Intersection-enhanced straight line segment matching method and system between images
By using similarity screening and projection transformation of feature points and intersection pairs in image matching, the accuracy of straight line segment matching is improved, the problem of insufficient straight line segment matching affected by the quality of feature points in the existing technology is solved, and a more accurate image matching results.
Patent Information
- Application Number
- CN202310289085.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-23
- Publication Date
- 2024-09-06
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the existing technology, the straight line segment matching method based on feature points has unsatisfactory feature matching results in scenes that lack texture or repeated patterns, resulting in poor straight line segment matching results. Especially in the absence of feature points, geometric constraints are not applicable, which may Resulting in missing matching results.
By obtaining the feature point pairs and straight line segments of the two images, detect the straight line pairs, select candidate matching straight line pairs based on the polar lines of the straight line pairs, use the feature points in the neighborhood to calculate the similarity, filter the matching intersection point pairs, and pass the homography matrix Project the straight line segment in one image to another image, and accumulate the similarity to the voting matrix to select the final straight line segment matching result.
Effective use of feature points and intersection points improves the accuracy of straight line segment matching in images. It is suitable for all straight line segment matching methods based on feature points and enhances the reliability of matching results, especially in scenarios lacking feature points.
Smart Images

Figure CN116342907B
Abstract
Description
[0001] Technology Neighborhood
[0002] The invention relates to the field of image matching technology, and in particular to an intersection-enhanced straight line segment matching method and system between images. Background Art
[0003] Image matching is a method of finding the target image by analyzing the image content, features, structure, relationship, texture and grayscale. The features used in image matching are an important research topic in image recognition, among which the straight line segment feature is an important feature commonly used in matching.
[0004] The line segment matching task is to obtain the line segments in each image from two images of the same scene through a line segment detection algorithm, and finally match the line segments in the two images that correspond to the same real world. Existing line segment matching methods include: for each line segment, create a descriptor based on the surrounding image information; for each line descriptor in one image, find the line with the closest similarity to the descriptor in the other image; then filter according to some similarity thresholds to finally obtain the matching result. In order to deal with the problem of inconsistent scales of the two images, each line will be placed in a different scale space to obtain more descriptors for matching. There is also a line segment matching method that combines line segments into groups or pairs to form integrated features, which can provide additional geometric or topological constraints for matching disambiguation. There is also a line matching method based on point correspondence that uses the feature point pairs of feature matching results as reliable prior knowledge to guide the matching of line segments. The prior art [1] derives an affine invariant, which can be calculated by the line and the two feature points around the line, and the final matching result is filtered out by the invariant. Similarly, the prior art [2] calculates the proposed feature number through the feature point pairs around the straight line segment. The feature number has projection invariance and can be used to match the straight line segment. The prior art [3] uses feature points to impose geometric constraints to obtain candidate matching straight line segments, and then uses descriptors to match the straight line segments. These methods are based on a considerable number of feature points and have higher positioning accuracy than line segment endpoints. Point matching is usually used to construct geometric invariants or geometric constraints to guide the matching of line segments.
[0005] However, the performance of the feature point based line segment matching method is undoubtedly affected by the quality of the provided feature points. In some scenes, such as the lack of texture and repeated patterns, the feature point results obtained by feature matching are relatively poor, resulting in unsatisfactory line segment matching results. Secondly, when there are almost no feature points in the area around the line segment, the geometric constraints are not applicable, which will lead to the omission of possible matching results and poor matching results.
[0006] References:
[0007] [1]Bin Fan, Fuchao Wu, and Zhanyi Hu, “Line matching leveraged by pointcorrespondences,” in IEEE Computer Society Conference on Computer Vision andPattern Recognition, 2010, pp.390–397.
[0008] [2] Qi Jia, Xin Fan, Xinkai Gao, Meiyu Yu, Haojie Li, and Zhongxuan Luo, “Line matching based on line-points invariant and local homography,” Pattern Recognition, vol. 81, pp. 471–483, 2018.
[0009] [3]Jingxue Wang, Qing Zhu, Suyan Liu, and Weixi Wang, "Robust linefeature matching based on pair-wise geometric constraints and matchingredundancy," ISPRS Journal of Photogrammetry and Remote Sensing, vol.172, pp.41–58, 2021. Summary of the invention
[0010] To this end, the technical problem to be solved by the present invention is to overcome the deficiencies in the prior art and provide a method and system for matching straight line segments between images with intersection enhancement, which can effectively utilize feature points and intersections and improve the accuracy of straight line segment matching in images.
[0011] In order to solve the above technical problems, the present invention provides an intersection-enhanced straight line segment matching method between images, comprising:
[0012] Obtain two images to be matched, and extract a set of feature point pairs in the two images to be matched;
[0013] Detecting straight line segments in the two images to be matched, combining and verifying the straight line segments in each of the images to be matched to obtain straight line pairs;
[0014] Selecting candidate matching straight line pairs according to the epipolar lines of the straight line pairs, calculating similarity according to feature points in the neighborhood of the candidate matching straight line pairs, and screening the similarity to obtain a final matching intersection pair;
[0015] Searching for at least four pairs of final matching intersection points and feature point pairs in the neighborhood around the two candidate matching straight line pairs, and obtaining a homography matrix according to the at least four pairs of final matching intersection points and feature point pairs;
[0016] According to the homography matrix, a straight line segment in one image to be matched is projected into another image to be matched, the similarity between the projected straight line segment and the straight line segment in the candidate matching straight line pair is calculated and accumulated into a voting matrix, and the final straight line segment matching result is selected according to the voting matrix.
[0017] In one embodiment of the present invention, the pairwise combination and verification of the straight line segments in each to-be-matched image to obtain straight line pairs includes:
[0018] Select two straight line segments whose included angle is greater than a preset angle threshold. If the distance between the intersection point of the two straight line segments and the straight line segments meets the distance condition, the two straight line segments are combined into a straight line pair.
[0019] In one embodiment of the present invention, the distance condition is met as follows:
[0020] The distance between the intersection point of two straight line segments and the two intersection points of any of the two straight line segments satisfies:
[0021] min{d(I k ,e1),d(I k ,e2)}≤T d d(e1,e2),
[0022] Where d(·) is the Euclidean distance between two points, e1 and e2 are the coordinates of the endpoints on any one of the two straight line segments, and I k is the intersection of two straight line segments, T d is the distance threshold.
[0023] In one embodiment of the present invention, the candidate matching straight line pairs are selected according to the epipolar lines of the straight line pairs, specifically:
[0024] For each straight line pair in one of the images to be matched, the epipolar line of the intersection of the straight line pair in the other image to be matched is calculated, and multiple straight line pairs in the other image to be matched whose distance from the intersection point to the epipolar line meets a preset distance threshold are regarded as a set of candidate matching straight line pairs for the straight line pairs in the image to be matched.
[0025] In one embodiment of the present invention, calculating similarity based on feature points in the neighborhood of the candidate matching line pair, and screening the similarity to obtain a final matching intersection pair includes:
[0026] Taking the candidate matching straight line pair set of the straight line pairs in the image to be matched as a one-to-many imaginary pairing result of straight line pairs, that is, a one-to-many imaginary intersection matching pair;
[0027] For each pair of imaginary intersection matching pairs, find the nearest multiple feature points to build a neighborhood, calculate the similarity based on the distance of the feature points in the neighborhood relative to the central intersection and the distance ranking, and perform three-level screening on the similarity to obtain a one-to-one final matching intersection pair.
[0028] In one embodiment of the present invention, the similarity is calculated based on the distance of the feature points in the neighborhood relative to the central intersection point and the distance ranking as follows:
[0029] sim=W T X,
[0030] Among them, W indicates whether the weight of the edge between the surrounding points and the center intersection is established or not, and X indicates whether the edge between the surrounding points and the center intersection is established or not; X is a binary vector of 0 or 1, and 0 indicates that the element in W at the corresponding position does not participate in the calculation; the first element of X is fixed to 1, and the remaining K bits are assigned values according to whether there are common feature points in the neighborhood. The value of 1 indicates that there are common feature points, and the value of 0 indicates that there are no common feature points, so X has K+1 elements; the W vector contains an intersection similarity value and K edge similarity values, and K is the number of feature points in the neighborhood.
[0031] In one embodiment of the present invention, the three-layer screening includes:
[0032] First-level screening: using feature points around possible matching intersection pairs, calculating the similarity, retaining those with similarity greater than a preset threshold, and obtaining a result set M1;
[0033] Second-level screening: for each pair of intersections in M1, find K nearest neighbor intersections from M1, calculate the similarity, and keep those with similarity greater than a preset threshold to obtain a result set M2;
[0034] The third level of screening: for each pair of intersections in M2, find K nearest neighbor intersections in M2, calculate the similarity, and keep those with similarity greater than a preset threshold to obtain the final result.
[0035] In one embodiment of the present invention, the calculating of the similarity between the projected straight line segment and the straight line segment in the candidate matching straight line pair is specifically:
[0036] If the overlap rate of two straight line segments is less than the preset threshold or min(CC′,DD′) is greater than the preset threshold, the two straight line segments are considered to be mismatched and their similarity is 0; otherwise, the two straight line segments l i and l j The similarity is:
[0037] sim(l i ,l j )=e -min{CC′,DD′}
[0038] Among them, CC′ and DD′ respectively represent the distances from the two endpoints of the target straight line segment in the candidate matching straight line pair to the projected straight line segment, and min(CC′,DD′) represents the smaller value of CC′ and DD′.
[0039] In one embodiment of the present invention, the accumulation is added to the voting matrix, and the final straight line segment matching result is selected according to the voting matrix, specifically:
[0040] Adding the similarity between the projected straight line segment and the straight line segment in the candidate matching straight line pair to the corresponding position in the voting matrix, the voting matrix is a matrix of M rows×N columns, M and N are respectively the number of straight line segments detected in the two images to be matched; the element in the i-th row and j-th column in the voting matrix represents the similarity between the i-th straight line segment in one image to be matched and the j-th straight line segment in another image to be matched;
[0041] Select the element whose row and column are both the maximum value from the voting matrix, and use the straight line segment corresponding to the element as the final matching straight line segment.
[0042] The present invention also provides an intersection-enhanced straight line segment matching system between images, comprising:
[0043] A feature matching module is used to obtain two images to be matched and extract a set of feature point pairs in the two images to be matched;
[0044] A straight line segment detection module is used to detect straight line segments in two images to be matched;
[0045] A straight line pair generation module, used for combining and verifying the straight line segments in each image to be matched to obtain straight line pairs;
[0046] A line pair matching module, used for selecting candidate matching line pairs according to the epipolar lines of the line pairs;
[0047] An intersection matching module is used to calculate similarity based on feature points in the neighborhood of the candidate matching straight line pair, and screen the similarity to obtain a final matching intersection pair;
[0048] A projection transformation estimation module, used to find at least four pairs of final matching intersection points and feature point pairs in the neighborhood around the two candidate matching straight line pairs, and obtain a homography matrix according to the at least four pairs of final matching intersection points and feature point pairs;
[0049] The straight line segment matching module is used to project the straight line segments in one image to be matched to another image to be matched according to the homography matrix, calculate the similarity between the projected straight line segments and the straight line segments in the candidate matching straight line pairs and accumulate them into the voting matrix, and select the final straight line segment matching result according to the voting matrix.
[0050] The above technical solution of the present invention has the following advantages compared with the prior art:
[0051] The present invention pairs straight line segments to obtain intersection points, and then performs screening and matching to obtain intersection pairs in the two images; by using these additional intersection pairs to expand feature point pairs, all straight line segment matching methods based on feature points can be applied, effectively utilizing feature points and intersection points, and improving the accuracy of straight line segment matching in images. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] In order to make the content of the present invention more clearly understood, the present invention is further described in detail below according to specific embodiments of the present invention in conjunction with the accompanying drawings, wherein:
[0053] Figure 1 It is a flow chart of the present invention.
[0054] Figure 2 It is a process step diagram of the present invention.
[0055] Figure 3 Schematic diagram of straight line similarity calculation in an embodiment of the present invention. DETAILED DESCRIPTION
[0056] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments so that those skilled in the art can better understand the present invention and implement it, but the embodiments are not intended to limit the present invention.
[0057] Embodiment 1
[0058] Reference Figure 1-Figure 2 As shown, the present invention discloses a method for matching straight line segments between images with intersection enhancement. The input of the present invention is two images, and the output is the correspondence between the straight line segments in the two images and the straight line segments between the two images (i.e., the straight line segment matching result), which includes the following steps:
[0059] S1: Feature matching: obtain two images to be matched, and extract a set of feature point pairs in the two images to be matched;
[0060] S1-1: Obtain two images to be matched, and use the ASIFT feature matching algorithm to extract feature points in the two images to obtain a set of feature point pairs;
[0061] S1-2: Use a screening algorithm to remove noise from feature point pairs. The screening algorithm used in this embodiment can be a GMS feature point pair mismatch removal algorithm. For details, see the paper Bian, Jia Wang, et al. "Gms: Grid-based motion statistics for fast, ultra-robust feature correspondence." Proceedings of the IEEE conference on computer vision and pattern recognition. 2017.
[0062] S2: straight line segment detection: straight line segments in the two images to be matched are detected; in this embodiment, the LSD algorithm is used to detect straight line segments.
[0063] S3: straight line pair generation: straight line pairs are obtained by combining and verifying the straight line segments in each image to be matched.
[0064] S3-1: Since it is difficult for two straight lines to have an intersection if they are parallel, pairing them is considered only when the angle between the two straight lines is greater than a certain threshold. Therefore, two straight line segments whose angle is greater than a preset angle threshold are selected, and the angle threshold is π / 18;
[0065] S3-2: If the distance between the intersection point of two straight line segments and the straight line segments meets the distance condition:
[0066] The distance between the intersection point of two straight line segments and the two intersection points of any of the two straight line segments satisfies:
[0067] min{d(I k ,e1),d(I k ,e2)}≤T d d(e1,e2),
[0068] Where d(·) is the Euclidean distance between two points, e1 and e2 are the coordinates of the endpoints on any one of the two straight line segments, and I k is the intersection of two straight line segments, T d is the distance threshold, and in this embodiment, the distance threshold is 0.2.
[0069] S3-3: The two straight line segments at this time are combined into a straight line pair.
[0070] For example, two straight line segments l i and lj , their intersection point is I k , if the following constraints are met, it is considered to be a straight line pair that meets the requirements: min{d(I k ,e1),d(I k ,e2)}≤T d ·d(e1,e2) and θ k ≥T θ ; where d(·) is the Euclidean distance between two points, e1 and e2 are the coordinates of the two endpoints of any two straight lines, T d is the distance threshold, which is set to 0.2 based on experience, θ k is the angle between the two straight lines, T θ is the angle threshold, which is empirically set to π / 18.
[0071] S4: Line pair matching: Select candidate matching line pairs according to the epipolar lines of the line pairs, specifically:
[0072] For the straight line pairs in the two images, we will try to pair them up. We will not get a specific one-to-one straight line pair pairing result here. Instead, for each straight line pair in one of the images to be matched, we will calculate the epipolar line of the intersection of the straight line pair in the other image to be matched. Then, we will use multiple straight line pairs in the other image to be matched whose intersection points meet a preset distance threshold from the epipolar line as a set of candidate matching straight line pairs for the straight line pairs in the image to be matched. In this embodiment, the distance threshold is 0.05.
[0073] For a pair of straight lines, their intersection point is I k , the polar line of the intersection point in the other figure is: l e =FI k , F is the basic matrix, which can be estimated from the feature point pair set in step S1. Specifically, the "estimateFundamentalMatrix" function in matlab can be used to obtain the basic matrix F. Then, the distance from the intersection point in the figure to the epipolar line is calculated in another figure. If it is less than 0.05, it is regarded as a candidate straight line pair that matches the straight line pair in the original figure.
[0074] S5: Intersection matching: Calculate the similarity based on the feature points in the neighborhood of the candidate matching line pair, and screen the similarity to obtain the final matching intersection pair. Through step S4, you can get a one-to-many imaginary pairing result of the line pair, that is, a one-to-many intersection match. They will be refined and purified in this step to get the final desired precise one-to-one intersection pair. Here, the imaginary intersection pairs will be calculated by similarity, and the ones with the largest similarity will be regarded as possible real matches.
[0075] S5-1: For each pair of imaginary intersection matching pairs, find the nearest K feature points around them to build a neighborhood. In this embodiment, the KD tree algorithm is used. For each intersection of a pair of straight lines, find the K feature points closest to the intersection. Calculate their similarity. The similarity calculation method is:
[0076] sim=W T X,
[0077] Among them, W and X represent the weight of the edge between the surrounding points and the central intersection and whether the edge is established or not. X is a binary (0 and 1) vector, and 0 means that the element in W at the corresponding position does not participate in the calculation. Its first element is fixed to 1, and the remaining K bits are assigned 1 (there are common feature points) or 0 (no common feature points) according to whether there are common feature points in their neighborhood, so it has K+1 elements. The W vector contains an intersection similarity value and K edge similarity values. The intersection similarity is obtained by counting the number of feature points whose ranking from the central intersection in the neighborhood has not increased (the smaller the closer to the center point), and normalizing it. The edge similarity is obtained by the ratio of the change in the feature point to the central intersection.
[0078] S5-2: Perform three-level screening on the similarity to obtain a one-to-one final matching intersection pair, wherein the three-level screening includes:
[0079] First-level screening: using feature points around possible matching intersection pairs, calculating the similarity, retaining those with similarity greater than a preset threshold, and obtaining a result set M1. In this embodiment, the preset threshold here is 0.6;
[0080] Second-level screening: for each pair of intersections in M1, find K nearest neighbor intersections from M1, calculate the similarity, and keep those with similarity greater than a preset threshold to obtain a result set M2;
[0081] The third level of screening: for each pair of intersections in M2, find K nearest neighbor intersections in M2, calculate the similarity, and keep those with similarity greater than a preset threshold to obtain the final result.
[0082] Through three-level screening, a set of accurate intersection pairs with high reliability is obtained.
[0083] S6: Projection transformation estimation: There are many methods for projective transformation estimation. In any case, the core method is to find at least four pairs of final matching intersection points and feature points in the neighborhood around the two candidate matching straight line pairs (that is, from a set of feature points enhanced by a matching intersection point pair, that is, a set of matching intersection points + feature points, select 4 pairs), and obtain the homography matrix H based on the 4 pairs of final matching intersection points and feature points. The homography matrix H can be used to project the straight line segments to the same plane as the candidate matching straight line pairs and then calculate their similarity, that is, it can be used to calculate the transformation correspondence between the local areas of the two images; of course, if the given set of matching point pairs is accurate enough and the number is large enough, then the transformation relationship on the entire image can be accurately estimated. The local homography matrix has 8 degrees of freedom (unknown quantities), and the homography matrix can be solved through at least 4 pairs of points. The homography matrix H can be obtained through public ready-made functions or self-matrix operations.
[0084] S7: Straight line segment matching: According to the homography matrix, the straight line segments in one image to be matched are projected into the space of another image to be matched; the similarity between the projected straight line segments and the straight line segments in the candidate matching straight line pairs is calculated, and the similarity between the projected straight line segments and the straight line segments in the candidate matching straight line pairs is accumulated into the voting matrix, and finally a one-to-one straight line segment matching result is selected.
[0085] S7-1: For the one-to-many imaginary straight line pairs obtained in step S4, according to the homography matrix obtained in step S6 (i.e., the projection transformation relationship between the two images and each local area), the straight line segments in one image to be matched are projected into the space of another image to be matched.
[0086] S7-2: Calculate the similarity between it and two straight line segments in another graph. Figure 3 The following is a schematic diagram of the calculation of straight line similarity. i The straight line mapped to the right figure is l i ′, the overlap rate of the two lines is A′D′ / CD. The similarities of these line segments are accumulated into a voting matrix. The elements in the i-th row and j-th column of the matrix represent the similarity between the i-th line segment in the left image and the j-th line segment in the right image. Select the element with the maximum value in both the row and column to get the matching line segment.
[0087] like Figure 3 As shown in Figure 2, if the overlap rate of two straight line segments is less than the preset threshold of 0.5 or min(CC′,DD′) is greater than the preset threshold of 0.1, the two straight line segments are considered to be mismatched and their similarity is 0; otherwise, the two straight line segments l i and l j The similarity is:
[0088] sim(l i,l j )=e -min{CC′,DD′} ,
[0089] Among them, CC′ and DD′ respectively represent the distances from the two endpoints of the target straight line segment in the candidate matching straight line pair to the projected straight line segment, and min(CC′,DD′) represents the smaller value of CC′ and DD′.
[0090] S7-3: Add the similarity between the projected straight line segment and the straight line segment in the candidate matching straight line pair to the corresponding position in the voting matrix, wherein the voting matrix is a matrix of M rows × N columns, where M and N are the number of straight line segments detected in the two images to be matched respectively; the element in the i-th row and j-th column of the voting matrix represents the similarity between the i-th straight line segment in one image to be matched and the j-th straight line segment in another image to be matched.
[0091] S7-4: Select the element with the maximum value in both row and column from the voting matrix, and use the line segment corresponding to the element as the final matching line segment. For example, (i, j) is the maximum value in the i-th row and the j-th column, which means that the i-th line segment in the left image and the j-th line segment in the right image are matched.
[0092] Embodiment 2
[0093] The present invention also discloses an intersection-enhanced straight line segment matching system between images, comprising a feature matching module, a straight line segment detection module, a straight line pair generation module, a straight line pair matching module, an intersection matching module, a projection transformation estimation module and a straight line segment matching module.
[0094] A feature matching module is used to obtain two images to be matched and extract a set of feature point pairs in the two images to be matched; a straight line segment detection module is used to detect and obtain straight line segments in the two images to be matched; a straight line pair generation module is used to combine and verify the straight line segments in each image to be matched to obtain straight line pairs; a straight line pair matching module is used to select candidate matching straight line pairs according to the polar lines of the straight line pairs; an intersection matching module is used to calculate the similarity based on the feature points in the neighborhood of the candidate matching straight line pairs, and screen the similarity to obtain the final matching intersection point pairs; a projection transformation estimation module is used to find at least four pairs of final matching intersection point pairs and feature point pairs in the neighborhood around the two candidate matching straight line pairs, and obtain a homography matrix based on at least four pairs of final matching intersection point pairs and feature point pairs; a straight line segment matching module is used to project the straight line segments in one image to be matched to another image to be matched according to the homography matrix, calculate the similarity between the projected straight line segments and the straight line segments in the candidate matching straight line pairs and accumulate them into the voting matrix, and select the final straight line segment matching result according to the voting matrix.
[0095] Compared with the straight line segment matching method based on feature point pairs in the prior art which only uses a single feature point set obtained by feature matching, the present invention introduces additional high-precision intersection point pairs on the basis of the original point set, thereby making the straight line segment matching process more accurate and the matching results more accurate.
[0096] In the straight line segment matching method based on feature points, the quality and quantity of the feature points greatly affect the quality of the straight line segment matching results. The present invention pairs the straight line segments to obtain intersection points, and then performs screening and matching to obtain the intersection point pairs in the two images; by using these additional intersection point pairs to expand the feature point pairs, the straight line segment matching results are better.
[0097] The present invention is applicable to all straight line segment matching methods based on feature points. On the basis of the existing point set of feature points obtained by feature matching, these intersection points are used as an additional expanded point set to improve the accuracy of the straight line segment matching process; and the matching results can be more effectively used in applications such as scene reconstruction, autonomous driving, etc. that require the use of three-dimensional reconstruction.
[0098] The technicians in this field should understand that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of complete hardware embodiments, complete software embodiments, or embodiments in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program codes.
[0099] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0100] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1A function specified in one or more boxes.
[0101] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0102] Obviously, the above embodiments are merely examples for clear explanation and are not intended to limit the implementation methods. For ordinary technicians in the relevant field, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the implementation methods here. The obvious changes or modifications derived from them are still within the protection scope of the invention.
Claims
1. A method for matching straight line segments between images with intersection enhancement, characterized in that: include: Obtain two images to be matched, and extract a set of feature point pairs in the two images to be matched; Detecting straight line segments in the two images to be matched, combining and verifying the straight line segments in each of the images to be matched to obtain straight line pairs; Selecting candidate matching straight line pairs according to the epipolar lines of the straight line pairs, calculating similarity according to feature points in the neighborhood of the candidate matching straight line pairs, and screening the similarity to obtain a final matching intersection pair; Searching for at least four pairs of final matching intersection points and feature point pairs in the neighborhood around the two candidate matching straight line pairs, and obtaining a homography matrix according to the at least four pairs of final matching intersection points and feature point pairs; Projecting a straight line segment in one image to be matched into another image to be matched according to the homography matrix, calculating the similarity between the projected straight line segment and the straight line segment in the candidate matching straight line pair and accumulating the similarity into a voting matrix, and selecting a final straight line segment matching result according to the voting matrix; Selecting candidate matching straight line pairs according to the epipolar lines of the straight line pairs, specifically: for each straight line pair in one of the images to be matched, calculating the epipolar line of the intersection of the straight line pair in the other image to be matched, and taking a plurality of straight line pairs whose intersection in the other image to be matched is at a distance from the epipolar line that satisfies a preset distance threshold as a set of candidate matching straight line pairs of the straight line pairs in the image to be matched; Calculating similarity based on feature points in the neighborhood of the candidate matching straight line pairs, and screening the similarity to obtain final matching intersection pairs, including: taking the candidate matching straight line pair set of straight line pairs in the image to be matched as a one-to-many straight line pair imaginary pairing result, that is, a one-to-many imaginary intersection matching pair; For each pair of imaginary intersection matching pairs, find the nearest multiple feature points to build a neighborhood, calculate the similarity based on the distance of the feature points in the neighborhood relative to the central intersection and the distance ranking, and perform three-level screening on the similarity to obtain a one-to-one final matching intersection pair.
2. The method for matching straight line segments between images with intersection enhancement according to claim 1, characterized in that: The pairwise combination and verification of the straight line segments in each to-be-matched image to obtain straight line pairs includes: Select two straight line segments whose included angle is greater than a preset angle threshold. If the distance between the intersection point of the two straight line segments and the straight line segments meets the distance condition, the two straight line segments are combined into a straight line pair.
3. The method for matching straight line segments between images with intersection enhancement according to claim 2, characterized in that: The distance condition is specifically: The distance between the intersection point of two straight line segments and the two intersection points of any of the two straight line segments satisfies: min{d(I k ,e1),d(I k ,e2)}≤T d ·d(e1,e2), Where d(·) is the Euclidean distance between two points, e1 and e2 are the coordinates of the endpoints on any one of the two straight line segments, and I k is the intersection of two straight line segments, T d is the distance threshold.
4. The method for matching straight line segments between images with intersection enhancement according to claim 1, characterized in that: The similarity is calculated based on the distance between the feature points in the neighborhood and the central intersection and the distance ranking: sim=W T X, Among them, W indicates whether the weight of the edge between the surrounding points and the center intersection is established or not, and X indicates whether the edge between the surrounding points and the center intersection is established or not; X is a binary vector of 0 or 1, and 0 indicates that the element in W at the corresponding position does not participate in the calculation; the first element of X is fixed to 1, and the remaining K bits are assigned values according to whether there are common feature points in the neighborhood. The value of 1 indicates that there are common feature points, and the value of 0 indicates that there are no common feature points, so X has L+1 elements; the W vector contains an intersection similarity value and K edge similarity values, and K is the number of feature points in the neighborhood.
5. The method for matching straight line segments between images with intersection enhancement according to claim 1, characterized in that: The three-level screening includes: First-level screening: using feature points around possible matching intersection pairs, calculating the similarity, retaining those with similarity greater than a preset threshold, and obtaining a result set M1; Second-level screening: for each pair of intersections in M1, find K nearest neighbor intersections from M1, calculate the similarity, and keep those with similarity greater than a preset threshold to obtain a result set M2; The third level of screening: for each pair of intersections in M2, find K nearest neighbor intersections in M2, calculate the similarity, and keep those with similarity greater than a preset threshold to obtain the final result.
6. The method for matching straight line segments between images with intersection enhancement according to claim 1, characterized in that: The calculating of the similarity between the projected straight line segment and the straight line segment in the candidate matching straight line pair is specifically as follows: If the overlap rate of two straight line segments is less than the preset threshold or min(CC′,DD′) is greater than the preset threshold, the two straight line segments are considered to be mismatched and their similarity is 0; otherwise, the two straight line segments l i and l j The similarity is: yes(l i ,l j )=and -min{CC′,DD′} Among them, CC′ and DD′ respectively represent the distances from the two endpoints of the target straight line segment in the candidate matching straight line pair to the projected straight line segment, and min(CC′,DD′) represents the smaller value of CC′ and DD′.
7. The method for matching straight line segments between images with intersection enhancement according to any one of claims 1 to 6, characterized in that: The above are accumulated into the voting matrix, and the final straight line segment matching result is selected according to the voting matrix, which is specifically: Adding the similarity between the projected straight line segment and the straight line segment in the candidate matching straight line pair to the corresponding position in the voting matrix, the voting matrix is a matrix of M rows×N columns, M and N are respectively the number of straight line segments detected in the two images to be matched; the element in the i-th row and j-th column in the voting matrix represents the similarity between the i-th straight line segment in one image to be matched and the j-th straight line segment in another image to be matched; Select the element whose row and column are both the maximum value from the voting matrix, and use the straight line segment corresponding to the element as the final matching straight line segment.
8. An intersection-enhanced straight line segment matching system between images, characterized in that: include: A feature matching module is used to obtain two images to be matched and extract a set of feature point pairs in the two images to be matched; A straight line segment detection module is used to detect straight line segments in two images to be matched; A straight line pair generation module, used for combining and verifying the straight line segments in each image to be matched to obtain straight line pairs; A line pair matching module, used for selecting candidate matching line pairs according to the epipolar lines of the line pairs; An intersection matching module is used to calculate similarity based on feature points in the neighborhood of the candidate matching straight line pair, and screen the similarity to obtain a final matching intersection pair; A projection transformation estimation module, used to find at least four pairs of final matching intersection points and feature point pairs in the neighborhood around the two candidate matching straight line pairs, and obtain a homography matrix according to the at least four pairs of final matching intersection points and feature point pairs; A straight line segment matching module is used to project the straight line segments in one image to be matched to another image to be matched according to the homography matrix, calculate the similarity between the projected straight line segments and the straight line segments in the candidate matching straight line pairs and accumulate them into a voting matrix, and select the final straight line segment matching result according to the voting matrix; Selecting candidate matching straight line pairs according to the epipolar lines of the straight line pairs, specifically: for each straight line pair in one of the images to be matched, calculating the epipolar line of the intersection of the straight line pair in the other image to be matched, and taking a plurality of straight line pairs whose intersection in the other image to be matched is at a distance from the epipolar line that satisfies a preset distance threshold as a set of candidate matching straight line pairs of the straight line pairs in the image to be matched; Calculating similarity based on feature points in the neighborhood of the candidate matching straight line pairs, and screening the similarity to obtain final matching intersection pairs, including: taking the candidate matching straight line pair set of straight line pairs in the image to be matched as a one-to-many straight line pair imaginary pairing result, that is, a one-to-many imaginary intersection matching pair; For each pair of imaginary intersection matching pairs, find the nearest multiple feature points to build a neighborhood, calculate the similarity based on the distance of the feature points in the neighborhood relative to the central intersection and the distance ranking, and perform three-level screening on the similarity to obtain a one-to-one final matching intersection pair.
