CN-122023481-A - Method for inhibiting reflective noise of light supplementing photo
Abstract
The invention discloses a reflection noise suppression method for a light supplementing photo, which comprises the following steps of 1, ORB feature extraction, step 2, feature point matching, namely, matching the extracted feature points through a KNN algorithm, utilizing Hamming distance to measure similarity of the descriptors, and then utilizing a RANSAC algorithm to reject outliers, step 3, calculating a homography matrix, namely, constructing a linear equation set according to the matching point pair relation after outlier rejection, initially solving the homography matrix through a least square method, and then refining matrix parameters through a Levenberg-Marquardt method to obtain a final homography matrix, and step 4, dynamic weight fusion of a reflection noise area.
Inventors
- Deng lun
- CAI WEI
- HU JUN
- CHEN ZHENGHU
- LI YAJUN
- YAN FEI
- LI SILIANG
- ZHU YUANLONG
- ZHOU JUNTAO
Assignees
- 中国长江电力股份有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20260114
Claims (10)
- 1. The method for suppressing the reflection noise of the light supplementing photo is characterized by comprising the following steps of: step 1, ORB feature extraction, namely extracting feature points and descriptors thereof in an image by adopting an ORB feature point extraction method and combining FAST feature point detection and BRIEF descriptors; step 2, feature point matching, namely matching the extracted feature points through a KNN algorithm, measuring descriptor similarity by utilizing a hamming distance, and eliminating outliers of the matched point pairs by adopting a RANSAC algorithm; step 3, calculating a homography matrix, namely constructing a linear equation set according to the matching point pair relation after outlier elimination, preliminarily solving the homography matrix through a least square method, and refining matrix parameters by adopting a Levenberg-Marquardt method to obtain a final homography matrix; And 4, dynamic weight fusion of the reflection noise area, namely after image splicing is completed, setting a brightness threshold value to identify the reflection noise area, fitting reflection noise pixel point distribution by adopting Gaussian distribution, generating Gaussian masks, calculating dynamic weight based on the Gaussian masks, and carrying out fusion treatment on pixels of the overlapping area.
- 2. The method as claimed in claim 1, wherein the FAST feature point detection in step 1 includes defining a circular area around each pixel point p, the area being composed of N equally spaced pixels, and the algorithm comparing the brightness of the central pixel point p Brightness with surrounding N pixels To determine whether p is a feature point.
- 3. The method for suppressing reflection noise of a light-compensating film as recited in claim 1, the method is characterized in that in the step 1, the BRIEF descriptor comprises: for each feature point In its neighborhood, n pairs of pixel points are selected And comparing the gray values of each pair of pixels if The j-th bit of the descriptor is 1, otherwise, 0, and the finally generated descriptor is a binary vector with the length of n.
- 4. The method for suppressing reflective noise of a light-compensating photo according to claim 1, wherein in the step 2, the extracted feature points are matched by KNN algorithm, and measuring the similarity of descriptors by using hamming distance comprises adopting KNN algorithm, taking hamming distance as a measure of similarity of descriptors, calculating hamming distance between descriptors of each feature point in each image and descriptors of all feature points in other images, and screening neighboring feature points according to the magnitude of hamming distance to realize preliminary matching of feature points.
- 5. The method of claim 1, wherein in the step 2, performing outlier rejection on the matching point pairs by using RANSAC algorithm comprises: Step 2.1, randomly selecting 4 point pairs from the matched point pairs, and estimating model parameters of plane homography transformation; step 2.2, estimating a homography matrix by using the selected point pairs, substituting all the matching point pairs into the model, and calculating the re-projection error of each point pair; Step 2.3, setting an error threshold, judging the point pair with the reprojection error smaller than the threshold as an inner point, and judging the rest as outliers; And 2.4, repeating the steps for a plurality of times, selecting the model with the largest number of interior points as a final model, and re-estimating the model parameters by utilizing all the interior points.
- 6. The method for suppressing reflection noise of a light supplementing photo according to claim 1, wherein the specific process of the step 3 is as follows: Step 3.1, setting the matching points in the two images as respectively And The homography matrix H satisfies the following relationship: Wherein H is: Wherein H 11 , h 12 , h 13 is three elements of the first row of the homography matrix H, x i ';h 21 , h 22 , h 23 which is used for calculating the matching point is three elements of the second row of the homography matrix H, y i ';h 31 , h 32 , h 33 which is used for calculating the matching point is three elements of the third row of the homography matrix H, and normalization is performed; and 3.2, solving a homography matrix H by using a least square method, and constructing the following linear equation set for each pair of matching points: step 3.3, constructing a back projection error function: And 3.4, refining by a Levenberg-Marquardt method through giving an initial homography matrix initialization estimation, and further reducing projection errors to obtain final H matrix parameters.
- 7. The method for suppressing reflection noise of a light supplementing photo according to claim 1, wherein the step 4 specifically comprises the following steps: Step 4.1, in the overlapping area, assuming that the image with the reflective noise is A and the image without the reflective noise is B, setting a brightness threshold value T for identifying the reflective noise area in the A, traversing each pixel point (x, y) of the image A, and if the brightness value is greater than the threshold value T, considering that the pixel point has the reflective noise; Step 4.2, fitting the distribution condition of the reflective noise pixels by adopting two-dimensional Gaussian distribution; Step 4.3, generating a Gaussian mask M according to the estimated Gaussian distribution parameters, wherein the value of the Gaussian mask M is higher near the center of the reflection noise area and gradually decreases at a position far from the center; Step 4.4, calculating a dynamic weight w (x, y) according to the value of the Gaussian mask M (x, y), wherein the value range of the dynamic weight w (x, y) is [0,1]; And 4.5, fusing pixels of the A and B images according to the dynamic weight w (x, y).
- 8. The method of claim 7, wherein in the step 4.2, the probability density function of the two-dimensional gaussian distribution is: ; Wherein, the Is a probability density function value of a two-dimensional gaussian distribution, (x, y) is the coordinate of a certain pixel in the image, x is the abscissa, y is the ordinate, Is the mean value of the values, Is the standard deviation, ρ is the correlation coefficient, and these parameters can be estimated by maximum likelihood estimation or other optimization methods.
- 9. The method of claim 7, wherein in the step 4.4, the calculation formula of w (x, y) is as follows: Where the maximum value of all pixels in the gaussian mask M is such that the closer to the gaussian distribution center, the higher the dynamic weight w (x, y) is, and the farther from the center, the lower the weight w (x, y) is.
- 10. The method of claim 7, wherein in the step 4.5, the fused pixel value is expressed as: In the formula, For the pixel value of image a at pixel point (x, y) where reflection noise is present, The pixel value of the image B at the pixel point (x, y) is free of the reflection noise, so that the pixel of the reflection noise area is mainly determined by the pixel value of the image B, and the pixel far from the reflection noise area is determined by the average value of the pixel values of a and B.
Description
Method for inhibiting reflective noise of light supplementing photo Technical Field The invention relates to the technical field of automatic inspection, in particular to a method for inhibiting reflective noise of a light supplementing photo. Background In the field of modern industrial production and automated inspection, robots are widely used in various complex environmental tasks, especially in indoor environments for inspecting critical parts and equipment. These tasks typically require the acquisition of image information of the device by means of visual sensors, such as cameras, for status monitoring, fault diagnosis and data recording. However, in dim indoor environments, natural lighting conditions are often insufficient to meet the need for high quality imaging. In order to ensure the sharpness and detail of the image, it is generally necessary to supplement the photographic subject with light. Although the light filling can obviously improve the overall brightness of the image, a new problem is brought about in that a strong light reflecting area is generated on the photo after the light filling due to the light reflecting characteristic of the surface of the equipment. These retroreflective regions are often very bright and even overexposed, resulting in complete loss of detail in these regions and failure to use for subsequent analysis and processing. Therefore, how to effectively inhibit the reflection noise after light supplement and recover the details of the image becomes a technical problem to be solved urgently. Disclosure of Invention The invention aims to overcome the defects and provide a method for inhibiting reflective noise of a light supplementing photo so as to effectively inhibit reflective noise after light supplementing and restore details of images. In order to solve the technical problems, the invention adopts the technical scheme that the method for suppressing the reflection noise of the light supplementing photo comprises the following steps: step 1, ORB feature extraction, namely extracting feature points and descriptors thereof in an image by adopting an ORB feature point extraction method and combining FAST feature point detection and BRIEF descriptors; step 2, feature point matching, namely matching the extracted feature points through a KNN algorithm, measuring descriptor similarity by utilizing a hamming distance, and eliminating outliers of the matched point pairs by adopting a RANSAC algorithm; step 3, calculating a homography matrix, namely constructing a linear equation set according to the matching point pair relation after outlier elimination, preliminarily solving the homography matrix through a least square method, and refining matrix parameters by adopting a Levenberg-Marquardt method to obtain a final homography matrix; And 4, dynamic weight fusion of the reflection noise area, namely after image splicing is completed, setting a brightness threshold value to identify the reflection noise area, fitting reflection noise pixel point distribution by adopting Gaussian distribution, generating Gaussian masks, calculating dynamic weight based on the Gaussian masks, and carrying out fusion treatment on pixels of the overlapping area. Preferably, in the step 1, the FAST feature point detection includes defining a circular region around each pixel point p, the region being composed of N equally spaced pixel points, and comparing the brightness of the central pixel point p by an algorithmBrightness with surrounding N pixelsTo determine whether p is a feature point. Preferably, in the step 1, the BRIEF descriptor includes, for each feature pointIn its neighborhood, n pairs of pixel points are selectedAnd comparing the gray values of each pair of pixels ifThe j-th bit of the descriptor is 1, otherwise, 0, and the finally generated descriptor is a binary vector with the length of n. Preferably, in the step 2, the extracted feature points are matched through a KNN algorithm, and the measurement of the descriptor similarity by using the hamming distance comprises the steps of adopting the KNN algorithm, taking the hamming distance as a measurement index of the descriptor similarity, calculating hamming distances between descriptors of each feature point in each image and all feature point descriptors in other images, and screening neighboring feature points according to the hamming distance to realize the preliminary matching of the feature points. Preferably, in the step 2, performing outlier rejection on the matching point pair by using a RANSAC algorithm includes: Step 2.1, randomly selecting 4 point pairs from the matched point pairs, and estimating model parameters of plane homography transformation; step 2.2, estimating a homography matrix by using the selected point pairs, substituting all the matching point pairs into the model, and calculating the re-projection error of each point pair; Step 2.3, setting an error threshold, judging the point pair with the reproje