Digital imaging system and method
Methods and systems for providing multi-plane viewing of a digital image of a subject matter which do not require viewing multiple images taken at multiple image planes. Pseudo-focus images are generated from a flattened, merged image of a three-dimensional subject matter. The merged image is generated by merging a plurality of images taken at different focal planes of the subject matter which form a through-focus image stack. The merged image comprises the best focus pixels originating from different respective image planes. A depth map is also generated from the multiple images which associates each best focus pixel with a pixel depth value. A plane of interest (POI) is selected from the image planes. A pseudo-focus image is then generated using the merged image and pixel depth map by generating a blurred focus value for each best focus pixel based on the focus offset of each pixel from the POI.
1 . A method for generating a pseudo-focus image of a digital image of a subject matter having a three-dimensional volume, comprising:
accessing: (1) a merged image of the subject matter having the three-dimensional volume, the merged image comprising an image generated from best focus pixels selected from a plurality of images of the subject matter which form a through-focus image stack, the best focus pixels originating from different respective image planes at different respective depths of the subject matter, each image plane being one of a plurality of image planes which stack up to form at least a partial depth of the subject matter; and (2) a pixel depth map associating each best focus pixel with a respective image plane corresponding to a depth value at which each best focus pixel originated within the subject matter;
selecting a first plane of interest (POI) from the plurality of image planes;
calculating a first pixel focus offset for each best focus pixel equal to a difference between a depth value of the first POI and the respective depth value for each best focus pixel;
generating a first blurred focus value for each best focus pixel based on the respective first pixel focus offset; and
generating a first pseudo-focus image of the merged image for the first POI composed of the first blurred focus values for each best focus pixel,
wherein generating the first blurred focus value for each best focus pixel based on the respective pixel focus offset, comprises:
generating a pixel focus offset array having a pixel focus offset for each best focus pixel equal to the difference between the depth value of the first POI and the respective depth value of each best focus pixel, the pixel focus offset array defining a range of pixel focus offsets within which a plurality of focus offset values are defined, and
generating a plurality of focus offset images corresponding to each first focus offset within the range of the pixel focus offset array by: (1) generating a blurred focus value for each of the focus offset values, and (2) for each focus offset value, applying a respective blurred focus value to the merged image, and
wherein generating the first pseudo-focus image of the merged image for the first POI composed of the first blurred focus values for each best focus pixel, comprises:
generating a focus mask for each image plane, wherein each focus mask contains all of the best focus pixels associated with the respective image plane; and
summing the products of (1) the focus mask for a respective image plane and (2) the focus offset image having the focus offset value corresponding to the respective image plane, for each image plane of the plurality of image planes.
2 . The method of claim 1 , further comprising:
displaying the first pseudo-focus image on a display device.
3 . The method of claim 2 , wherein the display device is selected from the group consisting of: an LCD display; an LED display; an OLED display; and a computer monitor.
4 . The method of claim 1 , further comprising:
selecting a second POI from the plurality of image planes different from the first POI;
calculating a second pixel focus offset for each best focus pixel equal to the difference between the depth value of the second POI and the respective depth value for each best focus pixel;
generating a second blurred focus value for each best focus pixel based on the respective second pixel focus offset; and
generating a second pseudo-focus image of the merged image for the second POI composed of the second blurred focus values for each best focus pixel.
5 . The method of claim 4 , further comprising:
displaying the second pseudo-focus image on a display device.
6 . The method of claim 1 , wherein the plurality of images of the subject matter used to generate the merged image are captured with a camera having an optical axis which is orthogonal to a slide surface to which the subject matter is affixed.
7 . The method of claim 1 , wherein the first blurred focus value for each best focus pixel is generated using a two-dimensional Gaussian blur function.
8 . The method of claim 7 , wherein two-dimensional Gaussian blur function utilizes a Gaussian blur radius based upon a depth of field of a camera system used to obtain the plurality of images of the subject matter.
9 . The method of claim 8 , wherein the Gaussian blur radius is also based upon an effective numerical aperture of the camera system.
10 . The method of claim 1 , wherein the merged image is an RGB digital image file and the pixel depth map is stored in a channel of RGB digital image file.
11 . The method of claim 1 , wherein the merged image is stored as a digital image file and the pixel depth map is stored in a separate file from the digital image file.