The present invention relates to forming a refocused image from at least two scene captured images with different focus settings.
A desirable photographic effect is “bokeh”, the strong blurring of objects that are not the main subject of the picture. This is an aesthetic quality of blur that is not easily achieved with digital cameras that use low-cost lenses. The general solution in the low-cost digital camera arena is to capture two or more images with different focus setting of the lens and to digitally merge, or “fuse”, the images to produce a bokeh effect. There are many descriptions of systems that capture multiple images with different focus settings (a “through-focus” series) and then merging them to produce desired images. In U.S. Patent Application Publication 2007/0035712 Gassner, et al., teach capturing a through-focus series of images, computing image contrast for each image, and then composing a composite image from the regions of the through-focus images with highest contrast. In U.S. Patent Application Publication 2009/0121027 Nadabar describes another way of combining the best portions of each image in a through-focus series into a desired composite image. Finally, Mrityunjay Kumar, in “Optimal image fusion using the Rayleigh quotient,” IEEE Sensors Applications Symposium, February 2009, describes fusing images from a through-focus series in such a way as to maximize the energy of the resulting image. The difficulty with all these approaches is that the segmentation of the subject of interest from the rest of the objects in the scene based on image contrast and other energy-based arguments will only find the objects that are the most in-focus in the through-focus series. The important additional cue of subject distance is not directly used. Additionally, with the previous methods only one composite image is generated from the through-focus series where, in fact, it is possible to generate several different images, each with different main subjects with their own bokeh effects from the same through-focus series. In this last regard, what is missing is a way to automatically produce one or more refocused images with a given main subject in-focus and the rest of the scene aesthetically out-of-focus from a through-focus series of captures.
The present invention represents a method of providing a refocused image, comprising using a processor to perform the steps of
(a) acquiring at least two captured images of a scene with differing focus settings;
(b) using the at least two captured images to provide an all-in-focus image;
(c) generating a range map from the at least two captured images;
(d) locating a region-of-interest (ROI) window from the range map; and
(e) providing a refocused image from the all-in-focus image and the region-of-interest (ROI) window.
This invention has the advantage that the ROI window is automatically located based on object distances in the scene without the user needing to identify the objects of interest manually.
It has the additional advantage of being able to automatically produce as many differently refocused images as there are captured images with different focus settings minus one, each with a different range of objects in focus and all after the set of captured images has been acquired.
This and other aspects, objects, features, and advantages of the present invention will be more clearly understood and appreciated from a review of the following detailed description of the preferred embodiments and appended claims, and by reference to the accompanying drawings.
It is to be understood that the attached drawings are for purposes of illustrating the concepts of the invention and may not be to scale.
In the following description, a preferred embodiment of the present invention will be described in terms that would ordinarily be implemented as a software program. Those skilled in the art will readily recognize that the equivalent of such software can also be constructed in hardware. Because image manipulation algorithms and systems are well known, the present description will be directed in particular to algorithms and systems forming part of, or cooperating more directly with, the system and method in accordance with the present invention. Other aspects of such algorithms and systems, and hardware or software for producing and otherwise processing the image signals involved therewith, not specifically shown or described herein, can be selected from such systems, algorithms, components and elements known in the art. Given the system as described according to the invention in the following materials, software not specifically shown, suggested or described herein that is useful for implementation of the invention is conventional and within the ordinary skill in such arts.
Still further, as used herein, a computer program for performing the method of the present invention can be stored in a computer readable storage medium, which can include, for example; magnetic storage media such as a magnetic disk (such as a hard drive or a floppy disk) or magnetic tape; optical storage media such as an optical disc, optical tape, or machine readable bar code; solid state electronic storage devices such as random access memory (RAM), or read only memory (ROM); or any other physical device or medium employed to store a computer program having instructions for controlling one or more computers to practice the method according to the present invention.
The invention is inclusive of combinations of the embodiments described herein. References to “a particular embodiment” and the like refer to features that are present in at least one embodiment of the invention. Separate references to “an embodiment” or “particular embodiments” or the like do not necessarily refer to the same embodiment or embodiments; however, such embodiments are not mutually exclusive, unless so indicated or as are readily apparent to one of skill in the art. The use of singular or plural in referring to the “method” or “methods” and the like is not limiting. It should be noted that, unless otherwise explicitly noted or required by context, the word “or” is used in this disclosure in a non-exclusive sense.
Because digital cameras employing imaging devices and related circuitry for signal capture and processing, and display are well known, the present description will be directed in particular to elements forming part of, or cooperating more directly with, the method and apparatus in accordance with the present invention. Elements not specifically shown or described herein are selected from those known in the art. Certain aspects of the embodiments to be described are provided in software. Given the system as shown and described according to the invention in the following materials, software not specifically shown, described or suggested herein that is useful for implementation of the invention is conventional and within the ordinary skill in such arts.
The following description of a digital camera will be familiar to one skilled in the art. It will be obvious that there are many variations of this embodiment that are possible and are selected to reduce the cost, add features or improve the performance of the camera.
In some embodiments, the digital camera 10 captures both motion video images and still images. The digital camera 10 can also include other functions, including, but not limited to, the functions of a digital music player (e.g. an MP3 player), a mobile telephone, a GPS receiver, or a programmable digital assistant (PDA).
The digital camera 10 includes a lens 4 having an adjustable aperture and adjustable shutter 6. In a preferred embodiment, the lens 4 is a zoom lens and is controlled by zoom and focus motor drives 8. The lens 4 focuses light from a scene (not shown) onto an image sensor 14, for example, a single-chip color CCD or CMOS image sensor. The lens 4 is one type optical system for forming an image of the scene on the image sensor 14. In other embodiments, the optical system can use a fixed focal length lens with either variable or fixed focus.
The output of the image sensor 14 is converted to digital form by Analog Signal Processor (ASP) and Analog-to-Digital (A/D) converter 16, and temporarily stored in buffer memory 18. The image data stored in buffer memory 18 is subsequently manipulated by a processor 20, using embedded software programs (e.g. firmware) stored in firmware memory 28. In some embodiments, the software program is permanently stored in firmware memory 28 using a read only memory (ROM). In other embodiments, the firmware memory 28 can be modified by using, for example, Flash EPROM memory. In such embodiments, an external device can update the software programs stored in firmware memory 28 using a wired interface 38 or a wireless modem 50. In such embodiments, the firmware memory 28 can also be used to store image sensor calibration data, user setting selections and other data which must be preserved when the camera is turned off. In some embodiments, the processor 20 includes a program memory (not shown), and the software programs stored in the firmware memory 28 are copied into the program memory before being executed by the processor 20.
It will be understood that the functions of processor 20 can be provided using a single programmable processor or by using multiple programmable processors, including one or more digital signal processor (DSP) devices. Alternatively, the processor 20 can be provided by custom circuitry (e.g., by one or more custom integrated circuits (ICs) designed specifically for use in digital cameras), or by a combination of programmable processor(s) and custom circuits. It will be understood that connectors between the processor 20 from some or all of the various components shown in
The processed images are then stored using the image memory 30. It is understood that the image memory 30 can be any form of memory known to those skilled in the art including, but not limited to, a removable Flash memory card, internal Flash memory chips, magnetic memory, or optical memory. In some embodiments, the image memory 30 can include both internal Flash memory chips and a standard interface to a removable Flash memory card, such as a Secure Digital (SD) card. Alternatively, a different memory card format can be used, such as a micro SD card, Compact Flash (CF) card, MultiMedia Card (MMC), xD card or Memory Stick.
The image sensor 14 is controlled by a timing generator 12, which produces various clocking signals to select rows and pixels and synchronizes the operation of an ASP and A/D converter 16. The image sensor 14 can have, for example, 12.4 megapixels (4088×3040 pixels) in order to provide a still image file of approximately 4000×3000 pixels. To provide a color image, the image sensor is generally overlaid with a color filter array, which provides an image sensor having an array of pixels that include different colored pixels. The different color pixels can be arranged in many different patterns. As one example, the different color pixels can be arranged using the well-known Bayer color filter array, as described in commonly assigned U.S. Pat. No. 3,971,065 to Bayer, the disclosure of which is incorporated herein by reference. As a second example, the different color pixels can be arranged as described in commonly assigned U.S. Patent Application Publication 2005/191729 to Compton and Hamilton, the disclosure of which is incorporated herein by reference. These examples are not limiting, and many other color patterns can be used.
It will be understood that the image sensor 14, timing generator 12, and ASP and A/D converter 16 can be separately fabricated integrated circuits, or they can be fabricated as a single integrated circuit as is commonly done with CMOS image sensors. In some embodiments, this single integrated circuit can perform some of the other functions shown in
The image sensor 14 is effective when actuated in a first mode by timing generator 12 for providing a motion sequence of lower resolution sensor image data, which is used when capturing video images and also when previewing a still image to be captured, in order to compose the image. This preview mode sensor image data can be provided as HD resolution image data, for example, with 1280×720 pixels, or as VGA resolution image data, for example, with 640×480 pixels, or using other resolutions which have significantly columns and rows of data, compared to the resolution of the image sensor.
The preview mode sensor image data can be provided by combining values of adjacent pixels having the same color, or by eliminating some of the pixels values, or by combining some color pixels values while eliminating other color pixel values. The preview mode image data can be processed as described in commonly assigned U.S. Pat. No. 6,292,218 to Parulski, et al which is incorporated herein by reference.
The image sensor 14 is also effective when actuated in a second mode by timing generator 12 for providing high resolution still image data. This final mode sensor image data is provided as high resolution output image data, which for scenes having a high illumination level includes all of the pixels of the image sensor, and can be, for example, a 12 megapixel final image data having 4000×3000 pixels. At lower illumination levels, the final sensor image data can be provided by “binning” some number of like-colored pixels on the image sensor, in order to increase the signal level and thus the “ISO speed” of the sensor. The zoom and focus motor drivers 8 are controlled by control signals supplied by the processor 20, to provide the appropriate focal length setting and to focus the scene onto the image sensor 14. The exposure level of the image sensor 14 is controlled by controlling the f/number and exposure time of the adjustable aperture and adjustable shutter 6, the exposure period of the image sensor 14 via the timing generator 12, and the gain (i.e., ISO speed) setting of the ASP and A/D converter 16. The processor 20 also controls a flash 2 which can illuminate the scene.
The lens 4 of the digital camera 10 can be focused in the first mode by using “through-the-lens” autofocus, as described in commonly-assigned U.S. Pat. No. 5,668,597 to Parulski et al., which is incorporated herein by reference. This is accomplished by using the zoom and focus motor drivers 8 to adjust the focus position of the lens 4 to a number of positions ranging between a near focus position to an infinity focus position, while the processor 20 determines the closest focus position which provides a peak sharpness value for a central portion of the image captured by the image sensor 14. The focus distance which corresponds to the closest focus position can then be utilized for several purposes, such as automatically setting an appropriate scene mode, and can be stored as metadata in the image file, along with other lens and camera settings.
The processor 20 produces menus and low resolution color images that are temporarily stored in a display memory 36 and are displayed on an image display 32. The image display 32 is typically an active matrix color liquid crystal display (LCD), although other types of displays, such as organic light emitting diode (OLED) displays, can be used. A video interface 44 provides a video output signal from the digital camera 10 to a video display 46, such as a flat panel HDTV display. In preview mode, or video mode, the digital image data from buffer memory 18 is manipulated by processor 20 to form a series of motion preview images that are displayed, typically as color images, on the image display 32. In review mode, the images displayed on the image display 32 are produced using the image data from the digital image files stored in image memory 30.
The graphical user interface displayed on the image display 32 is controlled in response to user input provided by user controls 34. The user controls 34 are used to select various camera modes, such as video capture mode, still capture mode, and review mode, and to initiate capture of still images, recording of motion images. The user controls 34 are also used to set user processing preferences, and to choose between various photography modes based on scene type and taking conditions. In some embodiments, various camera settings can be set automatically in response to analysis of preview image data, audio signals, or external signals such as GPS, weather broadcasts, or other available signals.
In some embodiments, when the digital camera 10 is in a still photography mode the above-described preview mode is initiated when the user partially depresses a shutter button, which is one of the user controls 34, and the still image capture mode is initiated when the user fully depresses the shutter button. The user controls 34 are also used to turn on the digital camera 10, control the lens 4, and initiate the picture taking process. User controls 34 typically include some combination of buttons, rocker switches, joysticks, or rotary dials. In some embodiments, some of the user controls 34 are provided by using a touch screen overlay on the image display 32. In other embodiments, the user controls 34 can include a way to receive input from the user or an external device via a tethered, wireless, voice activated, visual or other interface. In other embodiments, additional status displays or images displays can be used.
The camera modes that can be selected using the user controls 34 include a “timer” mode. When the “timer” mode is selected, a short delay (e.g., 10 seconds) occurs after the user fully presses the shutter button, before the processor 20 initiates the capture of a still image.
An audio codec 22 connected to the processor 20 receives an audio signal from a microphone 24 and provides an audio signal to a speaker 26. These components can be used to record and playback an audio track, along with a video sequence or still image. If the digital camera 10 is a multi-function device such as a combination camera and mobile phone, the microphone 24 and the speaker 26 can be used for telephone conversation.
In some embodiments, the speaker 26 can be used as part of the user interface, for example to provide various audible signals which indicate that a user control has been depressed, or that a particular mode has been selected. In some embodiments, the microphone 24, the audio codec 22, and the processor 20 can be used to provide voice recognition, so that the user can provide a user input to the processor 20 by using voice commands, rather than user controls 34. The speaker 26 can also be used to inform the user of an incoming phone call. This can be done using a standard ring tone stored in firmware memory 28, or by using a custom ring-tone downloaded from a wireless network 58 and stored in the image memory 30. In addition, a vibration device (not shown) can be used to provide a silent (e.g., non audible) notification of an incoming phone call.
The processor 20 also provides additional processing of the image data from the image sensor 14, in order to produce rendered sRGB image data which is compressed and stored within a “finished” image file, such as a well-known Exif-JPEG image file, in the image memory 30.
The digital camera 10 can be connected via the wired interface 38 to an interface/recharger 48, which is connected to a computer 40, which can be a desktop computer or portable computer located in a home or office. The wired interface 38 can conform to, for example, the well-known USB 2.0 interface specification. The interface/recharger 48 can provide power via the wired interface 38 to a set of rechargeable batteries (not shown) in the digital camera 10.
The digital camera 10 can include the wireless modem 50, which interfaces over a radio frequency band 52 with the wireless network 58. The wireless modem 50 can use various wireless interface protocols, such as the well-known Bluetooth wireless interface or the well-known 802.11 wireless interface. The computer 40 can upload images via the Internet 70 to a photo service provider 72, such as the Kodak EasyShare Gallery. Other devices (not shown) can access the images stored by the photo service provider 72.
In alternative embodiments, the wireless modem 50 communicates over a radio frequency (e.g. wireless) link with a mobile phone network (not shown), such as a 3GSM network, which connects with the Internet 70 in order to upload digital image files from the digital camera 10. These digital image files can be provided to the computer 40 or the photo service provider 72.
The color sensor data 100 which has been digitally converted by the ASP and A/D converter 16 is manipulated by a white balance step 95. In some embodiments, this processing can be performed using the methods described in commonly-assigned U.S. Pat. No. 7,542,077 to Miki, the disclosure of which is herein incorporated by reference. The white balance can be adjusted in response to a white balance setting 90, which can be manually set by a user, or which can be automatically set by the digital camera 10.
The color image data is then manipulated by a noise reduction step 105 in order to reduce noise from the image sensor 14. In some embodiments, this processing can be performed using the methods described in commonly-assigned U.S. Pat. No. 6,934,056 to Gindele et al, the disclosure of which is herein incorporated by reference. The level of noise reduction can be adjusted in response to an ISO setting 110, so that more filtering is performed at higher ISO exposure index setting.
The color image data is then manipulated by a demosaicking step 115, in order to provide red, green and blue (RGB) image data values at each pixel location. Algorithms for performing the demosaicking step 115 are commonly known as color filter array (CFA) interpolation algorithms or “deBayering” algorithms. In one embodiment of the present invention, the demosaicking step 115 can use the luminance CFA interpolation method described in commonly-assigned U.S. Pat. No. 5,652,621 to Adams et al., the disclosure of which is incorporated herein by reference. The demosaicking step 115 can also use the chrominance CFA interpolation method described in commonly-assigned U.S. Pat. No. 4,642,678 to Cok, the disclosure of which is herein incorporated by reference.
In some embodiments, the user can select between different pixel resolution modes, so that the digital camera can produce a smaller size image file. Multiple pixel resolutions can be provided as described in commonly-assigned U.S. Pat. No. 5,493,335 to Parulski et al., the disclosure of which is herein incorporated by reference. In some embodiments, a resolution mode setting 120 can be selected by the user to be full size (e.g. 3,000×2,000 pixels), medium size (e.g. 1,500×1000 pixels) or small size (750×500 pixels).
The color image data is color corrected in color correction step 125. In some embodiments, the color correction is provided using a 3×3 linear space color correction matrix, as described in commonly-assigned U.S. Pat. No. 5,189,511 to Parulski, et al., the disclosure of which is incorporated herein by reference. In some embodiments, different user-selectable color modes can be provided by storing different color matrix coefficients in firmware memory 28 of the digital camera 10. For example, four different color modes can be provided, so that the color mode setting 130 is used to select one of the following color correction matrices:
Setting 1 (normal color reproduction)
Setting 2 (saturated color reproduction)
Setting 3 (de-saturated color reproduction)
Setting 4 (monochrome)
In other embodiments, a three-dimensional lookup table can be used to perform the color correction step 125.
The color image data is also manipulated by a tone scale correction step 135. In some embodiments, the tone scale correction step 135 can be performed using a one-dimensional look-up table as described in U.S. Pat. No. 5,189,511, cited earlier. In some embodiments, a plurality of tone scale correction look-up tables is stored in the firmware memory 28 in the digital camera 10. These can include look-up tables which provide a “normal” tone scale correction curve, a “high contrast” tone scale correction curve, and a “low contrast” tone scale correction curve. A user selected contrast setting 140 is used by the processor 20 to determine which of the tone scale correction look-up tables to use when performing the tone scale correction step 135.
The color image data is also manipulated by an image sharpening step 145. In some embodiments, this can be provided using the methods described in commonly-assigned U.S. Pat. No. 6,192,162 to Hamilton, et al., the disclosure of which is incorporated herein by reference. In some embodiments, the user can select between various sharpening settings, including a “normal sharpness” setting, a “high sharpness” setting, and a “low sharpness” setting. In this example, the processor 20 uses one of three different edge boost multiplier values, for example 2.0 for “high sharpness”, 1.0 for “normal sharpness”, and 0.5 for “low sharpness” levels, responsive to a sharpening setting 150 selected by the user of the digital camera 10.
The color image data is also manipulated by an image compression step 155. In some embodiments, the image compression step 155 can be provided using the methods described in commonly-assigned U.S. Pat. No. 4,774,574 to Daly et al., the disclosure of which is incorporated herein by reference. In some embodiments, the user can select between various compression settings. This can be implemented by storing a plurality of quantization tables, for example, three different tables, in the firmware memory 28 of the digital camera 10. These tables provide different quality levels and average file sizes for the compressed digital image file 180 to be stored in the image memory 30 of the digital camera 10. A user selected compression mode setting 160 is used by the processor 20 to select the particular quantization table to be used for the image compression step 155 for a particular image.
The compressed color image data is stored in the digital image file 180 using a file formatting step 165. The digital image file 180 can include various metadata 170. Metadata 170 is any type of information that relates to the digital image, such as the model of the camera that captured the image, the size of the image, the date and time the image was captured, and various camera settings, such as the lens focal length, the exposure time and f-number of the lens, and whether or not the camera flash fired. In a preferred embodiment, all of this metadata 170 is stored using standardized tags within the well-known Exif-JPEG still image file format. In a preferred embodiment of the present invention, the metadata 170 includes information about various camera settings 185, including the photography mode settings 175.
The present invention will now be described with reference to
In
In Equation 5, m is the minimum code value, M is the maximum code value, t1 and t2 are threshold values, and A is the weighted average. For an 8-bit code values range (0-255), appropriate threshold values are t1=64 and t2=192. The weighted average, A, becomes the all-in-focus image 204 code value for the given pixel location.
In
In Equation 6 f1 and f2 are the code values for a given pixel location from two through-focus images 200 (
The low-pass difference image threshold block 232 thresholds the low-pass difference image 230 into three regions using a 2% histogram penetration at both ends of the code value range. The pixel code values in the lowest 2% of the code value distribution in the low-pass difference image 230 are assigned to the “close” category in the range map 208 (
In
In Equation 8 rm,n is the range map 208 (
In
In Equation 9 the kernel coefficients are indexed from (−50,−50) in the upper left to (50,50) in the lower right. Braces, { }, mean to round to the nearest integer. H is the resulting low-pass kernel coefficient. In an alternate embodiment the computation of the all-in-focus filtering block 244 is replaced with an additional through-focus image 200 (
Ri,j=Wi,jAi,j+(1−Wi,j)Li,j (10)
In Equation 10 Wi,j is the ROI window 212 (
A computer program product can include one or more storage medium, for example; magnetic storage media such as magnetic disk (such as a floppy disk) or magnetic tape; optical storage media such as optical disk, optical tape, or machine readable bar code; solid-state electronic storage devices such as random access memory (RAM), or read-only memory (ROM); or any other physical device or media employed to store a computer program having instructions for controlling one or more computers to practice the method according to the present invention.
The invention has been described in detail with particular reference to certain preferred embodiments thereof, but it will be understood that variations and modifications can be effected within the spirit and scope of the invention.
Number | Name | Date | Kind |
---|---|---|---|
3971065 | Bayer | Jul 1976 | A |
4642678 | Cok | Feb 1987 | A |
4774574 | Daly et al. | Sep 1988 | A |
5189511 | Parulski et al. | Feb 1993 | A |
5282045 | Mimura et al. | Jan 1994 | A |
5493335 | Parulski et al. | Feb 1996 | A |
5652621 | Adams | Jul 1997 | A |
5668597 | Parulski et al. | Sep 1997 | A |
6192162 | Hamilton, Jr. et al. | Feb 2001 | B1 |
6292218 | Parulski et al. | Sep 2001 | B1 |
6934056 | Gindelle | Aug 2005 | B2 |
7542077 | Miki | Jun 2009 | B2 |
20030080974 | Grosvenor et al. | May 2003 | A1 |
20040080661 | Afseniu et al. | Apr 2004 | A1 |
20050191729 | Kaczmarek et al. | Sep 2005 | A1 |
20070024931 | Compton | Feb 2007 | A1 |
20070035712 | Gassner et al. | Feb 2007 | A1 |
20080219654 | Border et al. | Sep 2008 | A1 |
20080247602 | Fields et al. | Oct 2008 | A1 |
20090121027 | Nadabar | May 2009 | A1 |
20110110560 | Adhikari | May 2011 | A1 |
Number | Date | Country |
---|---|---|
716179 | May 2007 | KR |
2010124070 | Oct 2010 | WO |
Entry |
---|
Mrityunjay Kumar, Optimal image fusion using the Rayleigh quotient, IEEE Sensors Applications Symposium, Feb. 2009. |
Number | Date | Country | |
---|---|---|---|
20120070097 A1 | Mar 2012 | US |