Patent ID: 8412002

Claim:
A method for generating an all-in-focus image, for an image capturing device, the method comprising: obtaining a plurality of frames captured at a plurality of focal lengths, wherein the frames comprise a source frame and a plurality of reference frames; performing a motion compensation procedure on the frames; performing an edge detection procedure on the frames to determine whether each of pixel positions in the frames belongs to an edge; and for each of the pixel positions belonging to the edge, performing the steps of: calculating a characteristic similarity between the pixel position within the source frame and the pixel position within each of the reference frames; according to the characteristic similarities respectively corresponding to the reference frames, selecting a plurality of qualified reference frames among the reference frames; according to an edge sharpness corresponding to the pixel position within each of the source frame and the qualified reference frames, determining a first type color space component of the pixel position within an all-in-focus image; and according to a color brightness corresponding to the pixel position within each of the source frame and the qualified reference frames, determining a second type color space component of the pixel position within the all-in-focus image.