1. Field of the Invention
The present invention relates to digital image processing, and more particularly to a method and apparatus for detection and correction of red-eye defects and/or other artifacts in an acquired digital image.
2. Description of the Related Art
Redeye is the appearance of an unnatural reddish coloration of the pupils of a person appearing in an image captured by a camera with flash illumination. Redeye is caused by light from the flash reflecting off blood vessels in the person's retina and returning to the camera.
A large number of image processing techniques have been proposed to detect and correct redeye in color images. In general, these techniques typically are semi-automatic or automatic. Semi-automatic redeye detection techniques rely on human input. For example, in some semi-automatic redeye reduction systems, a user must manually identify to the system the areas of an image containing redeye before the defects can be corrected.
Many automatic redeye reduction systems rely on a preliminary face detection step before redeye areas are detected. A common automatic approach involves detecting faces in an image and, subsequently, detecting eyes within each detected face. After the eyes are located, redeye is identified based on shape, coloration, and brightness of image areas corresponding to the detected eye locations. In general, face-detection-based automatic redeye reduction techniques have high computation and memory resource requirements. In addition, most of the face detection algorithms are only able to detect faces that are oriented in an upright frontal view. These approaches generally do not detect faces that are rotated in-plane or out-of-plane with respect to the image plane.
A redeye filter process is illustrated in
U.S. Pat. No. 6,407,777 to inventor DeLuca discloses in-camera detection and correction of redeye pixels in an acquired digital image, while US published patent application 2002/0176623 to inventor Steinberg discloses automated real-time detection and correction of redeye defects optimized for handheld devices (each of these is assigned to the same assignee as the present application, as are U.S. application Ser. Nos. 10/919,226, filed Aug. 16, 2004, 10/772,092, filed Feb. 4, 2004, 10/772,767, filed Feb. 4, 2004, and 10/635,918, filed Aug. 5, 2003). US published patent applications 2005/0047655 and 2005/0047656 to Luo et al disclose techniques for detecting and correcting redeye in a digital image and in embedded systems, respectively. The aforementioned patent and published and unpublished patent applications are all hereby incorporated by reference.
Within an image acquisition subsystem such as is embodied in typical digital cameras, a peak computing load and resource requirements occur around the time of image acquisition. Upon receiving an image acquisition request from the user the main embedded processing system refines the image focus and exposure to achieve an optimal main acquired image. This image, in turn, is off-loaded from the main optical sensor of the camera and subjected to further image processing to convert it from its raw format (e.g. Bayer) to a conventional color space such as RGB or YCC. Finally the acquired image is compressed prior to saving it on a removable storage medium such as a compact flash or multimedia card.
The time taken by the camera to recover from the acquisition of a first image and reinitialize itself to capture a second image is referred to as the “click-to-click” time. This parameter is used in the comparison and marketing of modern digital cameras. It is desired for manufacturers to minimize this “click-to-click” time. Thus, it is desired that any additional image processing, such as redeye filtering, which is to be added to the main image acquisition chain should be highly optimized for speed of execution in order to minimize its impact on the click-to-click time of the main system. Such a redeye filter typically compromises its overall performance in terms of accuracy of detection of redeye defects and quality of image correction.
An alternative would be to wait until after the main image has been acquired and perform the redeye filtering at a later time when the camera may execute the filter as a background process, or to perform the redeye filtering off-camera on a desktop PC or printer. There can be drawbacks to this alternative approach, though. First, images are displayed on the acquiring device, immediately after acquisition, with uncorrected redeye defects. Second, when images are accessed in playback mode, there is a further delay while images are post-processed before an image can be displayed. Both drawbacks would create a negative impression on end users.
Further, as most digital cameras store images using lossy compression techniques there can be additional disadvantages with respect to image quality as images are decompressed and recompressed in order to perform redeye detection and correction processes in playback or background modes. Such loss of image quality may not become apparent until later when a user wishes to print an image and it is too late to reverse the process.
If redeye processing is delayed until the images are loaded onto another device, such as a desktop PC or printer, there can be further disadvantages. First, meta-data relating to the acquiring device and its state at the time the image was acquired may not be available to the redeye filter process. Second, this post-processing device performs redeye filtering on the entire image; so that for an embedded device such as a printer that may be relatively constrained in terms of CPU cycles and processing resources for its primary post-processing activity, it would be desirable to optimize the performance of the full redeye filter. It is generally desired to optimize the detection of red-eye defects in digital images for embedded image acquisition and processing systems.
A digital image acquisition device is provided. An imaging optic and detector is for acquiring digital images including one or more preview images and a main image. A face detector module is for analyzing the one or more preview images to ascertain information relating to candidate face regions therein. An image generating module is for programming the processor to generate a sub-sampled version of the main image. A first speed-optimized red-eye filter is for programming the processor to produce a first set of candidate red-eye regions in a sub-sampled version of the main image based on the candidate face region information provided by the face detector.
An image encoder is for encoding the acquired image. An image compressor is for compressing the main image.
An image store memory is for storing therein said encoded image in association with said first set of candidate red-eye regions for later image processing of the encoded image.
An analysis-optimized red eye filter is for later analysis of a full resolution version of the main image based in part on the previous analysis.
A display is for displaying an image processed by said first speed-optimized red-eye filter.
A signal connection is for transferring images to a PC or other microprocessor-based device, or both, for further image processing.
The face detector may include a search module for detecting candidate face regions and a tracking module for predicting and confirming candidate face regions.
The one or more preview images may include a sub-sampled version of an acquired image.
The candidate face region information includes (i) a list of one or more candidate face regions; (ii) a set of data associated with one or more candidate face regions and statistical data derived from a history of the one or more candidate face regions; or (iii) a predicted location for one or more candidate face regions; or (iv) combinations thereof.
a) illustrates a redeye process.
b) illustrates a redeye process according to a preferred embodiment.
c) illustrates a redeye process according to an alternative embodiment.
a) illustrates an embodiment within a digital image acquisition device.
b) illustrates an embodiment wherein analysis-optimized redeye filtering is performed on a separate device from an acquiring device.
a) illustrates a process according to an embodiment whereby a speed-optimized redeye detector is applied to a partially compressed DCT block image.
b) is a workflow diagram of an illustrative embodiment of an improved in-camera redeye detection component employing a redeye DCT prefilter.
c) is a workflow diagram of an illustrative embodiment of the redeye DCT prefilter.
d) illustrates segmentation of a redeye DCT prefilter.
e) shows a 4-DCT block neighborhood.
a) illustrates eye regions mapped onto a rectangular grid.
b) illustrates the approximate color which will be recorded by a DC coefficient of each DCT block after the image of
c), 4(d) and 4(e) illustrate DCT blocks from
a) illustrates an original defect region stored in a header and a corrected defect region applied to a main image body.
b) illustrates a corrected defect region stored in the header and the original defect region remaining uncorrected in the main image body.
c) illustrates an original defect region and at least one alternative corrected defect region stored in the header and the optimally determined corrected defect region applied to the main image body.
A two-stage redeye filtering process is provided whereby a speed optimized filter performs the initial segmentation of candidate redeye regions and optionally applies a speed-optimized set of falsing/verification filters to determine a first set of confirmed redeye regions for correction. Some of the candidate regions which are rejected during the first stage are recorded and re-analyzed during a second stage by an alternative set of analysis-optimized filters to determine a second set of confirmed redeye regions.
Optionally, the first set of confirmed redeye regions may be passed through the second stage analysis-optimized filters.
In an alternative embodiment, the second stage filter may incorporate an enhanced correction filter which may be optionally applied to the first set of confirmed redeye regions.
A process is provided including implementing a two-stage redeye filter wherein a first redeye filter process, which is optimized for speed, is combined with a second redeye process which is optimized for accurate image analysis. The advantages of a redeye filter implemented within a main image acquisition chain are combined with those of a redeye filter implemented in background/playback mode, while disadvantages generally associated with each of these two approaches are reduced or eliminated.
A red eye process in accordance with a preferred embodiment is illustrated in
Thus, in this embodiment the falsing & verification filters 106 generates a set of secondary candidate regions 109 in addition to the set of confirmed redeye regions 108. The set of secondary candidate regions may include members of the original candidate region set 104, which could be neither confirmed nor eliminated by the speed optimized redeye detection process 100. It may also include combined candidate regions in close proximity to each other.
This set of candidate regions 109 is saved either in a RAM buffer, or in non-volatile memory depending on the implementation of the embodiment. Where the data is saved in RAM (or volatile) memory, the image acquisition system applies the second stage redeye filter to the image prior to powering down. The preferred form of storage is in non-volatile memory, or on a removable media card. In other embodiments this data may be stored in the image header with the part-processed image itself.
In this embodiment, a second stage, analysis optimised redeye filter 101 is next applied to the secondary set of candidate regions 109. During the analysis optimized detection process 101, the saved candidate regions 109 are preferably further analyzed at a higher resolution than during the speed optimized process. Thus, the filter 101 includes an analysis optimized set of falsing and verification filters 116, which differ either in their nature or in their operating parameters from the falsing and verification filters 106 employed in the speed optimized analysis. Nonetheless, it will be appreciated that it may be useful to perform one or more intermediate stages of optimized analysis at increasing image resolutions. This will depend on the hardware capabilities of the imaging appliance and the resources available within the image processing subsystems of the imaging appliance.
Second stage analysis may occur in response to a variety of external events. For example, a user may initiate image playback causing this filter 101 to be applied. Alternatively, a camera may signal that it has been idle for a predetermined interval and thus background redeye processing may be initiated. Where a camera can determine its motion from auto-focus data, e.g., when a camera is idle such that image focus does not change for a predetermined interval and no user input is received, background image processing including stage-two redeye filtering may be initiated.
After a set of confirmed redeye regions 118 is determined by the second stage redeye filter 101, a correction filter (pixel modifier) 102 is applied and these corrected regions are merged 115 with the initial corrected image 112 to generate a final corrected image 113.
An alternative embodiment is illustrated in
a) illustrates an embodiment within a digital image acquisition device. The speed optimized redeye filter 411 may contains both detection 411-1, 411-2 & 411-4 and, optionally, correction 411-3 processes. Similarly, the analysis optimized redeye filter 412, which may operate as a background process 403, performs additional refinements to the initial determinations and corrections of the speed optimized filter 411. Data related to these initial determinations is provided by the redeye filter metadata 410-5 which is stored with the acquired image 410-2 in an image store 410.
b) illustrates a variation on the embodiment of
For an exemplary, non-exhaustive list of some typical filters that may be found in either the speed or analysis-optimized redeye filters 411, 412, see U.S. published application Ser. No. 10/976,336, filed Oct. 28, 2004, which is assigned to the same assignee as the present application and is hereby incorporated by reference.
In the embodiments above, speed optimized redeye detection 100 is preferably applied to a sub-sampled input image. The confirmed redeye regions 108 from this speed optimized redeye detection 100 are passed to a redeye correction module 102/102a. The corrected redeye image 112 can be displayed on a low-resolution viewing screen of a digital camera immediately after the image acquisition process providing the user with a redeye corrected image almost instantly. However, although this initial corrected image 112 may be adequately corrected, for example, where it is a portrait-style image in which a face occupies most of an image or where large high probability red-eye regions exist, it may not be adequately corrected for images including a large groups of persons, where the candidate redeye regions are smaller or less certain. Accordingly, the second analysis optimized redeye filtering process 101 is preferably implemented after image acquisition but prior to final image 113 display on a larger viewer, or image printing. The analysis optimized redeye detection process 101 and correction process 102 may be advantageously delayed until such high resolution viewing or printing is desired by the end user.
In the embodiments of
As in the case of
In the embodiment of
The regions output by the DCT prefilter 428, incorporated in the main image acquisition chain 401, can advantageously allow much of the DCT block stream to be bypassed without being processed when an image is subsequently corrected by a filter such as a background filter module 426. This allows either much faster or more detailed analysis and filtering of the DCT blocks which are determined to require processing by an analysis optimized redeye filter 406. Those skilled in the art will realize that further embodiments are possible which separate aspects of both the DCT prefilter and the otherwise conventional type redeye filter 406 between the main image acquisition chain, 401 and a background redeye detection and correction process 426.
b) shows in more detail the operation of the redeye DCT prefilter 428. This particular example illustrates how the DCT prefilter can integrate with the main image acquisition, processing and compression chain, 402, 404 and 408 of
In a second principle stage of the DCT prefilter 428, the DCT blocks are segmented and grouped 906 based on a plurality of criteria determined from the coefficients extracted at step 904. A region based analysis is performed 907 in order to determine the final candidate redeye groupings. It is next determined if there are any valid candidate grouping 908 and if not the normal JPEG compression process is resumed 408-2. If candidate regions are determined 908 then a bounding region is determined for each region 910 which is sufficiently large to include various eye-region features which may be used as part of a main redeye filter process 411/412 of
c) shows the region based analysis 907 of
After the calculations required for each criteria table have been completed 932 they are copied into temporary storage 933 and the prefilter algorithm will next perform a filtering and segmentation step 907 for each of the plurality of criteria tables. This particular step is further detailed in
This region-based analysis 936 is comprised of a number of alternative techniques which will be known to those skilled in the art. In particular, we mention that regions may be combined both in inclusive, exclusive and less frequently in mutually exclusive combinations 936-1. An alternative approach to region-based analysis will employ template matching 936-2. An example is provided in U.S. Pat. No. 5,805,727 to Nakano, which is hereby incorporated by reference. A sub-region is matched within a DCT image using both coarse and fine template matching techniques based on the DC coefficients of the DCT blocks within the image.
A component of the region based analysis is a re-segmentation engine 92-6 which is responsible for analyzing larger regions which may, in fact, be two distinct overlapping regions, or clusters of smaller regions which may, in fact, be a single larger region. Then once the region based analysis 936 is completed a final LUT containing the list of determined flash defect candidate regions is obtained and written to system memory.
d) shows the segmentation step 907 of the redeye DCT prefilter in more detail. The next preprocessed criteria table to be processed by the segmentation process is first loaded 950 and the labeling LUT for the region grouping process is initialized 952. Next the current DCT block and DCT block neighborhoods are initialized 954.
e) shows a diagrammatic representation of a 4-DCT block neighborhood 992 containing the three upper DCT blocks and the DCT block to the left of the current DCT block 994, which is cross-hatched in
Returning to step 954 we see that after initialization is completed the next step for the workflow of
A number of alternative techniques can advantageously be adapted for use within the redeye DCT prefilter. U.S. Pat. No. 5,949,904 to Delp discloses querying image colors within a DCT block. In particular it allows the determination of color within the DCT block from the DC coefficient of the DCT alone. Thus from a knowledge of the DC coefficients alone color matching can be achieved. U.S. Pat. No. 6,621,867 to Sazzad et al discloses determining the presence of edges within DCT blocks based on differences between the DC coefficients in neighbouring DCT blocks.
Now additional image qualities such as texture and image sharpness/blur can be determined through an analysis of additional AC components within a DCT block. Examples of such analysis techniques are described in US patent application No. 2004/0120598 to Feng and US patent application No. 2004/0057623 to Schuhurke et al.
Alternative DCT block segmentation techniques may be employed in other embodiments, and specifically techniques described in U.S. Pat. No. 6,407,777 to DeLuca, U.S. Pat. No. 6,873,743 to Steinberg, and US patent applications 2005/0047655 and 2005/0047656 to Luo et al. All of these patents and published applications are hereby incorporated by reference.
In
Next, in
A potential disadvantage in the embodiment of
Accordingly,
Various means of sensing user activity may be alternatively employed. One example includes detecting camera motion and optionally correlating this with other in-camera functions such as an autofocus subsystem and a user-interface subsystem. A camera may also incorporate a power-saving mode which determines that the camera has been inactive long enough to disable certain subsystems. When such a mode is activated by user inactivity then additional background image processing can be initiated without interfering with the use of the appliance by the user.
Returning to
After an image is analyzed by this speed optimized redeye filter 411 it is subsequently compressed 427-1 and stored 410. In addition data relating to the location of candidate redeye regions and false positives is recorded and associated with the stored image.
Now when the camera can initiate background processing, as described above, or when the user enters playback mode and selects an image for viewing it will be partially decompressed 433 from JPEG to DCT block form. As this decompression step is lossless there is no loss of quality to the main image which is temporarily stored in memory and passed to a DCT region decompressor 430. This DCT region decompressor uses the data stored and associated with the original image to determine the specific DCT blocks which contain candidate redeye regions, and, optionally, false positive regions which may benefit from additional detection processing if sufficient time & system resources are available.
Each decompressed DCT region is then incrementally filtered by one or more redeye filters to determine corrections which should be applied to said DCT image block.
In certain embodiments, DCT blocks may be decompressed to bitmap format and filtered as a pixel block. In other embodiments adjacent, non-candidate DCT blocks may be included in the decompression 430 and filtering 412 processes. Once a decompressed DCT block region, which may include multiple DCT blocks, has been corrected by the redeye filter 412 then the corrected DCT image segment is passed onto a DCT block matching module 416 which, in addition to checking the alignment of DCT blocks will also check the integration of the corrected DCT blocks within the partially decompressed and temporarily stored DCT block image. When all candidate DCT blocks and any adjacent DCT blocks included in the redeye filter analysis have been corrected they are overwritten onto the partially decompressed and temporarily stored DCT block image by a DCT region overwriter 418 module. The partially decompressed and temporarily stored DCT block image is next passed to the DCT to JPEG image compression module 427-1 and is losslessly compressed back to JPEG format.
Note that in this way the only regions of the image which are decompressed using lossy techniques are those identified by the speed optimized redeye filter 411 in the image acquisition chain. As these image regions are to be corrected the effect of lossy decompression and recompression on them will thus be negligible.
Several further embodiments can be identified. These include (i) saving a copy of the original defect region prior to overwriting the DCT blocks which contain the image defect in the temporary copy of the DCT image. This alternative embodiment supports lossless restoration of the original image. The saved original DCT block region containing the defect can be stored within the header of the JPEG image. In U.S. Pat. No. 6,298,166 to Ratnakar et al., watermark data is incorporated in the image. Thus the corrected image can contain a copy of any original uncorrected regions. Alternatively (ii) multiple alternative correction algorithms can be employed and these may be temporarily copied for later storage in the JPEG header for later selection by an end user through a user interface, either on the camera or subsequently in a computer based image processing application. The overwriting step is optional. If it is used, then certain image analysis criteria can be applied as additional processing either immediately prior to overwriting, or as an integral part of detecting or correcting red-eye or combinations thereof.
Further aspects of these embodiments are illustrated in
In other embodiments, the performance of the fast red-eye filter can be further improved by selectively applying it to a limited set of regions within the acquired image. As it is generally impractical to implement extensive image analysis during the main image acquisition chain, these regions are preferably determined prior to the initiation of the main image acquisition.
One convenient approach to pre-determine image regions which have a high probability of containing red-eye candidates is to perform pre-processing on a set of preview images. Many state-of-art digital cameras acquire such a stream of images captured at video rates of 15-30 frames per second (fps) at a lower resolution than that provided by the main image acquisition architecture and/or programming. A set of 320×240, or QVGA images is typical of many consumer cameras and the size and frame-rate of this preview images stream can normally be adjusted within certain limits.
In one embodiment, as illustrated in
Thus in normal operation only the output(s) from the second operational mode of a face tracker algorithm will be available after every frame of the preview image stream. There may be three principle outputs from this second mode: (i) a list of candidate face regions which are confirmed to still contain faces; and/or (ii) a set of data associated with each such confirmed face region including its location within that frame of the image and various additional data determined from a statistical analysis of the history of said confirmed face region; and/or (iii) a predicted location for each such confirmed face region in the next frame of the preview image stream. If item (ii) is used, item (iii) can be optional as sufficient data may be provided by item (ii) for a determination of predicted location.
These outputs from the preview face detector (600) enable the speed optimized red-eye detector 411 to be applied selectively to face regions (601) where it is expected that a red-eye defect will be found.
Techniques are known wherein a face detector is first applied to an image prior to the application of a red-eye filter (e.g. US 20020172419 to Lin et al; US 20020126893 to Held et al; US 20050232490 to Itagaki et al and US 20040037460 to Luo et al.). We emphasize that, under normal circumstances, there is not sufficient time available during the main image acquisition chain, which is operable within a digital camera to allow the application of face detector prior to the application of a red-eye filter. The present embodiment overcomes this disadvantage of the prior art by employing the predictive output of a face tracker module (600). Although the size of the predicted region will typically be larger than the size of the corresponding face region, it is still significantly smaller than the size of the entire image. Thus, advantages of faster and more accurate detection can be achieved within a digital camera or embedded image acquisition system without the need to operate a face detector (600) within the main image acquisition chain.
Note that where multiple face candidate regions (601) are tracked, then multiple predicted regions will have the speed-optimized red-eye filter applied.
The present invention is not limited to the embodiments described above herein, which may be amended or modified without departing from the scope of the present invention as set forth in the appended claims, and structural and functional equivalents thereof.
In methods that may be performed according to preferred embodiments herein and that may have been described above and/or claimed below, the operations have been described in selected typographical sequences. However, the sequences have been selected and so ordered for typographical convenience and are not intended to imply any particular order for performing the operations.
In addition, all references cited above herein, in addition to the background and summary of the invention sections, are hereby incorporated by reference into the detailed description of the preferred embodiments as disclosing alternative embodiments and components.
This application is a Division of U.S. patent application Ser. No. 11/462,035, filed Aug. 2, 2006, which is a Continuation-in-Part of U.S. patent application Ser. No. 11/282,954, filed Nov. 18, 2005, now U.S. Pat. No. 7,689,009, which is hereby incorporated by reference.
Number | Date | Country | |
---|---|---|---|
Parent | 11462035 | Aug 2006 | US |
Child | 12952171 | US |
Number | Date | Country | |
---|---|---|---|
Parent | 11282954 | Nov 2005 | US |
Child | 11462035 | US |