A geometric correction method for images collected by rail transit linear array cameras

The convolutional neural network and improved adaptive clustering algorithm generate segmented correction curves to accurately correct the rail transit image, solving the problem that the image pixel cannot be accurately corrected in the prior art, and achieving high-precision image correction.

CN119359601BActive Publication Date: 2025-04-11CRRC HANGZHOU DIGITAL TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411909453.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-24
Publication Date
2025-04-11
Estimated Expiration
2044-12-24

AI Technical Summary

Technical Problem

The existing rail transit image correction technology cannot achieve accurate correction of every pixel point in the image, especially when the train speed is not constant, the image is prone to stretching or compressive deformation in the horizontal dimension.

Method used

Through the steps of comparing image generation, feature point set generation, list point cluster generation, correction curve stitching and correction image mapping, a segmented correction curve is generated for image mapping of the corrected images using convolutional neural network and improved adaptive clustering algorithm.

Benefits of technology

Accurate correction of each pixel point in the image is achieved, the accuracy and robustness of image correction are improved, and it is suitable for scenes with large speed changes in rail transit.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119359601B_ABST
    Figure CN119359601B_ABST
Patent Text Reader

Abstract

The present invention provides a geometric correction method for images collected by a linear array camera for rail transit, comprising a comparison image generation step, screening an image to be corrected captured by a line scan camera, matching a number of corresponding template images for splicing to generate a first template image; a feature point set generation step, inputting the image to be corrected and the first template image into a convolutional neural network for processing and outputting a first feature point set and a second feature point set; a list point cluster generation step, combining the horizontal coordinates in the first feature point set with the horizontal coordinates in the second feature point set to generate a first list, and performing adaptive clustering to obtain a point cluster; a correction curve splicing step, fitting each point in the point cluster to form a first correction curve, and splicing to obtain a segmented correction curve; a correction image mapping step, performing image mapping on the image to be corrected according to the segmented correction curve; the present invention has the advantage of being able to perform accurate correction on each pixel point in the image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of rail transit image correction, and more particularly to a geometric correction method for images collected by a rail transit linear array camera. Background Art

[0002] In recent years, rail transit intelligent detection technology has made significant progress. Among them, the comprehensive application of train color imaging, 3D imaging and machine vision-based train component status assessment algorithms has become the mainstream trend. In view of the significant feature of the length of the train body, that is, its size far exceeds the width and height, it is particularly appropriate to use a linear array camera designed for dynamic object shooting to capture the train appearance image. In theory, if the sampling frequency of the linear array camera can accurately match the instantaneous speed of the train, a distortion-free train appearance image can be generated. However, in practical applications, the non-constant characteristics of the train speed constitute a significant obstacle. Although the sampling frequency of the camera can be dynamically adjusted through a real-time speed measurement feedback mechanism, due to the inherent lag effect of this adjustment process, the precise synchronization between the camera sampling frequency and the train speed is difficult to achieve, which inevitably leads to stretching or compression deformation of the image in the horizontal dimension.

[0003] In response to the above challenges, one of the current mainstream processing strategies is to set reference marks on the surface of the train, aiming to correct the distorted images captured by the linear array camera based on the deformation of these marks. However, this method has several inherent limitations. First, its correction effect is highly dependent on the scale selection of the reference marks. If the scale of the mark is too large, adjacent marks may be affected by both stretching and compression distortions, which will make it impossible to accurately distinguish and correct these two distortions. On the contrary, if the scale of the mark is too small, when the image is compressed and distorted, some marks may be lost due to image resolution limitations, making the distortion correction process also unable to be accurately performed. In addition, adding reference marks on the surface of the train will not only have a significant impact on the appearance of the car body, but also face practical difficulties in implementing such marks in areas with complex structures and limited space at the bottom of the train.

[0004] In addition to the above methods, another image correction strategy is to rely on the train's own parts as natural reference objects. This strategy applies a target detection algorithm to identify and locate all available landmarks, and then performs an average stretching or compression operation on the entire image based on the difference between the theoretical pixel spacing and the actual pixel spacing between these landmarks to achieve geometric correction of the image. However, the fundamental limitation of this method is that it relies on the average distance for correction, which makes it impossible to accurately correct every pixel of the train image. Therefore, although this method provides a feasible correction path, its correction effect may not be ideal in application scenarios that pursue high-precision image reconstruction.

[0005] In summary, the currently available track train geometry correction technologies all have limitations, and their correction accuracy generally remains below the pixel level. In other words, these methods cannot achieve accurate correction of every pixel in the image. Summary of the invention

[0006] In view of the deficiencies in the prior art, an object of the present invention is to provide a geometric correction method for images captured by a rail transit linear array camera.

[0007] To achieve the above object, the present invention provides the following technical solutions:

[0008] A geometric correction method for images collected by a rail transit linear array camera comprises the following steps:

[0009] A comparison image generation step, screening the image to be corrected captured by the line scan camera, and stitching a plurality of template images corresponding to the image to be corrected in a preset template image library to generate a first template image;

[0010] A feature point set generating step, inputting the image to be corrected and the first template image into a convolutional neural network to process and output a first feature point set corresponding to the image to be corrected and a second feature point set corresponding to the first template image;

[0011] A list point cluster generation step, combining the horizontal coordinates in the first feature point set with the horizontal coordinates in the second feature point set to generate a first list, and adaptively clustering the elements in the first list to obtain point clusters;

[0012] a calibration curve splicing step, fitting each point in the point cluster to form a first calibration curve, and splicing the first calibration curve to obtain a segmented calibration curve;

[0013] The correction image mapping step performs image mapping on the image to be corrected according to the segmented correction curve.

[0014] Furthermore, the list point cluster generation step includes a list verification strategy, which includes calculating the vertical coordinate difference between the first feature point set and the second feature point set in the first list, and filtering outliers greater than a preset pixel threshold N1, and then calculating the average of the difference between the 0th dimension and the 1st dimension of all elements in the filtered first list, and judging whether the average is within the threshold range N2. If so, adaptive clustering is performed; if not, the number of template images is adjusted according to the average to re-join the first template image, and the feature point set generation step is performed again.

[0015] Furthermore, the step of generating list point clusters also includes an adaptive clustering improvement strategy, which includes

[0016] Step S1, traverse all data points, construct a weighted undirected graph, and calculate the similarity between data points by formula 1 and formula 2 to obtain a similarity matrix and a degree matrix;

[0017] Step S2, calculating the similarity matrix and the degree matrix by formula 3 to obtain a Laplace matrix, and then calculating the standardized Laplace matrix by formula 4;

[0018] Step S3, perturbing the standardized Laplace matrix to obtain a perturbation matrix, and performing eigenvalue decomposition on the perturbation matrix to obtain a first eigenvalue and a first eigenvector, and then calculating the difference between two adjacent first eigenvalues ​​to obtain an eigengap sequence, searching for the first maximum value in the eigengap sequence in turn, and determining the corresponding subscript as the number of clusters k;

[0019] Step S4, performing eigenvalue decomposition on the standardized Laplace matrix to obtain a second eigenvalue and a second eigenvector, and constructing a characteristic matrix, converting the row vectors of the characteristic matrix into unit vectors using Formula 5 to obtain a normalized characteristic matrix;

[0020] Step S5, clustering the normalized feature matrix through a clustering algorithm to obtain k clusters.

[0021] Furthermore, the formula 1 is configured as:

[0022] ,

[0023] in, is the similarity between data point i and data point j, is the Euclidean distance from data point i to the kth neighbor point, is the Euclidean distance from data point j to the kth neighbor point;

[0024] The formula 2 is configured as:

[0025] ,

[0026] in, For data points The Euclidean distance to the kth nearest neighbor;

[0027] The formula 3 is configured as:

[0028] ,

[0029] The formula 4 is configured as:

[0030] ,

[0031] in, is the Laplace matrix, is the degree matrix, is the similarity matrix, is the normalized Laplacian matrix;

[0032] The formula 5 is configured as:

[0033] ,

[0034] in, is the normalized feature matrix, Use line algebra to find the eigenvectors corresponding to the first k non-zero largest eigenvalues ​​of the normalized Laplacian matrix.

[0035] Furthermore, the perturbation matrix is ​​configured as:

[0036] ,

[0037] The intrinsic gap configuration in the intrinsic gap sequence is:

[0038] ,

[0039] The cluster number k is configured as:

[0040] ,

[0041] in, is the perturbation matrix, is a small perturbation matrix with a value range of , is a small positive number, is the intrinsic gap, is the first eigenvalue, is the number of clusters, A function to find the maximum value.

[0042] Furthermore, the correction curve splicing step includes a curve verification strategy, and the curve verification strategy includes determining whether the slope of the first correction curve is within a threshold range. If any slope of the first correction curve is outside the threshold range, a first auxiliary feature point set and a second auxiliary feature point set are extracted from the image to be corrected and the first template image respectively, and the first auxiliary feature point set, the second auxiliary feature point set, the first feature point set and the second feature point set are fused, and the list point cluster generation step is performed again. Otherwise, splicing is performed to obtain a segmented correction curve.

[0043] Furthermore, the comparison image generation step includes a template stitching strategy, which includes a preset initialization definition to select a number of template images in sequence, and stitching the number of template images and the image to be corrected in sequence in the horizontal axis direction to generate a first template image.

[0044] Furthermore, the comparison image generation step also includes a preprocessing strategy for the image to be corrected, and the preprocessing strategy for the image to be corrected includes a black image deletion step and a featureless image deletion step.

[0045] The step of deleting the all-black image is to mark the image with all pixel values ​​of zero in the image to be corrected as a all-black image and delete it;

[0046] The featureless image deletion step marks the image with the same pixel value corresponding to the pixel points with the same horizontal coordinate in the image to be corrected as the first featureless image, then converts the image to be corrected into a grayscale image, and adds the pixel values ​​of each column in the vertical coordinate direction in the grayscale image, and then calculates the discrete data of each column of pixels, and marks the image with outliers as the second featureless image based on the discrete data, and deletes the first featureless image and the second featureless image.

[0047] Further, the fitting of the first correction curve includes a quartic spline curve, and the quartic spline curve is configured as follows:

[0048] ,

[0049] in, , , , , These are all coefficients to be determined.

[0050] Furthermore, the convolutional neural network includes a feature extraction module, a graph neural network module, a geometric consistency verification module and a matching result generation module.

[0051] The beneficial effects of the present invention are as follows: the image to be corrected and the spliced ​​first template image are processed through a neural network to output a feature point set, the feature point set is clustered by improved adaptive clustering, curve fitting is performed based on the point cluster, and finally image mapping is performed. Compared with traditional geometric correction technology, the correction method of the present invention can accurately correct each pixel in the image. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] Figure 1 It is the overall flow chart of the present invention;

[0053] Figure 2 is the image to be corrected in the present invention;

[0054] Figure 3 is the first template image in the present invention;

[0055] Figure 4 is a diagram of a matching feature pair process in the present invention;

[0056] Figure 5 It is the fitting calibration curve diagram in the present invention; DETAILED DESCRIPTION

[0057] The present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. The same parts are represented by the same reference numerals. It should be noted that the words "front", "rear", "left", "right", "upper" and "lower" used in the following description refer to directions in the accompanying drawings, and the words "bottom surface" and "top surface", "inner" and "outer" refer to directions toward or away from the geometric center of a specific component, respectively.

[0058] Since the currently disclosed rail train geometric correction technologies all have limitations, their correction accuracy generally remains below the pixel level. In other words, these methods cannot achieve accurate correction of each pixel in the image; therefore, the present invention designs such a geometric correction method for rail transit linear array camera image acquisition, such as Figure 1 As shown, the following steps are included:

[0059] Comparison image generation steps: ①, set image labels for the images acquired by the linear array camera, that is, name all the images to be corrected as 0, 1, 2, ..., t according to the order of image acquisition timestamps.

[0060] ② Then, the image preprocessing strategy to be corrected is performed, wherein the image preprocessing strategy to be corrected includes a step of deleting a completely black image and a step of deleting a featureless image.

[0061] Specifically, the step of deleting the all-black image is to determine whether the image is a completely black image. When the line scan camera is turned on and there is no object in the imaging range, the captured image is a completely black image, that is, the pixel value is (0,0,0). The all function of the NumPy library is used to determine whether the pixel value of each channel is all zero. If so, it is marked as a completely black image and deleted.

[0062] The featureless image deletion step determines whether the image is a featureless image. When the train stops within the imaging range of the line scan camera, the pixel values ​​corresponding to all pixels with the same horizontal coordinates are equal without considering the noise in the image, which is the first featureless image (caused by the midway stop). In addition, the image to be corrected is converted into a grayscale image, and the grayscale image is subjected to median filtering. The pixel values ​​of the filtered image are normalized, and then the pixel values ​​of each column are added in the vertical (y-axis) direction, and then the discrete data composed of each column of pixels is calculated, including the variance and mean. The quartile method is used to calculate whether there are outliers. If so, it is marked as the second featureless image. Finally, the first feature image and the second featureless image are deleted.

[0063] ③. Finally, the template splicing strategy is implemented. Specifically, the train number of the characteristic position of the train in the image set to be corrected (such as the position of the first car of the thunder car) is detected, the train number is extracted using the OCR algorithm, and the template image library corresponding to the train number is selected from the template library. The template image library does not contain featureless images and all-black images after image preprocessing;

[0064] Then select the image to be corrected from the images to be corrected according to the set image number and the set image selection order, such as Figure 2 and Figure 3 As shown, specifically, the order of selecting images is to sort them in ascending order according to the set image numbers, and select them one by one starting from the smallest number;

[0065] The preset initialization definition selects the number of template images in sequence. For example, if n is initialized to 3, when the image to be corrected is labeled p, the selected template images are labeled 0, 1, 2, that is, the selection strategy for template image initialization is p+1, p+2, ..., p+n, and then the selected template images are stitched together in the x-axis direction in the order of the template image labels into one image (the first template image). The size of a template image is 4096*4000, so the size of the first template image after stitching is 4096*12000.

[0066] In the feature point set generation step, the image to be corrected and the first template image are input into the convolutional neural network to process and output the first feature point set corresponding to the image to be corrected and the second feature point set corresponding to the first template image, wherein the first feature point set is named KD and the second feature point set is named KT, such as Figure 4 As shown, the upper part is the image to be corrected caused by the vehicle speed change, and the lower part is the first template image;

[0067] Among them, the convolutional neural network is a dense matching deep convolutional network integrated with the graph neural network, including a feature extraction module, a graph neural network module, a geometric consistency verification module, and a matching result generation module;

[0068] The feature extraction module is responsible for extracting key points and descriptors from the image. It is a ResNet network model that integrates Transformer after training with the Image dataset, that is, the architecture of the Transformer module is introduced into the traditional ResNet (Residual Network). In order to combine the convolutional feature extraction capability of ResNet and the global context modeling capability of Transformer, the Transformer module is embedded in the traditional residual block. First, the local features are extracted using the traditional convolutional layer, and then the convolution output is processed by the Transformer module. The Transformer layer performs global context modeling on the convolutional feature map through the self-attention mechanism, and the output of the convolutional layer is added to the output of the Transformer layer to form a residual connection. Therefore, the key point detection on the input image and the generation of a descriptor for each detected key point can be realized. The descriptor is a high-dimensional vector, which is usually further generated using CNN (Convolutional Neural Network). The purpose of the descriptor is to provide local image information for each key point, so that different key points can be accurately distinguished when matching between different images.

[0069] Graph neural network module: After extracting the key points and descriptors of the image, the next step is to match the image pieces. The graph neural network can optimize the local matching results by learning global information, avoiding matching based solely on the similarity between descriptors.

[0070] The first step is to build a graph. For each pair of images, the feature extraction module represents their feature points as nodes in the graph. Each node contains a descriptor of a key point. The edges between nodes represent the potential matching relationship between different key points. The weight of each edge is calculated based on the similarity and set relationship of the descriptors, such as local transformation or perspective change.

[0071] Next, message passing and node updating are performed. In graph neural networks, information is propagated between nodes through a message passing mechanism. The features of each node (i.e., the descriptors of key points) exchange information with neighboring nodes. The goal of graph neural networks is to update the state of each node (i.e., descriptors) through multiple rounds of information passing, so that the final node state can reflect the position of the node in the global graph structure and the possibility of matching. The update process of graph neural networks is usually as follows:

[0072] Message passing: Each node transmits its own feature information to its connected neighbor nodes;

[0073] Node update: Each node updates its own features based on the neighbor information it receives. This process can be done through a simple weighted sum or a more complex function (such as a fully connected layer);

[0074] Iterative update: Through multiple rounds of iterations, nodes will gradually obtain more global context information, thereby optimizing the matching status of each node;

[0075] This information transmission-based mechanism enables the network to not only consider the local descriptor similarity, but also improve the matching accuracy and robustness through global information propagation;

[0076] Finally, edge selection and matching are performed. During the information propagation process, the graph neural network will gradually optimize the edge weights. These weights represent the possibility of matching between two nodes (feature points). After multiple rounds of message transmission and node updates, the network will generate the final matching result, which is the best matching point of each node in the other graph.

[0077] Geometric consistency verification module. During the matching process, feature points must not only be similar in descriptors, but also meet geometric constraints, that is, two matching points should be aligned under the same geometric space transformation. Further improvement of matching accuracy comes from the geometric consistency module. The geometric consistency module optimizes the matching results by calculating the geometric constraints between matching point pairs. The specific method is as follows:

[0078] Geometric constraints: Use geometric constraints such as the fundamental matrix or homography matrix to verify the accuracy of matching point pairs. By calculating the transformation relationship between images, the geometric consistency module can ensure that the matching points still conform to geometric laws when the viewing angle changes;

[0079] Geometric consistency loss: This loss function helps the network learn which matches conform to geometric constraints and which are wrong. By minimizing the geometric consistency loss, the convolutional neural network can optimize the matching results from a global perspective.

[0080] Matching result generation module. After the graph neural network and geometric consistency optimization, the convolution neural network outputs the matching point set in each pair of images. and The final matching pair is obtained based on the node status and geometric consistency evaluation. The matching accuracy is optimized through two major mechanisms: graph neural network and geometric consistency. It not only considers the descriptor similarity, but also effectively avoids incorrect matching caused by factors such as perspective changes and occlusion.

[0081] List point cluster generation steps, ①, due to and It is a set of feature point pairs generated by the convolutional neural network, so their number is equal and the shape is w*2, where w is the number of feature point pairs, and 2 means that the feature point consists of two parameters, the horizontal coordinate x and the vertical coordinate y, respectively extracted and The horizontal axis and Generate the first list M, where the horizontal coordinate of M is , the vertical axis is , the shape is also w*2.

[0082] ② Then carry out the list verification strategy, specifically:

[0083] Filter outliers in the first list M using and The difference of the ordinate of is used to filter outliers. Since both the image to be corrected and the template image are collected by a linear array camera, for a pair of correctly matched feature points, even if there is a value change caused by image stretching or compression in the x-axis direction, the value difference in the y-axis is within a certain range. =| [1, :]- [1, :]|, that is Subtract all first dimension data from The absolute values ​​of all first-dimensional data are further recorded The index of the pixel value greater than the set threshold value N1 (50 pixel value) is deleted, and the data of the corresponding index in the first list M is deleted to filter outliers;

[0084] Calculate the average value S of the difference between the 0th dimension and the 1st dimension of all elements in the first list M, where the average value S reflects the lateral position of the image to be corrected in the first template image;

[0085] Determine whether the average value S is within the threshold range N2. Since the size of the template image is 4096*4000, in order to ensure that the image to be corrected is in the middle position of the template image on the horizontal axis, the threshold range N2 is set to be greater than 2000 and less than 10000. If the average value S is not within the threshold range N2, the initialization n is dynamically adjusted according to the value of the average value S to adjust the number of selected template images, and the first template image is generated by splicing. When the average value S is less than the threshold range N2, the template image selection strategy is p, p+1, ..., p+n-1, where p is the label of the image to be corrected. When the average value S is greater than the threshold range N2, the template image selection strategy is p+2, p+3, ..., p+n+1, and then the feature point set generation step is repeated. If the average value S is within the threshold range N2, the elements in M ​​are adaptively clustered to obtain K1, K2, ..., Kn point clusters.

[0086] ③. The adaptive clustering in the list point cluster generation step is improved. The adaptive clustering improvement strategy is as follows:

[0087] Adaptive clustering uses an improved adaptive NJW spectral clustering algorithm. Since the similarity matrix of the classic NJW spectral clustering algorithm is established through the Gaussian kernel function, in practical applications, the scale parameter of the Gaussian kernel function is The setting of will have a direct impact on the clustering effect. If the value of is too small, the weight value in the similarity matrix will be very large, resulting in the clustering results being too dispersed and unable to obtain effective clustering; If the value of is too large, the weight values ​​in the similarity matrix will tend to be equal, resulting in the clustering results being too concentrated and losing the meaning of clustering. Therefore, it is necessary to choose The value of is an important factor affecting the clustering effect; the classic NJW spectral clustering algorithm requires artificially specifying the scale parameter of the Gaussian kernel function. In addition, the number of clusters k needs to be determined;

[0088] In order to realize adaptive clustering of elements in M, the improved adaptive NJW spectral clustering algorithm is based on matrix perturbation theory and combined with improved Gaussian kernel function. Compared with the classic NJW spectral clustering algorithm, the improved algorithm can effectively avoid the parameter The sensitivity problem of clustering can be solved without manually setting the value of clustering number k. The number of clustering k can be adaptively determined according to the characteristics of the data set. The specific steps are as follows:

[0089] Step S1, traverse all data points and construct a weighted undirected graph ( ), and the similarity matrix is ​​obtained by calculating the similarity between data points through formula 1 and formula 2 Sum degree matrix ;

[0090] Formula 1 is configured as:

[0091] ,

[0092] in, is the similarity between data point i and data point j, is the Euclidean distance from data point i to the kth neighbor point, is the Euclidean distance from data point j to the kth neighbor point;

[0093] Formula 2 is configured as:

[0094] ,

[0095] in, For data points The Euclidean distance to the kth nearest neighbor, where k is 7.

[0096] Step S2: The similarity matrix Sum degree matrix The Laplace matrix is ​​calculated by formula 3 , and then calculate the standardized Laplace matrix using formula 4 ;

[0097] Formula 3 is configured as:

[0098] ,

[0099] Formula 4 is configured as:

[0100] ,

[0101] in, is the Laplace matrix, is the degree matrix, is the similarity matrix, is the normalized Laplacian matrix.

[0102] Step S3, the standardized Laplacian matrix Perturb and get the perturbation matrix , and the perturbation matrix Perform eigenvalue decomposition to obtain the first eigenvalue and the first eigenvector , and then calculate the first eigenvalues ​​of two adjacent The difference between them is used to obtain the eigengap sequence, and the first maximum value is found in the eigengap sequence in turn, and the corresponding subscript is determined as the number of clusters k;

[0103] Specifically, firstly, a perturbation matrix is ​​obtained by slightly perturbing the normalized Laplace matrix in step S2. The perturbation matrix is ​​configured as follows:

[0104] ,

[0105] in, is a small perturbation matrix, usually in the range of , is a small positive number, and then the perturbation matrix Perform eigenvalue decomposition to obtain the perturbation matrix The first eigenvalue of and the first eigenvector , further calculate the difference between two adjacent first eigenvalues ​​to obtain the eigengap sequence , where the intrinsic gap The configuration is:

[0106] ,

[0107] Finally, according to the changing trend of the intrinsic gap sequence and based on the perturbation theory of the matrix, the first maximum value is found in the intrinsic gap sequence in turn. The subscript corresponding to the value is the number of clusters k, and the number of clusters k is configured as:

[0108] ,

[0109] in In order to find the maximum value of the subscript function, in practical applications, a threshold is usually set , only when the difference between two adjacent intrinsic gaps exceeds It is considered a peak only when , otherwise it is considered a flat interval. When calculating the intrinsic gap, it is usually necessary to perform multiple perturbations and eigenvalue decomposition operations, and then take the average value to reduce the random error. In addition, for the non-normalized Laplace matrix, its eigenvector needs to be normalized when calculating the intrinsic gap.

[0110] Step S4, the standardized Laplace matrix Perform eigenvalue decomposition to obtain the second eigenvalue and the second eigenvector , and build The characteristic matrix , the feature matrix The normalized feature matrix is ​​obtained by converting the row vector into a unit vector using formula 5 , Formula 5 is configured as:

[0111] ,

[0112] in, is the normalized feature matrix, To solve the eigenvectors corresponding to the first k non-zero largest eigenvalues ​​of the normalized Laplacian matrix using line algebra .

[0113] Step S5: normalize the feature matrix Each row is regarded as a point in space, and K-means algorithm or other clustering algorithms are used to cluster it to obtain k clusters. If the normalized feature matrix If the i-th row of data belongs to the j-th cluster after clustering, then the i-th row of the original data set also belongs to this cluster.

[0114] The calibration curve stitching steps are as follows: Figure 5 As shown, ①, each point in the point cluster is fitted by a quartic spline curve to form a first correction curve Ln, and the quartic spline curve is configured as:

[0115] ,

[0116] in, , , , , All are coefficients to be determined;

[0117] ② The calibration curve splicing step includes a curve verification strategy, which includes determining whether the slope of the first calibration curve Ln is within the threshold range. If any slope of the first correction curve is outside the threshold range, it is considered that the first correction curve Ln is unreasonable. Then, the first auxiliary feature point set and the second auxiliary feature point set are extracted from the image to be corrected and the first template image respectively by the corner detection algorithm, and the first auxiliary feature point set, the second auxiliary feature point set, the first feature point set and the second feature point set are fused, and then the feature points are matched by the RANSAC algorithm to generate feature points. and , and repeat the step of generating the list point cluster. Otherwise, when the first correction curve Ln is reasonable, L1, L2, ..., Ln are spliced ​​into the piecewise correction curve L through the piecewise function of the Numpy library.

[0118] The correction image mapping step performs image mapping on the image to be corrected according to the segmented correction curve.

[0119] The above are only preferred embodiments of the present invention. The protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.

Claims

1. A geometric correction method for images collected by a rail transit linear array camera, characterized in that: The steps include: A comparison image generation step, screening the image to be corrected captured by the line scan camera, and stitching a plurality of template images corresponding to the image to be corrected in a preset template image library to generate a first template image; A feature point set generating step, inputting the image to be corrected and the first template image into a convolutional neural network to process and output a first feature point set corresponding to the image to be corrected and a second feature point set corresponding to the first template image; A list point cluster generation step, combining the horizontal coordinates in the first feature point set with the horizontal coordinates in the second feature point set to generate a first list, and adaptively clustering the elements in the first list to obtain point clusters; a calibration curve splicing step, fitting each point in the point cluster to form a first calibration curve, and splicing the first calibration curve to obtain a segmented calibration curve; The correction image mapping step performs image mapping on the image to be corrected according to the segmented correction curve.

2. The geometric correction method for images collected by a rail transit linear array camera according to claim 1, characterized in that: The list point cluster generation step includes a list verification strategy, which includes calculating the vertical coordinate difference between the first feature point set and the second feature point set in the first list, filtering outliers greater than a preset pixel threshold N1, and then calculating the average value of the difference between the 0th dimension and the 1st dimension of all elements in the filtered first list, and judging whether the average value is within the threshold range N2. If so, adaptive clustering is performed; if not, the number of template images is adjusted according to the average value to re-join the first template image, and the feature point set generation step is performed again.

3. The geometric correction method for images collected by a rail transit linear array camera according to claim 2, characterized in that: The step of generating list point clusters also includes an adaptive clustering improvement strategy, which includes Step S1, traverse all data points, construct a weighted undirected graph, and calculate the similarity between data points by formula 1 and formula 2 to obtain a similarity matrix and a degree matrix; Step S2, calculating the similarity matrix and the degree matrix by formula 3 to obtain a Laplace matrix, and then calculating the standardized Laplace matrix by formula 4; Step S3, perturbing the standardized Laplace matrix to obtain a perturbation matrix, and performing eigenvalue decomposition on the perturbation matrix to obtain a first eigenvalue and a first eigenvector, and then calculating the difference between two adjacent first eigenvalues ​​to obtain an eigengap sequence, searching for the first maximum value in the eigengap sequence in turn, and determining the corresponding subscript as the number of clusters k; Step S4, performing eigenvalue decomposition on the standardized Laplace matrix to obtain a second eigenvalue and a second eigenvector, and constructing a characteristic matrix, converting the row vectors of the characteristic matrix into unit vectors using Formula 5 to obtain a normalized characteristic matrix; Step S5, clustering the normalized feature matrix using a clustering algorithm to obtain k clusters; The formula 1 is configured as: , in, is the similarity between data point i and data point j, is the Euclidean distance from data point i to the kth neighbor point, is the Euclidean distance from data point j to the kth neighbor point; The formula 2 is configured as: , in, For data points The Euclidean distance to the kth nearest neighbor; The formula 3 is configured as: , The formula 4 is configured as: , in, is the Laplace matrix, is the degree matrix, is the similarity matrix, is the normalized Laplacian matrix; The formula 5 is configured as: , in, is the normalized feature matrix, Use line algebra to find the eigenvectors corresponding to the first k non-zero largest eigenvalues ​​of the normalized Laplacian matrix.

4. The geometric correction method for images collected by a rail transit linear array camera according to claim 3, characterized in that: The perturbation matrix is ​​configured as: , The intrinsic gap configuration in the intrinsic gap sequence is: , The cluster number k is configured as: , in, is the perturbation matrix, is a small perturbation matrix with a value range of , is a small positive number, is the intrinsic gap, is the first eigenvalue, is the number of clusters, A function to find the maximum value.

5. A geometric correction method for images collected by a rail transit linear array camera according to claim 1 or 3, characterized in that: The correction curve splicing step includes a curve verification strategy, which includes determining whether the slope of the first correction curve is within a threshold range. If any slope of the first correction curve is outside the threshold range, a first auxiliary feature point set and a second auxiliary feature point set are extracted from the image to be corrected and the first template image respectively, and the first auxiliary feature point set, the second auxiliary feature point set, the first feature point set and the second feature point set are fused, and the list point cluster generation step is performed again. Otherwise, splicing is performed to obtain a segmented correction curve.

6. The geometric correction method for images collected by a rail transit linear array camera according to claim 5, characterized in that: The comparison image generation step includes a template stitching strategy, which includes a preset initialization definition to select a number of template images in sequence, and stitching the number of template images and the image to be corrected in sequence in the horizontal axis direction to generate a first template image.

7. The geometric correction method for images collected by a rail transit linear array camera according to claim 6, characterized in that: The comparison image generation step also includes a preprocessing strategy for the image to be corrected, and the preprocessing strategy for the image to be corrected includes a black image deletion step and a featureless image deletion step. The step of deleting the all-black image is to mark the image with all pixel values ​​of zero in the image to be corrected as a all-black image and delete it; The featureless image deletion step marks the image with the same pixel value corresponding to the pixel points with the same horizontal coordinate in the image to be corrected as the first featureless image, then converts the image to be corrected into a grayscale image, and adds the pixel values ​​of each column in the vertical coordinate direction in the grayscale image, and then calculates the discrete data of each column of pixels, and marks the image with outliers as the second featureless image based on the discrete data, and deletes the first featureless image and the second featureless image.

8. The geometric correction method for images collected by a rail transit linear array camera according to claim 1, characterized in that: The fitting of the first correction curve includes a quartic spline curve, and the quartic spline curve is configured as follows: , in, , , , , These are all coefficients to be determined.

9. The geometric correction method for images collected by a rail transit linear array camera according to claim 1, characterized in that: The convolutional neural network includes a feature extraction module, a graph neural network module, a geometric consistency verification module and a matching result generation module.

Citation Information

Patent Citations

  • A hierarchical clustering-based multi-plane image splicing method

    CN109741240A

  • Noise suppression method based on spatial transformation and adaptive clustering

    CN115205567A