CN112561829B - Multi-region non-uniform brightness distortion correction algorithm based on L-channel Gamma transformation - Google Patents

Multi-region non-uniform brightness distortion correction algorithm based on L-channel Gamma transformation Download PDF

Info

Publication number
CN112561829B
CN112561829B CN202011536064.5A CN202011536064A CN112561829B CN 112561829 B CN112561829 B CN 112561829B CN 202011536064 A CN202011536064 A CN 202011536064A CN 112561829 B CN112561829 B CN 112561829B
Authority
CN
China
Prior art keywords
image
brightness
image module
channel
reticle
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
CN202011536064.5A
Other languages
Chinese (zh)
Other versions
CN112561829A (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.)
Northwestern Polytechnical University
Original Assignee
Northwestern Polytechnical University
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 Northwestern Polytechnical University filed Critical Northwestern Polytechnical University
Priority to CN202011536064.5A priority Critical patent/CN112561829B/en
Publication of CN112561829A publication Critical patent/CN112561829A/en
Application granted granted Critical
Publication of CN112561829B publication Critical patent/CN112561829B/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
    • G06T5/92Dynamic range modification of images or parts thereof based on global image properties
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10024Color image

Landscapes

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

Abstract

The invention provides a multi-region non-uniform brightness distortion correction algorithm based on L-channel Gamma transformation, which is characterized in that a plurality of typical image modules are set, a color reticle image to be processed is divided into a plurality of regions, and brightness similarity matching between each region image and the typical image module is realized, so that corresponding optimal brightness correction parameters are obtained, and brightness correction conforming to respective conditions is completed. The method for converting the image into the LAB color space and correcting the LAB color space in the brightness L channel effectively reduces the complexity of model processing and improves the instantaneity, the robustness and the accuracy of system processing.

Description

Multi-region non-uniform brightness distortion correction algorithm based on L-channel Gamma transformation
Technical Field
The present invention relates to an image processing technology, and more particularly, to processing a luminance-distorted image.
Background
In many technologies such as image enhancement and object detection, illumination effects have been an important concern. In the image acquisition process, the whole illumination of the image is uneven due to the change of the imaging environment or the uneven smoothness of the surface of the object, so that bright spots and dark spots with different degrees appear, and the local detail information in the image is difficult to recognize. The image illumination unevenness is specifically expressed as: (1) The overall brightness of the image is low, and the image is commonly found in night images, infrared images and the like; (2) Some areas of the image have lower brightness and some areas have higher brightness, and the brightness is mainly caused by uneven illumination or local structural characteristics of the surface of an object; (3) The image is subjected to high light phenomena such as overexposure of the camera. The original appearance of the image is changed due to uneven brightness of the image, and the difficulty of further processing the image is increased. It is therefore desirable to improve the overall quality of the luminance distorted image, i.e. to pre-process the image, before applying the image.
Common processing methods include histogram equalization, homomorphic filtering based on illumination-reflection models, gradient domain transformation, and Gamma transformation. Histogram equalization has a certain practical value for images with too bright or too dark background and foreground, but has the disadvantage that the processed data is not selected, so that the contrast of the background area may be increased or the contrast of useful signals may be reduced finally; the homomorphic filtering method based on the illumination-reflection imaging principle can retain part of low-frequency information while enhancing the high-frequency information of the image, so as to achieve the effects of compressing the dynamic range of the gray scale of the image and enhancing the contrast of the image, but when the brightness value of a certain part of pixels of the image is enhanced, the brightness value of the other part of pixels is easy to be excessively enhanced; the gradient domain transformation method can well keep detailed information and layering sense in the original image, but can sharpen the image to a certain extent. The Gamma conversion can effectively weaken the influence of illumination and improve the quality of images by selecting proper Gamma values under unknown illumination conditions.
The current Gamma transformation method is divided into a linear correction method and a nonlinear correction method. The linear correction method can only realize the change of Gamma conversion intensity along with the brightness of the pixel to a certain extent, overcomes the defect that the traditional Gamma conversion method can not meet the brightness correction problem of concurrent image highlighting and shadow areas, and still has some defects: firstly, linear correction is adopted for Gamma values, and the capability of effectively enhancing the change of the Gamma values along with the brightness values of pixels is lacking; secondly, the actual problem of illumination change of highlight, transition and shadow areas in the image is not well solved by selecting Gamma values; finally, the image is slightly distorted after Gamma transformation, and especially the distortion effect on the color image is obvious. The nonlinear correction method adopts a correction mode that nonlinear functions are mutually overlapped, but the correction model is too complex, the calculation complexity is high, and the realization is not facilitated.
The collimator is an optical tool commonly used in the correction process, and because the collimator reticle area is smaller, the coordinate resolution displayed on the collimator reticle is limited, the observation is inconvenient, the human eye is easy to fatigue, and the realization of the digitization of the collimator reticle coordinate system is the basis for realizing intelligent, convenient and more accurate optical measurement. The collimator reticle coordinate system digitization refers to: and photographing the reticle on which the reticle grid and the coordinate scale are displayed, identifying the reticle grid and the coordinate scale according to the photographed image, and generating the digital grid line and the coordinate scale which are strictly corresponding to the reticle grid and the coordinate scale. The reticle coordinate system converted into the digital image can be flexibly scaled, so that the coordinate precision is further improved, the observation by human eyes is easy, the operation function is greatly improved, and the intelligent level is greatly improved. In this process, the main problems encountered are: the reticle with the reticle grid and the coordinate scale can have bright areas or dark areas with light or heavy or different brightness degrees, the overall brightness of the reticle plane also changes at different moments, in addition, when the reticle is photographed, the influence of ambient light is inevitably introduced for the second time, so that when the reticle coordinate system is digitalized, the brightness of the reticle image obtained at different moments is uneven, and the brightness of a plurality of areas on the same image is different, the interference of the brightness changes has very adverse influence on the identification of the reticle grid and the coordinate scale, and the correct generation of the final digital reticle coordinate system is influenced.
Disclosure of Invention
In order to overcome the defects of the prior art, the invention provides a multi-region non-uniform brightness distortion correction algorithm based on L-channel Gamma transformation, which has reasonable correction model and high instantaneity, can eliminate the interference of illumination change on the basis of nonlinear Gamma transformation, and adaptively corrects different brightness distortion conditions, thereby improving the image quality.
The technical scheme adopted by the invention for solving the technical problems comprises the following steps:
step one, mapping a color collimator reticle image from an RGB color space to an LAB color space;
step two, according to the brightness distribution characteristics of the reticle image, four typical brightness levels are analyzed and defined, wherein the four typical brightness levels comprise a normal image module, an excessively dark image module, an excessively bright image module and a bright-dark transition image module;
step three, correcting the function for the over-dark image moduleWherein m is 1 E (0, 1) is the adjustment coefficient, r 01 The brightness threshold value is corrected for the over-dark image module, and r is the brightness value before transformation; auxiliary function->n d E (0, 1) is an adjustment coefficient; gamma transformation function of excessively dark image module
Correction function for over-bright image moduleWherein m is 2 E (0, 1) is the adjustment coefficient, r 02 For correcting the brightness threshold of an excessively bright image module, an auxiliary function +.>n h E (0, 1) is an adjustment coefficient; excessively bright image module Gamma transformation function +.>
For a light-dark transition image module, correction functionsWherein the auxiliary function->Parameter ρ ε (0, 1), θ=arctan (-2 n) t ),n t For adjusting the coefficients, the Gamma transformation function of the light-dark transition image module>
Mapping the color collimator reticle image to be processed from an RGB color space to an LAB color space, dividing an L-channel image into a plurality of areas, performing optimal brightness similarity matching between each area and all typical image modules, and performing brightness correction on the areas by using Gamma transformation functions of the most matched typical image modules;
and fifthly, restoring the reticle image corrected with the L-channel image from the LAB color space to the RGB color space.
In the first step, the values of pixels of each of the R, G, B channels of the color collimator reticle image are r ', g ', b ', respectively, so as to construct three temporary variablesLet the pixel values of the three L, A, B channels be l ', a ', t ', and use X, Y, Z to solve the parameter values of the pixels in the LAB color spaceWherein (1)>
Selecting a certain area I on the reticle L channel image, and calculating the average brightness L of the area; taking a dividing grid and a coordinate scale as foreground pixels and the rest as background pixels, calculating the average brightness value of the corresponding positions of the background pixels on the L-channel image and the average brightness value of the corresponding positions of the foreground pixels on the L-channel image to obtain the average brightness difference of the background pixels and the foreground pixelsSetting an average brightness difference threshold a, an average brightness lower limit threshold b and an average brightness upper limit threshold c;
will satisfyAnd l is<b is defined as an excessively dark image module, namely a low-brightness area with unclear display of a dividing grid and a coordinate scale;
will satisfyAnd l is>c, defining an area as an over-bright image module, namely a high-brightness area with unclear display of a dividing grid and a coordinate scale;
will satisfyThe area b is less than or equal to l and less than or equal to c defines a bright-dark transition image module, namely a dividing line grid and a coordinate scale display unclear high-low brightness gradual change area;
will satisfyAnd the area b is less than or equal to l is less than or equal to c is defined as a normal image module, namely a clear normal brightness area is displayed by the dividing line grid and the coordinate scale.
Selecting a certain area I on the reticle L channel image, and calculating to obtain a binarized imaged is a set threshold, wherein the value is 1, namely a background pixel, and the value is 0, namely a foreground pixel.
In the third step, m 1 Taken as 0.2, r 01 Taken as 0.3, n d Taken as 0.7, m 2 Taken as 0.2, r 02 Taken as 0.7, n h Taken as 0.1, n t Taken as 0.3 and ρ as 0.1.
Dividing the L channel image into a plurality of areas; defining the luminance similarity of two imagesU isBrightness matrix of certain area on L channel image of to-be-processed reticle, V i And representing a brightness matrix of an L-channel image of a certain typical image module, wherein element values in the matrix are corresponding pixel values in the L-channel image, wherein subscript i represents an over-dark image module, i represents an over-bright image module, i represents a bright-dark transition image module, t represents a bright-dark transition image module, and i represents a normal image module.
In the fifth step, the brightness value of the pixels of the reticle image L, A, B channel after the L-channel image is corrected is L * 、a * 、t * After being converted back into RGB color space, the corresponding pixel brightness value of R, G, B channel is r * 、g * 、b * ,X * 、Y * 、Z * As a temporary variable, a set of variables,
wherein,
the beneficial effects of the invention are as follows: the overall brightness of the collimator reticle images at different moments is changed, especially bright areas or dark areas with different brightness degrees appear on the images at certain moments, and the traditional Gamma transformation is not strong in robustness of brightness correction for the whole image, so that the brightness distortion phenomenon of the reticle images can not be solved. The invention provides an effective multi-region non-uniform brightness distortion correction algorithm based on the traditional Gamma transformation. The algorithm reasonably designs four typical image modules according to different brightness conditions, and independently trains the Gamma transformation parameters of the four typical image modules, thereby laying a foundation for automatic classification and correction of brightness; the brightness channel image of the to-be-processed reticle image is divided into a plurality of areas, and the optimal brightness correction parameters matched with the areas are obtained according to the brightness similarity through a similarity measurement mechanism, so that the correction robustness and accuracy are improved. The invention can be widely applied to various fields related to the uneven illumination processing of images.
Drawings
FIG. 1 is a schematic view of a collimator reticle and its various light and dark areas distributed thereon;
FIG. 2 is a schematic diagram of Gamma transformation of an over-dark image module;
FIG. 3 is a schematic diagram of the Gamma transformation of the over-bright image module;
FIG. 4 is a schematic diagram of a Gamma transformation of a light-dark transition image module;
in the figure, 1-overdue area; 2-an over-bright area; 3-light-dark transition region; 4-normal region (other region than 1-3 region); r-transforming the pre-luminance value; s-transformed luminance values.
Detailed Description
The invention will be further illustrated with reference to the following figures and examples, which include but are not limited to the following examples.
The invention provides an image quality improvement algorithm for eliminating the phenomenon of uneven brightness of multiple areas of a color reticle image. The algorithm provides the concept of a typical image module, designs a brightness similarity measurement index, and on the basis, divides the color reticle image to be processed into a plurality of areas to realize automatic matching of brightness similarity between the images of each area and the typical image module, thereby obtaining corresponding optimal brightness correction parameters and completing brightness correction conforming to respective conditions. The method for converting the image into the LAB color space and correcting the LAB color space in the brightness L channel effectively reduces the complexity of model processing and improves the real-time performance, the robustness and the accuracy of system processing.
The technical scheme of the invention is as follows: mapping the color collimator reticle image from the RGB color space to the LAB color space, storing L, A, B channel values of all pixels of each, and independently extracting an L-channel image displayed in a gray scale form; according to the brightness distribution characteristics of the L-channel image, four typical image modules, namely a normal image module, an excessively bright image module, an excessively dark image module, a bright-dark transition image module and the like, are designed; performing linear or nonlinear Gamma transformation of different parameters on the L-channel image of each typical image module to make the dividing line grid and the coordinate scale of the L-channel image clear, acquiring correction parameters and storing the correction parameters as a typical brightness correction parameter set; dividing a color reticle image to be processed into a plurality of areas, matching the most similar typical image modules for each area through a similarity measurement mechanism, obtaining a corresponding brightness correction parameter set, and completing optimal brightness correction; and after brightness correction is completed in all the areas, restoring the color reticle image to be processed to an RGB color space, and providing a high-quality image with uniform brightness for the subsequent identification of the reticle grid and the coordinate scale. The method comprises the following specific steps:
step one, mapping a color collimator reticle image from an RGB color space to a LAB color space.
Due to the differences of the parallel light sources of the collimator and the influence of the surrounding environment when photographing the reticle, the imaging effect of the reticle is different each time, including different bright and dark areas and different bright and dark degrees, as shown in fig. 1. In areas of too high or too low brightness, the reticle grid and the coordinate scale are not clear enough and subsequent identification becomes difficult, thus requiring correction of brightness.
Under the RGB color space, different illumination can influence the pixel values of the R, G, B three channels, and the difficulty is brought to the overall illumination processing. In contrast to the RGB color space, the LAB color space is a device independent color system, where the L-channel represents pixel brightness, the a-channel represents the range from red to green, the B-channel represents the range from yellow to blue, and different illumination affects only the L-channel value of the image and not the other two channels. The image is mapped to the LAB color space, so that the brightness can be independently corrected, and the problem of image quality caused by illumination interference can be solved.
The method of mapping an image from an RGB color space to a LAB color space is as follows:
(1) Let R, G, B be r ', g ', b ' for each pixel value of three channels, construct three temporary variables X, Y, Z:
(2) Let the pixel values of the three channels L, A, B be l ', a ', t ', and use X, Y, Z to solve the parameter values of the pixels in the LAB color space:
wherein,
and step two, defining a typical image module according to the L-channel image.
According to the brightness distribution characteristics of the reticle images under different external environments or different light sources, four typical brightness levels are analyzed and defined, and are represented by four typical image modules respectively, namely: a normal image module, an over-dark image module, an over-bright image module and a bright-dark transition image module. The four image modules are 64×64 in pixels, and the size can be adjusted according to practical situations. In the latter three image modules, there is a phenomenon that the division line grid and the coordinate scale are not clear due to brightness distortion. Based on these features, four representative image modules are selectively defined as follows.
A certain region I is selected on the existing reticle L-channel image, with a size of 64×64, in pixels:
(1) Calculate the average luminance of the region/:
where j is the row number of the region I image and k is its column number.
(2) And binarizing the region I image, and calculating the average brightness difference between the dividing line grid and the background image and between the coordinate scale and the background image. The binarized image I' is calculated from equation (5):
wherein 1 is a background pixel; and 0 is a foreground pixel, namely a dividing grid and a coordinate scale pixel.
Calculating the average value L of the brightness of the corresponding position of the background pixel on the L-channel image by using the formula (4) b And the average value L of the brightness of the corresponding position of the foreground pixel on the L-channel image f Obtaining the average brightness difference between background pixels and foreground pixels
When (when)At this time, the reticle grid and the coordinate scale are displayed unclear.
(3) The area I satisfying the following different conditions is found and defined as the corresponding typical image module.
Will satisfyAnd l is<40 is defined as an excessively dark image module, i.e. a low-brightness area where the reticle grid and the coordinate scale are not clearly displayed;
will satisfyAnd l is>The area 84 is defined as the over-bright image module, i.e. the area where the division line grid and the coordinate scale display are not clear and high-brightness;
will satisfyAnd the area with l being more than or equal to 40 and less than or equal to 83 defines the bright-dark transitionThe image module, namely the dividing grid and the coordinate scale display unclear high-low brightness gradual change areas;
will satisfyAnd the area with l being more than or equal to 40 and less than or equal to 83 is defined as a normal image module, namely a clear normal brightness area is displayed by the dividing line grid and the coordinate scale.
In view of l<40 is an excessively dark region, l>84 is an excessively bright region, where grid lines are not clear, and cannot occurThus, l<40 and->Or l>84 and->For the rare occurrence of the state, it is not representative, and is not selected as a typical image module.
And thirdly, performing Gamma transformation on the L-channel images of the over-dark image module, the over-bright image module and the bright-dark transition image module respectively to enable the dividing line grids and the coordinate scales to be clear.
The L-channel (i.e., luminance channel) image of the LAB color space is displayed as a gray scale image, having a size of 64 pixels×64 pixels. The Gamma transformation basic form is:
where c is a positive constant, typically 0.5.r is the luminance value before transformation, s is the luminance value after transformation, α (r) is the power exponent associated with the pixel value, γ (r) is the correction function, and α (r) is the reciprocal, and typical values of γ (r) are:
wherein m is an adjustment coefficient, r 0 Is the corrected luminance threshold. In the aspect of control of brightness correction effect, only increasing m is used for expanding the value range of gamma (r), which can cause that the amplitude change rate of gamma (r) in the value range is overlarge, namely that the unit brightness change causes overlarge amplitude change of gamma (r), so that the value change of alpha (r) is severe, and finally, the corrected image is obviously distorted. To solve this problem, the present patent expands γ (r) to γ' (r) where α (r) is:
gamma' (r) consists of gamma (r) superimposed by an auxiliary function f (r), f (r) consisting of one or several linear or nonlinear functions. The following discusses the strategy of Gamma transformation of the L-channel images of the four exemplary image modules, respectively.
(1) Excessively dark image module
The brightness value of the pixels in the over-dark image module is low, the brightness value needs to be increased through Gamma transformation, and the form of the correction function Gamma (r) is taken as follows:
m 1 for adjustment coefficients, a typical value is 0.2; r is (r) 01 For a corrected luminance threshold of an excessively dark image module, a typical value is 0.3. The invention transforms [0, r ] by Gamma 01 ]The brightness value in the narrower range is expanded to a large brightness range, the brightness of the image is improved, and meanwhile, the contrast is stretched, so that the aim of making the dividing grid and the coordinate scale clear is fulfilled. Since the correction range is limited to 0, r 01 ]The brightness is in an increasing trend, and only the correction amplitude is different, so the auxiliary function f (r) uses the following linear function form:
wherein n is d For adjustment of the coefficients, a typical value is 0.7.
Thereby obtaining the Gamma transformation function of the excessively dark image module:
the module typically has a luminance correction parameter set PS d Is { m } 1 ,r 01 ,n d Typical values are 0.2,0.3,0.7, and a correction function curve is shown in FIG. 2. After correction, the average brightness/and average brightness difference of the imageAll enter the range of the normal image module, and the dividing grid and the coordinate scale can be clearly displayed.
(2) Over-bright image module
In the over-bright image module, the unclear division line grid and coordinate scale is due to the influence of the over-high brightness value, and the brightness value needs to be reduced through Gamma transformation. To achieve this, the correction function γ (r) is now in the form of:
m 2 for adjustment coefficients, a typical value is 0.2; r is (r) 02 For the corrected luminance threshold of the over-bright image module, the typical value is 0.7. At this time, the auxiliary function f (r) in the over-bright image module uses the following linear function form:
wherein n is h For adjustment of the coefficients, a typical value is 0.1.
Thereby obtaining the Gamma transformation of the over-bright image module:
the module typically has a luminance correction parameter set PS h Is { m } 2 ,r 02 ,n h Typical values are {0.2,0.7,0.1}. A schematic diagram of the correction function is shown in FIG. 3. After correction, the average brightness/and average brightness difference of the imageAll enter the range of the normal image module, and the dividing grid and the coordinate scale can be clearly displayed.
(3) Bright-dark transition image module
Under the actual illumination condition, a bright-dark transition region between a highlight and a shadow always exists in an image, the definition of a dividing grid and a coordinate scale in the region is poor, and in order to solve the problem and the natural transition of brightness at the junction of the excessively dark region and the excessively bright region, the self-adaptive strategy of different correction forces is adopted in a bright-dark transition image module: for pixels with brightness distributed in the middle area of the module, the brightness correction strength is weak; the brightness distribution is close to the pixels at two ends, and the brightness correction force is enhanced. The correction function γ (r) is then in the form of:
m 1 and m 2 For the adjustment factor, the typical values are all 0.2; r is (r) 01 And r 02 The corrected luminance threshold values for the too dark image module and the too bright module are respectively, and typical values are respectively 0.3 and 0.7.
The auxiliary function f (r) is designed as a nonlinear function as follows:
wherein θ=arctan (-2 n) t ),n t For the adjustment of the coefficients, a typical value is taken to be 0.3. The introduction of a parameter ρThe purpose is to make the correction effect of pixel brightness weak in middle brightness correction and strong in both ends brightness correction when correcting the auxiliary function f (r), and ρ is typically 0.1.
Thereby obtaining the Gamma transformation function of the bright-dark transition image module:
wherein:
θ=arctan(-2n t ) (20)
the module typically has a luminance correction parameter set PS t Is { m } 1 ,m 2 ,r 01 ,r 02 ,n t ρ, typical value is 0.2,0.2,0.3,0.7,0.3,0.1, and the calibration curve is shown in FIG. 4. After correction, the average brightness/and average brightness difference of the imageAll enter the range of the normal image module, and the dividing grid and the coordinate scale can be clearly displayed.
The dividing grid and the coordinate scale in the normal image module can be clearly displayed without Gamma transformation, namely s=r.
And step four, calculating the maximum brightness similarity of each region on the L channel image of the reticle to be processed, and carrying out self-adaptive brightness correction.
Mapping the color collimator reticle image to be processed from an RGB color space to an LAB color space, dividing the L-channel image into a plurality of areas, performing optimal brightness similarity matching between each area and all typical image modules, obtaining corresponding typical brightness correction parameters, and performing brightness correction. The method comprises the following steps:
with horizontal parallel lines and dips at intervals of size (typically 64 in pixels)Straight parallel lines divide the L-channel image into a plurality of square regions. Near the image boundary, when the residual region is less than size, the boundary becomes an independent region. Defining a measure of similarity of the brightness of two images, i.e. brightness similarity S i (U,V i ):
Wherein U is the brightness matrix of a certain area on the L channel image of the reticle to be processed, V i The brightness matrix of the L channel image of a typical image module is represented, the brightness matrix is 64 multiplied by 64, and the element values in the matrix are the corresponding pixel values in the L channel image. Wherein the subscript i is d times of over-dark image modules, i is h times of over-bright image modules, i is t times of bright-dark transition image modules, and i is n times of normal image modules. S is S i (U,V i ) The larger indicates the higher the similarity of both, i.e., the closer the luminance distribution.
Respectively calculating the brightness similarity S of a certain area and the L channel images of four typical image modules according to a formula (21) i (U,V i ) And acquiring a brightness correction parameter set of the typical image module according to the i value corresponding to the maximum brightness similarity value, and finishing brightness correction of the area of the L channel image of the reticle to be processed according to the parameter.
And traversing all N areas of the L-channel image of the reticle to be processed, and completing the self-adaptive brightness correction of the whole image.
And fifthly, restoring the reticle image corrected with the L-channel image from the LAB color space to the RGB color space.
In order to enable the corrected image to be displayed normally on the display, the RGB color mode adopted by the current display converts the brightness corrected reticle image from the LAB color space back to the RGB color space. Let the luminance value of L, A, B channel pixel in LAB color space be l * 、a * 、t * After being converted back into RGB color space, the corresponding pixel brightness value of R, G, B channel is r * 、g * 、b * ,X * 、Y * 、Z * As a temporary variable, the following transformation formula is provided:
wherein,
thus, a complete and uniform-brightness reticle image is obtained, and the reticle grids and scales of the over-dark area, the over-bright area and the bright-dark transition area in the original image are simultaneously and clearly displayed, so that a high-quality image is provided for the subsequent identification of the reticle grids and coordinate scales.
In the example of the present invention, the non-uniform illumination processing algorithm for the Gamma transformation of the image L channel includes the following steps.
Step one, mapping a color collimator reticle image from an RGB color space to a LAB color space.
The method of mapping an image from an RGB color space to a LAB color space is as follows:
(1) Let R, G, B be r ', g ', b ' for each pixel value of three channels, construct three temporary variables X, Y, Z:
(2) Let the pixel values of the three channels L, A, B be l ', a ', t ', and use X, Y, Z to solve the parameter values of the pixels in the LAB color space:
wherein,
and step two, defining a typical image module according to the L-channel image.
According to the brightness distribution characteristics of the reticle images under different external environments or different light sources, four typical brightness levels are analyzed and defined, and the four typical brightness levels are represented by four typical image modules respectively: a normal image module, an over-dark image module, an over-bright image module and a bright-dark transition image module. The four image modules are 64×64 in pixels, and the size can be adjusted according to practical situations. Four typical image modules are selectively defined according to the following steps:
a certain region I is selected on the existing reticle L-channel image, with a size of 64×64, in pixels:
(1) Calculate the average luminance of the region/:
where j is the row number of the region I image and k is its column number.
(2) And binarizing the region I image, and calculating the average brightness difference between the dividing line grid and the background image and between the coordinate scale and the background image. The binarized image I' is calculated from equation (29):
wherein 1 is a background pixel; and 0 is a foreground pixel, namely a dividing grid and a coordinate scale pixel.
Calculating the average value L of the brightness of the corresponding position of the background pixel on the L-channel image by using the formula (28) b And the average value L of the brightness of the corresponding position of the foreground pixel on the L-channel image f Obtaining the backgroundAverage luminance difference between pixel and foreground pixel
When (when)At this time, the reticle grid and the coordinate scale are displayed unclear.
(3) The area I satisfying the following different conditions is found and defined as the corresponding typical image module.
Will satisfyAnd l is<40 is defined as an excessively dark image module, i.e. a low-brightness area where the reticle grid and the coordinate scale are not clearly displayed;
will satisfyAnd l is>The area 84 is defined as the over-bright image module, i.e. the area where the division line grid and the coordinate scale display are not clear and high-brightness;
will satisfyThe area with l being more than or equal to 40 and less than or equal to 83 defines a bright-dark transition image module, namely a dividing line grid and a coordinate scale display unclear high-low brightness gradual change area;
will satisfyAnd the area with l being more than or equal to 40 and less than or equal to 83 is defined as a normal image module, namely a clear normal brightness area is displayed by the dividing line grid and the coordinate scale. />
And thirdly, performing Gamma transformation on the L-channel images of the over-dark image module, the over-bright image module and the bright-dark transition image module respectively to enable the dividing grid and the coordinate scale to be clearly identifiable. Wherein:
(1) The Gamma transformation function of the over-dark image module is:
the module typically has a luminance correction parameter set PS d Is { m } 1 ,r 01 ,n d Typical values are {0.2,0.3,0.7}.
(2) The Gamma transformation function of the over-bright image module is as follows:
the module typically has a luminance correction parameter set PS h Is { m } 2 ,r 02 ,n h Typical values are {0.2,0.7,0.1}.
(3) The Gamma transformation function of the bright-dark transition image module is as follows:
wherein:
θ=arctan(-2n t ) (35)
the module typically has a luminance correction parameter set PS t Is { m } 1 ,m 2 ,r 01 ,r 02 ,n t ρ, a typical value is 0.2,0.2,0.3,0.7,0.3,0.1.
The dividing grid and the coordinate scale in the normal image module are clearly identifiable, and Gamma transformation is not needed, namely s=r.
And step four, calculating the maximum brightness similarity of each region on the color reticle image to be processed, and carrying out self-adaptive brightness correction.
The color reticle L channel image to be processed is divided into N image blocks of size 64 x 64 in pixels. Defining a measure of similarity of the brightness of two images, i.e. brightness similarity S i (U,V i ):
Wherein U is the brightness matrix of a certain area of the L channel image of the color reticle to be processed, V i The brightness matrix of the L channel image of a typical image module is represented, the brightness matrix is 64 multiplied by 64, and the element values in the matrix are the corresponding pixel values in the L channel image. The subscript i is d times of over-dark image modules, i is h times of over-bright image modules, i is t times of bright-dark transition image modules, and i is n times of normal image modules. S is S i (U,V i ) The larger the two luminance distributions are, the closer.
Calculating the brightness similarity S of a certain area and the L-channel images of four typical image modules according to a formula (36) i (U,V i ). And acquiring a brightness correction parameter set of the typical image module according to the i value corresponding to the maximum brightness similarity value, and finishing brightness correction of the area of the L channel image of the reticle to be processed according to the parameter.
And traversing all N areas of the L-channel image of the reticle to be processed, and completing the self-adaptive brightness correction of the whole image.
And fifthly, restoring the reticle image corrected with the L-channel image from the LAB color space to the RGB color space.
Let L, A, B channels in LAB color space correspond to pixel values of l respectively * 、a * 、t * After being converted back into RGB color space, the corresponding pixel values of R, G, B channels are r respectively * 、g * 、b * ,X * 、Y * 、Z * As temporary variables:
wherein,
thus, a complete and uniform-brightness reticle image is obtained, and the reticle grids and scales of the over-dark area, the over-bright area and the bright-dark transition area in the original image are clearly displayed at the same time.
In the following four examples, brightness correction is achieved for the over-dark region, the over-bright region and the bright-dark transition region of the color collimator reticle, and good correction effects are obtained.
After mapping the color collimator panel image from the RGB color space to the LAB color space, four typical image modules of size 64×64 (units: pixels) are analyzed based on the luminance distribution characteristics of the color collimator panel image: the over-dark image module, the over-bright image module, the bright-dark transition image module and the normal image module are used for obtaining typical brightness correction parameter sets after brightness correction, wherein the typical brightness correction parameter sets are respectively as follows:
(1) Typical brightness correction parameter set PS for an excessively dark image module d :{0.2,0.3,0.7}
(2) Representative brightness correction parameter set PS of over-bright image module h ::{0.2,0.7,0.1}
(3) Brightness-darkness transition image module typical brightness correction parameter set PS t :{0.2,0.2,0.3,0.7,0.3,0.1}
Example 1
For a region A of 64X 64 (units: pixels) in size on an L-channel image of a color reticle to be processed 1 Respectively calculate A 1 Brightness similarity S with four typical image modules i (U,V i ) The following are respectively:
(a) Luminance similarity to an excessively dark image module: s is S d (U,V d )=0.913
(b) Luminance similarity to the over-bright image module: s is S h (U,V h )=0.517
(c) Brightness similarity with the bright-dark transition image module: s is S t (U,V t )=0.851
(d) Brightness similarity to normal image module: s is S n (U,V n )=0.699
Wherein S is d (U,V d ) Maximum value, indicating that the area is closest to the brightness of the excessively dark image module, so that the representative brightness correction parameter set PS of the excessively dark image module is used d Is a parameter pair of region A 1 And Gamma conversion is carried out, the converted image is converted into an RGD color space, at the moment, the brightness of the image is integrally improved, the contrast is enhanced, and the dividing line grids and the coordinate scales can be clearly displayed.
Example 2
For a region A of 64X 64 (units: pixels) in size on an L-channel image of a color reticle to be processed 2 Respectively calculate A 2 Brightness similarity S with four typical image modules i (U,V i ) The following are respectively:
(a) Luminance similarity to an excessively dark image module: s is S d (U,V d )=0.494
(b) Luminance similarity to the over-bright image module: s is S h (U,V h )=0.927
(c) Brightness similarity with the bright-dark transition image module: s is S t (U,V t )=0.816
(d) Brightness similarity to normal image module: s is S n (U,V n )=0.711
Wherein S is h (U,V h ) Maximum value, indicating that the area is closest to the luminance of the over-bright image module, so that the typical luminance correction parameter set PS of the over-bright image module is used h Is a parameter pair of region A 2 Gamma conversion is carried out, and the converted image is converted into RGB color space, at the moment, the brightness of the image is reduced as a whole, the contrast is enhanced, and the dividing line grid and the coordinate scale can be usedAnd clearly displaying.
Example 3
For a region A of 64X 64 (units: pixels) in size on an L-channel image of a color reticle to be processed 3 Respectively calculate A 3 Brightness similarity S with four typical image modules i (U,V i ) The following are respectively:
(a) Luminance similarity to an excessively dark image module: s is S d (U,V d )=0.697
(b) Luminance similarity to the over-bright image module: s is S h (U,V h )=0.712
(c) Brightness similarity with the bright-dark transition image module: s is S t (U,V t )=0.919
(d) Brightness similarity to normal image module: s is S n (U,V n )=0.823
Wherein S is t The (U, V) value is the largest, indicating that the region is closest to the brightness of the bright-dark transition image module, so a typical brightness correction parameter set PS of the bright-dark transition image module is used t Is a parameter pair of region A 3 And Gamma conversion is carried out, the converted image is converted into an RGD color space, the brightness of the image is uniform, and the dividing line grids and the coordinate scales can be clearly displayed.
Example 4
A region A of 64X 64 (units: pixels) in size on the L-channel image of the color reticle to be processed 4 Respectively calculate A 4 Brightness similarity S with four typical image modules i (U,V i ) The following are respectively:
(a) Luminance similarity to an excessively dark image module: s is S d (U,V d )=0.727
(b) Luminance similarity to the over-bright image module: s is S h (U,V h )=0.693
(c) Brightness similarity with the bright-dark transition image module: s is S t (U,V t )=0.786
(d) Brightness similarity to normal image module: s is S n (U,V n )=0.923
Wherein S is n (U,V n ) Value ofMaximum, it is explained that the area is closest to the normal image module brightness, so area A 4 No Gamma conversion is required.

Claims (7)

1. The multi-region non-uniform brightness distortion correction algorithm based on L-channel Gamma transformation is characterized by comprising the following steps:
step one, mapping a color collimator reticle image from an RGB color space to an LAB color space;
step two, according to the brightness distribution characteristics of the reticle image, four typical brightness levels are analyzed and defined, wherein the four typical brightness levels comprise a normal image module, an excessively dark image module, an excessively bright image module and a bright-dark transition image module;
step three, correcting the function for the over-dark image moduleWherein m is 1 E (0, 1) is the adjustment coefficient, r 01 The brightness threshold value is corrected for the over-dark image module, and r is the brightness value before transformation; auxiliary function->n d E (0, 1) is an adjustment coefficient; excessively dark image module Gamma transformation function +.>
Correction function for over-bright image moduleWherein m is 2 E (0, 1) is the adjustment coefficient, r 02 For correcting the brightness threshold of an excessively bright image module, an auxiliary function +.>n h E (0, 1) is an adjustment coefficient; excessively bright image module Gamma transformation function +.>
For a light-dark transition image module, correction functionsWherein the auxiliary function->Parameter ρ ε (0, 1), θ=arctan (-2 n) t ),n t For adjusting the coefficients, the Gamma transformation function of the light-dark transition image module>
Mapping the color collimator reticle image to be processed from an RGB color space to an LAB color space, dividing an L-channel image into a plurality of areas, performing optimal brightness similarity matching between each area and all typical image modules, and performing brightness correction on the areas by using Gamma transformation functions of the most matched typical image modules;
and fifthly, restoring the reticle image corrected with the L-channel image from the LAB color space to the RGB color space.
2. The algorithm of claim 1, wherein in the first step, the R, G, B three channels of the color collimator reticle image have respective pixel values r ', g ', b ', respectively, to construct three temporary variablesLet the pixel values of the three L, A, B channels be l ', a ', t ', and use X, Y, Z to solve the parameter values of the pixels in the LAB color spaceWherein (1)>
3. The algorithm of multi-region non-uniform luminance distortion correction based on L-channel Gamma transformation according to claim 1, wherein step two is to select a region I on the reticle L-channel image and calculate the average luminance L of the region; taking a dividing grid and a coordinate scale as foreground pixels and the rest as background pixels, calculating the average brightness value of the corresponding positions of the background pixels on the L-channel image and the average brightness value of the corresponding positions of the foreground pixels on the L-channel image to obtain the average brightness difference of the background pixels and the foreground pixelsSetting an average brightness difference threshold a, an average brightness lower limit threshold b and an average brightness upper limit threshold c; will meet->And l is<b is defined as an excessively dark image module, namely a low-brightness area with unclear display of a dividing grid and a coordinate scale; will meet->And l is>c, defining an area as an over-bright image module, namely a high-brightness area with unclear display of a dividing grid and a coordinate scale; will meet->The area b is less than or equal to l and less than or equal to c defines a bright-dark transition image module, namely a dividing line grid and a coordinate scale display unclear high-low brightness gradual change area; will meet->And the area b is less than or equal to l is less than or equal to c is defined as a normal image module, namely the dividing line grid and the coordinate scale display are clear and normalA luminance region.
4. The algorithm of claim 1, wherein the step two selects a region I on the reticle L-channel image, and calculates a binarized imaged is a set threshold, wherein the value is 1, namely a background pixel, and the value is 0, namely a foreground pixel.
5. The algorithm of claim 1, wherein m is 1 Taken as 0.2, r 01 Taken as 0.3, n d Taken as 0.7, m 2 Taken as 0.2, r 02 Taken as 0.7, n h Taken as 0.1, n t Taken as 0.3 and ρ as 0.1.
6. The multi-region non-uniform luminance distortion correction algorithm based on L-channel Gamma transformation according to claim 1, wherein said step four divides the L-channel image into a plurality of regions; defining the luminance similarity of two imagesi=d, h, t, n, U is the brightness matrix of a certain area on the L channel image of the reticle to be processed, V i And representing a brightness matrix of an L-channel image of a certain typical image module, wherein element values in the matrix are corresponding pixel values in the L-channel image, wherein subscript i represents an over-dark image module, i represents an over-bright image module, i represents a bright-dark transition image module, t represents a bright-dark transition image module, and i represents a normal image module.
7. The algorithm of claim 1, wherein in the fifth step, the reticle image after the L-channel image is correctedL, A, B the brightness value of the pixel is l * 、a * 、t * After being converted back into RGB color space, the corresponding pixel brightness value of R, G, B channel is r * 、g * 、b * ,X * 、Y * 、Z * As a temporary variable, a set of variables,
wherein,
CN202011536064.5A 2020-12-23 2020-12-23 Multi-region non-uniform brightness distortion correction algorithm based on L-channel Gamma transformation Active CN112561829B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011536064.5A CN112561829B (en) 2020-12-23 2020-12-23 Multi-region non-uniform brightness distortion correction algorithm based on L-channel Gamma transformation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011536064.5A CN112561829B (en) 2020-12-23 2020-12-23 Multi-region non-uniform brightness distortion correction algorithm based on L-channel Gamma transformation

Publications (2)

Publication Number Publication Date
CN112561829A CN112561829A (en) 2021-03-26
CN112561829B true CN112561829B (en) 2024-01-12

Family

ID=75030950

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011536064.5A Active CN112561829B (en) 2020-12-23 2020-12-23 Multi-region non-uniform brightness distortion correction algorithm based on L-channel Gamma transformation

Country Status (1)

Country Link
CN (1) CN112561829B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113763278A (en) * 2021-09-10 2021-12-07 昆山丘钛微电子科技股份有限公司 Image correction method and device
CN113923429B (en) * 2021-12-16 2022-04-12 成都索贝数码科技股份有限公司 Color correction method based on color card

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101034538A (en) * 2006-03-07 2007-09-12 乐金电子(南京)等离子有限公司 Gamma distortion calibration device and method using digital signal processing
CN106557729A (en) * 2015-09-30 2017-04-05 日本电气株式会社 For processing the apparatus and method of facial image
CN109447910A (en) * 2018-10-09 2019-03-08 湖南源信光电科技股份有限公司 A kind of low-luminance color image enchancing method based on fuzzy theory
CN110047051A (en) * 2019-04-24 2019-07-23 郑州轻工业学院 A kind of non-uniform lighting colour-image reinforcing method
KR20200089410A (en) * 2019-01-17 2020-07-27 정인호 Low-light image correction method based on optimal gamma correction

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100970883B1 (en) * 2008-10-08 2010-07-20 한국과학기술원 The apparatus for enhancing image considering the region characteristic and method therefor

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101034538A (en) * 2006-03-07 2007-09-12 乐金电子(南京)等离子有限公司 Gamma distortion calibration device and method using digital signal processing
CN106557729A (en) * 2015-09-30 2017-04-05 日本电气株式会社 For processing the apparatus and method of facial image
CN109447910A (en) * 2018-10-09 2019-03-08 湖南源信光电科技股份有限公司 A kind of low-luminance color image enchancing method based on fuzzy theory
KR20200089410A (en) * 2019-01-17 2020-07-27 정인호 Low-light image correction method based on optimal gamma correction
CN110047051A (en) * 2019-04-24 2019-07-23 郑州轻工业学院 A kind of non-uniform lighting colour-image reinforcing method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于统计特征分类耦合自适应Gamma校正的图像增强算法;陆涛;;电子测量与仪器学报(06);全文 *

Also Published As

Publication number Publication date
CN112561829A (en) 2021-03-26

Similar Documents

Publication Publication Date Title
CN110148095B (en) Underwater image enhancement method and enhancement device
CN104240194B (en) A kind of enhancement algorithm for low-illumination image based on parabolic function
CN102682436B (en) A kind of image enchancing method theoretical improved multiple dimensioned Retinex
CN109345491B (en) Remote sensing image enhancement method fusing gradient and gray scale information
CN112561829B (en) Multi-region non-uniform brightness distortion correction algorithm based on L-channel Gamma transformation
CN108711140B (en) Image brightness uniformity real-time recovery method based on inter-class variance description
CN102436640A (en) Foggy-day image sharpening method of multi-scale Retinex model based on HIS space
CN110570360B (en) Retinex-based robust and comprehensive low-quality illumination image enhancement method
CN111968065B (en) Self-adaptive enhancement method for image with uneven brightness
CN106056559A (en) Dark-channel-prior-method-based non-uniform-light-field underwater target detection image enhancement method
CN103065334A (en) Color cast detection and correction method and device based on HSV (Hue, Saturation, Value) color space
CN108288258A (en) A kind of low-quality images Enhancement Method under severe weather conditions
CN106651817A (en) Non-sampling contourlet-based image enhancement method
CN115526806B (en) Artificial intelligence-based black light image automatic color correction method
CN116228604B (en) Satellite remote sensing optical image color homogenizing method suitable for polar region
CN110969584B (en) Low-illumination image enhancement method
CN116188339A (en) Retinex and image fusion-based scotopic vision image enhancement method
CN107358592B (en) Iterative global adaptive image enhancement method
CN110111280A (en) A kind of enhancement algorithm for low-illumination image of multi-scale gradient domain guiding filtering
Yang et al. Improved retinex image enhancement algorithm based on bilateral filtering
CN116630198A (en) Multi-scale fusion underwater image enhancement method combining self-adaptive gamma correction
CN116489330A (en) Self-adaptive white balance method and device, electronic equipment and storage medium
CN112019774B (en) High-quality display method of infrared high-bit-width digital image
CN116797468A (en) Low-light image enhancement method based on self-calibration depth curve estimation of soft-edge reconstruction
CN115293989A (en) Image enhancement method integrating MsRcR and automatic color gradation

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