WO2020186590A1 - 图像处理方法、装置及存储介质 - Google Patents
图像处理方法、装置及存储介质 Download PDFInfo
- Publication number
- WO2020186590A1 WO2020186590A1 PCT/CN2019/083478 CN2019083478W WO2020186590A1 WO 2020186590 A1 WO2020186590 A1 WO 2020186590A1 CN 2019083478 W CN2019083478 W CN 2019083478W WO 2020186590 A1 WO2020186590 A1 WO 2020186590A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- color image
- image
- color
- index
- remaining
- 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.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/40—Image enhancement or restoration using histogram techniques
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/90—Dynamic range modification of images or parts thereof
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10024—Color image
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20172—Image enhancement details
- G06T2207/20208—High dynamic range [HDR] image processing
Definitions
- the present invention relates to the field of image processing technology, and in particular to an image processing method, device and storage medium.
- HDR High-Dynamic Range
- LDR Low-Dynamic Range
- Pseudo-HDR refers to processing an LDR image into another LDR image for display on an LDR display device through certain tone mapping algorithms, making it reach or close to the effect of an HDR display. The essence of this algorithm is to maximize the details and contrast in the picture.
- Image contrast enhancement methods can be divided into two categories: one is direct contrast enhancement methods; the other is indirect contrast enhancement methods. Histogram stretching and histogram equalization are the two most common indirect contrast enhancement methods.
- the histogram equalization process is to change the gray histogram of the original image from a relatively concentrated gray range to a uniform distribution in the entire gray range. Histogram equalization is to stretch the image non-linearly and redistribute image pixel values so that the number of pixels in a certain gray scale range is roughly the same. Histogram equalization is to change the histogram distribution of a given image to a "uniform" distribution histogram distribution. This method is very useful for images where the background and foreground are too bright or too dark. The disadvantage is that it does not select the processed data, and all pictures are processed in the same way, resulting in excessive image contrast enhancement after some picture transformations. The gray level is reduced, some details disappear, or the contrast of some pictures is not enhanced enough to reveal the details.
- the embodiment of the present invention provides an image processing method, device and storage medium.
- the histogram equalization algorithm of image processing the calculation of the image distortion index is introduced, and the cropping scale value of the histogram is adaptively controlled to make the histogram equalized
- the transformed image has a reasonable exposure, which can show more image details and reduce color cast.
- the present invention provides an image processing method, the method including:
- the image processing method further includes:
- a new cropping scale value is reset, and the second color image is histogram equalized according to the new cropping scale value to obtain a third color Image, calculating a third color image distortion index of the third color image relative to the first color image, and outputting the third color image when the third color image distortion index is less than a preset value.
- the calculating the image distortion index of the second color image relative to the first color image includes:
- the remaining exposure energy and the color index, the image distortion index of the second color image relative to the first color image is calculated.
- the calculating the abnormal exposure rate, remaining exposure energy, and color index of the second color image includes:
- the calculating the abnormal exposure rate of the second color image includes:
- N(I W ) is the first number of pixels in the second color image whose gray value is greater than the first preset value and meets the requirements of the preset loss of detail
- N(I b ) is the gray in the second color image The second number of pixels whose degree value is less than the second preset value and meets the preset detail loss requirement
- n is the total number of pixels in the grayscale image of the first color image.
- the calculating the remaining exposure energy of the second color image includes:
- the remaining exposure energy of the second color image is calculated.
- the calculation of the remaining exposure energy of the second color image according to the remaining upper exposure energy and the remaining lower exposure energy is:
- the remaining exposure energy of the second color image is equal to the sum of the remaining upper exposure energy and the remaining lower exposure energy.
- the calculating the color index of the second color image includes:
- the color index of the second color image is calculated according to the total channel average value and the total channel variance of the second color image.
- the index is the image distortion index of the second color image relative to the first color image
- E x is the abnormal exposure rate of the second color image
- Energy is the remaining exposure energy
- C is the color index
- ⁇ 1 , ⁇ 2 , and ⁇ 3 are constant coefficients, which are respectively the weight ratios of the abnormal exposure rate, remaining exposure energy, and color index of the second color image.
- the present invention also provides an image processing device, which includes:
- the first acquiring unit is used to acquire the first color image
- the second obtaining unit is used to obtain a preset cutting scale value
- An equalization processing unit configured to perform histogram equalization processing on the first color image according to the crop ratio value to obtain a second color image
- a calculation unit configured to calculate the image distortion index of the second color image relative to the first color image
- the output unit is configured to output the second color image when the image distortion index is less than a preset value.
- calculation unit is specifically configured to:
- the remaining exposure energy and the color index, the image distortion index of the second color image relative to the first color image is calculated.
- calculation unit is specifically configured to:
- calculation unit is specifically configured to:
- calculation unit uses the following formula to calculate the abnormal exposure rate:
- N(I W ) is the first number of pixels in the second color image whose gray value is greater than the first preset value and meets the requirements of the preset loss of detail
- N(I b ) is the gray in the second color image The second number of pixels whose degree value is less than the second preset value and meets the preset detail loss requirement
- n is the total number of pixels in the grayscale image of the first color image.
- calculation unit is specifically configured to:
- the remaining exposure energy of the second color image is calculated.
- calculation unit uses the following formula to calculate the remaining exposure energy:
- the remaining exposure energy of the second color image is equal to the sum of the remaining upper exposure energy and the remaining lower exposure energy.
- calculation unit is specifically configured to:
- the color index of the second color image is calculated according to the total channel average value and the total channel variance of the second color image.
- calculation unit uses the following formula to calculate the image distortion index of the second color image relative to the first color image:
- the index is the image distortion index of the second color image relative to the first color image
- E x is the abnormal exposure rate of the second color image
- Energy is the remaining exposure energy
- C is the color index
- ⁇ 1 , ⁇ 2 , and ⁇ 3 are constant coefficients, which are respectively the weight ratios of the abnormal exposure rate, remaining exposure energy, and color index of the second color image.
- the present invention also provides a storage medium that stores a plurality of instructions, and the instructions are suitable for loading by a processor to execute the steps in any one of the image processing methods described above.
- the purpose of the present invention is to solve the problems of excessive image contrast enhancement, reduced gray level, disappearance of details, insufficient image contrast enhancement, and inability to show details after image transformation after image transformation. , Proposes an image processing method, based on the traditional histogram equalization algorithm, introduces the image distortion index, and realizes effective adaptive parameter adjustment, so that the image after the histogram equalization process has a reasonable exposure and can show more More image details, reduce color cast.
- FIG. 1 is a flowchart of an embodiment of an image processing method provided by the present invention
- FIG. 2 is a flowchart of performing histogram equalization processing on a grayscale image of a first color image in an embodiment of the image processing method provided by the present invention
- FIG. 3 is a flowchart of calculating the image distortion index of the second color image relative to the first color image in an embodiment of the image processing method provided by the present invention
- Fig. 4 is a schematic diagram of an embodiment of an image processing device provided by the present invention.
- image processing method under the prior art has lost details and large color cast. Based on this, embodiments of the present invention provide an image processing method, device, and storage medium, which are described in detail below.
- FIG. 1 it is a schematic diagram of an embodiment of an image processing method in an embodiment of the present invention.
- the method includes:
- the cutting ratio value is an initially preset value, for example, the initial cutting ratio value, such as 10%, 20%, or 30%.
- the second color image shown can show more image details and reduce color cast.
- the preset value is ⁇ , which may be the average variance of pixels in the first color image.
- the image processing method provided by the present invention increases the calculation of the image distortion index and realizes effective adaptive parameter adjustment, so that the image has a reasonable exposure after the histogram is processed. And can show more details and reduce color cast.
- the image processing method may further include:
- a new cropping scale value is reset, and the second color image is histogram equalized according to the new cropping scale value to obtain a third color Image, calculating a third color image distortion index of the third color image relative to the first color image, and outputting the third color image when the third color image distortion index is less than a preset value.
- the following calculation formula may be used to set the new cutting ratio value:
- Clip j ⁇ (index j-1 -index j-2 )/(clip j-1 -clip j-2 ) ⁇ *a learning rate + (clip j-1 -clip j-2 )/2
- said learning rate is a learning rate constant
- the image distortion index can be close to the preset value until it is less than the preset value.
- step S3 in the embodiment of the image processing method shown in FIG. 1 may further include: acquiring a grayscale image of the first color image; drawing a grayscale histogram of the grayscale image of the first color image; Cut the scale value, cut the grayscale histogram of the first color image, calculate the mapping relationship of the grayscale value before and after equalization by a preset formula, and obtain the normalized grayscale histogram; according to the normalization The subsequent grayscale histogram obtains the second color image.
- the drawing the grayscale histogram of the grayscale image of the first color image includes: counting the number n of pixels corresponding to each grayscale value k in the grayscale image of the first color image; The number of pixels corresponding to a gray value draws a grayscale histogram of the grayscale image of the first color image.
- step S3 in the embodiment of the image processing method shown in FIG. 1 may include:
- grayscale of a color image can be made using the following formula:
- f (i, j) is the gray value of the gray image pixel (i, j)
- R (i, j), G (i, j), B (i, j) are the red color image , Green and blue components.
- the gray value f(i, j) has a value of 0-255, such as 0, 100, and 255.
- drawing the grayscale histogram of the grayscale image of the first color image may include the following steps: counting the number n of pixels corresponding to each grayscale value k in the grayscale image of the first color image; The number of pixels corresponding to a gray value draws a grayscale histogram of the grayscale image of the first color image.
- each pixel in a grayscale image corresponds to a grayscale value.
- the gray value is the number n of pixels corresponding to k.
- grayscale histogram can be expressed as:
- the total number of pixels is n-gradation image of the first color image
- L is the total number of gray values
- k represents the k-th R & lt gradation values
- k represents the number of pixels of the n-level gray scale value k
- P r (r k ) represents the frequency of the gray value, and is an estimate of its probability of occurrence.
- the relationship graph between r k and P r (r k ) is drawn in the rectangular coordinate system, which is the gray histogram of the gray image of the color image.
- the abscissa of the grayscale histogram is the grayscale value k
- the ordinate is the probability P r (r k ) of the number of pixels corresponding to each grayscale value k in the total number of pixels in the grayscale image.
- the preset cutting scale value may be the initial cutting scale value, for example, 20%
- the gray scale value is 0-255, that is, L is 256
- the preset The cropping ratio value of the first color image is 20%
- the grayscale image of the first color image is cropped.
- the range of the cropped grayscale value is: (255+1)*20%-(255+1)*80 %, that is, the range of the gray value after cropping is 52-205. Specifically, all pixels in the gray image of the first color image whose gray value is outside 52-205 are removed.
- calculating the mapping relationship of the gray value before and after the histogram equalization processing by using a preset formula, and obtaining the normalized gray histogram may include the following steps: calculating after cropping The ratio of the number of pixels of each gray value in the gray-level histogram to the total number of pixels; accumulate each ratio value to obtain a new ratio value, and draw a normalized new gray-level histogram Figure.
- step S4 in the foregoing embodiment may further include:
- S301 Calculate the abnormal exposure rate, remaining exposure energy, and color index of the second color image.
- the calculating the abnormal exposure rate, the remaining exposure energy, and the color index of the second color image may include: calculating the abnormal exposure rate of the second color image; calculating the remaining exposure energy of the second color image ; Calculate the color index of the second color image.
- the calculating the abnormal exposure rate of the second color image may include: determining the first number of pixels in the second color image whose gray value is greater than a first preset value and meeting a preset detail loss requirement; determining the The second number of pixels in the second color image whose gray value is less than the second preset value and meets the requirements of the preset loss of detail; the abnormality of the second color image is counted according to the first number and the second number Exposure rate.
- the first preset value is the maximum value of the grayscale in the grayscale image of the first color image after the grayscale image of the first color image is cut according to a preset cropping ratio value.
- I W ⁇ I(i)/ ⁇ (i)>255 ⁇ m ⁇ (i) ⁇
- I(i) is the gray value of pixel i in the first color image
- ⁇ (i) is the gray value of pixel i in the second color image
- ⁇ (i) is pixel i in the second color image
- the variance of ⁇ is the average variance of the pixels of the first color image.
- the first preset value is the minimum value of the grayscale in the grayscale image of the first color image after the grayscale image of the first color image is cut according to a preset cropping ratio value.
- I b ⁇ I(i)/ ⁇ (i) ⁇ 255 ⁇ m ⁇ (i) ⁇
- I(i) is the gray value of pixel i in the first color image
- ⁇ (i) is the gray value of pixel i in the second color image
- ⁇ (i) is pixel i in the second color image
- the variance of ⁇ is the average variance of the pixels of the first color image.
- the preset cutting ratio value is 10%, and at this time, the first preset value is a gray value of 255*90%, that is, a gray value of 223; Set the gray value to 255*10%, that is, the gray value is 25.
- the preset cutting ratio value may also be 20%, and at this time, the first preset value is a gray value of 255*80%, that is, a gray value of 204;
- the second preset value is the gray value of 255*20%, that is, the gray value is 51.
- the pixels whose preset details are lost are: the variance a(i) of any pixel in the second color image is smaller than the pixel corresponding to the average variance ⁇ of the pixels of the first color image, that is, a(i ) ⁇ .
- the following calculation formula may be used to calculate the abnormal exposure rate:
- the abnormal exposure will make the image scene very bright or dark, and the abnormal exposure will cause the loss of image details.
- the abnormal exposure rate represents the proportion of pixels in the image that have been abnormally exposed and lost details. The larger the value of the exposure rate, the more severe the abnormal exposure of the image.
- calculating the remaining exposure energy of the second color image may include the following steps: calculating the remaining upper exposure energy of the second color image; calculating the remaining lower exposure energy of the second color image Calculate the remaining exposure energy of the second color image according to the remaining upper exposure energy and the remaining lower exposure energy.
- ⁇ A ⁇ is a second-order norm function
- Energy w represents the concentration of the pixel gray value relative to the white point, which is the gray value 255, in the abnormally exposed pixels.
- the larger the Energy w it means that the pixels exposed on the anomaly are far away from the white point and the remaining energy is larger; the smaller the Energy w is , the pixels exposed on the anomaly are closer to the white point and the remaining energy is smaller.
- the calculation of the remaining lower exposure energy of the second color image may adopt the following formula:
- Energy b represents the concentration degree of the pixel gray value relative to the black point 0 in the pixels exposed under abnormal conditions.
- the calculation formula for calculating the remaining exposure energy of the second color image according to the remaining upper exposure energy and the remaining lower exposure energy may be:
- calculating the color index C of the second color image includes: calculating the red-green channel value and the yellow-blue channel value of the second color image; according to the red-green channel value and the yellow-blue channel value Calculate the total channel average value and the total channel variance of the second color image; calculate the color index according to the total channel average value and the total channel variance of the second color image.
- the following calculation formula may be used to calculate the red and green r g channel values of the second color image:
- ⁇ rg and ⁇ yb are the average values of the red-green (r g ) and yellow-blue (y b ) channels in the second color image.
- ⁇ rg and ⁇ yb are the variances of the red-green (r g ) and yellow-blue (y b ) channels in the second color image.
- the following calculation formula may be used to calculate the color index C according to the total channel average value and the total channel variance of the second color image:
- c c is a constant coefficient
- the color index C measures the color information of the color image.
- S302 Calculate the image distortion index of the second color image relative to the first color image according to the abnormal exposure rate, the remaining exposure energy, and the color index.
- the calculation formula for calculating the image distortion index index of the second color image relative to the first color image is:
- index is the image distortion index of the second color image relative to the first color image
- E x is the abnormal exposure rate of the second color image
- Energy is the remaining exposure energy
- C is the color index
- ⁇ 1 , ⁇ 2 , and ⁇ 3 are constant coefficients, which are respectively the weight ratios of the abnormal exposure rate, remaining exposure energy, and color index of the second color image.
- the image processing method may further include:
- a new cropping scale value is reset, and the second color image is histogram equalized according to the new cropping scale value to obtain a third color Image, calculating a third color image distortion index of the third color image relative to the first color image, and outputting the third color image when the third color image distortion index is less than a preset value.
- the calculation formula for setting the new cutting scale value may be:
- Clip j ⁇ (index j-1 -index j-2 )/(clip j-1 -clip j-2 ) ⁇ *a learning rate + (clip j-1 -clip j-2 )/2
- said learning rate is a learning rate constant
- the present invention also provides an image processing apparatus 400.
- an embodiment of the image processing apparatus provided by the present invention includes:
- the first obtaining unit 401 is configured to obtain a first color image
- the second obtaining unit 402 is configured to obtain a preset cutting scale value
- An equalization processing unit 403, configured to perform histogram equalization processing on the first color image according to the cropping ratio value to obtain a second color image;
- a calculating unit 404 configured to calculate the image distortion index of the second color image relative to the first color image
- the output unit 405 is configured to output the second color image when the image distortion index is less than a preset value.
- the present invention provides an image processing device.
- the image processing device can calculate the image distortion index of the second color image relative to the first color image, realizes effective adaptive parameter adjustment, and equalizes the histogram
- the processed image has a reasonable exposure, which can show more image details and reduce color cast.
- output unit 405 is also used for:
- a new cropping scale value is reset, and the second color image is histogram equalized according to the new cropping scale value to obtain a third color Image, calculating a third color image distortion index of the third color image relative to the first color image, and outputting the third color image when the third color image distortion index is less than a preset value.
- calculation unit 404 is specifically configured to:
- the remaining exposure energy and the color index, the image distortion index of the second color image relative to the first color image is calculated.
- calculation unit 404 is specifically configured to:
- calculation unit 404 is specifically configured to:
- calculation unit 404 is specifically configured to:
- the remaining exposure energy of the second color image is calculated.
- calculation unit 404 is specifically configured to:
- the color index of the second color image is calculated according to the total channel average value and the total channel variance of the second color image.
- calculation unit 404 calculates the image distortion index of the second color image relative to the first color image according to the abnormal exposure rate, remaining exposure energy and color index, using the following formula:
- the index is the image distortion index of the second color image relative to the first color image
- E x is the abnormal exposure rate of the second color image
- Energy is the remaining exposure energy
- C is the color index
- ⁇ 1 , ⁇ 2 , and ⁇ 3 are constant coefficients, which are respectively the weight ratios of the abnormal exposure rate, remaining exposure energy, and color index of the second color image.
- the present invention also provides a storage medium that stores a plurality of instructions, and the instructions are suitable for loading by a processor to execute the steps in the image processing method described in any of the above embodiments.
- the disclosed system, device, and method may be implemented in other ways.
- the device embodiments described above are only illustrative.
- the division of the units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components may be combined or It can be integrated into another system, or some features can be ignored or not implemented.
- the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
- the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
- the functional units in the various embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
- the above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Image Processing (AREA)
- Facsimile Image Signal Circuits (AREA)
Abstract
本发明提供一种图像处理方法、装置及存储介质,该方法包括:获取第一彩色图像的灰度图像和预设裁切比例值;按裁切比例值对第一彩色图像的灰度图像进行处理,得到第二彩色图像;计算第二彩色图像相对于第一彩色图像的图像失真指数;当图像失真指数小于预设定值,输出第二彩色图像。本申请的方法,能够展现更多的图像细节。
Description
本发明涉及图像处理技术领域,尤其涉及一种图像处理方法、装置及存储介质。
近年来,高动态范围图像(High-Dynamic Range,HDR)的应用逐渐成为图像处理领域的一个热门话题。HDR图像能够准确地描述亮度差异,从微弱的星光到明亮的阳光,从而为观众提供更高质量的观看体验。然而,由于当前的HDR相关设备通常都很昂贵,实际应用范围有限,大多数图像处理系统仍然配备了传统的低动态范围图像(Low-Dynamic Range,LDR)设备。同时,HDR图像和视频的获取设备也非常复杂和昂贵,许多缺陷也尚未解决,比如多曝光的拍摄装置往往带来图像伪影。所以Pseudo-HDR应运而生。
Pseudo-HDR是指通过某些色调映射算法,将LDR图片处理成另一张LDR图片在LDR显示设备上显示,使其达到或接近HDR显示器的效果。这种算法的根本是将图片中的细节和对比度最大程度的展现出来。图像对比度增强的方法可以分成两类:一类是直接对比度增强方法;另一类是间接对比度增强方法。直方图拉伸和直方图均衡化是两种最常见的间接对比度增强方法。
直方图均衡化处理是把原始图像的灰度直方图从比较集中的某个灰度区间变成在全部灰度范围内的均匀分布。直方图均衡化就是对图像进行非线性拉伸,重新分配图像像素值,使一定灰度范围内的像素数量大致相同。直方图均衡化就是把给定图像的直方图分布改变成“均匀”分布直方图分布。这种方法对于背景和前景都太亮或者太暗的图像非常有用,缺点是它对处理的数据不加选择,将所有图片都采用相同的方式进行处理,导致某些图片变换后图像对比度增强过度,灰度级减少,某些细节消失,或某些图片对比度增强不够,细节无法展现。
本发明实施例提供一种图像处理方法、装置及存储介质,在图像处理的直方图均衡化算法中,引入图像失真指数的计算,自适应的控制直方图的裁切比例值,使得直方图均衡化处理后的图像有了合理的曝光,能够展现更多的图像细节,减小色偏。
第一方面,本发明提供一种图像处理方法,所述方法包括:
获取第一彩色图像;
获取预设的裁切比例值;
按所述裁切比例值对所述第一彩色图像的灰度图像进行直方图均衡化处理,得到第二彩色图像;
计算所述第二彩色图像相对于所述第一彩色图像的图像失真指数;
当所述图像失真指数小于预设定值时,输出所述第二彩色图像。
进一步的,所述图像处理方法还包括:
当所述图像失真指数不小于预设定值时,重新设置新的裁切比例值,根据所述新的裁切比例值对所述第二彩色图像进行直方图均衡化处理,得到第三彩色图像,计算所述第三彩色图像相对于所述第一彩色图像的第三彩色图像失真指数,当所述第三彩色图像失真指数小于预设定值时,输出所述第三彩色图像。
进一步的,所述计算所述第二彩色图像相对于所述第一彩色图像的图像失真指数,包括:
计算所述第二彩色图像的异常曝光率、剩余曝光能量、颜色指数。
根据所述异常曝光率、剩余曝光能量和颜色指数,计算所述第二彩色图像相对所述第一彩色 图像的图像失真指数。
进一步的,所述计算所述第二彩色图像的异常曝光率、剩余曝光能量、颜色指数,包括:
计算所述第二彩色图像的异常曝光率;
计算所述第二彩色图像的剩余曝光能量;
计算所述第二彩色图像的颜色指数。
进一步的,所述计算所述第二彩色图像的异常曝光率包括:
确定所述第二彩色图像中灰度值大于第一预设值并符合预设细节丢失要求的像素的第一数量;
确定所述第二彩色图像中灰度值小于第二第预设值并符合预设细节丢失要求的像素的第二数量:
根据所述第一数量和所述第二数量统计所述第二彩色图像的异常曝光率。
进一步的,其中,所述根据所述第一数量和所述第二数量统计所述第二彩色图像的异常曝光率的公式为:
E
x={N(I
W)+N(I
b)}/n
其中,N(I
W)为第二彩色图像中灰度值大于第一预设值并符合预设细节丢失要求的像素的第一数量;N(I
b)为所述第二彩色图像中灰度值小于第二第预设值并符合预设细节丢失要求的像素的第二数量;n为第一彩色图像的灰度图像中的像素总数。
进一步的,所述计算所述第二彩色图像的剩余曝光能量,包括:
计算所述第二彩色图像的剩余上曝光能量;
计算所述第二彩色图像的剩余下曝光能量;
根据所述剩余上曝光能量和所述剩余下曝光能量,计算所述第二彩色图像的剩余曝光能量。
进一步的,所述根据所述剩余上曝光能量和所述剩余下曝光能量,计算所述第二彩色图像的剩余曝光能量为:
所述第二彩色图像的剩余曝光能量等于所述剩余上曝光能量和所述剩余下曝光能量的和。
进一步的,所述计算所述第二彩色图像的颜色指数,包括:
计算所述第二彩色图像的红绿通道值和黄蓝通道值;
根据红绿通道值和黄蓝通道值计算所述第二彩色图像的通道总均值和通道总方差;
根据所述第二彩色图像的通道总均值和通道总方差,计算所述第二彩色图像的颜色指数。
进一步的,所述根据所述异常曝光率、剩余曝光能量和颜色指数,计算所述第二彩色图像相对所述第一彩色图像的图像失真指数,采用如下公式:
index=α
1*E
x+α
2*Energy+α
3*C
所述index为所述第二彩色图像相对所述第一彩色图像的图像失真指数,E
x为所述第二彩色图像的异常曝光率、Energy为剩余曝光能量、C为颜色指数,所述α
1、α
2、α
3是常量系数,分别为所述第二彩色图像的异常曝光率、剩余曝光能量、颜色指数的权重占比。
第二方面,本发明还提供一种图像处理装置,所述图像处理装置包括:
第一获取单元,用于获取第一彩色图像;
第二获取单元,用于获取预设的裁切比例值;
均衡化处理单元,用于按所述裁切比例值对所述第一彩色图像进行直方图均衡化处理,得到第二彩色图像;
计算单元,用于计算所述第二彩色图像相对所述第一彩色图像的图像失真指数;
输出单元,用于当所述图像失真指数小于预设定值时,输出所述第二彩色图像。
进一步的,所述计算单元具体用于:
计算所述第二彩色图像的异常曝光率、剩余曝光能量、颜色指数。
根据所述异常曝光率、剩余曝光能量和颜色指数,计算所述第二彩色图像相对所述第一彩色 图像的图像失真指数。
进一步的,所述计算单元具体用于:
计算所述第二彩色图像的异常曝光率;
计算所述第二彩色图像的剩余曝光能量;
计算所述第二彩色图像的颜色指数。
进一步的,所述计算单元具体用于:
确定所述第二彩色图像中灰度值大于第一预设值并符合预设细节丢失要求的像素的第一数量;
确定所述第二彩色图像中灰度值小于第二第预设值并符合预设细节丢失要求的像素的第二数量:
根据所述第一数量和所述第二数量统计所述第二彩色图像的异常曝光率。
进一步的,所述计算单元采用如下公式计算异常曝光率:
E
x={N(I
W)+N(I
b)}/n
其中,N(I
W)为第二彩色图像中灰度值大于第一预设值并符合预设细节丢失要求的像素的第一数量;N(I
b)为所述第二彩色图像中灰度值小于第二第预设值并符合预设细节丢失要求的像素的第二数量;n为第一彩色图像的灰度图像中的像素总数。
进一步的,所述计算单元具体用于:
计算所述第二彩色图像的剩余上曝光能量;
计算所述第二彩色图像的剩余下曝光能量;
根据所述剩余上曝光能量和所述剩余下曝光能量,计算所述第二彩色图像的剩余曝光能量。
进一步的,所述计算单元采用如下公式计算剩余曝光能量:
所述第二彩色图像的剩余曝光能量等于所述剩余上曝光能量和所述剩余下曝光能量的和。
进一步的,所述计算单元具体用于:
计算所述第二彩色图像的红绿通道值和黄蓝通道值;
根据红绿通道值和黄蓝通道值计算所述第二彩色图像的通道总均值和通道总方差;
根据所述第二彩色图像的通道总均值和通道总方差,计算所述第二彩色图像的颜色指数。
进一步的,所述计算单元采用如下公式计算所述第二彩色图像相对所述第一彩色图像的图像失真指数:
index=α
1*E
x+α
2*Energy+α
3*C
所述index为所述第二彩色图像相对所述第一彩色图像的图像失真指数,E
x为所述第二彩色图像的异常曝光率、Energy为剩余曝光能量、C为颜色指数,所述α
1、α
2、α
3是常量系数,分别为所述第二彩色图像的异常曝光率、剩余曝光能量、颜色指数的权重占比。
本发明还提供一种存储介质,所述存储介质存储有多条指令,所述指令适于处理器进行加载,以执行以上任一项所述的图像处理方法中的步骤。
有益效果:本发明的目的是针对现有技术下的灰度图像对比度增强算法中出现的图片变换后图像对比度增强过度,灰度级减少,细节消失,或者图片对比度增强不够,细节无法展现等问题,提出一种图像处理方法,基于传统的直方图均衡化算法,引入了图像失真指数,实现了有效的自适应参数调节,使得直方图均衡化处理后的图像有了合理的曝光,能够展现更多的图像细节,减小色偏。
为了更清楚地说明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单介绍,显而易见地,下面描述中的附图仅仅是发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的 附图。
图1为本发明所提供的图像处理方法一实施例的流程图;
图2为本发明所提供的图像处理方法一实施例中对第一彩色图像的灰度图像进行直方图均衡化处理的流程图;
图3为本发明所提供的图像处理方法一实施例中计算第二彩色图像相对于第一彩色图像的图像失真指数的流程图;
图4为本发明所提供的图像处理装置一实施例示意图。
以下各实施例的说明是参考附加的图示,用以例示本发明可用以实施的特定实施例。本发明所提到的方向用语,例如[上]、[下]、[前]、[后]、[左]、[右]、[内]、[外]、[侧面]等,仅是参考附加图式的方向。因此,使用的方向用语是用以说明及理解本发明,而非用以限制本发明。在图中,结构相似的单元是用以相同标号表示。
附图和说明被认为在本质上是示出性的,而不是限制性的。在图中,结构相似的单元是用以相同标号表示。另外,为了理解和便于描述,附图中示出的每个组件的尺寸和厚度都是任意示出的,但是本发明不限于此。
在附图中,为了清晰起见,夸大了层、膜、面板、区域等的厚度。在附图中,为了理解方便和便于描述,夸大了一些层和区域的厚度。需要说明的是,当例如层、膜、区域或基底的组件被称作“在”另一组件“上”时。所述组件可以直接在所述另一组件上,或者也可以存在中间组件。
另外,在说明书中,除非明确地描述为相反的,否则词语“包括”将被理解为意指包括所述组件,但是不排除任何其他组件。此外在说明书中,“在……上”意指位于目标组件上方或者下方,而不意指必须位于基于重力方向的顶部上。
为更进一步阐述本发明为达成预定发明所采取的技术手段及功效,以下结合附图及较佳实施例,对依据本发明提出的一种图像处理方法、装置及存储介质,其具体实施方式、结构、特征及其功效,详细说明如下。
现有技术下的图像处理方法细节丢失,色偏较大。基于此,本发明实施例中提供一种图像处理方法、装置及存储介质,下面分别详细进行描述。
如图1所示,为本发明实施例中图像处理方法的一个实施例的示意图,该方法包括:
S1、获取第一彩色图像。
S2、获取预设的裁切比例值。
具体的,所述裁切比例值为初始预设的值,例如初始裁切比例值,具体的如10%、20%或30%。
S3、按所述裁切比例值对所述第一彩色图像的灰度图像进行直方图均衡化处理,得到第二彩色图像。
本发明实施例中,相对于第一彩色图像,所示第二彩色图像可以展示更多的图像细节,减少色偏。
S4、计算所述第二彩色图像相对于所述第一彩色图像的图像失真指数。
S5、当所述图像失真指数小于预设定值时,输出所述第二彩色图像。
具体的,预设定值为δ,δ可以为所述第一彩色图像中像素的平均方差。
本发明所提供的图像处理方法,相对于现有技术的图像处理方法,增加了图像失真指数的计算,实现了有效的自适应参数调节,使得图像进行直方图处理后,有一个合理的曝光,且能够展现更多的细节,减小色偏。
进一步的,本发明所提供的图像处理方法一实施例中,所述图像处理方法还可以包括:
当所述图像失真指数不小于预设定值时,重新设置新的裁切比例值,根据所述新的裁切比例 值对所述第二彩色图像进行直方图均衡化处理,得到第三彩色图像,计算所述第三彩色图像相对于所述第一彩色图像的第三彩色图像失真指数,当所述第三彩色图像失真指数小于预设定值时,输出所述第三彩色图像。
具体的,在本发明一些实施例中,所述设置新的裁切比例值可以采用如下计算公式:
Clip
j={(index
j-1-index
j-2)/(clip
j-1-clip
j-2)}*a
学习率+(clip
j-1-clip
j-2)/2
其中,所述a
学习率为学习率常量,j表示循环次数(即裁切比例值的调整次数)。若j=1,clip
j-1=clip
0,clip
j-2=0,index
j-1为最近一次计算得到的index,clip
j-2=0。
通过这种裁切比例值的不断设定,可以使得图像失真指数接近预设定值,直至小于预设定值。
具体的,图1所示图像处理方法实施例中的步骤S3可以进一步包括:获取第一彩色图像的灰度图像;绘制第一彩色图像的灰度图像的灰度直方图;按照预设的裁切比例值,对所述第一彩色图像的灰度直方图进行裁切通过预设公式计算灰度值在均衡化前后的映射关系,得到归一化后的灰度直方图;根据归一化之后的灰度直方图得到第二彩色图像。
进一步的,所述绘制第一彩色图像的灰度图像的灰度直方图,包括:统计第一彩色图像的灰度图像中每一个灰度值为k所对应的像素的个数n;根据每一个灰度值对应的像素个数绘制第一彩色图像的灰度图像的灰度直方图。
下面结合一具体实施场景描述步骤S3的具体实现过程,如图2所示,图1所示图像处理方法实施例中的步骤S3可以包括:
S201、获取第一彩色图像的灰度图像。
具体的,对任一彩色图像,可以通过灰度化的方式将其转化为灰度图像,将彩色图像灰度化可以采用如下公式为:
k=f(i,j)=0.30R(i,j)+0.59G(i,j)+0.11B(i,j)
其中,f(i,j)为灰度图像像素(i,j)的灰度值,,R(i,j)、G(i,j)、B(i,j)分别为彩色图像的红、绿、蓝色分量。
具体的,所述灰度值f(i,j)的取值为0-255,例如0、100、255。
S202、绘制第一彩色图像的灰度图像的灰度直方图。
优选的,绘制第一彩色图像的灰度图像的灰度直方图可以包括如下步骤:统计第一彩色图像的灰度图像中每一个灰度值为k所对应的像素的个数n;根据每一个灰度值对应的像素个数绘制第一彩色图像的灰度图像的灰度直方图。
具体的,灰度图像中每个像素都对应有一个灰度值,一个灰度图像中可能存在灰度值相同的等多个像素,因此,可以统计第一彩色图像的灰度图像中每一个灰度值为k所对应的像素的个数n。
需要说明的是,对于灰度图像,灰度直方图可以表示为:
P
r(r
k)=n
k/n k=0,1,2,,,,L-1
其中,n为第一彩色图像的灰度图像中的像素总数,L为灰度值的总数目,r
k表示第k级灰度值,n
k表示第k级灰度值的像素个数,P
r(r
k)表示该灰度值出现的频率,是对其出现概率的估计。
在直角坐标系中做出r
k与P
r(r
k)的关系图形,即为所述彩色图像的灰度图像的灰度直方图。所述灰度直方图的横坐标为灰度值k,纵坐标为每一个灰度值k所对应的像素个数在灰度图像总像素个数的概率P
r(r
k)。
S203、按照预设的裁切比例值,对所述第一彩色图像的灰度直方图进行裁切,通过预设公式计算灰度值在均衡化前后的映射关系,得到归一化后的灰度直方图。
本发明一实施例中,所述预设的裁切比例值可以是初始裁切比例值,例如可以为20%,所述灰度值为0-255,即L为256,所述按照预设的裁切比例值20%,对所述第一彩色图像的灰度图像进行裁切,裁切后的灰度值的范围为:(255+1)*20%-(255+1)*80%,即裁切后的 灰度值的范围为52-205,具体的,即去掉第一彩色图像的灰度图像中灰度值在52-205之外的所有像素。
优选的,在本发明的一些实施例中,通过预设公式计算灰度值在直方图均衡化处理前后的映射关系,得到归一化后的灰度直方图可以包括如下步骤:计算裁切后灰度直方图中每一个灰度值的像素个数在总像素个数中所对应的比例;对每一个比例值进行累加计算,得到新的比例值,绘制归一化的新的灰度直方图。
S204、根据归一化之后的灰度直方图得到第二彩色图像。
在本发明一些实施例中,如图3所示,上述实施例中步骤S4可以进一步包括:
S301、计算所述第二彩色图像的异常曝光率、剩余曝光能量、颜色指数。
具体的,所述计算所述第二彩色图像的异常曝光率、剩余曝光能量、颜色指数,可以包括:计算所述第二彩色图像的异常曝光率;计算所述第二彩色图像的剩余曝光能量;计算所述第二彩色图像的颜色指数。
其中,所述计算第二彩色图像的异常曝光率可以包括:确定所述第二彩色图像中灰度值大于第一预设值并符合预设细节丢失要求的像素的第一数量;确定所述第二彩色图像中灰度值小于第二第预设值并符合预设细节丢失要求的像素的第二数量;根据所述第一数量和所述第二数量统计所述第二彩色图像的异常曝光率。
其中,所述第一预设值为按照预设的裁切比例值对所述第一彩色图像的灰度图像进行裁切后的第一彩色图像的灰度图像中的灰度的最大值。
所述第二彩色图像中灰度值大于第一预设值并符合预设细节丢失要求的像素为:
I
W={I(i)/μ(i)>255×m∩α(i)<δ}
其中,I(i)为第一彩色图像中像素i的灰度值,μ(i)为第二彩色图像中像素i的灰度值,α(i)为所述第二彩色图像中像素i的方差,δ为所述第一彩色图像的像素的平均方差。
统计此时灰度值大于所述第一预设值的像素的个数N(I
W)。
确定所述第二彩色图像中灰度值小于第二第预设值并符合预设细节丢失要求的像素的第二数量;
其中,所述第一预设值为按照预设的裁切比例值对所述第一彩色图像的灰度图像进行裁切后的第一彩色图像的灰度图像中的灰度的最小值。
所述第二彩色图像中灰度值大于第一预设值并符合预设细节丢失要求的像素为:
I
b={I(i)/μ(i)<255×m∩α(i)<δ}
统计此时灰度值小于所述第二预设值的像素的个数N(I
b)。
其中,I(i)为第一彩色图像中像素i的灰度值,μ(i)为第二彩色图像中像素i的灰度值,α(i)为所述第二彩色图像中像素i的方差,δ为所述第一彩色图像的像素的平均方差。
在本发明一实施例中,所述预设的裁切比例值为10%,此时所述第一预设值为灰度值为255*90%,即灰度值为223;第二预设值为灰度值为255*10%,即灰度值为25。
在本发明其他实施例中,所述预设的裁切比例值还可以为20%,此时所述第一预设值为灰度值为255*80%,即灰度值为204;第二预设值为灰度值为255*20%,即灰度值为51。
需要说明的是,所述预设细节丢失的像素为:所述第二彩色图像中的任意像素的方差a(i)小于第一彩色图像的像素平均方差δ所对应的像素,即a(i)<δ。
优选的,在本发明的一些实施例中,计算所述异常曝光率可以采用如下计算公式:
E
x={N(I
W)+N(I
b)}/n
由于不正常的曝光会使得图像场景变得非常明亮或者黑暗,同时异常曝光会引起图像的细节丢失。异常曝光率代表图像中有多少比例的像素发生了异常曝光并丢失了细节,曝光率的值越大,表示图像的异常曝光越严重。
在本发明的一些实施例中,计算所述第二彩色图像的剩余曝光能量可以包括如下步骤:计算 所述第二彩色图像的剩余上曝光能量;计算所述第二彩色图像的剩余下曝光能量;根据所述剩余上曝光能量和所述剩余下曝光能量,计算所述第二彩色图像的剩余曝光能量。
其中,计算所述第二彩色图像的剩余上曝光能量可以采用如下公式:
需要说明的是,‖A‖为一个2次范函数,Energy
w表示在异常上曝光的像素中,像素灰度值相对白点即灰度值255的集中程度。Energy
w越大,表示异常上曝光的像素远离白点分布,剩余能量大;Energy
w越小,表示异常上曝光的像素靠近白点分布,剩余能量小。
所述计算所述第二彩色图像的剩余下曝光能量可以采用如下公式:
其中,Energy
b表示在异常下曝光的像素中,像素灰度值相对黑点0的集中程度。Energy
b越大,表示异常上曝光的像素远离黑点分布,剩余能量大;Energy
b越小,表示异常上曝光的像素靠近黑点分布,剩余能量小。
在本发明的一些实施例中,所述根据所述剩余上曝光能量和所述剩余下曝光能量,计算所述第二彩色图像的剩余曝光能量的计算公式可以为:
Energy=Energy
w+Energy
b
在本发明的一些实施例中,计算所述第二彩色图像的颜色指数C包括:计算所述第二彩色图像的红绿通道值和黄蓝通道值;根据红绿通道值和黄蓝通道值计算所述第二彩色图像的通道总均值和通道总方差;根据所述第二彩色图像的通道总均值和通道总方差计算所述颜色指数。优选的,在本发明的一些实施例中,计算第二彩色图像的红绿r
g通道值可以采用如下的计算公式:
r
g=R-G
计算第二彩色图像的黄蓝y
b通道值可以采用如下的计算公式:
y
b=(R+G)/2-B
计算所述第二彩色图像的通道总均值可以采用如下的计算公式:
其中μ
rg,μ
yb为所述第二彩色图像中红绿(r
g)和黄蓝(y
b)通道的均值。
计算所述第二彩色图像的通道总方差可以采用如下的计算公式:;
其中,σ
rg,σ
yb为所述第二彩色图像中红绿(r
g)和黄蓝(y
b)通道的方差。
在本发明的一些实施例中,根据第二彩色图像的通道总均值和通道总方差计算所述颜色指数C的可以采用如下的计算公式:
C=σ
c+c
c*μ
c
其中,c
c是一个系数常量,颜色指数C衡量的是彩色图像的色彩信息。
S302、根据所述异常曝光率、剩余曝光能量和颜色指数,计算所述第二彩色图像相对所述第一彩色图像的图像失真指数。
在本发明的一些实施例中,根据所述异常曝光率、剩余曝光能量和颜色指数,计算所述第二彩色图像相对所述第一彩色图像的图像失真指数index的计算公式为:
index=α
1*E
x+α
2*Energy+α
3*C
其中,index为所述第二彩色图像相对所述第一彩色图像的图像失真指数,E
x为所述第二彩色图像的异常曝光率、Energy为剩余曝光能量、C为颜色指数,所述α
1、α
2、α
3是常量系 数,分别为所述第二彩色图像的异常曝光率、剩余曝光能量、颜色指数的权重占比。
进一步的,本发明所提供的图像处理方法一实施例中,所述图像处理方法还可以包括:
当所述图像失真指数不小于预设定值时,重新设置新的裁切比例值,根据所述新的裁切比例值对所述第二彩色图像进行直方图均衡化处理,得到第三彩色图像,计算所述第三彩色图像相对于所述第一彩色图像的第三彩色图像失真指数,当所述第三彩色图像失真指数小于预设定值时,输出所述第三彩色图像。
优选的,在本发明的一些实施例中,所述设置新的裁切比例值的计算公式可以为:
Clip
j={(index
j-1-index
j-2)/(clip
j-1-clip
j-2)}*a
学习率+(clip
j-1-clip
j-2)/2
其中,所述a
学习率为学习率常量,j表示循环次数(即裁切比例值的调整次数)。若j=1,clip
j-1=clip
0,clip
j-2=0,index
j-1为最近一次计算得到的index,Clip
j-2=0。
本发明还提供一种图像处理装置400,如图4所示,本发明所提供的图像处理装置一实施例中包括:
第一获取单元401,用于获取第一彩色图像;
第二获取单元402,用于将获取预设的裁切比例值;
均衡化处理单元403,用于按所述裁切比例值对所述第一彩色图像进行直方图均衡化处理,得到第二彩色图像;
计算单元404,用于计算所述第二彩色图像相对所述第一彩色图像的图像失真指数;
输出单元405,用于当所述图像失真指数小于预设定值时,输出所述第二彩色图像。
本发明提供了一种图像处理装置,相对于现有技术,该图像处理装置可以计算第二彩色图像相对第一彩色图像的图像失真指数,实现了有效的自适应参数调节,使得直方图均衡化处理后的图像有了合理的曝光,能够展现更多的图像细节,减小色偏。
进一步的,所述输出单元405还用于:
当所述图像失真指数不小于预设定值时,重新设置新的裁切比例值,根据所述新的裁切比例值对所述第二彩色图像进行直方图均衡化处理,得到第三彩色图像,计算所述第三彩色图像相对于所述第一彩色图像的第三彩色图像失真指数,当所述第三彩色图像失真指数小于预设定值时,输出所述第三彩色图像。
进一步的,所述计算单元404具体用于:
计算所述第二彩色图像的异常曝光率、剩余曝光能量、颜色指数。
根据所述异常曝光率、剩余曝光能量和颜色指数,计算所述第二彩色图像相对所述第一彩色图像的图像失真指数。
进一步的,所述计算单元404具体用于:
计算所述第二彩色图像的异常曝光率;
计算所述第二彩色图像的剩余曝光能量;
计算所述第二彩色图像的颜色指数。
进一步的,所述计算单元404具体用于:
确定所述第二彩色图像中灰度值大于第一预设值并符合预设细节丢失要求的像素的第一数量;
确定所述第二彩色图像中灰度值小于第二第预设值并符合预设细节丢失要求的像素的第二数量:
根据所述第一数量和所述第二数量统计所述第二彩色图像的异常曝光率。
进一步的,所述计算单元404具体用于:
计算所述第二彩色图像的剩余上曝光能量;
计算所述第二彩色图像的剩余下曝光能量;
根据所述剩余上曝光能量和所述剩余下曝光能量,计算所述第二彩色图像的剩余曝光能量。
进一步的,所述计算单元404具体用于:
计算所述第二彩色图像的红绿通道值和黄蓝通道值;
根据红绿通道值和黄蓝通道值计算所述第二彩色图像的通道总均值和通道总方差;
根据所述第二彩色图像的通道总均值和通道总方差,计算所述第二彩色图像的颜色指数。
进一步的,所述计算单元404根据所述异常曝光率、剩余曝光能量和颜色指数,计算所述第二彩色图像相对所述第一彩色图像的图像失真指数,采用如下公式:
index=α
1*E
x+α
2*Energy+α
3*C
所述index为所述第二彩色图像相对所述第一彩色图像的图像失真指数,E
x为所述第二彩色图像的异常曝光率、Energy为剩余曝光能量、C为颜色指数,所述α
1、α
2、α
3是常量系数,分别为所述第二彩色图像的异常曝光率、剩余曝光能量、颜色指数的权重占比。
本发明还提供一种存储介质,所述存储介质存储有多条指令,所述指令适于处理器进行加载,以执行以上任一实施例中所述的图像处理方法中的步骤。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
综上所述,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。
Claims (20)
- 一种图像处理方法,其中,所述方法包括:获取第一彩色图像;获取预设的裁切比例值;按所述裁切比例值对所述第一彩色图像进行直方图均衡化处理,得到第二彩色图像;计算所述第二彩色图像相对于所述第一彩色图像的图像失真指数;当所述图像失真指数小于预设定值时,输出所述第二彩色图像。
- 如权利要求1所述的图像处理方法,其中,所述方法还包括:当所述图像失真指数不小于预设定值时,重新设置新的裁切比例值,根据所述新的裁切比例值对所述第二彩色图像进行直方图均衡化处理,得到第三彩色图像,计算所述第三彩色图像相对于所述第一彩色图像的第三彩色图像失真指数,当所述第三彩色图像失真指数小于预设定值时,输出所述第三彩色图像。
- 如权利要求1所述的图像处理方法,其中,所述计算所述第二彩色图像相对于所述第一彩色图像的图像失真指数,包括:计算所述第二彩色图像的异常曝光率、剩余曝光能量、颜色指数;根据所述异常曝光率、剩余曝光能量和颜色指数,计算所述第二彩色图像相对所述第一彩色图像的图像失真指数。
- 如权利要求3所述的图像处理方法,其中,所述计算所述第二彩色图像的异常曝光率、剩余曝光能量、颜色指数,包括:计算所述第二彩色图像的异常曝光率;计算所述第二彩色图像的剩余曝光能量;计算所述第二彩色图像的颜色指数。
- 如权利要求4所述的图像处理方法,其中,所述计算所述第二彩色图像的异常曝光率包括:确定所述第二彩色图像中灰度值大于第一预设值并符合预设细节丢失要求的像素的第一数量;确定所述第二彩色图像中灰度值小于第二第预设值并符合预设细节丢失要求的像素的第二数量;根据所述第一数量和所述第二数量统计所述第二彩色图像的异常曝光率。
- 如权利要求5所述的图像处理方法,其中,所述根据所述第一数量和所述第二数量统计所述第二彩色图像的异常曝光率的公式为:Ex={N(I W)+N(I b)}/n其中,N(I W)为第二彩色图像中灰度值大于第一预设值并符合预设细节丢失要求的像素的第一数量;N(I b)为所述第二彩色图像中灰度值小于第二第预设值并符合预设细节丢失要求的像素的第二数量;n为第一彩色图像的灰度图像中的像素总数。
- 如权利要求4所述的图像处理方法,其中,所述计算所述第二彩色图像的剩余曝光能量,包括:计算所述第二彩色图像的剩余上曝光能量;计算所述第二彩色图像的剩余下曝光能量;根据所述剩余上曝光能量和所述剩余下曝光能量,计算所述第二彩色 图像的剩余曝光能量。
- 如权利要求7所述的图像处理方法,其中,所述根据所述剩余上曝光能量和所述剩余下曝光能量,计算所述第二彩色图像的剩余曝光能量为:所述第二彩色图像的剩余曝光能量等于所述剩余上曝光能量和所述剩余下曝光能量的和。
- 如权利要求4所述的图像处理方法,其中,所述计算所述第二彩色图像的颜色指数,包括:计算所述第二彩色图像的红绿通道值和黄蓝通道值;根据红绿通道值和黄蓝通道值计算所述第二彩色图像的通道总均值和通道总方差;根据所述第二彩色图像的通道总均值和通道总方差,计算所述第二彩色图像的颜色指数。
- 如权利要求3所述的图像处理方法,其特征在于,所述根据所述异常曝光率、剩余曝光能量和颜色指数,计算所述第二彩色图像相对所述第一彩色图像的图像失真指数,采用如下公式:index=α 1*Ex+α 2*Energy+α 3*C所述index为所述第二彩色图像相对所述第一彩色图像的图像失真指数,E x为所述第二彩色图像的异常曝光率、Energy为剩余曝光能量、C为颜色指数,所述α 1、α 2、α 3是常量系数,分别为所述第二彩色图像的异常曝光率、剩余曝光能量、颜色指数的权重占比。
- 一种图像处理装置,其特征在于,所述装置包括:第一获取单元,用于获取第一彩色图像;第二获取单元,用于获取预设的裁切比例值;均衡化处理单元,用于按所述裁切比例值对所述第一彩色图像进行直方图均衡化处理,得到第二彩色图像;计算单元,用于计算所述第二彩色图像相对所述第一彩色图像的图像失真指数;输出单元,用于当所述图像失真指数小于预设定值时,输出所述第二彩色图像。
- 如权利要求11所述的图像处理装置,其中,所述计算单元具体用于:计算所述第二彩色图像的异常曝光率、剩余曝光能量、颜色指数。根据所述异常曝光率、剩余曝光能量和颜色指数,计算所述第二彩色图像相对所述第一彩色图像的图像失真指数。
- 如权利要求12所述的图像处理装置,其中,所述计算单元具体用于:计算所述第二彩色图像的异常曝光率;计算所述第二彩色图像的剩余曝光能量;计算所述第二彩色图像的颜色指数。
- 如权利要求13所述的图像处理装置,其中,所述计算单元具体用于:确定所述第二彩色图像中灰度值大于第一预设值并符合预设细节丢失要求的像素的第一数量;确定所述第二彩色图像中灰度值小于第二第预设值并符合预设细节丢失要求的像素的第二数量;根据所述第一数量和所述第二数量统计所述第二彩色图像的异常曝光率。
- 如权利要求14所述的图像处理装置,其中,所述计算单元采用如下公式计算异常曝光率:Ex={N(I W)+N(I b)}/n其中,N(I W)为第二彩色图像中灰度值大于第一预设值并符合预设细节丢失要求的像素的第一数量;N(I b)为所述第二彩色图像中灰度值小于第二第预设值并符合预设细节丢失要求的像素的第二数量;n为第一彩色图像的灰度图像中的像素总数。
- 如权利要求13所述的图像处理装置,其中,所述计算单元具体用于:计算所述第二彩色图像的剩余上曝光能量;计算所述第二彩色图像的剩余下曝光能量;根据所述剩余上曝光能量和所述剩余下曝光能量,计算所述第二彩色图像的剩余曝光能量。
- 如权利要求16所述的图像处理装置,其中,所述计算单元采用如下公式计算剩余曝光能量:所述第二彩色图像的剩余曝光能量等于所述剩余上曝光能量和所述剩余下曝光能量的和。
- 如权利要求13所述的图像处理装置,其中,所述计算单元具体 用于:计算所述第二彩色图像的红绿通道值和黄蓝通道值;根据红绿通道值和黄蓝通道值计算所述第二彩色图像的通道总均值和通道总方差;根据所述第二彩色图像的通道总均值和通道总方差,计算所述第二彩色图像的颜色指数。
- 如权利要求11所述的图像处理装置,其中,所述计算单元采用如下公式计算所述第二彩色图像相对所述第一彩色图像的图像失真指数:index=α 1*Ex+α 2*Energy+α 3*C所述index为所述第二彩色图像相对所述第一彩色图像的图像失真指数,E x为所述第二彩色图像的异常曝光率、Energy为剩余曝光能量、C为颜色指数,所述α 1、α 2、α 3是常量系数,分别为所述第二彩色图像的异常曝光率、剩余曝光能量、颜色指数的权重占比。
- 一种存储介质,其特征在于,所述存储介质存储有多条指令,所述指令适于处理器进行加载,以执行权利要求1所述的图像处理方法中的步骤。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910205016.9 | 2019-03-18 | ||
| CN201910205016.9A CN110009581B (zh) | 2019-03-18 | 2019-03-18 | 图像处理方法、装置及存储介质 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2020186590A1 true WO2020186590A1 (zh) | 2020-09-24 |
Family
ID=67167298
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2019/083478 Ceased WO2020186590A1 (zh) | 2019-03-18 | 2019-04-19 | 图像处理方法、装置及存储介质 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN110009581B (zh) |
| WO (1) | WO2020186590A1 (zh) |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20070165947A1 (en) * | 2006-01-16 | 2007-07-19 | Paik Joon-Ki | Image processing method and system using gain controllable clipped histogram equalization |
| CN107038699A (zh) * | 2016-11-09 | 2017-08-11 | 重庆医科大学 | 增强图像失真率检测方法 |
| CN107481202A (zh) * | 2017-08-14 | 2017-12-15 | 深圳市华星光电半导体显示技术有限公司 | 一种图像动态范围增强的方法 |
| CN109191394A (zh) * | 2018-08-17 | 2019-01-11 | 京东方科技集团股份有限公司 | 一种图像增强的方法、装置、可读存储介质和计算机设备 |
| CN109472759A (zh) * | 2018-11-23 | 2019-03-15 | 中国科学院长春光学精密机械与物理研究所 | 一种自适应图像增强的方法、装置、设备以及存储介质 |
Family Cites Families (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101668226B (zh) * | 2009-09-11 | 2011-05-04 | 重庆医科大学 | 获取质量最好彩色图像的方法 |
| CN103353982B (zh) * | 2013-05-15 | 2016-03-09 | 中山大学 | 一种基于直方图均衡化的色调映射方法 |
| CN103606137B (zh) * | 2013-11-13 | 2016-04-13 | 天津大学 | 保持背景和细节信息的直方图均衡化方法 |
| CN104463196B (zh) * | 2014-11-11 | 2017-07-25 | 中国人民解放军理工大学 | 一种基于视频的天气现象识别方法 |
| WO2017132858A1 (en) * | 2016-02-03 | 2017-08-10 | Chongqing University Of Posts And Telecommunications | Methods, systems, and media for image processing |
| CN107833189A (zh) * | 2017-10-30 | 2018-03-23 | 常州工学院 | 对比受限自适应直方图均衡的水下目标探测图像增强方法 |
-
2019
- 2019-03-18 CN CN201910205016.9A patent/CN110009581B/zh active Active
- 2019-04-19 WO PCT/CN2019/083478 patent/WO2020186590A1/zh not_active Ceased
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20070165947A1 (en) * | 2006-01-16 | 2007-07-19 | Paik Joon-Ki | Image processing method and system using gain controllable clipped histogram equalization |
| CN107038699A (zh) * | 2016-11-09 | 2017-08-11 | 重庆医科大学 | 增强图像失真率检测方法 |
| CN107481202A (zh) * | 2017-08-14 | 2017-12-15 | 深圳市华星光电半导体显示技术有限公司 | 一种图像动态范围增强的方法 |
| CN109191394A (zh) * | 2018-08-17 | 2019-01-11 | 京东方科技集团股份有限公司 | 一种图像增强的方法、装置、可读存储介质和计算机设备 |
| CN109472759A (zh) * | 2018-11-23 | 2019-03-15 | 中国科学院长春光学精密机械与物理研究所 | 一种自适应图像增强的方法、装置、设备以及存储介质 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN110009581A (zh) | 2019-07-12 |
| CN110009581B (zh) | 2021-02-02 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN106886985B (zh) | 一种减小色偏的自适应低照度图像增强方法 | |
| US9538093B2 (en) | Forming high-dynamic-range (HDR) images using single-channel data | |
| CN107680056B (zh) | 一种图像处理方法及装置 | |
| CN112565636B (zh) | 图像处理方法、装置、设备和存储介质 | |
| CN109686342B (zh) | 一种图像处理方法及装置 | |
| WO2022116988A1 (zh) | 图像处理方法、装置、设备和存储介质 | |
| WO2021218603A1 (zh) | 图像处理方法及投影系统 | |
| US9532023B2 (en) | Color reproduction of display camera system | |
| WO2017049703A1 (zh) | 图像对比度增强方法 | |
| CN103973941B (zh) | 数码影像的动态对比度调整方法和系统 | |
| CN110852956A (zh) | 一种高动态范围图像的增强方法 | |
| CN110111269B (zh) | 基于多尺度上下文聚合网络的低照度成像算法及装置 | |
| CN102339461A (zh) | 图像增强方法和设备 | |
| CN108198155A (zh) | 一种自适用色调映射方法及系统 | |
| CN110163807B (zh) | 一种基于期望亮通道的低照度图像增强方法 | |
| CN103826113A (zh) | 一种色彩还原方法及装置 | |
| CN114998122A (zh) | 一种低照度图像增强方法 | |
| CN111192205A (zh) | 一种图像去雾方法、系统和计算机可读存储介质 | |
| CN108564633A (zh) | 灰度图像压缩方法、装置及计算机设备 | |
| CN110570384A (zh) | 一种对场景图像进行光照均衡处理的方法、装置、计算机设备以及计算机存储介质 | |
| CN115696027A (zh) | 拍摄方法、装置、控制器、设备和计算机可读存储介质 | |
| WO2020107646A1 (zh) | 图像处理方法 | |
| WO2020118902A1 (zh) | 图像处理方法及图像处理系统 | |
| CN115619667B (zh) | 低照度图像增强方法、装置及图像处理设备 | |
| CN116366987A (zh) | 一种视频中图像的处理方法和装置 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 19919813 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 19919813 Country of ref document: EP Kind code of ref document: A1 |