Low-visibility image matching method, device, computer equipment and storage medium
Using the blocking method and affine transformation model to match image feature points in a low-visibility environment solves the problem of low accuracy and efficiency of feature point matching in the existing technology, and achieves higher matching accuracy and efficiency.
Patent Information
- Application Number
- CN202410841134.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-27
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2044-06-27
AI Technical Summary
In a low-visibility environment, the accuracy and efficiency of image feature point matching are low. Existing technologies such as the RANSAC algorithm have randomness and repeatability problems, resulting in low matching accuracy and efficiency.
The blocking method is used to select and verify image feature points, and the box filter and Daisy descriptor are used to detect and describe feature points. The affine transformation model and dynamic threshold are combined to eliminate mismatched feature points and improve matching accuracy and efficiency.
It improves the accuracy and efficiency of image matching in low-visibility environments, reduces the possibility of incorrect feature point selection, and improves the image recognition capabilities of UAVs in low-visibility environments.
Smart Images

Figure CN118397315B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing, and in particular to a low-visibility image matching method, device, computer equipment and storage medium. Background Art
[0002] With the development and application of UAV technology, it has played an important role in post-disaster rescue, terrain survey, agricultural planting, etc. However, environmental light, visibility, dimness, etc. will interfere with the shooting of UAVs equipped with visual sensors, resulting in low image clarity and blurred vision. Image matching, as the starting link of visual SLAM (Simultaneous Localization and Mapping), plays an important role in completing visual odometer and realizing subsequent pose estimation and tracking. Therefore, improving the accuracy of UAV aerial images in low visibility environments, ensuring the number of effective feature points, and improving the robustness of the algorithm are of positive significance to the image recognition and subsequent application of UAVs in low visibility environments.
[0003] There are many reasons for low visibility, such as rain, snow, fog and other meteorological conditions at night or during the day. In low visibility environments, such as foggy days, the images taken by the camera will be degraded to varying degrees - some image feature points will be eliminated, which will have a serious impact on image matching. In visual SLAM, the initialization of image matching is crucial, which directly affects the backend optimization, closed-loop detection and map construction.
[0004] In the existing methods, in terms of feature point extraction and matching algorithms, David proposed the SIFT (Scale-invariant feature transform) algorithm (LOWE DG. Distinctive Image Features from Scale-Invariant Keypoints [J]. International Journal of Computer Vision, 2004 (2): 43-57.), which has strong scale invariance, but due to the complexity of gradient calculation, the working speed is slow. Bay proposed the SURF (Speeded Up Robust Feature) algorithm (Bay H. SURF: Speed Up Robust Features [C] / / European Conference on Computer Vision. 2006 (6): 33-45.) based on the SIFT algorithm, using a box filter instead of a Gaussian filter, and using the Hessian matrix to detect extreme values to improve the efficiency of feature extraction. The BRISK (Binary Robust invariant scalable keypoints) algorithm proposed by Stefan et al. (LENTEREGGER S, CHIL M, SIEGWART RY. BRISK: Binary Robust invariant scalable keypoints[C] / / International Conference on Computer Vision. IEEE, 2011(9):26-41.) uses the AGAST (Adaptive and generic corner detection based on the accelerated segment test) algorithm to extract corner points and constructs binary descriptors by comparing pixel grayscale values, which improves the algorithm calculation speed, but has poor robustness.Tole et al. proposed the Daisy descriptor algorithm (TOLA E, LEPETIT V, FUA P. DAISY: An Efficient Dense Descriptor Applied to Wide-Baseline Stereo[J]. Pattern Analysis and Machine Intelligence, IEEE Transactions on, 2010, 32(5):815-830.). The use of a ring descriptor can improve the robustness to the environment, making it more suitable for drone photography and greatly improving the calculation speed.
[0005] In the process of realizing the present invention, the inventors realized that the prior art has at least the following technical problems: In order to solve the problem of decreased accuracy of image feature point matching in low-visibility environments, the above-mentioned solution widely uses random sampling to eliminate mismatched image feature points. However, the traditional RANSAC algorithm has problems such as randomness and repeatability, resulting in low matching accuracy and efficiency. Summary of the invention
[0006] Embodiments of the present invention provide a low-visibility image matching method, apparatus, computer equipment and storage medium to improve the accuracy and efficiency of image matching in a low-visibility environment.
[0007] In order to solve the above technical problems, an embodiment of the present invention provides a low-visibility image matching method, comprising:
[0008] Acquire a low-visibility image to be identified, where the low-visibility image to be identified is taken by a drone in real time;
[0009] Extracting and matching image feature points of the low-visibility image to be identified to obtain image feature points, and generating feature point descriptors corresponding to the image feature points;
[0010] Based on the feature point descriptors, using a block method to eliminate mismatched feature points in the image feature points to obtain target feature points;
[0011] Image matching is performed based on the target feature points to obtain a matching result.
[0012] Optionally, image feature points are extracted and matched on the low-visibility image to be identified, and the image feature points obtained include:
[0013] A box filter is used to detect feature points of the low-visibility image to be identified. The box filter expression is as follows:
[0014]
[0015] Among them, D xx It is the approximate value obtained by performing Gaussian second-order partial derivative convolution on the points on the image in the x direction, D yy It is the approximate value obtained by performing Gaussian second-order partial derivative convolution on the points on the image in the y direction, D xy It is the approximate value obtained by performing Gaussian second-order partial derivative convolution on the points on the image in the xy direction, and ω is the weighting coefficient.
[0016] Optionally, generating a feature point descriptor corresponding to the image feature point includes:
[0017] The gradient of the pixel point (u, v) in 8 directions is calculated as:
[0018]
[0019] in, Used to determine whether the result of the formula in the brackets is greater than zero, the pixel point (u, v) is any pixel point in the low-visibility image to be identified, o represents the direction of the gradient, o is a positive integer from 1 to 8, and I(u, v) represents all pixel values in the diagonal image block between the image origin and the pixel point (u, v);
[0020] The gradient image Convolve with Gaussian functions with different convolution kernels:
[0021]
[0022] Where G ∑ Gaussian kernel representing different Gaussian scale values ∑;
[0023] Generate a vector of pixel points (u, v):
[0024] ;
[0025] Combine multiple Gaussian convolutions to get local descriptors:
[0026]
[0027] In the formula, R m Indicates the number of layers of the structure. Here, a 3-layer ring structure is selected. Represents the coordinates of the Nth sampling point on the jth concentric ring in the structure centered at the pixel point (u, v).
[0028] Optionally, the step of eliminating mismatched feature points in the image feature points by using a block method based on the feature point descriptor to obtain target feature points comprises:
[0029] Establish the interior point set in And set the initial threshold P, number of iterations N, and distance error Z;
[0030] Dividing the input low-visibility image to be identified into four areas of equal size;
[0031] Determine the number of feature points in the four areas, select three areas with a large number of feature points, and randomly select a pair of feature points in each area, calculate the homography matrix H(i) based on the feature point descriptors, and obtain the transformation model Q parameters;
[0032] The remaining area is used as the first verification set, and the selected three areas are used as the second verification set. The distance error between the feature points of the first verification set and the transformation model Q is calculated, and the inliers that meet the transformation model Q are put into the inliers set O. in And calculate the interior point rate P t1 (i);
[0033] The set threshold is compared with the inlier rate, and the parameters of the transformation model Q are iteratively updated according to the comparison result to obtain the target detection model;
[0034] The target detection model is used to identify and match the image feature points to obtain target feature points.
[0035] Optionally, calculating the distance error between the feature points of the first verification set and the transformation model Q includes:
[0036] The affine transformation model is used to determine the translation and rotation relationship between images:
[0037]
[0038] The distance error Z is calculated using the following formula:
[0039]
[0040] In the formula, h ij Indicates that the six parameters represent the translation and rotation of the original image, (x, y) represents the original image coordinates, Represents the coordinates of the image to be registered.
[0041] In order to solve the above technical problems, an embodiment of the present invention further provides a low-visibility image matching device, comprising:
[0042] An image acquisition module is used to acquire a low-visibility image to be identified, where the low-visibility image to be identified is taken by a drone in real time;
[0043] A feature point recognition module is used to extract and match image feature points of the low-visibility image to be recognized, obtain image feature points, and generate feature point descriptors corresponding to the image feature points;
[0044] An error elimination module, used to eliminate mismatched feature points in the image feature points by using a block method based on the feature point descriptors to obtain target feature points;
[0045] The image matching module is used to perform image matching based on the target feature points to obtain matching results.
[0046] Optionally, the feature point recognition module includes:
[0047] The feature point detection unit is used to detect feature points of the low-visibility image to be identified by using a box filter. The box filter expression is as follows:
[0048]
[0049] Among them, D xx It is the approximate value obtained by performing Gaussian second-order partial derivative convolution on the points on the image in the x direction, D yy It is the approximate value obtained by performing Gaussian second-order partial derivative convolution on the points on the image in the y direction, D xy It is the approximate value obtained by performing Gaussian second-order partial derivative convolution on the points on the image in the xy direction, and ω is the weighting coefficient.
[0050] Optionally, the feature point recognition module further includes:
[0051] The gradient calculation unit is used to calculate the gradient of the pixel point (u, v) in 8 directions:
[0052]
[0053] in, Used to determine whether the result of the formula in the brackets is greater than zero, the pixel point (u, v) is any pixel point in the low-visibility image to be identified, o represents the direction of the gradient, and o is a positive integer from 1 to 8;
[0054] Convolution unit, used to convert the gradient image Convolve with Gaussian functions with different convolution kernels:
[0055]
[0056] Where G ∑ Gaussian kernel representing different Gaussian scale values ∑;
[0057] Vector generation unit, used to generate vectors of pixel points (u, v):
[0058] ;
[0059] The descriptor generation unit is used to combine multiple Gaussian convolutions to obtain local descriptors:
[0060]
[0061] In the formula, R m Indicates the number of layers of the structure. Here, a 3-layer ring structure is selected. Represents the coordinates of the Nth sampling point on the jth concentric ring in the structure centered at the pixel point (u, v).
[0062] Optionally, the error elimination module includes:
[0063] The interior point set initialization unit is used to establish the interior point set O in And set the initial threshold P, number of iterations N, and distance error Z;
[0064] A block division unit, used for dividing the input low-visibility image to be identified into four areas of the same size;
[0065] A parameter calculation unit is used to determine the number of feature points in the four areas, select three areas with a large number of feature points, and randomly select a pair of feature points in each area, calculate the homography matrix H(i) based on the feature point descriptors, and obtain the transformation model Q parameters;
[0066] The interior point updating unit is used to take the remaining area as the first verification set, take the selected three areas as the second verification set, calculate the distance error between the feature points of the first verification set and the transformation model Q, and put the interior points that meet the transformation model Q into the interior point set O in And calculate the interior point rate P t1 (i);
[0067] A parameter iteration training unit is used to compare the set threshold with the inlier rate, and iteratively update the parameters of the transformation model Q according to the comparison result to obtain a target detection model;
[0068] The target matching unit is used to use the target detection model to identify and match the image feature points to obtain target feature points.
[0069] In order to solve the above technical problems, an embodiment of the present invention further provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above low-visibility image matching method when executing the computer program.
[0070] In order to solve the above technical problem, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above low-visibility image matching method are implemented.
[0071] The low-visibility image matching method, device, computer equipment and storage medium provided by the embodiment of the present invention obtain a low-visibility image to be identified, which is taken by a drone in real time; extract and match the image feature points of the low-visibility image to be identified to obtain image feature points, and generate feature point descriptors corresponding to the image feature points; based on the feature point descriptors, use the block method to eliminate the mismatched feature points in the image feature points to obtain the target feature points; perform image matching based on the target feature points to obtain matching results. By adopting the block method, the feature points are selected and verified to avoid the problem of selecting wrong feature points and thus obtaining an wrong homography matrix, thereby improving the accuracy and efficiency of low-visibility image matching. BRIEF DESCRIPTION OF THE DRAWINGS
[0072] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0073] Figure 1 is an exemplary system architecture diagram in which the present invention can be applied;
[0074] Figure 2 is a flow chart of an embodiment of a low-visibility image matching method of the present invention;
[0075] Figure 3 is a structural schematic diagram of an embodiment of a low-visibility image matching device according to the present invention;
[0076] Figure 4 FIG. 1 is a schematic structural diagram of an embodiment of a computer device according to the present invention. DETAILED DESCRIPTION
[0077] Unless otherwise defined, all technical and scientific terms used in this embodiment have the same meaning as those commonly understood by technicians in the technical field of the present invention; the terms used in this embodiment are only for the purpose of describing specific embodiments and are not intended to limit the present invention; the terms "including" and "having" and any variations thereof in the specification and claims of the present invention and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present invention or the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order.
[0078] The reference to "embodiment" in this embodiment means that the specific features, structures or characteristics described in conjunction with the embodiment may be included in at least one embodiment of the present invention. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiment described in this embodiment can be combined with other embodiments.
[0079] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0080] like Figure 1 As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0081] Users can use terminal devices 101 , 102 , 103 to interact with server 105 via network 104 to receive or send messages, etc.
[0082] Terminal devices 101, 102, 103 can be various electronic devices with display screens and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III), MP4 (Moving Picture Experts Group Audio Layer IV), laptop computers, desktop computers, etc.
[0083] The server 105 may be a server that provides various services, such as a background server that provides support for web pages displayed on the terminal devices 101 , 102 , and 103 .
[0084] It should be noted that the low-visibility image matching method provided in the embodiment of the present invention is executed by a server, and accordingly, the low-visibility image matching device is arranged in the server.
[0085] It should be understood that Figure 1The number of terminal devices, networks and servers in the embodiment is only for illustration. According to the implementation requirements, there may be any number of terminal devices, networks and servers. The terminal devices 101, 102, 103 in the embodiment of the present invention may specifically correspond to application systems in actual production.
[0086] See also Figure 2 , Figure 2 A low-visibility image matching method provided by an embodiment of the present invention is shown. The method is applied in Figure 1 The server in is used as an example to illustrate the details as follows:
[0087] S201: Acquire a low-visibility image to be identified, where the low-visibility image to be identified is taken by a drone in real time.
[0088] S202: extracting and matching image feature points of the low-visibility image to be identified to obtain image feature points, and generating feature point descriptors corresponding to the image feature points.
[0089] In a specific optional implementation manner, image feature points are extracted and matched for the low-visibility image to be identified, and the image feature points obtained include:
[0090] A box filter is used to detect feature points in the low-visibility image to be identified. The box filter expression is as follows:
[0091]
[0092] Among them, D xx It is the approximate value obtained by performing Gaussian second-order partial derivative convolution on the points on the image in the x direction, D yy It is the approximate value obtained by performing Gaussian second-order partial derivative convolution on the points on the image in the y direction, D xy It is the approximate value obtained by performing Gaussian second-order partial derivative convolution on the points on the image in the xy direction, and ω is the weighting coefficient.
[0093] In a specific optional implementation, generating a feature point descriptor corresponding to an image feature point includes:
[0094] The gradient of the pixel point (u, v) in 8 directions is calculated as:
[0095]
[0096] in, Used to determine whether the result of the formula in the brackets is greater than zero. The pixel point (u, v) is any pixel point in the low-visibility image to be identified. o represents the direction of the gradient and o is a positive integer from 1 to 8.
[0097] The gradient image Convolve with Gaussian functions with different convolution kernels:
[0098]
[0099] Where G ∑ Gaussian kernel representing different Gaussian scale values ∑;
[0100] Generate a vector of pixel points (u, v):
[0101] ;
[0102] Combine multiple Gaussian convolutions to get local descriptors:
[0103]
[0104] In the formula, R m Indicates the number of layers of the structure. Here, a 3-layer ring structure is selected. Represents the coordinates of the Nth sampling point on the jth concentric ring in the structure centered at the pixel point (u, v).
[0105] Specifically, in the visual odometer part of the visual SLAM front end, in order to obtain the correspondence between images, it is necessary to extract and match the feature points of the images, which mainly includes four steps: feature point extraction, feature point description, feature point matching, and elimination of mismatched feature points. For the first two steps, SIFT, SUFT, ORB and other algorithms are usually used to process independently, but these algorithms cannot have speed, robustness and accuracy at the same time. In this embodiment, based on the SUFT algorithm, combined with the DAISY descriptor, the feature points of the drone-collected images are extracted and feature point descriptors are generated.
[0106] The core of the SURF algorithm is to use the Hessian matrix to detect feature points. The Hessian matrix of a point X with an image scale of σ is defined as follows:
[0107] (1)
[0108] Where: L xx It is obtained by convolving the point x on the image with the Gaussian second-order partial derivative. In practical applications, in order to reduce the amount of algorithm calculation, the SURF algorithm uses a box filter instead of a Gaussian filter to quickly construct an approximate Hessian matrix. The discriminant of the H matrix is shown in formula (2). Since the use of a box filter will cause errors, in order to balance the errors, D xy It is multiplied by the weighting factor ω for balancing.
[0109] (2)
[0110] Where: D xxIt is the approximate value obtained by performing Gaussian second-order partial derivative convolution on the points on the image in the x direction, D yy It is the approximate value obtained by performing Gaussian second-order partial derivative convolution on the points on the image in the y direction, D xy It is the approximate value obtained by performing Gaussian second-order partial derivative convolution on the points on the image in the xy direction. ω is the weighting coefficient, which is usually taken as 0.9.
[0111] The Daisy descriptor is a local image descriptor suitable for wide baseline stereo matching. It retains the robustness of the SIFT algorithm and can be quickly calculated at each image pixel. The core idea of Daisy is to convolve several directional maps of the original image with multiple Gaussian filter functions of different scales. Since the Gaussian filter function is separable, the algorithm has high efficiency. At the same time, the shape of the Daisy descriptor is different from the traditional SIFT rectangular shape. It is a centrally symmetrical circular ring structure such as Figure 1 As shown in the figure, the descriptor is composed of three concentric rings with different radii around the feature point. The corresponding sampling points are located on the concentric rings with different radii. Feature points are extracted at equal intervals on each concentric ring, and a total of 25 feature points are extracted, which has stronger robustness.
[0112] In this embodiment, the method for constructing the Daisy descriptor is as follows:
[0113] Taking the pixel point (u, v) as an example, the gradients in eight directions of the pixel point are calculated as follows:
[0114] (3)
[0115] In the formula Used to determine whether the result of the formula in brackets is greater than zero.
[0116] Furthermore, the gradient image Convolve with Gaussian functions with different convolution kernels,
[0117] (4)
[0118] Where G ∑ represents the Gaussian kernel for different Gaussian scale values ∑.
[0119] Get the vector of pixel point (u, v):
[0120] (5)
[0121] Combining multiple Gaussian convolutions, the DAISY local descriptor can be expressed as:
[0122] (6).
[0123] S203: Based on the feature point descriptor, a block method is used to eliminate mismatched feature points in the image feature points to obtain target feature points.
[0124] In a specific optional implementation, based on the feature point descriptor, a block method is used to eliminate the mismatched feature points in the image feature points, and the target feature points are obtained, including:
[0125] Establish the interior point set in And set the initial threshold P, number of iterations N, and distance error Z;
[0126] Divide the input low-visibility image to be identified into four areas of equal size;
[0127] Determine the number of feature points in the four areas, select three areas with more feature points, and randomly select a pair of feature points in each area. Calculate the homography matrix H(i) based on the feature point descriptors to obtain the transformation model Q parameters;
[0128] The remaining area is used as the first verification set, and the selected three areas are used as the second verification set. The distance error between the feature points of the first verification set and the transformation model Q is calculated, and the inliers that meet the transformation model Q are put into the inliers set O. in And calculate the interior point rate P t1 (i);
[0129] The set threshold is compared with the inlier rate, and the parameters of the transformation model Q are iteratively updated according to the comparison result to obtain the target detection model;
[0130] The target detection model is used to identify and match the image feature points to obtain the target feature points.
[0131] In a specific optional implementation, calculating the distance error between the feature points of the first verification set and the transformation model Q includes:
[0132] The affine transformation model is used to determine the translation and rotation relationship between images:
[0133] ;
[0134] The distance error Z is calculated using the following formula:
[0135]
[0136] In the above formula, h ij Indicates that the six parameters represent the translation and rotation of the original image, (x, y) represents the original image coordinates, Represents the coordinates of the image to be registered.
[0137] Specifically, the feature matching methods that are currently used more frequently include Brute Force (BF) and Fastest Neighborhood (FLANN) feature matching. Compared with the BF algorithm, which compares all feature points to find matches, the FLANN algorithm proposes to use the kd tree to search for matching pairs and perform feature extraction in batches, avoiding the exhaustive search of the BF algorithm and improving the calculation speed. The core of the FLANN algorithm is to calculate the Euclidean distance between a feature point and its adjacent feature points to find the nearest feature point. The mathematical definition of the Euclidean distance is shown in formula (7):
[0138] (7)
[0139] In formula (7), d represents a d-dimensional space.
[0140] There are many methods to eliminate mismatched feature points, including methods based on block theory and graph theory (Lee S, Lim J, Suh IH. Progressive Feature Matching: Incremental Graph Construction and Optimization [J]. IEEE Transactions on Image Processing, 2020, PP (99): 1-1.), methods based on deep learning (Sun Kun, Dai Wen. Mismatch elimination method based on multi-scale loss function [J]. Journal of Shanxi University: Natural Science Edition, 2022 (003): 45-53.), etc., among which RANSAC is widely used. Traditional RANSAC uses an iterative method to eliminate mismatches in images. It first calculates the model parameters based on a small amount of data, and then iteratively searches for a better model so that the model contains as many feature points as possible.
[0141] The motion model between images used by traditional RANSAC is the projection transformation matrix model, i.e., formula (8). The homography matrix H has 8 degrees of freedom, and at least 4 pairs of corresponding feature points are required to calculate the parameters:
[0142] (8)
[0143] Where (x, y) is the coordinates of the feature point of the previous frame image, is the coordinate of the image feature point of the current frame, and h represents 8 image transformation parameters.
[0144] After obtaining the matrix H, the projection error ∆ E is calculated based on the projection distance between the remaining feature point pairs and H. i If the error is less than the set threshold, it is marked as an interior point, and if it is greater than the set threshold, it is marked as an exterior point. Projection error ∆ E iThe calculation formula (9) is as follows:
[0145] (9)
[0146] The inlier rate is calculated based on the number of inliers counted and compared with the set threshold, thus completing one iteration. If the inlier rate is greater than the set threshold, the iteration ends and the optimal solution is obtained. If the inlier rate is less than the threshold, feature point pairs are reselected for parameter calculation until the optimal solution is obtained.
[0147] The traditional RANSAC algorithm uses a projection transformation matrix model, which has high accuracy but low calculation speed. At the same time, in each iteration, the projection error must be calculated for all feature points. If an external point is selected when randomly selecting feature points, an incorrect homography matrix is obtained, which will generate a large number of invalid calculations and increase the calculation time. Traditional RANSAC also needs to consider whether the set threshold is appropriate. If the threshold is not set properly, the correctly matched feature points will be eliminated, the number of feature matches will be insufficient, and the calculation time will be increased.
[0148] To solve the above-mentioned problems, this embodiment improves the RANSAC algorithm in the following aspects.
[0149] First, this embodiment uses an affine transformation model to replace the transmission transformation model.
[0150] The affine transformation model used in this embodiment, namely formula (10), studies the translation and rotation relationship between images. The model has 6 parameters and requires 3 pairs of feature points, which greatly improves the speed of parameter calculation.
[0151] (10)
[0152] The affine transformation model does not need to calculate the projection error, but only needs to calculate the distance error in the two-dimensional space, which reduces the speed of calculating parameters and also improves the recognition speed of the drone in low visibility environments. The distance error Z calculation satisfies formula (11):
[0153] (11)
[0154] Second, this embodiment uses a block method to improve feature point selection.
[0155] To address the problem that the traditional RANSAC algorithm may select incorrect feature points to obtain an incorrect homography matrix, this embodiment uses a block method to improve the feature point selection, divides the image into four areas, calculates the number of feature points in each area, selects three areas with a large number of feature points, and selects a pair of feature points from each area to calculate the model parameters.
[0156] Third, this embodiment uses a dynamic threshold to screen the model. A more reasonable threshold is obtained by using a dynamic threshold as the model. The simple process is as follows.
[0157] Step 1: Create an interior point set O in And set the initial threshold P, number of iterations N, and distance error Z;
[0158] Step 2: Divide the input left image into four areas of the same size, A, B, C, and D, determine the number of feature points in the four areas, select three areas with the largest number of feature points, assume they are A, B, and C, randomly select a pair of feature points in each area to calculate the homography matrix H(i), and obtain the transformation model Q parameters;
[0159] Step 3: Take the remaining D area as the first validation set, and the three areas A, B, and C as the second validation set. Calculate the distance error between the feature points of the first validation set and the model Q, and put the inliers that meet the transformation model Q into the inliers set O. in And calculate the interior point rate P t1 (i);
[0160] Step 4: Compare the set threshold with the inlier rate to obtain the target transformation model Q.
[0161] S204: Perform image matching based on the target feature points to obtain matching results.
[0162] This embodiment uses the VisDrone drone image public dataset to verify the effectiveness of the method of this embodiment. This dataset is a dataset about drone visual detection and tracking of road conditions released in 2019, covering a variety of traffic scenes, including cars, pedestrians, roads, trains, houses and other objects.
[0163] In order to verify the matching robustness and accuracy of the method provided in this embodiment in a low-visibility environment, two conditions, foggy day and night, were selected to test the algorithm. 100 groups of photos that met the conditions were selected from the VisDrone image dataset to test the images.
[0164] First, the feature point detection is compared and verified:
[0165] In order to verify the improvement of the feature extraction speed of the SURF detection feature points combined with the Daisy descriptor used in this embodiment, this algorithm is used to conduct comparative experiments with the SIFT algorithm and the SURT algorithm. The experiment tests 50 groups of night and foggy images respectively, and the experimental results are averaged as shown in Table 1. As can be seen from Table 1, in the night environment, the running time of the method in this embodiment is 60.5ms, and the average detection time of each feature point is 0.019ms. Compared with the other two algorithms, the running time of each point of the method in this embodiment is 0.038ms shorter than that of the SIFT algorithm, and the speed is increased by 300%. The overall running time of the SURF algorithm is reduced by 24.5ms, and the speed is increased by 28.9%. In the foggy environment, the running time of the algorithm in this embodiment is 74.3ms, and the average detection time of each feature point is 0.025ms, which is 0.039ms shorter than the SIFT algorithm, and the running speed is increased by 196%. The overall running time is reduced by 19.3ms and the speed is increased by 20.6%, indicating that the algorithm is more suitable for feature point detection in low visibility environments.
[0166] Table 1 Comparison of running time of feature point detection algorithms
[0167]
[0168] Secondly, compare and verify the results of eliminating false matches:
[0169] The traditional RANSAC and the improved RANSAC were compared at night and in foggy weather. The performance comparison results are shown in Table 2. This embodiment conducts a comprehensive analysis from the two aspects of correct matching rate and running time. The correct matching rate reflects the quality of the algorithm for eliminating false matches. The higher the correct matching rate, the better the effect of eliminating false matches. The correct matching rate is defined as formula (12):
[0170] (12)
[0171] Table 2 Comparison of correct matching rates between the improved algorithm and the traditional algorithm
[0172]
[0173] It can be seen from Table 2 that the correct matching rate of the method adopted in this embodiment is improved by 8.1% compared with the traditional RANSAC, which shows that for the matching cross-matching and "one-to-many" matching problems in coarse matching, the traditional RANSAC can only eliminate some errors, and the matching accuracy is also disturbed due to environmental factors. This also shows that the proposed dynamic threshold method meets the matching requirements in low visibility environments and can increase the proportion of eliminated mismatched feature points.
[0174] At the same time, the comparison of the running time in two groups of night and foggy environments shows that the traditional algorithm runs longer, and the running speed of the method in this embodiment is significantly improved, indicating that the block method and affine transformation model can improve the running speed of the algorithm and reduce the iterative running time of the algorithm.
[0175] In this embodiment, a low-visibility image to be identified is obtained, and the low-visibility image to be identified is taken in real time by a drone; image feature points of the low-visibility image to be identified are extracted and matched to obtain image feature points, and feature point descriptors corresponding to the image feature points are generated; based on the feature point descriptors, a block method is used to eliminate mismatched feature points in the image feature points to obtain target feature points; and image matching is performed based on the target feature points to obtain matching results. By adopting the block method, feature points are selected and verified, avoiding the problem of selecting wrong feature points and thus obtaining an incorrect homography matrix, thereby improving the accuracy and efficiency of low-visibility image matching.
[0176] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0177] Figure 3 FIG. 2 is a block diagram showing a low-visibility image matching device corresponding to the low-visibility image matching method in the above embodiment. Figure 3 As shown, the low-visibility image matching device includes an image acquisition module 31, a feature point recognition module 32, an error elimination module 33 and a picture matching module 34. The functional modules are described in detail as follows:
[0178] An image acquisition module 31 is used to acquire a low-visibility image to be identified, where the low-visibility image to be identified is taken by a drone in real time;
[0179] The feature point recognition module 32 is used to extract and match the image feature points of the low-visibility image to be recognized, obtain the image feature points, and generate feature point descriptors corresponding to the image feature points;
[0180] The error elimination module 33 is used to eliminate the mismatched feature points in the image feature points by using a block method based on the feature point descriptor to obtain the target feature points;
[0181] The image matching module 34 is used to perform image matching based on target feature points to obtain matching results.
[0182] Optionally, the feature point recognition module 32 includes:
[0183] The feature point detection unit is used to detect feature points of the low-visibility image to be identified using a box filter. The box filter expression is as follows:
[0184]
[0185] Among them, D xx It is the approximate value obtained by performing Gaussian second-order partial derivative convolution on the points on the image in the x direction, D yy It is the approximate value obtained by performing Gaussian second-order partial derivative convolution on the points on the image in the y direction, D xy It is the approximate value obtained by performing Gaussian second-order partial derivative convolution on the points on the image in the xy direction, and ω is the weighting coefficient.
[0186] Optionally, the feature point recognition module 32 further includes:
[0187] The gradient calculation unit is used to calculate the gradient of the pixel point (u, v) in 8 directions:
[0188]
[0189] in, Used to determine whether the result of the formula in the brackets is greater than zero. The pixel point (u, v) is any pixel point in the low-visibility image to be identified. o represents the direction of the gradient. o is a positive integer from 1 to 8. I(u, v) represents all pixel values in the diagonal image block between the image origin and the pixel point (u, v);
[0190] Convolution unit, used to convert the gradient image Convolve with Gaussian functions with different convolution kernels:
[0191]
[0192] Where G ∑ Gaussian kernel representing different Gaussian scale values ∑;
[0193] Vector generation unit, used to generate vectors of pixel points (u, v):
[0194] ;
[0195] The descriptor generation unit is used to combine multiple Gaussian convolutions to obtain local descriptors:
[0196]
[0197] In the formula, R m Indicates the number of layers of the structure. Here, a 3-layer ring structure is selected. Represents the coordinates of the Nth sampling point on the jth concentric ring in the structure centered at the pixel point (u, v).
[0198] Optionally, the error elimination module 33 includes:
[0199] The interior point set initialization unit is used to establish the interior point set O in And set the initial threshold P, number of iterations N, and distance error Z;
[0200] A block division unit, used for dividing the input low-visibility image to be identified into four areas of equal size;
[0201] A parameter calculation unit is used to determine the number of feature points in the four areas, select three areas with a large number of feature points, and randomly select a pair of feature points in each area, calculate the homography matrix H(i) based on the feature point descriptors, and obtain the transformation model Q parameters;
[0202] The interior point updating unit is used to take the remaining area as the first verification set, take the selected three areas as the second verification set, calculate the distance error between the feature points of the first verification set and the transformation model Q, and put the interior points that meet the transformation model Q into the interior point set O in And calculate the interior point rate P t1 (i);
[0203] A parameter iteration training unit is used to compare the set threshold with the inlier rate, and iteratively update the parameters of the transformation model Q according to the comparison result to obtain a target detection model;
[0204] The target matching unit is used to identify and match the image feature points using the target detection model to obtain the target feature points.
[0205] For the specific definition of the low-visibility image matching device, please refer to the definition of the low-visibility image matching method above, which will not be repeated here. Each module in the above-mentioned low-visibility image matching device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0206] To solve the above technical problems, the present invention also provides a computer device. Figure 4 , Figure 4 This is a basic structural block diagram of the computer device in this embodiment.
[0207] The computer device 4 includes a memory 41, a processor 42, and a network interface 43 that are interconnected through a system bus. It should be noted that the figure only shows a computer device 4 with components connected to the memory 41, the processor 42, and the network interface 43, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable gate arrays (Field-Programmable Gate Array, FPGA), digital processors (Digital Signal Processor, DSP), embedded devices, etc.
[0208] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.
[0209] The memory 41 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or D interface display memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 41 can be an internal storage unit of the computer device 4, such as a hard disk or memory of the computer device 4. In other embodiments, the memory 41 can also be an external storage device of the computer device 4, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the computer device 4. Of course, the memory 41 can also include both the internal storage unit of the computer device 4 and its external storage device. In this embodiment, the memory 41 is generally used to store the operating system and various application software installed on the computer device 4, such as the program code of the low-visibility image matching method, etc. In addition, the memory 41 can also be used to temporarily store various types of data that have been output or are to be output.
[0210] The processor 42 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor 42 is generally used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is used to run the program code stored in the memory 41 or process data, such as running the program code of the low-visibility image matching method.
[0211] The network interface 43 may include a wireless network interface or a wired network interface. The network interface 43 is generally used to establish a communication connection between the computer device 4 and other electronic devices.
[0212] The present invention also provides another embodiment, namely, providing a computer-readable storage medium, wherein the computer-readable storage medium stores an interface display program, and the interface display program can be executed by at least one processor so that the at least one processor performs the steps of the low-visibility image matching method as described above.
[0213] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present invention.
[0214] Obviously, the embodiments described above are only some embodiments of the present invention, rather than all embodiments. The preferred embodiments of the present invention are given in the accompanying drawings, but they do not limit the patent scope of the present invention. The present invention can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present invention more thorough and comprehensive. Although the present invention has been described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific embodiments, or to perform equivalent replacements for some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of the present invention, directly or indirectly used in other related technical fields, is also within the scope of patent protection of the present invention.
Claims
1. A low-visibility image matching method, characterized in that: include: Acquire a low-visibility image to be identified, where the low-visibility image to be identified is taken by a drone in real time; Extracting and matching image feature points of the low-visibility image to be identified to obtain image feature points, and generating feature point descriptors corresponding to the image feature points; Based on the feature point descriptors, using a block method to eliminate mismatched feature points in the image feature points to obtain target feature points; Perform image matching based on the target feature points to obtain a matching result; Wherein, based on the feature point descriptor, using a block method to eliminate mismatched feature points in the image feature points to obtain target feature points includes: Establish the interior point set in And set the initial threshold P, number of iterations N, and distance error Z; Dividing the input low-visibility image to be identified into four areas of equal size; Determine the number of feature points in the four areas, select three areas with a large number of feature points, and randomly select a pair of feature points in each area, calculate the homography matrix H(i) based on the feature point descriptors, and obtain the transformation model Q parameters; The remaining area is used as the first verification set, and the selected three areas are used as the second verification set. The distance error between the feature points of the first verification set and the transformation model Q is calculated, and the inliers that meet the transformation model Q are put into the inliers set O. in And calculate the interior point rate P t1 (i); The set threshold is compared with the inlier rate, and the parameters of the transformation model Q are iteratively updated according to the comparison result to obtain the target detection model; Using the target detection model to identify and match the image feature points to obtain target feature points; The step of calculating the distance error between the feature points of the first verification set and the transformation model Q includes: The affine transformation model is used to determine the translation and rotation relationship between images: The distance error Z is calculated using the following formula: In the formula, h ij Indicates that the six parameters represent the translation and rotation of the original image, (x, y) represents the original image coordinates, Represents the coordinates of the image to be registered.
2. The low-visibility image matching method according to claim 1, characterized in that: The image feature points of the low-visibility image to be identified are extracted and matched, and the image feature points obtained include: A box filter is used to detect feature points of the low-visibility image to be identified. The box filter expression is as follows: Among them, D xx It is the approximate value obtained by performing Gaussian second-order partial derivative convolution on the points on the image in the x direction, D yy It is the approximate value obtained by performing Gaussian second-order partial derivative convolution on the points on the image in the y direction, D xy It is the approximate value obtained by performing Gaussian second-order partial derivative convolution on the points on the image in the xy direction, and ω is the weighting coefficient.
3. The low-visibility image matching method according to claim 1, characterized in that: The generating of feature point descriptors corresponding to the image feature points comprises: The gradients of the pixel point (u, v) in 8 directions are calculated as: in, Used to determine whether the result of the formula in the brackets is greater than zero, the pixel point (u, v) is any pixel point in the low-visibility image to be identified, o represents the direction of the gradient, o is a positive integer from 1 to 8, and I(u, v) represents all pixel values in the diagonal image block between the image origin and the pixel point (u, v); The gradient image Convolve with Gaussian functions with different convolution kernels: Where G ∑ Gaussian kernel representing different Gaussian scale values ∑; Generate a vector of pixel points (u, v): ; Combine multiple Gaussian convolutions to get local descriptors: In the formula, R m Indicates the number of layers of the structure. Here, a 3-layer ring structure is selected. Represents the coordinates of the Nth sampling point on the jth concentric ring in the structure centered at the pixel point (u, v).
4. A low-visibility image matching device, characterized in that: include: An image acquisition module is used to acquire a low-visibility image to be identified, where the low-visibility image to be identified is taken by a drone in real time; A feature point recognition module is used to extract and match image feature points of the low-visibility image to be recognized, obtain image feature points, and generate feature point descriptors corresponding to the image feature points; An error elimination module, used to eliminate mismatched feature points in the image feature points by using a block method based on the feature point descriptors to obtain target feature points; An image matching module is used to perform image matching based on the target feature points to obtain a matching result; Wherein, the error elimination module comprises: The interior point set initialization unit is used to establish the interior point set O in And set the initial threshold P, number of iterations N, and distance error Z; A block division unit, used for dividing the input low-visibility image to be identified into four areas of the same size; A parameter calculation unit is used to determine the number of feature points in the four areas, select three areas with a large number of feature points, and randomly select a pair of feature points in each area, calculate the homography matrix H(i) based on the feature point descriptors, and obtain the transformation model Q parameters; The interior point updating unit is used to take the remaining area as the first verification set, take the selected three areas as the second verification set, calculate the distance error between the feature points of the first verification set and the transformation model Q, and put the interior points that meet the transformation model Q into the interior point set O in And calculate the interior point rate P t1 (i); A parameter iteration training unit is used to compare the set threshold with the inlier rate, and iteratively update the parameters of the transformation model Q according to the comparison result to obtain a target detection model; A target matching unit, used to identify and match the image feature points using the target detection model to obtain target feature points; Wherein, the interior point updating unit comprises: The affine transformation model is used to determine the translation and rotation relationship between images: The distance error Z is calculated using the following formula: In the formula, h ij Indicates that the six parameters represent the translation and rotation of the original image, (x, y) represents the original image coordinates, Represents the coordinates of the image to be registered.
5. The low-visibility image matching device according to claim 4, characterized in that: The feature point recognition module comprises: The feature point detection unit is used to detect feature points of the low-visibility image to be identified by using a box filter. The box filter expression is as follows: Among them, D xx It is the approximate value obtained by performing Gaussian second-order partial derivative convolution on the points on the image in the x direction, D yy The approximate value obtained by performing Gaussian second-order partial derivative convolution on the points on the image in the y direction, D xy It is the approximate value obtained by performing Gaussian second-order partial derivative convolution on the points on the image in the xy direction, and ω is the weighting coefficient.
6. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the low-visibility image matching method according to any one of claims 1 to 3 is implemented.
7. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the low-visibility image matching method according to any one of claims 1 to 3 is implemented.
