1. Field of the Invention
The present invention relates to a method for making up a skin tone of a human body in an image and a related device thereof, and a method for adjusting a skin tone luminance of a human body in an image and a related device thereof, and particularly to a method and a related device thereof that can utilize a Trapezoid model to make up a skin tone of a human body in an image and a method and a related device thereof that can utilize a Trapezoid model to adjust a skin tone luminance of a human body in an image.
2. Description of the Prior Art
When the prior art executes color correction on an image, the prior art will execute the color correction on all pixels corresponding to the image. Therefore, when the image includes a human face and the prior art executes the color correction on the image, the prior art will inevitably influence a skin tone of the human face, resulting in the skin tone of the human face being distorted. In addition, when the prior art executes luminance adjustment on the image, the prior art will execute the luminance adjustment on whole color space corresponding to the image. Therefore, when the image includes the human face and the prior art executes the luminance adjustment on the image, the prior art will inevitably influence luminance of the human face, resulting in the luminance of the human face being too bright or too dark. Therefore, the prior art is not a good choice for a user.
An embodiment provides a method for making up a skin tone of a human body in an image, wherein a device applied to the method includes a first receiving unit, a second receiving unit, a filter module, a skin tone probability unit, a first mixing unit, a saturation adjustment unit, and a second mixing unit. The method includes the first receiving unit receiving Y values of the image and the second receiving unit receiving Cb values and Cr values of the image; the filter module generating two different luminance values corresponding to each pixel of the image according to the Y values of the image; the skin tone probability unit generating a probability value of each pixel of the image corresponding to a skin tone of the human body according to the Cb values and the Cr values of the image; the first mixing unit generating a skin tone luminance adjustment value corresponding to each pixel of the image according to two different luminance values corresponding to each pixel of the image and a probability value of each pixel of the image corresponding to the skin tone of the human body; the saturation adjustment unit generating a Cb adjustment value and a Cr adjustment value corresponding to each pixel of the image according to the Cb values and the Cr values of the image, respectively; and the second mixing unit generating a make-up human body skin tone image according to a skin tone luminance adjustment value corresponding to each pixel of the image, a Cb adjustment value corresponding to each pixel of the image, and a Cr adjustment value corresponding to each pixel of the image.
Another embodiment provides a method for adjusting a skin tone luminance of a human body in an image, wherein a device applied to the method includes a first receiving unit, a filter module, a skin tone probability unit, and a first mixing unit. The method including the first receiving unit receiving Y values of the image and the second receiving unit receiving Cb values and Cr values of the image; the filter module generating two different luminance values corresponding to each pixel of the image according to the Y values of the image; the skin tone probability unit generating a probability value of each pixel of the image corresponding to a skin tone of the human body according to the Cb values and the Cr values of the image; and the first mixing unit generating a skin tone luminance adjustment value corresponding to each pixel of the image according to two different luminance values corresponding to each pixel of the image and a probability value of each pixel of the image corresponding to the skin tone of the human body.
Another embodiment provides a device for making up a skin tone of a human body in an image. The device includes a first receiving unit, a second receiving unit, a filter module, a skin tone probability unit, a first mixing unit, a saturation adjustment unit, and a second mixing unit. The first receiving unit receives Y values of the image. The second receiving unit receives Cb values and Cr values of the image. The filter module is coupled to the first receiving unit for generating two different luminance values corresponding to each pixel of the image according to the Y values of the image. The skin tone probability unit is coupled to the second receiving unit for generating a probability value of each pixel of the image corresponding to a skin tone of the human body according to the Cb values and the Cr values of the image. The first mixing unit is coupled to the filter module and the skin tone probability unit for generating a skin tone luminance adjustment value corresponding to each pixel of the image according to two different luminance values corresponding to each pixel of the image and a probability value of each pixel of the image corresponding to the skin tone of the human body. The saturation adjustment unit is coupled to the second receiving unit for generating a Cb adjustment value and a Cr adjustment value corresponding to each pixel of the image according to the Cb values and the Cr values of the image, respectively. The second mixing unit is coupled to the first mixing unit and the saturation adjustment unit for generating a make-up human body skin tone image according to a skin tone luminance adjustment value corresponding to each pixel of the image, a Cb adjustment value corresponding to each pixel of the image, and a Cr adjustment value corresponding to each pixel of the image.
Another embodiment provides a device for adjusting a skin tone luminance of a human body in an image. The device includes a first receiving unit, a second receiving unit, a filter module, a skin tone probability unit, and a first mixing unit. The first receiving unit receives Y values of the image. The second receiving unit receives Cb values and Cr values of the image. The filter module is coupled to the first receiving unit for generating two different luminance values corresponding to each pixel of the image according to the Y values of the image. The skin tone probability unit is coupled to the second receiving unit for generating a probability value of each pixel of the image corresponding to a skin tone of the human body according to the Cb values and the Cr values of the image. The first mixing unit is coupled to the filter module and the skin tone probability unit for generating a skin tone luminance adjustment value corresponding to each pixel of the image according to two different luminance values corresponding to each pixel of the image and a probability value of each pixel of the image corresponding to the skin tone of the human body.
Another embodiment provides a method for making up a skin tone of a human body in an image, wherein a device applied to the method includes a first receiving unit, a second receiving unit, a filter module, a skin tone probability unit, a first mixing unit, a saturation adjustment unit, and a second mixing unit. The method includes the first receiving unit receiving Y values of the image and the second receiving unit receiving Cb values and Cr values of the image; the filter module generating two different luminance values corresponding to each pixel of the image according to the Y values of the image; the skin tone probability unit generating a probability value of each pixel of the image corresponding to a skin tone of the human body according to the Cb values, the Cr values of the image, and a Gaussian model corresponding to the skin tone of the human body; the first mixing unit generating a skin tone luminance adjustment value corresponding to each pixel of the image according to two different luminance values corresponding to each pixel of the image and a probability value of each pixel of the image corresponding to the skin tone of the human body; the saturation adjustment unit generating a Cb adjustment value and a Cr adjustment value corresponding to each pixel of the image according to the Cb values and the Cr values of the image, respectively; and the second mixing unit generating a make-up human body skin tone image according to a skin tone luminance adjustment value corresponding to each pixel of the image, a Cb adjustment value corresponding to each pixel of the image, and a Cr adjustment value corresponding to each pixel of the image.
Another embodiment provides a method for adjusting a skin tone luminance of a human body in an image, wherein a device applied to the method includes a first receiving unit, a filter module, a skin tone probability unit, and a first mixing unit. The method includes the first receiving unit receiving Y values of the image and the second receiving unit receiving Cb values and Cr values of the image; the filter module generating two different luminance values corresponding to each pixel of the image according to the Y values of the image; the skin tone probability unit generating a probability value of each pixel of the image corresponding to a skin tone of the human body according to the Cb values, the Cr values of the image, and a Gaussian model corresponding to a skin tone of the human body; and the first mixing unit generating a skin tone luminance adjustment value corresponding to each pixel of the image according to two different luminance values corresponding to each pixel of the image and a probability value of each pixel of the image corresponding to the skin tone of the human body.
Another embodiment provides a device for making up a skin tone of a human body in an image. The device includes a first receiving unit, a second receiving unit, a filter module, a skin tone probability unit, a first mixing unit, a saturation adjustment unit, and a second mixing unit. The first receiving unit receives Y values of the image. The second receiving unit receives Cb values and Cr values of the image. The filter module is coupled to the first receiving unit for generating two different luminance values corresponding to each pixel of the image according to the Y values of the image. The skin tone probability unit is coupled to the second receiving unit for generating a probability value of each pixel of the image corresponding to a skin tone of the human body according to the Cb values, the Cr values of the image, and a Gaussian model corresponding to the skin tone of the human body. The first mixing unit is coupled to the filter module and the skin tone probability unit for generating a skin tone luminance adjustment value corresponding to each pixel of the image according to two different luminance values corresponding to each pixel of the image and a probability value of each pixel of the image corresponding to the skin tone of the human body. The saturation adjustment unit is coupled to the second receiving unit for generating a Cb adjustment value and a Cr adjustment value corresponding to each pixel of the image according to the Cb values and the Cr values of the image, respectively. The second mixing unit is coupled to the first mixing unit and the saturation adjustment unit for generating a make-up human body skin tone image according to a skin tone luminance adjustment value corresponding to each pixel of the image, a Cb adjustment value corresponding to each pixel of the image, and a Cr adjustment value corresponding to each pixel of the image.
Another embodiment provides a device for adjusting a skin tone luminance of a human body in an image. The device includes a first receiving unit, a second receiving unit, a filter module, a skin tone probability unit, and a first mixing unit. The first receiving unit receives Y values of the image. The second receiving unit receives Cb values and Cr values of the image. The filter module is coupled to the first receiving unit for generating two different luminance values corresponding to each pixel of the image according to the Y values of the image. The skin tone probability unit is coupled to the second receiving unit for generating a probability value of each pixel of the image corresponding to a skin tone of the human body according to the Cb values, the Cr values of the image, and a Gaussian model corresponding to the skin tone of the human body. The first mixing unit is coupled to the filter module and the skin tone probability unit for generating a skin tone luminance adjustment value corresponding to each pixel of the image according to two different luminance values corresponding to each pixel of the image and a probability value of each pixel of the image corresponding to the skin tone of the human body.
The present invention provides a method for making up a skin tone of a human body in an image, a device for making up a skin tone of a human body in an image, a method for adjusting a skin tone luminance of a human body in an image, and a device for adjusting a skin tone luminance of a human body in an image. The method for making up a skin tone of a human body in an image, the device for making up a skin tone of a human body in an image, the method for adjusting a skin tone luminance of a human body in an image, and the device for adjusting a skin tone luminance of a human body in an image utilize a filter module and a skin tone probability unit to make up a skin tone of a human body in an image or to adjust a skin tone luminance of the human body in the image. Therefore, compared to the prior art, the present invention not only can soften the skin tone of the human body in the image, but can also ensure that the skin tone of the human body in the image is not distorted after adjusted. In addition, because the present invention only adjusts the skin tone of the human body in the image (however, the prior art executes luminance adjustment on whole color space corresponding to an image), the present invention does not make the skin tone luminance of the human body in the image too bright or too dark, and also not have a disadvantage corresponding to color shift. In addition, compared to the prior art, because the skin tone probability unit utilizes a linear trapezoidal model or a linear triangular model to approximate a Gaussian distribution, the present invention can significantly reduce operation burden of the skin tone probability unit and increase practicability of hardware calculation.
These and other objectives of the present invention will no doubt become obvious to those of ordinary skill in the art after reading the following detailed description of the preferred embodiment that is illustrated in the various figures and drawings.
Please refer to
Please refer to
As shown in equation (1), ICb(x) is a Cb value corresponding to a pixel x. Therefore, substituting the Cb value corresponding to the pixel x into equation (1) can obtain a first skin tone probability value corresponding to the Cb value of the pixel x. Similarly, a second skin tone probability value corresponding to a Cr value of the pixel x can also be generated according to the above mentioned principles. Therefore, the skin tone probability unit 108 can utilize the two-dimensional trapezoid model to multiple the first skin tone probability value corresponding to the Cb value of the pixel x by the second skin tone probability value corresponding to the Cr value of the pixel x to generate a probability value of the pixel x corresponding to the skin tone of the human body.
In addition, please refer to
In addition, in another of the present invention, the skin tone probability unit 108 can generate a probability value of each pixel of the image IM corresponding to the skin tone of the human body according to the Cb values and the Cr values of the image IM and a Gaussian model corresponding to the skin tone of the human body (that is, the Gaussian model corresponding to the skin tone of the human body has been built in the skin tone probability unit 108, so the skin tone probability unit 108 can directly generate a two-dimensional trapezoid model not through
As shown in
I′
Y(x)=(1−α)·IY
As shown in equation (3), I′Y(X) is a skin tone luminance adjustment value corresponding to the pixel x of the image IM, IY
As shown in
I′
Cb(x)=Sgain(ICb(x)−128)+128 (4)
′
Cr(x)=Sgain(ICr(x)−128)+128 (5)
As shown in equation (4), ICb(x) is a Cb value corresponding to the pixel x of the image IM, ICb(x) is a Cb adjustment value corresponding to the pixel x of the image IM, ICr(x) is a Cr value corresponding to the pixel x of the image IM, I′Cr(x) is a Cr adjustment value corresponding to the pixel x of the image IM, and Sgain is a saturation gain corresponding to the pixel x of the image IM.
As shown in
Please refer to
Step 500: Start.
Step 502: The first receiving unit 102 receives Y values of an image IM and the second receiving unit 104 receives Cb values and Cr values of the image IM.
Step 504: The filter module 106 generates two different luminance values corresponding to each pixel of the image IM according to the Y values of the image IM.
Step 506: The skin tone probability unit 108 generates a probability value of each pixel of the image corresponding to a skin tone of the human body according to the Cb values and the Cr values of the image IM.
Step 508: The first mixing unit 110 generates a skin tone luminance adjustment value corresponding to each pixel of the image IM according to two different luminance values corresponding to each pixel of the image IM and a probability value of each pixel of the image IM corresponding to the skin tone of the human body.
Step 510: The saturation adjustment unit 112 generates a Cb adjustment value and a Cr adjustment value corresponding to each pixel of the image IM according to the Cb values and the Cr values of the image IM, respectively.
Step 512: The second mixing unit 114 generates a make-up human body skin tone image MIM according to a skin tone luminance adjustment value corresponding to each pixel of the image, a Cb adjustment value corresponding to each pixel of the image, and a Cr adjustment value corresponding to each pixel of the image IM.
Step 514: End.
In Step 502, as shown in
In Step 506, as shown in
In Step 508, as shown in
In Step 510, as shown in
In Step 512, as shown in
Please refer to
Step 600: Start.
Step 602: The first receiving unit 102 receives Y values of an image IM and the second receiving unit 104 receives Cb values and Cr values of the image IM.
Step 604: The filter module 106 generates two different luminance values corresponding to each pixel of the image IM according to the Y values of the image IM.
Step 606: The skin tone probability unit 108 generates a probability value of each pixel of the image corresponding to a skin tone of the human body according to the Cb values and the Cr values of the image IM.
Step 608: The first mixing unit 110 generates a skin tone luminance adjustment value corresponding to each pixel of the image IM according to two different luminance values corresponding to each pixel of the image IM and a probability value of each pixel of the image IM corresponding to the skin tone of the human body.
Step 610: End.
Because operational principles of Steps 602-608 are the same as those of Steps 502-508, so further description thereof is omitted for simplicity.
To sum up, the method for making up a skin tone of a human body in an image, the device for making up a skin tone of a human body in an image, the method for adjusting a skin tone luminance of a human body in an image, and the device for adjusting a skin tone luminance of a human body in an image utilize the filter module and the skin tone probability unit to make up a skin tone of a human body in an image or to adjust a skin tone luminance of the human body in the image. Therefore, compared to the prior art, the present invention not only can soften the skin tone of the human body in the image, but can also ensure that the skin tone of the human body in the image is not distorted after adjusted. In addition, because the present invention only adjusts the skin tone of the human body in the image (however, the prior art executes luminance adjustment on whole color space corresponding to an image) , the present invention does not make the skin tone luminance of the human body in the image too bright or too dark, and also not have a disadvantage corresponding to color shift. In addition, compared to the prior art, because the skin tone probability unit utilizes a linear trapezoidal model or a linear triangular model to approximate a Gaussian distribution, the present invention can significantly reduce operation burden of the skin tone probability unit and increase practicability of hardware calculation.
Those skilled in the art will readily observe that numerous modifications and alterations of the device and method may be made while retaining the teachings of the invention. Accordingly, the above disclosure should be construed as limited only by the metes and bounds of the appended claims.
Number | Date | Country | Kind |
---|---|---|---|
103113919 | Apr 2014 | TW | national |