CN113888419A - Method for removing dark corners of image - Google Patents

Method for removing dark corners of image Download PDF

Info

Publication number
CN113888419A
CN113888419A CN202111112586.7A CN202111112586A CN113888419A CN 113888419 A CN113888419 A CN 113888419A CN 202111112586 A CN202111112586 A CN 202111112586A CN 113888419 A CN113888419 A CN 113888419A
Authority
CN
China
Prior art keywords
image
brightness
vignetting
parameter
value
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.)
Pending
Application number
CN202111112586.7A
Other languages
Chinese (zh)
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.)
Nanjing University
Original Assignee
Nanjing 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 Nanjing University filed Critical Nanjing University
Priority to CN202111112586.7A priority Critical patent/CN113888419A/en
Publication of CN113888419A publication Critical patent/CN113888419A/en
Pending legal-status Critical Current

Links

Images

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
    • G06T5/00Image enhancement or restoration
    • G06T5/40Image enhancement or restoration using histogram techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/70Denoising; Smoothing

Landscapes

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

Abstract

The invention discloses an image vignetting removing method. The method comprises the following steps: step 1, processing an vignetting image entropy value by using logarithmic mapping: mapping image brightness to [0, N-1] according to a logarithmic mapping formula i (L) ═ N-1)1og (1+ L)/1og 256]Wherein L represents the image brightness, and N is a parameter; then the mapped brightness is formulated
Figure DDA0003274311790000011
Figure DDA0003274311790000012
Carrying out histogram information statistics to obtain corresponding values of all brightness of the image, wherein x and y are horizontal and vertical coordinates of pixel points, and nkIs a histogram element; and 2, dimming the image processed in the step 1 to reduce the brightness. The method provided by the invention has the characteristic of high energy efficiency while greatly improving the operation speed.

Description

Method for removing dark corners of image
Technical Field
The invention relates to the field of machine learning such as image processing, in particular to an image vignetting removing method based on logarithmic mapping and hill climbing algorithm.
Background
The dark-corner image has a characteristic that the brightness of four corners of the image is significantly reduced, and is greatly different from an actual image. And (5) carrying out vignetting elimination on the image to realize vignetting elimination or local elimination operation. Most of the traditional method for removing the vignetting is based on the original entropy value of the image. If there is a vignetting in the image, there will be two peaks in its information histogram. And the process of correcting for vignetting is the process of bringing one lower peak closer to another higher peak. In the process, the entropy values of the traditional method are increased, and the entropy values are reduced only when two peaks are overlapped, but the difficulty of solving a global optimal solution is increased, and a correction algorithm is time-consuming.
In addition, the common logarithm mapping method also has a bug in mathematical derivation and a false recognition that the geometric center of a default picture is an optical center. According to the literature (R.K.Lenz and R.Y.Tsai.techniques for alignment of the scale factor and image center for high access 3-D Machine vision. IEEE Transactions on Pattern Analysis and Machine understanding, 10(5):713 and 720,1988), it is known that the optical center of a picture and the geometric center of a picture do not always coincide. Therefore, the existing method for removing the dark corners needs to be improved.
Disclosure of Invention
In view of the above prior art, it is an object of the present invention to provide an improved method of image de-vignetting.
The technical scheme adopted by the invention is as follows:
a method of image de-vignetting, the method comprising the steps of:
step 1, processing an vignetting image entropy value by using logarithmic mapping: mapping the image brightness to [0, N-1] log (1+ L)/log 256 according to the logarithmic mapping formula i (L) ═ N-1) log (1+ L)/log 256]Wherein L represents the image brightness, and N is a parameter; then the mapped brightness is formulated
Figure BDA0003274311770000011
Figure BDA0003274311770000012
Carrying out histogram information statistics to obtain corresponding values of all brightness of the image, wherein x and y are horizontal and vertical coordinates of pixel points, and nkIs a histogram element;
and 2, dimming the image processed in the step 1 to reduce the brightness.
According to the image vignetting removing method, the logarithmic entropy can be optimized to solve a global optimal solution, the speed of solving the correction function g can be improved by the hill climbing algorithm, the geometric center and the optical center of the image are not considered to be overlapped, so that the algorithm precision is improved, and the performance of the whole method is improved. Compared with the traditional vignetting removal method, the method has the advantages that the logarithmic entropy and the computational advantages of the hill climbing algorithm are utilized, the geometric center and the optical center of the image are distinguished, and the function of efficiently solving the global optimal solution can be realized.
Drawings
FIG. 1 is a normal image histogram and entropy values;
FIG. 2 is a graph of image histograms and entropy values after log mapping;
fig. 3 is a block flow diagram of the method of the present invention.
Detailed Description
The technical contents and effects of the present invention are further explained below with reference to the drawings and examples.
As shown in fig. 1, the vignetting image histogram is generally a bimodal distribution with a low brightness peak near normal brightness. Therefore, the process of correcting the vignetting includes: bimodal approach and entropy change, as shown in fig. 2, specifically:
(1) double peaks are close: when the dark angle is corrected, the low lightness peak gradually approaches to the high lightness peak and overlaps to overlap.
(2) Change in entropy value: when the double peaks are close, the entropy value of the whole image is unchanged. The entropy value does not start to increase gradually until the two peaks start to overlap.
Aiming at the defects of the prior method, the solution of the invention for removing the vignetting of the image is as follows:
firstly, processing an image entropy value in a logarithmic mapping mode to solve a global optimal solution, specifically:
step 11, for m pixel values of an image, mapping each pixel value into a range of [0, N-1] according to a logarithmic mapping formula i (L) ═ N-1) log (1+ L)/log 256, wherein L represents the brightness of the image, and N is a parameter, usually 256 is taken;
step 12, for m mapped pixel values of the image, the original histogram information statistical method is changed in the present embodiment, and a new method is adopted to statistically obtain corresponding values of each brightness of the image, that is, corresponding values of each brightness of the image are obtained
Figure BDA0003274311770000021
Wherein x and y are horizontal and vertical coordinates of the pixel points, i is the logarithmic mapping in step 11, and nkThe meaning of k is determined by the condition under the sign of the summation, being an element of the histogram.
Step 13, the obtained histogram has huge adjustment of color levels, so that most color levels have no histogram information. For this, gaussian smoothing may be performed on the histogram of step 2) to obtain a new histogram;
step 14, for the histogram after Gaussian smoothing, the entropy of the image is processed according to the logarithmic entropy formula, i.e.
Figure BDA0003274311770000031
Wherein
Figure BDA0003274311770000032
j is to satisfy
Figure BDA0003274311770000038
All of the pixels of (a) are,
Figure BDA0003274311770000033
Gσis a gaussian smoothed convolution kernel.
And (II) optimizing the correction dark corner by adopting a hill climbing algorithm, which specifically comprises the following steps:
step 21, assuming that the coordinates of each point of the vignetting image are (x, y),
Figure BDA0003274311770000034
coordinates of the center point of the image; the corrected image brightness is expressed by a new formula as:
Lcorr(x,y)=Lorig(x,y)*ga,b,c(r)
Figure BDA0003274311770000035
wherein L iscorr(x, y) represents the corrected luminance, Lorig(x, y) represents luminance before correction, ga,b,cAnd (r) represents a correction function, and is determined by four parameters of a, b, c and r, and r is determined by the point coordinate and the picture center coordinate. According to the conventional knowledge, the dark corner image should become gradually darker from the center point to the periphery of the image according to the function ga,b,c(r) should be monotonically increasing with r (since the present invention corrects vignetting images, the closer the edge-wise the multiplication the larger the function value should be), so the function ga,b,cThe first derivative of (r) should be greater than 0 and the parameter r e 0,1]. After obtaining the constraint, the function ga,b,cThe solution of (r) satisfies the relationship shown by the following formula:
Figure BDA0003274311770000036
wherein C is1,C2,C3,C4,C5The following conditions are satisfied:
C1=(c≥0∧4b2-12ac<0)
C2=(c≥0∧4b2-12ac≥0∧q-≤0∧q+≤0)
C3=(c≥0∧4b2-12ac≥0∧q_≥0∧q+≥0)
C4=(c<0∧q-≤0∧q+≥0)
C5=(c<0∧q-≥0∧q+≤0)
Figure BDA0003274311770000037
in step 22, there are many sets of parameter arrays (a, b, c) that satisfy the above relations, but such that the function g isa,b,c(r) the parameter array (a, b,c) there is only one group. In this embodiment, the constants a, b, and c are solved quickly by using a hill-climbing optimization algorithm. The algorithm first finds a locally optimal solution, i.e. a set of arrays (a, b, c) that minimize the logarithmic entropy H obtained in step 14 above.
Step 23, increasing or decreasing each parameter of the array (a, b, c) obtained in step 22 by delta, wherein delta is larger than 0. According to this method, the entropy value is updated to another lower entropy value. If the entropy value is not changed, delta is multiplied by a reduction factor k, 0 < k < 1.
And 24, continuing to update the entropy value according to the method of the steps 21-23 until the entropy value becomes minimum, namely the required unknown constants a, b and c.
Wherein, in step 21, C is due to the existing hill climbing algorithm1,C2,C3,C4,C5Many of these conditions are not reasonable. Such as C2,C3When c is 0, q+,q-It is not undefined. Therefore, the present invention proposes the function gq,b,cThe parameters (a, b, c) of (r) need to satisfy new constraints as follows:
Figure BDA0003274311770000042
Figure BDA0003274311770000043
Figure BDA0003274311770000044
C1=(a>0∧b=c=0)
C2=(a≥0∧b>0∧c=0)
C3=(c=0Λb<0Λ-a≤2b)
C4=(c>0Λb2<3ac)
C5=(c>0Λb2=3acΛb≥0)
C6=(c>0Λb2=3acΛ-b≥3c)
C7=(c>0∧b2>3ac∧q+≤0)
C8=(c>0∧b2>3ac∧q->1)
C9=(c<0∧b2>3ac∧q+≥1∧q-≤1)
Figure BDA0003274311770000041
by the new constraint condition, the situation that the global optimal solution cannot be obtained due to the set defects of the original constraint condition can be avoided. And the new constraint condition simplifies the original constraint condition, increases the rigor of mathematical derivation, and simplifies the calculation, so that the performance of the algorithm is improved.
In addition, in the existing hill climbing algorithm, the optical center of a picture and the geometric center of the picture are often considered as one point. The embodiment provides an improved method, which comprises the following specific steps:
step 1, extracting the brightness of the picture through a low-pass Gaussian filter. The purpose of this is to obtain a brightness and brightness estimate of the original image, resulting in an entropy value of the image.
Step 2, calculating the center CM according to the following formula:
Figure BDA0003274311770000051
wherein I (I, j) is the entropy value of a certain point of the N x M image obtained according to step 1.
Step 3, updating the formula of the calculation parameter r by using the obtained CM,
Figure BDA0003274311770000052
where v1=(a+δ,b,c),v2=(a-δ,b,c)
and 4, repeating the formula calculation of the step 11, the step 12, the step 14 and the step 21 by using the parameter r updated in the step 3 to obtain a final new logarithm entropy value H.
If the last output log entropy is the minimum, then the current set of parameters (a, b, c) is the last one. Otherwise, the delta is changed to half of the original delta, and the calculation is repeated.
Although the above calculation can distinguish the optical center and the geometric center of the picture, the calculation amount for realizing the method by hardware is too large. The present embodiment further simplifies the calculation.
First, it is observed that if the image aspect is compressed into the original image 1/5 or 1/10, the final output result is not affected much. But reduced in algorithm complexity to 1/25 or 1/100. And three parameters a, b, c ∈ [ -2,2]And r ∈ (0, 1). And r is2,r4,r6In this range the decay is very fast, i.e. its value has less and less influence in the formula. Therefore, in this embodiment, a, b, and c are discrete, and the intervals are set to 0.2. Then, whether the constraint conditions are reasonable or not is judged according to the new constraint conditions provided by the invention.
After a, b and c meeting the new constraint condition are obtained, the position of the optical center is calculated according to the formula CM calculated in the step 2 and the formula r calculated in the step 3.
Finally the image is corrected according to step 21. In calculating the correction formula, for ga,b,cRoot computation of the derivative of (r), where 1-2 multipliers are used, and the multipliers are multiplexed to reduce hardware overhead.
The method of the invention can reduce the cost of hardware and accelerate the speed of processing the image by the hardware. The method can be applied to the application fields of image optimization, photography and the like.

Claims (4)

1. An image de-vignetting method, characterized in that the method comprises the steps of:
step 1, processing an vignetting image entropy value by using logarithmic mapping: the image brightness is mapped according to a logarithmic mapping formula i (L) -1 log (1+ L)/log 256 to map to [0, N-1]Wherein L represents the image brightness, and N is a parameter; then the mapped brightness is formulated
Figure FDA0003274311760000014
Figure FDA0003274311760000015
Carrying out histogram information statistics to obtain corresponding values of all brightness of the image, wherein x and y are horizontal and vertical coordinates of pixel points, and nkIs a histogram element;
and 2, dimming the image processed in the step 1 to reduce the brightness.
2. The method for removing the vignetting of the image according to claim 1, wherein in the step 2, the dimming operation comprises the following specific steps:
step 21, assuming that the coordinates of each point of the vignetting image are (x, y),
Figure FDA0003274311760000011
coordinates of the center point of the image; the corrected image brightness is formulated as:
Lcorr(x,y)=Lorig(x,y)*ga,b,c(r)
Figure FDA0003274311760000012
wherein L iscorr(x, y) represents the corrected luminance, Lorig(x, y) represents luminance before correction, ga,b,c(r) represents a correction function; a. b and c are three parameters;
step 22, utilizing constraint conditions: function ga,b,cThe first derivative of (r) is greater than 0 and the parameter r ∈ [0, 1]]The relationship can be found:
Figure FDA0003274311760000013
C1=(a>0∧b=c=0)
C2=(a≥0∧b>0∧c=0)
C3=(c=0∧b<0∧-a≤2b)
C4=(c>0∧b2<3ac)
C5=(c>0∧b2=3ac∧b≥0)
C6=(c>0∧b2=3ac∧-b≥3c)
C7=(c>0∧b2>3ac∧q+≤0)
C8=(c>0∧b2>3ac∧q->1)
C9=(c<0∧b2>3ac∧q+≥1∧q-≤1)
wherein the content of the first and second substances,
Figure FDA0003274311760000021
using the above relationship to find a set of correction functions g for step 21a,b,c(r) the smallest parameter array (a, b, c).
3. The method for removing the vignetting of the image according to claim 2, wherein in the step 22, the parameter array is rapidly solved through a hill-climbing algorithm, and the specific method is as follows: increasing or decreasing each parameter of the parameter array (a, b, c) by a value δ, δ > 0; then the function ga,b,c(r) updating the function value to a new function value, if the updated logarithm entropy value is not changed, multiplying the value delta by a reduction factor k, wherein k is more than 0 and less than 1; and continuing to update the function value until the logarithm entropy value becomes minimum, thus obtaining the required parameter array (a, b, c).
4. The method according to claim 3, wherein in step 21, the method for calculating the brightness of the pixel points of the image and the geometric distance between the pixel points and the center of the image comprises:
step 211, extracting the brightness of the picture through a low-pass Gaussian filter to obtain the brightness of the picture;
step 212, calculating the center coordinate according to the following formula, and recording as CM:
Figure FDA0003274311760000022
where I (I, j) is the brightness of a certain point of the N x M image obtained according to step 211;
step 213, updating the calculation parameter r with the obtained CM:
Figure FDA0003274311760000023
wherein v1 ═ a + δ, b, c, v2 ═ a- δ, b, c, CM ═ CM1,CM2)。
CN202111112586.7A 2021-09-23 2021-09-23 Method for removing dark corners of image Pending CN113888419A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111112586.7A CN113888419A (en) 2021-09-23 2021-09-23 Method for removing dark corners of image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111112586.7A CN113888419A (en) 2021-09-23 2021-09-23 Method for removing dark corners of image

Publications (1)

Publication Number Publication Date
CN113888419A true CN113888419A (en) 2022-01-04

Family

ID=79009997

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111112586.7A Pending CN113888419A (en) 2021-09-23 2021-09-23 Method for removing dark corners of image

Country Status (1)

Country Link
CN (1) CN113888419A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116523774A (en) * 2023-04-14 2023-08-01 北京天睿空间科技股份有限公司 Shadow correction method suitable for video image

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070279500A1 (en) * 2006-06-05 2007-12-06 Stmicroelectronics S.R.L. Method for correcting a digital image
JP2008060627A (en) * 2006-08-29 2008-03-13 Brother Ind Ltd Image processing program and image processing apparatus
CN107172323A (en) * 2017-05-27 2017-09-15 昆山中科盖德微视光电有限公司 The image of large-field shooting head goes dark angle method and device
CN109410126A (en) * 2017-08-30 2019-03-01 中山大学 A kind of tone mapping method of details enhancing and the adaptive high dynamic range images of brightness

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070279500A1 (en) * 2006-06-05 2007-12-06 Stmicroelectronics S.R.L. Method for correcting a digital image
JP2008060627A (en) * 2006-08-29 2008-03-13 Brother Ind Ltd Image processing program and image processing apparatus
CN107172323A (en) * 2017-05-27 2017-09-15 昆山中科盖德微视光电有限公司 The image of large-field shooting head goes dark angle method and device
CN109410126A (en) * 2017-08-30 2019-03-01 中山大学 A kind of tone mapping method of details enhancing and the adaptive high dynamic range images of brightness

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116523774A (en) * 2023-04-14 2023-08-01 北京天睿空间科技股份有限公司 Shadow correction method suitable for video image
CN116523774B (en) * 2023-04-14 2024-02-02 北京天睿空间科技股份有限公司 Shadow correction method suitable for video image

Similar Documents

Publication Publication Date Title
CN111260543B (en) Underwater image splicing method based on multi-scale image fusion and SIFT features
US9454810B2 (en) Correcting chrominance values based onTone-mapped luminance values
US8090214B2 (en) Method for automatic detection and correction of halo artifacts in images
US10038862B2 (en) Methods and apparatus for automated noise and texture optimization of digital image sensors
KR20120072245A (en) Apparatus and method for stereo matching
JP2008263475A (en) Image processing device, method, and program
US8406559B2 (en) Method and system for enhancing image sharpness based on local features of image
CN112819721B (en) Method and system for reducing noise of image color noise
JP6548907B2 (en) IMAGE PROCESSING APPARATUS, IMAGE PROCESSING METHOD, AND PROGRAM
CN114693760A (en) Image correction method, device and system and electronic equipment
CN110175967B (en) Image defogging processing method, system, computer device and storage medium
CN113888419A (en) Method for removing dark corners of image
WO2020107308A1 (en) Low-light-level image rapid enhancement method and apparatus based on retinex
CN110610525B (en) Image processing method and device and computer readable storage medium
CN109035178B (en) Multi-parameter value tuning method applied to image denoising
CN114390266B (en) Image white balance processing method, device and computer readable storage medium
JPH1117984A (en) Image processor
CN114998186A (en) Image processing-based method and system for detecting surface scab defect of copper starting sheet
CN109886901B (en) Night image enhancement method based on multi-channel decomposition
CN109816613B (en) Image completion method and device
CN115830352B (en) Image similarity comparison method, device and storage medium
WO2006112814A1 (en) Edge-sensitive denoising and color interpolation of digital images
CN114638763B (en) Image defogging method, system, computer device and storage medium
CN117893455B (en) Image brightness and contrast adjusting method
CN112598679B (en) Sky area segmentation method and device

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