The present invention relates to an image processing method, and more particularly to a method capable of detecting a skin color of a face image in a digital image to confirm a range of a skin area on the face image, and filtering the skin area range to remove blemishes and dark spots in the face image.
In recent years, electronic technologies advance rapidly, and the performance of computers and peripheral products becomes increasingly higher, so that various different softwares are introduced to the market constantly and their price becomes much lower than before. Therefore, computers and peripherals are used extensively in our daily life and at work. With this trend, many video product manufacturers spare no effort to develop novel digital electronic devices for the newly developed computer consumer group. For instance, major manufacturers of image-capturing electronic devices (such as digital cameras) bundle various image processing softwares into the digital cameras to attract consumers and gain more marketing niches, and users can use the softwares to read digital images captured by the image-capturing electronic device. Users can connect the image-capturing electronic device with a display device such as a computer or television for viewing the captured digital images on the computer or television or editing the digital images. Such arrangement not only saves the expenses of developing the photos, but also allows users to make various changes and processes to the digital images to greatly reduce the waste of resources including the photo storage space and the related processing.
In general, a portrait photo is the most popular photo among various digital images shot by users and captured by a traditional image-capturing electronic device. When the portrait photo is taken, users generally adjust a diaphragm, a shutter and a position to capture the most appropriate instantaneous scene, and the captured portrait photo will show the best appearance of a photographed person as much as possible. What is the best appearance recognized and accepted by most users? The answer should be that the face of a photographed person shows a natural flawless skin color effect. However, no matter how skillful is a photographer, it is difficult to show a bright and beautiful effect if the photographed person has freckles, scars or moles on his/her face.
In view of the aforementioned issue, present existing image processing softwares generally provide a function of editing or processing digital images, so that users can quickly review and edit the photographed or obtained digital images. In general, the traditional image processing software includes functions of examining a pixel of a flaw digital image, processing the pixel, and removing dark spots. When a user clicks a rubber eraser icon in a toolbox provided by the traditional image processing software for repairing the digital images or removing the dark spots, the user erases the flaw pixels of the data of the digital image, and then clicks a paintbrush icon in the toolbox to repair the erased pixel position. The operating procedure not only involves a high level of complexity, but also requires a high level of skill. General users are not competent to handle the operation.
In the traditional photo development industry, there is a photo retouch service which is a very precise and relatively difficult technique that requires experienced professionals for the service. Regardless of enhancing a flaw negative or digital image, experienced professionals in the related areas of photo retouch, photography and chromatology are required for enhancing the details of flaws or removing the flaws from the negative or digital image, such that the retouched portion or the dark spot portion can show a natural color tone that matches the normal background color. For example, if it is necessary to remove blemishes or dark spots from a forehead of a human face in a face image while maintaining the natural skin color, an experienced professional in this field is required. Even editing tools such as Smear, Smudge, Fuzzy and Imitate in image processing softwares cannot show a natural skin color of the forehead after the blemishes and dark spots are removed, or tremendous time and efforts are required to achieve the effect. Therefore, the editing tools provided by all image processing softwares can provide a partial retouch but not a professional retouch or dark spot removal effect after the flaws on a digital image are retouched. As a result, general users dare not to attempt using the editing tools for enhancing the flaws of a digital image.
Thus, it is an important subject for image processing software and image-capturing electronic device developers to develop an image processing technology for quickly detecting a face image of a digital image captured by an image-capturing electronic device and determining whether or not the face image falls within a skin area range to automatically retouch and remove skin blemishes and dark spots in the area range; so as to assure that each face image can maintain a natural bright, beautiful and flawless skin condition, and allow the image processing technology to meet most of the basic user requirements for photography and effectively compensate the insufficiency of the user's photographic and retouch skills.
In view of the foregoing shortcomings of the prior art, the inventor of the present invention based on years of experience in the related industry to conduct extensive researches and experiments, and finally invented a face image processing method to overcome the shortcomings of the prior art image processing software and image-capturing electronic device that cannot retouch or remove the blemishes and dark spots on a face image in a digital image, and thus cannot assure that each face image maintains a natural, bright, beautiful and flawless skin condition, and finally invented a face image processing method in accordance with the present invention to overcome the shortcomings of the prior art.
Therefore, it is a primary objective of the present invention to provide a face image processing method applied to an electronic device, so that the electronic device can automatically perform a face detection to a digital image captured by an image-capturing electronic device to obtain a face image in the digital image, and perform a skin color detection to the face image to exclude non-skin features including eyes, eyeglasses, eyebrows, moustache, mouth and nostrils of the face image, and form a skin mask on an area range of the face image belonging to skin color, and finally perform a filtering process to the area range corresponding to the skin mask on the face image to filter high-frequency, mid-frequency and low-frequency noises of an abnormal skin color in the area range of the skin mask, so as to quickly remove the blemishes and dark spots in the skin area range of the face image.
Another objective of the present invention is to complete a face detection of the digital image and obtain a face image, and then mark a frame (such as square or rectangular frame) on the face image, and perform a skin color detection only to a reduced figure (which is about ⅛ of the face image or smaller) of the face image corresponding to the frame, so as to effectively simplify the operation and process of the skin color detection and expedite the skin color detection.
A further objective of the present invention is to provide a face image processing method that adopts a multi-seeds algorithm for performing a skin color detection to the face image, wherein a predetermined quantity of uniformly arranged seeds are formed in an inscribed circle or an ellipse (which covers any position of a face. closer to the front side of a digital image) within the frame, and determining whether or not the pixel color at a position corresponding to the frame is a skin color according to the position of each seed to filter the skin color, and a center color is computed for the pixel colors belonging to the skin color after the skin color filtering takes place, and the pixel colors and the center colors corresponding to all the seeds are sorted, and the seeds far away from the center color are deleted, so as to concurrently take care of a bigger change of skin colors in different areas and assure that the remaining seeds can cover more than 90% of the skin area on the face image, and the non-skin features including eyes, eyeglasses, eyebrows, moustache, mouth and nostrils, etc on the face image are excluded, so that the remaining seeds become a skin mask of the invention. The skin mask not only significantly reduces the computation for removing the blemishes and dark spots, but also assures the integrity of maintaining the skin features to obtain the best effect of removing the blemishes and dark spots.
Another objective of the present invention is to adopt a Gaussian and Laplacian pyramid operation along with a non-local (NL) filtering process to retouch and remove dark spots in the pixels corresponding to the skin mask (which are the remaining seeds) on the face image. Since the Gaussian and Laplacian pyramid operation is capable of separating high-frequency, mid-frequency and low-frequency noises in face image easily, and natural details such as pores and fine hairs on the face image are high-frequency noises, therefore the face image processing method simply adjusts the filtering range of the NL filtering process such as increasing the mid-frequency and low-frequency noises to reduce the filter of high-frequency noises in order to sufficiently remove the blemishes and dark spots in the skin area range, while maintaining the natural details such as pores and fine hairs on the face image. As a result, the face image in the digital image will be more natural, brighter and more beautiful.
The objects, technical characteristics and effects of the present invention will become apparent from the following detailed description taken with the accompanying drawings.
To make it easier for our examiner to understand the technical characteristics of the present invention, we use preferred embodiments together with the accompanying drawings for the detailed description of the invention as follows:
The present invention provides a face image processing method capable of performing a face detection to a digital image automatically to obtain a face image in the digital image, and performing a skin color detection to the face image to exclude non-skin features such as eyes, eyeglasses, eyebrows, moustache, mouth and nostrils on the face image and form a skin mask in an area range of the face image corresponding to skin color, and finally performing a filtering process to the area range corresponding to the skin mask to filter high-frequency, mid-frequency and low-frequency noises of an abnormal skin color in the area range of the skin mask of the face image, so as to quickly remove blemishes and dark spots existed in the skin area range on the face image.
To achieve the foregoing objectives, the present invention provides a face image processing method applied to an image-capturing electronic device, such that the image-capturing electronic device can automatically perform a face detection to a captured digital image to obtain a face image in the digital image and quickly remove blemishes and dark spots existed in the face image. In the preferred embodiment, the image-capturing electronic devices refer to various different digital cameras and digital camcorders or any other computer devices (such as personal digital assistants and notebook computers) or communication devices (such as digital mobile phones and video phones) having the image-capturing electronic devices. With reference to
U>=85 and U<=135; (a)
V>=135 and V<=180; and (b)
Y>=32 (c)
F1(Y1U1V1, Y2U2V2)=(Y1−Y2)̂2/32+(U1−U2)̂2*2+(V1−V2)̂2*4
In another preferred embodiment of the present invention, the face image processing method is applied to an image processing device, wherein the image processing device is an electronic device such as a notebook computer, a personal digital assistant or a mobile phone without requiring an installation of digital image capturing components. After the electronic device reads an inputted digital image, a face detection is performed to the digital image to obtain a face image in the digital image according to the foregoing procedure, and a skin color detection is performed to the face image to exclude the non-skin features on the face image, and a skin mask is formed in an area range of the face image belonging to skin color. Finally, a filtering process is performed to the area range of the face image corresponding to the skin mask to filter high-frequency, mid-frequency and low-frequency noises, and then quickly remove the blemishes and dark spots existed in the face image.
While the invention has been described by means of specific embodiments, numerous modifications and variations could be made thereto by those skilled in the art without departing from the scope and spirit of the invention set forth in the claims.