An image correction method, system and storage medium for linear array cameras of urban rail vehicles
By combining YOLOV5 and surf feature point detection algorithms, a correction matrix is generated using the fine positioning of widgets and segmented nonlinear fitting methods, which solves the tensile compression problem of the line array camera image of the urban rail train under the conditions of rapid speed change, and achieves high-precision image correction.
Patent Information
- Application Number
- CN202111006467.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-30
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2041-08-30
AI Technical Summary
The camera image of the urban rail train line array has tensile compression under the conditions of rapid speed change. The existing correction methods are low in accuracy and cannot adapt to the interference of light and dirty factors.
The YOLOV5 and surf feature point detection algorithm are used to combine the fine positioning of widgets, matching data screening and segmented nonlinear fitting algorithm to generate a correction matrix for image correction.
It greatly improves the accuracy and adaptability of image correction, overcomes the interference of factors such as rapid speed change, lighting and dirty, and improves the effect of image correction under rapid speed change conditions.
Smart Images

Figure CN113780309B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of linear array camera image processing, and in particular, to a method, a system and a storage medium for correcting linear array camera images of urban rail vehicles. Background Art
[0002] The intelligent inspection of urban rail transit has developed rapidly. The method of integrating high-definition color imaging technology of trains and the state determination algorithm of train components based on vision has gradually become the mainstream. Taking the image acquisition of a 6-car train as an example, the actual physical length of the train is usually dozens of times the width and height. Therefore, a linear array camera suitable for shooting moving objects is more suitable for collecting the appearance images of the train body. In theory, if the acquisition frequency of the linear array camera is highly consistent with the instantaneous traveling speed of the train, a train appearance image with a true proportion can be obtained. However, in practice, it is difficult to achieve absolute uniform speed of the train, and there is a lag in dynamically adjusting the camera acquisition frequency by the train speed measurement method. It is difficult to keep the two absolutely unified, so there must be a certain degree of stretching and compression of the image in the horizontal direction.
[0003] In the prior art, the solutions to the above problems are generally divided into two directions. The first direction is to use radar speed measurement technology to obtain high-frequency speed information. However, the current radar speed measurement frequency is still lower than the acquisition frequency of the linear array camera, making it difficult to achieve real-time dynamic matching. Moreover, in the case of low-speed movement such as when the train is approaching a stop, the speed measurement accuracy of the radar will be greatly reduced. The second direction is to perform correction processing on the acquired images.
[0004] For correcting the acquired images, a commonly used method is to set marks on the train and perform piecewise linear correction on the images according to the marks. This method that overly relies on external marks is complex to operate in practice, and the number of marks directly affects the correction accuracy. Another method is to select a historical train image that is as close as possible to the true proportion of the train as a template, and perform fitting correction on the newly acquired images through feature extraction until the difference between the images and the template is minimized. However, the feature extraction methods of these types are traditional gradient-based or feature point-based. It is difficult to ensure the matching accuracy after changes in illumination or component replacement. Moreover, these methods usually set a feature point distance threshold to determine whether it is a wrong match, assuming that only minor stretching or compression phenomena occur in the train images, which is not applicable to the correction of linear array camera images of urban rail trains that are prone to sudden speed changes. Summary of the Invention
[0005] In view of the low accuracy of the calibration method for the linear array camera images of urban rail trains and the inability to adapt to the distortion problem under rapid speed changes in the prior art, a method, a system and a storage medium for calibrating the linear array camera images of urban rail vehicles are provided. In the process of target detection and feature point extraction, the YOLOV5 and SURF feature point detection algorithms are respectively adopted in the present invention. The results of target detection are integrated into the operation of feature point matching, and algorithms such as fine positioning of widgets, screening of matching data and piecewise non-linear fitting are added, greatly improving the calibration accuracy and enhancing the adaptability of image calibration under rapid speed change conditions.
[0006] The technical means adopted by the present invention are as follows:
[0007] The present invention provides a method for calibrating the linear array camera images of urban rail vehicles, including:
[0008] Obtain template image data and image data to be detected;
[0009] Based on the first feature extraction model, extract fixed components from the template image data and the image data to be detected, so as to obtain detection frames of the same fixed components in the template image data and the image data to be detected;
[0010] Based on each detection frame of the template image data, obtain the first standard feature point data set of the template image. Based on each detection frame of the image data to be detected, obtain the second standard feature point data set of the image to be detected. Generate a standard matching data set based on the first standard feature point data set and the second standard feature point data set;
[0011] Based on the second feature extraction model, extract fixed components from the template image data and the image data to be detected, and use the RANSAC method to obtain a candidate matching data set, where the candidate matching data set includes pairs of template image feature points and image feature points to be detected that correspond one by one;
[0012] Based on the standard matching data set and the candidate matching data set, screen the data in the candidate matching data set to obtain a precise matching data set;
[0013] Based on the standard matching data set, segment the image data to be detected, and respectively use a third-order function to fit the discrete precise matching data for each segment of the image data to be detected. Construct a calibration matrix based on the fitting results of each segment;
[0014] Multiply the image data to be detected by the calibration matrix to obtain the calibrated image data.
[0015] Further, the first standard feature point data includes two vertex data of each detection frame of the template image data, and the data in the first standard feature point data set are arranged in ascending order of the x coordinate;
[0016] The second standard feature point dataset includes the data of two vertices of each detection box for the image data to be detected, and the data in the second standard feature point dataset are arranged in ascending order of the x coordinate.
[0017] Further, based on the standard matching dataset and the candidate matching dataset, the data in the candidate matching dataset are screened to obtain an accurate matching dataset, including:
[0018] After arranging the point pairs in the candidate matching dataset in ascending order based on the horizontal axis coordinates of the template image feature points, a primary screening is performed based on the change situation of the order of the image feature points to be detected;
[0019] The candidate matching data after the primary screening is fused with the standard matching data, and the template image feature points in the fused matching data are arranged in ascending order according to the horizontal axis coordinates, and a secondary screening is performed based on the change situation of the order of the image feature points to be detected, so as to obtain an accurate matching dataset.
[0020] Further, the first feature extraction model is the YOLO_V5 model.
[0021] Further, the second feature extraction model is a feature point detection model based on the SURF algorithm.
[0022] The present invention also provides an image correction system for urban rail vehicles line array cameras, including:
[0023] An image acquisition module, configured to acquire template image data and image data to be detected;
[0024] A first extraction module, configured to perform fixed component extraction on the template image data and the image data to be detected based on the first feature extraction model, so as to obtain detection boxes of the same fixed components in the template image data and the image data to be detected;
[0025] A standard matching dataset acquisition module, configured to obtain a first standard feature point dataset of the template image based on each detection box for the template image data, obtain a second standard feature point dataset of the image to be detected based on each detection box for the image data to be detected, and generate a standard matching dataset based on the first standard feature point dataset and the second standard feature point dataset;
[0026] A second extraction module, configured to perform fixed component extraction on the template image data and the image data to be detected based on the second feature extraction model, and obtain a candidate matching dataset by using the RANSAC method, where the candidate matching dataset includes pairs of corresponding template image feature points and image feature points to be detected;
[0027] A precise matching dataset acquisition module, configured to screen the data in the candidate matching dataset based on the standard matching dataset and the candidate matching dataset, so as to obtain a precise matching dataset;
[0028] A calibration matrix construction module, configured to segment the to-be-detected image data based on the standard matching dataset, respectively fit the discrete precise matching data of each segment of the to-be-detected image data with a third-order function, and construct a calibration matrix based on the fitting results of each segment;
[0029] An output module, configured to multiply the to-be-detected image data by the calibration matrix to obtain calibrated image data.
[0030] The present invention also provides a storage medium, which includes a stored program. When the program runs, it executes the method described in any one of the above.
[0031] Compared with the prior art, the present invention has the following advantages:
[0032] The present invention overcomes the problem of high stretching and compression caused by the rapid speed change of the linear array camera image of urban rail trains. In the process of target detection and feature point extraction, the YOLOV5 and surf feature point detection algorithms are respectively used. The result of target detection is integrated into the operation of feature point matching. The fine positioning of widgets, the screening of matching data and the piecewise non-linear fitting algorithm are added, which greatly improves the calibration accuracy and enhances the adaptability of image correction under rapid speed change conditions. At the same time, the present invention can overcome the interference of factors such as light and dirt. Description of the Drawings
[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0034] Figure 1 It is a flowchart of an image correction method for a linear array camera of an urban rail vehicle according to the present invention.
[0035] Figure 2 It is a schematic diagram of a template image in the embodiment.
[0036] Figure 3 It is a schematic diagram of a to-be-detected image in the embodiment.
[0037] Figure 4 It is a schematic diagram of the positioning effect of the template image in the embodiment.
[0038] Figure 5 It is a schematic diagram of the positioning effect of the to-be-detected image in the embodiment.
[0039] Figure 6 It is a schematic diagram of the corrected image in the embodiment. Detailed implementation manners
[0040] In order to enable those skilled in the art to better understand the solution of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0041] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above drawings are used to distinguish similar objects, and do not necessarily need to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0042] The present invention provides a method for correcting the image of a linear array camera of an urban rail vehicle. During the target detection and feature point extraction processes, the YOLOV5 and SURF feature point detection algorithms are respectively used, and the results of target detection are incorporated into the operation of feature point matching. Algorithms for fine positioning of widgets, screening of matching data, and piecewise non-linear fitting are added. The specific steps include:
[0043] S1. Obtain template image data and image data to be detected.
[0044] S2. Based on the first feature extraction model, perform extraction of fixed components on the template image data and the image data to be detected, so as to obtain detection frames of the same fixed components in the template image data and the image data to be detected. Further, the first feature extraction model is a YOLO_V5 model.
[0045] Specifically, as a preferred embodiment of the present invention, this embodiment uses the YOLO_V5 object detection algorithm in the field of deep learning to achieve widget positioning. When marking samples, try to select fixed components with obvious boundary features and suitable for horizontal image correction, such as bogie crossbeams, axles, axle box end covers, etc. with relatively constant positions. After generating the trained network file, divide the images into two categories according to the component concentration, perform object detection with different image size parameters, and obtain the positions of small components in the template image and the image to be inspected according to this method.
[0046] S3. Obtain the first standard feature point dataset of the template image based on each detection box for the template image data, obtain the second standard feature point dataset of the image to be detected based on each detection box for the image to be detected data, and generate a standard matching dataset based on the first standard feature point dataset and the second standard feature point dataset.
[0047] Specifically, since there is only horizontal stretching or compression in the linear array camera images of urban rail vehicles, the horizontal axis information is mainly used when screening the small component detection results. Two standard feature points can be generated for the object detection box of each small component. Arrange all the standard feature points in ascending order of the x coordinate. The feature points of the template image and the image to be inspected can be matched one by one in this order and included in the standard matching dataset.
[0048] S4. Extract fixed components from the template image data and the image to be detected data based on the second feature extraction model, and obtain a candidate matching dataset using the RANSAC method. The candidate matching dataset includes pairs of corresponding template image feature points and image to be detected feature points. Further, the second feature extraction model is a feature point detection model based on the SURF algorithm.
[0049] S5. Screen the data in the candidate matching dataset based on the standard matching dataset and the candidate matching dataset to obtain an accurate matching dataset.
[0050] The purpose of this step is mainly to delete incorrect matching data. The method for deleting incorrect matching data proposed by the present invention is different from the conventional screening method based on distance and empirical thresholds. The conventional method excludes possible mis-matching results by setting a threshold representing the stretching degree. This method is effective for images with a certain range of deformation, but cannot produce a good correction effect on the deformation caused by parking or rapid speed change, and has poor adaptability. The method adopted by the present invention is to use the standard matching dataset as a standard reference to screen the candidate matching dataset in turn until all incorrect matching data are deleted.
[0051] S6. Segment the image data to be detected based on the standard matching data set, respectively fit the discrete accurate matching data for each segment of the image data to be detected by using a third-order function, construct a correction matrix based on the fitting results of each segment, and multiply the image data to be detected by the correction matrix to obtain the corrected image data.
[0052] Specifically, after obtaining the accurate matching data, it is necessary to map the image to be detected according to the template image style, and the present invention proposes a segmented non-linear fitting method. The segmentation principle of non-linear fitting is determined by the standard matching data set. The horizontal axis coordinates of the standard feature points in the image to be detected are used as the cutting positions for vertical segmentation of the image. There may be multiple speed changes in the segmented image, and it is difficult to ensure the accuracy by using a linear function fitting. Therefore, a third-order function is used to fit the discrete matching data. Considering the image head and tail as the boundaries, a segmented non-linear fitting function is composed of several third-order fitting functions:
[0053] y = F(x)
[0054] The independent variable x i ranges from 0 to w A is input in sequence, and the corresponding dependent variable value y i can be obtained. According to the values of x i and y i , a correction matrix T can be obtained. The correction matrix T is a 0-1 matrix with w B rows and w A columns. Among them, the elements with the row number being y i and the column number being x i are set to 1, and the rest of the elements are set to 0. Multiply the image B to be detected by the correction matrix T to obtain the corrected matrix C, and thus the correction is completed.
[0055] The following further illustrates the solution of the present invention through specific application examples.
[0056] This embodiment provides a method for correcting the image of a linear array camera of an urban rail vehicle, which is improved on the basis of integrating the existing object detection algorithm and feature point extraction algorithm. The YOLOV5 and surf feature point detection algorithms are respectively used in the object detection and feature point extraction processes. This method integrates the results of object detection into the operation of feature point matching, and adds a widget fine positioning, matching data screening and segmented non-linear fitting algorithm, aiming to greatly improve the correction accuracy and enhance the adaptability of image correction under rapid speed change conditions. This method is based on a template image without any stretching and compression phenomenon, obtains the position information of key components through the object detection algorithm, generates a correction matrix through feature point detection and matching, and realizes the correction of each segmented train image one by one. Specifically, it includes:
[0057] Step 1: Refined positioning of the widgets in the template image and the image to be inspected. The original template image is as shown in Figure 2 , and the original image to be inspected is as shown in Figure 3 .
[0058] The present invention uses an object detection algorithm in the field of deep learning to achieve widget positioning. In the object detection process, the YOLO_V5 object detection algorithm is adopted by the present invention to generate a training network file. When labeling samples, fixed components with obvious boundary features and suitable for horizontal image correction are preferably selected, such as bogie crossbeams, axles, axle box end covers, etc. with relatively constant positions. Since the ratio of the length to the width of the images collected by the linear array cameras of urban rail vehicles can reach dozens of times, the recognition accuracy will decrease under conventional image size parameters. Although inputting small-sized image segments such as images into the model can ensure the overall recognition accuracy, the overall operation time of the entire vehicle image will be greatly extended. The underbody of an urban rail vehicle mainly consists of bogie components and box components. There are various dense small components in the bogie, with a high component concentration; while the boxes are scattered, with a relatively low component concentration. In this embodiment, it will be divided into two categories: bogies and boxes, where the concentration of bogies is high and the concentration of boxes is low. Therefore, the present invention divides the images into two categories according to the component concentration. For the bogie area with a high component concentration, the width-to-height ratio of the model detection is greater than 2 (1280*512 can be used), and for the box or blank area image with a low component concentration, the width-to-height ratio of the model detection is set to an equal ratio (416*416 can be used). The positions of the small components in the template image and the image to be inspected are obtained according to this method. The specific positioning effects are respectively as shown in Figure 4 , Figure 5 .
[0059] Step 2: Use the detection results of the small components generated in Step 1 as the standard feature point set.
[0060] Since there is only horizontal stretching or compression in the linear array camera images of urban rail vehicles, the horizontal axis information is mainly used when screening the detection results of small components. Two standard feature points can be generated for the object detection frame of each small component. If the horizontal axis coordinate of the upper left corner point of a certain object detection frame is x, the vertical axis coordinate is y, the width of the detection frame is w, and the height is h, then the coordinates of the corresponding two standard feature points are: (x, y), (x + w, y). All the standard feature points are arranged in ascending order of the x coordinate, and the feature points of the template image and the image to be inspected can be matched one by one in this order. Taking Figure 4 and Figure 5 as examples, 22 groups of matching data are generated and incorporated into the standard matching data set.
[0061] Step 3: Perform SURF feature point detection on the template image and the image to be inspected, and use the RANSAC method to obtain a candidate matching data set.
[0062] Step 4: Delete the mis-matched data
[0063] The method for deleting mis-matched data proposed by the present invention is different from the conventional screening method based on distance and empirical threshold. The conventional method excludes possible mis-matched results by setting a threshold representing the stretching degree. This method is effective for images with deformation within a certain range, but it cannot produce a good correction effect on the deformation caused by parking or sudden speed change, and its adaptability is poor. The method adopted by the present invention is to use the standard matching data set as a standard reference, and sequentially screen the candidate matching data sets until all mis-matched data are deleted. The specific operations are as follows:
[0064] Primary screening: The candidate matching data set contains one-to-one template image feature points and the feature points of the image to be inspected. The template image feature points are sorted in ascending order according to the horizontal axis coordinates. In the case of correct matching, the order of the corresponding feature points of the image to be inspected remains unchanged. If the order of a certain feature point of the image to be inspected changes, it indicates a mis-match, and the corresponding set of matching data is deleted;
[0065] Secondary screening: The candidate matching data after primary screening is fused with the standard matching data. The template image feature points in the fused matching data are sorted in ascending order according to the horizontal axis coordinates. If the order of the corresponding feature points of the image to be inspected changes, it indicates that there is still a mis-match in the matching, and this set of mis-matched data is deleted.
[0066] Step 5: Piecewise non-linear fitting
[0067] After obtaining accurate matching data, it is necessary to map the image to be inspected according to the template image style. The commonly used method is to perform piecewise linear fitting on the image according to the matching data. Using the screened matching data set can already achieve a high accuracy. However, in practice, the degree of stretching and compression of the image does not show a simple linear distribution, but a continuous non-linear distribution. Therefore, the present invention proposes a piecewise non-linear fitting method.
[0068] In this embodiment, the image width w of template image A A = 2147, and the height h A = 512. The matrix of the image to be inspected is denoted as B, the image width is w B = 2245, and the height h B = 512. Since the urban rail vehicle image only needs to be corrected in the horizontal direction, the image heights before and after are the same at this time.
[0069] The piecewise principle of non - linear fitting is determined by the standard matching data set. The horizontal axis coordinates of the standard feature points in the image to be inspected are used as the cutting positions for vertical segmentation of the image. There may be multiple speed changes in the segmented image, and it is difficult to ensure the accuracy using linear function fitting. Therefore, a third - order function is used to fit the discrete matching data. In this example, images A and B together contain 22 pairs of standard matching data. Considering the image start and end as boundaries, a total of 23 independent third - order fitting functions jointly form a piecewise non - linear fitting function:
[0070] y = F(x)
[0071] The independent variable x i ranges from 0 to w A Input sequentially, and the corresponding dependent variable value y can be obtained i , according to x i and y i values, a correction matrix T can be obtained. The correction matrix T is a 0 - 1 matrix with w B rows and w A columns. Among them, the number of rows is y i , and the number of columns is x i The elements are set to 1, and the rest of the elements are set to 0.
[0072] Multiply the image to be inspected B by the correction matrix T to obtain the corrected matrix C, such as Figure 6 , thus completing the correction.
[0073] The present invention also provides an image correction system for urban rail vehicle linear array cameras, used to perform the above - mentioned image correction of urban rail vehicle linear array cameras, including:
[0074] An image acquisition module, used to acquire template image data and image data to be detected;
[0075] A first extraction module, used to extract fixed components from the template image data and the image data to be detected based on a first feature extraction model, so as to obtain detection frames of the same fixed components in the template image data and the image data to be detected;
[0076] A standard matching data set acquisition module, used to obtain a first standard feature point data set of the template image based on each detection frame of the template image data, obtain a second standard feature point data set of the image to be detected based on each detection frame of the image data to be detected, and generate a standard matching data set based on the first standard feature point data set and the second standard feature point data set;
[0077] A second extraction module, used to extract fixed components from the template image data and the image data to be detected based on a second feature extraction model, and obtain a candidate matching data set using the RANSAC method. The candidate matching data set includes pairs of template image feature points and image feature points to be detected that correspond one by one;
[0078] A precise matching dataset acquisition module for screening data in the candidate matching dataset based on the standard matching dataset and the candidate matching dataset, so as to obtain a precise matching dataset;
[0079] A calibration matrix construction module for segmenting the image data to be detected based on the standard matching dataset, respectively fitting the discrete precise matching data of each segment of the image data to be detected with a third-order function, and constructing a calibration matrix based on the fitting results of each segment;
[0080] An output module for multiplying the image data to be detected by the calibration matrix to obtain calibrated image data.
[0081] For the embodiments of the present invention, since it corresponds to the above embodiments, the description is relatively simple. For relevant similarities, please refer to the description in the above embodiments, and details will not be repeated here.
[0082] The present invention also provides a storage medium, which includes a stored program. When the program runs, it executes the above-mentioned image calibration method for the linear array camera of urban rail vehicles.
[0083] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0084] In the above embodiments of the present invention, the descriptions of the various embodiments have their own emphases. For the parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0085] In several embodiments provided by the present application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only illustrative. For example, the division of the units can be a logical function division. In actual implementation, there can be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of the units or modules can be electrical or other forms.
[0086] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place, or they can be distributed to multiple units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0087] In addition, in each embodiment of the present invention, each functional unit can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
[0088] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that makes a contribution to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in each embodiment of the present invention. The foregoing storage medium includes: various media such as USB flash drives, read-only memories (ROMs), random access memories (RAMs), mobile hard disks, magnetic disks, or optical discs that can store program codes.
[0089] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some or all of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of each embodiment of the present invention.
Claims
1. A method for correcting the images of a linear array camera on an urban rail vehicle, characterized in that, Including: Obtain template image data and image data to be detected; Extract fixed components from the template image data and the image data to be detected through the YOLO_V5 model, so as to obtain detection frames of the same fixed components in the template image data and the image data to be detected; Based on each detection frame of the template image data, obtain the first standard feature point dataset of the template image. Based on each detection frame of the image data to be detected, obtain the second standard feature point dataset of the image to be detected. Generate a standard matching dataset based on the first standard feature point dataset and the second standard feature point dataset; Extract fixed components from the template image data and the image data to be detected through a feature point detection model based on the SURF algorithm, and use the RANSAC method to obtain a candidate matching dataset. The candidate matching dataset includes pairs of template image feature points and image feature points to be detected in one-to-one correspondence; Based on the standard matching dataset and the candidate matching dataset, screen the data in the candidate matching dataset to obtain an accurate matching dataset. This includes using the standard matching dataset as a standard reference to screen the candidate matching dataset in turn until all incorrect matching data is deleted. The specific operations are as follows: Initial screening: The candidate matching dataset contains pairs of template image feature points and image feature points to be detected in one-to-one correspondence. Sort the template image feature points in ascending order of the horizontal axis coordinate. In the case of correct matching, the order of the corresponding image feature points to be detected does not change. If the order of a certain image feature point to be detected changes, it means the matching is incorrect, and delete the corresponding set of matching data; Secondary screening: Integrate the candidate matching data after the initial screening with the standard matching data, and sort the template image feature points in the integrated matching data in ascending order of the horizontal axis coordinate. If the order of the corresponding image feature points to be detected changes, it means there are still errors in the matching, and delete this set of incorrect matching data; Segment the image data to be detected based on the standard matching dataset, and use a third-order function to fit the discrete accurate matching data for each segment of the image data to be detected. Construct a correction matrix based on the fitting results of each segment; Multiply the image data to be detected by the correction matrix to obtain the corrected image data.
2. The method for correcting the image of the linear array camera of the urban rail vehicle according to claim 1, wherein, The first standard feature point data includes two vertex data of each detection frame of the template image data, and the data in the first standard feature point dataset is arranged in ascending order of the x coordinate; The second standard feature point dataset includes two vertex data of each detection frame of the image data to be detected, and the data in the second standard feature point dataset is arranged in ascending order of the x coordinate.
3. An image correction system for linear array cameras of urban rail vehicles, characterized in that, Including: An image acquisition module for obtaining template image data and image data to be detected; A first extraction module for extracting fixed components from the template image data and the image data to be detected through the YOLO_V5 model, so as to obtain detection frames of the same fixed components in the template image data and the image data to be detected; A standard matching dataset acquisition module, configured to obtain a first standard feature point dataset of a template image based on each detection box for the template image data, obtain a second standard feature point dataset of the image to be detected based on each detection box for the image to be detected data, and generate a standard matching dataset based on the first standard feature point dataset and the second standard feature point dataset; A second extraction module, configured to perform fixed component extraction on the template image data and the image to be detected data through a feature point detection model based on the SURF algorithm, and obtain a candidate matching dataset by using the RANSAC method, where the candidate matching dataset includes pairs of corresponding template image feature points and image to be detected feature points; A precise matching dataset acquisition module, configured to screen the data in the candidate matching dataset based on the standard matching dataset and the candidate matching dataset, so as to obtain a precise matching dataset, including using the standard matching dataset as a standard reference, and sequentially screening the candidate matching dataset until all incorrect matching data are deleted. The specific operations are as follows: Primary screening: The candidate matching dataset contains corresponding template image feature points and image to be detected feature points. The template image feature points are sorted in ascending order of the horizontal axis coordinates. In the case of correct matching, the order of the corresponding image to be detected feature points does not change. If the order of a certain image to be detected feature point changes, it indicates an incorrect matching, and the corresponding set of matching data is deleted. Secondary screening: The candidate matching data after primary screening is fused with the standard matching data, and the template image feature points in the fused matching data are sorted in ascending order of the horizontal axis coordinates. If the order of the corresponding image to be detected feature points changes, it indicates that there are still errors in the matching, and this set of incorrect matching data is deleted; A calibration matrix construction module, configured to segment the image to be detected data based on the standard matching dataset, respectively fit the discrete precise matching data of each segment of the image to be detected data by using a third-order function, and construct a calibration matrix based on the fitting results of each segment; An output module, configured to multiply the image to be detected data by the calibration matrix to obtain calibrated image data.
4. A storage medium, characterized in that, The storage medium includes a stored program, where, when the program runs, it executes the method according to any one of claims 1 to 2.
Citation Information
Patent Citations
Nonlinear SAR image geometric correction method based on thin-plate spline interpolation
CN106548462A
Improved train image accurate registration method and system based on SURF features
CN111354026A