Image processing apparatus, method, device and storage medium

By converting video stream pixels to the HSV color space in an image processing device and calculating skin color weights using three-dimensional and two-dimensional lookup tables, the problem of low accuracy in hardware implementation of traditional skin color detection schemes is solved, and the adaptability and accuracy of skin color detection are improved.

CN117221550BActive Publication Date: 2025-11-07HAINING ESWIN IC DESIGN CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311215065.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-19
Publication Date
2025-11-07
Estimated Expiration
2043-09-19

AI Technical Summary

Technical Problem

Traditional skin color detection solutions have low accuracy when implemented in hardware and are difficult to adapt to changes in lighting, light intensity, and ethnicity in different scenarios.

Method used

An image processing device is used to convert each pixel of the video stream to be processed to the HSV color space. Skin color weights are calculated using three-dimensional and two-dimensional lookup tables. Combined with preprocessing and enhancement modules, the accuracy of skin color detection is improved.

Benefits of technology

While controlling hardware computing and storage costs, the accuracy of skin color detection has been improved, making it adaptable to more skin color detection scenarios, including different ambient light sources, light intensities, and ethnic conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117221550B_ABST
    Figure CN117221550B_ABST
Patent Text Reader

Abstract

The present disclosure provides an image processing device, method, equipment and storage medium, which can be applied to the technical field of image processing. The image processing device comprises: a preprocessing module configured to preprocess each image frame of a to-be-processed video stream to obtain a first processed image; a first determination module configured to determine the hue, saturation and brightness of each pixel in the first processed image; a second determination module configured to determine the skin color weight of each pixel in the first processed image according to the hue, saturation and brightness; and a third determination module configured to determine a skin color region in the first processed image according to the skin color weight of each pixel and a preset skin color threshold.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of image processing, and in particular, to an image processing apparatus, method, device, storage medium and program product. BACKGROUND

[0002] Human eyes are generally more inclined to see photos with bright and colorful colors, which can bring greater visual impact. However, human beings have the prior characteristics of memory for skin color and are highly sensitive to changes in skin color, so the skin color can be detected and treated as a special processing object.

[0003] Traditional skin color detection schemes generally include threshold method, Gaussian model method, histogram method, neural network method, Bayesian decision method and mixed schemes of various detection schemes. Although some of the above schemes are easy to be hardwareized, the detection accuracy is low. SUMMARY

[0004] The present disclosure provides an image processing apparatus, method, device, storage medium and program product.

[0005] According to a first aspect of an embodiment of the present disclosure, an image processing apparatus is provided, comprising: a preprocessing module configured to preprocess each image frame of a to-be-processed video stream to obtain a first processing image; a first determination module configured to determine a hue, a saturation and a brightness of each pixel in the first processing image; a second determination module configured to determine a skin color weight of each pixel in the first processing image according to the hue, the saturation and the brightness; and a third determination module configured to determine a skin color region in the first processing image according to the skin color weight of each pixel and a preset skin color threshold.

[0006] According to an embodiment of the present disclosure, the second determination module is further configured to: obtain a three-dimensional lookup table, the three-dimensional lookup table comprising a plurality of groups of first reference data, each group of first reference data comprising a reference hue, a reference saturation, a reference brightness and a corresponding reference skin color weight; and perform interpolation in the three-dimensional lookup table based on the hue, the saturation and the brightness to obtain the skin color weight of each pixel in the first processing image.

[0007] According to an embodiment of the present disclosure, the second determination module is further configured to: obtain a plurality of sample images with skin color attributes, the skin color attributes comprising an ambient light source, an illumination intensity, a gender, an age, a race and a skin part; preprocess each sample image to obtain a second processing image; determine a hue, a saturation and a brightness of each pixel in the second processing image; and use the hue, the saturation and the brightness of each pixel in the second processing image to obtain the three-dimensional lookup table.

[0008] According to an embodiment of the present disclosure, the second determining module is further configured to: remove non-skin color regions from the second processed image; and obtain the three-dimensional look-up table using the hue, the saturation and the brightness of each pixel in the second processed image after the non-skin color regions are removed.

[0009] According to an embodiment of the present disclosure, the second determining module is further configured to: convert the three-dimensional look-up table into a first two-dimensional look-up table and a second two-dimensional look-up table, the first two-dimensional look-up table including a plurality of groups of second reference data based on a first brightness threshold, the second two-dimensional look-up table including a plurality of groups of second reference data based on a second brightness threshold, each group of second reference data including a reference hue, a reference saturation and a corresponding reference skin color weight; interpolate the hue and the saturation in the first two-dimensional look-up table and the second two-dimensional look-up table respectively to obtain a first skin color weight and a second skin color weight; and determine the skin color weight of each pixel in the first processed image according to the brightness, the first brightness threshold, the second brightness threshold, the first skin color weight and the second skin color weight.

[0010] According to an embodiment of the present disclosure, the preprocessing module pre-processes each image frame of the to-be-processed video stream, including: denoising a plurality of image frames of the to-be-processed video stream to obtain N denoised images, N being an integer greater than 1; and for an i-th denoised image in the N denoised images, adjusting a gray value of each pixel of the i-th denoised image according to a gray value of each pixel of an (i-1)-th denoised image, 1

[0011] According to an embodiment of the present disclosure, adjusting the gray value of each pixel of the i-th denoised image according to the gray value of each pixel of the (i-1)-th denoised image includes: performing histogram statistics on a plurality of gray values of the pixels in the (i-1)-th denoised image to obtain statistical parameters, the statistical parameters including a maximum gray value, a minimum gray value, an adaptive adjustment range threshold and a global adaptive brightness gain; and adjusting each pixel of the i-th denoised image according to the statistical parameters of the (i-1)-th denoised image.

[0012] According to an embodiment of the present disclosure, the skin color region includes at least one skin color pixel; and the third determining module is further configured to: for each pixel in the first processed image, in a case where the skin color weight of the pixel is determined to be greater than a preset skin color threshold, determining the pixel as a skin color pixel and performing a protection operation on the skin color pixel.

[0013] According to an embodiment of the present disclosure, the image processing apparatus further comprises an enhancement processing module configured to: for each pixel in the first processed image, if it is determined that the skin color weight of the pixel is greater than a preset skin color threshold, determine a skin color protection gain according to the skin color weight of the pixel; if it is determined that the skin color weight of the pixel is less than or equal to the preset skin color threshold, determine a color enhancement gain according to the skin color weight of the pixel; fuse the skin color protection gain and the color enhancement gain in the first processed image to obtain a fused gain; and perform enhancement processing on the first processed image using the fused gain to obtain an enhanced image.

[0014] According to a second aspect of an embodiment of the present disclosure, an electronic device is provided, comprising the image processing apparatus described above.

[0015] According to a third aspect of an embodiment of the present disclosure, an image processing method is provided, comprising: performing preprocessing on each image frame of a to-be-processed video stream to obtain a first processed image; determining a hue, a saturation and a brightness of each pixel in the first processed image; determining a skin color weight of each pixel in the first processed image according to the hue, the saturation and the brightness; and determining a skin color region in the first processed image according to the skin color weight of each pixel and a preset skin color threshold.

[0016] According to a fourth aspect of an embodiment of the present disclosure, an electronic device is provided, comprising: one or more processors; a memory configured to store one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the above method.

[0017] According to a fifth aspect of an embodiment of the present disclosure, a computer readable storage medium is provided, having stored thereon executable instructions that, when executed by a processor, cause the processor to perform the above method.

[0018] According to a sixth aspect of an embodiment of the present disclosure, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the above method.

[0019] According to the technical solution of the present disclosure, each pixel of each image frame of the to-be-processed video stream is converted to the HSV color space, the skin color weight corresponding to the current pixel is calculated according to the H, S and V values of each pixel, and it is determined whether the current pixel belongs to a skin color pixel according to the skin color weight and the preset skin color threshold, so as to determine the skin color region of each image. In this way, on the basis of controlling the hardware operation cost and storage cost of the image quality improvement chip, the accuracy of skin color detection under different scene environment light sources, different light intensities and different ethnic conditions can be improved, and more skin color detection scenes can be adapted. BRIEF DESCRIPTION OF DRAWINGS

[0020] The above and other objects, features and advantages of the present disclosure will become more apparent from the following description when taken in conjunction with the accompanying drawings, in which:

[0021] Figure 1 A structural schematic diagram of an image processing apparatus according to an embodiment of the present disclosure is shown;

[0022] Figure 2 A principle schematic diagram of a pre-processing module according to an embodiment of the present disclosure is shown;

[0023] Figure 3 A structural schematic diagram of an HSV color model according to an embodiment of the present disclosure is shown;

[0024] Figure 4 A principle schematic diagram of a three-dimensional look-up table according to an embodiment of the present disclosure is shown;

[0025] Figure 5A A principle schematic diagram of interpolation of a three-dimensional look-up table according to an embodiment of the present disclosure is shown;

[0026] Figure 5B A principle schematic diagram of interpolation of a two-dimensional look-up table according to an embodiment of the present disclosure is shown;

[0027] Figure 6 A structural schematic diagram of an image processing apparatus according to another embodiment of the present disclosure is shown;

[0028] Figure 7 A flowchart of an image processing method according to an embodiment of the present disclosure is shown;

[0029] Figure 8A A flowchart of an image processing method according to another embodiment of the present disclosure is shown;

[0030] Figure 8B A flowchart of a skin color protection operation and a color enhancement operation according to another embodiment of the present disclosure is shown;

[0031] Figure 9 A block diagram of an electronic device suitable for implementing the image processing method according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0032] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It is to be understood, however, that the description is merely exemplary of the present disclosure, and is not intended to limit the scope of the present disclosure. In the following detailed description of the embodiments of the present disclosure, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure. However, it will be apparent to one skilled in the art that one or more embodiments of the present disclosure can be practiced without these specific details. In other instances, well-known structures and functions have not been described in detail in order to avoid obscuring aspects of the present disclosure.

[0033] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. As used herein, the terms "comprises", "comprising", "includes", "including" and the like are specifically intended to be open-ended and to mean that other features, steps, operations, and / or components can be added and / or are included.

[0034] All terms used herein, including technical and scientific terms, have the meanings commonly understood by one of ordinary skill in the art unless otherwise defined herein. It should be noted that the terms used herein are defined as having meanings that are consistent with the context of the specification in which the terms are used and should not be interpreted in an overly idealized or overly formal way.

[0035] In the case of using expressions similar to "at least one of A, B, and C, etc.", it should generally be interpreted to include any of them, to include, for example, a system having at least one of A, B, or C, a system having A alone, a system having B alone, a system having C alone, a system having both A and B, a system having both A and C, a system having both B and C, and / or a system having A, B, and C, etc.

[0036] In the technical solutions of the disclosure, the collection, storage, use, processing, transmission, provision, disclosure, and application of data (such as including but not limited to user personal information) are in line with the relevant legal regulations, necessary security measures are taken, and the public order and good customs are not violated.

[0037] In the process of implementing the concept of the disclosure, the inventors have found that skin color is essentially an external manifestation of skin physical properties determined by biological characteristics, and has its own unique properties. In actual applications, the collection of skin color depends on equipment and imaging light sources, and the manifestation of skin color has illumination dependence and imaging light source dependence. In other words, the same piece of skin, under the same light source, is manifested by different imaging equipment, and the color of the image has certain differences. At the same time, the same collection equipment collects the color of the same piece of skin under different light sources and different light intensities, and the manifestation of the skin also has differences. In addition, different races of different skin colors and different age groups of these races of skin colors also have certain differences, which are all factors that restrict the accuracy of skin color detection.

[0038] In view of this, the embodiments of the disclosure provide an image processing apparatus, method, device, storage medium, and program product. Through the embodiments of the disclosure, the accuracy of skin color detection in different scenarios can be improved, more races and more skin color detection scenarios can be adapted to the needs, and the embodiments of the disclosure can be applied to a picture quality improvement chip.

[0039] In the following, various embodiments according to the disclosure will be described in detail with reference to the accompanying drawings.

[0040] Figure 1 A schematic diagram of the structure of an image processing apparatus according to an embodiment of the present disclosure is shown.

[0041] like Figure 1 As shown, the image processing apparatus 100 of this embodiment includes a preprocessing module 110, a first determination module 120, a second determination module 130, and a third determination module 140.

[0042] The preprocessing module 110 is configured to preprocess each image frame of the video stream to be processed to obtain a first processed image.

[0043] The first determining module 120 is configured to determine the hue, saturation, and brightness of each pixel in the first processed image.

[0044] The second determining module 130 is configured to determine the skin color weight of each pixel in the first processed image based on hue, saturation, and brightness.

[0045] The third determining module 140 is configured to determine the skin color region in the first processed image based on the skin color weight of each pixel and a preset skin color threshold.

[0046] In the embodiments of this disclosure, each pixel of each image frame of the video stream to be processed is converted to the HSV color space, where H represents hue, S represents saturation, and V represents luminance. Based on the H, S, and V values ​​of each pixel, the skin tone weight corresponding to the current pixel is calculated. Based on this skin tone weight and a preset skin tone threshold, it is determined whether the current pixel belongs to a skin tone pixel, thus identifying the skin tone region of each image. In this way, while controlling the hardware computation and storage costs of the image quality improvement chip, the accuracy of skin tone detection under different scene lighting conditions, different light intensities, and different ethnicities can be improved, adapting to more skin tone detection scenarios.

[0047] Figure 2 A schematic diagram of a preprocessing module according to an embodiment of the present disclosure is shown.

[0048] like Figure 2 As shown, the preprocessing module 210 of this embodiment preprocesses each image frame of the video stream to be processed, including: denoising multiple image frames of the video stream to be processed to obtain N denoised images, where N is an integer greater than 1; for the i-th denoised image among the N denoised images, adjusting the grayscale value of each pixel of the i-th denoised image according to the grayscale value of each pixel of the (i-1)-th denoised image, where 1 < i ≤ N, and i is an integer.

[0049] For example, for the i-th image frame of the video stream to be processed, the i-th image frame is first denoised to obtain an i-th denoised image. Then, each pixel of the i-th denoised image is adjusted according to the statistical parameters of the (i-1)-th denoised image to obtain an i-th first processing image.

[0050] Through the embodiments of the present disclosure, the pre-processing module first performs denoising processing on the input image frame to avoid the influence of noise on skin color detection. Then, adaptive brightness equalization processing is performed on each denoised image to improve the overall light and dark level of the video image. For example, in a picture quality improvement chip, the gray value of the previous frame image can be counted, and the gray value of the current frame image is adjusted according to the gray value of the previous frame image to adjust the overall brightness of the picture and improve the accuracy of skin color detection.

[0051] For example, the adaptive brightness equalization processing can use a multi-scale Retinex algorithm, a gray scale equalization algorithm, a histogram adaptive equalization algorithm, etc.

[0052] In the embodiments of the present disclosure, adjusting the gray value of each pixel of the i-th denoised image according to the gray value of each pixel of the (i-1)-th denoised image includes: performing histogram statistics on a plurality of gray values of the pixels in the (i-1)-th denoised image to obtain statistical parameters, the statistical parameters including a maximum gray value, a minimum gray value, an adaptive adjustment range threshold, and a global adaptive brightness gain; and adjusting each pixel of the i-th denoised image according to the statistical parameters of the (i-1)-th denoised image.

[0053] Through the embodiments of the present disclosure, histogram adaptive equalization processing can be performed on each denoised image to adjust the overall gray scale of the image. The pixel value of the current frame is adjusted using the data of the gray histogram of the previous frame, and the data of the gray histogram of the current frame is counted for the next frame operation. At the same time, in order to avoid the detection difference caused by the sudden change of brightness in the detection process, dynamic adjustment of the global adaptive brightness gain of multiple frames is needed to avoid the case that the skin color detection rate is significantly reduced due to the large difference in the overall change of the previous and subsequent frame images.

[0054] It should be noted that the histogram adaptive equalization processing statistics the maximum gray value, the minimum gray value, the adaptive adjustment range threshold and the global adaptive brightness gain of the gray histogram, and the statistics of these parameters requires a large amount of time. Considering that the experiment of the global data parameter statistics of the image is large, the hardware cost of the quality improvement chip manufacturing is affected, and the quality improvement chip cannot use the data of the current frame for the current frame calculation. Therefore, the hardware design uses the statistical parameters of the previous frame for the current frame calculation, that is, after the input image is denoised, the parameters required for adaptive brightness equalization of the current frame are used for the equalization processing of the next frame image, and the adaptive brightness equalization parameters obtained by the previous frame statistics are used for the adaptive brightness equalization processing of the current image. Moreover, in order to avoid the mutation of the picture, the global adaptive brightness gain parameters of multiple frames are counted, which can control the adaptive equalization strength of the whole picture to avoid the flicker problem of the displayed video.

[0055] For example, when the quality improvement chip performs histogram adaptive equalization processing, the following (1)-(4) control logic can be referred to:

[0056] (1) At the end of the Nth frame image, the quality improvement chip logic collects the statistical information about the gray histogram;

[0057] (2) The adaptive brightness adjustment algorithm predicts the control parameters of the N+1th frame according to the statistical data of the Nth frame;

[0058] (3) The firmware writes the adaptive brightness adjustment gain control parameters into the hardware register of the quality improvement chip before the N+1th frame image arrives;

[0059] (4) The N+1th frame image uses new adaptive brightness adjustment parameters for calculation.

[0060] Specifically, the histogram adaptive equalization processing can start from the gray value 0 of the gray histogram and accumulate the histogram upward, and when the accumulated value is greater than H_lowxm×n (m×n is the image resolution, and H_low is the minimum gray value), the lower limit T_min of the stretching of the image tone at this time is obtained; similarly, starting from the gray value 255 of the histogram, the histogram is accumulated downward, and when the accumulated value is greater than H_highxm×n (H_high is the maximum gray value), the upper limit T_max of the stretching of the image tone at this time is obtained.

[0061] After the range of the upper and lower limits of the gray scale [T_min, T_max] is calculated, the input RGB image data is adaptively gray scale mapped. The mapping rule can be: for the gray scale value less than T_min, the gray scale value is mapped to M_min; for the gray scale value greater than T_max, the gray scale value is mapped to M_max; for the gray scale value between T_min and T_max, the gray scale value is linearly mapped between [T_min, T_max].

[0062] The adjusted gray scale value is adjusted using a global adaptive brightness gain, and the mapping rule can be expressed as formula (1) as follows:

[0063]

[0064] In formula (1), P(i, j) and P'(i, j) are respectively the original gray scale value and the adjusted gray scale value of pixel (i, j); M_max and M_min are respectively the upper and lower limits of the adaptive adjustment range threshold.

[0065] For each image frame of the video stream to be processed, after the above denoising and adaptive brightness equalization processing, a first processed image is obtained.

[0066] In the embodiment of the present disclosure, the first determination module 120 is further configured to: convert the RGB (R is red, G is green, and B is blue) value of each pixel in the first processed image to obtain the hue, saturation, and brightness of each pixel.

[0067] Through the embodiment of the present disclosure, the first determination module converts the first processed data from the RGB color space to the HSV (H is hue, S is saturation, and V is brightness) color space, effectively separates the brightness information, color saturation and phase information, and avoids the influence of light on the determination of the image skin color weight.

[0068] For example, the RGB value of each pixel is converted to the HSV value through the HSV color model, which is used for subsequent skin color weight determination. The skin color weight needs to be determined according to the H, S, and V values in the HSV color model.

[0069] Figure 3 A structural schematic diagram of the HSV color model according to an embodiment of the present disclosure is shown.

[0070] As Figure 3As shown, the HSV color model 301 of this embodiment is a hexagonal pyramid model with three dimensions of H, S, and V. The brightness V is the brightness of the pixel, in the vertical direction, ranging from 0 to 1, with the lowest point of 0 representing black and the highest point of 1 representing white, from bottom to top, indicating that the pixel is brighter and brighter. The hue H is the rotation angle, ranging from 0° to 360°, and different rotation angles represent the corresponding hue. The saturation S is the radial proportion, ranging from 0 to 1.

[0071] Based on the above HSV color model 301, for any pixel in the first processed image, its RGB color space is (R, G, B), and its HSV color space is (H, S, V). First, convert the R, G, B values to between 0 and 1, and when the R, G, B bit width is 8 bits, that is, R'=R / 255, G'=G / 255, B'=B / 255. Then, let MAX be the maximum of R', G', and B', and let MIN be the minimum of R', G', and B', then convert the RGB value of the pixel to HSV value according to the following formulas (2)-(4):

[0072]

[0073]

[0074] V = MAX (4)

[0075] In the quality improvement chip design, the bit width of the above H, S, and V values can be expanded and the calculation accuracy can be controlled according to specific needs, and the bit width of the H, S, and V values calculated by the above formulas (2)-(4) can be controlled to about 10-12 bits to ensure the accuracy of the table lookup.

[0076] In the embodiments of the present disclosure, the second determination module 130 is further configured to: obtain a three-dimensional lookup table (3D Look Up Table, also referred to as 3D LUT), the three-dimensional lookup table includes a plurality of groups of first reference data, each group of first reference data includes a reference hue, a reference saturation, a reference brightness, and a corresponding reference skin color weight; and based on the hue, the saturation, and the brightness, interpolating in the three-dimensional lookup table to obtain the skin color weight of each pixel in the first processed image.

[0077] Through the embodiments of the present disclosure, the three-dimensional lookup table 3D LUT based on the HSV color space is obtained offline. For any H, S, and V values, the skin color weight of the current pixel can be obtained by interpolating in the 3D LUT. In skin color detection, the influence of brightness on skin color detection needs to be considered. In order to avoid the problem of uneven transition between skin color regions and non-skin color regions in the display image caused by the fragmentation of the skin color detection image, the corresponding skin color weight is assigned to the skin color, skin color-like and other related color regions.

[0078] In the embodiment of the present disclosure, the second determination module 130 is further configured to: obtain a plurality of sample images with skin color attributes, the skin color attributes including environmental light source, illumination intensity, gender, age, race and skin part; pre-process each sample image to obtain a second processed image; determine the hue, saturation and brightness of each pixel in the second processed image; and obtain a three-dimensional lookup table using the hue, saturation and brightness of each pixel in the second processed image.

[0079] Through the embodiment of the present disclosure, since the selection of skin color samples affects the skin color detection effect, in order to accurately count the skin color clustering features of the face region, various color face images need to be selected as sample images for skin color detection, including sample images of different environmental light sources, illumination intensities, genders, ages, races and skin parts, so that the counted skin color is more representative.

[0080] The three-dimensional lookup table obtained offline through a sufficient amount of sample images can be stored in a static random access memory (SRAM). Since the larger the three-dimensional lookup table 3D LUT is, the area of the picture quality improvement chip and the production cost will be correspondingly increased, therefore, the 3D LUT needs to be down-sampled to the size of MxNxO, where M, N and O are all preset sizes, respectively representing the threshold values of the reference hue, reference saturation and reference brightness, which can be adjusted according to the actual situation of the picture quality improvement chip, and are not limited herein.

[0081] Figure 4 A principle schematic diagram of a three-dimensional lookup table according to an embodiment of the present disclosure is shown.

[0082] For example, in the case of M=13, N=O=9, a three-dimensional lookup table 401 of size 13x9x9 can be obtained as shown in Figure 4 to avoid the 3D LUT occupying the area of hardware storage.

[0083] Through the embodiment of the present disclosure, the three-dimensional lookup table obtained offline is queried according to the H, S and V values, the reference skin color weight in the three-dimensional lookup table is indexed, and the final skin color weight of the current pixel is obtained by interpolation.

[0084] After obtaining the three-dimensional lookup table, the skin color weight corresponding to any HSV value is calculated by interpolation for subsequent skin color protection and other color enhancement processing.

[0085] In the embodiment of the present disclosure, the second determination module 130 is further configured to: remove the non-skin color region from the second processed image; and obtain a three-dimensional lookup table using the hue, saturation and brightness of each pixel in the second processed image after removing the non-skin color region.

[0086] By the embodiments of the present disclosure, the non-skin color regions such as eyes, eyebrows, mouth, etc. can be removed (e.g. manually filled with white color), and only the skin color region part is left as a sample image for skin color collection, thereby avoiding the missed detection or false detection of the skin color caused by incomplete or inaccurate selection of the skin color sample image.

[0087] In the embodiments of the present disclosure, for the three-dimensional lookup table, the hue, saturation and brightness of each pixel to be processed need to be interpolated in the three-dimensional lookup table. Linear interpolation (linear), bilinear interpolation (bilinear) and trilinear interpolation (trilinear) are the most commonly used interpolation algorithms, which are respectively for one-dimensional, two-dimensional and three-dimensional space data, and have the advantages of simple calculation, good effect, and being conducive to hardware in the image quality improvement chip.

[0088] Figure 5A An interpolation principle diagram of a three-dimensional lookup table according to an embodiment of the present disclosure is shown.

[0089] As shown in Figure 5A , first, the HSV value obtained by conversion is indexed to trilinear interpolation in the 3D LUT (three-dimensional lookup table), and eight interpolation reference points ABCDEFGH are needed, which form a cube 501. It can be considered that the A point is the minimum coordinate point ([0][0][0]), and the G point is the maximum coordinate point ([1][1][1]). The point P to be interpolated is located at a certain position inside the cube 501, and the reference skin color weight of the P point is also the skin color weight of the current pixel. The interpolation process of the P point can be divided into three steps:

[0090] (1) Perform trilinear interpolation (twice in the horizontal direction and once in the vertical direction) on the ABCD plane to obtain the first skin color weight weight1 corresponding to the R point;

[0091] (2) Perform trilinear interpolation (twice in the horizontal direction and once in the vertical direction) on the EFGH plane to obtain the second skin color weight weight2 corresponding to the S point;

[0092] (3) Perform linear interpolation in the RS direction to obtain the final skin color weight weight.

[0093] Figure 5B An interpolation principle diagram of a two-dimensional lookup table according to an embodiment of the present disclosure is shown.

[0094] As shown in Figure 5B , first, trilinear interpolation needs to be performed on the ABCD and EFGH planes respectively.

[0095] Taking the cubic linear interpolation of the ABCD plane 502 as an example, it includes twice bilinear interpolation in the horizontal direction and once bilinear interpolation in the vertical direction. Figure 5B In the formula (5) and (6), blk_h and blk_s are the sampling step length of the H and S values of the current pixel in the HS plane, and blk_h' and blk_s' are the down-sampling step length of the current block of the 3D LUT. Under the premise of knowing the H value and the S value of the current pixel, the offset_h and the offset_s on the HS plane can be calculated according to the following formula (5) and (6):

[0096] offset_h = H - Hue_A (5)

[0097] offset_s = S - Sat_A (6)

[0098] In the formula (5) and (6), Hue_A and Sat_A are the hue and saturation values represented by the A point respectively.

[0099] Then, twice bilinear interpolation in the horizontal direction is performed according to the following formula (7) and (8) to obtain the top h_val and the bottom h_val :

[0100]

[0101]

[0102] In the formula (7) and (8), A, B, C, and D are the reference skin color weights represented by the A point, the B point, the C point, and the D point respectively.

[0103] Next, once bilinear interpolation in the vertical direction is performed according to the following formula (9) to obtain the first skin color weight weight1:

[0104]

[0105] Similarly, according to the same interpolation calculation of the above formula (5) to (9), the second skin color weight weight2 of the EDFG plane can be obtained.

[0106] Next, once linear interpolation is performed in the RS direction, blk_v is the sampling step length of the V value of the current pixel, and blk_v' is the down-sampling step length of the current block of the 3D LUT. Under the premise of knowing the V value of the pixel, the offset_v in the vertical direction can be calculated according to the following formula (10):

[0107] offset_v = V - Val_A (10)

[0108] In the formula (10), Val_A is the luminance represented by the A point.

[0109] The skin color weight of each pixel in the first processed image is determined according to the following formula (11):

[0110]

[0111] In an optional embodiment of the present disclosure, the second determining module 130 is further configured to: convert the three-dimensional look-up table into a first two-dimensional look-up table and a second two-dimensional look-up table, the first two-dimensional look-up table including a plurality of groups of second reference data based on a first luminance threshold, the second two-dimensional look-up table including a plurality of groups of second reference data based on a second luminance threshold, each group of second reference data including a reference hue, a reference saturation, and a corresponding reference skin color weight; interpolate the hue and the saturation in the first two-dimensional look-up table and the second two-dimensional look-up table respectively to obtain a first skin color weight and a second skin color weight; and determine the skin color weight of each pixel in the first processed image according to the luminance, the first luminance threshold, the second luminance threshold, the first skin color weight, and the second skin color weight.

[0112] For example, in some detection scenarios where luminance changes are not very frequent, i.e., the input image data has been subjected to some luminance adjustment operations in advance, the 3D LUT can be reduced to two 2D LUTs (two-dimensional look-up tables) at specific luminances. The skin color weights for the two 2D LUTs are set according to the threshold values of luminance changes, such as a first luminance threshold thrshold1 and a second luminance threshold thrshold2. For each two-dimensional look-up table, the hue and saturation of each pixel to be processed need to be interpolated in the two-dimensional look-up table. For example, based on the interpolation principle of the two-dimensional look-up table described above, the hue H and the saturation S of any pixel are indexed to the ABCD four points in the two 2D LUTs respectively to perform interpolation, and the first skin color weight weight1 and the second skin color weight weight2 corresponding to the two 2D LUTs are calculated through a bilinear interpolation algorithm. Then, according to the following formula (12), the weight1 and the weight2 obtained by interpolation are fused based on thrshold1, thrshold2, and the original luminance V of the pixel to obtain the skin color weight Weight of the pixel: Figure 5B

[0113]

[0114] ​By the embodiments of the present disclosure, the three-dimensional lookup table 3D LUT is only reserved two two-dimensional lookup tables 2D LUTs related to specific luminance values under two normal luminances to calculate the skin color weight, thereby further reducing the manufacturing cost of the hardware of the image quality improvement chip. Moreover, the embodiments of the present disclosure can select the applicable three-dimensional lookup table or two-dimensional lookup table according to specific technical problems to control the hardware cost and storage cost of the image quality improvement chip, reduce the SRAM storage space, and meanwhile improve the accuracy of the skin color detection.

[0115] In the embodiments of the present disclosure, the skin color region includes at least one skin color pixel; the third determination module 140 is further configured to: for each pixel in the first processed image, if it is determined that the skin color weight of the pixel is greater than a preset skin color threshold, the pixel is determined as a skin color pixel, and a protection operation is performed on the skin color pixel.

[0116] For example, if the skin color weight of the current pixel is less than or equal to the preset skin color threshold, the pixel is determined as a non-skin color pixel, and a color enhancement operation is performed on the non-skin color pixel.

[0117] For example, the range of the skin color weight can be set as 0-1, and the preset skin color threshold can be set as 0.8. If the skin color weight of the current pixel is greater than 0.8, the protection operation can be performed on the pixel. If the skin color weight of the current pixel is less than or equal to 0.8, the pixel is a non-skin color pixel, and the color enhancement operation can be performed.

[0118] For example, the protection operation on the skin color pixel can be to lock the edge of the pixel to protect the pixel from being modified. The color enhancement operation on the non-skin color pixel can be brightness enhancement or saturation enhancement to make the image more vivid and effectively improve the image effect.

[0119] By the embodiments of the present disclosure, whether the current pixel belongs to the skin color pixel is determined according to the calculated skin color weight and the preset skin color threshold, the skin color region and the non-skin color region are clearly distinguished, the protection of the skin color region and the color enhancement of the non-skin color region are realized. For the pixel with the skin color weight less than the preset skin color threshold, the pixel can be determined as a non-skin color pixel, and the color enhancement is performed on the non-skin color pixel. Thus, the embodiments of the present disclosure can realize the protection of the skin color while taking into account the enhancement of other colors (such as green, grass green, red, etc.), so that these colors are more vivid and the image quality is improved.

[0120] Figure 6 A structural schematic diagram of an image processing apparatus according to another embodiment of the present disclosure is shown.

[0121] As Figure 6As shown, the image processing apparatus 600 of this embodiment not only includes the preprocessing module 110, the first determination module 120, the second determination module 130 and the third determination module 140 described above, but also includes an enhancement processing module 610.

[0122] The enhancement processing module 610 is configured to:

[0123] For each pixel in the first processed image:

[0124] In a case where it is determined that the skin color weight of the pixel is greater than a preset skin color threshold, a skin color protection gain is determined according to the skin color weight of the pixel;

[0125] In a case where it is determined that the skin color weight of the pixel is less than or equal to the preset skin color threshold, a color enhancement gain is determined according to the skin color weight of the pixel;

[0126] The skin color protection gain and the color enhancement gain in the first processed image are fused to obtain a fused gain; and

[0127] The first processed image is enhanced using the fused gain to obtain an enhanced image.

[0128] For example, first, since the first processed image contains multiple pixels, and each pixel can only determine either the skin color protection gain or the color enhancement gain, a part of the skin color protection gains and another part of the color enhancement gains can be determined for the entire first processed image. Next, the two parts of gains of the entire first processed image are fused as a whole to obtain the fused gain. Then, the first processed image can be enhanced using the fused gain to obtain the enhanced image, thereby effectively improving the image effect.

[0129] Through the embodiments of the present disclosure, the 3D LUT or 2D LUT interpolation is performed on the first processed image to obtain the skin color weight of the current pixel, and it is determined whether the current pixel belongs to the skin color pixel according to the preset threshold. When the skin color weight of the current pixel is greater than the preset skin color threshold, it is determined that the pixel value belongs to the skin color pixel, and then the skin color protection gain is further calculated according to the skin color weight; when the skin color weight of the current pixel is not greater than the preset skin color threshold, it is determined that the pixel value does not belong to the skin color pixel, and then the color enhancement gain is calculated according to the skin color weight. Finally, the skin color protection gain and the color enhancement gain are fused to be used for enhancing the first processed image.

[0130] The present disclosure also provides an electronic device, which includes the image processing apparatus according to any of the embodiments of the present disclosure.

[0131] It should be noted that the division of units in the embodiments of the present disclosure is illustrative, and is only a logical function division. In actual implementation, another division manner can be used. In addition, each functional unit in each embodiment of the present disclosure can be integrated in one processing unit, or each unit can be physically stored separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.

[0132] For example, any multiple modules of the preprocessing module 110, the first determination module 120, the second determination module 130, the third determination module 140 and the enhancement processing module 610 can be combined in one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of the modules can be combined with at least part of the functions of other modules, and implemented in one module. According to the embodiments of the present disclosure, at least one of the preprocessing module 110, the first determination module 120, the second determination module 130, the third determination module 140 and the enhancement processing module 610 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on chip, a system on substrate, a system on package, an application specific integrated circuit (ASIC), or any other reasonable manner that can be integrated or packaged by a circuit, such as a hardware or firmware, or any one of software, hardware and firmware or a suitable combination of any of them. Alternatively, at least one of the preprocessing module 110, the first determination module 120, the second determination module 130, the third determination module 140 and the enhancement processing module 610 can be at least partially implemented as a computer program module, which can perform corresponding functions when the computer program module is run.

[0133] The embodiments of the present disclosure also provide an image processing method performed by an image processing apparatus. The image processing method will be described below in combination with Figure 7 - Figure 8B The method will be described in detail.

[0134] Figure 7 A flowchart of an image processing method according to an embodiment of the present disclosure is shown.

[0135] As Figure 7 shown, the image processing method of the embodiment can be applied to, for example, the image processing apparatus 100 of the above-mentioned embodiments. The image processing method includes operation S710 to operation S740.

[0136] In operation S710, each image frame of the to-be-processed video stream is preprocessed to obtain a first processed image.

[0137] In the embodiment of the present disclosure, operation S710 is performed by the preprocessing module 110, and corresponds to the operation performed by the preprocessing module 110 described above. For the sake of brevity, details are not repeated here.

[0138] In operation S720, the hue, saturation, and brightness of each pixel in the first processed image are determined.

[0139] In the embodiment of the present disclosure, operation S720 is performed by the first determination module 120, and corresponds to the operation performed by the first determination module 120 described above. For the sake of brevity, details are not repeated here.

[0140] In operation S730, the skin color weight of each pixel in the first processed image is determined according to the hue, saturation, and brightness.

[0141] In the embodiment of the present disclosure, operation S730 is performed by the second determination module 130, and corresponds to the operation performed by the second determination module 130 described above. For the sake of brevity, details are not repeated here.

[0142] In operation S740, the skin color region in the first processed image is determined according to the skin color weight of each pixel and a preset skin color threshold.

[0143] In the embodiment of the present disclosure, operation S740 is performed by the third determination module 140, and corresponds to the operation performed by the third determination module 140 described above. For the sake of brevity, details are not repeated here.

[0144] Figure 8A A flowchart of an image processing method according to another embodiment of the present disclosure is shown.

[0145] As Figure 8A shown, the image processing method of this embodiment can be applied to, for example, the image processing device 600 of the above-described embodiments. The image processing method includes:

[0146] Operation S811, preprocessing each image frame of the video stream to be processed to obtain a first processed image;

[0147] Operation S822, color space conversion is performed on each pixel in the first processed image, from the RGB color space to the HSV color space, to obtain the hue, saturation, and brightness of each pixel in the first processed image;

[0148] Operation S831, the skin color weight of each pixel in the first processed image is determined according to the hue, saturation, and brightness;

[0149] Operation S841, the skin color region in the first processed image is determined according to the skin color weight of each pixel and a preset skin color threshold.

[0150] Operation S850, the skin color protection or color enhancement processing is performed on each pixel in the first processing image.

[0151] In the embodiments of the present disclosure, operation S811 to operation S841 correspond to operation S910 to operation S940 respectively, which will not be repeated here. Operation S850 is performed by the enhancement processing module 610, and corresponds to the operation performed by the enhancement processing module 610. For the sake of simplicity, the detailed description will not be repeated here.

[0152] Please continue to refer to Figure 8A In the embodiments of the present disclosure, operation S811 can include operation S811a to operation S811b.

[0153] In operation S811a, the plurality of image frames of the to-be-processed video stream are denoised to obtain N denoised images.

[0154] In operation S811b, for each denoised image in the N denoised images, adaptive brightness equalization processing is performed to obtain a first processing image.

[0155] Figure 8B A flowchart of skin color protection operation and color enhancement operation according to another embodiment of the present disclosure is shown.

[0156] As Figure 8B shown, in the embodiments of the present disclosure, operation S850 can include operation S851 to operation S853.

[0157] In operation S851, for each pixel in the first processing image: in a case where it is determined that the skin color weight of the pixel is greater than a preset skin color threshold, a skin color protection gain is determined according to the skin color weight of the pixel; in a case where it is determined that the skin color weight of the pixel is less than or equal to the preset skin color threshold, a color enhancement gain is determined according to the skin color weight of the pixel.

[0158] In operation S852, the skin color protection gain and the color enhancement gain in the first processing image are fused to obtain a fused gain.

[0159] In operation S853, the first processing image is enhanced using the fused gain to obtain an enhanced image.

[0160] It should be noted that the steps of the above method embodiments correspond to the actions performed by the modules / units in the above device embodiments. For the implementation process of each step in the method embodiments of the present disclosure, please refer to the detailed function description of each module / unit in the device embodiments, which will not be repeated here.

[0161] Figure 9 A block diagram of an electronic device suitable for implementing the image processing method according to an embodiment of the present disclosure is shown.

[0162] like Figure 9 As shown, an electronic device 900 according to an embodiment of the present disclosure includes a processor 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage portion 908 into a random access memory (RAM) 903. The processor 901 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 901 may also include onboard memory for caching purposes. The processor 901 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.

[0163] RAM 903 stores various programs and data required for the operation of electronic device 900. Processor 901, ROM 902, and RAM 903 are interconnected via bus 904. Processor 901 performs various operations of the method flow according to embodiments of the present disclosure by executing programs in ROM 902 and / or RAM 903. It should be noted that the programs may also be stored in one or more memories other than ROM 902 and RAM 903. Processor 901 may also perform various operations of the method flow according to embodiments of the present disclosure by executing programs stored in said one or more memories.

[0164] According to embodiments of this disclosure, the electronic device 900 may further include an input / output (I / O) interface 905, which is also connected to a bus 904. The electronic device 900 may also include one or more of the following components connected to the I / O interface 905: an input section 906 including a keyboard, mouse, etc.; an output section 907 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 908 including a hard disk, etc.; and a communication section 909 including a network interface card such as a LAN card, modem, etc. The communication section 909 performs communication processing via a network such as the Internet. A drive 910 is also connected to the I / O interface 905 as needed. A removable medium 911, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 910 as needed so that computer programs read from it can be installed into the storage section 908 as needed.

[0165] The present disclosure also provides a computer readable storage medium, which can be included in the device / apparatus / system described in the above embodiments, or exist separately without being assembled into the device / apparatus / system. The above computer readable storage medium carries one or more programs, which, when executed, implement the method according to the embodiments of the present disclosure.

[0166] According to an embodiment of the present disclosure, the computer readable storage medium can be a non-volatile computer readable storage medium, which can include, but is not limited to, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any appropriate combination thereof. In the present disclosure, the computer readable storage medium can be any tangible medium that contains or stores a program, which can be used by or in connection with an instruction execution system, apparatus, or device. For example, according to an embodiment of the present disclosure, the computer readable storage medium can include one or more memories, such as the ROM 902 and / or the RAM 903 described above, and / or one or more memory units other than the ROM 902 and the RAM 903.

[0167] An embodiment of the present disclosure further provides a computer program product, which includes a computer program containing program codes for executing the method shown in the flowcharts. When the computer program product is run in a computer system, the program codes are used to make the computer system implement the image processing method provided by the embodiments of the present disclosure.

[0168] The above functions defined in the system / apparatus of the embodiments of the present disclosure are performed when the computer program is executed by the processor 901. According to an embodiment of the present disclosure, the above described system, apparatus, module, unit, etc. can be implemented by computer program modules.

[0169] In one embodiment, the computer program can rely on a tangible storage medium, such as an optical storage device, a magnetic storage device, etc. In another embodiment, the computer program can also be transmitted, distributed, and downloaded in the form of a signal via a network medium, and be downloaded and installed via the communication part 909 and / or installed from the detachable medium 911. The program codes contained in the computer program can be transmitted via any appropriate network medium, including but not limited to wireless, wired, etc., or any appropriate combination thereof.

[0170] In such embodiments, the computer program can be downloaded and installed from the network through the communication part 909, and / or installed from the detachable medium 911. When the computer program is executed by the processor 901, the above-described functions defined in the system of the embodiments of the present disclosure are executed. According to the embodiments of the present disclosure, the system, device, apparatus, module, unit, and the like described above can be implemented by computer program modules.

[0171] According to the embodiments of the present disclosure, the program code for executing the computer program provided by the embodiments of the present disclosure can be written in any combination of one or more programming languages, and specifically, these computer programs can be implemented using high-level procedural and / or object-oriented programming language, and / or assembly / machine language. The programming language includes, but is not limited to, such as Java, C++, python, "C" language or similar programming language. The program code can be executed entirely on the user computing device, partially on the user device, partially on a remote computing device, or entirely on a remote computing device or server. In the case involving a remote computing device, the remote computing device can be connected to the user computing device through any kind of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, connected through the Internet by using an Internet service provider).

[0172] The flowcharts and block diagrams in the drawings illustrate the possible implementation architectures, functions, and operations of the systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowcharts or block diagrams can represent a module, a program segment, or a portion of code that contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur in different orders than that shown in the figures. For example, two blocks that are shown in succession can actually be executed substantially concurrently, or they can sometimes be executed in reverse order, depending on the functionality involved. It should also be noted that each block in the block diagrams or flowcharts, and combinations of blocks in the block diagrams or flowcharts, can be implemented by a dedicated hardware-based system that performs specified functions or operations, or can be implemented by a combination of special-purpose hardware and computer instructions.

[0173] Those skilled in the art can understand that the features described in various embodiments of the present disclosure and / or claims can be combined or / and integrated, even if such combinations or integrations are not explicitly described in the present disclosure. In particular, the features described in various embodiments of the present disclosure and / or claims can be combined and / or integrated in various combinations, without departing from the spirit and teachings of the present disclosure. All such combinations and / or integrations fall within the scope of the present disclosure.

[0174] The above describes embodiments of the present disclosure. However, these embodiments are merely for illustrative purposes, and are not intended to limit the scope of the present disclosure. Although each embodiment is described above separately, this does not mean that the measures in each embodiment cannot be used advantageously in combination. The scope of the present disclosure is defined by the appended claims and their equivalents. Those skilled in the art can make various substitutions and modifications without departing from the scope of the present disclosure, and all such substitutions and modifications shall fall within the scope of the present disclosure.

Claims

1. An image processing apparatus, comprising: a preprocessing module configured to preprocess each image frame of a video stream to be processed to obtain a first processed image; a first determining module configured to determine a hue, a saturation, and a brightness of each pixel in the first processed image; a second determining module configured to determine a skin color weight of each pixel in the first processed image according to the hue, the saturation, and the brightness; and a third determining module configured to determine a skin color region in the first processed image according to the skin color weight of each pixel and a preset skin color threshold; wherein the second determining module is further configured to: obtain a three-dimensional lookup table, the three-dimensional lookup table comprising a plurality of groups of first reference data, each group of first reference data comprising a reference hue, a reference saturation, a reference brightness, and a corresponding reference skin color weight, the three-dimensional lookup table being obtained based on a sample image, the sample image comprising sample images of different ambient light sources, different light intensities, different genders, different ages, different races, and different skin parts; and perform interpolation in the three-dimensional lookup table based on the hue, the saturation, and the brightness to obtain the skin color weight of each pixel in the first processed image; wherein the second determining module is further configured to: convert the three-dimensional lookup table into a first two-dimensional lookup table and a second two-dimensional lookup table, the first two-dimensional lookup table comprising a plurality of groups of second reference data based on a first brightness threshold, the second two-dimensional lookup table comprising a plurality of groups of second reference data based on a second brightness threshold, each group of second reference data comprising a reference hue, a reference saturation, and a corresponding reference skin color weight; perform interpolation in the first two-dimensional lookup table and the second two-dimensional lookup table based on the hue and the saturation respectively to obtain a first skin color weight and a second skin color weight; and determine the skin color weight of each pixel in the first processed image according to the brightness, the first brightness threshold, the second brightness threshold, the first skin color weight, and the second skin color weight. The second determining module is further configured to: obtain a plurality of sample images with skin color attributes, the skin color attributes comprising ambient light sources, light intensities, genders, ages, races, and skin parts; preprocess each of the sample images to obtain a second processed image; determine a hue, a saturation, and a brightness of each pixel in the second processed image; and obtain the three-dimensional lookup table using the hue, the saturation, and the brightness of each pixel in the second processed image. The second determining module is further configured to: remove a non-skin color region from the second processed image; and obtain the three-dimensional lookup table using the hue, the saturation, and the brightness of each pixel in the second processed image after removing the non-skin color region. The preprocessing module preprocesses each image frame of a video stream to be processed by: performing denoising on a plurality of image frames of the video stream to be processed to obtain N denoised images, N being an integer greater than 1; and for an i-th denoised image in the N denoised images, adjusting a gray value of each pixel of the i-th denoised image according to a gray value of each pixel of an i-1-th denoised image, 1 < i ≤ N, and i being an integer. ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ 2. The apparatus of claim 1, wherein, ​ ​ ​ ​ ​ ​ 3. The apparatus of claim 2, wherein, ​ ​ ​ 4. The apparatus of claim 1, wherein, ​ ​ ​ 5. The apparatus of claim 4, wherein, The adjusting the gray value of each pixel of the i-th denoising image according to the gray value of each pixel of the i-1-th denoising image comprises: performing histogram statistics on a plurality of gray values of pixels in the i-1-th denoising image to obtain statistical parameters, the statistical parameters comprising a maximum gray value, a minimum gray value, an adaptive adjustment range threshold value and a global adaptive brightness gain; and adjusting each pixel of the i-th denoising image according to the statistical parameters of the i-1-th denoising image.

6. The apparatus of claim 1, wherein, The skin color region comprises at least one skin color pixel; The third determining module is further configured to: for each pixel in the first processing image, in a case where the skin color weight of the pixel is greater than the preset skin color threshold value, determining the pixel as a skin color pixel, and performing a protection operation on the skin color pixel.

7. The apparatus of claim 1, further comprising an enhancement processing module configured to: for each pixel in the first processing image: in a case where the skin color weight of the pixel is greater than the preset skin color threshold value, determining a skin color protection gain according to the skin color weight of the pixel; in a case where the skin color weight of the pixel is less than or equal to the preset skin color threshold value, determining a color enhancement gain according to the skin color weight of the pixel; fusing the skin color protection gain and the color enhancement gain in the first processing image to obtain a fused gain; and performing enhancement processing on the first processing image using the fused gain to obtain an enhanced image.

8. An electronic device comprising: the image processing apparatus according to any one of claims 1-7.

9. An image processing method comprising: performing preprocessing on each image frame of a to-be-processed video stream to obtain a first processing image; determining a hue, a saturation and a brightness of each pixel in the first processing image; determining a skin color weight of each pixel in the first processing image according to the hue, the saturation and the brightness; and determining a skin color region in the first processing image according to the skin color weight of each pixel and a preset skin color threshold value; wherein the determining the skin color weight of each pixel in the first processing image according to the hue, the saturation and the brightness comprises: obtaining a three-dimensional lookup table, the three-dimensional lookup table comprising a plurality of groups of first reference data, each group of first reference data comprising a reference hue, a reference saturation, a reference brightness and a corresponding reference skin color weight, the three-dimensional lookup table being obtained based on a sample image, the sample image comprising sample images of different environmental light sources, light intensities, genders, ages, races and skin parts; converting the three-dimensional lookup table into a first two-dimensional lookup table and a second two-dimensional lookup table, the first two-dimensional lookup table comprising a plurality of groups of second reference data based on a first brightness threshold value, the second two-dimensional lookup table comprising a plurality of groups of second reference data based on a second brightness threshold value, each group of second reference data comprising a reference hue, a reference saturation and a corresponding reference skin color weight; performing interpolation on the hue and the saturation in the first two-dimensional lookup table and the second two-dimensional lookup table respectively to obtain a first skin color weight and a second skin color weight; and ​ determine a skin color weight for each pixel in the first processed image according to the luminance, the first luminance threshold, the second luminance threshold, the first skin color weight, and the second skin color weight.

10. An electronic device, comprising: one or more processors; storage storing one or more programs, wherein the one or more programs that, when executed by the one or more processors, cause the one or more processors to perform the method of claim 9.

11. A computer-readable storage medium storing executable instructions thereon that, when executed by a processor, cause the processor to perform the method of claim 9.

Citation Information

Patent Citations

  • Skin color detecting method and device and terminal

    CN106570472A

  • Detection method and detection apparatus

    CN107871309A