CN112561829A - 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 PDFInfo
- Publication number
- CN112561829A CN112561829A CN202011536064.5A CN202011536064A CN112561829A CN 112561829 A CN112561829 A CN 112561829A CN 202011536064 A CN202011536064 A CN 202011536064A CN 112561829 A CN112561829 A CN 112561829A
- Authority
- CN
- China
- Prior art keywords
- image
- brightness
- channel
- bright
- image module
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000012937 correction Methods 0.000 title claims abstract description 87
- 238000004422 calculation algorithm Methods 0.000 title claims abstract description 16
- 230000009466 transformation Effects 0.000 title claims description 28
- 238000006243 chemical reaction Methods 0.000 claims abstract description 20
- 238000000034 method Methods 0.000 claims abstract description 19
- 230000007704 transition Effects 0.000 claims description 39
- 239000011159 matrix material Substances 0.000 claims description 12
- 238000013507 mapping Methods 0.000 claims description 11
- 239000000126 substance Substances 0.000 claims description 8
- 238000012545 processing Methods 0.000 abstract description 13
- 238000005286 illumination Methods 0.000 description 15
- 230000008859 change Effects 0.000 description 14
- 230000000694 effects Effects 0.000 description 6
- 238000010586 diagram Methods 0.000 description 4
- 230000008569 process Effects 0.000 description 4
- 238000003384 imaging method Methods 0.000 description 3
- 230000001965 increasing effect Effects 0.000 description 3
- 238000012886 linear function Methods 0.000 description 3
- 238000005259 measurement Methods 0.000 description 3
- 230000007547 defect Effects 0.000 description 2
- 230000002708 enhancing effect Effects 0.000 description 2
- 238000001914 filtration Methods 0.000 description 2
- 230000007246 mechanism Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000002411 adverse Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000007613 environmental effect Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
- 238000011524 similarity measure Methods 0.000 description 1
- 238000011426 transformation method Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR 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
- G06T5/92—Dynamic range modification of images or parts thereof based on global image properties
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR 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
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 conversion, 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, brightness similarity matching between each region image and the typical image modules is realized, so that corresponding optimal brightness correction parameters are obtained, and brightness correction according with respective conditions is completed. The method for converting the image into the LAB color space and correcting the image in the brightness L channel effectively reduces the complexity of model processing and improves the real-time property, robustness and accuracy of system processing.
Description
Technical Field
The present invention relates to an image processing technique, and more particularly, to processing of a luminance distorted image.
Background
Among many technologies such as image enhancement and target detection, the influence of illumination has always been an important concern. In the process of image acquisition, due to the change of an imaging environment or the reason that the smoothness of the surface of an object is not uniform, the whole image is not uniformly illuminated, bright spots and dark spots of different degrees occur, and the local detail information in the image is difficult to identify. The image uneven illumination is embodied as: (1) the overall brightness of the image is low, and the image is common in night images, infrared images and the like; (2) the brightness of some local areas of the image is low, and the brightness of some local areas is high, which is mainly caused by uneven illumination or local structural characteristics of the surface of an object; (3) the image exhibits a blooming phenomenon, such as camera overexposure. The uneven brightness of the image changes the original appearance of the image and increases the difficulty of further processing the image. There is therefore a need 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 some practical value for images with too bright or too dark background and foreground, but it has the disadvantage of indiscriminate data processing, and therefore may eventually increase the contrast of the background area, or decrease the contrast of the useful signal; the homomorphic filtering method based on the illumination-reflection imaging principle can enhance the high-frequency information of an image and simultaneously reserve partial low-frequency information, thereby achieving 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 easily over enhanced; the gradient domain transformation method can well maintain detail information and hierarchy in the original image, but sharpens the image to a certain extent. The Gamma transformation can effectively weaken the influence of illumination and improve the image quality by selecting a proper Gamma value under the condition of unknown illumination.
The current Gamma conversion methods are classified into linear correction methods and nonlinear correction methods. 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 problem that the traditional Gamma conversion method can not meet the brightness correction problem that the image highlight and shadow areas coexist at the same time, and still has some defects: firstly, the linear correction of the Gamma value lacks the capability of effectively enhancing the Gamma value along with the change of the pixel brightness value; secondly, the selection of the Gamma value does not well solve the actual problems of illumination change of highlight, transition and shadow areas in the image; finally, the image is slightly distorted after Gamma conversion, and especially has obvious distortion effect on color images. The nonlinear correction method adopts a correction mode in which nonlinear functions are mutually superposed, 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, the resolution of coordinates displayed on the collimator is limited due to the small area of the collimator reticle, observation is inconvenient, human eyes are easy to observe fatigue, and the realization of digitization of a collimator reticle coordinate system is the basis for realizing intelligent, convenient and more accurate optical measurement. The digitization of the collimator reticle coordinate system is that: and photographing the reticle with the reticle grids and the coordinate scales, identifying the reticle grids and the coordinate scales according to the photographed image, and generating digital grid lines and coordinate scales which strictly correspond to the reticle grids and the coordinate scales. The reticle coordinate system converted into the digital image can be flexibly zoomed, 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: some bright areas or dark areas with different brightness degrees or light areas or heavy areas or light areas or dark areas with different brightness degrees can appear on the reticle displaying the reticle grids and the coordinate scales, the overall brightness of the plane of the reticle is changed at different moments, in addition, when the reticle is photographed, the influence of environmental illumination is inevitably introduced for two times, so that when the coordinate system of the reticle is digitized, the image of the reticle obtained at different moments has the conditions of uneven brightness and different brightness of a plurality of areas on the same image, the interference of the brightness change causes very adverse influence on the recognition of the reticle grids and the coordinate scales, 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 conversion, the correction model is reasonable, the real-time performance is high, the interference of illumination change can be eliminated on the basis of nonlinear Gamma conversion, and the self-adaptive correction is carried out on different brightness distortion conditions, thereby improving the image quality.
The technical scheme adopted by the invention for solving the technical problem comprises the following steps:
mapping a color collimator tube reticle image from an RGB color space to an LAB color space;
analyzing and defining four typical brightness levels including a normal image module, an over-dark image module, an over-bright image module and a bright-dark transition image module according to the brightness distribution characteristics of the reticle image;
step three, correcting the function for the over-dark image moduleWherein m is1Epsilon (0,1) is an adjustment coefficient, r01The corrected brightness critical value is the corrected brightness critical value of the over-dark image module, and r is the brightness value before transformation; auxiliary functionndE (0,1) is an adjusting coefficient; gamma transformation function of over-dark image module
For over-bright image blocks, correction functionWherein m is2Epsilon (0,1) is an adjustment coefficient, r02Correction of luminance threshold for over-bright image module, auxiliary functionnhE (0,1) is an adjusting coefficient; gamma transformation function of over-bright image module
For bright-dark transition image modules, correction functionsWherein the auxiliary functionThe parameter ρ ∈ (0,1), θ ═ arctan (-2 n)t),ntFor adjusting coefficient, light-dark transition image module Gamma transformation function
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 regions, performing optimal brightness similarity matching between each region and all typical image modules, and performing brightness correction on the region by using a Gamma conversion function which is most matched with the typical image modules;
and step five, recovering the reticle image with the corrected L-channel image from the LAB color space to the RGB color space.
In the first step, the R, G, B three channels of the color collimator reticle image have respective pixel values of r ', g ', b ' to construct three temporary variablesLet L, A, B pixel values of three channels be l ', a ', and t ', respectively, and use X, Y, Z to solve the parameter values of the pixels in the LAB color spaceWherein the content of the first and second substances,
selecting a certain area I on the L channel image of the reticle, and calculating the average brightness L of the area; calculating the brightness average value of the corresponding position of the background pixel on the L channel image and the brightness average value of the corresponding position of the foreground pixel on the L channel image by taking the division line grid and the coordinate scale as the foreground pixel and the rest as the background pixel to obtain the average brightness difference between the background pixel and the foreground pixelSetting an average brightness difference threshold value a, an average brightness lower limit threshold value b and an average brightness upper limit threshold value c;
will satisfyAnd l<The area of b is defined as an over-dark image module, namely a low-brightness area with unclear display of a division line grid and coordinate scales;
will satisfyAnd l>The area of c is defined as an over-bright image module, namely a high-brightness area with unclear display of the division line grid and the coordinate scale;
will satisfyAnd the area where b is less than or equal to l and less than or equal to c defines a bright-dark transition image module, namely a high-brightness gradient area and a low-brightness gradient area which are not clear and are displayed by a division line grid and coordinate scales;
will satisfyAnd the area where b is less than or equal to l and less than or equal to c is defined as a normal image module, namely a normal brightness area with clear display of the division line grid and the coordinate scale.
Step two, selecting a certain area I on the reticle L channel image, and calculating to obtain binaryzationRear imaged is a set threshold, wherein the value is 1, i.e. background pixels, and the value is 0, i.e. foreground pixels.
In the third step, m1Is taken to be 0.2, r01Is taken to be 0.3, ndIs taken to be 0.7, m2Is taken to be 0.2, r02Is taken to be 0.7, nhIs taken to be 0.1, ntTaken to be 0.3 and ρ to be 0.1.
Step four, dividing the L-channel image into a plurality of areas; defining the brightness similarity of two imagesU is a brightness matrix of a certain area on the L channel image of the reticle to be processed, ViAnd 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 the subscript i is d to represent an excessively dark image module, i is h to represent an excessively bright image module, i is t to represent a bright-dark transition image module, and i is n to represent a normal image module.
In the fifth step, the luminance value of the L, A, B channel pixel of the reticle image after the L channel image is corrected is L*、a*、t*After conversion back to the RGB color space, the R, G, B channel corresponds to a pixel having a luminance value of r*、g*、b*,X*、Y*、Z*In the case of a temporary variable,
wherein the content of the first and second substances,
the invention has the beneficial effects that: the whole brightness of the collimator reticle image at different moments is changed, particularly, bright regions or dark regions with different brightness degrees often appear on the image at a certain moment, the traditional Gamma transformation aims at the whole image, the robustness of brightness correction is not strong, and the brightness distortion phenomenon of the reticle image cannot be solved. The invention provides an effective multi-region non-uniform brightness distortion correction algorithm based on the traditional Gamma conversion. The algorithm reasonably designs four typical image modules according to different brightness conditions, and trains respective Gamma transformation parameters of the four typical image modules independently, thereby laying a foundation for automatic classification and correction of brightness; the brightness channel image of the reticle image to be processed 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 measure 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 the image.
Drawings
FIG. 1 is a schematic view of a collimator reticle and different bright and dark regions distributed thereon;
FIG. 2 is a schematic diagram of Gamma transform of an over-dark image module;
FIG. 3 is a schematic diagram of Gamma transform of an over-bright image module;
FIG. 4 is a schematic diagram of Gamma transform of a bright-dark transition image module;
in the figure, 1-overly dark region; 2-an over-bright area; 3-light-dark transition region; 4-normal region (other than the 1-3 region); r-pre-transform luminance value; s-transformed luminance values.
Detailed Description
The present invention will be further described with reference to the following drawings and examples, which include, but are not limited to, the following examples.
The invention relates to an image quality improvement algorithm for eliminating the phenomenon of uneven multi-area brightness of a color reticle image. The algorithm provides a concept of a typical image module, designs a brightness similarity measurement index, divides a color reticle image to be processed into a plurality of areas on the basis, and realizes automatic brightness similarity matching of each area image and the typical image module, thereby obtaining corresponding optimal brightness correction parameters and finishing brightness correction according with respective conditions. The method for converting the image into the LAB color space and correcting the image in the brightness L channel effectively reduces the complexity of model processing and improves the real-time property, robustness and accuracy of system processing.
The technical scheme of the invention is as follows: mapping the color collimator reticle image from an RGB color space to an LAB color space, storing L, A, B channel values of all pixels of the color collimator reticle image, and independently extracting an L channel image displayed in a gray scale mode; designing four typical image modules such as a normal image module, an over-bright image module, an over-dark image module and a bright-dark transition image module according to the brightness distribution characteristics of the L-channel image; performing linear or nonlinear Gamma conversion of different parameters on the L-channel images of each typical image module to make the division line grids and the coordinate scales become clear, and acquiring and storing correction parameters as typical brightness correction parameter sets; dividing the color reticle image to be processed into a plurality of areas, matching the most similar typical image module for each area through a similarity measurement mechanism, obtaining a corresponding brightness correction parameter set, and completing the 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 subsequent recognition of reticle grids and coordinate scales. The method comprises the following specific steps:
step one, mapping the color collimator reticle image from an RGB color space to an LAB color space.
Due to the difference of the parallel light sources of the collimator and the influence on the surrounding environment when the reticle is photographed, the imaging effect of the reticle is different every time, including different bright and dark regions and different bright and dark degrees, as shown in fig. 1. In the region with too high or too low brightness, the division line grid and the coordinate scale are not clear enough, and the subsequent identification becomes difficult, so that the brightness needs to be corrected.
In the RGB color space, different illumination affects R, G, B three-channel pixel values, which makes the overall illumination processing difficult. In contrast to the RGB color space, which is a device independent color system, the LAB color space, where the L channel represents the pixel luminance, the a channel represents the range from red to green, and the B channel represents the range from yellow to blue, different illumination only affects the L channel value of the image and not the other two channels. The image is mapped to an LAB color space, and the brightness can be independently corrected, so that the problem of image quality caused by illumination interference can be solved.
The method of mapping an image from the RGB color space to the LAB color space is as follows:
(1) let R, G, B be the pixel values of the three channels r ', g ', b ', respectively, and construct three temporary variables X, Y, Z:
(2) let L, A, B be l ', a ', and t ', respectively, for each pixel value of the three channels, and solve the parameter values of the pixels in the LAB color space using X, Y, Z:
wherein the content of the first and second substances,
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 intensity light sources, four typical brightness levels are analyzed and defined and respectively represented by four typical image modules, namely: the image processing device comprises 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 size, and the unit is pixel, and the size can be adjusted according to actual conditions. In the latter three image modules, due to brightness distortion, the phenomenon that division line grids and coordinate scales are not clear exists. Based on these features, four representative image modules are selected and defined as follows.
Selecting a certain area I on an existing reticle L channel image, wherein the size of the certain area I is 64 multiplied by 64, and the unit is pixel:
(1) calculate the average luminance l of the area:
where j is the line number of the region I picture and k is its column number.
(2) And (4) carrying out binarization on the image of the region I, and calculating the average brightness difference between the division line grid and the coordinate scale and the background image. Calculating to obtain a binarized image I' by the formula (5):
wherein 1 is a background pixel; 0 is the foreground pixel, i.e. the reticle grid and the coordinate scale pixel.
Calculating the brightness average value L of the corresponding position of the background pixel on the L channel image by using the formula (4)bAnd the average value L of the brightness of the corresponding position of the foreground pixel on the L channel imagefObtaining the average brightness difference between the background pixel and the foreground pixel
(3) The area I, which satisfies the following different conditions, is found and defined as the corresponding representative image module.
Will satisfyAnd l<40 is defined as an over-dark image module, namely a low-brightness area with unclear display of a division line grid and coordinate scales;
will satisfyAnd l>84, defining an over-bright image module, namely a high-brightness area with unclear display of a division line grid and coordinate scales;
will satisfyAnd the area where l is more than or equal to 40 and less than or equal to 83 defines a bright-dark transition image module, namely a high-brightness gradual change area and a low-brightness gradual change area which are not clear and are displayed by a division line grid and coordinate scales;
will satisfyAnd the area where l is more than or equal to 40 and less than or equal to 83 is defined as a normal image module, namely a normal brightness area with clear display of the division line grids and the coordinate scales.
In view of l<40 is an excessively dark space,/>84 is an over-bright area, and the grid lines in these two areas are unclear and cannot appearIn a case of (1), therefore, l<40 andor l>84 andthe image module is not selected as a typical image module because the state is rarely generated and is not representative.
And step three, respectively carrying out 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 to enable the division 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 grayscale image having a size of 64 pixels × 64 pixels. The Gamma transform has the basic form:
where c is a normal number, 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 reciprocal to α (r), and typical values of γ (r) are:
wherein m is an adjustment coefficient, r0Is the corrected luminance threshold. In the aspect of controlling the brightness correction effect, expanding the value range of γ (r) only by increasing m may cause an excessively large amplitude change rate of γ (r) in the value range, that is, an excessively large amplitude change of γ (r) is caused by a unit brightness change, which may cause a drastic change of the value of α (r), and finally cause an obvious distortion of the corrected image. To solve this problem and improve the robustness of the luminance correction, the present patent extends γ (r) to γ' (r), where α (r) is:
γ' (r) is formed by superimposing an auxiliary function f (r) on γ (r), and f (r) is formed by one or several linear or non-linear functions. The following discusses the strategies of Gamma transformation of L-channel images of four typical image modules respectively.
(1) Over-dark image module
The luminance values of the pixels in the too-dark image module are low, and the luminance values need to be increased through Gamma transformation, and the correction function γ (r) is in the form of:
m1for the adjustment coefficient, a typical value is 0.2; r is01The typical value is 0.3 for the corrected luminance threshold of an overly dark image module. The invention converts [0, r ] by Gamma conversion01]The brightness value in a narrow range is expanded to a large brightness range, the image brightness is improved, and simultaneously the contrast is stretched, so that the purpose of making the division line grid and the coordinate scale clear is achieved. Since the correction range is limited to [0, r ]01]And the brightness is in the increasing trend, only the correction amplitude is different, so the auxiliary function f (r) uses the following linear function form:
wherein n isdFor the adjustment coefficient, a typical value is 0.7.
Therefore, the Gamma transform function of the over-dark image module is obtained:
the module typical brightness correction parameter set PSdIs { m1,r01,ndExemplary values are 0.2, 0.3, 0.7, and the calibration function is schematically shown in fig. 2. After correction, the average brightness l and the average brightness difference of the imageThe image is in the range of a normal image module, and the division line grids and the coordinate scales can be clearly displayed.
(2) Over-bright image module
In the over-bright image module, the unclear division line grid and coordinate scale is caused by the influence of over-high brightness value, and the brightness value needs to be reduced through Gamma conversion. To achieve this, the correction function γ (r) is now in the form:
m2for the adjustment coefficient, a typical value is 0.2; r is02The corrected luminance threshold for an over-bright image module is typically 0.7. At this time, the auxiliary function f (r) in the over-bright image module uses the following linear function form:
wherein n ishFor the adjustment coefficient, a typical value is 0.1.
The over-bright image module Gamma transform is thus obtained:
the module typical brightness correction parameter set PShIs { m2,r02,nhWith typical values of 0.2, 0.7, 0.1. A schematic diagram of the calibration function is shown in fig. 3. After correction, the average brightness l and the average brightness difference of the imageThe image is in the range of a normal image module, and the division line grids and the coordinate scales can be clearly displayed.
(3) Light-dark transition image module
Under the actual illumination condition, a bright-dark transition area between high brightness and shadow always exists in an image, the definition of a division line grid and a coordinate scale in the area is poor, and in order to solve the problem and the natural transition of the brightness at the junction of a dark area and an excessively bright area, the invention adopts self-adaptive strategies with different correction strength in a bright-dark transition image module: for the pixels of the module with brightness distributed in the middle area, the brightness correction strength is weak; the brightness distribution is close to the pixels at two ends, and the brightness correction strength is enhanced. The correction function γ (r) at this time is in the form:
m1and m2Typical values are all 0.2 for the adjustment coefficients; r is01And r02The corrected luminance threshold values for the too dark image module and the too bright module, respectively, are typically 0.3 and 0.7, respectively.
The auxiliary function f (r) is designed as a nonlinear function as follows:
wherein, theta is arctan (-2 n)t),ntTo adjust the coefficients, a typical value is 0.3. The parameter p is introduced to make the correction effect of the pixel brightness achieve the purposes of weak middle brightness correction and strong brightness correction at two ends when the auxiliary function f (r) is corrected, and the typical value of p is 0.1.
Therefore, a Gamma transformation function of a bright-dark transition image module is obtained:
wherein:
θ=arctan(-2nt) (20)
the module typical brightness correction parameter set PStIs { m1,m2,r01,r02,ntρ, typically {0.2, 0.2, 0.3, 0.7, 0.3, 0.1}, and a graph of the calibration function is shown in fig. 4. After correction, the average brightness l and the average brightness difference of the imageThe image is in the range of a normal image module, and the division line grids and the coordinate scales can be clearly displayed.
The division line 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 area on the L channel image of the reticle to be processed, and performing 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 regions, performing optimal brightness similarity matching between each region and all typical image modules, acquiring corresponding typical brightness correction parameters, and performing brightness correction. The method comprises the following specific steps:
the L-channel image is divided into a plurality of square regions by horizontal and vertical parallel lines at intervals of size (typically 64, in pixels). When the side length of the residual region is less than size, the boundary is still an independent region near the image boundary. Defining a measure of similarity of luminance, i.e. a luminance similarity S, of two imagesi(U,Vi):
Wherein, U is a brightness matrix of a certain area on the L channel image of the reticle to be processed, and ViThe luminance matrix of an L-channel image representing a typical image module has a size of 64 × 64, and the element values in the matrix are corresponding pixel values in the L-channel image. When the subscript i is d, the excessively dark image module is represented, when the subscript i is h, the excessively bright image module is represented, when the subscript i is t, the bright-dark transition image module is represented, and when the subscript i is n, the normal image module is represented. Si(U,Vi) The larger the value, the higher the similarity between the two values, i.e., the closer the luminance distribution.
Respectively calculating the brightness similarity S between a certain region and L-channel images of four typical image modules according to a formula (21)i(U,Vi) 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 completing the brightness correction of the region of the L channel image of the reticle to be processed according to the parameters.
And traversing all N areas of the L-channel image of the reticle to be processed to finish the self-adaptive brightness correction of the whole image.
And step five, recovering the reticle image with the corrected L-channel image from the LAB color space to the RGB color space.
In the RGB color scheme used in current displays, the luminance-corrected reticle image is converted from the LAB color space back to the RGB color space in order to allow the corrected image to be displayed on the display normally. Let the L, A, B-channel pixel brightness value be l in the LAB color space*、a*、t*After conversion back to the RGB color space, the R, G, B channel corresponds to a pixel having a luminance value of r*、g*、b*,X*、Y*、Z*For temporary variables, the following transformation formula is used:
wherein the content of the first and second substances,
therefore, a complete reticle image with uniform brightness 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 all displayed clearly at the same time, so that a high-quality image is provided for the identification of the subsequent reticle grids and coordinate scales.
In an embodiment of the present invention, the non-uniform illumination processing algorithm for the L-channel Gamma transformation of the image includes the following steps.
Step one, mapping the color collimator reticle image from an RGB color space to an LAB color space.
The method of mapping an image from the RGB color space to the LAB color space is as follows:
(1) let R, G, B be the pixel values of the three channels r ', g ', b ', respectively, and construct three temporary variables X, Y, Z:
(2) let L, A, B be l ', a ', and t ', respectively, for each pixel value of the three channels, and solve the parameter values of the pixels in the LAB color space using X, Y, Z:
wherein the content of the first and second substances,
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 intensity light sources, four typical brightness levels are analyzed and defined and represented by four typical image modules respectively: the image processing device comprises 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 size, and the unit is pixel, and the size can be adjusted according to actual conditions. Four typical image modules are selected and defined according to the following steps:
selecting a certain area I on an existing reticle L channel image, wherein the size of the certain area I is 64 multiplied by 64, and the unit is pixel:
(1) calculate the average luminance l of the area:
where j is the line number of the region I picture and k is its column number.
(2) And (4) carrying out binarization on the image of the region I, and calculating the average brightness difference between the division line grid and the coordinate scale and the background image. The binarized image I' is calculated by equation (29):
wherein 1 is a background pixel; 0 is the foreground pixel, i.e. the reticle grid and the coordinate scale pixel.
Calculating the brightness average value L of the corresponding position of the background pixel on the L channel image by using the formula (28)bAnd the average value L of the brightness of the corresponding position of the foreground pixel on the L channel imagefObtaining the average brightness difference between the background pixel and the foreground pixel
(3) The area I, which satisfies the following different conditions, is found and defined as the corresponding representative image module.
Will satisfyAnd l<40 is defined as an over-dark image module, namely a low-brightness area with unclear display of a division line grid and coordinate scales;
will satisfyAnd l>84, defining an over-bright image module, namely a high-brightness area with unclear display of a division line grid and coordinate scales;
will satisfyAnd the area where l is more than or equal to 40 and less than or equal to 83 defines a bright-dark transition image module, namely a high-brightness gradual change area and a low-brightness gradual change area which are not clear and are displayed by a division line grid and coordinate scales;
will satisfyAnd the area where l is more than or equal to 40 and less than or equal to 83 is defined as a normal image module, namely a normal brightness area with clear display of the division line grids and the coordinate scales.
And step three, 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 ensure that the division line grids and the coordinate scales are clear and recognizable. Wherein:
(1) the Gamma transform function of the over-dark image module is as follows:
the module typical brightness correction parameter set PSdIs { m1,r01,ndWith typical values of 0.2, 0.3, 0.7.
(2) The Gamma transform function of the over-bright image module is as follows:
the module typical brightness correction parameter set PShIs { m2,r02,nhWith typical values of 0.2, 0.7, 0.1.
(3) The Gamma transformation function of the bright-dark transition image module is as follows:
wherein:
θ=arctan(-2nt) (35)
the module typical brightness correction parameter set PStIs { m1,m2,r01,r02,ntρ, typical values are {0.2, 0.2, 0.3, 0.7, 0.3, 0.1 }.
The division line grid and the coordinate scale in the normal image module are clear and recognizable, and Gamma transformation is not needed, namely s is r.
And step four, calculating the maximum brightness similarity of each area on the color reticle image to be processed, and performing self-adaptive brightness correction.
Dividing the L-channel image of the color reticle to be processed into N image blocks with the size of 64 multiplied by 64, and the unit is pixel. Defining a measure of similarity of luminance, i.e. a luminance similarity S, of two imagesi(U,Vi):
Wherein, U is a brightness matrix of a certain area of the L channel image of the color reticle to be processed, and ViThe luminance matrix of an L-channel image representing a typical image module has a size of 64 × 64, and the element values in the matrix are corresponding pixel values in the L-channel image. When the subscript i is d, the excessively dark image module is represented, when the subscript i is h, the excessively bright image module is represented, when the subscript i is t, the bright-dark transition image module is represented, and when the subscript i is n, the normal image module is represented. Si(U,Vi) The larger the brightness distribution, the closer the brightness distribution.
Respectively calculating the brightness similarity S between a certain region and L-channel images of four typical image modules according to a formula (36)i(U,Vi). 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 the brightness correction of the region 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 to finish the self-adaptive brightness correction of the whole image.
And step five, recovering the reticle image with the corrected L-channel image from the LAB color space to the RGB color space.
Let the L, A, B channel corresponding pixel values in the LAB color space be l*、a*、t*After conversion back to the RGB color space, the R, G, B channels have corresponding pixel values r*、g*、b*,X*、Y*、Z*As temporary variables:
wherein the content of the first and second substances,
therefore, a complete reticle image with uniform brightness is obtained, and reticle grids and scales of the over-dark area, the over-bright area and the bright-dark transition area in the original image are all displayed clearly at the same time.
In the following four examples, brightness correction is realized on the over-dark area, the over-bright area and the bright-dark transition area of the color collimator reticle, and good correction effect is obtained.
After mapping the color collimator reticle image from the RGB color space to the LAB color space, four typical image modules with a size of 64 × 64 (unit: pixel) are analyzed according to the brightness distribution characteristics of the color collimator reticle image: the brightness correction is carried out on the over-dark image module, the over-bright image module, the bright-dark transition image module and the normal image module to obtain a typical brightness correction parameter set, which is respectively as follows:
(1) typical luminance correction parameter set PS for too dark image moduled:{0.2,0.3,0.7}
(2) Typical luminance correction parameter set PS for over-bright image moduleh::{0.2,0.7,0.1}
(3) Typical brightness correction parameter set PS for bright-dark transition image modulet:{0.2,0.2,0.3,0.7,0.3,0.1}
Example 1
For an area A with the size of 64 x 64 (unit: pixel) on the L-channel image of the color reticle to be processed1Separately calculate A1Brightness similarity with four typical image modules Si(U,Vi) Respectively as follows:
(a) luminance similarity with too dark image module: sd(U,Vd)=0.913
(b) Luminance similarity with over-bright image module: sh(U,Vh)=0.517
(c) Brightness similarity with bright-dark transition image module: st(U,Vt)=0.851
(d) Luminance similarity with normal image module: sn(U,Vn)=0.699
Wherein Sd(U,Vd) The maximum value indicates that the brightness of the region is closest to the brightness of the over-dark image module, so the typical brightness correction parameter set PS for the over-dark image module is useddParameter pair region A1And performing Gamma conversion, and converting the converted image into RGD color space, wherein the image brightness is integrally improved, the contrast is enhanced, and the division line grid and the coordinate scale can be clearly displayed.
Example 2
For an area A with the size of 64 x 64 (unit: pixel) on the L-channel image of the color reticle to be processed2Separately calculate A2Brightness similarity with four typical image modules Si(U,Vi) Respectively as follows:
(a) luminance similarity with too dark image module: sd(U,Vd)=0.494
(b) Brightness similarity with over-bright image moduleDegree: sh(U,Vh)=0.927
(c) Brightness similarity with bright-dark transition image module: st(U,Vt)=0.816
(d) Luminance similarity with normal image module: sn(U,Vn)=0.711
Wherein Sh(U,Vh) The maximum value indicates that the brightness of the region is closest to the brightness of the over-bright image module, so the typical brightness correction parameter set PS for the over-bright image module is usedhParameter pair region A2Gamma conversion is carried out, the converted image is converted into RGB color space, the brightness of the image is reduced as a whole, the contrast is enhanced, and the division line grid and the coordinate scale can be displayed clearly.
Example 3
For an area A with the size of 64 x 64 (unit: pixel) on the L-channel image of the color reticle to be processed3Separately calculate A3Brightness similarity with four typical image modules Si(U,Vi) Respectively as follows:
(a) luminance similarity with too dark image module: sd(U,Vd)=0.697
(b) Luminance similarity with over-bright image module: sh(U,Vh)=0.712
(c) Brightness similarity with bright-dark transition image module: st(U,Vt)=0.919
(d) Luminance similarity with normal image module: sn(U,Vn)=0.823
Wherein StThe maximum value of (U, V) indicates that the brightness of the region is closest to that of the bright-dark transition image module, so the typical brightness correction parameter set PS for the bright-dark transition image module is usedtParameter pair region A3And performing Gamma conversion, converting the converted image into RGD color space, wherein the image brightness is uniform, and the division line grid and the coordinate scale can be clearly displayed.
Example 4
An area A of 64X 64 (unit: pixel) size on the L-channel image of the color reticle to be processed4Separately calculate A4Brightness similarity with four typical image modules Si(U,Vi) Respectively as follows:
(a) luminance similarity with too dark image module: sd(U,Vd)=0.727
(b) Luminance similarity with over-bright image module: sh(U,Vh)=0.693
(c) Brightness similarity with bright-dark transition image module: st(U,Vt)=0.786
(d) Luminance similarity with normal image module: sn(U,Vn)=0.923
Wherein Sn(U,Vn) The maximum value indicates that the brightness of the region is closest to the normal image module, so region A4No Gamma transformation is required.
Claims (7)
1. A multi-region non-uniform brightness distortion correction algorithm based on L-channel Gamma transform is characterized by comprising the following steps:
mapping a color collimator tube reticle image from an RGB color space to an LAB color space;
analyzing and defining four typical brightness levels including a normal image module, an over-dark image module, an over-bright image module and a bright-dark transition image module according to the brightness distribution characteristics of the reticle image;
step three, correcting the function for the over-dark image moduleWherein m is1Epsilon (0,1) is an adjustment coefficient, r01The corrected brightness critical value is the corrected brightness critical value of the over-dark image module, and r is the brightness value before transformation; auxiliary functionndE (0,1) is an adjusting coefficient; gamma transformation function of over-dark image module
For over-bright image blocks, correction functionWherein m is2Epsilon (0,1) is an adjustment coefficient, r02Correction of luminance threshold for over-bright image module, auxiliary functionnhE (0,1) is an adjusting coefficient; gamma transformation function of over-bright image module
For bright-dark transition image modules, correction functionsWherein the auxiliary functionThe parameter ρ ∈ (0,1), θ ═ arctan (-2 n)t),ntFor adjusting coefficient, light-dark transition image module Gamma transformation function
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 regions, performing optimal brightness similarity matching between each region and all typical image modules, and performing brightness correction on the region by using a Gamma conversion function which is most matched with the typical image modules;
and step five, recovering the reticle image with the corrected L-channel image from the LAB color space to the RGB color space.
2. The method of claim 1 based on an L-channel Gamma transformThe multi-region non-uniform brightness distortion correction algorithm is characterized in that in the step one, the pixel values of R, G, B channels of the color collimator reticle image are r ', g ' and b ' respectively to construct three temporary variablesLet L, A, B pixel values of three channels be l ', a ', and t ', respectively, and use X, Y, Z to solve the parameter values of the pixels in the LAB color spaceWherein the content of the first and second substances,
3. the multi-region nonuniform brightness distortion correction algorithm based on L-channel Gamma transform as claimed in claim 1, characterized in that said second step is to select a certain region I on the reticle L-channel image, calculate the average brightness L of the region; calculating the brightness average value of the corresponding position of the background pixel on the L channel image and the brightness average value of the corresponding position of the foreground pixel on the L channel image by taking the division line grid and the coordinate scale as the foreground pixel and the rest as the background pixel to obtain the average brightness difference between the background pixel and the foreground pixelSetting an average brightness difference threshold value a, an average brightness lower limit threshold value b and an average brightness upper limit threshold value c; will satisfyAnd l<The area of b is defined as an over-dark image module, namely a low-brightness area with unclear display of a division line grid and coordinate scales; will satisfyAnd l>c area is defined as over-bright imageThe module, namely the high-brightness area which is not clear is displayed by the division line grid and the coordinate scale; will satisfyAnd the area where b is less than or equal to l and less than or equal to c defines a bright-dark transition image module, namely a high-brightness gradient area and a low-brightness gradient area which are not clear and are displayed by a division line grid and coordinate scales; will satisfyAnd the area where b is less than or equal to l and less than or equal to c is defined as a normal image module, namely a normal brightness area with clear display of the division line grid and the coordinate scale.
4. The L-channel Gamma transform-based multi-region nonuniform brightness distortion correction algorithm as claimed in claim 1, wherein the second step is to select a certain region I on the reticle L-channel image, and calculate to obtain the binarized imaged is a set threshold, wherein the value is 1, i.e. background pixels, and the value is 0, i.e. foreground pixels.
5. The L-channel Gamma transform based multi-region nonuniform brightness distortion correction algorithm of claim 1, wherein m is the third step1Is taken to be 0.2, r01Is taken to be 0.3, ndIs taken to be 0.7, m2Is taken to be 0.2, r02Is taken to be 0.7, nhIs taken to be 0.1, ntTaken to be 0.3 and ρ to be 0.1.
6. The L-channel Gamma transform based multi-region nonuniform brightness distortion correction algorithm of claim 1, wherein the step four divides the L-channel image into a plurality of regions; defining the brightness similarity of two imagesi=d,h,t,n,U is a brightness matrix of a certain area on the L channel image of the reticle to be processed, ViAnd 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 the subscript i is d to represent an excessively dark image module, i is h to represent an excessively bright image module, i is t to represent a bright-dark transition image module, and i is n to represent a normal image module.
7. The multi-region nonuniform brightness distortion correction algorithm according to claim 1, wherein in the fifth step, the luminance value of the pixel of the reticle image L, A, B after the L-channel image is corrected is L*、a*、t*After conversion back to the RGB color space, the R, G, B channel corresponds to a pixel having a luminance value of r*、g*、b*,X*、Y*、Z*In the case of a temporary variable,
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 true CN112561829A (en) | 2021-03-26 |
CN112561829B 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) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113763278A (en) * | 2021-09-10 | 2021-12-07 | 昆山丘钛微电子科技股份有限公司 | Image correction method and device |
CN113923429A (en) * | 2021-12-16 | 2022-01-11 | 成都索贝数码科技股份有限公司 | Color correction method based on color card |
Citations (6)
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 |
US20100085361A1 (en) * | 2008-10-08 | 2010-04-08 | Korea Advanced Institute Of Science And Technology | Apparatus and method for enhancing images in consideration of region characteristics |
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 |
-
2020
- 2020-12-23 CN CN202011536064.5A patent/CN112561829B/en active Active
Patent Citations (6)
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 |
US20100085361A1 (en) * | 2008-10-08 | 2010-04-08 | Korea Advanced Institute Of Science And Technology | Apparatus and method for enhancing images in consideration of region characteristics |
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)
Title |
---|
陆涛;: "基于统计特征分类耦合自适应Gamma校正的图像增强算法", 电子测量与仪器学报, no. 06 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113763278A (en) * | 2021-09-10 | 2021-12-07 | 昆山丘钛微电子科技股份有限公司 | Image correction method and device |
CN113923429A (en) * | 2021-12-16 | 2022-01-11 | 成都索贝数码科技股份有限公司 | Color correction method based on color card |
Also Published As
Publication number | Publication date |
---|---|
CN112561829B (en) | 2024-01-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102436640A (en) | Foggy-day image sharpening method of multi-scale Retinex model based on HIS space | |
CN112561829B (en) | Multi-region non-uniform brightness distortion correction algorithm based on L-channel Gamma transformation | |
JPH05225332A (en) | Method and apparatus for variable-space wave filtering | |
Zhang et al. | Efficient fusion scheme for multi-focus images by using blurring measure | |
CN103065334A (en) | Color cast detection and correction method and device based on HSV (Hue, Saturation, Value) color space | |
CN106651817A (en) | Non-sampling contourlet-based image enhancement method | |
CN109211918B (en) | Fabric bow weft detection method based on weft trend | |
CN108288258A (en) | A kind of low-quality images Enhancement Method under severe weather conditions | |
CN105809643A (en) | Image enhancing method based on self-adaptive block channel stretching | |
CN110298796A (en) | Based on the enhancement method of low-illumination image for improving Retinex and Logarithmic image processing | |
CN110969584B (en) | Low-illumination image enhancement method | |
CN112435184A (en) | Haze sky image identification method based on Retinex and quaternion | |
CN116188339A (en) | Retinex and image fusion-based scotopic vision image enhancement method | |
CN107358592B (en) | Iterative global adaptive image enhancement method | |
CN116452447A (en) | Low-illumination high-definition image processing method | |
CN102750680A (en) | Tea image enhancement method based on empirical mode decomposition and color space | |
CN102800061B (en) | The quick self-adapted optimization method of digital picture under high illumination | |
CN108830817A (en) | A kind of histogram-equalized image Enhancement Method based on gray correction | |
CN114549386A (en) | Multi-exposure image fusion method based on self-adaptive illumination consistency | |
CN115908155A (en) | NSST domain combined GAN and scale correlation coefficient low-illumination image enhancement and denoising method | |
CN112019774B (en) | High-quality display method of infrared high-bit-width digital image | |
Chandana et al. | An optimal image dehazing technique using dark channel prior | |
CN109165569B (en) | Passive millimeter wave image polarization information display method based on BA algorithm | |
CN113658157A (en) | Color segmentation method and device based on HSV space | |
Zheng | A channel-based color fusion technique using multispectral images for night vision enhancement |
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 |