CN115660994B - Image enhancement method based on regional least square estimation - Google Patents
Image enhancement method based on regional least square estimation Download PDFInfo
- Publication number
- CN115660994B CN115660994B CN202211365819.9A CN202211365819A CN115660994B CN 115660994 B CN115660994 B CN 115660994B CN 202211365819 A CN202211365819 A CN 202211365819A CN 115660994 B CN115660994 B CN 115660994B
- Authority
- CN
- China
- Prior art keywords
- image
- enhanced
- boundary pixel
- gray
- formula
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 38
- 238000004364 calculation method Methods 0.000 claims abstract description 28
- 238000013507 mapping Methods 0.000 claims abstract description 14
- 230000011218 segmentation Effects 0.000 claims description 33
- 238000005286 illumination Methods 0.000 claims description 25
- 230000001186 cumulative effect Effects 0.000 claims description 4
- 238000004422 calculation algorithm Methods 0.000 abstract description 11
- 230000000007 visual effect Effects 0.000 abstract description 5
- 238000012545 processing Methods 0.000 abstract description 4
- 230000006870 function Effects 0.000 description 6
- 238000010586 diagram Methods 0.000 description 5
- 238000013461 design Methods 0.000 description 2
- 238000004088 simulation Methods 0.000 description 2
- 230000003044 adaptive effect Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000002708 enhancing effect Effects 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
Images
Landscapes
- Image Processing (AREA)
Abstract
An image enhancement method based on regional least square estimation belongs to the technical field of image processing. The invention solves the problem of poor quality of the enhanced image obtained by adopting the existing method. The method comprises a regional boundary brightness calculation method based on piecewise brightness linear mapping and a non-boundary pixel brightness calculation method based on a regional least square method, wherein the regional boundary brightness calculation method based on piecewise brightness linear mapping determines the overall brightness distribution of the enhanced image, and the non-boundary pixel brightness calculation method based on the regional least square method calculates the brightness of non-boundary pixel points so as to enable the detail characteristics of the enhanced image to be consistent with those of an original image. The algorithm designed by the invention can enhance the brightness distribution of the image, improve the whole visual effect of the image, effectively maintain the local details of the enhanced image and improve the quality of the enhanced image. The method can be applied to the field of image processing.
Description
Technical Field
The invention belongs to the technical field of image processing, and particularly relates to an image enhancement method based on regional least square estimation.
Background
The image enhancement solves the problem of poor visual effect of the image caused by poor ambient light and equipment defects in the process of acquisition and transmission of the image by enhancing the contrast, local detail textures and other characteristics in the image, and improves the image quality of the digital image. Early image enhancement algorithms included: histogram equalization algorithm, adaptive filtering algorithm, contrast enhancement algorithm. The three algorithms can improve the image quality to a certain extent, but the local detail and definition of the enhanced image and the overall brightness distribution of the image are limited, so that the quality of the enhanced image obtained by the existing method is still poor and needs to be further improved.
Disclosure of Invention
The invention aims to solve the problem of poor quality of an enhanced image obtained by adopting the existing method, and provides an image enhancement method based on regional least squares estimation, which improves the overall brightness contrast effect of the enhanced image on the premise of ensuring the local detail characteristics of an original image.
The technical scheme adopted by the invention for solving the technical problems is as follows:
an image enhancement method based on regional least squares estimation, the method specifically comprising the steps of:
dividing an image plane to be enhanced into N8 multiplied by 8 areas to obtain N image blocks;
step two, calculating low-illumination segmentation points of the image to be enhancedAnd high brightness segmentation point->
Step three, utilizing the low-illumination segmentation points calculated in the step twoAnd high brightness segmentation point->Performing piecewise brightness linear mapping on each boundary pixel in each image block to obtain an enhanced brightness value corresponding to each boundary pixel in each image block;
and step four, calculating the enhanced brightness value corresponding to each non-boundary pixel in each image block according to the enhanced brightness value corresponding to each boundary pixel in each image block.
The beneficial effects of the invention are as follows:
the method comprises a regional boundary brightness calculation method based on piecewise brightness linear mapping and a non-boundary pixel brightness calculation method based on a regional least square method, wherein the regional boundary brightness calculation method based on piecewise brightness linear mapping determines the overall brightness distribution of the enhanced image, and the non-boundary pixel brightness calculation method based on the regional least square method calculates the brightness of non-boundary pixel points so as to enable the detail characteristics of the enhanced image to be consistent with those of an original image.
Experimental results show that the algorithm designed by the invention can enhance the brightness distribution of the image, improve the whole visual effect of the image, effectively maintain the local details of the enhanced image and improve the quality of the enhanced image.
Drawings
FIG. 1 is a schematic diagram of boundary pixel and non-boundary pixel numbering;
FIG. 2 is an image kodim;
FIG. 3 is a schematic diagram of a piecewise luminance linear mapping function corresponding to an image kodim;
fig. 4 is an enhanced image corresponding to the image kodim;
FIG. 5 is an original image read;
FIG. 6 is a schematic diagram of a piecewise luminance linear mapping function corresponding to an original image read;
FIG. 7 is an enhanced image corresponding to the image read;
FIG. 8 is an image seed;
FIG. 9 is a schematic diagram of a piecewise luminance linear mapping function corresponding to an image seed;
fig. 10 is an enhanced image corresponding to the image seed.
Detailed Description
An image enhancement method based on region least square estimation according to a first embodiment of the present invention specifically includes the following steps:
dividing an image plane to be enhanced into N8 multiplied by 8 areas to obtain N image blocks;
if the width or height of the image to be enhanced cannot be divided by 8, the width and height of the image after the copying boundary can be divided by 8 by copying the right end boundary and the bottom boundary of the image. Since the area size of each image block is 8×8, each area includes 28 boundary pixels and 36 non-boundary pixels. As shown in fig. 1, there is a schematic diagram of 8×8 regions, boundary pixels and non-boundary pixel numbers;
step two, calculating low-illumination segmentation points of the image to be enhancedAnd highlightingDegree segmentation Point->
Step three, utilizing the low-illumination segmentation points calculated in the step twoAnd high brightness segmentation point->Performing piecewise brightness linear mapping on each boundary pixel in each image block to obtain an enhanced brightness value corresponding to each boundary pixel in each image block;
and step four, calculating the enhanced brightness value corresponding to each non-boundary pixel in each image block according to the enhanced brightness value corresponding to each boundary pixel in each image block.
The second embodiment is as follows: the embodiment is different from the specific embodiment in that the low-illumination segmentation pointThe calculation method of (1) is as follows:
wherein b represents gray scale, H b Representing gray scale distribution corresponding to gray scale b;
D l (T l )=A l (T l )-M l (T l ) (3)
Other steps and parameters are the same as in the first embodiment.
And a third specific embodiment: this embodiment differs from the first or second embodiments in that the high-luminance segment pointsThe calculation method of (1) is as follows:
step (1), in gray scale interval [128,255 ]]One gray level is arbitrarily selected as a high-illumination segmentation point T h ;
Step (2), calculating the gray scale interval [ T ] of the image to be enhanced h ,255]The median M of the gray scale of (2) h (T h ),M h (T h ) The calculation mode of (2) is shown as the formula (5):
step (3), calculating the gray interval [128, T ] of the image to be enhanced according to the gray histogram h +1]Is the gray average value A of (2) h (T h ),A h (T h ) The calculation mode of (2) is shown as the formula (6):
wherein b represents gray scale, H b Representing gray scale distribution corresponding to gray scale b;
step (4), calculating a gray average value A h (T h ) And gray median M h (T h ) Is the difference D of (2) h (T h ),D h (T h ) The calculation mode of (2) is shown as the formula (7):
D h (T h )=M h (T h )-A h (T h ) (7)
step (5), repeating the processes from step (1) to step (4) to make the high-illumination segmentation point T h In gray scale intervals [128,255]Traversing to find the maximum difference D h (T h ) The corresponding segmentation point is taken as the final high-illumination segmentation point The calculation mode of (2) is shown as the formula (8):
other steps and parameters are the same as in the first or second embodiment.
The specific embodiment IV is as follows: the present embodiment is different from one of the first to third embodiments in that the specific process of the third step is:
low illumination segmentation pointAnd high illuminance segment Point->The corresponding gray value is shown in formula (9):
wherein ,is->Corresponding gray value +.>Is->Corresponding gray value +.>Is->Corresponding cumulative probability distribution->Is->A corresponding cumulative probability distribution;
performing piecewise linear brightness mapping on each boundary pixel in each image block to obtain an enhanced brightness value corresponding to each boundary pixel in each image block;
the piecewise linear luminance mapping expression is shown in equation (10):
wherein I represents the luminance value of the boundary pixel,representing the enhanced luminance value corresponding to the boundary pixel.
As shown in fig. 1, each image block includes 28 boundary pixels, and the method according to the present embodiment can obtain enhanced luminance values corresponding to the 28 boundary pixels of each image block.
Other steps and parameters are the same as in one to three embodiments.
Fifth embodiment: the difference between the present embodiment and one to four embodiments is that the specific process of the fourth step is:
step S1, for the kth non-boundary pixels in all N regions, constructing a function f with 28 boundary weights and in accumulated form k (ω 1 ,ω 2 ,...,ω 28 ) Function f k (ω 1 ,ω 2 ,...,ω 28 ) As shown in formula (11):
f k (ω 1 ,ω 2 ,...,ω 28 )=∑ i (ω 1 I i,1 +ω 2 I i,2 +···+ω 28 I i,28 -I i (k)) 2 (11)
wherein ,ω1 ,ω 2 ,...,ω 28 For the weight corresponding to each boundary pixel, I i,1 Represents the enhanced luminance value corresponding to the 1 st boundary pixel in the I-th region, i=1, 2, …, N, I i (k) Representing the original brightness value of the kth non-boundary pixel in the ith region in the image to be enhanced;
according to the least square criterion, to the function f k (ω 1 ,ω 2 ,...,ω 28 ) Arbitrary boundary pixel weight ω of (1) j Is 0, i.e., equation (12) holds:
where j=1, 2, …,28;
bringing all the boundary weights into formula (12), and combining formula (11) to obtain a linear equation set about the boundary weights shown in formula (13):
solving the formula (13) by a Jacobian iteration method to obtain an optimal solution of any boundary weight, as shown in the formula (14):
wherein the superscript t indicates the number of iterations,representing the weight of the jth boundary pixel obtained in the t-th iteration,representing the weight of the jth boundary pixel obtained in the t-1 th iteration;
the jacobian iterative method converges when the equation (15) is constant for all boundary pixels:
the least square estimation result of the boundary pixel weight is obtained; non-boundary pixels at the same position in different regions correspond to a group of same boundary weights;
And step S3, repeating the processes from the step S1 to the step S2 to respectively obtain the enhanced brightness value corresponding to each non-boundary pixel in each image block.
Other steps and parameters are the same as in one to four embodiments.
Experimental results and analysis
According to the invention, the simulation experiment is carried out on the algorithm through the desktop. Hardware configuration of desktop: the model of the central processing unit is i5-12400F, the specification of the display card is RTX3060, and the memory capacity is 128G. The operating system of the desktop is Windows 11, and the simulation software platform is Matlab 2020a. The input and output of the algorithm are both jpg format gray scale images. The simulation results are shown in fig. 2 to 10.
Comparing the original image and the enhanced image can be known: the design algorithm of the invention can improve the overall visual impression of the image, and the contrast of the enhanced image is effectively improved. The brightness of the pixels in the area where the illumination is insufficient is effectively stretched to improve the visibility of the area. In addition, the local detail holding capability of the enhanced image to the original image is more prominent, and the edges and the outlines of all targets in the enhanced image are clearer. Therefore, the design algorithm of the invention can effectively improve the image quality and greatly improve the visual effect of the enhanced image.
The above examples of the present invention are only for describing the calculation model and calculation flow of the present invention in detail, and are not limiting of the embodiments of the present invention. Other variations and modifications of the above description will be apparent to those of ordinary skill in the art, and it is not intended to be exhaustive of all embodiments, all of which are within the scope of the invention.
Claims (4)
1. An image enhancement method based on regional least square estimation, which is characterized by comprising the following steps:
dividing an image plane to be enhanced into N8 multiplied by 8 areas to obtain N image blocks;
step two, calculating low-illumination segmentation points of the image to be enhancedAnd high brightness segmentation point->
step 1, in gray scale interval [0,127 ]]One gray level is arbitrarily selected as a low-illumination segmentation point T l ;
Step 2, calculating the gray scale interval [0, T ] of the image to be enhanced l ]The median M of the gray scale of (2) l (T l ),M l (T l ) The calculation mode of (2) is shown as the formula (1):
step 3, calculating the gray interval [ T ] of the image to be enhanced according to the gray histogram l +1,127]Is the gray average value A of (2) l (T l ),A l (T l ) The calculation mode of (2) is as shown in the formula:
wherein b represents gray scale, H b Representing gray scale distribution corresponding to gray scale b;
step 4, calculating the average value A l (T l ) And median M l (T l ) Is the difference D of (2) l (T l ),D l (T l ) The calculation mode of (2) is shown as the formula (3):
D l (T l )=A l (T l )-M l (T l )(3)
step 5, repeating the processes from step 1 to step 4 to make the low-illumination segmentation point T l In the gray scale interval [0,127 ]]Traversing to find the maximum difference D l (T l ) The corresponding low-illumination segmentation point is taken as the final low-illumination segmentation pointI.e.
Step three, utilizing the low-illumination segmentation points calculated in the step twoAnd high brightness segmentation point->Performing piecewise brightness linear mapping on each boundary pixel in each image block to obtain an enhanced brightness value corresponding to each boundary pixel in each image block;
and step four, calculating the enhanced brightness value corresponding to each non-boundary pixel in each image block according to the enhanced brightness value corresponding to each boundary pixel in each image block.
2. The image enhancement method according to claim 1, wherein the high-brightness segmentation pointThe calculation method of (1) is as follows:
step (1), in gray scale interval [128,255 ]]One gray level is arbitrarily selected as a high-illumination segmentation point T h ;
Step (2), calculating the gray scale interval [ T ] of the image to be enhanced h ,255]The median M of the gray scale of (2) h (T h ),M h (T h ) The calculation mode of (2) is shown as the formula (5):
step (3), calculating the gray interval [128, T ] of the image to be enhanced according to the gray histogram h +1]Is the gray average value A of (2) h (T h ),A h (T h ) The calculation mode of (2) is shown as the formula (6):
wherein b represents gray scale, H b Representing gray scale distribution corresponding to gray scale b;
step (4), calculating a gray average value A h (T h ) And gray median M h (T h ) Is the difference D of (2) h (T h ),D h (T h ) The calculation mode of (2) is shown as the formula (7):
D h (T h )=M h (T h )-A h (T h )(7)
step (5), repeating the processes from step (1) to step (4) to make the high-illumination segmentation point T h In gray scale intervals [128,255]Traversing to find the maximum difference D h (T h ) The corresponding segmentation point is taken as the final high-illumination segmentation point The calculation mode of (2) is shown as the formula (8):
3. the image enhancement method based on regional least squares estimation according to claim 1, wherein the specific procedure of the third step is as follows:
low illumination segmentation pointAnd high illuminance segment Point->The corresponding gray value is shown in formula (9):
wherein ,is->Corresponding gray value +.>Is->Corresponding gray value +.>Is->The corresponding cumulative probability distribution is used to determine,is->A corresponding cumulative probability distribution;
performing piecewise linear brightness mapping on each boundary pixel in each image block to obtain an enhanced brightness value corresponding to each boundary pixel in each image block;
the piecewise linear luminance mapping expression is shown in equation (10):
4. The image enhancement method based on regional least squares estimation according to claim 1, wherein the specific process of the fourth step is:
step S1, for the kth non-boundary pixels in all N regions, constructing a function f with 28 boundary weights and in accumulated form k (ω 1 ,ω 2 ,...,ω 28 ) Function f k (ω 1 ,ω 2 ,...,ω 28 ) As shown in formula (11):
f k (ω 1 ,ω 2 ,...,ω 28 )=∑ i (ω 1 I i,1 +ω 2 I i,2 +···+ω 28 I i,28 -I i (k)) 2 (11)
wherein ,ω1 ,ω 2 ,...,ω 28 For the weight corresponding to each boundary pixel, I i,1 Represents the enhanced luminance value corresponding to the 1 st boundary pixel in the I-th region, i=1, 2, …, N, I i (k) Representing the original brightness value of the kth non-boundary pixel in the ith region in the image to be enhanced;
according to the least square criterion, to the function f k (ω 1 ,ω 2 ,...,ω 28 ) Arbitrary boundary pixel weight ω of (1) j Is 0, i.e., equation (12) holds:
where j=1, 2, …,28;
bringing all the boundary weights into formula (12), and combining formula (11) to obtain a linear equation set about the boundary weights shown in formula (13):
solving the formula (13) by a Jacobian iteration method to obtain an optimal solution of any boundary weight, as shown in the formula (14):
wherein the superscript t indicates the number of iterations,representing the weight of the jth boundary pixel obtained in the t-th iteration,/th>Representing the weight of the jth boundary pixel obtained in the t-1 th iteration;
the jacobian iterative method converges when the equation (15) is constant for all boundary pixels:
And step S3, repeating the processes from the step S1 to the step S2 to respectively obtain the enhanced brightness value corresponding to each non-boundary pixel in each image block.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211365819.9A CN115660994B (en) | 2022-10-31 | 2022-10-31 | Image enhancement method based on regional least square estimation |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211365819.9A CN115660994B (en) | 2022-10-31 | 2022-10-31 | Image enhancement method based on regional least square estimation |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115660994A CN115660994A (en) | 2023-01-31 |
CN115660994B true CN115660994B (en) | 2023-06-09 |
Family
ID=84995294
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211365819.9A Active CN115660994B (en) | 2022-10-31 | 2022-10-31 | Image enhancement method based on regional least square estimation |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115660994B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116703888B (en) * | 2023-07-28 | 2023-10-20 | 菏泽城建新型工程材料有限公司 | Auxiliary abnormality detection method and system for bored pile construction |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112037144A (en) * | 2020-08-31 | 2020-12-04 | 哈尔滨理工大学 | Low-illumination image enhancement method based on local contrast stretching |
CN114429426A (en) * | 2021-12-20 | 2022-05-03 | 哈尔滨理工大学 | Low-illumination image quality improvement method based on Retinex model |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6236751B1 (en) * | 1998-09-23 | 2001-05-22 | Xerox Corporation | Automatic method for determining piecewise linear transformation from an image histogram |
CN101340511B (en) * | 2008-08-07 | 2011-10-26 | 中兴通讯股份有限公司 | Adaptive video image enhancing method based on lightness detection |
CN102298770B (en) * | 2011-08-11 | 2014-03-12 | 奇瑞汽车股份有限公司 | Method and apparatus for enhancing image contrast |
CN105654438A (en) * | 2015-12-27 | 2016-06-08 | 西南技术物理研究所 | Gray scale image fitting enhancement method based on local histogram equalization |
CN106897972A (en) * | 2016-12-28 | 2017-06-27 | 南京第五十五所技术开发有限公司 | A kind of self-adapting histogram underwater picture Enhancement Method of white balance and dark primary |
JP7137185B2 (en) * | 2018-05-30 | 2022-09-14 | 株式会社朋栄 | Tone mapping processing method by edge strength maximization and HDR video conversion device |
CN109064426B (en) * | 2018-07-26 | 2021-08-31 | 电子科技大学 | Method and device for suppressing glare in low-illumination image and enhancing image |
-
2022
- 2022-10-31 CN CN202211365819.9A patent/CN115660994B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112037144A (en) * | 2020-08-31 | 2020-12-04 | 哈尔滨理工大学 | Low-illumination image enhancement method based on local contrast stretching |
CN114429426A (en) * | 2021-12-20 | 2022-05-03 | 哈尔滨理工大学 | Low-illumination image quality improvement method based on Retinex model |
Also Published As
Publication number | Publication date |
---|---|
CN115660994A (en) | 2023-01-31 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110599415B (en) | Image contrast enhancement implementation method based on local self-adaptive gamma correction | |
CN105608676B (en) | The Enhancement Method and device of a kind of video image | |
CN106251300B (en) | A kind of quick night Misty Image restored method based on Retinex | |
CN105225210B (en) | A kind of self-adapting histogram enhancing defogging method based on dark | |
US10521885B2 (en) | Image processing device and image processing method | |
CN103218778B (en) | The disposal route of a kind of image and video and device | |
CN112037144B (en) | Low-illumination image enhancement method based on local contrast stretching | |
CN107292842B (en) | Image deblurring method based on prior constraint and outlier suppression | |
CN107292830B (en) | Low-illumination image enhancement and evaluation method | |
WO2020124873A1 (en) | Image processing method | |
CN110211070B (en) | Low-illumination color image enhancement method based on local extreme value | |
CN104504662A (en) | Homomorphic filtering based image processing method and system | |
CN111145105B (en) | Image rapid defogging method and device, terminal and storage medium | |
CN115660994B (en) | Image enhancement method based on regional least square estimation | |
CN113327206A (en) | Image fuzzy processing method of intelligent power transmission line inspection system based on artificial intelligence | |
CN109345479B (en) | Real-time preprocessing method and storage medium for video monitoring data | |
CN110349113B (en) | Adaptive image defogging method based on dark primary color priori improvement | |
CN108765337B (en) | Single color image defogging processing method based on dark channel prior and non-local MTV model | |
CN104268845A (en) | Self-adaptive double local reinforcement method of extreme-value temperature difference short wave infrared image | |
CN104715456B (en) | A kind of defogging method of image | |
CN112907461A (en) | Defogging and enhancing method for infrared degraded image in foggy day | |
CN111489333A (en) | No-reference night natural image quality evaluation method | |
CN109118441B (en) | Low-illumination image and video enhancement method, computer device and storage medium | |
CN114862706B (en) | Tone mapping method for keeping gradient direction of image | |
CN114429426B (en) | Low-illumination image quality improvement method based on Retinex model |
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 |