Color gamut weight detection method and device for skin color image

Through the color gamut weight detection method of skin color images, the skin color area of ​​the person is identified and the color gamut weight map is generated, which solves the problem of insufficient separation of the person's skin color and the background color in the existing technology, and achieves precise adjustment of the person's skin color and the entire image. color needs are met.

CN112149468BActive Publication Date: 2024-09-06REALTEK SEMICON CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201910573432.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-06-28
Publication Date
2024-09-06
Estimated Expiration
2039-06-28

AI Technical Summary

Technical Problem

The existing technology cannot effectively separate the person's skin color and the background color during image retouching. As a result, the background does not meet expectations when the person's skin color is adjusted, or the person's skin color does not meet expectations when the background is normal. It cannot satisfy the user's local color cast and exposure of the entire image. need.

Method used

This paper proposes a color gamut weight detection method for skin color images. By receiving the image, it identifies the skin color area in the person image, obtains the skin color category and color gamut, calculates the color component value and base, obtains the color gamut and weight center, and generates the skin color gamut. Weight map enables precise adjustment of character skin color.

Benefits of technology

It achieves independent adjustment of character skin color without affecting other parts of the image, meets the user's color and brightness needs of the entire image, and improves the accuracy and effect of image editing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112149468B
    Figure CN112149468B
Patent Text Reader

Abstract

A color gamut weight detection method and device for skin color images, comprising: receiving an image with a person's image, the image comprising a plurality of pixels, each pixel comprising a first color component and a second color component; obtaining a skin color area, a skin color category, and a first color gamut; obtaining a first color component value and a first cardinality based on the first color component in the skin color area; obtaining a second color component value and a second cardinality based on the second color component in the skin color area; obtaining a second color gamut and a weight center based on the skin color category, the first cardinality, the first color component value, the second cardinality, and the second color component value; obtaining a first weight area and a second weight area based on the first color gamut and the second color gamut; and obtaining a skin color gamut weight map based on the weight center, the first weight area, and the second weight area.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This case is related to the field of image processing, and in particular to a method and device for detecting color gamut weight of skin color images. Background Art

[0002] Nowadays, users have a very common demand for photo editing functions. Users will adjust the shape, color and brightness of the image to suit their own preferences. Among them, the function of adjusting the skin color of the characters is the most concerned by the public.

[0003] However, the prior art performs color correction on all pixels in the image when retouching photos. Therefore, when adjusting the background or the color of the person's clothing, the person's skin color with the same color as the adjusted color is inevitably adjusted together. This prior art makes the person's skin color adjusted to meet the user's expectations, but the background often does not meet the expectations, such as too dark brightness, too bright brightness, or chromatic distortion. On the contrary, when the background is normal, the person's skin color is not adjusted to the chromaticity or brightness expected by the user. The reason for these two undesirable situations is that the skin color that users now expect to modify is not the original skin color, such as white or bronze. But at the same time, the user expects the background to remain normal. Therefore, when there is no local color cast or overexposure in the entire image (including the person and the background), it is impossible to achieve the effect required by the user by modifying the entire image only by relying on the prior art. Therefore, the prior art still has shortcomings in adjusting the skin color of people in the image. Summary of the invention

[0004] In view of this, this application proposes a color gamut weight detection method and device for skin color images.

[0005] According to some embodiments, a color gamut weight detection method for a skin color image includes: receiving an image, the image having a person image, the image including multiple pixels, each pixel including a first color component and a second color component; obtaining a skin color area of ​​the person image, a skin color category corresponding to the skin color area, and a first color gamut corresponding to the skin color category according to a skin color judgment program; obtaining multiple first color component values ​​and multiple first cardinal numbers according to the first color component in the skin color area; obtaining multiple second color component values ​​and multiple second cardinal numbers according to the second color component in the skin color area; obtaining a second color gamut and a weight center according to the skin color category, the first cardinality, the first color component value, the second cardinality, and the second color component value; obtaining a first weight area and a second weight area according to the first color gamut and the second color gamut; and obtaining a skin color gamut weight map corresponding to the skin color area according to the weight center, the first weight area, and the second weight area.

[0006] According to some embodiments, a color gamut weight detection device for a skin color image includes: an image receiving circuit, a skin color judgment circuit, a skin color analysis circuit, a color gamut obtaining circuit, and a skin color gamut weight map obtaining circuit. The image receiving circuit is used to receive an image, and the image has a person image. The image includes a plurality of pixels, and each pixel includes a first color component and a second color component. The skin color judgment circuit is used to obtain a skin color area of ​​the person image, a skin color category corresponding to the skin color area, and a first color gamut corresponding to the skin color category according to a skin color judgment procedure. The skin color analysis circuit is used to obtain a plurality of first color component values ​​and a plurality of first cardinal numbers according to the first color component in the skin color area. And the skin color analysis circuit is used to obtain a plurality of second color component values ​​and a plurality of second cardinal numbers according to the second color component in the skin color area. The color gamut obtaining circuit is used to obtain a second color gamut and a weight center according to the skin color category, the first cardinal number, the first color component value, the second cardinal number, and the second color component value. And the skin color gamut weight map obtaining circuit is used to obtain a first weight area and a second weight area according to the first color gamut and the second color gamut. And the skin color gamut weight map obtaining circuit is used to obtain the skin color gamut weight map corresponding to the skin color area according to the weight center, the first weight area, and the second weight area.

[0007] In summary, the color gamut weight detection method and device for skin color image proposed in some embodiments of the present invention can obtain a skin color gamut weight map of the skin color area of ​​the person image based on an image having a person image. BRIEF DESCRIPTION OF THE DRAWINGS

[0008] Figure 1 A schematic diagram of a color gamut weight detection device for a skin color image according to some embodiments of the present invention is shown.

[0009] Figure 2 Schematic diagrams showing character images according to some embodiments of the present invention.

[0010] Figure 3 Schematic diagrams showing the color gamut areas of some embodiments of the present invention.

[0011] Figure 4 A flow chart of a method for detecting color gamut weight of a skin color image according to some embodiments of the present invention is shown.

[0012] Figure 5 A flow chart of a skin color determination procedure according to some embodiments of the present invention is shown.

[0013] Figure 6 A schematic diagram of a first histogram according to some embodiments of the present invention is shown.

[0014] Figure 7 A schematic diagram of a second histogram according to some embodiments of the present invention is shown.

[0015] Figure 8A flow chart of a color gamut acquisition process (I) according to some embodiments of the present invention is shown.

[0016] Fig. 9 A flow chart of the color gamut acquisition process (II) of some embodiments of the present invention is shown.

[0017] Fig.10 Schematic diagrams showing weight regions according to some embodiments of the present invention.

[0018] Fig.11 A partial enlarged schematic diagram of the weight region of some embodiments of the present case is shown.

[0019] Fig.12 A schematic diagram of a first weight region according to some embodiments of the present invention is shown.

[0020] Fig.13 Schematic diagrams of the second weight region of some embodiments of the present invention are shown.

[0021] Fig.14 A flowchart of a procedure for obtaining a skin color gamut weight map according to some embodiments of the present invention is shown.

[0022] Fig.15 A diagram showing the relationship between the first weight distance and the first weight function according to some embodiments of the present invention is shown.

[0023] Fig.16 A diagram showing the relationship between the second weight distance and the second weight function according to some embodiments of the present invention is shown.

[0024] Explanation of symbols:

[0025] 10 Color Gamut Weight Detection Device for Skin Color Images

[0026] 100 Image receiving circuit

[0027] 200 Skin color judgment circuit

[0028] 300 Skin color analysis circuit

[0029] 400 Color Gamut Acquisition Circuit

[0030] 500 Skin color gamut weight map acquisition circuit

[0031] 600 Storage Devices

[0032] 700 images

[0033] 720 people images

[0034] 740 Skin color area

[0035] 800 UV color planes

[0036] 810 First Color Gamut

[0037] 820 Second color space

[0038] 830 Weight Center

[0039] 840 First Weight Area

[0040] 850 Second Weight Zone

[0041] 860 weight boundary points

[0042] 870 First weighted color block

[0043] 880 Second weighted color block

[0044] 890 Weight Direction

[0045] U first color component

[0046] V Second color component

[0047] M1 First maximum

[0048] M2 Second maximum

[0049] T1 first threshold

[0050] T2 Second threshold

[0051] N1 First cardinality

[0052] N2 Second base

[0053] d1 first weighted distance

[0054] d2 Second weighted distance

[0055] w1(d1) first weight function

[0056] w2(d2) second weight function

[0057] T1 First Weight Percentage

[0058] T2 Second weight percentage

[0059] W Weight coefficient

[0060] Steps S110 to S176 DETAILED DESCRIPTION

[0061] Figure 1 FIG. 1 is a schematic diagram of a color gamut weight detection device 10 for skin color images according to some embodiments of the present invention. Figure 1In some embodiments, the color gamut weight detection device 10 for skin color image includes: an image receiving circuit 100, a skin color determination circuit 200, a skin color analysis circuit 300, a color gamut obtaining circuit 400, and a skin color gamut weight map obtaining circuit 500. The image receiving circuit 100, the skin color determination circuit 200, the skin color analysis circuit 300, the color gamut obtaining circuit 400, and the skin color gamut weight map obtaining circuit 500 are coupled to each other. The image receiving circuit 100, the skin color determination circuit 200, the skin color analysis circuit 300, the color gamut obtaining circuit 400, and the skin color gamut weight map obtaining circuit 500 are, for example but not limited to, implemented as separate chips or integrated into a single chip, and the present invention is not limited thereto.

[0062] In some embodiments, the color gamut weight detection device 10 for skin color image further includes a storage device 600. The storage device 600 is respectively coupled to the image receiving circuit 100, the skin color determination circuit 200, the skin color analysis circuit 300, the color gamut obtaining circuit 400, and the skin color gamut weight map obtaining circuit 500. The various data input or output between the image receiving circuit 100, the skin color determination circuit 200, the skin color analysis circuit 300, the color gamut obtaining circuit 400, and the skin color gamut weight map obtaining circuit 500 are not limited to being accessed through the storage device 600, or directly through the built-in storage function of each circuit to achieve the access function. The storage device 600 is, for example, but not limited to, a volatile memory, a read-only memory, a flash memory, or a disk.

[0063] Figure 2 A schematic diagram of a character image 720 is shown in some embodiments of the present invention. Figure 1 and Figure 2In some embodiments, the image receiving circuit 100 is used to receive an image 700 from the outside. The image 700 has a person image 720, and the person image 720 has a skin color area 740. Specifically, the image 700 includes a plurality of pixels, each pixel including a first color component U and a second color component V. According to some embodiments, each pixel is arranged in a two-dimensional array according to a first axis and a second axis. The first color component U represents the "U color component" in the YUV (luminance, chrominance, chroma) color model, and the second color component V represents the "V color component" in the YUV color model. That is, the first color component U and the second color component V are used to represent the chromaticity and chroma in the pixel, and the "color component" is used as a general term for the "first color component U and the second color component V" hereinafter. It should be noted that, for ease of description, this specification uses the example that image 700 has only one person image 720, and the person image 720 has only one skin color area 740. In practice, image 700 may have one or more person images 720, and the person image 720 may also have one or more skin color areas 740.

[0064] In some embodiments, the first color component U and the second color component V are color components in the YUV color model, such as "Y color component", "U color component", "V color component", or a combination thereof. In some embodiments, the first color component U and the second color component V are color components in the HSV (Hue, Saturation, Lightness) color model, such as "H color component", "S color component", or "L color component", or a combination thereof. It should be particularly noted that the present invention is not limited to color components in the YUV color model, the HSV color model, or other color models.

[0065] Figure 3 Schematic diagrams showing the color gamut areas of some embodiments of the present invention are shown. Figures 1 to 3 In some embodiments, the color gamut weight detection device 10 of the skin color image is used to receive the image 700 and output the skin color gamut weight map corresponding to the skin color area 740. The skin color gamut weight map includes various color components related to the skin color of the character image 720, and the weight values ​​corresponding to these color components. It should be particularly noted that the weight value is used to represent the importance of the color component in the skin color area 740 (for example, the proportion of the skin color area 740). First, the image 700 is received by the image receiving circuit 100. Then, the color gamut weight detection device 10 of the skin color image obtains the color gamut of the skin color area 740 of the character image 720 of the image 700 in two ways, such as the first color gamut 810 and the second color gamut 820 in the UV color plane 800.

[0066] In some embodiments, the first color gamut 810 and the second color gamut 820 are distributed in the UV color plane 800. Specifically, in the YUV color model, the first color gamut 810 and the second color gamut 820 are sets of some color components in the UV color plane 800. According to some embodiments, the first color gamut 810 includes the second color gamut 820, which means that the set of color components represented by the first color gamut 810 covers and is greater than the set of color components represented by the second color gamut 820. It should be noted that Figure 3 The X-axis is the normalized first color component U, and the Y-axis is the normalized second color component V. For example, the original value range of the U color component and the V color component is 127 to -128, and the value range of the U color component and the V color component after normalization is +1 to -1. Figure 3 Only the portion from +0.5 to -0.5 is shown.

[0067] Secondly, in some embodiments, the first color gamut 810 is obtained by the skin color determination circuit 200, and the second color gamut 820 is obtained by the skin color analysis circuit 300 and the color gamut acquisition circuit 400. The skin color determination circuit 200 obtains the first color gamut 810 according to the skin color region 740 of the person image 720. Specifically, the skin color determination circuit 200 classifies the distribution of color components in the skin color region 740 by skin color category to obtain the skin color category corresponding to the skin color region 740, and each skin color category (such as skin color corresponding to yellow skin color, black skin color, white skin color, Middle Eastern skin color, etc., but the present case is not limited thereto) has a corresponding color gamut, and the first color gamut 810 is the color gamut corresponding to its skin color category.

[0068] The skin color analysis circuit 300 and the color gamut acquisition circuit 400 obtain the second color gamut 820 according to the skin color region 740 of the person image 720. Specifically, the skin color analysis circuit 300 counts the distribution of color components in the skin color region 740 to obtain the number corresponding to each color component value. The color gamut acquisition circuit 400 obtains the second color gamut 820 and the weight center 830 according to the number corresponding to each color component value and by selecting the color component value whose number meets a specific threshold. According to some embodiments, the color gamut acquisition circuit 400 obtains the weight center 830 by the maximum number of color component values.

[0069] Finally, the skin color gamut weight map acquisition circuit 500 is used to receive the first color gamut 810, the second color gamut 820, and the weight center 830. The skin color gamut weight map acquisition circuit 500 obtains the skin color gamut weight map corresponding to the skin color area 740 according to the first color gamut 810, the second color gamut 820, and the weight center 830.

[0070] Figure 4A flow chart of a method for detecting color gamut weight of a skin color image in some embodiments of the present invention is shown. Figure 4 In some embodiments, the color gamut weight detection method of the skin color image includes the following steps: receiving an image 700 having a person image 720, the image 700 including a plurality of pixels, each pixel including a first color component U and a second color component V (step S110); obtaining a skin color region 740 of the person image 720, a skin color category corresponding to the skin color region 740, and a first color gamut 810 corresponding to the skin color category according to a skin color judgment procedure (step S120); obtaining a plurality of first color component values ​​and a plurality of first cardinal numbers N1 according to the first color component U in the skin color region 740 (step S130); obtaining a plurality of first color component values ​​and a plurality of first cardinal numbers N1 according to the first color component U in the skin color region 740 (step S140); obtaining a plurality of first color component values ​​and a plurality of first cardinal numbers N2 according to the first color component U in the skin color region 740 (step S150); obtaining a plurality of first color component values ​​and a plurality of first cardinal numbers N3 according to the first color component U in the skin color region 740 (step S151); obtaining a plurality of first color component values ​​and a plurality of first cardinal numbers N4 according to the first color component U in the skin color region 740 (step S152); obtaining a plurality of first color component values ​​and a plurality of first cardinal numbers N5 according to the first color component U in the skin color region 740 (step S153); obtaining a plurality of first color component values ​​and a plurality of first cardinal numbers N6 according to the first color component U in the skin color region 740 (step S154); obtaining a plurality of first color component values ​​and a plurality of first cardinal numbers N7 according to the first color component U in the skin color region 740 (step S155); obtaining a plurality of first color component values ​​and a plurality of first cardinal numbers N8 according to the first color component U in the skin color region 740 (step S156); obtaining a plurality of first color component The second color component V is obtained by obtaining a plurality of second color component values ​​and a plurality of second cardinal numbers N2 (step S140); according to the skin color category, these first cardinal numbers N1, these first color component values, these second cardinal numbers N2, and these second color component values, a second color gamut 820 and a weight center 830 are obtained (step S150); according to the first color gamut 810 and the second color gamut 820, a first weight area 840 and a second weight area 850 are obtained (step S160); and, according to the weight center 830, the first weight area 840, and the second weight area 850, a skin color gamut weight map corresponding to the skin color area 740 is obtained (step S170).

[0071] See also Figure 1 and Figure 4 Step S110, in some embodiments, the image receiving circuit 100 receives the image 700, and the image receiving circuit 100 outputs the image 700 for the skin color determination circuit 200, the skin color analysis circuit 300, the color gamut acquisition circuit 400, and the skin color gamut weight map acquisition circuit 500 to receive and use.

[0072] Continued reference Figure 1 and Figure 4 . Step S120, in some embodiments, the skin color judgment circuit 200 first obtains the skin color area 740 of the person image 720 through the image 700 according to the skin color judgment procedure, and then obtains the skin color category corresponding to the skin color area 740 from the skin color area 740, and then obtains the first color domain 810 corresponding to the skin color category according to the skin color category. In some embodiments, the image 700 has a person image 720, and the person image 720 has a skin color area 740. The skin color area 740 represents the exposed skin part of the person image 720, such as the face, neck, arm, or other exposed skin parts. The shape of the skin color area 740 is not limited to the irregular outline, square, oval or other shapes of the person image 720, that is, the skin color area 740 may include the exposed skin part and the surrounding area. For example Figure 2The skin color area 740 shown is a square, and the exposed skin areas are the face and neck, while the hair and background around the exposed skin are also included in the skin color area 740 .

[0073] Figure 5 A flowchart of the skin color determination process of some embodiments of the present invention is shown. Figure 5 In some embodiments, the skin color determination procedure includes the following steps: determining whether a person image 720 exists in the image 700 (step S121); obtaining a skin color area and multiple skin color area coordinates of the person image 720 based on the image 700 (step S122); obtaining a skin color category and a confidence coefficient corresponding to the skin color category based on pixels in the skin color area (step S123); and obtaining a first color gamut 810 based on the skin color category (step S124).

[0074] Reference Figure 2 and Figure 5 In step S121, in some embodiments, the skin color determination circuit 200 performs the following steps S122 to S124 by determining that the image 700 contains a person image 720. On the contrary, when the skin color determination circuit 200 determines that the image 700 contains no person image 720, the skin color determination circuit 200 stops the skin color determination process.

[0075] Reference Figure 2 and Figure 5 , step S122, in some embodiments, the skin color determination circuit 200 obtains the skin color region 740 of the person image 720 and a plurality of skin color region coordinates of the skin color region 740 according to the image 700. In practice, according to some embodiments, the skin color determination circuit 200 can locate the skin color region 740 and the skin color region coordinates of the face by determining the facial features and contours of the face.

[0076] Step S123, in some embodiments, the skin color determination circuit 200 obtains the skin color category and the confidence coefficient of the corresponding skin color category according to the skin color area 740. Specifically, the confidence coefficient is used to represent the reliability of the skin color determination circuit 200 in determining the skin color category of the skin color area 740. The confidence coefficient can be 0% to 100%, wherein the closer the confidence coefficient is to 100%, the more likely the skin color category determined by the skin color determination circuit 200 is correct. Conversely, when the confidence coefficient is closer to 0%, the more likely the skin color category determined by the skin color determination circuit 200 is wrong. Step S124, in some embodiments, the skin color determination circuit 200 obtains the first color gamut 810 according to the skin color category.

[0077] Figure 6 A schematic diagram showing a first histogram of some embodiments of the present invention is shown. Figure 7 A schematic diagram of a second histogram of some embodiments of the present invention is shown. Figure 4 , Figure 6 and Figure 7 Step S130 and step S140: In some embodiments, the skin color analysis circuit 300 is used to obtain a plurality of first color component values ​​and a plurality of first cardinal numbers N1 (such as Figure 6 The skin color analysis circuit 300 is also used to obtain a plurality of second color component values ​​and a plurality of second bases N2 (such as Figure 7 Specifically, the first cardinality N1 is the number corresponding to the first color component value, and the second cardinality N2 is the number corresponding to the second color component value. Since the skin color area 740 includes a plurality of first color components U and a plurality of second color components V. Therefore, the skin color analysis circuit 300 obtains a plurality of first color component values ​​and a plurality of first cardinality N1 by counting the first color component U in the skin color area 740. The first color component value and the first cardinality N1 are represented by a histogram, which is a first histogram (as shown in FIG. Figure 6 The skin color analysis circuit 300 obtains a plurality of second color component values ​​and a plurality of second base numbers N2 by counting the second color component V in the skin color area 740. The second color component values ​​and the second base number N2 are represented by a histogram, which is a second histogram (as shown in FIG. Figure 7 ). Among them, Figure 6 The X-axis is the first color component U, and the Y-axis is the number corresponding to each first color component value, that is, the first cardinality N1. Figure 7 The X-axis is the second color component V, and the Y-axis is the number corresponding to each second color component value, that is, the second cardinality N2.

[0078] Continued reference Figure 4 , Figure 6 and Figure 7. Step S150, in some embodiments, the color gamut acquisition circuit 400 is used to obtain the second color gamut 820 and the weight center 830 according to the skin color category, the first cardinality N1, the first color component value, the second cardinality N2, and the second color component value. Specifically, in some embodiments, since some of the first color component values ​​and some of the second color component values ​​do not belong to the corresponding race of the skin color category, the color gamut acquisition circuit 400 needs to remove these first color component values ​​and second color component values ​​first. For example, the skin color range of Asians cannot include pixels (i.e., grayscale pixels) with the first color component U being 0 (U=0) and the second color component V being 0 (V=0), so the color gamut acquisition circuit 400 removes the values ​​of the first color component U being 0 and the second color component V being 0 and the corresponding first cardinality N1 and second cardinality N2. Alternatively, in some embodiments, the color gamut acquisition circuit 400 can also remove the first color component value and the second color component value that do not belong to the first color gamut 810 based on the color components in the first color gamut 810 as a reference. Then, the color gamut obtaining circuit 400 obtains the second color gamut 820 and the weight center 830 from the remaining first cardinality N1, the first color component value, the second cardinality N2, and the second color component value.

[0079] Figure 8 A flowchart of the color gamut acquisition process (I) of some embodiments of the present invention is shown. Figures 6 to 8 In some embodiments, a color gamut acquisition procedure is used to obtain a second color gamut 820 and a weight center 830, wherein the color gamut acquisition procedure includes the following steps: obtaining a weight center 830 based on a first color component U corresponding to a first maximum value M1 in a first cardinality N1 and a second color component V corresponding to a second maximum value M2 in a second cardinality N2 (step S151A); obtaining a first threshold T1 based on a first maximum value M1 in a first cardinality N1 and a first coefficient (step S152A); obtaining a second threshold T2 based on a second maximum value M2 in a second cardinality N2 and a second coefficient (step S153A); setting a first cardinality N1 greater than or equal to the first threshold T1 as a plurality of first selected cardins (step S154A); setting a second cardinality N2 greater than or equal to the second threshold T2 as a plurality of second selected cardins (step S155A); and obtaining a second color gamut 820 based on the first selected cardinality, the first color component value, the second selected cardinality, and the second color component value (step S156A).

[0080] Reference Figure 3 , Figures 6 to 8, step S151A, in some embodiments, the color gamut acquisition circuit 400 obtains the weight center 830 according to the first color component value corresponding to the first maximum value M1 in the first cardinality N1 and the second color component value corresponding to the second maximum value M2 in the second cardinality N2. Specifically, the first maximum value is the maximum value in the first cardinality N1, and the second maximum value M2 is the maximum value in the second cardinality N2. That is, the color gamut acquisition circuit 400 uses the mode of the first color component value and the mode of the second color component value as the weight center 830.

[0081] Reference Figure 3 , Figures 6 to 8 , step S152A and step S153A, in some embodiments, the color gamut acquisition circuit 400 obtains the first threshold T1 according to the first maximum value M1 in the first base N1 and the first coefficient. The color gamut acquisition circuit 400 obtains the second threshold T2 according to the first maximum value M1 in the second base N2 and the second coefficient. Specifically, the color gamut acquisition circuit 400 uses the product of the first maximum value M1 and the first coefficient as the first threshold T1, and uses the product of the second maximum value M2 and the second coefficient as the second threshold T2. For example, when the first coefficient is 60%, it means that the first threshold T1 is 60% of the first maximum value M1. When the second coefficient is 60%, it means that the second threshold T2 is 60% of the second maximum value M2.

[0082] Reference Figure 3 , Figures 6 to 8 , step S154A and step S155A, in some embodiments, the color gamut acquisition circuit 400 selects a first cardinality N1 greater than or equal to the first threshold T1 as a plurality of first selected cardinality. The color gamut acquisition circuit 400 selects a second cardinality N2 greater than or equal to the second threshold T2 as a plurality of second selected cardinality. Specifically, the first cardinality N1 corresponding to the first color component value must be greater than or equal to the first threshold T1 to be selected as the first selected cardinality. The second cardinality N2 corresponding to the second color component value must be greater than or equal to the second threshold T2 to be selected as the second selected cardinality.

[0083] Reference Figure 3 , Figures 6 to 8 , step S156A, in some embodiments, the color gamut obtaining circuit 400 obtains the second color gamut 820 according to the first selected cardinality, the first color component value, the second selected cardinality, and the second color component value. Specifically, when the color gamut obtaining circuit 400 represents the first selected cardinality, the first color component value corresponding to the first selected cardinality, the second selected cardinality, and the second color component value corresponding to the second selected cardinality on the UV color plane 800, it is the second color gamut 820, wherein the first color component value corresponding to the first selected cardinality and the second color component value corresponding to the second selected cardinality are first processed by the aforementioned normalization method.

[0084] Fig. 9 A flowchart of the color gamut acquisition process (II) of some embodiments of the present invention is shown. Figure 6 , Figure 7 and Fig. 9 In some embodiments, the color gamut obtaining procedure is used to obtain the second color gamut 820 and the weight center 830, wherein the color gamut obtaining procedure includes the following steps: obtaining a plurality of first correction bases, a plurality of first correction color component values, a plurality of second correction bases, and a plurality of second correction color component values ​​according to the skin color category, the first base N1, the first color component value, the second base N2, and the second color component value (step S151B); obtaining the weight center 830 according to the first correction color component value corresponding to the first maximum value M1 in the first correction base and the second correction color component value corresponding to the second maximum value M2 in the second correction base (step S152B); Based on the first maximum value M1 and the first coefficient in the first correction base, the first threshold T1 is obtained (step S153B); based on the second maximum value M2 and the second coefficient in the second correction base, the second threshold T2 is obtained (step S154B); the first correction base that is greater than or equal to the first threshold T1 is set as a plurality of first selected bases (step S155B); the second correction base that is greater than or equal to the second threshold T2 is set as a plurality of second selected bases (step S156B); and, based on the first selected base, the first correction color component value, the second selected base, and the second correction color component value, the second color gamut 820 is obtained (step S157B).

[0085] Step S151B, in some embodiments, the color gamut acquisition circuit 400 obtains a plurality of first correction bases, a plurality of first correction color component values, a plurality of second correction bases, and a plurality of second correction color component values ​​according to the skin color category, the first base N1, the first color component value, the second base N2, and the second color component value. The color gamut acquisition circuit 400 can determine which first color component values ​​and second color component values ​​do not belong to the corresponding race of the skin color category by the skin color category. Therefore, the color gamut acquisition circuit 400 removes the first color component values ​​and the second color component values ​​that do not belong to the skin color category from the first color component values ​​and the second color component values ​​to obtain the first correction color component value and the second correction color component value. The first base N1 corresponding to the first correction color component value is the first correction base, and the second base N2 corresponding to the second correction color component value is the second correction base. Therefore, the color gamut acquisition circuit 400 can obtain the first correction base and the second correction base again. The main difference between the color gamut acquisition procedure (two) and the color gamut acquisition procedure (one) is that the first base number N1, the first color component value, the second base number N2, and the second color component value are firstly eliminated by the color gamut acquisition circuit 400 according to the skin color category to obtain the first correction base number, the first correction color component value, the second correction base number, and the second correction color component value.

[0086] Step S152B, in some embodiments, the color gamut acquisition circuit 400 obtains the weight center 830 according to the first correction color component value corresponding to the first maximum value M1 in the first correction base and the second correction color component value corresponding to the second maximum value M2 in the second correction base. Specifically, the first maximum value M1 is the maximum value in the first correction base, and the second maximum value M2 is the maximum value in the second correction base. That is, the color gamut acquisition circuit 400 uses the mode of the first correction color component value and the mode of the second correction color component value as the weight center 830.

[0087] Step S153B and step S154B, in some embodiments, the color gamut acquisition circuit 400 obtains the first threshold T1 according to the first maximum value M1 in the first correction base and the first coefficient. The color gamut acquisition circuit 400 obtains the second threshold T2 according to the second maximum value M2 in the second correction base and the second coefficient. Specifically, the color gamut acquisition circuit 400 uses the product of the first maximum value M1 and the first coefficient as the first threshold T1, and uses the product of the second maximum value M2 and the second coefficient as the second threshold T2. For example, when the first coefficient is 60%, it means that the first threshold T1 is 60% of the first maximum value M1. When the second coefficient is 60%, it means that the second threshold T2 is 60% of the second maximum value M2.

[0088] Step S155B and step S156B, in some embodiments, the color gamut acquisition circuit 400 selects a first correction base greater than or equal to the first threshold T1 as a plurality of first selected bases. The color gamut acquisition circuit 400 selects a second correction base greater than or equal to the second threshold T2 as a plurality of second selected bases. Specifically, the first correction base corresponding to the first correction color component value must be greater than or equal to the first threshold T1 to be selected as the first selected base. The second correction base corresponding to the second correction color component value must be greater than or equal to the second threshold T2 to be selected as the second selected base.

[0089] Step S157B, in some embodiments, the color gamut obtaining circuit 400 obtains the second color gamut 820 according to the first selected cardinality, the first corrected color component value, the second selected cardinality, and the second corrected color component value. Specifically, when the color gamut obtaining circuit 400 represents the first selected cardinality, the first corrected color component value corresponding to the first selected cardinality, the second selected cardinality, and the second corrected color component value corresponding to the second selected cardinality on the UV color plane 800, the second color gamut 820 is obtained, wherein the first corrected color component value corresponding to the first selected cardinality and the second corrected color component value corresponding to the second selected cardinality are first processed by the aforementioned normalization method.

[0090] Fig.10 A schematic diagram showing weight regions of some embodiments of the present invention is shown. Fig.11A partial enlarged schematic diagram of the weight area of ​​some embodiments of the present invention is shown. Fig.12 A schematic diagram of the first weight region of some embodiments of the present invention is shown. Fig.13 A schematic diagram of the second weight region of some embodiments of the present invention is shown. Figure 3 , Figure 4 , Figures 10 to 13 , step S160, in some embodiments, the skin color gamut weight map obtaining circuit 500 obtains the first weight area 840 and the second weight area 850 according to the first color gamut 810 and the second color gamut 820. Specifically, according to some embodiments, the first weight area 840 is the difference between the first color gamut 810 and the second color gamut 820. The second weight area 850 is the intersection of the first color gamut 810 and the second color gamut 820. Therefore, when the first color gamut 810 covers the second color gamut 820, Fig.12 The first weight region 840 is equal to Figure 3 The area remaining after subtracting the second color gamut 820 from the first color gamut 810, and Fig.13 The second weight region 850 is equal to Figure 3 The area of ​​the second color gamut 820.

[0091] Continued reference Figure 3 , Figure 4 , Figures 10 to 13 , step S170, in some embodiments, the skin color gamut weight map acquisition circuit 500 is used to obtain the skin color gamut weight map corresponding to the skin color area 740 according to the weight center 830, the first weight area 840, and the second weight area 850. Specifically, according to some embodiments, the skin color gamut weight map includes each color component related to the skin color and the weight value represented by each color component. The skin color gamut weight map acquisition circuit 500 obtains a plurality of first weight color blocks 870 from the first weight area 840, and obtains a plurality of second weight color blocks 880 from the second weight area 850. The first weight color blocks 870 and the second weight color blocks 880 are the color components related to the skin color in the skin color gamut weight map. The skin color gamut weight map acquisition circuit 500 then obtains the weight values ​​of the first weight color blocks 870 and the second weight color blocks 880 by the distance between the weight center 830 and each first weight color block 870 and each second weight color block 880. Therefore, the skin color gamut weight map obtaining circuit 500 can obtain the skin color gamut weight map corresponding to the skin color area 740 .

[0092] Fig.14 A flowchart of a skin color gamut weight map obtaining process in some embodiments of the present invention is shown. Fig.15 A diagram illustrating the relationship between the first weight distance d1 and the first weight function w1 (d1) according to some embodiments of the present invention is shown. Fig.16 A diagram showing the relationship between the second weight distance d2 and the second weight function w2(d2) in some embodiments of the present invention is shown. Fig.11 , Figures 14 to 16 In some embodiments, a skin color gamut weight map acquisition procedure is used to obtain a skin color gamut weight map, wherein the skin color gamut weight map acquisition procedure includes the following steps: based on the first weight area 840, a plurality of first weight color blocks 870 are obtained (step S171); based on the second weight area 850, a plurality of second weight color blocks 880 are obtained (step S172); based on the weight center 830, the first weight color block 870 and the second weight color block 880, the weight center coordinates and the plurality of weight color block coordinates are obtained (step S173); based on the weight center coordinates and the weight The heavy color block coordinates, the first weight area 840, and the second weight area 850 are used to obtain multiple first weight distances d1 and multiple second weight distances d2 (step S174); based on the first weight distance d1 and the second weight distance d2, the first weight function w1(d1) and the second weight function w2(d2) are obtained (step S175); and, based on the first weight color block 870, the second weight color block 880, the first weight function w1(d1), and the second weight function w2(d2), a skin color gamut weight map is obtained (step S176).

[0093] Reference Fig.11 and Fig.14 , step S171 and step S172, in some embodiments, the skin color gamut weight map obtaining circuit 500 obtains a plurality of first weighted color blocks 870 according to the first weight area 840. The skin color gamut weight map obtaining circuit 500 obtains a plurality of second weighted color blocks 880 according to the second weight area 850. Specifically, the skin color gamut weight map obtaining circuit 500 divides the first weight area 840 and the second weight area 850 into unit color blocks, wherein the unit color block in the first weight area 840 is the first weighted color block 870, and the unit color block in the second weight area 850 is the first weighted color block 870. According to some embodiments, the UV color plane 800 uses 1 / 128 as the unit length and unit width of the unit color block, so the UV color plane 800 has 128*128 unit color blocks.

[0094] Reference Fig.11 and Fig.14, step S173, in some embodiments, the skin color gamut weight map acquisition circuit 500 obtains the weight center coordinates and multiple weight color block coordinates based on the weight center 830, the first weight color block 870 and the second weight color block 880. Specifically, the weight center coordinates are the coordinates of the center point of the weight center 830 on the UV color plane 800. Therefore, the skin color gamut weight map acquisition circuit 500 can obtain the weight center coordinates by normalizing the first color component value corresponding to the first maximum value M1 and the second color component value corresponding to the second maximum value M2. The weight color block coordinates are the coordinates of the center points of the first weight color block 870 and the second weight color block 880 on the UV color plane 800. Therefore, when the skin color gamut weight map acquisition circuit 500 cuts out the first weight color block 870 and the second weight color block 880 from the first weight area 840 and the second weight area 850, the weight color block coordinates can be obtained.

[0095] Reference Fig.11 and Fig.14 , step S174, in some embodiments, the skin color gamut weight map acquisition circuit 500 obtains multiple first weight distances d1 and multiple second weight distances d2 based on the weight center coordinates and the weight color block coordinates, the first weight area 840, and the second weight area 850. Specifically, according to some embodiments, if the first weight area 840 and the second weight area 850 are located in the first weight area 840 and the second weight area 850. Since the first weight area 840 is included in the periphery of the second weight area 850, the line between the first weight color block 870 and the weight center 830 will intersect at a point on the boundary between the first weight area 840 and the second weight area 850, hereinafter referred to as the weight critical point 860. Assume that the weight color block coordinates of the first weight color block 870 are (U1, V1), the weight color block coordinates of the second weight color block 880 are (U2, V2), and the weight center coordinates are (U C , V C ), the coordinates of the weight boundary point 860 are (U B , V B ). Then the first weight distance d1 is equal to the distance from the weighted color block coordinate (U1, V1) to the weighted boundary point 860 coordinate (U B , V B ), the second weight distance d2 is equal to the distance between the weighted color block coordinates (U2, V2) and the weight center coordinates (U C , V C ), the formula is as follows.

[0096]

[0097]

[0098] Reference Fig.11 , Fig.15 and Fig.16 , step S175, in some embodiments, the skin color gamut weight map acquisition circuit 500 obtains the first weight function w1(d1) and the second weight function w2(d2) according to the first weight distance d1 and the second weight distance d2. Specifically, in some embodiments, Fig.15 and Fig.16 The Y axis is the weight coefficient w, Fig.15 The X-axis is the first weight distance d1, Fig.16 The X-axis is the second weight distance d2. Assume that the weight direction 890 of the first weighted color block 870 is from the weighted boundary point 860 to the first weighted color block 870, and the weight direction 890 of the second weighted color block 880 is from the weighted center 830 to the second weighted color block 880. The first weight function w1(d1) and the second weight function w2(d2) are both linear functions. The first weight function w1(d1) and the second weight function w2(d2) are as follows:

[0099]

[0100]

[0101] Wherein, T1 is the first weight percentage, T2 is the second weight percentage, and the first weight percentage T1 and the second weight percentage T2 are constants. D1 is the maximum value among the first weight distances d1 corresponding to the first weight color block 870 in the weight direction 890 corresponding to the first weight color block 870. D2 is the maximum value among the second weight distances d2 corresponding to the second weight color block 880 in the weight direction 890 corresponding to the second weight color block 880.

[0102] Reference Fig.15 , in some embodiments, the second weight percentage T2 is 30%. The first weighted color block 870 (i.e., the weighted boundary point 860) located at the first weighted distance d1=0 has a first weight function w1(d1)=30%. The first weighted color block 870 (i.e., the first weighted color block 870 on the outer edge of the first weighted area 840) located at the first weighted distance d1=D1 has a first weight function w1(d1)=0. Therefore, the first weight function w1(d1) is as follows.

[0103]

[0104] Reference Fig.16In some embodiments, the first weight percentage T1 is 100% and the second weight percentage T2 is 30%. The second weighted color block 880 (i.e., the weighted center 830) located at the second weighted distance d2=0 has a second weight function w2(d2)=100%. The second weighted color block 880 (i.e., the weighted boundary point 860) located at the second weighted distance d2=D2 has a second weight function w2(d2)=30%. Therefore, the second weight function w2(d2) is as follows.

[0105]

[0106] It should be particularly noted that the first weight percentage T1 and the second weight percentage T2 are merely examples, and the present invention is not limited thereto.

[0107] Continued reference Fig.11 , Fig.15 and Fig.16 , step S176, in some embodiments, the skin color gamut weight map acquisition circuit 500 obtains a skin color gamut weight map based on the first weight color block 870, the second weight color block 880, the first weight function w1(d1) and the second weight function w2(d2). Specifically, since the skin color gamut weight map includes various color components related to the skin color of the character image 720, and the weight values ​​corresponding to these color components. Therefore, the first weight color block 870 and the second weight color block 880 obtained by the skin color gamut weight map acquisition circuit 500 are the various color components related to the skin color of the character image 720. The skin color gamut weight map acquisition circuit 500 can obtain the weight coefficient w corresponding to the first weight color block 870 and the second weight color block 880 by the first weight function w1(d1) and the second weight function w2(d2). Therefore, the skin color gamut weight map acquisition circuit 500 obtains the skin color gamut weight map.

[0108] In summary, the color gamut weight detection method and device for skin color images proposed in some embodiments of the present invention can obtain a skin color gamut weight map of the skin color area of ​​the person image based on an image having a person image. The skin color gamut weight map is the skin color gamut of the person image and the weight values ​​corresponding to each color block in the skin color gamut. In some embodiments, the user can further adjust the skin color of the person image in the image separately by using the skin color gamut weight map without affecting other parts of the image to meet the user's needs.

Claims

1. A color gamut weight detection method for skin color images, comprising: An image is received, the image having an image of a person, the image comprising a plurality of pixels, each of the pixels comprising: a first color component; and a second color component; Obtaining a skin color region of the person image, a skin color category corresponding to the skin color region, and a first color range corresponding to the skin color category according to a skin color determination procedure; According to the first color components in the skin color area, a plurality of first color component values ​​and a plurality of first cardinal numbers are obtained, wherein the first cardinal number is the number corresponding to the first color component values; According to the second color components in the skin color area, a plurality of second color component values ​​and a plurality of second base numbers are obtained, wherein the second base number is the number corresponding to the second color component values; Obtaining a second color gamut and a weight center according to the skin color category, the first bases, the first color component values, the second bases, and the second color component values; Obtaining a first weight region and a second weight region according to the first color domain and the second color domain; and According to a skin color gamut weight map obtaining procedure, a skin color gamut weight map corresponding to the skin color area is obtained, The procedure for obtaining the skin color gamut weight map includes: According to the first weight region, a plurality of first weight color blocks are obtained; According to the second weight area, a plurality of second weight color blocks are obtained; Obtaining a weight center coordinate and a plurality of weight color block coordinates according to the weight center, the first weight color blocks and the second weight color blocks; Obtaining a plurality of first weighted distances and a plurality of second weighted distances according to the weighted center coordinates and the weighted color block coordinates, the first weighted region, and the second weighted region; Obtaining a plurality of first weight functions and a plurality of second weight functions according to the first weight distances and the second weight distances; and The skin color gamut weight map is obtained according to the first weighted color blocks, the second weighted color blocks, the first weight functions, and the second weight functions.

2. The color gamut weight detection method of skin color image according to claim 1, further comprising a color gamut obtaining procedure to obtain the second color gamut and the weight center, the color gamut obtaining procedure comprising: Obtaining the weight center according to the first color component value corresponding to a first maximum value among the first cardinal numbers and the second color component value corresponding to a second maximum value among the second cardinal numbers; Obtaining a first threshold value according to the first maximum value among the first base numbers and a first coefficient; Obtaining a second threshold value according to the second maximum value among the second base numbers and a second coefficient; Setting the first bases greater than or equal to the first threshold as a plurality of first selected bases; Setting the second base numbers that are greater than or equal to the second threshold as a plurality of second selected base numbers; and The second color gamut is obtained according to the first selected cardinal numbers, the first color component values, the second selected cardinal numbers, and the second color component values.

3. The color gamut weight detection method of skin color image according to claim 1, further comprising a color gamut obtaining procedure to obtain the second color gamut and the weight center, the color gamut obtaining procedure comprising: Obtaining a plurality of first correction bases, a plurality of first correction color component values, a plurality of second correction bases, and a plurality of second correction color component values ​​according to the skin color category, the first bases, the first color component values, the second bases, and the second color component values; Obtaining the weight center according to the first corrected color component value corresponding to a first maximum value among the first corrected bases and the second corrected color component value corresponding to a second maximum value among the second corrected bases; Obtaining a first threshold value according to the first maximum value among the first calibration bases and a first coefficient; Obtaining a second threshold value according to the second maximum value among the second calibration bases and a second coefficient; Setting the first calibration bases greater than or equal to the first threshold as a plurality of first selected bases; Setting the second calibration bases that are greater than or equal to the second threshold as a plurality of second selected bases; and The second color gamut is obtained according to the first selected bases, the first corrected color component values, the second selected bases, and the second corrected color component values.

4. The color gamut weight detection method of skin color image according to claim 1, wherein the skin color determination procedure comprises: Determining whether the image of the person exists in the image; According to the image, obtaining the skin color area of ​​the person image and a plurality of skin color area coordinates of the skin color area; Obtaining the skin color category and a confidence coefficient corresponding to the skin color category according to the pixels in the skin color area; and The first color gamut is obtained according to the skin color category.

5. A color gamut weight detection device for a skin color image, comprising: An image receiving circuit is used to receive an image having an image of a person. The image includes a plurality of pixels, each of which includes: a first color component; and a second color component; a skin color determination circuit, used for obtaining a skin color region of the person image, a skin color category corresponding to the skin color region, and a first color range corresponding to the skin color category according to a skin color determination procedure; a skin color analysis circuit, used for obtaining a plurality of first color component values ​​and a plurality of first bases according to the first color components in the skin color area, and for obtaining a plurality of second color component values ​​and a plurality of second bases according to the second color components in the skin color area, wherein the first base is the number corresponding to the first color component value, and the second base is the number corresponding to the second color component value; a color gamut obtaining circuit, for obtaining a second color gamut and a weight center according to the skin color category, the first bases, the first color component values, the second bases, and the second color component values; and a skin color gamut weight map obtaining circuit, for obtaining a first weight area and a second weight area according to the first color gamut and the second color gamut, and for obtaining a skin color gamut weight map corresponding to the skin color area according to the weight center, the first weight area, and the second weight area, Wherein, obtaining the skin color gamut weight map includes: According to the first weight region, a plurality of first weight color blocks are obtained; According to the second weight area, a plurality of second weight color blocks are obtained; Obtaining a weight center coordinate and a plurality of weight color block coordinates according to the weight center, the first weight color blocks and the second weight color blocks; Obtaining a plurality of first weighted distances and a plurality of second weighted distances according to the weighted center coordinates and the weighted color block coordinates, the first weighted region, and the second weighted region; Obtaining a plurality of first weight functions and a plurality of second weight functions according to the first weight distances and the second weight distances; and The skin color gamut weight map is obtained according to the first weighted color blocks, the second weighted color blocks, the first weight functions, and the second weight functions.

6. The color gamut weight detection device of skin color image according to claim 5, wherein the color gamut acquisition circuit acquires the second color gamut and the weight center according to a color gamut acquisition procedure, and the color gamut acquisition procedure comprises: Obtaining a first threshold value according to a maximum value among the first base numbers and a first coefficient; Obtaining a second threshold value according to a maximum value among the second base numbers and a second coefficient; Setting the first bases greater than or equal to the first threshold as a plurality of first selected bases; Setting the second base numbers that are greater than or equal to the second threshold as a plurality of second selected base numbers; and The second color gamut is obtained according to the first selected cardinal numbers, the first color component values, the second selected cardinal numbers, and the second color component values.

7. The color gamut weight detection device of skin color image according to claim 5, wherein the color gamut acquisition circuit acquires the second color gamut and the weight center according to a color gamut acquisition procedure, and the color gamut acquisition procedure comprises: Obtaining a plurality of first correction bases, a plurality of first correction color component values, a plurality of second correction bases, and a plurality of second correction color component values ​​according to the skin color category, the first bases, the first color component values, the second bases, and the second color component values; Obtaining a first threshold value according to a maximum value among the first calibration bases and a first coefficient; Obtaining a second threshold value according to a maximum value among the second calibration bases and a second coefficient; Setting the first calibration bases greater than or equal to the first threshold as a plurality of first selected bases; Setting the second calibration bases that are greater than or equal to the second threshold as a plurality of second selected bases; and The second color gamut is obtained according to the first selected bases, the first corrected color component values, the second selected bases, and the second corrected color component values.

8. The color gamut weight detection device of skin color image according to claim 5, wherein the skin color determination procedure comprises: Determining whether the image of the person exists in the image; According to the image, obtaining the skin color area of ​​the person image and a plurality of skin color area coordinates of the skin color area; Obtaining the skin color category and a confidence coefficient corresponding to the skin color category according to the pixels in the skin color area; and The first color gamut is obtained according to the skin color category.