SIFT (Scale Invariant Feature Transform) image feature matching preprocessing method based on optimized weight

By introducing local enhancement preprocessing and epipolar constraint methods with optimized weights into SIFT image feature matching, the problems caused by the loss of image details and noise amplification caused by the local contrast enhancement algorithm under the influence of multiple factors are solved, and the accuracy of feature matching is improved. sex and robustness, achieving better image feature matching effects.

CN118823391APending Publication Date: 2024-10-22CHONGQING ELECTRIC POWER COLLEGE
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410825959.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-25
Publication Date
2024-10-22

AI Technical Summary

Technical Problem

Existing local contrast enhancement algorithms may cause loss of image details when faced with factors such as angle, rotation, and lighting, and may cause noise amplification when the background is high, resulting in excessive image enhancement or excessive suppression, affecting the feature matching effect.

Method used

The SIFT image feature matching preprocessing method based on optimized weights is used to obtain image data through binocular cameras, perform grayscale processing and edge filling, introduce local enhancement factors and nonlinear transformation factors for local enhancement preprocessing, and combine the SIFT algorithm to extract features Points and epipolar constraint methods are used to eliminate false matches and improve feature matching accuracy.

Benefits of technology

It improves the effect and robustness of image feature matching, enhances the reliability of feature matching points, ensures the optimal and correct feature matching pairs are obtained under different working conditions, effectively suppresses noise, and improves image quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118823391A_ABST
    Figure CN118823391A_ABST
Patent Text Reader

Abstract

The invention discloses an SIFT (Scale Invariant Feature Transform) image feature matching preprocessing method based on weight optimization. The method comprises the following steps of: acquiring a binocular image data set under various working conditions by using a binocular camera; performing graying processing on a binocular image in the binocular image data set to obtain a grayscale image; edge filling processing is carried out on the grayscale image; and introducing a local enhancement factor and a nonlinear transformation factor to carry out weight optimization local enhancement preprocessing on the gray level image after the edge filling processing so as to obtain a gray level enhanced image. According to the method, the LCM algorithm is improved, the local enhancement factor and the nonlinear transformation factor are introduced to adjust the local enhancement value, a better preprocessing method is provided for local enhancement of the gray level image, image pixel dynamic enhancement can be achieved, a better enhanced image can be obtained, the feature matching number is larger, and the image quality is improved. And the image feature matching effect is better.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image feature point matching, and in particular to a SIFT image feature matching preprocessing method based on optimized weights. Background Art

[0002] In the field of computer vision and artificial intelligence, image matching is a core research topic and is widely used in image retrieval, target tracking, 3D reconstruction and other fields. Image matching methods are divided into two categories: grayscale information-based and feature information-based. Compared with grayscale information-based methods, the latter can be applied to various types of images and can be combined with other image processing techniques to further improve the effect of image matching. Therefore, image matching based on feature information has become a hot topic in current research. In recent years, the focus of image matching research based on feature information has been on feature point matching, and efforts have been made to improve the matching rate under complex backgrounds, partial viewing angles, and high noise environments. Commonly used image feature matching algorithms are mainly based on improved Harris corner detection, scale-invariant feature transform (SITF), accelerated robust features (SURF) and other algorithms. Most researchers focus on improving feature point extraction, descriptor construction, and false matching elimination algorithms to improve feature matching effects, but ignore that image feature quality can directly affect the effects of feature point extraction, descriptor construction, and feature point matching. Therefore, for image feature matching, it is crucial to use a good preprocessing algorithm to improve image feature quality.

[0003] In recent years, the local contrast enhancement (LCM) algorithm has been widely used in image preprocessing research. Li Hang et al. proposed an improved contrast saliency detection algorithm, which effectively expanded the target detection range by constructing an image pyramid and expanding the detection window structure, and performed non-maximum suppression based on regional saliency, and used the region growing method to segment the target to achieve accurate positioning of the target area; Yi Xiang et al. proposed a fast infrared image preprocessing algorithm based on region selection, which detects the region of interest based on the idea of ​​regional guidance, and adaptively compresses and enhances the region of interest based on the results of regional detection, reducing the processed area and effectively improving the contrast of the region of interest. Therefore, applying the local contrast maximization (LCM) algorithm to SIFT image feature matching can improve the discrimination of feature points, making feature points more prominent in complex backgrounds, and help improve the matching effect of the SIFT algorithm in feature matching.

[0004] There are some limitations to the application of the local contrast enhancement (LCM) algorithm to SIFT image feature matching. First, the gradient and direction information of the image will change due to the influence of multiple factors such as angle, rotation, and illumination, which may lead to the loss of image details. Second, this method does not take into account the situation of high background noise. When the local pixel distribution is poor, it may cause noise amplification, resulting in over-enhancement or over-suppression of the image. Summary of the invention

[0005] In view of the above-mentioned deficiencies in the prior art, the technical problem to be solved by the present invention is to provide a SIFT image feature matching preprocessing method based on optimized weights by improving the traditional LCM algorithm to improve the image feature matching effect.

[0006] In order to solve the above technical problems, a technical solution adopted by the present invention is: to provide a SIFT image feature matching preprocessing method based on optimized weights, comprising the following steps:

[0007] Use a binocular camera to obtain binocular image datasets under various working conditions;

[0008] Performing grayscale processing on the binocular images in the binocular image data set to obtain a grayscale image;

[0009] Performing edge filling processing on the grayscale image;

[0010] A local enhancement factor and a nonlinear transformation factor are introduced to perform weighted local enhancement preprocessing on the grayscale image after edge filling processing to obtain a grayscale enhanced image.

[0011] Furthermore, after the step of introducing the local enhancement factor and the nonlinear transformation factor to perform weight-optimized local enhancement preprocessing on the grayscale image after the edge filling process to obtain the grayscale enhanced image, the following steps are also included:

[0012] The SIFT algorithm is used to extract feature points from the grayscale enhanced image after the optimized weighted local enhancement preprocessing, and a feature descriptor is constructed to obtain the optimized image feature matching pair;

[0013] The optimal image feature matching pair is subjected to false matching elimination using an epipolar constraint method based on binocular position information to obtain the optimal correct SI FT feature matching pair.

[0014] Furthermore, the step of performing edge filling processing on the grayscale image specifically includes: filling square pixel blocks with a side length of radius on the rows and columns of the grayscale image respectively, and the filled pixel values ​​are symmetrically filled by copying the pixel values ​​of the edge of the binocular image to uniformly process the image edge;

[0015] The size of the grayscale image after edge padding processing is obtained by the following formula:

[0016] H edge = H gray + 2 × radius(one)

[0017] In formula (one), H edge is the height of the grayscale image after edge padding, and H gray is the height of the grayscale image;

[0018] W edge = W gray + 2 × radius(two)

[0019] In formula (two), W edge is the width of the grayscale image after edge padding, and W gray is the width of the grayscale image.

[0020] Furthermore, in the step of introducing a local enhancement factor and a non - linear transformation factor to perform optimized - weight local enhancement pre - processing on the grayscale image after edge padding processing, the following sub - steps are included:

[0021] Define the local pixel block to be processed A(i, j), and obtain the set of local pixel blocks to be processed that need local enhancement;

[0022] Analyze the dispersion degree between each local pixel block A(i, j) to be processed in the set of local pixel blocks to be processed and its eight neighboring pixel blocks, and calculate the local enhancement value E (i,j) ;

[0023] Introduce a local enhancement factor and a non - linear transformation factor to adjust the local enhancement value E (i,j) to obtain the non - linearly transformed local enhancement value E ( ′ i,j) and use it to enhance the corresponding local pixel block A(i, j) to be processed.

[0024] Furthermore, the step of obtaining the set of local pixel blocks to be processed that need to be locally enhanced specifically includes: starting from the pixel position (1,1) at the upper left corner of the grayscale image, horizontally obtaining the first row of square pixel blocks with a side length of radius from left to right for the local pixel block A(i,j) to be processed, with a moving spacing of radius, and the pixel blocks are named A(1,1), A(2,1), ..., A(b,1) in sequence; moving down a certain distance, starting from the pixel position (1,radius+1) of the grayscale image, and obtaining the second row of pixel blocks at equal intervals from left to right, and the pixel blocks are named A(1,2), A(2,2), ..., A(b,2) in sequence; moving down a certain distance again, obtaining a row of pixel blocks from left to right, and so on, obtaining a×b local pixel blocks to be processed, which is the set of local pixel blocks to be processed that need to be locally enhanced in the grayscale image, where a is the number of rows, and a=H gray ÷ radius, b is the number of columns, b=W gray ÷radius.

[0025] Furthermore, the discreteness of each local pixel block A(i, j) to be processed and its eight neighboring pixel blocks in the local pixel block set to be processed is analyzed, and the local enhancement value E adapted to the local pixel block A(i, j) to be processed is calculated based on the discreteness. (i,j) The steps include the following sub-steps:

[0026] The local pixel block A(i,j) to be processed is defined as the central sub-window P0, and eight neighborhood pixel blocks centered on the central sub-window P0 are defined as neighborhood sub-windows P1, P2, ..., P7 and P8 in sequence;

[0027] Calculate the average value of all pixels in the central sub-window and the neighboring sub-windows and the standard deviation of the central sub-window;

[0028] The local enhancement value E adapted to the local pixel block A(i, j) to be processed is calculated based on the average value of all pixels in the central sub-window and the neighboring sub-window and the standard deviation of the central sub-window. (i,j) .

[0029] Furthermore, the local enhancement factor and the nonlinear transformation factor are introduced to adjust the local enhancement value E (i,j) , and obtain the local enhancement value E after nonlinear change ( ' i,j) And it is used in the step of enhancing the local pixel block A(i,j) to be processed, including the following sub-steps:

[0030] The local enhancement factor and nonlinear transformation factor are introduced, and the characteristics of the hyperbolic tangent function are used for nonlinear changes. The nonlinear transformation factor is used to effectively compress the dynamic range of the local enhancement value to [-1, 1]. The local enhancement factor is used as a weight to control the local enhancement value of the image, and the local enhancement value E after nonlinear change is obtained. ( ' i,j) ;

[0031] The local enhancement value E after the nonlinear change ( ' i,j) Used to enhance the local pixel block A(i,j) to be processed.

[0032] Furthermore, the local enhancement value E after the nonlinear change ( ' i,j) Obtained by the following formula:

[0033] E ( ' i,j) =α×tanh(β×E (i,j) )(three)

[0034] In formula (3), α represents the local enhancement factor, and β represents the nonlinear transformation factor;

[0035] The local enhancement value E after the nonlinear change ( ' i,j) The step of enhancing the local pixel block A(i,j) to be processed specifically includes: using the local enhancement value E after the nonlinear change ( ' i,j) Each pixel in the local pixel block A(i,j) to be processed is enhanced, which can be expressed by the following formula:

[0036] I k ′=I k +E ( ' i,j) (Four)

[0037] In formula (IV), I k ′ represents the pixel value of the kth pixel in the local pixel block to be processed after local pixel enhancement, I k Represents the pixel value of the kth pixel in the local pixel block to be processed.

[0038] Furthermore, in the step of introducing the local enhancement factor and the nonlinear transformation factor to adjust the local enhancement value E (i,j) , and obtain the local enhancement value E after nonlinear change ( ' i,j) After the step of using it to enhance the corresponding local pixel block A(i,j) to be processed, the method further includes:

[0039] The optimal local enhancement factor and nonlinear transformation factor are obtained through gradient ascent iterative update, and the local enhancement value E after nonlinear change is optimized based on the optimal local enhancement factor and nonlinear transformation factor. ( ' i,j) And used to enhance the corresponding local pixel block A(i,j) to be processed;

[0040] The step of obtaining the optimal local enhancement factor and nonlinear transformation factor by iteratively updating the gradient ascent comprises:

[0041] The value of the local enhancement factor is randomly set, and the nonlinear transformation factor is coarsely iterated within the set coarse iteration range with the set coarse iteration step size, and the fine iteration range of the nonlinear transformation factor is determined by taking the image feature matching pair as the evaluation index;

[0042] The value of the nonlinear transformation factor is randomly set, and the local enhancement factor is coarsely iterated within the set coarse iteration range with the set coarse iteration step size, and the fine iteration range of the local enhancement factor is determined by taking the image feature matching pair as the evaluation index;

[0043] Under the scale of the fine iteration range of the local enhancement factor, the value of the local enhancement factor is set, and the nonlinear transformation factor is finely iterated within the fine iteration range of the nonlinear transformation factor with the set fine iteration step size, and the image feature matching pair is used as an evaluation index to obtain the optimal nonlinear transformation factor;

[0044] Under the scale of the fine iteration range of the nonlinear transformation factor, the value of the nonlinear transformation factor is set, and the local enhancement factor is finely iterated within the fine iteration range of the local enhancement factor with the set fine iteration step size, and the image feature matching pair is used as an evaluation index to obtain the optimal local enhancement factor.

[0045] Furthermore, the step of extracting feature points from the grayscale enhanced image after the optimized weighted local enhancement preprocessing by using the SIFT algorithm, and constructing a feature descriptor to obtain an optimized image feature matching pair includes the following sub-steps:

[0046] Construct the scale space of grayscale enhanced image based on SIFT algorithm;

[0047] Feature points are detected by obtaining Gaussian difference images between adjacent scales;

[0048] Obtaining a gradient direction histogram of a neighborhood around each feature point as a descriptor of the feature point;

[0049] Based on the feature points and descriptors, the grayscale enhanced image is matched using the matchFeatures() function in Matlab to obtain an optimized image feature matching pair;

[0050] The step of using an epipolar constraint method based on binocular position information to eliminate false matches on the optimized image feature matching pair to obtain the optimal correct SIFT feature matching pair specifically includes: projecting the feature matching points of the grayscale enhanced image onto two grayscale enhanced images of different viewing angles and calculating the similarity of the epipolar lines; setting a elimination threshold, when the similarity of the epipolar lines is greater than the elimination threshold, the feature matching point is a false match point and is eliminated, otherwise it is retained to obtain the optimal correct SIFT feature matching pair.

[0051] The SIFT image feature matching preprocessing method based on optimized weights of the present invention has at least the following beneficial effects: by improving the LCM algorithm, introducing a local enhancement factor and a nonlinear transformation factor to adjust the local enhancement value, a better preprocessing method is provided for local enhancement of grayscale images, and dynamic enhancement of image pixels can be achieved, and a better enhanced image can be obtained, so that the number of feature matches is larger and the image feature matching effect is better; while retaining the essence of the traditional feature matching algorithm, the present invention utilizes the optimized image preprocessing method based on the SIFT algorithm to effectively improve the image quality and suppress the image background noise, and enhance the image feature matching points; in the case of a multi-factor working environment, according to the actual acquisition environment, the size of the local enhancement factor and the nonlinear transformation factor is adjusted to achieve dynamic enhancement of pixels under different working conditions, and the feature points of the preprocessed image are extracted by the SIFT algorithm for matching, thereby improving the reliability and robustness of the feature point extraction; a random sampling consistency algorithm is used to eliminate false matches, thereby obtaining the optimal correct SIFT feature matching pair under different working conditions, and ensuring the accuracy and reliability of the feature matching pair. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0053] Figure 1 The present invention is a flowchart of an implementation of a SIFT image feature matching preprocessing method based on optimized weights.

[0054] Figure 2 The image set is collected by an implementation method of SIFT image feature matching preprocessing method based on optimized weights of the present invention, wherein: Figure 2 a- Figure 2 f denotes the normal, rotated and shifted left and right images respectively.

[0055] Figure 3 for Figure 1 Flow chart of step S4 in FIG.

[0056] Figure 4 for Figure 3 Flowchart of step S42 in FIG.

[0057] Figure 5 for Figure 3 Flowchart of step S43 in FIG.

[0058] Figure 6 for Figure 3 Flowchart of obtaining the optimal local enhancement factor and nonlinear transformation factor through gradient ascent iterative update in step S44.

[0059] Figure 7 These are the grayscale enhancement effects under different working conditions.

[0060] Figure 8 for Figure 1 Flow chart of step S5 in FIG.

[0061] Fig. 9 for Figure 2 a- Figure 2 f is the optimal correct feature matching graph under different working conditions obtained by the method of the present invention, wherein: Fig. 9 a- Fig. 9 c represents the optimal correct feature matching images under normal, rotation and offset conditions respectively.

[0062] Fig.10 for Figure 2 a- Figure 2 f The feature matching image obtained using the traditional LCM local contrast enhancement preprocessing method, Fig.10 a- Fig.10 c represents the feature matching images under normal, rotation and offset conditions respectively. DETAILED DESCRIPTION

[0063] The present invention will be further described below in conjunction with the accompanying drawings.

[0064] See also Figure 1 , is a flow chart of an implementation method of a SIFT image feature matching preprocessing method based on optimized weights of the present invention. This implementation method specifically includes the following steps:

[0065] S1. Use a binocular camera to obtain binocular image datasets under various working conditions.

[0066] In this embodiment, a standard version of pixel XYZTM, model D-435, a binocular camera with a single pixel size of 3.75um×3.75um and a pixel resolution of 1280×720 is used to capture images under normal working conditions, rotation conditions, and offset conditions. During the construction process, the optical axes of the left and right cameras are kept parallel to reduce the occurrence of errors.

[0067] Under multiple environmental parameters, a binocular camera is used to collect high-precision images of the target object. The object to be tested is uniformly placed at a distance of about 1m from the camera and placed under normal conditions, including but not limited to lighting and angle, to obtain image data under normal conditions. During the acquisition process, the experimental object is rotated at multiple angles and the binocular camera is offset to ensure that the image data obtained is under a variety of working conditions. Please refer to Figure 2 , is the image set collected in this implementation.

[0068] S2. Grayscale the binocular image in the binocular image data set to obtain a grayscale image. Specifically, grayscale the binocular image to obtain a grayscale image using the formula:

[0069] gray=0.299×R+0.587×G+0.114×B

[0070] Where gray is the gray value of the current pixel after grayscale processing, and [RGB] represents the values ​​of the red, green, and blue channels of the current pixel, respectively.

[0071] S3. Perform edge filling processing on the grayscale image.

[0072] Specifically, square pixel blocks with a side length of radius are filled in the rows and columns of the grayscale image, and in this embodiment, the radius is 8. The filled pixel values ​​are symmetrically filled by copying the pixel values ​​at the edge of the binocular image, and the image edge is processed uniformly, which can ensure the integrity and clarity of the image and ensure that the edge effect, information loss, inconsistent processing, etc. encountered by pixels close to the edge during the optimization weight local enhancement preprocessing are effectively solved in the subsequent process.

[0073] The calculation formula for the size of the grayscale image after edge filling is as follows:

[0074] H edge =H gray +2×radius

[0075] Among them, H edge is the height of the grayscale image after edge filling, H gray is the grayscale image height;

[0076] W edge =W gray +2×radius

[0077] Among them, W edge is the width of the grayscale image after edge filling, W gray is the width of the grayscale image.

[0078] In this embodiment, the size of the binocular image is 1280×720 pixels, and the size after edge filling is 1296×736 pixels.

[0079] S4. Introduce a local enhancement factor and a nonlinear transformation factor to perform weighted local enhancement preprocessing on the grayscale image after edge filling processing to obtain a grayscale enhanced image.

[0080] See also Figure 3 , this step S4 includes the following sub-steps:

[0081] S41, defining a local pixel block A(i, j) to be processed, and obtaining a set of local pixel blocks to be processed that need to be locally enhanced.

[0082] The local pixel block A(i, j) to be processed is an area in the grayscale image. The size of the area is a square pixel block with a side length of radius. Each local pixel block has 8 congruent neighboring pixel blocks.

[0083] Specifically, the local pixel block A(i,j) to be processed starts from the pixel position (1,1) in the upper left corner of the grayscale image, and in the horizontal direction, obtains the first row of square pixel blocks with a side length of radius from left to right, with a moving spacing of radius, and the pixel blocks are named A(1,1), A(2,1), ..., A(b,1) in sequence; moves down a certain distance, starts from the pixel position (1,radius+1) of the grayscale image, and obtains the second row of pixel blocks at equal intervals from left to right, and the pixel blocks are named A(1,2), A(2,2), ..., A(b,2) in sequence; moves down a certain distance again, obtains a row of pixel blocks from left to right, and so on, a total of a×b local pixel blocks to be processed are obtained, which is the set of local pixel blocks to be processed that need to be locally enhanced in the grayscale image, where a is the number of rows, and a=H gray ÷ radius, b is the number of columns, b=W gray ÷radius.

[0084] S42, analyzing the discreteness of each local pixel block A(i, j) to be processed and its eight neighboring pixel blocks in the local pixel block set to be processed, and calculating the local enhancement value E adapted to the local pixel block A(i, j) to be processed based on the discreteness. (i,j) .

[0085] See also Figure 4 , this step S42 includes the following sub-steps:

[0086] S421, defining the local pixel block A(i, j) to be processed as a central sub-window P0, and defining eight neighborhood pixel blocks centered on the central sub-window P0 as neighborhood sub-windows P1, P2, ..., P7 and P8 in sequence.

[0087] S422, calculating the average values ​​of all pixels in the central sub-window and the neighboring sub-windows and the standard deviation of the central sub-window.

[0088] The size of the standard deviation reflects the fluctuation of the pixel value in the central subwindow relative to the average value of all pixels in all subwindows. If the standard deviation is large, it means that the pixel value in the central subwindow is greatly different from the overall average value, that is, the degree of dispersion is high; conversely, if the standard deviation is small, it means that the pixel value in the central subwindow is close to the overall average value, and the degree of dispersion is low.

[0089] Specifically, the calculation formula for the average value of all pixels in the central sub-window and the neighborhood sub-window is as follows:

[0090]

[0091] Among them, μ represents the average value of all pixels in the center sub-window and the neighborhood sub-window, v n represents the average value of pixels in the nth sub-window, n=0,1,2,…,8,I neighbor (k) represents the pixel value of the kth pixel in subwindow n, and N represents the number of all pixels in the subwindow;

[0092] The calculation formula of the standard deviation of the central sub-window is as follows:

[0093]

[0094] Among them, σ represents the standard deviation of the central sub-window, μ represents the pixel average of all sub-windows, and v0 represents the pixel average in the central sub-window.

[0095] S423, calculating a local enhancement value E adapted to the local pixel block A(i, j) to be processed based on the average values ​​of all pixels in the central sub-window and the neighboring sub-windows and the standard deviation of the central sub-window (i,j) .

[0096] The calculation formula of the local enhancement value is as follows:

[0097]

[0098] Among them, E (i,j) is the local enhancement value of the central sub-window, ε is a parameter set to prevent the standard deviation from being divided by zero, and the value of ε is very small.

[0099] S43, introducing a local enhancement factor and a nonlinear transformation factor to adjust the local enhancement value E (i,j) , and obtain the local enhancement value E after nonlinear change ( ' i,j)And use it to enhance the corresponding local pixel block A(i,j) to be processed.

[0100] See also Figure 5 , this step S43 includes the following sub-steps:

[0101] S431, introduce a local enhancement factor and a nonlinear transformation factor, use the characteristics of the hyperbolic tangent function to perform nonlinear changes, use the nonlinear transformation factor to effectively compress the dynamic range of the local enhancement value to [-1, 1], and use the local enhancement factor as a weight to control the local enhancement value of the image, and obtain the local enhancement value E after the nonlinear change ( ' i,j) .

[0102] The local enhancement value E after the nonlinear change ( ' i,j) The calculation formula is as follows:

[0103] E ( ' i,j) =α×tanh(β×E (i,j) )

[0104] Among them, α represents the local enhancement factor and β represents the nonlinear transformation factor.

[0105] S432: The local enhancement value E after the nonlinear change ( ' i,j) Used to enhance the local pixel block A(i,j) to be processed.

[0106] Specifically, the local enhancement value E after the nonlinear change is used ( ' i,j) Each pixel in the local pixel block A(i,j) to be processed is enhanced, which can be expressed by the following formula:

[0107] I k ′=I k +E ( ' i,j)

[0108] Among them, I k ′ represents the pixel value of the kth pixel in the local pixel block to be processed after local pixel enhancement, I k Represents the pixel value of the kth pixel in the local pixel block to be processed.

[0109] S44, obtaining the optimal local enhancement factor and nonlinear transformation factor through gradient ascent iterative update, and optimizing the local enhancement value E after nonlinear change based on the optimal local enhancement factor and nonlinear transformation factor ( ' i,j) And used to enhance the corresponding local pixel block A(i,j) to be processed.

[0110] The nonlinear transformation factor controls the slope of the hyperbolic tangent function. If the nonlinear transformation factor is large, the function transition will be steeper, which means that the distribution of local enhancement values ​​after nonlinear transformation will be more concentrated, and most local enhancement values ​​will be mapped to a smaller range; conversely, if the nonlinear transformation factor is small, the function transition will be smoother, which means that the distribution of local enhancement values ​​after nonlinear transformation will be more dispersed, and most local enhancement values ​​will be mapped to a larger range. The local enhancement factor is regarded as affecting the weight ratio of the local enhancement value, which can directly affect the amplitude of the local enhancement value after conversion. If the local enhancement factor is large, the converted local enhancement value will also be correspondingly larger; conversely, if the local enhancement factor is small, the converted local enhancement value will also be correspondingly smaller.

[0111] According to the characteristics of local enhancement factor and nonlinear transformation factor, gradient ascent is used to iteratively update local enhancement factor and nonlinear transformation factor. In the actual multi-factor working environment, a set of optimal local enhancement factor and nonlinear transformation factor needs to be set to more effectively improve the feature matching effect. Taking the entire grayscale image as the iteration object and the image feature matching pair as the evaluation index, and considering the computer running speed and iteration range, the idea of ​​the control variable method is used to find the optimal iteration range.

[0112] See also Figure 6 In step S44, the sub-steps of obtaining the optimal local enhancement factor and nonlinear transformation factor by iteratively updating the gradient ascent include:

[0113] S441, randomly setting the value of the local enhancement factor, and coarsely iterating the nonlinear transformation factor within a set coarse iteration range with a set coarse iteration step size, and determining the fine iteration range of the nonlinear transformation factor with the image feature matching pair as an evaluation index.

[0114] S442, randomly setting the value of the nonlinear transformation factor, and coarsely iterating the local enhancement factor within the set coarse iteration range with the set coarse iteration step size, and determining the fine iteration range of the local enhancement factor with the image feature matching pair as the evaluation index.

[0115] In this embodiment, considering the output characteristics of the hyperbolic tangent function, the local enhancement factor is randomly set to 1, the nonlinear transformation factor range is [-100, 100], and then the nonlinear transformation factor is randomly set to 1, the local enhancement factor range is [-100, 100], and the iteration step is set to 10 for coarse iteration. Under the scale of the coarse iteration range, when the local enhancement factor and the nonlinear transformation factor are too large or too small, the number of correct matching pairs tends to be stable, and the positive and negative intervals roughly show a symmetrical effect. Based on the shooting of the same scene, it is verified that the correct matching pairs under the working environment of offset, rotation and other factors have the same change trend.

[0116] In the iterative process, the local enhancement factor and the nonlinear transformation factor are brought into step S43, the local enhancement value is calculated and used to enhance the corresponding local pixel block to be processed, the feature points of the grayscale enhanced image are extracted by using the SIFT algorithm, and the feature descriptor is constructed to obtain the optimized image feature matching pair, and the number or quality of the feature matching pair is used as an evaluation index, and finally the optimal iteration range of the local enhancement factor and the nonlinear transformation factor is obtained as the fine iteration range. In this embodiment, the fine iteration ranges of the local enhancement factor and the nonlinear transformation factor are both [0, 20].

[0117] S443. Within the scale of the fine iteration range of the local enhancement factor, set the value of the local enhancement factor, and perform fine iteration on the nonlinear transformation factor within the fine iteration range of the nonlinear transformation factor with the set fine iteration step size, and use the image feature matching pair as an evaluation index to obtain the optimal nonlinear transformation factor.

[0118] S444. Within the scale of the fine iteration range of the nonlinear transformation factor, set the value of the nonlinear transformation factor, and perform fine iteration on the local enhancement factor within the fine iteration range of the local enhancement factor with the set fine iteration step size, and use the image feature matching pair as an evaluation indicator to obtain the optimal local enhancement factor.

[0119] In this embodiment, the initial value of the local enhancement factor is set to 0, the range of the nonlinear transformation factor is [0, 20], the initial value of the nonlinear transformation factor is set to 0, the range of the local enhancement factor is [0, 20], the fine iteration step is set to 0.1, and the image feature matching pair is used as the evaluation index to obtain a set of optimal local enhancement factors and nonlinear transformation factors. The specific iterative process is the same as the above-mentioned coarse iteration and will not be repeated here. Because the optimal local enhancement factor and nonlinear transformation factor obtained under different normal, rotation and offset working conditions are different, the image feature matching pair iterative update operation is repeated to obtain the optimal local enhancement factor and nonlinear transformation factor under different working conditions.

[0120] Based on the optimal local enhancement factor and nonlinear transformation factor, the local enhancement value E after nonlinear change is optimized. ( ' i,j) And used to enhance the corresponding local pixel block A(i,j) to be processed. Perform pixel enhancement on a×b local pixel blocks under the current working environment, and repeat the optimized weight image preprocessing on the grayscale images under different working environments to obtain grayscale enhanced images under different working environments. Figure 7 , which are the grayscale enhancement effect diagrams under different working conditions.

[0121] S5. Use the SIFT algorithm to extract feature points from the grayscale enhanced image after the optimized weighted local enhancement preprocessing, and construct a feature descriptor to obtain an optimized image feature matching pair.

[0122] See also Figure 8 , this step S5 includes the following sub-steps:

[0123] S51. Construct the scale space of grayscale enhanced image based on SIFT algorithm.

[0124] The calculation formula of the scale space function is as follows:

[0125] L(x,y,σ′)=G(x,y,σ′)*I(x,y)

[0126] Among them, L(x,y,σ′) represents the scale space function, G(x,y,σ′) represents the two-dimensional Gaussian function with standard deviation σ′, * represents convolution, and I(x,y) represents the current pixel.

[0127] S52: Detect feature points by acquiring Gaussian difference images between adjacent scales.

[0128] Find local extreme points as feature points in the Gaussian difference image. If a pixel point is an extreme point in both the image scale and the adjacent scale, then the point will be considered a feature point. The calculation formula of the Gaussian difference image is as follows:

[0129] D(x,y,σ′)=(G(x,y,kσ′)-G(x,y,σ′))*I(x,y)=L(x,y,kσ′)-L(x,y,σ′)

[0130] Where D(x,y,σ′) represents the Gaussian difference image and k represents the scale interval.

[0131] S53: Obtain a gradient direction histogram of a neighborhood around each feature point as a descriptor of the feature point.

[0132] For each feature point, the SIFT algorithm obtains the gradient direction histogram of its surrounding neighborhood as the descriptor of the feature point. The calculation formula of the feature descriptor is as follows:

[0133] D={m(x,y,σ′)·w(x,y)} x,y

[0134] Where D represents the feature descriptor, m(x,y,σ′) represents the gradient magnitude at the (x,y) position and σ′ scale, and w(x,y) represents the Gaussian window.

[0135] S54. Based on the feature points and descriptors, use the matchFeatures() function in mat lab to perform feature matching on the grayscale enhanced image to obtain an optimized image feature matching pair.

[0136] Because the optimal local enhancement factor and nonlinear transformation factor under different working conditions are different, when performing image feature matching, an optimized image feature matching pair can be obtained based on the optimal local enhancement factor and nonlinear transformation factor under different working conditions.

[0137] S6. Eliminate mismatches of the optimized image feature matching pairs using an epipolar constraint method based on binocular position information to obtain the best correct SIFT feature matching pairs.

[0138] Specifically, the feature matching points of the grayscale enhanced image are projected onto two grayscale enhanced images from different perspectives and the epipolar similarity is calculated. The projection point x1 of point x on the left image is on the baseline l1, and the projection point x2 on the right image is on the baseline l2. The two points satisfy a certain spatial constraint relationship. The specific formula is: T Fx1 = 0, F is the basic matrix obtained by estimating the feature matching points, l2 = Fx1; for any feature matching point x1 in the left image, its corresponding point x2 in the right image must be located on a straight line, which is the epipolar line. Let l2′ be the epipolar line of the actual right image feature matching point, and the calculation formula of the epipolar line similarity measure C is as follows:

[0139]

[0140] In the actual feature matching process, mismatching may occur, that is, the corresponding point of a feature point in the left image in the right image does not fall on the epipolar line where it should be. Therefore, the rejection threshold T is set C , when C is greater than T C When , it means that the feature matching point is a wrong matching point and it is removed, otherwise, it is retained. The optimal correct image feature matching pair is obtained by thresholding the optimized image feature matching pair, where T CIt is an adaptive threshold, and a corresponding threshold is used for images of different working conditions.

[0141] Repeatedly use the epipolar constraint method based on binocular position information to eliminate mismatches of optimized image feature matching pairs under different working conditions, so as to obtain the optimal correct SIFT feature matching pairs under different working conditions. Fig. 9 , which is the optimal correct feature matching diagram under different working conditions obtained by using the method of the present invention, please refer to Fig.10 , which is the feature matching map obtained using the traditional LCM local contrast enhancement preprocessing method.

[0142] In order to further compare the matching effect of the SIFT image feature matching preprocessing method based on optimized weights of the present invention with the commonly used traditional LCM local enhancement preprocessing method, the average matching pairs of SIFT feature matching pairs of the two methods under different working conditions are calculated respectively. The average number of feature matching pairs obtained by using the traditional LCM local enhancement preprocessing method is 177.00, and the average number of feature matching pairs obtained by using the SIFT image feature matching preprocessing method based on optimized weights of the present invention is 389.67. This shows that compared with Fig.10 , Fig. 9 The more feature matches there are, the better the image feature matching effect is.

[0143] It should be noted that Figure 2 , Fig. 9 as well as Fig.10 None of them are grayscale images. In the actual processing process, they are all color images.

[0144] The present invention improves the LCM algorithm, introduces a local enhancement factor and a nonlinear transformation factor to adjust the local enhancement value, and provides a better preprocessing method for local enhancement of grayscale images, which can realize dynamic enhancement of image pixels, obtain a better enhanced image, and make the number of feature matches larger and the image feature matching effect better; while retaining the essence of the traditional feature matching algorithm, the present invention uses an optimized image preprocessing method based on the SI FT algorithm to effectively improve the image quality and suppress the image background noise, and enhance the image feature matching points; in the case of a multi-factor working environment, according to the actual acquisition environment, the size of the local enhancement factor and the nonlinear transformation factor is adjusted to realize dynamic enhancement of pixels under different working conditions, and the SI FT algorithm is used to extract the feature points of the preprocessed image for matching, thereby improving the reliability and robustness of the feature point extraction; a random sampling consistency algorithm is used to eliminate false matches, thereby obtaining the optimal and correct SI FT feature matching pairs under different working conditions, and ensuring the accuracy and reliability of the feature matching pairs.

[0145] The above is only a specific implementation of the present application. Those skilled in the art should understand that the present invention is not limited by the above implementation. The above implementation and description only describe the principles of the present invention. Since the method of the present invention mainly optimizes the preprocessing algorithm of image feature matching, it does not change the essence of the feature matching algorithm. Therefore, it also has certain feasibility and robustness on other feature matching algorithms and optimized feature matching algorithms. These changes and improvements fall within the scope of the present invention, which is defined by the attached claims and their equivalents.

Claims

1. A SIFT image feature matching preprocessing method based on optimized weights, It is characterized in that The following steps are involved: Use a binocular camera to obtain binocular image datasets under various working conditions; Performing grayscale processing on the binocular images in the binocular image data set to obtain a grayscale image; Performing edge filling processing on the grayscale image; A local enhancement factor and a nonlinear transformation factor are introduced to perform weighted local enhancement preprocessing on the grayscale image after edge filling processing to obtain a grayscale enhanced image.

2. The SIFT image feature matching preprocessing method based on optimized weights as claimed in claim 1, It is characterized in that After the step of introducing the local enhancement factor and the nonlinear transformation factor to perform weight-optimized local enhancement preprocessing on the grayscale image after the edge filling process to obtain the grayscale enhanced image, the following steps are also included: The SIFT algorithm is used to extract feature points from the grayscale enhanced image after the optimized weighted local enhancement preprocessing, and a feature descriptor is constructed to obtain the optimized image feature matching pair; The optimized image feature matching pairs are subjected to false matching elimination using an epipolar constraint method based on binocular position information to obtain the optimal correct SIFT feature matching pairs.

3. The SIFT image feature matching preprocessing method based on optimized weights as claimed in claim 1, It is characterized in that The step of performing edge filling processing on the grayscale image specifically includes: filling square pixel blocks with a side length of radius on the rows and columns of the grayscale image respectively, and the filled pixel values ​​are symmetrically filled by copying the pixel values ​​of the edge of the binocular image to uniformly process the image edge; The size of the grayscale image after edge filling is obtained by the following formula: H edge = H gray + 2 × radius (one) In formula (1), H edge is the height of the grayscale image after edge filling, H gray is the grayscale image height; W edge = W gray +2×radius (2) In formula (II), W edge is the width of the grayscale image after edge filling, W gray is the width of the grayscale image.

4. The SIFT image feature matching preprocessing method based on optimized weights as claimed in claim 3, It is characterized in that The step of introducing a local enhancement factor and a nonlinear transformation factor to perform weighted local enhancement preprocessing on the grayscale image after edge filling processing includes the following sub-steps: Define a local pixel block A(i,j) to be processed, and obtain a set of local pixel blocks to be processed that need to be locally enhanced; Analyze the discreteness of each local pixel block A(i, j) to be processed and its eight neighboring pixel blocks in the local pixel block set to be processed, and calculate the local enhancement value E adapted to the local pixel block A(i, j) to be processed based on the discreteness (i,j) ; Introduce a local enhancement factor and a nonlinear transformation factor to adjust the local enhancement value E (i,j) , and obtain the local enhancement value E′ after nonlinear change (i,j) And use it to enhance the corresponding local pixel block A(i,j) to be processed.

5. The SIFT image feature matching preprocessing method based on optimized weights as claimed in claim 4, It is characterized in that The step of obtaining the set of local pixel blocks to be processed that need to be locally enhanced specifically includes: starting from the pixel position (1,1) at the upper left corner of the grayscale image, horizontally obtaining the first row of square pixel blocks with a side length of radius from left to right for the local pixel block A(i,j) to be processed, with a moving spacing of radius, and the pixel blocks are named A(1,1), A(2,1), ..., A(b,1) in sequence; moving down a certain distance, starting from the pixel position (1,radius+1) of the grayscale image, and obtaining the second row of pixel blocks at equal intervals from left to right, and the pixel blocks are named A(1,2), A(2,2), ..., A(b,2) in sequence; moving down a certain distance again, obtaining a row of pixel blocks from left to right, and so on, obtaining a×b local pixel blocks to be processed in total, that is, the set of local pixel blocks to be processed that need to be locally enhanced in the grayscale image, wherein a is the number of rows, and a=H gray ÷ radius, b is the number of columns, b=W gray ÷radius.

6. The SIFT image feature matching preprocessing method based on optimized weights as claimed in claim 4, It is characterized in that The method comprises: analyzing the discrete degree of each local pixel block A(i, j) to be processed and its eight neighboring pixel blocks in the local pixel block set to be processed, and calculating the local enhancement value E adapted to the local pixel block A(i, j) to be processed based on the discrete degree. (i,j) The steps include the following sub-steps: The local pixel block A(i,j) to be processed is defined as the central sub-window P0, and eight neighborhood pixel blocks centered on the central sub-window P0 are defined as neighborhood sub-windows P1, P2, ..., P7 and P8 in sequence; Calculate the average value of all pixels in the central sub-window and the neighboring sub-windows and the standard deviation of the central sub-window; The local enhancement value E adapted to the local pixel block A(i, j) to be processed is calculated based on the average value of all pixels in the central sub-window and the neighboring sub-window and the standard deviation of the central sub-window. (i,j) .

7. The SIFT image feature matching preprocessing method based on optimized weights as claimed in claim 4, It is characterized in that The local enhancement factor and the nonlinear transformation factor are introduced to adjust the local enhancement value E (i,j) , and obtain the local enhancement value E′ after nonlinear change (i,j) And it is used in the step of enhancing the local pixel block A(i,j) to be processed, including the following sub-steps: The local enhancement factor and nonlinear transformation factor are introduced, and the characteristics of the hyperbolic tangent function are used for nonlinear changes. The nonlinear transformation factor is used to effectively compress the dynamic range of the local enhancement value to [-1, 1]. The local enhancement factor is used as a weight to control the local enhancement value of the image, and the local enhancement value E′ after nonlinear change is obtained. (i,j) ; The local enhancement value E′ after the nonlinear change (i,j) Used to enhance the local pixel block A(i,j) to be processed.

8. The SIFT image feature matching preprocessing method based on optimized weights as claimed in claim 7, It is characterized in that The local enhancement value E′ after the nonlinear change (i,j) Obtained by the following formula: E′ (i,j) =α×tanh(β×E (i,j) ) (three) In formula (3), α represents the local enhancement factor, and β represents the nonlinear transformation factor; The local enhancement value E′ after the nonlinear change (i,j) The step of enhancing the local pixel block A(i,j) to be processed specifically includes: using the local enhancement value E′ after the nonlinear change (i,j) Each pixel in the local pixel block A(i,j) to be processed is enhanced, which can be expressed by the following formula: I' k =I k +E′ (i,j) (four) In formula (IV), I k ′ represents the pixel value of the kth pixel in the local pixel block to be processed after local pixel enhancement, I k Represents the pixel value of the kth pixel in the local pixel block to be processed.

9. The SIFT image feature matching preprocessing method based on optimized weights as claimed in claim 4, It is characterized in that In the step of introducing a local enhancement factor and a nonlinear transformation factor to adjust the local enhancement value E (i,j) , and obtain the local enhancement value E′ after nonlinear change (i,j) After the step of using it to enhance the corresponding local pixel block A(i,j) to be processed, the method further includes: The optimal local enhancement factor and nonlinear transformation factor are obtained through gradient ascent iterative update, and the local enhancement value E′ after nonlinear change is optimized based on the optimal local enhancement factor and nonlinear transformation factor. (i,j) And used to enhance the corresponding local pixel block A(i,j) to be processed; The step of obtaining the optimal local enhancement factor and nonlinear transformation factor by iteratively updating the gradient ascent comprises: The value of the local enhancement factor is randomly set, and the nonlinear transformation factor is coarsely iterated within the set coarse iteration range with the set coarse iteration step size, and the fine iteration range of the nonlinear transformation factor is determined by taking the image feature matching pair as the evaluation index; The value of the nonlinear transformation factor is randomly set, and the local enhancement factor is coarsely iterated within the set coarse iteration range with the set coarse iteration step size, and the fine iteration range of the local enhancement factor is determined by taking the image feature matching pair as the evaluation index; Under the scale of the fine iteration range of the local enhancement factor, the value of the local enhancement factor is set, and the nonlinear transformation factor is finely iterated within the fine iteration range of the nonlinear transformation factor with the set fine iteration step size, and the image feature matching pair is used as an evaluation index to obtain the optimal nonlinear transformation factor; Under the scale of the fine iteration range of the nonlinear transformation factor, the value of the nonlinear transformation factor is set, and the local enhancement factor is finely iterated within the fine iteration range of the local enhancement factor with the set fine iteration step size, and the image feature matching pair is used as an evaluation index to obtain the optimal local enhancement factor.

10. The SIFT image feature matching preprocessing method based on optimized weights as claimed in claim 2, It is characterized in that The step of extracting feature points from the grayscale enhanced image after the optimized weighted local enhancement preprocessing by using the SIFT algorithm, constructing feature descriptors, and obtaining optimized image feature matching pairs includes the following sub-steps: Construct the scale space of grayscale enhanced image based on SIFT algorithm; Feature points are detected by obtaining Gaussian difference images between adjacent scales; Obtaining a gradient direction histogram of a neighborhood around each feature point as a descriptor of the feature point; Based on the feature points and descriptors, the grayscale enhanced image is matched using the matchFeatures() function in Matlab to obtain an optimized image feature matching pair; The step of eliminating mismatches of the optimized image feature matching pairs using an epipolar constraint method based on binocular position information to obtain the optimal correct SIFT feature matching pairs specifically includes: projecting the feature matching points of the grayscale enhanced image onto two grayscale enhanced images of different viewing angles and calculating the epipolar similarity; The elimination threshold is set. When the similarity of the epipolar lines is greater than the elimination threshold, the feature matching point is a wrong matching point and is eliminated. Otherwise, it is retained to obtain the optimal correct SIFT feature matching pair.