A method for outdoor scene image stitching based on feature screening
By using feature screening and Bayesian models to screen feature points in outdoor scene image stitching, combined with global and local registration, the problems of low stitching accuracy and overlapping areas in the existing technology are solved, and high-quality large field of view image stitching is achieved. .
Patent Information
- Application Number
- CN202110036464.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-12
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2041-01-12
AI Technical Summary
The existing technology has problems such as low image matching accuracy, large overall geometric deformation, and ghosting in overlapping areas when splicing images in outdoor scenes, making it difficult to obtain high-quality large-field images.
A method based on feature screening is adopted, and the corresponding relationship of feature points is obtained through SIFT feature point extraction and RANSAC algorithm. Bayesian model and thin plate spline function are combined to screen feature points, perform global and local registration, and use similarity transformation model and optimal Seams eliminate image ghosting and distortion.
It improves the registration accuracy of image splicing, reduces overall geometric deformation and ghosting in overlapping areas, and achieves natural and accurate splicing effects, which is suitable for outdoor scene images.
Smart Images

Figure CN112837217B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of image processing, and in particular relates to an outdoor scene image splicing method based on feature screening. Background Art
[0002] With the continuous development of society, the demand for large-field-of-view images has become increasingly strong in the fields of security, autonomous driving, medical imaging, etc., but the existing single standard lens cannot obtain large-field-of-view images, and wide-angle and ultra-wide-angle lenses will cause serious image distortion problems, so image stitching technology has emerged. Image stitching refers to stitching together several images with a certain overlapping area in the same scene through a series of technical means to form a large-viewing angle image that includes the entire scene.
[0003] Images taken from multiple perspectives in outdoor scenes often have large perspective changes and small image overlap, resulting in local distribution of points of the same name. The results of existing stitching methods often have problems such as low image matching accuracy, large overall geometric deformation, and ghosting in overlapping areas, making them difficult to apply in practice. Summary of the invention
[0004] Purpose of the invention: In order to overcome the deficiencies in the prior art, a method for outdoor scene image stitching based on feature point screening is provided. By optimizing the feature points multiple times and adopting a strategy combining global registration and local registration, the problem of reduced registration accuracy of existing stitching schemes in outdoor scenes is better solved.
[0005] Technical solution: To achieve the above purpose, the present invention provides an outdoor scene image stitching method based on feature screening, comprising the following steps:
[0006] S1: The SIFT feature point extraction algorithm is used to extract the feature points of the reference image and the target image, and the RANSAC algorithm is used to obtain the corresponding relationship of the feature points;
[0007] S2: Obtain an accurate feature point set P1 according to the feature point screening algorithm based on the Bayesian model;
[0008] S3: According to the feature point set P1, a feature point set P2 for global homography calculation is selected based on the distance-based feature selection method;
[0009] S4: Calculate the global homography transformation matrix using the feature point set P2 to perform global registration;
[0010] S5: local registration using feature point set P1 and grid-based deformation model calculation;
[0011] S6: Use the similarity transformation model and the optimal stitching seam method to eliminate image ghosting and deformation and achieve image stitching.
[0012] Furthermore, the method for acquiring the feature point set P1 in step S2 is: calculating the weight of each pair of matching points according to the characteristics of the thin plate spline function, and then removing the wrong matching points according to the Bayesian theorem to screen out accurate matching point pairs.
[0013] Furthermore, the specific process of obtaining the feature point set P1 in step S2 is as follows:
[0014] For a pair of images I and J to be stitched with overlapping areas, images I and J are the reference image and the target image respectively, and a pair of matching points is denoted as (p i ,p j ), after global registration, denoted as p' i =(x' i ,y' i ) T , p' i is the point p obtained according to the global homography model i The projection point in the image plane J, p' i The parallax at is the projection deviation g i =p' i -p j =(g i ,h i ) T Indicates that (g i ,h i ) T Represents the deformation components in the x and y directions. According to the characteristics of the thin plate spline function, the weight (ω i ,υ i ) by p' i The projection deviation g i and p' i The weight coefficient of each feature point pair is determined by the difference between the projection deviations of other feature point pairs in the nearby area. and By solving the following linear equations:
[0015]
[0016] Where K = (r ij 2 lnr ij )∈R n×n ,
[0017] G=(g 1 ,...,g n ) T ∈R n×2 , λ is a constant;
[0018] Finally, the weight of each feature point is calculated (ωi ,υ i ), weight coefficient (ω i ,υ i ) approximately follows a normal distribution, that is, ω i ~N(0,σ ω ),υ i ~N(0,σ υ ), where σ ω and σ υ Represents ω i and i The standard deviation of
[0019] According to Bayes' theorem, in |ω i |>tσ ω In the case of matching point pairs {p i ,q i The posterior probability that} is a mismatch is:
[0020]
[0021] According to the 3σ principle, take t = 3, then Φ(t) = 0.9987, when p 1 ∈[0,0.9973], there is p(τ i =0|A i )≥0.5, that is, event A i ={|ω i |>3σ ω} occurs, the matching point pair {p i ,q i The probability of mismatch is not less than 50%;
[0022] Therefore, p i ∈[0,0.9973], when |ω appears i |>3σ ω or |υ i |>3σ υ When {p i ,q i} is a false match and is removed.
[0023] Furthermore, the screening method of the feature point set P2 in step S3 is: calculate the average distance between each feature point and other points in the y direction, and screen out the points with the largest average distance, while retaining some feature points with a smaller average distance, that is, feature points in dense areas, to ensure the robustness of the model and determine the feature point set for global registration.
[0024] In the step S3, in the outdoor scene, the uneven distribution of feature points is mainly reflected in the uneven distribution in the y direction, and the sparser the distribution of feature points is, the larger the average distance between it and other feature points is. Therefore, only the average distance between each feature point and other points in the y direction is calculated, and the points with the largest average distance are screened out. At the same time, some feature points with a smaller average distance, that is, feature points in dense areas, are retained to ensure the robustness of the model. Through such a screening strategy, the ratio of feature points in dense and sparse areas used for global registration is changed from the original 1:4 to 1:1, which increases the weight of feature points in sparse areas in calculating the global registration model, so that the calculated global registration model focuses more on the registration of sparsely distributed feature points.
[0025] Furthermore, the screening process of the feature point set P2 in step S3 is as follows:
[0026] A1: First, calculate the average distance of each feature point to other points in the y direction;
[0027] The feature point set P1 is used as the initial feature point set, L ij_y It represents the average distance between the i-th feature point and other points in the y direction. The calculation formula is as follows:
[0028]
[0029] Among them, p i represents the i-th feature point, p j represents other feature points except the i-th point;
[0030] A2: The distance l of each feature point ij_y Construct a set and sort it to get the set L ij_y ;
[0031] A3: In set L ij_y In the above example, we select the first α% of the values with the largest distance, and sample the remaining 1-α% of the values. The sampling frequency is set to μ, and the set L is obtained. ij_y_select ;
[0032] A4: Using the mapping relationship, the set L ij_y_select Map to the corresponding points and get the feature point set P2.
[0033] The mapping relationship here refers to the mapping relationship between each feature point and the distance calculated by the feature point. This mapping relationship is specifically that for each point p in the set P1 i Map to the set L ij_y The distance l corresponding to each point in ij_y On each point p i You can calculate its distance l ij_y . After getting the set Lij_y_select Afterwards, it can also be mapped back to the corresponding point set P2.
[0034] Furthermore, the global registration in step S4 is performed by bringing all matching points in the known point set P2 into the global homography approximation model, and by estimating the global homography transformation matrix, the cumulative sum of square errors of all matching points is minimized. Specifically:
[0035] The global homography model is estimated using the matching points (p, q) in the feature point set P2, where the horizontal and vertical coordinates of the matching points are represented as (x p ,y p ), (x q ,y q );
[0036] First, the homography approximation model q~Hp is expressed as the following formula:
[0037]
[0038] Expand it to get two linear equations as follows:
[0039]
[0040] A direct linear transformation is performed on this formula to transform the global homography matrix to be estimated into a variable vector h = (h 1 ,h 2 ,…h 9 ) T , and transform the known variable relationship of the matching feature point pair (p, q) into a known linear parameter matrix as follows:
[0041]
[0042] Therefore, the following formula is obtained:
[0043] ah=0
[0044] The solution h is evaluated by minimizing the cumulative sum of squared errors, as follows:
[0045]
[0046] Where |·| represents L 2 Normal form, that is, Euclidean distance; the combination matrix A satisfies the following equation:
[0047]
[0048] Indicates all a i (i=1,2,…,n) vertical arrangement;
[0049] Decompose the A matrix using SVD to obtain the least squares solution
[0050] Furthermore, the step S5 is to construct an energy function for optimal deformation using the point set P1 and express it in the form of a grid, and to achieve local registration by minimizing the energy function. Specifically:
[0051] The deformation function is constructed as follows:
[0052] g(x,y)=(g(x,y),h(x,y)) T
[0053] This formula represents the image I q The deformation of g(x,y) and h(x,y) represent the deformation components in the x and y directions respectively. According to the theory of thin plate splines, for g(x,y), the energy function used to estimate the optimal deformation is:
[0054] J λ =J D +λJ S
[0055] Among them, the registration term J D and the smoothing term J S The values are:
[0056]
[0057]
[0058] The energy function J λ Minimize and obtain the solutions g(x,y) and h(x,y) about the x and y directions. The complete deformation function is uniformly expressed as:
[0059]
[0060] in,
[0061] Furthermore, step S6 is to combine the homography transformation model with the similarity transformation model, and slowly transition from the homography transformation model to the similarity transformation model from the overlapping area to the non-overlapping area, so as to reduce the projection distortion in the non-overlapping area of the image. Specifically:
[0062] Eliminate image deformation using similarity transformation model;
[0063] In order to obtain accurate feature matching {p i ,q i}After that, the global similarity transformation S is estimated by minimizing the formula:
[0064]
[0065] In the formula, is the similarity transformation model to be estimated;
[0066] H q =μ h H+μ s H s
[0067] Among them, H s is constructed by adding the row (0, 0, 1) to the bottom of the global similarity transform S, and μ h and μ s is a constraint μ h +μ s =1 weighting coefficient, μ h In the distorted source image I', it changes linearly from 1 to 0, so that the image transformation model gradually transitions to H s ;
[0068] Eliminate image ghosting with optimal stitching seams:
[0069] Obtain the overlapping areas Ω(ΔI') and Ω(ΔJ) by registering the source image I' and the target image J;
[0070] Find the best stitching line so that the left side of the stitching line takes the information of the left image and the right side takes the information of the right image to eliminate image ghosting. The selection of the best stitching line requires that the color difference on both sides of the stitching line is as small as possible and the adjacent pixels on both sides of the stitching line are as similar as possible. The search for the best stitching line follows two principles: (a) the color difference on both sides of the stitching line is as small as possible; (b) the adjacent pixels on both sides of the stitching line are as similar as possible.
[0071] For (a), the RGB component difference is performed between the distorted image pairs, and the difference matrix E is obtained after standardization ij ,
[0072]
[0073] Among them, Ω(ΔI') and Ω(ΔJ) represent the RGB component vectors [r ij ,g ij ,b ij ] T ;
[0074] For (b), local similarity is used, that is, the gradient difference matrix is used for quantization. The distorted image is converted to the gradient domain and the difference is performed to obtain the difference matrix E ij grad ;
[0075] E ijgrad =||grad(Ω(ΔI')) ij -grad(Ω(ΔJ)) ij ||
[0076] By combining the difference matrix E ij and the difference matrix E ij grad Get the energy matrix E ij , which is achieved by searching for a path with minimum energy;
[0077] E ij =ω c E ij c +(1-ω c )E ij grad
[0078] Each pixel in the image is regarded as a node, and the energy value is used as a weight, and finally an optimal stitching seam with minimum energy is obtained.
[0079] Furthermore, in step S3, Euclidean distance is used as a metric to perform feature screening.
[0080] Beneficial effects: Compared with the prior art, the present invention improves the image registration accuracy based on the feature distribution characteristics of outdoor scene images through effective screening of image features and a grid-based deformation model, achieves accurate and natural stitching effects, and solves the problems of reduced registration accuracy, large overall geometric deformation, and ghosting in overlapping areas of existing stitching schemes in outdoor scenes. The stitching effect of outdoor scene images is significantly improved, and the method has good application prospects. BRIEF DESCRIPTION OF THE DRAWINGS
[0081] Figure 1 is a flow chart of the method of the present invention;
[0082] Figure 2 Schematic diagram of obtaining an accurate feature point set P1 based on the feature point screening algorithm of the Bayesian model;
[0083] Figure 3 Schematic diagram of feature point set P2 screened out for global homography calculation by distance-based feature screening method;
[0084] Figure 4 is the result image after image registration in the present invention;
[0085] Figure 5 This is the splicing result image obtained after using the similarity transformation model;
[0086] Figure 6 This is the stitching result diagram obtained after using the optimal stitching seam method;
[0087] Figure 7 This is the stitching result image obtained using the existing method. DETAILED DESCRIPTION
[0088] The present invention is further explained below in conjunction with the accompanying drawings and specific embodiments. It should be understood that these embodiments are only used to illustrate the present invention and are not used to limit the scope of the present invention. After reading the present invention, various equivalent forms of modifications to the present invention by those skilled in the art all fall within the scope defined by the claims attached to this application.
[0089] like Figure 1 As shown, the present invention provides an outdoor scene image stitching method based on feature screening, comprising the following steps:
[0090] S1: The SIFT feature point extraction algorithm is used to extract the feature points of the reference image and the target image, and the RANSAC algorithm is used to obtain the corresponding relationship of the feature points;
[0091] S2: The feature point screening algorithm based on the Bayesian model obtains the accurate feature point set P1.
[0092] The obtained feature point set P1 is as follows Figure 2 As shown, the specific process is:
[0093] For a pair of images I and J to be stitched with overlapping areas, let the pair of matching points be (p i ,p j ), after global registration, denoted as p' i =(x' i ,y' i ) T , p' i is the point p obtained according to the global homography model i The projection point in the image plane J, p' i The parallax at is the projection deviation g i =p' i -p j =(g i ,h i ) T Indicates that (g i ,h i ) T Represents the deformation components in the x and y directions. According to the characteristics of the thin plate spline function, the weight (ω i ,υ i ) is mainly composed of p' i The projection deviation g i and p' i The weight coefficient of each feature point pair is determined by the difference between the projection deviations of other feature point pairs in the nearby area. and It can be obtained by solving the following linear equations:
[0094]
[0095] Where K = (r ij 2 lnr ij )∈R n×n ,
[0096] G=(g 1 ,...,g n ) T ∈R n×2 , λ is a constant;
[0097] Finally, the weight of each feature point is calculated (ω i ,υ i ), weight coefficient (ω i ,υ i ) approximately follows a normal distribution, that is, ω i ~N(0,σ ω ),υ i ~N(0,σ υ ), where σ ω and σ υ Represents ω i and i The standard deviation of Under the premise of i and i The mean of is equal to 0.
[0098] According to Bayes' Rule, in |ω i |>tσ ω In the case of matching point pairs {p i ,q i The posterior probability that} is a mismatch is:
[0099]
[0100] According to the 3σ principle, take t = 3, then Φ(t) = 0.9987, when p 1 ∈[0,0.9973], there is p(τ i =0|A i )≥0.5, that is, event A i ={|ω i |>3σ ω} occurs, the matching point pair {p i ,q i} is a mismatch with a probability of no less than 50%.
[0101] Therefore, p i ∈[0,0.9973], when |ω appears i |>3σ ω or |υ i |>3σ υ When {p i ,q i} is a false match and is removed.
[0102] In actual operation, due to the weight distribution σ corresponding to the correct matching point ω and σ υ Unknown, so the weighted standard deviation of all current matching points is used and As an approximation, the mismatching points are eliminated in a cyclic approximation manner. The elimination of mismatching can usually be completed within 10 cycles. In this embodiment, the maximum number of cycles L is set to 10.
[0103] S3: Filter out a feature point set P2 for global homography calculation according to a distance-based feature screening method.
[0104] The obtained feature point set P2 is as follows Figure 3 As shown, the specific process is:
[0105] The feature point set selected by the Bayesian model is represented as P1. The feature point selection strategy based on spatial distribution is as follows:
[0106] (1) First, calculate the average distance of each feature point to other points in the y direction. The initial feature point set is P1, which represents the feature point set selected by the Bayesian model, and L ij_y It represents the average distance between the i-th feature point and other points in the y direction. The calculation formula is as follows:
[0107]
[0108] Among them, p i represents the i-th feature point, p j Represents other feature points except the i-th point.
[0109] (2) The distance l of each feature point ij_y Construct a set and sort it to get the set L ij_y .
[0110] (3) In the set L ij_y In the above example, we select the first α% of the values with the largest distance, and sample the remaining (1-α)% of the values. The sampling frequency is set to μ, and the set L is obtained. ij_y_select In this embodiment, α is set to 20 and μ is set to 1 / 4.
[0111] (4) Using the mapping relationship, the set L ij_y_select Map to the corresponding points and get the point set P2.
[0112] The mapping relationship here refers to the mapping relationship between each feature point and the distance calculated by the feature point. This mapping relationship is specifically that for each point p in the set P1 i Map to the set L ij_y The distance l corresponding to each point in ij_y On each point p i You can calculate its distance l ij_y . After getting the set L ij_y_select Afterwards, it can also be mapped back to the corresponding point set P2.
[0113] In outdoor scenes, the uneven distribution of feature points is mainly reflected in the uneven distribution in the y direction, and the sparser the distribution of feature points is, the greater the average distance between it and other feature points is. Therefore, only the average distance of each feature point in the y direction and other points is calculated, and the points with the largest average distance are screened out. At the same time, some feature points with a smaller average distance, that is, feature points in dense areas, are retained to ensure the robustness of the model. Through such a screening strategy, the ratio of feature points in dense and sparse areas used for global registration is changed from 1:4 to 1:1, which increases the weight of feature points in sparse areas in the calculation of the global registration model, so that the calculated global registration model focuses more on the registration of sparsely distributed feature points. It should be noted that the feature point set P2 is only used when calculating the global homography. In order to ensure the number and accuracy of feature points, the feature point set P1 is still used when calculating local registration.
[0114] S4: Calculate the global homography transformation matrix using the feature point set P2 and perform global registration.
[0115] The global homography model is estimated using the matching points (p, q) in the feature point set P2. The horizontal and vertical coordinates of the matching points are represented as (x p ,y p ), (x q ,y q ).
[0116] First, the homography approximation model q~Hp is expressed in detail as follows:
[0117]
[0118] Expanding it can get two linear equations as follows:
[0119]
[0120] By directly linearly transforming the formula, the global homography matrix to be estimated is transformed into a variable vector h = (h 1 ,h 2 ,…h 9 ) T , and transform the known variable relationship of the matching feature point pair (p, q) into a known linear parameter matrix as follows:
[0121]
[0122] Therefore, the following formula can be obtained:
[0123] ah=0
[0124] There are usually multiple pairs of matching points in the image to be registered. In fact, when solving h, it is usually evaluated by minimizing the cumulative sum of squares error. The formula is as follows:
[0125]
[0126] Here, the formula is a least squares solution to an overdetermined equation (when n>4), which uses |h| 2 = 1 to limit the degrees of freedom of h to 8, where |·| represents L 2 norm, that is, the Euclidean distance. In addition, the combination matrix A satisfies the following equation:
[0127]
[0128] Among them, the combination matrix A represents all a i (i=1,2,…,n) are arranged vertically. In this embodiment, the size is 2n×9.
[0129] In this embodiment, SVD is used to decompose the A matrix to obtain the least squares solution
[0130] S5: Perform local registration using point set P1 and grid-based deformation model calculation.
[0131] The deformation function is constructed as follows:
[0132] g(x,y)=(g(x,y),h(x,y)) T
[0133] This formula represents the image I q The deformation of g(x,y) and h(x,y) represent the deformation components in the x and y directions respectively. According to the theory of thin plate splines, for g(x,y), the energy function used to estimate the optimal deformation is:
[0134] J λ =J D +λJS
[0135] The registration term J D and the smoothing term J S The values are:
[0136]
[0137]
[0138] The energy function J λ By minimizing, we can get the solutions g(x,y) and h(x,y) about the x and y directions. The complete deformation function can be uniformly expressed as:
[0139]
[0140] in, The weight coefficient of each feature point pair and It has already been determined in step S2.
[0141] In this embodiment, after the global registration in step S4 and the local registration in step S5, the following is obtained: Figure 4 The registration result is shown in Figure .
[0142] S6: Use the similarity transformation model and the optimal stitching seam method to eliminate image ghosting and deformation and achieve image stitching.
[0143] 1. Use similarity transformation model to eliminate image deformation.
[0144] Get as Figure 5 The specific acquisition process of the splicing result diagram shown is as follows:
[0145] In order to obtain accurate feature matching {p i ,q i}After that, we estimate the global similarity transformation S by minimizing the formula:
[0146]
[0147] In the formula is the similarity transformation model to be estimated.
[0148] H q =μ h H+μ s H s
[0149] Among them, H s is constructed by adding the row (0, 0, 1) to the bottom of S, and μ h and μ s is a constraint μh +μ s =1 weighting coefficient. h In the distorted source image I', it changes linearly from 1 to 0, so that the image transformation model gradually transitions to H s .
[0150] 2. Eliminate image ghosting using optimal stitching seams.
[0151] Get as Figure 6 The specific acquisition process of the splicing result diagram shown is as follows:
[0152] The overlapped regions Ω(ΔI') and Ω(ΔJ) are obtained by registering the source image I' and the target image J.
[0153] Find the best stitching line so that the left side of the stitching line takes the information of the left image, and the right side takes the information of the right image. The search for the best stitching line follows two principles: (a) the color difference on both sides of the stitching line is as small as possible; (b) the adjacent pixels on both sides of the stitching line are as similar as possible.
[0154] For (a), the RGB component difference is performed between the distorted image pairs, and the difference matrix E is obtained after standardization ij ,
[0155]
[0156] Among them, Ω(ΔI') and Ω(ΔJ) represent the RGB component vectors [r ij ,g ij ,b ij ] T .
[0157] For (b), local similarity is used, that is, the gradient difference matrix is used for quantization. The distorted image is converted to the gradient domain and the difference is performed to obtain the difference matrix E ij grad , the smaller the difference value, the higher the local similarity.
[0158] E ij grad =||grad(Ω(ΔI')) ij -grad(Ω(ΔJ)) ij ||
[0159] These criteria can be obtained by combining the two difference matrices to obtain the energy matrix E ij This is achieved by searching for a path with the least energy. Objects with greater structural differences will have greater energy, and they will be avoided as much as possible during the search, thus suppressing the generation of ghost images.
[0160] E ij =ωc E ij c +(1-ω c )E ij grad
[0161] Each pixel in the image is regarded as a node, and the energy value is used as a weight, and finally an optimal stitching seam with minimum energy can be obtained. c Take 0.5.
[0162] In order to more intuitively reflect the effect of the method of the present invention, the existing splicing method is used to obtain the splicing image shown in FIG. 7. Figure 6 and Figure 7 visible, Figure 7 The registration accuracy is low, the key is the problem of ghosting in the overlapping area. Figure 6 The registration accuracy is high and there is no ghosting problem in the overlapping area, which well verifies the effectiveness of the method of the present invention.
Claims
1. A method for outdoor scene image stitching based on feature screening, It is characterized in that The steps include: S1: The SIFT feature point extraction algorithm is used to extract the feature points of the reference image and the target image, and the RANSAC algorithm is used to obtain the corresponding relationship of the feature points; S2: Obtain feature point set P1 according to the feature point screening algorithm based on the Bayesian model; S3: According to the feature point set P1, a feature point set P2 for global homography calculation is selected based on the distance-based feature selection method; S4: Calculate the global homography transformation matrix using the feature point set P2 to perform global registration; S5: local registration using feature point set P1 and grid-based deformation model calculation; S6: Using the similarity transformation model and the optimal stitching seam method, image ghosting and deformation are eliminated to achieve image stitching; The step S6 is specifically as follows: Eliminate image deformation using similarity transformation model; In order to obtain accurate feature matching {p i ,q i }After that, the global similarity transformation S is estimated by minimizing the formula: In the formula, is the similarity transformation model to be estimated; H q =μ h H+μ s H s Among them, H s is constructed by adding the row (0, 0, 1) to the bottom of the global similarity transform S, and μ h and μ s is a constraint μ h +μ s =1 weighting coefficient, μ h In the distorted source image I', it changes linearly from 1 to 0, so that the image transformation model gradually transitions to H s ; Eliminate image ghosting with optimal stitching seams: Obtain the overlapping areas Ω(ΔI') and Ω(ΔJ) by registering the source image I' and the target image J; Find the best stitching line so that the left side of the stitching line takes the information of the left image, and the right side takes the information of the right image. The search for the best stitching line follows two principles: (a) the color difference on both sides of the stitching line is as small as possible; (b) the adjacent pixels on both sides of the stitching line are as similar as possible. For (a), the RGB component difference is performed between the distorted image pairs, and the difference matrix E is obtained after standardization ij c , Among them, Ω(ΔI') and Ω(ΔJ) represent the RGB component vectors of the overlapping area of the distorted image, respectively. For (b), local similarity is used, that is, the gradient difference matrix is used for quantization. The distorted image is converted to the gradient domain and the difference is performed to obtain the difference matrix E ij grad ; E ij grad =||grad(Ω(ΔI')) ij -grad(Ω(ΔJ)) ij || By combining the difference matrix E ij c and the difference matrix E ij grad Get the energy matrix E ij , which is achieved by searching for a path with minimum energy; E ij =ω c E ij c +(1-ω c )E ij grad Each pixel in the image is regarded as a node, and the energy value is used as a weight, and finally an optimal stitching seam with minimum energy is obtained.
2. The outdoor scene image stitching method based on feature screening according to claim 1, It is characterized in that The method for acquiring the feature point set P1 in step S2 is: calculating the weight of each pair of matching points according to the characteristics of the thin plate spline function, and then removing the mismatching points according to the Bayesian theorem to screen out accurate matching point pairs.
3. The outdoor scene image stitching method based on feature screening according to claim 2, It is characterized in that The specific process of obtaining the feature point set P1 in step S2 is as follows: For a pair of images I and J to be stitched with overlapping areas, images I and J are the reference image and the target image respectively, and a pair of matching points is denoted as (p i ,p j ), after global registration, denoted as p′ i =(x′ i ,y′ i ) T , p′ i is the point p obtained according to the global homography model i The projection point in the image plane J, p i The parallax at ' is the projection deviation g i =p′ i -p j =(g i ,h i ) T Indicates that (g i ,h i ) T Represents the deformation components in the x and y directions. According to the characteristics of the thin plate spline function, the weight (ω i ,υ i ) by p' i The projection deviation g i and p' i The weight coefficient of each feature point pair is determined by the difference between the projection deviations of other feature point pairs in the nearby area. and By solving the following linear equations: Where K = (r ij 2 ln ij )∈R n×n , G=(g 1 ,...,g n ) T ∈R n×2 , λ is a constant; Finally, the weight of each feature point is calculated (ω i ,υ i ), weight coefficient (ω i ,υ i ) approximately follows a normal distribution, that is, ω i ~N(0,σ ω ),υ i ~N(0,σ υ ), where σ ω and σ υ Represents ω i and i The standard deviation of According to Bayes' theorem, in |ω i |>tσ ω In the case of matching point pairs {p i ,q i The posterior probability that} is a mismatch is: According to the 3σ principle, take t = 3, then Φ(t) = 0.9987, when p 1 ∈[0,0.9973], there is p(τ i =0|A i )≥0.5, that is, event A i ={|ω i |>3σ ω } occurs, the matching point pair {p i ,q i The probability of mismatch is not less than 50%; Therefore, p i ∈[0,0.9973], when |ω appears i |>3σ ω or |υ i |>3σ υ When {p i ,q i } is a false match and is removed.
4. The outdoor scene image stitching method based on feature screening according to claim 1, It is characterized in that The method for screening the feature point set P2 in step S3 is: calculating the average distance between each feature point and other points in the y direction, and screening out the points with the largest average distance, while retaining the feature points in the dense area to ensure the robustness of the model and determine the feature point set for global registration.
5. The outdoor scene image stitching method based on feature screening according to claim 4, It is characterized in that The screening process of the feature point set P2 in step S3 is as follows: A1: First, calculate the average distance of each feature point to other points in the y direction; Take the feature point set P1 as the initial feature point set, l ij_y It represents the average distance between the i-th feature point and other points in the y direction. The calculation formula is as follows: Among them, p i represents the i-th feature point, p j represents other feature points except the i-th point; A2: The distance l of each feature point ij_y Construct a set and sort it to get the set L ij_y , every point p in P1 i can be mapped to the set L ij_y The distance l ij_y ; A3: In set L ij_y In the above example, we select the first α% of the values with the largest distance, and sample the remaining 1-α% of the values. The sampling frequency is set to μ, and the set L is obtained. ij_y_select ; A4: Using the mapping relationship, the set L ij_y_select Map to the corresponding points and get the feature point set P2.
6. The outdoor scene image stitching method based on feature screening according to claim 1, It is characterized in that The step S4 is specifically as follows: The global homography model is estimated using the matching points (p, q) in the feature point set P2, where the horizontal and vertical coordinates of the matching points are represented as (x p ,y p ), (x q ,y q ); First, the homography approximation model q~Hp is expressed as the following formula: Expand it to get two linear equations as follows: By directly linearly transforming the formula, the global homography matrix to be estimated is transformed into a variable vector h = (h 1 ,h 2 ,…h 9 ) T , and transform the known variable relationship of the matching feature point pair (p, q) into a known linear parameter matrix as follows: Therefore, the following formula is obtained: ah=0 The solution is evaluated by minimizing the cumulative sum of squared errors The formula is as follows: Where |·| represents L 2 Normal form, that is, Euclidean distance; the combination matrix A satisfies the following equation: Indicates all a i The vertical arrangement of Decompose the A matrix using SVD to obtain the least squares solution 7. The outdoor scene image stitching method based on feature screening according to claim 1, It is characterized in that The step S5 is specifically as follows: The deformation function is constructed as follows: g(x,y)=(g(x,y),h(x,y)) T This formula represents the image I q The deformation of g(x,y) and h(x,y) represent the deformation components in the x and y directions respectively. According to the theory of thin plate splines, for g(x,y), the energy function used to estimate the optimal deformation is: J λ =J D +λJ S Among them, the registration term J D and the smoothing term J S The values are: The energy function J λ Minimize and obtain the solutions g(x,y) and h(x,y) about the x and y directions. The complete deformation function is uniformly expressed as: in, 8. The outdoor scene image stitching method based on feature screening according to claim 1, It is characterized in that In step S3, Euclidean distance is used as a metric to perform feature screening.
