The invention relates generally to the field of digital image processing, and in particular to red eye detection in color digital images by digital cameras.
Red eye in color digital images occurs when a flash illumination is reflected off a subject's retina and is captured by a camera. For humans this is usually a red color while for animals it is usually a red, green or yellow color. Many consumer cameras have a red-eye reduction flash mode that causes the subject's pupils to contract, thus reducing (but not eliminating) the red-eye effect. Other commercial methods have the user manually indicate the region of the red eye in the image to be corrected.
There are also many examples of semi-manual and automatic prior art in this field. U.S. Pat. No. 5,596,346 (Leone, et al.) discloses a semi-manual method of selecting the defect. The image is displayed on a touch sensitive display and the user can, by touching the display, maneuver a window to pan, zoom-in and zoom-out on particular portions of the image to designate a red-eye region. WO9917254 A1 (Boucher, et al.) discloses a method of detecting red eye based upon preset threshold values of luminance, hue and saturation. U.S. Pat. No. 6,292,574 B1 (Schildkraut, et al.) discloses a method of searching for skin colored regions in a digital image and then searching for the red-eye defect within those regions. U.S. Pat. No. 6,278,491 B1 (Wang, et al.) also discloses a method of redeye detection using face detection. British Patent 2,379,819 A (Nick) discloses a method of identifying highlight regions and associating these with specular reflections in red eye. U.S. Pat. No. 6,134,339 (Luo) discloses a method of detecting red-eye based on two consecutive images with an illumination source being fired during one of the images and not the other.
A significant problem with existing red eye detection methods is that they require considerable processing to detect red eye. Often they require separate scanning steps after a proposed red eye has been identified. These methods are often very computationally intensive and complex because they are not directly detecting red eye. These methods often have reduced success rates for detecting red eye because the success is based on the accuracy with which they can infer the red eye location from other scene cues. Another problem is that some of the methods require a pair of red eyes for detection. Another problem is that some of the red eye detection methods require user intervention and are not fully automatic. A significant problem with the red-eye reduction flash mode is the delay required between the pre-flash and the capture flash in order to appropriately reduce the red-eye effect. The red-eye reduction flash mode also does not completely eliminate the red-eye effect.
It is an object of the present invention to provide an improved, automatic, computationally efficient way to detect red eye in color digital images.
This object is achieved by
It has been found that by using a digital camera in a flash and non-flash mode to capture the same image of a scene that red eye can be more effectively detected by converting the primary-color space for the first and second digital images into the same chrominance channel, wherein the chrominance channel identifies a particular pair of colors and their relative intensity. Thereafter by calculating the difference between the chrominance channel of the image captured without flash and the chrominance channel of the image captured with flash; and responding to such differences to locate the position of red eyes within the first color digital image.
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 may 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 and/or software for producing and otherwise processing the image signals involved therewith, not specifically shown or described herein, may 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, the computer program may be stored in a computer readable storage medium, which may comprise, 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.
Before describing the present invention, it facilitates understanding to note that the present invention is preferably utilized on any well-known computer system, such a personal computer. Consequently, the computer system will not be discussed in detail herein. It is also instructive to note that the images are either directly input into the computer system (for example by a digital camera) or digitized before input into the computer system (for example by scanning an original, such as a silver halide film).
Referring to
A compact disk-read only memory (CD-ROM) 124, which typically includes software programs, is inserted into the microprocessor based unit 112 for providing a means of inputting the software programs and other information to the microprocessor-based unit 112. In addition, a floppy disk 126 may also include a software program, and is inserted into the microprocessor-based unit 112 for inputting the software program. The compact disk-read only memory (CD-ROM) 124 or the floppy disk 126 may alternatively be inserted into an externally located disk drive unit 122 which is connected to the microprocessor-based unit 112. Still further, the microprocessor-based unit 112 may be programmed, as is well known in the art, for storing the software program internally. The microprocessor-based unit 112 may also have a network connection 127, such as a telephone line, to an external network, such as a local area network or the Internet. A printer 128 may also be connected to the microprocessor-based unit 112 for printing a hardcopy of the output from the computer system 110.
Images may also be displayed on the display 114 via a personal computer card (PC card) 130, such as, as it was formerly known, a PCMCIA card (based on the specifications of the Personal Computer Memory Card International Association) which contains digitized images electronically embodied in the card 130. The PC card 130 is ultimately inserted into the microprocessor based unit 112 for permitting visual display of the image on the display 114. Alternatively, the PC card 130 can be inserted into an externally located PC card reader 132 connected to the microprocessor-based unit 112. Images may also be input via the compact disk 124, the floppy disk 126, or the network connection 127. Any images stored in the PC card 130, the floppy disk 126 or the compact disk 124, or input through the network connection 127, may have been obtained from a variety of sources, such as a digital camera (not shown) or a scanner (not shown). Images may also be input directly from a digital camera 134 via a camera docking port 136 connected to the microprocessor-based unit 112 or directly from the digital camera 134 via a cable connection 138 to the microprocessor-based unit 112 or via a wireless connection 140 to the microprocessor-based unit 112.
In accordance with the invention, the algorithm may be stored in any of the storage devices heretofore mentioned and applied to images in order to detect red eye in images.
Referring to
Referring to
Although
Returning to the preferred embodiment,
where R=red, G=green, B=blue, and C=the chrominance channel. It should be clear to others skilled in the art that other chrominance calculations could be used. For example, if animal red eye (that is visually yellow) is to be detected, an appropriate chrominance calculation would be
Referring to
C224=C216−C214
Where C224 is the chrominance difference image 224 pixel value, C214 is the chrominance channel from non-flash image 214 pixel value and C216 is the chrominance channel from flash image 216 pixel value. The result of the chrominance subtraction 220 is the chrominance difference image 224.
A typical value for the aforementioned predetermined levels threshold value for an 8-bit image is 5. A typical value for the aforementioned predetermined color threshold value for an 8-bit image is 30.
Although
Although
Although
Although
Although
The red eye detection algorithm disclosed in the preferred embodiment(s) of the present invention may be employed in a variety of user contexts and environments. Exemplary contexts and environments include, without limitation, wholesale digital photofinishing (which involves exemplary process steps or stages such as film in, digital processing, prints out), retail digital photofinishing (film in, digital processing, prints out), home printing (home scanned film or digital images, digital processing, prints out), desktop software (software that applies algorithms to digital prints to make them better—or even just to change them), digital fulfillment (digital images in—from media or over the web, digital processing, with images out—in digital form on media, digital form over the web, or printed on hard-copy prints), kiosks (digital or scanned input, digital processing, digital or scanned output), mobile devices (e.g., PDA or cell phone that can be used as a processing unit, a display unit, or a unit to give processing instructions), and as a service offered via the World Wide Web.
In each case, the red-eye algorithm may stand alone or may be a component of a larger system solution. Furthermore, the interfaces with the algorithm, e.g., the scanning or input, the digital processing, the display to a user (if needed), the input of user requests or processing instructions (if needed), the output, can each be on the same or different devices and physical locations, and communication between the devices and locations can be via public or private network connections, or media based communication. Where consistent with the foregoing disclosure of the present invention, the algorithm itself can be fully automatic, may have user input (be fully or partially manual), may have user or operator review to accept/reject the result, or may be assisted by metadata (metadata that may be user supplied, supplied by a measuring device (e.g. in a camera), or determined by an algorithm). Moreover, the algorithm may interface with a variety of workflow user interface schemes.
The red-eye detection algorithm disclosed herein in accordance with the invention can also be employed with interior components that utilize various data detection and reduction techniques (e.g., face detection, eye detection, skin detection, flash detection)
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.
Reference is made to commonly assigned U.S. patent application Ser. No. 10/792,079 filed Mar. 3, 2004, entitled “Correction Of Redeye Defects In Images Of Humans” by Andrew C. Gallagher et al, the disclosure of which is incorporated herein.