Method, device, equipment, medium and product for removing reflections from an ultra-high definition image
By converting ultra-high-definition images to multiple color spaces and performing cross-validation and correction, the problem of green screen reflections being difficult to remove in ultra-high-definition images has been solved, achieving a high-quality reflection removal effect.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING ENLIGHTV TECH CO LTD
- Filing Date
- 2025-11-04
- Publication Date
- 2026-04-17
AI Technical Summary
Existing green screen keying algorithms cannot effectively distinguish between real skin tone and the green component mixed in by green screen reflections, resulting in poor reflection removal in ultra-high-definition images.
Ultra-high-resolution images are converted to Lab, YCbCr, and HLS color spaces. The target skin color region is accurately located through cross-validation and skin color region ellipse model. Combined with the neighboring skin pixel correction of green reflective pollution points, multiple corrected images are merged using the weights of different color spaces to achieve reflective removal.
While preserving the naturalness of skin tones, it accurately removes green glare, improves the glare removal effect of ultra-high-definition images, reduces errors in single color space processing, and improves image quality.
Smart Images

Figure CN121053050B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and in particular to a method, apparatus, device, medium and product for removing reflections from ultra-high-definition images. Background Technology
[0002] Green screen keying technology has been widely used in many fields involving image compositing, such as film and television production, live streaming, and virtual reality, due to its efficiency and flexibility. Green screen keying technology places the subject in front of a green background, uses post-processing algorithms to extract the foreground target and replace the background, thereby achieving diverse visual effects.
[0003] However, in actual green screen shooting scenarios, because the green screen background is a uniform green, the light shining on it during shooting will cause reflections. These reflected lights will be projected onto the skin areas of the subjects, such as their faces and hands. In bright areas, this green reflection problem is more pronounced, causing a noticeable green component to appear mixed into the subject's skin.
[0004] Currently, most existing green screen keying algorithms are based on chroma keying. The basic principle of chroma keying is to distinguish the foreground and background based on color information, separating the green background from the ultra-high-definition image, and then extracting the foreground subject. However, this technique cannot effectively distinguish between real skin tone and the green component mixed in by green screen reflections. In practical applications, it is impossible to accurately remove green reflections while preserving the naturalness of skin tone, resulting in poor reflection removal effects in the processed ultra-high-definition image. Summary of the Invention
[0005] The purpose of this application is to provide a method, apparatus, device, medium, and product for removing reflections from ultra-high-definition images, which can improve the reflection removal effect of ultra-high-definition images.
[0006] To achieve the above objectives, this application provides the following solution:
[0007] In a first aspect, this application provides a method for removing reflections from ultra-high-definition images, comprising:
[0008] Convert the input ultra-high-definition RGB image to Lab color space, YCbCr color space, and HLS color space;
[0009] The initial skin region and initial YCbCr correction result in the ultra-high-definition image are determined based on the YCbCr color space.
[0010] Cross-validation is performed based on the initial skin region and the initial YCbCr correction result with the HLS color space to obtain the target skin color region, the target YCbCr correction result, and the HLS correction result.
[0011] Based on the ultra-high-definition image and the Lab color space, green reflective pollution points in the skin area were identified;
[0012] Based on the neighboring skin pixels of the green reflective pollution points, the green reflective pollution points in the Lab color space are corrected to obtain the Lab correction result;
[0013] The Lab correction result, the YCbCr target correction result, and the HLS correction result are respectively converted into a first corrected image, a second corrected image, and a third corrected image in RGB format.
[0014] Based on the Lab weights of the Lab color space, the YCbCr weights of the YCbCr color space, and the HLS weights of the HLS color space, the first corrected image, the second corrected image, and the third corrected image are merged to obtain a reflection removal image.
[0015] Optionally, determining the initial skin region and initial YCbCr correction result in the ultra-high-definition image based on the YCbCr color space specifically includes:
[0016] An elliptical model of the skin color region is constructed in the YCbCr color space to determine the concentrated distribution area of skin color pixels in the YCbCr color space.
[0017] By eliminating the incorrectly selected regions within the concentrated distribution area, the initial correction result for YCbCr is obtained;
[0018] The region in the ultra-high-definition image corresponding to the initial correction result of YCbCr is determined as the initial skin region.
[0019] Optionally, the step of cross-validating the initial skin region and the initial YCbCr correction result with the HLS color space to obtain the target skin region, the target YCbCr correction result, and the HLS correction result specifically includes:
[0020] The HLS skin tone region is determined from the HLS color space; wherein the hue of each pixel in the HLS skin tone region is within a preset hue range, and the saturation of each pixel in the HLS skin tone region is within a preset saturation range.
[0021] The HLS skin tone region and the initial skin region are adjusted based on the overlap between the HLS skin tone region and the initial skin region to determine the target skin tone region and the HLS correction result.
[0022] The initial correction result of YCbCr is adjusted based on the target skin color region to determine the target correction result of YCbCr.
[0023] Optionally, determining the green reflective pollution points in the skin region based on the ultra-high-definition image and the Lab color space specifically includes:
[0024] Based on the green channel value, red channel value, and blue channel value of each pixel in the ultra-high-definition image, the initial green reflective pollution points in the skin area are determined;
[0025] Based on the Lab color space, green reflective pollution points are determined from the initial green reflective pollution points; wherein the red-green channel values of the pixels of the green reflective pollution points in the Lab color space are less than a preset threshold.
[0026] Optionally, determining the initial green reflective pollution points in the skin region based on the green channel value, red channel value, and blue channel value of each pixel in the ultra-high-definition image specifically includes:
[0027] Based on the green channel value, red channel value, and blue channel value of each pixel in the ultra-high-definition image, the relative energy of the green channel of each pixel is determined;
[0028] Based on the green channel value of each pixel in the ultra-high-definition image, the green gradient magnitude of each pixel is determined;
[0029] An initial green reflective contamination point is determined from the skin region of the ultra-high-definition image; wherein the relative energy of the green channel of the initial green reflective contamination point is greater than a preset relative energy, and the green gradient amplitude of the initial green reflective contamination point is greater than a preset green gradient amplitude.
[0030] Optionally, the step of correcting the green reflective pollution point in the Lab color space based on the neighboring skin pixels of the green reflective pollution point to obtain the Lab correction result specifically includes:
[0031] Based on the green channel value, red channel value, and blue channel value of the neighboring skin pixels of the green reflective pollution point, the green residual value of the green reflective pollution point is determined;
[0032] Based on the Lab color space, determine the green reflectivity weight coefficient of the green reflectivity pollution point;
[0033] Based on the original green channel value of the green reflective pollution point, the green residual value, and the green reflective weight coefficient, the corrected green channel value of the green reflective pollution point is determined.
[0034] Based on the corrected green channel value of the green reflective pollution point, the initial Lab correction result is determined;
[0035] The initial Lab correction result is smoothed to obtain the Lab correction result.
[0036] Secondly, this application provides a reflection removal device for ultra-high-definition images, comprising:
[0037] The first conversion unit is used to convert the input ultra-high-definition image in RGB format into Lab color space, YCbCr color space and HLS color space;
[0038] The first determining unit is used to determine the initial skin region and the initial YCbCr correction result in the ultra-high-definition image based on the YCbCr color space.
[0039] The verification unit is used to perform cross-verification based on the initial skin region and the initial YCbCr correction result with the HLS color space to obtain the target skin region, the target YCbCr correction result and the HLS correction result.
[0040] The second determining unit is used to determine green reflective pollution points in the skin area based on the ultra-high-definition image and the Lab color space;
[0041] The correction unit is used to correct the green reflective pollution point in the Lab color space based on the neighboring skin pixels of the green reflective pollution point, and obtain the Lab correction result;
[0042] The second conversion unit is used to convert the Lab correction result, the YCbCr target correction result and the HLS correction result into a first corrected image, a second corrected image and a third corrected image in RGB format, respectively.
[0043] The merging unit is used to merge the first corrected image, the second corrected image, and the third corrected image based on the Lab weights of the Lab color space, the YCbCr weights of the YCbCr color space, and the HLS weights of the HLS color space to obtain a reflection removal image.
[0044] Thirdly, this application provides a computer device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the ultra-high-definition image reflection removal method described in any one of the above-described methods.
[0045] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the ultra-high-definition image reflection removal method described in any one of the above descriptions.
[0046] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the ultra-high-definition image reflection removal method described above.
[0047] In a sixth aspect, this application provides a chip, the chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run a program or instructions, the processor executing the program or instructions to implement the steps of the ultra-high-definition image reflection removal method described in any one of the above.
[0048] According to the specific embodiments provided in this application, the following technical effects are disclosed:
[0049] This application provides a method, apparatus, device, medium, and product for removing reflections from ultra-high-definition images. By converting the image to multiple color spaces, it can fully utilize the characteristics of different color spaces and comprehensively capture image information. Based on the YCbCr color space, an initial skin region and initial YCbCr correction result are determined. Cross-validation of the initial skin region and initial YCbCr correction result with HLS is then performed to accurately locate the target skin color region, obtaining more accurate YCbCr target correction results and HLS correction results. Green reflective contamination points are identified and corrected using the ultra-high-definition image and Lab color space, resulting in a Lab correction result for removing reflections. Finally, multiple corrected images are merged according to the weights of each color space, combining the advantages of different color space processing and avoiding information loss or bias that may result from single-color space processing. This method processes reflections in ultra-high-definition images from multiple dimensions and angles, accurately removing green reflections while preserving the naturalness of skin color, thus improving the reflection removal effect of ultra-high-definition images. Attached Figure Description
[0050] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0051] Figure 1 A schematic flowchart illustrating a method for removing reflections from ultra-high-definition images according to an embodiment of this application;
[0052] Figure 2 A schematic diagram of the functional modules of an ultra-high-definition image reflection removal device provided in an embodiment of this application;
[0053] Figure 3 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0054] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0055] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0056] In one exemplary embodiment, such as Figure 1 As shown, a method for removing reflections from ultra-high-definition images is provided. This method is executed by a computer device, specifically by a terminal or server alone, or by both a terminal and a server. In this embodiment, it includes steps 101 to 107. Wherein:
[0057] Step 101: Convert the input ultra-high-definition image in RGB format to Lab color space, YCbCr color space, and HLS color space.
[0058] In this embodiment, the ultra-high-definition image resolution in RGB format supports 4K and above. The ultra-high-definition image is simultaneously converted to Lab color space, YCbCr color space, and HLS color space to provide redundant color information to support subsequent analysis.
[0059] Specifically, the method for converting ultra-high-definition images to the Lab color space is as follows:
[0060] 1.1 Convert RGB to linear RGB (gamma correction), the formula is:
[0061]
[0062] in, This represents the linear R channel in linear RGB and the linear G channel in linear RGB. and linear B channel The calculation formula and The same applies, so I won't repeat it here.
[0063] 1.2 Convert linear RGB to XYZ (CIE XYZ color space, standard D65 white point) using the following formula:
[0064]
[0065] 1.3 Convert XYZ to Lab color space using the following formula:
[0066]
[0067]
[0068]
[0069]
[0070] In this embodiment of the application, the formula for converting an ultra-high-definition image to the YCbCr color space is as follows:
[0071]
[0072]
[0073]
[0074] In the YCbCr color space, Y represents lightness, Cb represents blue color difference, and Cr represents red color difference.
[0075] In this embodiment of the application, the method for converting ultra-high-definition images to the HLS color space is as follows:
[0076] 2.1 Maximum value and minimum value Extraction, the formula is:
[0077]
[0078]
[0079]
[0080] in, This represents the difference between the maximum and minimum values.
[0081] 2.2 Luminance calculation L, the formula is:
[0082]
[0083] 2.3 Hue calculation formula:
[0084]
[0085] 2.4 Saturation S is calculated using the following formula:
[0086]
[0087] Step 102: Determine the initial skin region and initial YCbCr correction result in the ultra-high-definition image based on the YCbCr color space.
[0088] As an optional implementation, step 102, which determines the initial skin region and the initial YCbCr correction result in the ultra-high-definition image based on the YCbCr color space, may include:
[0089] An elliptical model of the skin color region is constructed in the YCbCr color space to determine the concentrated distribution area of skin color pixels in the YCbCr color space.
[0090] By eliminating the incorrectly selected regions within the concentrated distribution area, the initial correction result for YCbCr is obtained;
[0091] The region in the ultra-high-definition image corresponding to the initial correction result of YCbCr is determined as the initial skin region.
[0092] This implementation method, by constructing an elliptical model of the skin tone region in the YCbCr color space, scientifically defines the concentrated distribution area of skin tone pixels, providing a foundation for accurate skin tone identification. Eliminating misselected areas within this concentrated distribution area avoids interference from non-skin tone components, resulting in a more accurate initial YCbCr correction result. Determining the initial skin region in this way allows for precise targeting of the area to be processed, making subsequent reflection removal operations more targeted and improving overall processing quality.
[0093] In this embodiment, an elliptical model of the skin color region can be established in the YCbCr color space based on a statistical model of human skin color, and the concentrated distribution area of skin color pixels in the YCbCr color space can be identified. This facilitates accurate extraction of the skin region while excluding interfering colors such as background, clothing, and green screen. Skin color is mainly distributed in an elliptical region on the Cb–Cr plane in the YCbCr color space, and this characteristic is stable and effective.
[0094] Human skin color statistical models refer to the statistical analysis of the color values of skin region pixels in a large number of real human face images in a certain color space (such as YCbCr, HSV, HLS, etc.) to obtain the distribution characteristics of skin color pixels in this space, such as: distribution center (mean), distribution shape (such as covariance or standard deviation), and distribution region (which can be fitted with geometric shapes such as ellipses or polygons).
[0095] In this embodiment, the formula for the elliptical model of the skin color region can be:
[0096]
[0097] in, , These represent the mean (center position) of skin color in the Cb and Cr channels, respectively. , These represent the standard deviations of Cb and Cr, respectively, used to control the width and height of the elliptical model of the skin color region. T represents the decision threshold, used to control the receiving range, typically ranging from 1 to 2.5; common values are: =210; =35; =250; =20.
[0098] In this embodiment of the application, the method for removing misselected regions within a concentrated distribution area to obtain the initial correction result of YCbCr can be as follows: using image morphology methods to perform "skin mask dilation-erosion-edge purification" to remove misselected regions. Specific implementation steps may include:
[0099] 3.1 Dilation operation: Use an elliptic kernel (e.g., 5×5 pixels) to expand the concentrated distribution area;
[0100] Function: To connect broken skin areas and fill small holes;
[0101] Removed items: Repairing skin tears caused by light reflection;
[0102] 3.2 Erosion operation: Use the same core to shrink the expanded area;
[0103] Function: Removes isolated noise and smooths edges;
[0104] Targets to be excluded: Small non-skin areas that are falsely detected (such as reflective spots on a green screen);
[0105] 3.3 Edge Refinement: Detecting the edges of the etched mask;
[0106] Function: To perform secondary verification in the edge region;
[0107] 3.4 Removal Mechanism: Edge pixels must pass color verification (YCbCr elliptical model + HLS hue rules); remove edge pixels that do not conform to skin color characteristics; delete isolated areas with too small an area (<100 pixels).
[0108] Step 103: Cross-validate the initial skin region and the initial YCbCr correction result with the HLS color space to obtain the target skin region, the target YCbCr correction result, and the HLS correction result.
[0109] As an optional implementation, step 103, which involves cross-validating the initial skin region and the initial YCbCr correction result with the HLS color space to obtain the target skin region, the target YCbCr correction result, and the HLS correction result, may include:
[0110] The HLS skin tone region is determined from the HLS color space; wherein the hue of each pixel in the HLS skin tone region is within a preset hue range, and the saturation of each pixel in the HLS skin tone region is within a preset saturation range.
[0111] The HLS skin tone region and the initial skin region are adjusted based on the overlap between the HLS skin tone region and the initial skin region to determine the target skin tone region and the HLS correction result.
[0112] The initial correction result of YCbCr is adjusted based on the target skin color region to determine the target correction result of YCbCr.
[0113] This implementation method determines the HLS skin tone region based on hue and saturation ranges within the HLS color space, accurately selecting pixels that match skin tone characteristics. By adjusting the overlapping area with the initial skin region, the advantages of different color spaces can be combined to determine a more accurate target skin tone region and HLS correction result. Further optimization of the correction result can be achieved by adjusting the initial YCbCr correction result based on the target skin tone region. This cross-validation method effectively reduces the error of a single color space, making the determination of the target skin tone region more accurate and laying the foundation for high-quality reflection removal.
[0114] In this embodiment of the application, the preset hue range can be [0.10, 0.20], and the preset saturation range can be [0.2, 1.6].
[0115] In this embodiment of the application, the method for adjusting the HLS skin tone region and the initial skin region based on the overlap between the HLS skin tone region and the initial skin region to determine the target skin tone region and the HLS correction result can be as follows:
[0116] The overlapping area between the HLS skin color region and the initial skin region is determined, and the initial skin region is adjusted based on the overlapping area so that the resulting target skin color region is the same as the region corresponding to the overlapping area in the ultra-high-definition image; and the HLS skin color region can be adjusted based on the overlapping area to obtain the HLS correction result, which can represent the region representing skin color in the HLS color space. At this time, the HLS correction result is the same as the region corresponding to the overlapping area in the ultra-high-definition image.
[0117] In this embodiment, the YCbCr target correction result can represent the region representing skin color in the YCbCr color space. At this time, the YCbCr target correction result is the same as the region corresponding to the target skin color region in the ultra-high-definition image.
[0118] Step 104: Based on the ultra-high-definition image and the Lab color space, determine the green reflective pollution points in the skin area.
[0119] As an optional implementation, step 104, based on the ultra-high-definition image and the Lab color space, may determine the green reflective pollution points in the skin area in the following way:
[0120] Based on the green channel value, red channel value, and blue channel value of each pixel in the ultra-high-definition image, the initial green reflective pollution points in the skin area are determined;
[0121] Based on the Lab color space, green reflective pollution points are determined from the initial green reflective pollution points; wherein the red-green channel values of the pixels of the green reflective pollution points in the Lab color space are less than a preset threshold.
[0122] This implementation method first preliminarily determines initial green reflective contamination points based on the RGB channel values of each pixel in the ultra-high-definition image. This quickly identifies areas where green reflection may exist, improving screening efficiency. Then, using the Lab color space, the true green reflective contamination points are further precisely screened by comparing the red and green channel values with preset thresholds. This dual determination method, combining RGB and Lab color spaces, effectively avoids the errors of a single determination method, enabling more accurate identification of green reflective contamination points in skin areas and providing a reliable basis for subsequent reflection removal.
[0123] Optionally, the method for determining the initial green reflective pollution points in the skin region based on the green channel value, red channel value, and blue channel value of each pixel in the ultra-high-definition image may include:
[0124] Based on the green channel value, red channel value, and blue channel value of each pixel in the ultra-high-definition image, the relative energy of the green channel of each pixel is determined;
[0125] Based on the green channel value of each pixel in the ultra-high-definition image, the green gradient magnitude of each pixel is determined;
[0126] An initial green reflective contamination point is determined from the skin region of the ultra-high-definition image; wherein the relative energy of the green channel of the initial green reflective contamination point is greater than a preset relative energy, and the green gradient amplitude of the initial green reflective contamination point is greater than a preset green gradient amplitude.
[0127] This implementation method, by calculating the relative energy of the green channel for each pixel, measures the intensity of the green component within the pixel, quickly identifying pixels with prominent green features. Simultaneously, determining the green gradient amplitude captures changes in green energy, highlighting green reflective edges. Combining both methods, initial green reflective contamination points that simultaneously meet preset criteria are selected. This approach integrates the intensity and variation of green energy, effectively avoiding misjudgments based on a single indicator, improving the accuracy and reliability of initial contamination point identification, and facilitating subsequent reflective removal.
[0128] In this embodiment, the formula for calculating the relative energy of the green channel of each pixel can be:
[0129]
[0130] in, Represents pixels The green channel value at that location (0-255); Represents pixels The red and blue channel values at that location; Represents a non-zero minimum constant (e.g.) To prevent the denominator from being 0; This indicates the relative energy of the green channel; the higher the value, the more significant the green component.
[0131] The relative energy of the green channel (the proportion of green components) is the basis for calculating the directional reflectance ratio.
[0132] Directional reflectivity, by analyzing the spatial gradient change of this energy (i.e., the intensity and direction of energy abrupt changes), accurately locates the specular reflection area and eliminates uniform green interference.
[0133] In this embodiment of the application, the formula for calculating the green gradient magnitude of each pixel can be:
[0134]
[0135] in, This represents the gradient (i.e., rate of change) of the green channel image in the horizontal direction (x direction). This represents the gradient of the green channel image in the vertical direction (y-direction); An amplitude map representing the gradient of the green channel reflects the degree of change in green intensity at each pixel, and is used to detect edges or reflective "hot spots".
[0136] If a pixel satisfies: and If it is, then it is marked as the initial green reflective pollution point. This represents the threshold of the green channel gradient. In other words, when determining the "initial green reflection / highlight," it considers factors beyond just the relative green energy. In addition, the gradient magnitude of the green channel is also required. Exceeding a threshold ;like Only when the green intensity of a pixel changes drastically enough (e.g., at the edge or as a specular highlight) is it marked as a green reflective contamination point. It is a parameter set by experience / algorithm and needs to be adjusted according to the image and noise level.
[0137] In this embodiment, the preset threshold can be... , The mean value of the a channel in the Lab color space for normal skin tones (empirical estimate); −10 represents the tolerance offset, which means that the pixel is more green than expected, which may be due to glare.
[0138] Step 105: Correct the green reflective pollution point in the Lab color space based on the neighboring skin pixels of the green reflective pollution point to obtain the Lab correction result.
[0139] As an optional implementation, step 105 corrects the green reflective pollution point in the Lab color space based on the neighboring skin pixels of the green reflective pollution point, and the method for obtaining the Lab correction result may include:
[0140] Based on the green channel value, red channel value, and blue channel value of the neighboring skin pixels of the green reflective pollution point, the green residual value of the green reflective pollution point is determined;
[0141] Based on the Lab color space, determine the green reflectivity weight coefficient of the green reflectivity pollution point;
[0142] Based on the original green channel value of the green reflective pollution point, the green residual value, and the green reflective weight coefficient, the corrected green channel value of the green reflective pollution point is determined.
[0143] Based on the corrected green channel value of the green reflective pollution point, the initial Lab correction result is determined;
[0144] The initial Lab correction result is smoothed to obtain the Lab correction result.
[0145] This implementation method determines the green residual value through neighboring skin pixels, accurately quantifying the degree of deviation of green reflective pollution points. By using the Lab color space to determine the green reflective weight coefficient, the correction intensity can be reasonably allocated. Based on this, the corrected green channel value is determined, effectively eliminating the influence of green reflections. Obtaining the initial Lab correction result first, followed by smoothing, avoids abrupt changes in the image, resulting in a natural color transition and rich detail in the corrected image. Overall, this method can accurately correct green reflective pollution points, improve image quality, and achieve superior reflection removal results.
[0146] In this embodiment of the application, the formula for calculating the green residual value of green reflective pollution points can be:
[0147]
[0148] in, The pixel coordinates of the green reflective pollution point represent its horizontal and vertical positions in the ultra-high-definition image; This represents the green component intensity of the green reflective pollution point, with a value range of 0-255; Indicates the red component; Indicates the blue component; This represents the average value of the red and blue channels, and is the baseline of the "non-green component" compared to the green channel. The green residual value represents the amount by which the green intensity exceeds that of red and blue, and can be used to determine whether green reflective pollution exists.
[0149] In this embodiment of the application, the formula for calculating the green reflectivity weight coefficient of green reflective pollution points can be:
[0150]
[0151] in, This represents the value of the a channel (red-green axis) in the Lab color space; The reference α channel value represents the skin tone; This represents the standard deviation and controls the range of weight decay. This represents the weighting function for a local window.
[0152] In this embodiment of the application, the formula for calculating the corrected green channel value of green reflective pollution points can be:
[0153]
[0154] in, This indicates the corrected green channel value; This represents the original green channel value; This represents the residual or reference value for green reflection.
[0155] In this embodiment, the initial Lab correction result is smoothed to obtain the final Lab correction result. This can be achieved by using a guided filter to perform local edge-preserving smoothing on the initial Lab correction result, avoiding hard cut-offs at the edges of color blocks. The specific implementation steps are as follows:
[0156] 4.1 Prepare the input correction image and guide image, usually the original image or skin color mask, and set the filter window size and regularization parameters.
[0157] The corrected image refers to the initial Lab color correction result obtained after the preceding algorithms (such as green reflectivity detection and Lab color correction). The corrected image is generally an image in Lab color space (i.e., each pixel has three channels: L, a, and b). During filtering, the a and b channels (chroma) can be smoothed separately to avoid affecting the luminance (L).
[0158] A guide image is an image used to guide edge preservation during filtering. Guide images are typically used in RGB space (i.e., the original image) or a single-channel mask space. It is not necessarily a Lab image, but rather serves as "guidance information," telling the filter which edges should be preserved.
[0159] 4.2 Within each window of the guiding image, calculate the mean and variance of the pixels to determine local statistical features.
[0160] 4.3 Based on these statistics, linear transformation coefficients are calculated, which describe the local changes in the image.
[0161] 4.4 These coefficients are applied to each pixel for transformation, and a smoothed result is obtained by window averaging.
[0162] 4.5 Guided filtering utilizes edge information of the guided image to preserve image details such as skin color boundaries, while smoothing reflective areas, thereby achieving a high-fidelity smoothing effect and supporting real-time processing.
[0163] Step 106: Convert the Lab correction result, the YCbCr target correction result, and the HLS correction result into a first corrected image, a second corrected image, and a third corrected image in RGB format, respectively.
[0164] Step 107: Based on the Lab weights of the Lab color space, the YCbCr weights of the YCbCr color space, and the HLS weights of the HLS color space, the first corrected image, the second corrected image, and the third corrected image are merged to obtain the reflection removal image.
[0165] By implementing steps 101 to 107, green reflections are accurately removed while preserving the naturalness of skin tone, thus improving the reflection removal effect of ultra-high-definition images. Furthermore, this application can precisely pinpoint the area to be processed, making subsequent reflection removal operations more targeted and improving overall processing quality. In addition, this application can effectively reduce errors in a single color space, making the determination of target skin tone areas more accurate and laying the foundation for high-quality reflection removal. Furthermore, this application can accurately identify green reflective contamination points in skin areas, providing a reliable basis for subsequent reflection removal. Furthermore, this application can improve the accuracy and reliability of initial contamination point determination, facilitating subsequent reflection removal. Moreover, this application can accurately correct green reflective contamination points, improving image quality and resulting in superior reflection removal effects.
[0166] Based on the same inventive concept, this application also provides an ultra-high-definition image reflection removal apparatus for implementing the aforementioned ultra-high-definition image reflection removal method. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations of one or more ultra-high-definition image reflection removal apparatus embodiments provided below can be found in the limitations of the ultra-high-definition image reflection removal method described above, and will not be repeated here.
[0167] In one exemplary embodiment, such as Figure 2 As shown, a reflection removal device for ultra-high-definition images is provided, comprising:
[0168] The first conversion unit 201 is used to convert the input ultra-high-definition image in RGB format into Lab color space, YCbCr color space and HLS color space.
[0169] The first determining unit 202 is used to determine the initial skin region and the initial YCbCr correction result in the ultra-high-definition image based on the YCbCr color space.
[0170] Verification unit 203 is used to perform cross-verification based on the initial skin region and the initial YCbCr correction result with the HLS color space to obtain the target skin region, the target YCbCr correction result and the HLS correction result;
[0171] The second determining unit 204 is used to determine green reflective pollution points in the skin area based on the ultra-high-definition image and the Lab color space;
[0172] Correction unit 205 is used to correct the green reflective pollution point in the Lab color space based on the neighboring skin pixels of the green reflective pollution point, and obtain Lab correction result;
[0173] The second conversion unit 206 is used to convert the Lab correction result, the YCbCr target correction result and the HLS correction result into a first corrected image, a second corrected image and a third corrected image in RGB format, respectively.
[0174] The merging unit 207 is used to merge the first corrected image, the second corrected image, and the third corrected image based on the Lab weights of the Lab color space, the YCbCr weights of the YCbCr color space, and the HLS weights of the HLS color space to obtain a reflection removal image.
[0175] By implementing the above methods, while preserving the naturalness of skin tone, green reflections can be accurately removed, thus improving the reflection removal effect of ultra-high-definition images.
[0176] In one exemplary embodiment, a computer device is provided, which may be a server or a terminal, and its internal structure diagram may be as follows. Figure 3 As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores reflection removal data for ultra-high-definition images. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements a reflection removal method for ultra-high-definition images.
[0177] Those skilled in the art will understand that Figure 3 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0178] In one exemplary embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0179] In one exemplary embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.
[0180] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.
[0181] In one exemplary embodiment, a chip is provided, the chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run programs or instructions to implement the steps in the above method embodiments and achieve the same technical effect, and will not be described again here to avoid repetition.
[0182] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.
[0183] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0184] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM).
[0185] The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0186] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0187] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method for removing reflections from ultra-high-definition images, characterized in that, The method for removing reflections from ultra-high-definition images includes: Convert the input ultra-high-definition RGB image to Lab color space, YCbCr color space, and HLS color space; The initial skin region and initial YCbCr correction result in the ultra-high-definition image are determined based on the YCbCr color space. Based on the initial skin region and the initial YCbCr correction result, cross-validation is performed with the HLS color space to obtain the target skin color region, the target YCbCr correction result, and the HLS correction result. Based on the ultra-high-definition image and the Lab color space, green reflective pollution points in the initial skin area are determined; Based on the neighboring skin pixels of the green reflective pollution points, the green reflective pollution points in the Lab color space are corrected to obtain the Lab correction result; The Lab correction result, the YCbCr target correction result, and the HLS correction result are respectively converted into a first corrected image, a second corrected image, and a third corrected image in RGB format. Based on the Lab weights of the Lab color space, the YCbCr weights of the YCbCr color space, and the HLS weights of the HLS color space, the first corrected image, the second corrected image, and the third corrected image are merged to obtain a reflection removal image. And, the determination of green reflective pollution points in the initial skin region based on the ultra-high-definition image and the Lab color space specifically includes: Based on the green channel value, red channel value, and blue channel value of each pixel in the ultra-high-definition image, the initial green reflective pollution point in the initial skin area is determined; Based on the Lab color space, green reflective pollution points are determined from the initial green reflective pollution points; wherein, the red-green channel values of the pixels of the green reflective pollution points in the Lab color space are less than a preset threshold. Furthermore, determining the initial green reflective contamination points in the initial skin region based on the green channel value, red channel value, and blue channel value of each pixel in the ultra-high-definition image specifically includes: Based on the green channel value, red channel value, and blue channel value of each pixel in the ultra-high-definition image, the relative energy of the green channel of each pixel is determined; Based on the green channel value of each pixel in the ultra-high-definition image, the green gradient magnitude of each pixel is determined; An initial green reflective contamination point is determined from the initial skin region of the ultra-high-definition image; wherein the relative energy of the green channel of the initial green reflective contamination point is greater than a preset relative energy, and the green gradient amplitude of the initial green reflective contamination point is greater than a preset green gradient amplitude; Furthermore, the correction of the green reflective pollution points in the Lab color space based on the neighboring skin pixels of the green reflective pollution points to obtain the Lab correction result specifically includes: Based on the green channel value, red channel value, and blue channel value of the neighboring skin pixels of the green reflective pollution point, the green residual value of the green reflective pollution point is determined; Based on the Lab color space, determine the green reflectivity weight coefficient of the green reflectivity pollution point; Based on the original green channel value of the green reflective pollution point, the green residual value, and the green reflective weight coefficient, the corrected green channel value of the green reflective pollution point is determined. Based on the corrected green channel value of the green reflective pollution point, the initial Lab correction result is determined; The initial Lab correction result is smoothed to obtain the Lab correction result; Furthermore, the formula for calculating the relative energy of the green channel for each pixel is: ; in, This indicates the relative energy of the green channel. Represents pixels The green channel value at that location; Represents pixels The red and blue channel values at that location; Represents a non-zero minimum constant; And, the formula for calculating the green gradient magnitude of each pixel is: ; in, The magnitude map representing the green gradient reflects the degree of drastic change in green intensity for each pixel. This represents the gradient of the green channel value in the horizontal direction; This represents the gradient of the green channel value in the vertical direction.
2. The method for removing reflections from ultra-high-definition images according to claim 1, characterized in that, The determination of the initial skin region and initial YCbCr correction result in the ultra-high-definition image based on the YCbCr color space specifically includes: An elliptical model of the skin color region is constructed in the YCbCr color space to determine the concentrated distribution area of skin color pixels in the YCbCr color space. By eliminating the incorrectly selected regions within the concentrated distribution area, the initial correction result for YCbCr is obtained; The region in the ultra-high-definition image corresponding to the initial correction result of YCbCr is determined as the initial skin region.
3. The method for removing reflections from ultra-high-definition images according to claim 2, characterized in that, The process of cross-validating the initial skin region and the initial YCbCr correction result with the HLS color space to obtain the target skin color region, the target YCbCr correction result, and the HLS correction result specifically includes: The HLS skin tone region is determined from the HLS color space; wherein the hue of each pixel in the HLS skin tone region is within a preset hue range, and the saturation of each pixel in the HLS skin tone region is within a preset saturation range. The HLS skin tone region and the initial skin region are adjusted based on the overlap between the HLS skin tone region and the initial skin region to determine the target skin tone region and the HLS correction result. The initial correction result of YCbCr is adjusted based on the target skin color region to determine the target correction result of YCbCr.
4. A reflection removal device for ultra-high-definition images, characterized in that, The reflection removal device for the ultra-high-definition image includes: The first conversion unit is used to convert the input ultra-high-definition image in RGB format into Lab color space, YCbCr color space and HLS color space; The first determining unit is used to determine the initial skin region and the initial YCbCr correction result in the ultra-high-definition image based on the YCbCr color space. The verification unit is used to perform cross-verification based on the initial skin region and the initial YCbCr correction result with the HLS color space to obtain the target skin region, the target YCbCr correction result and the HLS correction result. The second determining unit is used to determine green reflective pollution points in the initial skin area based on the ultra-high-definition image and the Lab color space; The correction unit is used to correct the green reflective pollution point in the Lab color space based on the neighboring skin pixels of the green reflective pollution point, and obtain the Lab correction result; The second conversion unit is used to convert the Lab correction result, the YCbCr target correction result and the HLS correction result into a first corrected image, a second corrected image and a third corrected image in RGB format, respectively. The merging unit is used to merge the first corrected image, the second corrected image, and the third corrected image based on the Lab weights of the Lab color space, the YCbCr weights of the YCbCr color space, and the HLS weights of the HLS color space to obtain a reflection removal image. Furthermore, the second determining unit determines the green reflective pollution points in the initial skin region based on the ultra-high-definition image and the Lab color space in the following specific manner: Based on the green channel value, red channel value, and blue channel value of each pixel in the ultra-high-definition image, the initial green reflective pollution point in the initial skin area is determined; Based on the Lab color space, green reflective pollution points are determined from the initial green reflective pollution points; wherein, the red-green channel values of the pixels of the green reflective pollution points in the Lab color space are less than a preset threshold. Furthermore, the second determining unit determines the initial green reflective contamination points in the initial skin region based on the green channel value, red channel value, and blue channel value of each pixel in the ultra-high-definition image in the following specific manner: Based on the green channel value, red channel value, and blue channel value of each pixel in the ultra-high-definition image, the relative energy of the green channel of each pixel is determined; Based on the green channel value of each pixel in the ultra-high-definition image, the green gradient magnitude of each pixel is determined; An initial green reflective contamination point is determined from the initial skin region of the ultra-high-definition image; wherein the relative energy of the green channel of the initial green reflective contamination point is greater than a preset relative energy, and the green gradient amplitude of the initial green reflective contamination point is greater than a preset green gradient amplitude; Furthermore, the correction unit corrects the green reflective pollution points in the Lab color space based on the neighboring skin pixels of the green reflective pollution points, and obtains the Lab correction result in the following specific manner: Based on the green channel value, red channel value, and blue channel value of the neighboring skin pixels of the green reflective pollution point, the green residual value of the green reflective pollution point is determined; Based on the Lab color space, determine the green reflectivity weight coefficient of the green reflectivity pollution point; Based on the original green channel value of the green reflective pollution point, the green residual value, and the green reflective weight coefficient, the corrected green channel value of the green reflective pollution point is determined. Based on the corrected green channel value of the green reflective pollution point, the initial Lab correction result is determined; The initial Lab correction result is smoothed to obtain the Lab correction result; Furthermore, the formula for calculating the relative energy of the green channel for each pixel is: ; in, This indicates the relative energy of the green channel. Represents pixels The green channel value at that location; Represents pixels The red and blue channel values at that location; Represents a non-zero minimum constant; And, the formula for calculating the green gradient magnitude of each pixel is: ; in, The magnitude map representing the green gradient reflects the degree of drastic change in green intensity for each pixel. This represents the gradient of the green channel value in the horizontal direction; This represents the gradient of the green channel value in the vertical direction.
5. A computer device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor executes the computer program to implement the steps of the method for removing reflections from an ultra-high-definition image according to any one of claims 1-3.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method for removing reflections from ultra-high-definition images according to any one of claims 1-3.
7. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method for removing reflections from ultra-high-definition images according to any one of claims 1-3.
Citation Information
Patent Citations
Image highlight removal method based on color partitions
CN113469895A
Image processing method and device, electronic equipment and storage medium
CN114266803A