CN116523774B - Shadow correction method suitable for video image - Google Patents

Shadow correction method suitable for video image Download PDF

Info

Publication number
CN116523774B
CN116523774B CN202310397009.XA CN202310397009A CN116523774B CN 116523774 B CN116523774 B CN 116523774B CN 202310397009 A CN202310397009 A CN 202310397009A CN 116523774 B CN116523774 B CN 116523774B
Authority
CN
China
Prior art keywords
image
shadow
shading correction
correction parameters
parameters
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202310397009.XA
Other languages
Chinese (zh)
Other versions
CN116523774A (en
Inventor
吴刚
林姝含
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Tianrui Kongjian Technology Co ltd
Original Assignee
Beijing Tianrui Kongjian Technology Co ltd
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 Beijing Tianrui Kongjian Technology Co ltd filed Critical Beijing Tianrui Kongjian Technology Co ltd
Priority to CN202310397009.XA priority Critical patent/CN116523774B/en
Publication of CN116523774A publication Critical patent/CN116523774A/en
Application granted granted Critical
Publication of CN116523774B publication Critical patent/CN116523774B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • G06T5/77
    • G06T5/80
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T10/00Road transport of goods or passengers
    • Y02T10/10Internal combustion engine [ICE] based vehicles
    • Y02T10/40Engine management systems

Abstract

The invention relates to a shading correction method suitable for video images, which adopts a shading correction function to carry out shading correction on the images, sets up a plurality of candidate shading parameters, periodically selects an optimal group from the plurality of candidate shading correction parameters as a current shading correction parameter in the period based on the current input image, adopts the current shading correction parameter to carry out shading correction on all the images to be corrected in the period, and calculates and compares the information entropy of logarithmic images of the images after the shading correction when carrying out the shading correction constant parameter update, and takes the candidate shading correction parameter corresponding to the minimum information entropy as the current shading correction parameter. The invention is suitable for the dynamic correction of the shadow of the single-channel video, can be also used for image preprocessing or other suitable occasions during multi-channel video splicing, can well eliminate splicing stripes caused by image shadow, and has good real-time performance and self-adaption.

Description

Shadow correction method suitable for video image
Technical Field
The invention relates to a shading correction method suitable for video images.
Background
Image shading refers to a phenomenon in which the brightness of an image gradually becomes darker as the distance from the pixel position to the center of the image increases, also called halation. This phenomenon is common in photographic imaging systems and is related to the optical properties of the lens, the sensor performance and the illumination. The image shadows not only reduce the image quality and the look and feel, but also bring difficulties to subsequent processing. For example, in an image stitching application, if an image with a shadow is directly used for stitching, streaks with alternate brightness appear in the image, which greatly affects the stitching effect.
The existing image shading correction methods are roughly divided into two categories: (1) correction method based on multiple images: the correction is carried out by adopting a plurality of images with a certain overlapping area, and the correction method is mainly used for improving the light and shade alternate stripes generated during image stitching. (2) Correction methods based on a single image can be divided into two types: the image calibration method is characterized in that a camera shoots a white calibration plate, and pixel value distribution of the obtained image is counted, so that a shadow correction parameter is obtained; the self-adaptive method optimizes the parameters of the correction function based on a certain image quality evaluation index to obtain the optimal correction effect.
These existing shadow correction methods have various characteristics and are respectively suitable for the respective adapted occasions, however, certain limitations exist. For example, a correction method based on a plurality of images requires that there is an overlapping region between the plurality of images to be corrected, and that the overlapping region cannot have a shadow at the same time, and that applicable scenes are limited; the image calibration method based on a single image is generally only suitable for laboratory environment, has higher requirements on lamplight and a calibration plate, and particularly has no calibration condition for an imaging system which is put into use, so that the method is difficult to be practical; although the self-adaptive method based on the single image has good effect on shadow correction of the single image, certain difficulty exists when the method is popularized to video processing, because the method is based on the pre-estimated fixed parameters, and in actual conditions, the image shadow characteristics can dynamically change along with factors such as weather, illumination and the like, for example, the shadow in cloudy days is usually more obvious than that in sunny days, so that good correction effect cannot be obtained in many cases by adopting the pre-estimated fixed parameters, in addition, the method adopts the iterative optimization method to estimate the shadow correction parameters, the calculated amount is large, the real-time completion is difficult, the optimization process is sometimes even not converged, and unexpected correction results can be caused.
Disclosure of Invention
In order to overcome the above-mentioned drawbacks of the prior art, the present invention provides a shading correction method with dynamically variable parameters, which updates the parameters of the correction function periodically to adapt to the change of the shading characteristic with time.
The technical scheme of the invention is as follows: a shading correction method suitable for video images adopts the following formula to carry out shading correction on the images:
wherein the method comprises the steps of
I (x, y) is the current input image (pre-correction image, or original image, or shadow image), I (x, y) is the pixel point coordinates, wherein the coordinates of the center point (or 0 point) of the image are (x) 0 ,y 0 );
f(r)=1+ar 2 +br 4 +cr 6 For the shading correction function, a, b and c are the corresponding constants in the function f (r), called shading correction parameters, r is the distance parameter involved in the shading correction,
in case the shadow feature is radially symmetric about (corresponds to) the image center point,
in the case where the shadow feature is axisymmetric about (corresponding to) the longitudinal axis of the over-image center,
r=|x-x 0 |/x 0
setting up multiple sets of candidate shadow parameters, periodically (periodically) selecting an optimal set of the multiple sets of candidate shadow correction parameters as a current shadow correction parameter (or called a current shadow correction parameter) in a corresponding period (period or time interval) based on a current input image, and carrying out shadow correction on all images to be corrected in the period by adopting the current shadow correction parameter (taking the current shadow correction parameter as a corresponding constant of a shadow correction function).
Preferably, the optimal set of candidate shading correction parameters is selected from the following sets of candidate shading correction parameters: and respectively carrying out shading correction on the current image by adopting each group of candidate shading correction parameters to obtain a plurality of shading corrected images corresponding to each group of shading correction parameters, calculating and comparing the information entropy of the logarithmic images of each shading corrected image, and taking the candidate shading correction parameters corresponding to the minimum information entropy as the current shading correction parameters.
Preferably, a plurality of image samples (for example, image samples under different time or different illumination conditions) with different shading degrees/characteristics are selected, the optimized shading correction parameters of each image sample are obtained through operation, a clustering algorithm is adopted to perform clustering operation on the optimized shading correction parameters of the plurality of image samples, and each clustering center is used as a candidate correction parameter, so that a plurality of groups of candidate shading correction parameters are formed.
Preferably, an iterative optimization method is adopted to estimate the optimized shading correction parameters of each image sample, and the optimization target is that the information entropy of the logarithmic image of the image after shading correction is minimized.
Preferably, the logarithmic image of the image (either image) is calculated according to the following formula:
the gray scale value range of the image is set to be 0,255,
G log =255*log(G+1)/log256,
G log is a logarithmic image of image G.
Preferably, the information entropy of an image (any image, including a logarithmic image of the image) is calculated according to the following formula:
wherein,
h is the information entropy of the image, K is the number of intervals obtained by dividing the value range of the logarithmic image, K is a positive integer greater than 1, k=1, 2,3, … and K is the interval serial number under the condition that the value range of the logarithmic image is divided into K intervals, and p k The proportion of the number of pixels whose image value falls in (or is located in) the kth interval is the image value.
The beneficial effects of the invention are as follows: the parameters of the shading correction function are updated regularly, so that the change of the shading characteristic along with time can be well self-adapted; because the group which is most suitable for the current image is selected from a plurality of groups of shadow correction parameters estimated in advance when the parameters are updated, the large calculation cost existing when the parameters are estimated on line by adopting an iterative method is overcome, and the unexpected result possibly caused by the non-convergence of the algorithm is avoided.
The invention is suitable for the dynamic correction of the shadow of the single-channel video, can be also used for image preprocessing or other suitable occasions during multi-channel video splicing, can well eliminate splicing stripes caused by image shadow, and has good real-time performance and self-adaption.
Drawings
FIG. 1 is an overall flow chart in accordance with the present invention;
fig. 2 is an image correction function example according to the present invention.
Detailed Description
The overall flow of the invention is shown in fig. 1, and includes an off-line estimated parameter stage and an on-line shading correction parameter stage on a time axis. Wherein,
offline parameter estimation stage: a certain number of image samples with different shadow characteristics are collected in advance, and a plurality of groups of candidate shadow correction parameters are generated;
on-line shading correction parameter stage: and carrying out real-time processing on the input video image, and selecting one group from a plurality of candidate parameters obtained in an offline parameter estimation stage to serve as a current-stage shadow correction parameter periodically or in real time.
The method according to the invention is further described below.
1. Shadow correction
Whether the shading correction is actually performed on the image or the shading correction involved in the selection of the candidate shading correction parameter and the current shading correction parameter, the image correction can be described by the following formula:
wherein I is,Representing the pre-and post-correction images, respectively, f represents the correction function, which varies with pixel position (x, y) to the center of the image (x 0 ,y 0 ) The distance parameter r of (c) increases and increases, thereby being denoted as f (r).
Since f (r) satisfies a certain symmetry, it can be defined as an even order polynomial function of r:
f(r)=1+ar 2 +br 4 +cr 6 (2)
wherein a, b, c are shading correction parameters to be estimated, the combination of a, b, c can be called a group of shading correction parameters, and the value range of r is in the interval of [0,1 ].
Equation (2) can be expressed by f (r) at point 0 (x 0 ,y 0 ) Is pushed out by taylor expansion: since there is no shadow at the center of the image, f (0) =1; and because the shadow is symmetrical about the center of the image, the odd term is ignored to make f (r) an even function, and enough precision can be obtained by reserving the odd term to 6 times, so that the formula (2) is obtained.
For vignetting correction, the vignetting characteristics are radially symmetric about the image center point, allowing
For the dark edge correction, the dark shadow characteristic is axisymmetric about the longitudinal axis of the center of the over-image, and can make
r=|x-x 0 |/x 0 (4)
2. Offline prediction parameters
The process is finished off-line, and aims to obtain a plurality of groups of optional parameters for the subsequent parameter correction stage so as to adapt to image shadows with different degrees, and the method comprises the following specific steps:
1) Image samples with different degrees of shadows and different shadow characteristics under different time and illumination conditions are collected/selected.
2) For each image sample, the shading correction parameters (a, b, c in equation 2) are estimated using an iterative optimization method, wherein the optimization objective function is based on the image log entropy. The calculation method comprises the following steps:
firstly, carrying out logarithmic transformation on an image, and setting the gray scale value range of the image to be [0,255]]Calculating an image I (i.e. image I (xLog image I of y) log (or expressed as I) log (x,y)):
I log =255*log(I+1)/log256 (5)
Then calculate the logarithmic image I log Information entropy H of (2):
where K is the range of values of the logarithmic image (also 0,255]) The number of sections (bin number) obtained by division, for example, k=16 when sixteen equal sections are obtained; k is the range of values of the logarithmic image (also 0,255]) Interval number when dividing into K intervals, k=1, 2,3, …, K; p is p k The ratio of the number of pixels whose image value falls in the kth section.
Without loss of generality, for any image G, its log image G log Calculated according to the following formula:
G log =255*log(G+1)/log256。
equation (6) is also adapted to calculate the entropy of any image.
The entropy value characterizes the degree of disorder of the distribution of image values, the more disorder the distribution is, the greater the entropy value is. Generally, the image value distribution of the shadow image is more disordered, i.e. the entropy value is larger, compared with the corrected image without shadow, so the optimization process is to find a set of parameters a, b and c, so that the entropy value of the image corrected by the set of parameters is smaller. The logarithmic entropy is adopted instead of directly calculating the information entropy of the original image, because the logarithmic entropy has the invariance of image brightness, namely, the corresponding logarithmic entropy of the image is still unchanged after the image is multiplied by a constant coefficient, so that the global optimal solution is more favorable to be obtained in the optimization process.
3) Clustering the shading correction parameters of the image samples obtained in the step 2) by adopting a clustering algorithm, and taking the clustering center as a candidate shading correction parameter, thereby forming a plurality of groups of candidate shading correction parameters.
The clustering number can be pre-specified (such as 3 or 4 types), and particularly can be based on the conditions of precision requirements, computing capacity and the like, and the clustering method can adopt algorithms such as k-means and the like.
3. On-line parameter correction
The process is periodically executed, and according to the current input image, the optimal candidate parameter is selected from a plurality of candidate parameters obtained in the offline estimated parameter stage and is used as the current period shading correction parameter to carry out shading correction.
The parameter selection criterion can be based on the image logarithmic entropy, respectively correcting the current image with each set of candidate parameters, and calculating the logarithmic entropy H of the corrected image i Selecting an entropy value H i The smallest set of parameters serves as a shading correction parameter for shading correction of all images to be corrected for the current input image or for a period of time (one period) thereafter, that is, the present-period shading correction parameter.
Wherein a is * ,b * ,c * Correcting parameters for the shadow in the present period, a i ,b i ,c i I=1, 2,3, …, n for the i-th candidate shading correction parameter, the number of the shading correction parameter set, n for the candidate shading correction parameter set, greater than 1, h i To a as i ,b i ,c i And (3) performing shading correction on the current input image as a shading correction parameter to obtain the information entropy of the logarithmic image of the image.
In addition, in order to improve the calculation speed, the current input image can be downsampled, then the image correction and the entropy calculation are carried out, and the time cost of online calculation can be greatly reduced.
Since the influence factor of the shading (for example, the illumination intensity) is gradually changed, the shading correction parameter of the present period can be calculated periodically (every certain time or every certain frame number) once, and the shading correction is performed on all images in the period by adopting the shading correction parameter of the present period, so that the data processing amount can be reduced under the condition of meeting the correction requirement. If necessary, the present shading correction parameter may be calculated for each frame of image to be subjected to shading correction, that is, the period of the image frame is taken as the period.
And judging whether to update the original period of shading correction parameters or not according to the updating period of the shading correction parameters before carrying out image correction, if the input image is in the period suitable for the existing original period of shading correction parameters, carrying out shading correction by using the existing original period of shading correction parameters, if the input image exceeds the period suitable for the existing original period of shading correction parameters, calculating new original period of shading correction parameters by using the image, determining the adaptation period of the new original period of shading correction parameters, and carrying out shading correction on the image and other images in the same period by using the new original period of shading correction parameters.
An example of the correction function of the specific image obtained by the above method can be seen in fig. 2.

Claims (3)

1. A shading correction method suitable for video images adopts the following formula to carry out shading correction on the images:
wherein the method comprises the steps of
I (x, y) is the current input image, or the image before correction, I (x, y) is the pixel point coordinates, wherein the coordinates of the center point (or 0 point) of the image are (x) 0 ,y 0 );
f(r)=1+ar 2 +br 4 +cr 6 For the shading correction function, a, b and c are the corresponding constants in the function f (r), called shading correction parameters, r is the shading corrected distance parameter,
in the case of the shadow feature being radially symmetric about the image center point,
in the case where the shadow feature is axisymmetric about the longitudinal axis of the center of the over-image,
r=|x-x 0 |/x 0
the method is characterized in that:
setting up multiple sets of candidate shadow correction parameters, periodically based on the current input image, selecting an optimal set of candidate shadow correction parameters from the multiple sets of candidate shadow correction parameters as the current shadow correction parameters of the period, carrying out shadow correction on all images to be corrected in the period by adopting the current shadow correction parameters,
selecting multiple image samples with different shadow degrees or characteristics, calculating to obtain optimized shadow correction parameters of each image sample, clustering the optimized shadow correction parameters of the multiple image samples by adopting a clustering algorithm, taking each clustering center as a candidate shadow correction parameter, thereby forming multiple groups of candidate shadow correction parameters,
the optimal mode of selecting one group from the plurality of groups of candidate shadow correction parameters is as follows: respectively adopting each group of candidate shadow correction parameters to carry out shadow correction on the current image, obtaining a plurality of shadow corrected images corresponding to each group of shadow correction parameters, calculating and comparing the information entropy of the logarithmic images of each shadow corrected image, taking the candidate shadow correction parameters corresponding to the minimum information entropy as the current shadow correction parameters,
and estimating the optimized shadow correction parameters of each image sample by adopting an iterative optimization method, wherein the optimization target is the information entropy minimization of the logarithmic image of the image after the shadow correction.
2. The shading correction method for video images as defined in claim 1, wherein the logarithmic image of any one image is calculated according to the following formula:
the gray scale value range of the image is set to be 0,255,
G log =255*log(G+1)/log256,
G log is a logarithmic image of image G.
3. The shading correction method for video image as defined in claim 1, wherein the information entropy of any image is calculated according to the following formula:
wherein,
h is the information entropy of the image, K is the number of intervals obtained by dividing the value range of the logarithmic image, K is a positive integer greater than 1, k=1, 2,3, … and K is the interval serial number under the condition that the value range of the logarithmic image is divided into K intervals, and p k The ratio of the number of pixels of the image whose image value falls in the kth section.
CN202310397009.XA 2023-04-14 2023-04-14 Shadow correction method suitable for video image Active CN116523774B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310397009.XA CN116523774B (en) 2023-04-14 2023-04-14 Shadow correction method suitable for video image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310397009.XA CN116523774B (en) 2023-04-14 2023-04-14 Shadow correction method suitable for video image

Publications (2)

Publication Number Publication Date
CN116523774A CN116523774A (en) 2023-08-01
CN116523774B true CN116523774B (en) 2024-02-02

Family

ID=87393311

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310397009.XA Active CN116523774B (en) 2023-04-14 2023-04-14 Shadow correction method suitable for video image

Country Status (1)

Country Link
CN (1) CN116523774B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005039786A (en) * 2003-07-03 2005-02-10 Matsushita Electric Ind Co Ltd Image processing device, image display device using the same, and image processing method
CN105306913A (en) * 2014-06-16 2016-02-03 聚晶半导体股份有限公司 Image obtaining device and image compensation method thereof
CN106101588A (en) * 2016-07-08 2016-11-09 成都易瞳科技有限公司 The compensation method of panoramic picture gradual halation phenomena
CN107172323A (en) * 2017-05-27 2017-09-15 昆山中科盖德微视光电有限公司 The image of large-field shooting head goes dark angle method and device
WO2020228781A1 (en) * 2019-05-15 2020-11-19 深圳市道通智能航空技术有限公司 Image brightness adjustment method and apparatus, and unmanned aerial vehicle
CN113888419A (en) * 2021-09-23 2022-01-04 南京大学 Method for removing dark corners of image
CN115239569A (en) * 2021-04-23 2022-10-25 中国电信股份有限公司 Image vignetting removal method, panoramic image generation method and related equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5014195B2 (en) * 2008-02-25 2012-08-29 キヤノン株式会社 Imaging apparatus, control method thereof, and program

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005039786A (en) * 2003-07-03 2005-02-10 Matsushita Electric Ind Co Ltd Image processing device, image display device using the same, and image processing method
CN105306913A (en) * 2014-06-16 2016-02-03 聚晶半导体股份有限公司 Image obtaining device and image compensation method thereof
CN106101588A (en) * 2016-07-08 2016-11-09 成都易瞳科技有限公司 The compensation method of panoramic picture gradual halation phenomena
CN107172323A (en) * 2017-05-27 2017-09-15 昆山中科盖德微视光电有限公司 The image of large-field shooting head goes dark angle method and device
WO2020228781A1 (en) * 2019-05-15 2020-11-19 深圳市道通智能航空技术有限公司 Image brightness adjustment method and apparatus, and unmanned aerial vehicle
CN115239569A (en) * 2021-04-23 2022-10-25 中国电信股份有限公司 Image vignetting removal method, panoramic image generation method and related equipment
CN113888419A (en) * 2021-09-23 2022-01-04 南京大学 Method for removing dark corners of image

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Entropy Minimization for Shadow Removal;Graham D. Finlayson et al;《International Journal of Computer Vision》;第35-57页 *
基于多路相机实时拼接的激光准直测量技术研究;罗元;《中国优秀硕士学位论文全文数据库 基础科学辑》;第A005-371页 *

Also Published As

Publication number Publication date
CN116523774A (en) 2023-08-01

Similar Documents

Publication Publication Date Title
CN110248112B (en) Exposure control method of image sensor
CN115633259A (en) Automatic regulation and control method and system for intelligent camera based on artificial intelligence
CN110475123B (en) Manual real-time splicing method for microscope video stream
CN110838091B (en) Fully self-adaptive infrared image contrast enhancement method and system
CN108133462B (en) Single image restoration method based on gradient field region segmentation
CN111212241A (en) High-speed automatic driving automatic exposure control method based on image gradient and entropy fusion
CN110782403A (en) Infrared image non-uniformity correction method
CN113432723B (en) Image processing method, system and computer system for weakening stray radiation
KR102377318B1 (en) High Dynamic Range technique for light exposure compensation and image quality improvement
CN113327206B (en) Image fuzzy processing method of intelligent power transmission line inspection system based on artificial intelligence
CN114494013A (en) Image splicing method, device, equipment and medium
CN116523774B (en) Shadow correction method suitable for video image
Pandian et al. Object Identification from Dark/Blurred Image using WBWM and Gaussian Pyramid Techniques
CN107911599B (en) Infrared image global automatic focusing method and device
KR102277005B1 (en) Low-Light Image Processing Method and Device Using Unsupervised Learning
CN110246169B (en) Gradient-based window adaptive stereo matching method and system
CN113781368B (en) Infrared imaging device based on local information entropy
CN111640068A (en) Unsupervised automatic correction method for image exposure
CN111612720B (en) Wide-angle infrared image optimization method, system and related components
CN111047540B (en) Image defogging method based on sky segmentation and application system thereof
CN113888419A (en) Method for removing dark corners of image
CN112541859A (en) Illumination self-adaptive face image enhancement method
CN116612050B (en) Priori defogging method based on dark channel
CN117061879B (en) Automatic light quantity correction method and system and electronic equipment
Guo et al. Image enhancement algorithm based on background enhancement coefficient

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