CN111524076A - Image processing method, electronic device, and computer-readable storage medium - Google Patents

Image processing method, electronic device, and computer-readable storage medium Download PDF

Info

Publication number
CN111524076A
CN111524076A CN202010265232.5A CN202010265232A CN111524076A CN 111524076 A CN111524076 A CN 111524076A CN 202010265232 A CN202010265232 A CN 202010265232A CN 111524076 A CN111524076 A CN 111524076A
Authority
CN
China
Prior art keywords
image
value
processed
color
hue
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010265232.5A
Other languages
Chinese (zh)
Other versions
CN111524076B (en
Inventor
张学成
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Communications Group Co Ltd
MIGU Culture Technology Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
MIGU Culture Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Mobile Communications Group Co Ltd, MIGU Culture Technology Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN202010265232.5A priority Critical patent/CN111524076B/en
Publication of CN111524076A publication Critical patent/CN111524076A/en
Application granted granted Critical
Publication of CN111524076B publication Critical patent/CN111524076B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • G06T5/94
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/194Segmentation; Edge detection involving foreground-background segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10016Video; Image sequence
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10024Color image

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)
  • Facsimile Image Signal Circuits (AREA)

Abstract

The embodiment of the invention relates to the technical field of image processing, and discloses an image processing method, electronic equipment and a computer readable storage medium. In the present invention, the image processing method includes: determining an overflow color area in an image to be processed, and determining the confidence coefficient that pixels in the overflow color area are in a preset hue; the preset hue is the hue of the background color in the image to be processed; removing the background color in the image to be processed to obtain a first image; performing linear mixing on the first image and the image to be processed according to the confidence coefficient to obtain a second image; and correcting the brightness and the saturation of the second image to obtain a processed result image, so that background color components reflected by the color overflowing area can be effectively inhibited, and the colors of some non-color overflowing areas are not influenced.

Description

Image processing method, electronic device, and computer-readable storage medium
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to an image processing method, an electronic device, and a computer-readable storage medium.
Background
At present, the green screen matting technology plays an extremely important role in the film industry, foreground and background objects can be accurately separated through the green screen technology, and various special effects in the film can be realized through the later-stage synthesis technology. In the real green curtain scene shooting, because the influence of scene light overall arrangement and foreground object itself, green composition very easily "overflows" to the foreground object on, if: 1) green screen background reflection 2) foreground character wearing white clothing 3) foreground object hair edges 4) figure body contour and edges etc. The overflow of the green component causes the local color cast of the imaged foreground object, and in order to overcome the overflow phenomenon, a plurality of existing color suppression methods are proposed, the existing main stream methods are mostly RGB channel suppression, the main principle is to suppress the color component of a G channel or a B channel (blue screen), and reduce the influence of the green or blue component
However, the inventors found that at least the following problems exist in the related art: although the RGB channel suppression method can effectively suppress the background color component reflected by the color-bleeding region, it can affect the colors of some non-color-bleeding regions.
Disclosure of Invention
It is an object of embodiments of the present invention to provide an image processing method, an electronic device, and a computer-readable storage medium that make it possible to effectively suppress background color components reflected by a color bleeding region while not affecting the colors of some non-color bleeding regions.
To solve the above technical problem, an embodiment of the present invention provides an image processing method, including: determining an overflow color area in an image to be processed, and determining the confidence coefficient that pixels in the overflow color area are in a preset hue; the preset hue is the hue of the background color in the image to be processed; removing the background color in the image to be processed to obtain a first image; performing linear mixing on the first image and the image to be processed according to the confidence coefficient to obtain a second image; and correcting the brightness and the saturation of the second image to obtain a processed result image.
An embodiment of the present invention also provides an electronic device, including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the image processing method described above.
Embodiments of the present invention also provide a computer-readable storage medium storing a computer program which, when executed by a processor, implements the image processing method described above.
Compared with the prior art, the method and the device for determining the color overflowing area in the image to be processed distinguish the color overflowing area from the non-color overflowing area in the image to be processed. By determining the confidence coefficient that the pixel in the color overflowing area in the image to be processed is the preset hue, wherein the preset hue is the hue of the background color in the image to be processed, the closeness degree of the pixel to the hue of the background color can be obtained through the confidence coefficient of the pixel in the color overflowing area. The first image is obtained by removing the background color in the image to be processed, so that the background color component in the first image can be greatly reduced. And linearly mixing the first image and the image to be processed according to the confidence coefficient to obtain a second image, namely linearly mixing the first image without the background color and the image to be processed, namely the original image, to obtain the second image by combining the proximity degree of the hue of the pixels in the spilled color area and the hue of the background color, so that the background color component reflected by the second image compared with the spilled color area of the original image can be inhibited to a certain extent. In addition, since the removal of the background color in the image to be processed affects the brightness and the saturation to some extent, the brightness and the saturation of the second image are corrected to obtain the processed result image, so that the brightness and the saturation affected by the removal of the background color can be restored in the processed result image, and the colors of some non-spill color areas can not be affected while background color components reflected by the spill color areas are suppressed.
In addition, the calculating the confidence that the pixel in the overflow color region is the preset hue according to the HSL component value of the pixel in the overflow color region and the working interval associated with the preset hue includes: calculating the confidence coefficient that the pixels in the overflow color area are in the preset hue by the following formula:
Figure BDA0002441022980000021
wherein C is the confidence of the calculation, H is the hue component value of the pixel, and L is the color component value of the pixelo,Li,Ro,RiThe values are a head end gradual change starting value, a head end gradual change ending value, a tail end gradual change starting value and a tail end gradual change ending value of the working interval on the color phase ring. A specific formula for calculating the confidence coefficient is provided, so that the confidence coefficient that the pixels in the overflow color region are in the preset hue can be calculated accurately.
The hue estimation value is obtained as follows: acquiring the average value of H component values of pixels in a background area in the image to be processed in an HSL color space; and taking the average value of the H component values as the hue estimation value. The method for obtaining the hue estimation value is provided, the average value of H component values of the pixels of the background area in the HSL color space is used as the hue estimation value, the H component values of all the pixels of the background area are taken into consideration, the hue value of the background color is accurately estimated, and the deviation possibly caused by using the hue empirical value of the background color in the prior art is avoided.
In addition, after the adjusting the brightness and the saturation of the second image and acquiring the processed result image, the method further includes: analyzing color components of the background area of the image to be processed to determine an overflow inhibition estimation value; and performing linear fusion on the image to be processed and the result image according to the overflow inhibition estimation value to obtain a target image. Considering that the background color is often changed due to different lamplight materials in an actual scene, the existing G-channel overflow suppression method does not analyze the real background color component, and the overflow suppression deficiency or the over suppression is easy to derive. According to the embodiment of the invention, the overflow inhibition estimation value is determined by analyzing the color components of the background area of the image to be processed, and the image to be processed and the result image are linearly fused according to the overflow inhibition estimation value to obtain the target image, so that the overflow inhibition is favorably avoided from being insufficient or excessively inhibited, and the background color component reflected by the overflow area is more accurately inhibited.
In addition, the analyzing the color components of the background area of the image to be processed to determine the overflow suppression estimation value includes: acquiring the average value of all component values of pixels in a background area in the image to be processed in an HSL color space; wherein the average value of each component value includes an average value of an H component value, an average value of an S component value, and an average value of an L component value; and calculating the overflow suppression estimation value according to the average value of all component values under the HSL color space. The method is favorable for accurately analyzing the color components of the background area of the image to be processed by acquiring the average value of all component values of the pixels of the background area in the image to be processed in the HSL color space, and is favorable for reasonably calculating the overflow suppression estimation value according to the average value of all component values in the HSL color space.
Drawings
One or more embodiments are illustrated by the corresponding figures in the drawings, which are not meant to be limiting.
Fig. 1 is a flowchart of an image processing method according to a first embodiment of the present invention;
FIG. 2 is a diagram illustrating the relationship between the confidence level of a pixel and the interval of the H component value of the pixel according to the first embodiment of the present invention;
fig. 3 is a flowchart of an image processing method according to a second embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device according to a third embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, embodiments of the present invention will be described in detail below with reference to the accompanying drawings. However, it will be appreciated by those of ordinary skill in the art that numerous technical details are set forth in order to provide a better understanding of the present application in various embodiments of the present invention. However, the technical solution claimed in the present application can be implemented without these technical details and various changes and modifications based on the following embodiments. The following embodiments are divided for convenience of description, and should not constitute any limitation to the specific implementation manner of the present invention, and the embodiments may be mutually incorporated and referred to without contradiction.
A first embodiment of the present invention relates to an image processing method. The following detailed description of the present embodiments is provided for ease of understanding and is not intended to limit the scope of the present embodiments. As shown in fig. 1, the flowchart of the image processing method in the present embodiment specifically includes:
step 101: and determining an overflow color area in the image to be processed, and determining the confidence coefficient that pixels in the overflow color area are in a preset hue.
The preset hue is a hue of a background color in the image to be processed, namely a hue of a color of a background curtain in the image to be processed. For example, in a specific implementation, if the background screen is a green screen, the predetermined hue is a green hue, and if the background screen is a blue screen, the predetermined hue is a blue hue.
In one example, the manner of determining the color overflow area in the image to be processed may be: determining a working interval associated with a preset hue according to the hue circle, acquiring the hue of the pixel in the image to be processed, and determining a color overflowing area in the image to be processed according to whether the hue of the pixel in the image to be processed is in the working interval associated with the preset hue. For example, if the hue of a pixel is in the working interval associated with the preset hue, the area where the pixel is located is a color-bleeding area, otherwise, the area is a non-color-bleeding area. Taking the background curtain as a green curtain as an example, the working interval associated with the hue of the green determined according to the color phase circle may be [75 °, 165 ° ], and the working interval includes green and green corresponding hue values, and the green may include cyan, yellow, and the like. The range of hue values corresponding to green is [105 °, 135 ° ], and the remaining ranges are those corresponding to greenish. In a specific implementation, the operating range associated with the green hue may also be represented as [75 °, 105 °, 135 °, 165 °.
In one example, the confidence level that the pixels in the overflow region are in the preset hue may be determined by: firstly, converting RGB component values of pixels of an image to be processed into HSL component values; that is, the HSL color space conversion is performed on the image to be processed to obtain the HSL component values of the pixels of the image to be processed, and since the conversion between the RGB component values and the HSL component values belongs to the prior art, the description thereof will not be provided in this embodiment. And then, according to the HSL component values of the pixels in the overflow color area and the working interval associated with the preset hue, calculating the confidence coefficient that the pixels in the overflow color area are the preset hue. The confidence of a pixel can represent the degree of closeness of the pixel to the hue of the background color, and the interval where the confidence is located is [0, 1 ]. The confidence coefficient is 0, which indicates that the pixel has no correlation with the hue of the background color; a confidence of 1 indicates that the pixel has the same hue as the background color; a confidence of (0, 1) indicates that the pixel is associated with but not the same hue as the background color, and the closer the pixel is to the hue of the background color, the greater the confidence. It is understood that the confidence of the pixel in the overflow area is (0, 1), and the confidence of the pixel in the overflow area is 0. for example, taking the background as a green curtain, the working interval associated with the green hue may be [75 °, 165 ° ], if the hue of the pixel is between [105 °, 135 ° ] and the confidence of the pixel is 1, if the hue of the pixel is not between [75 °, 165 ° ], the confidence of the pixel is 0, if the hue of the pixel is at [75 °, 105 °) or (135 °, 165 °), the confidence may be determined according to the proximity of the hue of the pixel and the green hue.
In one example, the confidence that the pixels in the bleed area are of the preset hue may be calculated by the following formula:
Figure BDA0002441022980000051
wherein C is the confidence of the calculation, H is the hue component value of the pixel, and L is the color component value of the pixelo,Li,Ro,RiAre respectively stationAnd the head end gradual change starting value, the head end gradual change ending value, the tail end gradual change starting value and the tail end gradual change ending value of the working interval on the color phase ring. The preset hue is the green hue as an example, and the working interval associated with the green hue can be represented as [75 °, 105 °, 135 °, 165 ° ]]. For ease of understanding, reference may be made to fig. 2, which illustrates the relationship between the confidence of a pixel and the interval in which the H component value of the pixel is located. It will be appreciated that each pixel in the bleed region may correspond to a confidence level.
Step 102: and removing the background color in the image to be processed to obtain a first image.
For example, if the background color in the image to be processed is the color of the green curtain, 0 value filling may be performed on the G channel except for the image to be processed, so as to remove the green component in the image to be processed. For another example, if the background color in the image to be processed is the color of a blue curtain, 0 value filling may be performed on the B channel except for the image to be processed, so as to remove the blue component in the image to be processed. Wherein the first image may be an image based on an HSL color space.
In one example, the background color in the image to be processed is the color of the green curtain, and the first image may be obtained by performing 0-value filling on the G channel in the image to be processed, and then performing HSL color space conversion on the image after the 0-value filling.
Step 103: and performing linear mixing on the first image and the image to be processed according to the confidence coefficient to obtain a second image.
Specifically, the pixel values in the first image and the pixel values in the image to be processed may be linearly mixed according to the confidence of the pixels in the overflow region, so as to obtain the second image. It is understood that the positions of the respective pixels in the first image and the image to be processed are the same, and thus a preset region of the first image can be acquired, the relative position of which in the first image is the same as the relative position of the bleeding region in the image to be processed. And according to the confidence coefficient of the pixels in the spill-over area, carrying out linear mixing on the pixel values of the pixels in the preset area in the first image and the pixel values of the pixels in the spill-over area in the image to be processed to obtain a second image.
In one example, the hue and saturation of the first image may be adjusted to obtain a first adjusted image. For example, a current hue value and a current saturation value of the first image may be obtained, respectively, the current hue value of the first image minus the preset hue value is used as a target hue value, and the current saturation value minus the preset saturation value is used as a target saturation value. And then, respectively adjusting the hue and the saturation of the first image into the target hue value and the target saturation value to obtain a first adjusted image. The preset hue value and the preset saturation value may be set according to actual needs, for example, in this embodiment, the preset hue value may be set to 24 ° ± 10 °, and the preset saturation value may be set to-30 ± 10, but the specific implementation is not limited thereto. After the first adjusted image is obtained, the first adjusted image and the image to be processed can be linearly mixed according to the confidence coefficient by the following formula to obtain a second image:
I2=(1.0-C)*I+C*(I1_0)
wherein I2 is the pixel value of the second image, C is the confidence, I is the pixel value of the image to be processed, and I1_0 is the pixel value of the first adjusted image. The linear blending may be understood as performing linear blending on the pixel values of the pixels in the image to be processed and the pixel values of the pixels in the preset region in the first adjusted image according to the confidence of the pixels in the overflow region; and the relative position of the preset area in the first adjustment image is the same as the relative position of the color overflowing area in the image to be processed. That is, in the present embodiment, only the pixel values of the pixels of the color bleeding area in the image to be processed are adjusted.
Step 104: and correcting the brightness and the saturation of the second image to obtain a processed result image.
In one example, the brightness and the saturation of the second image may be corrected according to the empirical values of the brightness and the saturation, and the processed result image may be obtained.
In another example, the brightness and saturation of the second image are corrected, and the processed result image is obtained as follows:
firstly, converting a preset background color mixing factor based on an HSL color space into a background color mixing factor based on an RGB color space; wherein, the background color mixing factor based on the HSL color space comprises: hue estimate H, brightness estimate L, and saturation estimate S, the background color mixing factor may be represented as (H, S, L). The luminance estimated value L and the saturation estimated value S may be set according to actual needs, in this embodiment, the luminance estimated value L may be set to 50 ± 10, and the saturation estimated value S may be set to 50 ± 10, but the implementation is not limited thereto. Performing RGB color space conversion on the background color mixing factor (H, S, L) based on HSL color space to obtain the background color mixing factor (R) based on RGB color spaceb,Gb,Bb). In addition, since the conversion between the HSL color space and the RGB color space is prior art, the specific conversion process is not described in detail in this embodiment.
In one example, the hue estimation value H in the background color mixing factor (H, S, L) may be an empirical value, such as a hue value of green in a green curtain background, and the hue estimation value H may be a hue value of green, such as 120 °.
In another example, the hue estimation value in the background color mixture factor (H, S, L) is obtained as follows: acquiring an average value of H component values of pixels in a background area in an image to be processed in an HSL color space; and taking the average value of the H component values as the hue estimation value. For example, the foreground and background can be segmented based on the existing segmentation technology to obtain the foreground mask image M, and the segmentation of the foreground and background can adopt the traditional matting technology, such as: the method is realized by a shared-matching method, a close-form matching method and the like. Then, according to the image to be processed and the foreground mask image, color component analysis is performed on the background area to obtain an average value of RGB component values of pixels of the background area in an RGB color space, the average value of the RGB component values is converted into an average value of HSL component values in an HSL color space, and then the average value of the H component values is used as a hue estimation value in a background color mixing factor (H, S, L). In addition, when the color component analysis is performed on the background area according to the image to be processed and the foreground mask image, the image to be processed and the foreground mask image may be downsampled to obtain the image to be processed and the foreground mask image with the preset resolution, and then the color component analysis is performed on the background area according to the image to be processed and the foreground mask image with the preset resolution, so as to obtain an average value of H component values of pixels of the background area in the image to be processed in the HSL color space. Where down-sampling is understood to be scaling down the image, the predetermined resolution may be small, such as the longer side of the image not exceeding 320 pixels. And the image to be processed and the foreground mask image are downsampled firstly, so that the execution time is favorably shortened.
Next, the luminance and saturation of the background color mixing factor based on the RGB color space are acquired. For example, the luminance value L and the saturation value S of the background color mixing factor based on the RGB color space may be obtained by the following formulas:
L=aRb+bGb+cBb
S=max(Rb,Gb,Bb)-min(Rb,Gb,Bb)
the value of a + b + c is 1, and the specific values of a, b, and c may be set according to actual needs, and in one example, the values of a, b, and c may be as follows: a is 0.3, b is 0.59, and c is 0.11, but the invention is not limited thereto in specific implementations.
And then, respectively correcting the brightness and the saturation of the second image according to the acquired brightness value and the acquired saturation value, and acquiring an acquired processed result image. For example, the luminance and saturation of the second image are corrected to the acquired luminance value L and saturation value S, respectively.
The above examples in the present embodiment are only for convenience of understanding, and do not limit the technical aspects of the present invention.
Compared with the prior art, the embodiment determines the color overflowing area in the image to be processed, namely, distinguishes the color overflowing area from the non-color overflowing area in the image to be processed. By determining the confidence coefficient that the pixel in the color overflowing area in the image to be processed is the preset hue, wherein the preset hue is the hue of the background color in the image to be processed, the closeness degree of the pixel to the hue of the background color can be obtained through the confidence coefficient of the pixel in the color overflowing area. The first image is obtained by removing the background color in the image to be processed, so that the background color component in the first image can be greatly reduced. And linearly mixing the first image and the image to be processed according to the confidence coefficient to obtain a second image, namely linearly mixing the first image without the background color and the image to be processed, namely the original image, to obtain the second image by combining the proximity degree of the hue of the pixels in the spilled color area and the hue of the background color, so that the background color component reflected by the second image compared with the spilled color area of the original image can be inhibited to a certain extent. In addition, since the removal of the background color in the image to be processed affects the brightness and the saturation to some extent, the brightness and the saturation of the second image are corrected to obtain the processed result image, so that the brightness and the saturation affected by the removal of the background color can be restored in the processed result image, and the colors of some non-spill color areas can not be affected while background color components reflected by the spill color areas are suppressed.
A second embodiment of the present invention relates to an image processing method. The second embodiment is a further improvement of the first embodiment, and the present embodiment further processes the result image to obtain the target image after obtaining the result image, so that insufficient or excessive suppression of overflow can be avoided, thereby more accurately suppressing the background color component reflected by the overflow area. The following detailed description of the present embodiments is provided for ease of understanding and is not intended to limit the scope of the present embodiments. As shown in fig. 2, the flowchart of the image processing method in the present embodiment specifically includes:
step 201: and determining an overflow color area in the image to be processed, and determining the confidence coefficient that pixels in the overflow color area are in a preset hue.
Step 202: and removing the background color in the image to be processed to obtain a first image.
Step 203: and performing linear mixing on the first image and the image to be processed according to the confidence coefficient to obtain a second image.
Step 204: and correcting the brightness and the saturation of the second image to obtain a processed result image.
Steps 201 to 204 are substantially the same as steps 101 to 104 in the first embodiment, and are not repeated herein.
Step 205: and carrying out color component analysis on the background area of the image to be processed to determine an overflow inhibition estimation value.
Specifically, an average value of component values of pixels in a background area in an image to be processed in an HSL color space may be obtained; wherein the average value of each component value includes an average value of H component values, an average value of S component values, and an average value of L component values. And then calculating the overflow suppression estimation value according to the average value of all component values in the HSL color space.
In one example, the manner of obtaining the average value of the component values in the HSL color space of the pixel of the background area in the image to be processed may be as follows: obtaining a foreground mask image corresponding to the image to be processed, and carrying out color statistics on a background area in an RGB color space according to the image to be processed and the foreground mask image to obtain a background average color of the background area
Figure BDA0002441022980000081
Will be provided with
Figure BDA0002441022980000082
Converting into HSL color space to obtain background average color in HSL color space
Figure BDA0002441022980000083
Wherein the content of the first and second substances,
Figure BDA0002441022980000084
it can be understood that: the average of the RGB component values of the pixels of the background area,
Figure BDA0002441022980000085
it can be understood that: h of pixels of background areaAverage of SL component values. In addition, after the foreground mask image corresponding to the image to be processed is obtained, down sampling can be performed on the image to be processed and the foreground mask image to obtain the image to be processed and the foreground mask image with preset resolution, and then color statistics of a background area is performed in an RGB color space according to the image to be processed and the foreground mask image with the preset resolution to obtain a background average color of the background area
Figure BDA0002441022980000086
Where down-sampling is understood to be scaling down the image, the predetermined resolution may be small, such as the longer side of the image not exceeding 320 pixels. And the image to be processed and the foreground mask image are downsampled firstly, so that the execution time is favorably shortened.
In one example, the overflow suppression estimate may be calculated based on the average of the component values in the HSL color space by: the overflow suppression estimate is calculated by the following equation:
Figure BDA0002441022980000091
where α is the calculated overflow suppression estimate,
Figure BDA0002441022980000092
the average values of the component values in the HSL color space are respectively. x is the number of1To x7Can be set according to actual needs, wherein x1、x2、x3、x5Are all natural numbers less than 1, x7Is a natural number greater than 1, x5And x6Can be 50 + -20. In one example, x1To x7The values of (a) can be as follows: x is the number of1=0.8±0.1,x2=0.6±0.1,x3=0.35±0.1,x4=50±10,x5=0.5±0.2,x6=50±10,x7=1.767±0.2
Step 206: and performing linear fusion on the image to be processed and the result image according to the overflow inhibition estimation value to obtain a target image.
Specifically, the pixel values in the first image and the pixel values in the image to be processed may be linearly mixed according to the overflow suppression estimation value to obtain the target image. In specific implementation, an alpha fusion method can be used for completing adaptive adjustment of overflow inhibition on an image to be processed, a result image and an overflow inhibition estimation value alpha, and a target image is obtained. For example, linear fusion can be performed according to the following formula:
I4=(1-α)I+αI3
wherein, I4Is the pixel value of the target image, I is the pixel value of the image to be processed, I3Linear blending may be understood as linear blending of pixel values of pixels at the same location in the image to be processed and the result image.
Compared with the prior art, in the embodiment, considering that the background color is often changed due to different lamplight materials in an actual scene, the existing G-channel overflow suppression method does not analyze the real background color component, and overflow suppression deficiency or excessive suppression is easy to derive. According to the embodiment of the invention, the overflow inhibition estimation value is determined by analyzing the color components of the background area of the image to be processed, and the image to be processed and the result image are linearly fused according to the overflow inhibition estimation value to obtain the target image, so that the overflow inhibition is favorably avoided from being insufficient or excessively inhibited, and the background color component reflected by the overflow area is more accurately inhibited.
The steps of the above methods are divided for clarity, and the implementation may be combined into one step or split some steps, and the steps are divided into multiple steps, so long as the same logical relationship is included, which are all within the protection scope of the present patent; it is within the scope of the patent to add insignificant modifications to the algorithms or processes or to introduce insignificant design changes to the core design without changing the algorithms or processes.
A third embodiment of the present invention relates to an electronic device, as shown in fig. 3, including at least one processor 301; and a memory 302 communicatively coupled to the at least one processor 301; the memory 302 stores instructions executable by the at least one processor 301, and the instructions are executed by the at least one processor 301, so that the at least one processor 301 can execute the image processing method according to the first or second embodiment.
Where the memory 302 and the processor 301 are coupled in a bus, the bus may comprise any number of interconnected buses and bridges, the buses coupling one or more of the various circuits of the processor 301 and the memory 302. The bus may also connect various other circuits such as peripherals, voltage regulators, power management circuits, and the like, which are well known in the art, and therefore, will not be described any further herein. A bus interface provides an interface between the bus and the transceiver. The transceiver may be one element or a plurality of elements, such as a plurality of receivers and transmitters, providing a means for communicating with various other apparatus over a transmission medium. The data processed by the processor 301 is transmitted over a wireless medium through an antenna, which further receives the data and transmits the data to the processor 301.
The processor 301 is responsible for managing the bus and general processing and may also provide various functions including timing, peripheral interfaces, voltage regulation, power management, and other control functions. And memory 302 may be used to store data used by processor 301 in performing operations.
A fourth embodiment of the present invention relates to a computer-readable storage medium storing a computer program. The computer program realizes the above-described method embodiments when executed by a processor.
That is, as can be understood by those skilled in the art, all or part of the steps in the method for implementing the embodiments described above may be implemented by a program instructing related hardware, where the program is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, or the like) or a processor (processor) to execute all or part of the steps of the method described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It will be understood by those of ordinary skill in the art that the foregoing embodiments are specific examples for carrying out the invention, and that various changes in form and details may be made therein without departing from the spirit and scope of the invention in practice.

Claims (10)

1. An image processing method, comprising:
determining an overflow color area in an image to be processed, and determining the confidence coefficient that pixels in the overflow color area are in a preset hue; the preset hue is the hue of the background color in the image to be processed;
removing the background color in the image to be processed to obtain a first image;
performing linear mixing on the first image and the image to be processed according to the confidence coefficient to obtain a second image;
and correcting the brightness and the saturation of the second image to obtain a processed result image.
2. The method according to claim 1, wherein the determining the confidence level that the pixels in the bleeding region are of the preset hue comprises:
converting RGB component values of pixels of the image to be processed into HSL component values;
and calculating the confidence coefficient that the pixels in the overflow color area are the preset hue according to the HSL component values of the pixels in the overflow color area and the working interval associated with the preset hue.
3. The method according to claim 2, wherein the calculating the confidence level that the pixel in the bleeding area is the preset hue according to the HSL component value of the pixel in the bleeding area and the working interval associated with the preset hue comprises:
calculating the confidence coefficient that the pixels in the overflow color area are in the preset hue by the following formula:
Figure FDA0002441022970000011
wherein C is the confidence of the calculation, H is the hue component value of the pixel, and L is the color component value of the pixelo,Li,Ri,RoThe values are a head end gradual change starting value, a head end gradual change ending value, a tail end gradual change starting value and a tail end gradual change ending value of the working interval on the color phase ring.
4. The image processing method according to claim 1, wherein the linearly mixing the first image and the image to be processed according to the confidence coefficient to obtain a second image comprises:
adjusting the hue and saturation of the first image to obtain a first adjusted image;
and linearly mixing the first adjustment image and the image to be processed according to the confidence coefficient by using the following formula to obtain a second image:
I2=(1.0-C)*I+C*(I1_0)
wherein the I2 is a pixel value of the second image, the C is a confidence, the I is a pixel value of the image to be processed, and the I1_0 is a pixel value of the first adjusted image.
5. The image processing method according to claim 1, wherein the correcting the brightness and the saturation of the second image to obtain a processed result image comprises:
converting a preset background color mixing factor based on an HSL color space into a background color mixing factor based on an RGB color space; wherein the HSL color space-based background color mixing factor comprises: hue estimation value, brightness estimation value and saturation estimation value;
acquiring the brightness value and the saturation value of the background color mixing factor based on the RGB color space;
and respectively correcting the brightness and the saturation of the second image according to the acquired brightness value and the acquired saturation value, and acquiring an acquired processed result image.
6. The image processing method according to claim 5, wherein the hue estimation value is obtained as follows:
acquiring the average value of H component values of pixels in a background area in the image to be processed in an HSL color space;
and taking the average value of the H component values as the hue estimation value.
7. The image processing method according to claim 1, further comprising, after the adjusting the brightness and the saturation of the second image to obtain a processed result image:
analyzing color components of the background area of the image to be processed to determine an overflow inhibition estimation value;
and performing linear fusion on the image to be processed and the result image according to the overflow inhibition estimation value to obtain a target image.
8. The image processing method according to claim 7, wherein the performing color component analysis on the background region of the image to be processed to determine an overflow suppression estimation value comprises:
acquiring the average value of all component values of pixels in a background area in the image to be processed in an HSL color space; wherein the average value of each component value includes an average value of an H component value, an average value of an S component value, and an average value of an L component value;
and calculating the overflow suppression estimation value according to the average value of all component values under the HSL color space.
9. An electronic device, comprising:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the image processing method of any one of claims 1 to 8.
10. A computer-readable storage medium, storing a computer program, wherein the computer program, when executed by a processor, implements the image processing method of any one of claims 1 to 8.
CN202010265232.5A 2020-04-07 2020-04-07 Image processing method, electronic device, and computer-readable storage medium Active CN111524076B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010265232.5A CN111524076B (en) 2020-04-07 2020-04-07 Image processing method, electronic device, and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010265232.5A CN111524076B (en) 2020-04-07 2020-04-07 Image processing method, electronic device, and computer-readable storage medium

Publications (2)

Publication Number Publication Date
CN111524076A true CN111524076A (en) 2020-08-11
CN111524076B CN111524076B (en) 2023-07-21

Family

ID=71901261

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010265232.5A Active CN111524076B (en) 2020-04-07 2020-04-07 Image processing method, electronic device, and computer-readable storage medium

Country Status (1)

Country Link
CN (1) CN111524076B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113487497A (en) * 2021-06-18 2021-10-08 维沃移动通信有限公司 Image processing method and device and electronic equipment
CN113763496A (en) * 2021-03-19 2021-12-07 北京沃东天骏信息技术有限公司 Image coloring method, device and computer readable storage medium

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH103549A (en) * 1996-06-17 1998-01-06 Hitachi Ltd Device for supporting discrimination of sounding body
US6122441A (en) * 1994-03-31 2000-09-19 Canon Kabushiki Kaisha Image processing apparatus and method
US20040041820A1 (en) * 2002-08-30 2004-03-04 Benoit Sevigny Image processing
JP2004248020A (en) * 2003-02-14 2004-09-02 Fuji Photo Film Co Ltd Image processor and image processing system
CN102005060A (en) * 2010-12-08 2011-04-06 上海杰图软件技术有限公司 Method and device for automatically removing selected images in pictures
CN102075666A (en) * 2009-11-25 2011-05-25 惠普开发有限公司 Method and device used for removing background colors from image
AU2012203836A1 (en) * 2011-07-05 2013-01-24 Jostens, Inc System and method for yearbook creation
CN103177446A (en) * 2013-03-13 2013-06-26 北京航空航天大学 Image foreground matting method based on neighbourhood and non-neighbourhood smoothness prior
CN103581571A (en) * 2013-11-22 2014-02-12 北京中科大洋科技发展股份有限公司 Video image matting method based on three elements of color
CN105678724A (en) * 2015-12-29 2016-06-15 北京奇艺世纪科技有限公司 Background replacing method and apparatus for images
CN107087123A (en) * 2017-04-26 2017-08-22 杭州奥点科技股份有限公司 It is a kind of that image space method is scratched based on the real-time high-definition that high in the clouds is handled
CN110210532A (en) * 2019-05-15 2019-09-06 北京字节跳动网络技术有限公司 Background colour generation method, device and electronic equipment
CN110703976A (en) * 2019-08-28 2020-01-17 咪咕文化科技有限公司 Clipping method, electronic device, and computer-readable storage medium

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6122441A (en) * 1994-03-31 2000-09-19 Canon Kabushiki Kaisha Image processing apparatus and method
JPH103549A (en) * 1996-06-17 1998-01-06 Hitachi Ltd Device for supporting discrimination of sounding body
US20040041820A1 (en) * 2002-08-30 2004-03-04 Benoit Sevigny Image processing
JP2004248020A (en) * 2003-02-14 2004-09-02 Fuji Photo Film Co Ltd Image processor and image processing system
CN102075666A (en) * 2009-11-25 2011-05-25 惠普开发有限公司 Method and device used for removing background colors from image
CN102005060A (en) * 2010-12-08 2011-04-06 上海杰图软件技术有限公司 Method and device for automatically removing selected images in pictures
AU2012203836A1 (en) * 2011-07-05 2013-01-24 Jostens, Inc System and method for yearbook creation
CN103177446A (en) * 2013-03-13 2013-06-26 北京航空航天大学 Image foreground matting method based on neighbourhood and non-neighbourhood smoothness prior
CN103581571A (en) * 2013-11-22 2014-02-12 北京中科大洋科技发展股份有限公司 Video image matting method based on three elements of color
CN105678724A (en) * 2015-12-29 2016-06-15 北京奇艺世纪科技有限公司 Background replacing method and apparatus for images
CN107087123A (en) * 2017-04-26 2017-08-22 杭州奥点科技股份有限公司 It is a kind of that image space method is scratched based on the real-time high-definition that high in the clouds is handled
CN110210532A (en) * 2019-05-15 2019-09-06 北京字节跳动网络技术有限公司 Background colour generation method, device and electronic equipment
CN110703976A (en) * 2019-08-28 2020-01-17 咪咕文化科技有限公司 Clipping method, electronic device, and computer-readable storage medium

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
李娜等: "基于采样抠图和自适应颜色的图像合成算法", 《液晶与显示》 *
李闻等: "一种融合图像合成的抠图算法", 《计算机应用研究》 *
王春艳等: "Dirac Quasinormal Modes of Reissner-Nodstrom Black Hole Surrounded by Quintessence", 《COMMUNICATIONS IN THEORETICAL PHYSICS》 *
白宇: "对演播室图像质量的新认知――通过各工种合作呈现电视图像的高质量和艺术性", 《现代电视技术》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113763496A (en) * 2021-03-19 2021-12-07 北京沃东天骏信息技术有限公司 Image coloring method, device and computer readable storage medium
CN113763496B (en) * 2021-03-19 2024-04-09 北京沃东天骏信息技术有限公司 Method, apparatus and computer readable storage medium for image coloring
CN113487497A (en) * 2021-06-18 2021-10-08 维沃移动通信有限公司 Image processing method and device and electronic equipment

Also Published As

Publication number Publication date
CN111524076B (en) 2023-07-21

Similar Documents

Publication Publication Date Title
US7057768B2 (en) Automatic color balance
US10565742B1 (en) Image processing method and apparatus
Gao et al. Sand-dust image restoration based on reversing the blue channel prior
US20070262985A1 (en) Image processing device, image processing method, program, storage medium and integrated circuit
JP2003230160A (en) Color picture saturation adjustment apparatus and method therefor
JP2003069846A (en) Image processing program
CN103065334A (en) Color cast detection and correction method and device based on HSV (Hue, Saturation, Value) color space
CN111062993B (en) Color combined painting image processing method, device, equipment and storage medium
CN110392243B (en) Method and apparatus for gamut mapping
CN111524076A (en) Image processing method, electronic device, and computer-readable storage medium
KR20070090224A (en) Method of electronic color image saturation processing
CN111861922A (en) Method and device for adjusting color correction matrix and storage medium
CN111209775B (en) Signal lamp image processing method, device, equipment and storage medium
CN106683063B (en) A kind of method and apparatus of image denoising
JP2000224607A (en) Image processor
CN112788251A (en) Image brightness processing method and device, and image processing method and device
CN111079637B (en) Method, device, equipment and storage medium for segmenting rape flowers in field image
CN105791710B (en) A kind of signal lamp image enhancement processing method
CN110175967B (en) Image defogging processing method, system, computer device and storage medium
CN110751607A (en) Skin color correction method and device, storage medium and electronic device
Tsukada et al. Automatic color preference correction for color reproduction
CN105184758A (en) Defogging and enhancing method for image
JP2008048264A (en) Image processing program, and image processing unit
JPH118768A (en) Image processor, image processing method and medium recording image processing control program
KR101874538B1 (en) Method and Apparatus for Processing Image to Simultaneously Enhance Contrast and Saturation of Image

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant