CN112541868B - Image processing method, device, computer equipment and storage medium - Google Patents

Image processing method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN112541868B
CN112541868B CN202011418526.3A CN202011418526A CN112541868B CN 112541868 B CN112541868 B CN 112541868B CN 202011418526 A CN202011418526 A CN 202011418526A CN 112541868 B CN112541868 B CN 112541868B
Authority
CN
China
Prior art keywords
image
color
saturation
channel
pixel point
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.)
Active
Application number
CN202011418526.3A
Other languages
Chinese (zh)
Other versions
CN112541868A (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.)
Insta360 Innovation Technology Co Ltd
Original Assignee
Insta360 Innovation 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 Insta360 Innovation Technology Co Ltd filed Critical Insta360 Innovation Technology Co Ltd
Priority to CN202011418526.3A priority Critical patent/CN112541868B/en
Publication of CN112541868A publication Critical patent/CN112541868A/en
Priority to PCT/CN2021/136086 priority patent/WO2022121893A1/en
Application granted granted Critical
Publication of CN112541868B publication Critical patent/CN112541868B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/90Dynamic range modification of images or parts thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/50Image enhancement or restoration using two or more images, e.g. averaging or subtraction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • 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/10004Still image; Photographic image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20212Image combination
    • G06T2207/20221Image fusion; Image merging

Landscapes

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

Abstract

The application relates to an image processing method, an image processing device, a computer device and a storage medium. The method comprises the following steps: performing image processing on the image to be processed to obtain a processed image; acquiring color channel values corresponding to all pixel points in the processed image, and counting the color channel values to obtain channel statistic values corresponding to the processed image; acquiring saturation lifting pixel points in the processed image, and calculating to obtain channel color ratio values corresponding to all color channels of the saturation lifting pixel points based on all color channel values and channel statistic values of the saturation lifting pixel points; selecting a minimum value from the channel color ratios as a color inhibition ratio corresponding to each color channel of the saturation lifting pixel point; and performing color suppression processing on each color channel of the saturation lifting pixel point based on the color suppression ratio corresponding to each color channel of the saturation lifting pixel point to obtain a target image. The image processing effect can be improved by adopting the method.

Description

Image processing method, device, computer equipment and storage medium
Technical Field
The present application relates to the field of image processing technologies, and in particular, to an image processing method, an image processing apparatus, a computer device, and a storage medium.
Background
With the development of image processing technology, the requirements of users on image processing effects are also increasing. For example, a requirement for a processing effect of saturation in image processing, the saturation being an important factor for evaluating the image processing effect. Saturation refers to the vividness of a color, also known as the purity of the color, the higher the purity, the more vivid the color; the purity is lower, and the color performance is darker; but when the saturation is too high, the image may be distorted.
For an image or video which is directly output by a camera, if the dynamic range is insufficient and the overall contrast of the image quality is insufficient, the image or video is blurred, if the saturation is insufficient, the overall image quality is dark, and the problems cannot be solved well by the existing image enhancement method, and more or less distortion exists after processing. For example, the classical histogram equalization algorithm can improve the overall contrast of the image, but oversaturation of the image contrast and degradation of the overall image quality can occur; and the corresponding deep learning algorithm (such as DPED) can cause the problems of oversaturation of the whole image quality, solid color overflow and the like.
In summary, there is no image processing method for automatically processing the content of a video or a picture shot by a user to achieve the effect of improving the dynamic range of a picture and improving the saturation of contrast, and the existing image processing method has the problems of poor image processing effect and lower quality of an output image.
Disclosure of Invention
In view of the foregoing, it is desirable to provide an image processing method, apparatus, computer device, and storage medium that can improve the dynamic range of a screen, improve the contrast saturation, and improve the quality of an output image as a whole.
An image processing method, the method comprising:
performing image processing on the image to be processed to obtain a processed image;
Acquiring color channel values corresponding to all pixel points in the processed image, and counting the color channel values to obtain channel statistic values corresponding to the processed image;
acquiring a saturation lifting pixel point in the processed image, and calculating a channel color ratio corresponding to each color channel of the saturation lifting pixel point based on each color channel value of the saturation lifting pixel point and the channel statistical value;
Selecting a minimum value from channel color ratios corresponding to all color channels of the saturation lifting pixel point as a color inhibition ratio corresponding to all color channels of the saturation lifting pixel point;
and performing color suppression processing on each color channel of the saturation lifting pixel point based on the color suppression ratio corresponding to each color channel of the saturation lifting pixel point to obtain a target image.
In one embodiment, the acquiring the saturation lifting pixel point in the processed image includes:
acquiring a gray image corresponding to the image to be processed;
Determining a pixel lifting ratio of each pixel point in the processed image relative to the gray image according to the pixel value of each pixel point in the processed image and the pixel value of the pixel point at the corresponding position in the gray image;
and taking the pixel point with the pixel lifting ratio larger than a preset threshold value in the processed image as a saturation lifting pixel point.
In one embodiment, the calculating, based on the channel statistics and the color channel values of the saturation improving pixel point, a channel color ratio corresponding to each color channel of the saturation improving pixel point includes:
Calculating the variation value of each color channel value of the saturation lifting pixel point relative to the channel statistical value;
Determining the adjusting weights corresponding to the color channel values of the saturation lifting pixel points according to the change values, wherein the color channel value adjusting weights and the change values form a negative correlation;
And calculating to obtain channel color ratios corresponding to all color channels of the saturation lifting pixel point according to the adjusting weights corresponding to all color channel values of the saturation lifting pixel point.
In one embodiment, the calculating, according to the adjustment weights corresponding to the color channel values of the saturation improving pixel point, the channel color ratio corresponding to each color channel of the saturation improving pixel point includes:
Calculating to obtain a first ratio according to the product of the adjustment weights corresponding to the color channel values of the saturation lifting pixel points and the pixel lifting ratio of the saturation lifting pixel points;
subtracting the adjusting weights corresponding to the color channel values of the saturation lifting pixel points from a preset value to obtain a second ratio;
And adding the first ratio and the second ratio to obtain channel color ratios corresponding to all color channels of the saturation lifting pixel point.
In one embodiment, the method further comprises: acquiring pixel points with pixel values larger than a preset threshold value in the gray level image as highlight pixel points;
Multiplying the pixel lifting ratio corresponding to the highlight pixel point with a first coefficient to obtain a third ratio; the first coefficient and the pixel value of the pixel point at the corresponding position of the highlight pixel point in the processed image form a negative correlation;
subtracting the first coefficient from a preset value to obtain a fourth ratio;
And adding the third ratio and the fourth ratio to obtain channel color ratios corresponding to all color channels of the highlight pixel point.
In one embodiment, the performing image processing on the image to be processed to obtain a processed image includes:
performing image processing on the image to be processed to obtain an intermediate image;
Acquiring a first pixel point, of which the pixel value is smaller than a preset threshold value, in a gray image corresponding to the image to be processed, and taking the pixel point corresponding to the first pixel point in the intermediate image as a second pixel point;
Obtaining a noise suppression weight of the corresponding second pixel point according to the pixel value of the first pixel point in the gray image, wherein the pixel value and the noise suppression weight form a correlation;
and performing noise suppression on a second pixel point in the intermediate image according to the noise suppression weight to obtain a processed image.
In one embodiment, the performing image processing on the image to be processed to obtain a processed image includes:
acquiring a gray image corresponding to an image to be processed;
carrying out brightening treatment on the gray level image to obtain a brightening image;
Performing contrast enhancement processing on the gray level image to obtain a contrast enhancement image;
and carrying out fusion processing on the gray level image, the brightening image and the contrast enhancement image to obtain a processed image.
An image processing apparatus, the apparatus comprising:
The processing image acquisition module is used for carrying out image processing on the image to be processed to obtain a processed image;
The channel statistical value acquisition module is used for acquiring color channel values corresponding to all pixel points in the processed image, and carrying out statistics on the color channel values to obtain channel statistical values corresponding to the processed image;
The channel color ratio acquisition module is used for acquiring saturation lifting pixel points in the processed image, and calculating to obtain channel color ratios corresponding to all color channels of the saturation lifting pixel points based on all color channel values and the channel statistic values of the saturation lifting pixel points;
the color inhibition ratio acquisition module is used for selecting the minimum value from the channel color ratios corresponding to the color channels of the saturation lifting pixel point to be used as the color inhibition ratio corresponding to the color channels of the saturation lifting pixel point;
And the target image acquisition module is used for carrying out color inhibition processing on each color channel of the saturation lifting pixel point based on the color inhibition ratio corresponding to each color channel of the saturation lifting pixel point to obtain a target image.
A computer device comprising a memory storing a computer program and a processor which when executing the computer program performs the steps of:
performing image processing on the image to be processed to obtain a processed image;
Acquiring color channel values corresponding to all pixel points in the processed image, and counting the color channel values to obtain channel statistic values corresponding to the processed image;
Acquiring a saturation lifting pixel point in the processed image, and calculating a channel color ratio corresponding to each color channel of the saturation lifting pixel point based on each color channel value and the channel statistic value of the saturation lifting pixel point;
Selecting a minimum value from channel color ratios corresponding to all color channels of the saturation lifting pixel point as a color inhibition ratio corresponding to all color channels of the saturation lifting pixel point;
And performing color suppression processing on each color channel of the saturation lifting pixel point based on the color suppression ratio corresponding to each color channel of the saturation lifting pixel point to obtain a target image.
A computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of:
performing image processing on the image to be processed to obtain a processed image;
Acquiring color channel values corresponding to all pixel points in the processed image, and counting the color channel values to obtain channel statistic values corresponding to the processed image;
Acquiring a saturation lifting pixel point in the processed image, and calculating a channel color ratio corresponding to each color channel of the saturation lifting pixel point based on each color channel value and the channel statistic value of the saturation lifting pixel point;
Selecting a minimum value from channel color ratios corresponding to all color channels of the saturation lifting pixel point as a color inhibition ratio corresponding to all color channels of the saturation lifting pixel point;
And performing color suppression processing on each color channel of the saturation lifting pixel point based on the color suppression ratio corresponding to each color channel of the saturation lifting pixel point to obtain a target image.
The image processing method, the device, the computer equipment and the storage medium are used for obtaining a processed image after image processing is carried out on the image to be processed, obtaining color channel values corresponding to all pixel points in the processed image, and obtaining channel statistical values corresponding to the processed image by carrying out statistics on the color channel values; and then, obtaining the saturation lifting pixel points in the processed image, calculating a channel color ratio corresponding to the color channel based on each color channel value and channel statistical value of the saturation lifting pixel points, and selecting the minimum value from the channel color ratio as a color inhibition ratio corresponding to the saturation lifting pixel points, so that the color inhibition processing can be performed on the pixel points with high saturation, and the image processing effect is improved.
Drawings
FIG. 1 is a diagram of an application environment for an image processing method in one embodiment;
FIG. 2 is a flow chart of an image processing method;
FIG. 3 is a flow chart of a method for obtaining saturation lifting pixels in a processed image according to one embodiment;
FIG. 4 is a flowchart of a method for obtaining saturation lifting pixels in a processed image according to another embodiment;
FIG. 5 is a flowchart of a method for obtaining saturation lifting pixels in a processed image according to another embodiment;
FIG. 6 is a flow chart of an image processing method according to another embodiment;
FIG. 7 is a flow chart of a method for processing an image to obtain a processed image according to an embodiment;
FIG. 8 is a flow chart of a method for processing an image to obtain a processed image according to another embodiment;
FIG. 9 is a block diagram showing the structure of an image processing apparatus in one embodiment;
fig. 10 is an internal structural view of a computer device in one embodiment.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
The image processing method provided by the application can be applied to an application environment shown in fig. 1. The application environment comprises an image acquisition device 102 and a terminal 104, wherein the image acquisition device 102 is in communication connection with the terminal 104. After the image acquisition device 102 acquires the image to be processed, the image is transmitted to the terminal 104, the terminal 104 acquires the image to be processed, the terminal 104 can count the color channel values corresponding to each pixel point of the acquired image to be processed, and a channel statistic value corresponding to the processed image is obtained; obtaining saturation lifting pixel points in the processed image, and calculating a channel color ratio corresponding to a color channel based on each color channel value and channel statistic value of the saturation lifting pixel points; selecting a minimum value from channel color ratios corresponding to all color channels corresponding to the saturation lifting pixel points as a color inhibition ratio corresponding to the saturation lifting pixel points; and performing color suppression processing on the saturation lifting pixel points based on the color suppression ratio corresponding to the saturation lifting pixel points to obtain a target image. The image capturing device 102 may be, but not limited to, various devices with image capturing functions, and may be distributed outside the terminal 104 or may be distributed inside the terminal 104. For example: various cameras, scanners, various cameras, image acquisition cards distributed outside the terminal 104. The terminal 104 may be, but is not limited to, various cameras, personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices.
It will be appreciated that the method provided by the embodiment of the present application may also be performed by a server.
In one embodiment, as shown in fig. 2, an image processing method is provided, and the method is applied to the terminal in fig. 1 for illustration, and includes the following steps:
step 202, performing image processing on the image to be processed to obtain a processed image.
Wherein, the processed image refers to the image after image processing.
Specifically, the terminal may use an image acquired in real time as the image to be processed, and the display effect of the image to be processed is not ideal, so that the image to be processed needs to be subjected to image processing to obtain a processed image.
In one embodiment, the terminal may also obtain the processed image by acquiring the image to be processed from the memory storing the image, and performing image processing on the image to be processed.
In one embodiment, the gray-scale image may be obtained by performing gray-scale processing on the image to be processed, and the gray-scale image may be subjected to brightening processing to obtain a brightening image, and the contrast enhancement processing may be performed on the gray-scale image to obtain a contrast enhancement image, and the gray-scale image, the brightening image and the contrast enhancement image may be fused to obtain an intermediate processing image, and the intermediate processing image obtained at this time may be used as the processing image.
Further, in an embodiment, an intermediate processing image obtained by fusion processing of the grayscale image, the brightening image, and the contrast enhancement image in the above embodiment is selected, and noise suppression processing may be further performed, with the obtained processing image as the processing image.
Further, in the above embodiment, the noise suppression processing is performed on the intermediate processed image (i.e., the intermediate image), which may specifically be:
Acquiring a first pixel point of which the pixel value is smaller than a preset threshold value in a gray image corresponding to an image to be processed, and taking the pixel point corresponding to the first pixel point in an intermediate image as a second pixel point;
Obtaining a noise suppression weight of a corresponding second pixel point according to the pixel value of the first pixel point in the gray image, wherein the pixel value and the noise suppression weight form a correlation;
And carrying out noise suppression on the second pixel point in the intermediate image according to the noise suppression weight to obtain a processed image.
Step 204, obtaining color channel values corresponding to each pixel point in the processed image, and counting the color channel values to obtain channel statistic values corresponding to the processed image.
The color channel value refers to a value of each channel after dividing each pixel point into three channels of R (red), G (green) and B (blue). The value of each channel may be represented using the corresponding pixel value of each channel. For example, at a pixel point, the color channel values for the RGB three channels are 199, 237, and 204, respectively. The channel statistics value refers to a color channel value capable of reflecting the overall data characteristics of the color channel value. The channel statistics may refer to an average of three color channel values, or may be median, etc.
Specifically, the terminal can detect color channel values corresponding to each pixel point by acquiring a processing image and using self-contained pixel point analysis software or analysis tools, and obtain channel statistical values corresponding to the processing image through calculation.
Step 206, obtaining saturation lifting pixel points in the processed image, and calculating to obtain channel color ratio values corresponding to all color channels of the saturation lifting pixel points based on all color channel values and channel statistic values of the saturation lifting pixel points.
The saturation lifting pixel point refers to a pixel point of which the saturation of the pixel point of the processed image is raised relative to the saturation of the original pixel point in the image to be processed. The channel color ratio refers to the respective duty ratio of the RGB three channel colors in each pixel point to each pixel point.
Specifically, after obtaining the color channel value corresponding to each pixel point, obtaining the channel statistical value corresponding to the processed image through calculation, obtaining the saturation lifting pixel point in the processed image, and obtaining the channel color ratio based on the saturation lifting pixel point in the processed image.
In one embodiment, a certain channel color saturation of an image is positively correlated with the absolute value of the difference in the corresponding channel statistics. The greater the absolute value of the difference between the color channel value and the processed image, the higher the color saturation of a certain channel of the image. For example, the greater the absolute value of the difference between the color channel value of the red color represented by R in the RGB three channels and the processed image, the higher the red saturation of the R channel, which appears as the redder in the image.
And step 208, selecting the minimum value from the channel color ratios corresponding to the color channels of the saturation lifting pixel point as the color inhibition ratio corresponding to the color channels of the saturation lifting pixel point.
The color suppression ratio is a ratio used for suppressing excessive color saturation, and the image processing effect can be improved by establishing a functional relation with the corresponding channel color through the ratio.
Specifically, because the channel color ratio is a value greater than 1, the closer the value is to 1, the higher the saturation of the image, so that the minimum value selected in the channel color ratio is the value closest to 1, the value is taken as the color suppression ratio, and the color suppression processing is performed on the saturation lifting pixel point based on the color suppression ratio, so as to obtain the target image.
Step 210, performing color suppression processing on each color channel of the saturation lifting pixel point based on the color suppression ratio corresponding to each color channel of the saturation lifting pixel point, so as to obtain a target image.
In one embodiment, after the color suppression ratio is obtained, a functional relationship is established between the pixel value of the saturation-increasing pixel point and the color suppression ratio, so that the pixel value of the pixel point obtained after the functional relationship is established is obtained, the effect of color suppression processing is achieved, and the target image is obtained.
In one embodiment, the saturation boost pixel point and the color suppression ratio may be functionally related by taking the color suppression ratio as a coefficient, and multiplying the pixel value of the saturation boost pixel point by the color suppression ratio to obtain the pixel point subjected to the suppression processing, thereby obtaining the target image.
In the image processing method, after the image to be processed is subjected to image processing, a processed image is obtained, color channel values corresponding to all pixel points in the processed image are obtained, and channel statistical values corresponding to the processed image are obtained through statistics of the color channel values; and then, obtaining the saturation lifting pixel points in the processed image, calculating a channel color ratio corresponding to the color channel based on each color channel value and channel statistical value of the saturation lifting pixel points, and selecting the minimum value from the channel color ratio as a color inhibition ratio corresponding to the saturation lifting pixel points, so that the color inhibition processing can be performed on the pixel points with high saturation, and the image processing effect is improved.
In one embodiment, as shown in fig. 3, the step of obtaining saturation lifting pixels in the processed image includes:
Step 302, a gray image corresponding to the image to be processed is obtained.
The grayscale image is an image in which the image is classified into several levels from black to white. The gray level image can make the transition of the image smoother and finer.
In one embodiment, the image to be processed may be converted accordingly, resulting in a converted gray scale image. The gray level image corresponding to the image to be processed can be obtained by performing corresponding mathematical operation on the image to be processed. For example, the Gray image is denoted as Gray, the channel color values of the three channels of the image pixel to be processed are denoted as R, G and B, respectively, and the floating point algorithm may be used: gray=r 0.3+g 0.59+b 0.11, and a Gray image is calculated.
Step 304, determining the pixel lifting ratio of each pixel point in the processed image relative to the gray image according to the pixel value of each pixel point in the processed image and the pixel value of the pixel point at the corresponding position in the gray image.
The pixel lifting ratio refers to the enhancement degree of the pixel value of each pixel point in the processed image relative to the pixel value of the pixel point at the corresponding position in the gray image.
Specifically, the pixel value of the pixel point is a numerical value, the numerical value and the saturation are in positive correlation, and the pixel lifting ratio of the processed image relative to the gray image can be determined through the numerical value.
In one embodiment, the pixel lifting ratio of the processed image to the gray image may be represented by a multiple relationship between the pixel values of each pixel in the processed image and the pixel values of the corresponding pixel in the gray image. For example, assuming that the pixel value of each pixel of the processed image is denoted as I, the pixel value of the pixel at the corresponding position in the gray image is denoted as I1, and the pixel lifting ratio of the processed image relative to the gray image is denoted as ratio src, the relationship between the three can be expressed as:
ratiosrc=(I+1)/(I1+1)
And 306, taking the pixel point with the pixel lifting ratio larger than the preset threshold value in the processed image as a saturation lifting pixel point.
The preset threshold value is a set critical value, and when the preset threshold value is larger than the critical value, the pixel points meeting the condition are taken as saturation lifting pixel points; when the saturation is smaller than the threshold value, the pixel point meeting the condition is not required to be used as the saturation lifting pixel point.
Specifically, after the pixel lifting ratio is obtained, the pixel points needing saturation lifting can be screened out in a preset threshold mode, and the saturation of the screened part of pixels is adjusted.
In one embodiment, the preset threshold may be set to a fixed value, and when the preset threshold is greater than the fixed value, the pixel points meeting the condition are screened out as the pixel points to be saturated; it can be appreciated that when smaller than this fixed value, the pixel satisfying the condition is not the pixel that promotes saturation. For example, if the fixed value is 1, the pixel lifting ratio is ratio src, and if ratio src is greater than 1, the corresponding pixel points in the processed image meeting the condition are screened out for saturation lifting processing; when ratio src is smaller than 1, the pixel points in the processed image satisfying the condition are not subjected to saturation lifting processing.
In this embodiment, the pixel lifting ratio of the processed image relative to the gray image is determined by determining the processed image, a preset threshold is set for the pixel lifting ratio, and the saturation lifting pixel point is screened out by the preset threshold, so that the purpose of accurately determining the saturation lifting pixel point can be achieved.
In one embodiment, as shown in fig. 4, the step of calculating, based on the channel statistics and the color channel values of the saturation improving pixel point, the channel color ratio corresponding to each color channel of the saturation improving pixel point includes:
In step 402, a variation value of each color channel value of the saturation boost pixel point relative to the channel statistics is calculated.
In one embodiment, the change value of the color channel value of each saturation lifting pixel point relative to the channel statistics may be a difference value of the color channel value of each saturation lifting pixel point relative to the channel statistics. For example, assuming that the color channel value of any saturation-elevating pixel point is c, the channel statistics value is avg, and the variation value of the color channel value of the corresponding saturation-elevating pixel point with respect to the channel statistics value is d, d is expressed as: d=c-avg
And step 404, determining the adjusting weights corresponding to the color channel values of the saturation lifting pixel points according to the change values, wherein the color channel value adjusting weights and the change values form a negative correlation.
The adjustment weight refers to the importance level of adjustment required by each color channel value of each saturation lifting pixel point. The method has a negative correlation with the change value, and the larger the change value is, the smaller the adjustment weight is, and the smaller the change value is, the larger the adjustment weight is.
In one embodiment, the adjustment weights may be represented by a functional relationship between the change values and the adjustment weights. For example, if any channel-adjustment weight is denoted as w (c, avg), then the functional relationship between the change value d and the color-channel-value adjustment weight w (c, avg) may be expressed as:
step 406, calculating to obtain the channel color ratio corresponding to each color channel of the saturation lifting pixel according to the adjustment weights corresponding to each color channel value of the saturation lifting pixel.
Specifically, the channel color ratio c corresponding to the color channel of each saturation lifting pixel point can be calculated by the adjusting weight w (c, avg) corresponding to the saturation lifting pixel point and the pixel lifting ratio src.
In one embodiment, the positive correlation exists between the adjustment weights corresponding to the color channel values of the saturation lifting pixel point and the channel color ratios corresponding to the color channels of the saturation lifting pixel point, and the greater the adjustment weights corresponding to the color channel values of the saturation lifting pixel point, the higher the channel color ratios corresponding to the color channels of the saturation lifting pixel point. For example, the channel color ratio c corresponding to each color channel of the saturation-increasing pixel point may be expressed as:
ratioc=ratiosrc*w(c,avg)+(1-w(c,avg))*1
In this embodiment, the adjustment weights corresponding to the color channel values of the saturation lifting pixel points are obtained through the change values of the color channel values of the saturation lifting pixel points relative to the channel statistics values, and the purpose of obtaining the channel color ratio can be achieved through the adjustment weights.
In one embodiment, as shown in fig. 5, the step of calculating, according to the adjustment weights corresponding to the color channel values of the saturation improving pixel point, the channel color ratio corresponding to each color channel of the saturation improving pixel point includes:
Step 502, calculating a first ratio according to the product of the adjustment weights corresponding to the color channel values of the saturation lifting pixel points and the pixel lifting ratio of the saturation lifting pixel points.
Specifically, the first ratio is represented as ratio c1, which can be calculated by the following formula:
ratioc1=ratiosrc*w(c,avg)
And step 504, subtracting the adjustment weights corresponding to the color channel values of the saturation lifting pixel points from the preset value to obtain a second ratio.
Specifically, the second ratio is denoted as ratio c2, and the preset value is e, and ratio c2 may be denoted as:
ratioc2=e-w(c,avg)
In one embodiment, the preset value e may be 1, and the second ratio c2 may be expressed as:
ratioc2=1-w(c,avg)
And step 506, adding the first ratio and the second ratio to obtain channel color ratios corresponding to the color channels of the saturation lifting pixel point.
Specifically, the channel color ratio is denoted as ratio c, the first ratio is denoted as ratio c1, the second ratio is denoted as ratio c2, and the channel color ratio c may be denoted as:
ratioc=ratioc1+ratioc2
In this embodiment, a first ratio is obtained by multiplying an adjustment weight corresponding to each color channel value of the saturation lifting pixel point by a pixel lifting ratio of the saturation lifting pixel point, a second ratio is obtained by subtracting the adjustment weight corresponding to the saturation lifting pixel point from a preset value, and the purpose of obtaining a channel color ratio corresponding to the color channel can be achieved by the first ratio and the second ratio, so that a minimum value in the channel color ratio is selected as a color suppression ratio, and color suppression processing is performed on an image by the color suppression ratio to obtain a target image.
In one embodiment, as shown in fig. 6, the step image processing method further includes:
Step 602, obtaining a pixel point with a pixel value greater than a preset threshold value in the gray image as a highlight pixel point.
The highlight pixel points refer to pixel points with higher pixel values.
Specifically, a pixel point with a pixel value larger than a preset threshold value is used as a highlight pixel point by setting the preset threshold value for the pixel value; and (3) not listing the pixel points with the pixel values smaller than or equal to the preset threshold value in the range of the highlight pixel points. It can be appreciated that the highlight pixels have an effect on the quality of the image, the more highlight pixels that are present in the image, the poorer the quality of the image.
Step 604, multiplying the pixel lifting ratio corresponding to the highlight pixel point by the first coefficient to obtain a third ratio;
Specifically, the pixel lifting ratio corresponding to the highlight pixel point is denoted as ratio src, the first coefficient is denoted as f, the third ratio is denoted as ratio c3, and the third ratio is denoted as ratio c3 may be expressed as:
ratioc3=ratiosrc*f
the first coefficient f is in negative correlation with the pixel value I of the pixel point at the corresponding position of the highlight pixel point in the processed image. The first coefficient f may be expressed as:
alpha = 255-preset threshold
In one embodiment, the preset threshold may be 230, and a pixel with a pixel value greater than 230 in the gray scale image is used as the highlight pixel. The first coefficient f can be obtained by a preset threshold.
Step 606, subtracting the first coefficient from the preset value to obtain a fourth ratio.
Specifically, the preset value is identified as g, the fourth ratio is represented as ratio c4, and the fourth ratio c4 is represented as:
ratioc4=g-f
In one embodiment, if the preset value is 1, the fourth ratio c4 is expressed as:
ratioc4=1-f
and 608, adding the third ratio to the fourth ratio to obtain the channel color ratio corresponding to each color channel of the highlight pixel.
Specifically, the channel color ratio corresponding to the color channel of the highlight pixel is represented as ratio c', and ratio c' is represented as:
ratioc'=ratioc3+ratioc4
In one embodiment, the three channels are multiplied by the ratio c', respectively, so as to obtain the channel color ratio corresponding to the color channel of the highlight pixel.
In one embodiment, the three channels are multiplied by the ratio, and if the maximum value in the obtained results is greater than 255, the pixel value on the channel is set to 255, and the ratio of 255 to the maximum value is calculated, and the results of the other two channels are multiplied by the ratio to obtain the channel color ratio corresponding to the color channel of the highlight pixel point.
In this embodiment, the purpose of obtaining the channel color ratio corresponding to the color channel of the highlight pixel point can be achieved by setting a preset threshold value to screen the highlight pixel point and by a functional relationship between the pixel lifting ratio corresponding to the highlight pixel point and the corresponding coefficient.
In one embodiment, as shown in fig. 7, the step of performing image processing on an image to be processed to obtain a processed image includes:
step 702, performing image processing on an image to be processed to obtain an intermediate image.
The intermediate image refers to an image before the image to be processed is processed, but the processing image required by the user is not obtained yet.
Specifically, the intermediate image may be a fused image, where the fused image is an image obtained by fusing an image to be processed.
Step 704, obtaining a first pixel point, of which the pixel value is smaller than a preset threshold value, in the gray image corresponding to the image to be processed, and taking the pixel point corresponding to the first pixel point in the intermediate image as a second pixel point.
Specifically, the terminal may acquire a pixel value in a gray image corresponding to the image to be processed through a pixel value acquiring tool, and compare the acquired pixel value with a preset threshold stored in the terminal to acquire a first pixel point smaller than the preset threshold, and take a pixel point corresponding to the first pixel point in the intermediate image as a second pixel point.
In one embodiment, the preset threshold of the pixel point may be 64, and the terminal acquires a pixel point with a pixel value smaller than 64 in the gray image as the first pixel point, and acquires a second pixel point in the intermediate image corresponding to the first pixel point.
Step 706, obtaining the noise suppression weight of the corresponding second pixel point according to the pixel value of the first pixel point in the gray image, wherein the pixel value and the noise suppression weight are in a correlation relationship.
Specifically, the noise suppression weight of the second pixel point may be represented as w, the pixel value of the first pixel point in the gray image may be represented as I 1, and β is a preset threshold, where the noise suppression weight w of the second pixel point may be represented as:
w=(I1/β)2*2+1.0-(I1/β)2,I1
In one embodiment, the preset threshold β is 64, and the pixel value smaller than 64 may be regarded as a dark area image, and the noise suppression weight w of the second pixel is obtained through selecting the preset threshold.
Step 708, noise suppression is performed on the second pixel point in the intermediate image according to the noise suppression weight, so as to obtain a processed image.
Specifically, after the noise suppression weight is calculated, the gray level image is adjusted by the noise suppression weight, and a processed image is obtained. It will be appreciated that the processed image may be taken as an intermediate image prior to acquisition of the target image.
In one embodiment, the intermediate image may be processed by noise suppression weights, controlling the intermediate image to be within twice the pixel value range of the image to be processed. For example, the intermediate image is denoted as I enhance, the process image is denoted as I, and I may be denoted as:
In this embodiment, by acquiring the intermediate image and acquiring the first pixel point within the preset threshold value in the gray image and the corresponding second pixel point and noise suppression weight in the intermediate image, the pixel value of the processed image can be controlled within twice the pixel value of the image to be processed, so that the image with the pixel value smaller than the preset threshold value can improve the brightness, the details are more prominent, and the color fault caused by the overlarge difference of the pixel values is prevented.
In one embodiment, as shown in fig. 8, the step of performing image processing on an image to be processed to obtain a processed image includes:
Step 802, acquiring a gray image corresponding to the image to be processed.
In one embodiment, after the terminal acquires the image to be processed, the image to be processed is converted into a gray scale image, and the conversion method includes a component method, a maximum value method, a weighted average value method, or the like.
In one embodiment, the image to be processed can be converted into a gray image by using a weighted average method, and the three channel color pixel values of RGB in the image to be processed are weighted-averaged according to different weights to obtain the gray image. For example, the pixel value of the gray image is denoted as I 1 (I, j), and the pixel values of the RGB three channel colors in the image to be processed are R (I, j), G (I, j), and B (I, j), respectively, and the pixel value I 1 (I, j) of the gray image may be denoted as:
I1(i,j)=0.299R(i,j)+0.578G(i,j)+0.114B(i,j)
step 804, performing brightening processing on the gray scale image to obtain a brightening image.
Specifically, a brightening image corresponding to a gray image can be obtained through a functional relationship between a gray image pixel value and a brightening image pixel value. For example, the highlighted image is denoted as I 2, the gray image is denoted as I 1, a and b are denoted as arguments, and then the following functional relationship exists between the two:
in one embodiment, the argument a may take a value of 2, the argument b may take a value of 20, and the luminance image with more details can be obtained after performing luminance processing on the gray image through the above functional relationship by selecting the argument.
Step 806, performing contrast enhancement processing on the gray level image to obtain a contrast enhanced image.
Specifically, a low-pass filter map I guide can be obtained by guiding filtering through the gray-scale image, and a contrast-enhanced intermediate image v 1 can be obtained through the low-pass filter map I guide:
v1=(Iguide-127.5)*c+127.5
the guided filtering is a low-pass filter.
In one embodiment, the argument c may be chosen to be 1.2, enabling the contrast enhanced intermediate image v 1 to retain more image detail.
In one embodiment, the difference value between the gray-scale image and the intermediate image is calculated so as to obtain more image details, and the detail enhancement coefficient k detail is set, so that an enhanced and detail-highlighted intermediate processing image v 2 can be obtained, which is expressed by using a formula:
v2=v1+(I1-v1)*kdetail
In one embodiment, in order to obtain a high-quality gray-scale image, the detail enhancement coefficient k detail may be set to 4, and on the basis of the detail enhancement coefficient, the processed image details are more prominent, so that the image processing effect is improved.
In one embodiment, a preset upper and lower limit is set for the intermediate processed image v 2, the upper limit being denoted val max, the lower limit being denoted val min, expressed as:
valmax=I1*kdetail
valmin=I1*kdetail-(kdetail-1)
Obtaining a contrast enhancement image I3:
And 808, performing fusion processing on the gray level image, the brightening image and the contrast enhancement image to obtain a processed image.
In one embodiment, the gray scale image, the brightening image, and the contrast enhancement image may be weighted fused to obtain a processed image. Representing the gray scale image as I 1, the weight map corresponding to the brightening image as I 2 and the contrast enhancement image as I 3,I1、I2 and I 3 can be represented using the following formula:
in one embodiment, the corresponding weight maps for the grayscale image I 1, the brightening image I 2 and the contrast enhancement image I 3 are set to w 1、w2 and w 3 respectively,
By parameters in w 1、w2 and w 3 And setting the parameter delta, so that the value of each pixel point in the weight graphs corresponding to I 1、I2 and I 3 is closer to the pixel mean value of each image.
And carrying out normalization processing on the same positions of the three weight graphs, and converting the weights into decimal numbers between 0 and 1. Specifically, three weights corresponding to the positions are added up, and each weight is changed into a current weight value divided by the weight sum; for example, weights w 1、w2 and w 3 are { 3.5.2.5 }, then the normalization is followed by conversion to { 0.350.25.0.4 }. And setting the converted weight as a new weight at a corresponding position to form a weight graph. And carrying out multi-scale fusion or multi-resolution fusion on the weight map, the gray level image, the brightening image and the contrast enhancement image to obtain a processed image. It will be appreciated that the processed image at this time may be a fused image as an intermediate image.
In this embodiment, the image is respectively converted into the gray-scale image, the brightening image and the contrast enhancement image, and the fusion processing is performed, and the images are weighted and fused, so that the purpose of obtaining the fused image can be achieved.
In one embodiment, the fused image obtained in the above embodiment may be used as the processing image in step 202, and after the noise suppression processing in steps 702-708 in fig. 7, the fused image may also be used as the processing image in step 202.
It should be understood that, although the steps in the flowcharts of fig. 1-8 are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in FIGS. 1-8 may include multiple steps or stages that are not necessarily performed at the same time, but may be performed at different times, nor do the order in which the steps or stages are performed necessarily performed in sequence, but may be performed alternately or alternately with at least a portion of the steps or stages in other steps or other steps.
In one embodiment, as shown in fig. 9, there is provided an image processing apparatus 900 including: a process image acquisition module 902, a channel statistics acquisition module 904, a channel color ratio acquisition module 906, a color suppression ratio acquisition module 908, and a target image acquisition module 910, wherein:
A processing image obtaining module 902, configured to perform image processing on an image to be processed to obtain a processed image;
the channel statistics value obtaining module 904 is configured to obtain color channel values corresponding to each pixel point in the processed image, and perform statistics on the color channel values to obtain channel statistics corresponding to the processed image;
The channel color ratio obtaining module 906 is configured to obtain a saturation lifting pixel point in the processed image, and calculate based on each color channel value and channel statistics value of the saturation lifting pixel point, to obtain a channel color ratio corresponding to each color channel of the saturation lifting pixel point;
the color suppression ratio obtaining module 908 is configured to select a minimum value from channel color ratios corresponding to each color channel of the saturation lifting pixel point, as a color suppression ratio corresponding to each color channel of the saturation lifting pixel point;
The target image obtaining module 910 is configured to perform color suppression processing on each color channel of the saturation lifting pixel point based on the color suppression ratio corresponding to each color channel of the saturation lifting pixel point, so as to obtain a target image.
In one embodiment, the channel color ratio obtaining module 906 is further configured to obtain a gray image corresponding to the image to be processed;
determining a pixel lifting ratio of each pixel point in the processed image relative to the gray image according to the pixel value of each pixel point in the processed image and the pixel value of the pixel point at the corresponding position in the gray image;
And taking the pixel point with the pixel lifting ratio larger than a preset threshold value in the processed image as a saturation lifting pixel point.
In one embodiment, the channel color ratio obtaining module 906 is further configured to calculate a variation value of each color channel value of the saturation boost pixel point relative to the channel statistics;
Determining the adjusting weights corresponding to the color channel values of the saturation lifting pixel points according to the change values, wherein the color channel value adjusting weights and the change values form a negative correlation;
According to the adjustment weights corresponding to the color channel values of the saturation lifting pixel points, calculating to obtain the channel color ratio values corresponding to the color channels of the saturation lifting pixel points
In one embodiment, the channel color ratio obtaining module 906 is further configured to calculate a first ratio according to a product of the adjustment weights corresponding to the color channel values of the saturation boost pixel points and the pixel boost ratio of the saturation boost pixel points;
subtracting the adjusting weights corresponding to the color channel values of the saturation lifting pixel points from the preset value to obtain a second ratio;
and adding the first ratio and the second ratio to obtain channel color ratios corresponding to the color channels of the saturation lifting pixel point.
In one embodiment, the image processing apparatus further includes: the device comprises a highlight pixel point acquisition module, a third ratio acquisition module, a fourth ratio acquisition module and a channel color ratio acquisition module, wherein:
the highlight pixel point acquisition module is used for acquiring pixel points with pixel values larger than a preset threshold value in the gray level image as highlight pixel points;
The third ratio obtaining module is used for multiplying the pixel lifting ratio corresponding to the highlight pixel point by the first coefficient to obtain a third ratio; the first coefficient and the pixel value of the pixel point at the corresponding position of the highlight pixel point in the processed image form a negative correlation;
The fourth ratio obtaining module is used for subtracting the first coefficient from the preset value to obtain a fourth ratio;
And the channel color ratio obtaining module is used for adding the third ratio and the fourth ratio to obtain the channel color ratio corresponding to each color channel of the highlight pixel point.
In one embodiment, the processing image acquisition module is further to:
performing image processing on the image to be processed to obtain an intermediate image;
Acquiring a first pixel point of which the pixel value is smaller than a preset threshold value in a gray image corresponding to an image to be processed, and taking the pixel point corresponding to the first pixel point in an intermediate image as a second pixel point;
Obtaining a noise suppression weight of a corresponding second pixel point according to the pixel value of the first pixel point in the gray image, wherein the pixel value and the noise suppression weight form a correlation;
And carrying out noise suppression on the second pixel point in the intermediate image according to the noise suppression weight to obtain a processed image.
In one embodiment, the processing image acquisition module is further to:
acquiring a gray image corresponding to an image to be processed;
Carrying out brightening treatment on the gray level image to obtain a brightening image;
carrying out contrast enhancement processing on the gray level image to obtain a contrast enhancement image;
and carrying out fusion processing on the gray level image, the brightening image and the contrast enhancement image to obtain a processed image.
For specific limitations of the image processing apparatus, reference may be made to the above limitations of the image processing method, and no further description is given here. The respective modules in the above-described image processing apparatus may be implemented in whole or in part by software, hardware, and combinations thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a terminal, and an internal structure diagram thereof may be as shown in fig. 10. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless mode can be realized through WIFI, an operator network, NFC (near field communication) or other technologies. The computer program is executed by a processor to implement an image processing method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, can also be keys, a track ball or a touch pad arranged on the shell of the computer equipment, and can also be an external keyboard, a touch pad or a mouse and the like.
It will be appreciated by those skilled in the art that the structure shown in FIG. 10 is merely a block diagram of some of the structures associated with the present inventive arrangements and is not limiting of the computer device to which the present inventive arrangements may be applied, and that a particular computer device may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
In one embodiment, a computer device is provided comprising a memory and a processor, the memory having stored therein a computer program, the processor when executing the computer program performing the steps of:
performing image processing on the image to be processed to obtain a processed image;
Acquiring color channel values corresponding to all pixel points in the processed image, and counting the color channel values to obtain channel statistic values corresponding to the processed image;
acquiring saturation lifting pixel points in the processed image, and calculating to obtain channel color ratio values corresponding to all color channels of the saturation lifting pixel points based on all color channel values and channel statistic values of the saturation lifting pixel points;
selecting a minimum value from channel color ratios corresponding to all color channels of the saturation lifting pixel point, and taking the minimum value as a color inhibition ratio corresponding to all color channels of the saturation lifting pixel point;
And performing color suppression processing on each color channel of the saturation lifting pixel point based on the color suppression ratio corresponding to each color channel of the saturation lifting pixel point to obtain a target image.
In one embodiment, the processor when executing the computer program further performs the steps of:
acquiring a gray image corresponding to an image to be processed;
determining a pixel lifting ratio of each pixel point in the processed image relative to the gray image according to the pixel value of each pixel point in the processed image and the pixel value of the pixel point at the corresponding position in the gray image;
And taking the pixel point with the pixel lifting ratio larger than a preset threshold value in the processed image as a saturation lifting pixel point.
In one embodiment, the processor when executing the computer program further performs the steps of:
Calculating the variation value of each color channel value of the saturation lifting pixel point relative to the channel statistic value;
Determining the adjusting weights corresponding to the color channel values of the saturation lifting pixel points according to the change values, wherein the color channel value adjusting weights and the change values form a negative correlation;
And calculating to obtain channel color ratio values corresponding to all color channels of the saturation lifting pixel point according to the adjustment weights corresponding to all color channel values of the saturation lifting pixel point.
In one embodiment, the processor when executing the computer program further performs the steps of:
Calculating a first ratio according to the product of the adjusting weight corresponding to the saturation lifting pixel point and the lifting ratio of the saturation lifting pixel point;
subtracting the adjusting weights corresponding to the color channel values of the saturation lifting pixel points from the preset value to obtain a second ratio;
and adding the first ratio and the second ratio to obtain channel color ratios corresponding to the color channels of the saturation lifting pixel point.
In one embodiment, the processor when executing the computer program further performs the steps of:
acquiring pixel points with pixel values larger than a preset threshold value in a gray level image as highlight pixel points;
Multiplying the pixel lifting ratio corresponding to the highlight pixel point with the first coefficient to obtain a third ratio; the first coefficient and the pixel value of the pixel point at the corresponding position of the highlight pixel point in the processed image form a negative correlation;
subtracting the first coefficient from a preset value to obtain a fourth ratio;
And adding the third ratio to the fourth ratio to obtain the channel color ratio corresponding to each color channel of the highlight pixel point.
In one embodiment, the processor when executing the computer program further performs the steps of:
performing image processing on the image to be processed to obtain an intermediate image;
Acquiring a first pixel point of which the pixel value is smaller than a preset threshold value in a gray image corresponding to an image to be processed, and taking the pixel point corresponding to the first pixel point in an intermediate image as a second pixel point;
Obtaining a noise suppression weight of a corresponding second pixel point according to the pixel value of the first pixel point in the gray image, wherein the pixel value and the noise suppression weight form a correlation;
And carrying out noise suppression on the second pixel point in the intermediate image according to the noise suppression weight to obtain a processed image.
In one embodiment, the processor when executing the computer program further performs the steps of:
acquiring a gray image corresponding to an image to be processed;
Carrying out brightening treatment on the gray level image to obtain a brightening image;
carrying out contrast enhancement processing on the gray level image to obtain a contrast enhancement image;
and carrying out fusion processing on the gray level image, the brightening image and the contrast enhancement image to obtain a processed image.
In one embodiment, a computer readable storage medium is provided having a computer program stored thereon, which when executed by a processor, performs the steps of:
performing image processing on the image to be processed to obtain a processed image;
Acquiring color channel values corresponding to all pixel points in the processed image, and counting the color channel values to obtain channel statistic values corresponding to the processed image;
acquiring saturation lifting pixel points in the processed image, and calculating to obtain channel color ratio values corresponding to all color channels of the saturation lifting pixel points based on all color channel values and channel statistic values of the saturation lifting pixel points;
selecting a minimum value from channel color ratios corresponding to all color channels of the saturation lifting pixel point, and taking the minimum value as a color inhibition ratio corresponding to all color channels of the saturation lifting pixel point;
And performing color suppression processing on each color channel of the saturation lifting pixel point based on the color suppression ratio corresponding to each color channel of the saturation lifting pixel point to obtain a target image.
In one embodiment, the computer program when executed by the processor further performs the steps of:
acquiring a gray image corresponding to an image to be processed;
determining a pixel lifting ratio of each pixel point in the processed image relative to the gray image according to the pixel value of each pixel point in the processed image and the pixel value of the pixel point at the corresponding position in the gray image;
And taking the pixel point with the pixel lifting ratio larger than a preset threshold value in the processed image as a saturation lifting pixel point.
In one embodiment, the computer program when executed by the processor further performs the steps of:
Calculating the variation value of each color channel value of the saturation lifting pixel point relative to the channel statistic value;
Determining the adjusting weights corresponding to the color channel values of the saturation lifting pixel points according to the change values, wherein the color channel value adjusting weights and the change values form a negative correlation;
And calculating to obtain channel color ratio values corresponding to all color channels of the saturation lifting pixel point according to the adjustment weights corresponding to all color channel values of the saturation lifting pixel point.
In one embodiment, the computer program when executed by the processor further performs the steps of:
Calculating to obtain a first ratio according to the product of the adjustment weights corresponding to the color channel values of the saturation lifting pixel points and the pixel lifting ratio of the saturation lifting pixel points;
subtracting the adjusting weights corresponding to the color channel values of the saturation lifting pixel points from the preset value to obtain a second ratio;
and adding the first ratio and the second ratio to obtain channel color ratios corresponding to the color channels of the saturation lifting pixel point.
In one embodiment, the computer program when executed by the processor further performs the steps of:
acquiring pixel points with pixel values larger than a preset threshold value in a gray level image as highlight pixel points;
Multiplying the pixel lifting ratio corresponding to the highlight pixel point with the first coefficient to obtain a third ratio; the first coefficient and the pixel value of the pixel point at the corresponding position of the highlight pixel point in the processed image form a negative correlation;
subtracting the first coefficient from a preset value to obtain a fourth ratio;
And adding the third ratio to the fourth ratio to obtain the channel color ratio corresponding to each color channel of the highlight pixel point.
In one embodiment, the computer program when executed by the processor further performs the steps of:
performing image processing on the image to be processed to obtain an intermediate image;
Acquiring a first pixel point of which the pixel value is smaller than a preset threshold value in a gray image corresponding to an image to be processed, and taking the pixel point corresponding to the first pixel point in an intermediate image as a second pixel point;
Obtaining a noise suppression weight of a corresponding second pixel point according to the pixel value of the first pixel point in the gray image, wherein the pixel value and the noise suppression weight form a correlation;
And carrying out noise suppression on the second pixel point in the intermediate image according to the noise suppression weight to obtain a processed image.
In one embodiment, the computer program when executed by the processor further performs the steps of:
acquiring a gray image corresponding to an image to be processed;
Carrying out brightening treatment on the gray level image to obtain a brightening image;
carrying out contrast enhancement processing on the gray level image to obtain a contrast enhancement image;
and carrying out fusion processing on the gray level image, the brightening image and the contrast enhancement image to obtain a processed image.
Those skilled in the art will appreciate that implementing all or part of the above-described methods in accordance with the embodiments may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, or the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory. By way of illustration, and not limitation, RAM can be in various forms such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), etc.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The foregoing examples illustrate only a few embodiments of the application, which are described in detail and are not to be construed as limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of protection of the present application is to be determined by the appended claims.

Claims (10)

1. An image processing method, the method comprising:
performing image processing on the image to be processed to obtain a processed image;
Acquiring color channel values corresponding to all pixel points in the processed image, and counting the color channel values to obtain channel statistic values corresponding to the processed image;
Acquiring saturation lifting pixel points in the processed image, and calculating the variation value of each color channel value of the saturation lifting pixel points relative to the channel statistic value; determining the adjusting weights corresponding to the color channel values of the saturation lifting pixel points according to the change values, wherein the color channel value adjusting weights and the change values form a negative correlation; calculating to obtain channel color ratios corresponding to all color channels of the saturation lifting pixel point according to the adjusting weights corresponding to all color channel values of the saturation lifting pixel point;
Selecting a minimum value from channel color ratios corresponding to all color channels of the saturation lifting pixel point as a color inhibition ratio corresponding to all color channels of the saturation lifting pixel point;
And performing color suppression processing on each color channel of the saturation lifting pixel point based on the color suppression ratio corresponding to each color channel of the saturation lifting pixel point to obtain a target image.
2. The method of claim 1, wherein the acquiring saturation lifting pixels in the processed image comprises:
acquiring a gray image corresponding to the image to be processed;
Determining a pixel lifting ratio of each pixel point in the processed image relative to the gray image according to the pixel value of each pixel point in the processed image and the pixel value of the pixel point at the corresponding position in the gray image;
and taking the pixel point with the pixel lifting ratio larger than a preset threshold value in the processed image as a saturation lifting pixel point.
3. The method according to claim 2, wherein the calculating the channel color ratio corresponding to each color channel of the saturation boost pixel point according to the adjustment weights corresponding to each color channel value of the saturation boost pixel point includes:
Calculating to obtain a first ratio according to the product of the adjustment weights corresponding to the color channel values of the saturation lifting pixel points and the pixel lifting ratio of the saturation lifting pixel points;
subtracting the adjusting weights corresponding to the color channel values of the saturation lifting pixel points from a preset value to obtain a second ratio;
And adding the first ratio and the second ratio to obtain channel color ratios corresponding to all color channels of the saturation lifting pixel point.
4. The method according to claim 2, wherein the method further comprises:
Acquiring pixel points with pixel values larger than a preset threshold value in the gray level image as highlight pixel points;
Multiplying the pixel lifting ratio corresponding to the highlight pixel point with a first coefficient to obtain a third ratio; the first coefficient and the pixel value of the pixel point at the corresponding position of the highlight pixel point in the processed image form a negative correlation;
subtracting the first coefficient from a preset value to obtain a fourth ratio;
And adding the third ratio and the fourth ratio to obtain channel color ratios corresponding to all color channels of the highlight pixel point.
5. The method of claim 1, wherein performing image processing on the image to be processed to obtain a processed image comprises:
performing image processing on the image to be processed to obtain an intermediate image;
Acquiring a first pixel point, of which the pixel value is smaller than a preset threshold value, in a gray image corresponding to the image to be processed, and taking the pixel point corresponding to the first pixel point in the intermediate image as a second pixel point;
Obtaining a noise suppression weight of the corresponding second pixel point according to the pixel value of the first pixel point in the gray image, wherein the pixel value and the noise suppression weight form a correlation;
and performing noise suppression on a second pixel point in the intermediate image according to the noise suppression weight to obtain a processed image.
6. The method according to claim 1 or 5, wherein performing image processing on the image to be processed to obtain a processed image comprises:
acquiring a gray image corresponding to an image to be processed;
carrying out brightening treatment on the gray level image to obtain a brightening image;
Performing contrast enhancement processing on the gray level image to obtain a contrast enhancement image;
and carrying out fusion processing on the gray level image, the brightening image and the contrast enhancement image to obtain a processed image.
7. The method of claim 1, wherein the channel color ratio is a value greater than 1, the closer the channel color ratio is to 1, the higher the saturation of the image.
8. An image processing apparatus, characterized in that the apparatus comprises:
The processing image acquisition module is used for carrying out image processing on the image to be processed to obtain a processed image;
The channel statistical value acquisition module is used for acquiring color channel values corresponding to all pixel points in the processed image, and carrying out statistics on the color channel values to obtain channel statistical values corresponding to the processed image;
The channel color ratio acquisition module is used for acquiring saturation lifting pixel points in the processed image and calculating the variation value of each color channel value of the saturation lifting pixel points relative to the channel statistical value; determining the adjusting weights corresponding to the color channel values of the saturation lifting pixel points according to the change values, wherein the color channel value adjusting weights and the change values form a negative correlation; calculating to obtain channel color ratios corresponding to all color channels of the saturation lifting pixel point according to the adjusting weights corresponding to all color channel values of the saturation lifting pixel point;
the color inhibition ratio acquisition module is used for selecting the minimum value from the channel color ratios corresponding to the color channels of the saturation lifting pixel point to be used as the color inhibition ratio corresponding to the color channels of the saturation lifting pixel point;
And the target image acquisition module is used for carrying out color inhibition processing on each color channel of the saturation lifting pixel point based on the color inhibition ratio corresponding to each color channel of the saturation lifting pixel point to obtain a target image.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 7 when the computer program is executed.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 7.
CN202011418526.3A 2020-12-07 2020-12-07 Image processing method, device, computer equipment and storage medium Active CN112541868B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202011418526.3A CN112541868B (en) 2020-12-07 2020-12-07 Image processing method, device, computer equipment and storage medium
PCT/CN2021/136086 WO2022121893A1 (en) 2020-12-07 2021-12-07 Image processing method and apparatus, and computer device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011418526.3A CN112541868B (en) 2020-12-07 2020-12-07 Image processing method, device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112541868A CN112541868A (en) 2021-03-23
CN112541868B true CN112541868B (en) 2024-05-14

Family

ID=75016303

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011418526.3A Active CN112541868B (en) 2020-12-07 2020-12-07 Image processing method, device, computer equipment and storage medium

Country Status (2)

Country Link
CN (1) CN112541868B (en)
WO (1) WO2022121893A1 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112541868B (en) * 2020-12-07 2024-05-14 影石创新科技股份有限公司 Image processing method, device, computer equipment and storage medium
CN115731861B (en) * 2022-11-18 2024-06-18 武汉路特斯汽车有限公司 Screen color adjustment method, device and terminal
CN117237258B (en) * 2023-11-14 2024-02-09 山东捷瑞数字科技股份有限公司 Night vision image processing method, system, equipment and medium based on three-dimensional engine
CN117853346B (en) * 2024-03-08 2024-05-14 杭州湘亭科技有限公司 Radiation source three-dimensional radiation image intelligent enhancement method based on decontamination robot

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103618887A (en) * 2013-11-29 2014-03-05 深圳Tcl新技术有限公司 Method and device for processing image
CN105631826A (en) * 2015-12-25 2016-06-01 武汉鸿瑞达信息技术有限公司 Color image saturation enhancing method and system
CN108876742A (en) * 2018-06-25 2018-11-23 深圳市华星光电技术有限公司 image color enhancement method and device
CN109741279A (en) * 2019-01-04 2019-05-10 Oppo广东移动通信有限公司 Image saturation method of adjustment, device, storage medium and terminal
CN111163268A (en) * 2020-01-09 2020-05-15 腾讯科技(深圳)有限公司 Image processing method and device and computer storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8842912B2 (en) * 2011-05-19 2014-09-23 Foveon, Inc. Method for processing highlights and saturated regions in a digital image
CN112541868B (en) * 2020-12-07 2024-05-14 影石创新科技股份有限公司 Image processing method, device, computer equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103618887A (en) * 2013-11-29 2014-03-05 深圳Tcl新技术有限公司 Method and device for processing image
CN105631826A (en) * 2015-12-25 2016-06-01 武汉鸿瑞达信息技术有限公司 Color image saturation enhancing method and system
CN108876742A (en) * 2018-06-25 2018-11-23 深圳市华星光电技术有限公司 image color enhancement method and device
CN109741279A (en) * 2019-01-04 2019-05-10 Oppo广东移动通信有限公司 Image saturation method of adjustment, device, storage medium and terminal
CN111163268A (en) * 2020-01-09 2020-05-15 腾讯科技(深圳)有限公司 Image processing method and device and computer storage medium

Also Published As

Publication number Publication date
CN112541868A (en) 2021-03-23
WO2022121893A1 (en) 2022-06-16

Similar Documents

Publication Publication Date Title
CN112541868B (en) Image processing method, device, computer equipment and storage medium
CN109272459B (en) Image processing method, image processing device, storage medium and electronic equipment
US9826149B2 (en) Machine learning of real-time image capture parameters
EP2987135B1 (en) Reference image selection for motion ghost filtering
US8760537B2 (en) Capturing and rendering high dynamic range images
US10565742B1 (en) Image processing method and apparatus
CN105432069B (en) Image processing apparatus, photographic device, image processing method and program
US10783837B2 (en) Driving method and driving device of display device, and related device
KR101998531B1 (en) Real-time video enhancement methods, terminals, and non-transitory computer readable storage media
US9177367B2 (en) Image processing apparatus and image processing method
CN115115554B (en) Image processing method and device based on enhanced image and computer equipment
WO2020093782A1 (en) Method, system, and computer-readable medium for improving quality of low-light images
WO2023137956A1 (en) Image processing method and apparatus, electronic device, and storage medium
CN115496668A (en) Image processing method, image processing device, electronic equipment and storage medium
Lei et al. A novel intelligent underwater image enhancement method via color correction and contrast stretching✰
CN112534466B (en) Directional scaling system and method
US11640654B2 (en) Image processing method and apparatus
CN116843566A (en) Tone mapping method, tone mapping device, display device and storage medium
CN111462158A (en) Image processing method and device, intelligent device and storage medium
WO2023011280A1 (en) Image noise degree estimation method and apparatus, and electronic device and storage medium
CN115660997A (en) Image data processing method and device and electronic equipment
WO2022111269A1 (en) Method and device for enhancing video details, mobile terminal, and storage medium
US9836827B2 (en) Method, apparatus and computer program product for reducing chromatic aberrations in deconvolved images
CN110874816B (en) Image processing method, device, mobile terminal and storage medium
CN111915529A (en) Video dim light enhancement method and device, mobile terminal and storage medium

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