A vision-based method for rapid identification of targets in track areas
Through the combination of four vehicle-mounted cameras and image calibration models, the problems of delay in image blur processing, insufficient matching accuracy and low calibration efficiency of multi-camera in the track visual recognition method are solved, real-time accurate recognition of track target objects is achieved, system robustness and detection coverage are improved, and train safety is ensured.
Patent Information
- Application Number
- CN202510748205.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-06
- Publication Date
- 2025-08-15
- Estimated Expiration
- 2045-06-06
AI Technical Summary
The existing track visual recognition methods face problems such as image blurring, insufficient image matching accuracy and low efficiency of multi-camera collaborative calibration during high-speed train driving, which is difficult to meet the real-time detection requirements and improve system robustness.
Four parallel-setting vehicle cameras are adopted to construct and image calibration models through fuzzy databases, combining deconvolution layer and error correction strategies to achieve real-time calibration and feature matching of images, dynamically adjust pixel thresholds and RGB gradient ranges, eliminate common mode errors and differential mode errors, and improve recognition accuracy.
Real-time accurate detection of track target objects in high-speed train environments is achieved, system robustness and detection coverage are improved, false detection and missed detection rates are reduced, and train safety and reliability are ensured.
Smart Images

Figure CN120259639B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of track detection, and in particular to a method for quickly identifying targets in a track area based on vision. Background Art
[0002] With the rapid development of rail transit, track detection technology has become an important guarantee for ensuring the safe operation of trains. In recent years, vision-based object recognition methods have been widely used in the field of track detection. They use on-board cameras to collect track images in real time and combine image processing technology to identify abnormal objects on the track (such as foreign objects, damaged track components, etc.). However, during high-speed train travel, existing visual recognition methods still face the following technical bottlenecks: (1) Image blur leads to processing delay: Due to the high speed of the train, the images collected by the on-board camera are easily affected by motion blur and vibration, and the image resolution is low and the edges are blurred. Traditional image enhancement and deblurring algorithms require a lot of computing resources and are difficult to meet real-time processing requirements. Especially in complex lighting or dynamic environments, the processing time of existing algorithms increases significantly, resulting in delayed target recognition and inability to provide timely feedback on safety hazards. (2) Insufficient accuracy of fuzzy image matching: Existing methods usually rely on clear image databases for feature matching, but feature extraction of fuzzy images is difficult, and direct matching is prone to misjudgment or missed detection. For example, the contour of the target object in the fuzzy image is deformed or the color is distorted, resulting in inaccurate feature mapping, which seriously affects the reliability of the recognition results. (3) Low efficiency of multi-camera collaborative calibration: To improve detection coverage, existing technologies often use multi-camera systems. However, it is difficult to effectively eliminate the geometric deformation and errors of images caused by differences in installation angles or environmental interference (such as vibration and lighting changes). Traditional calibration methods rely on complex hardware adjustments or static calibration, which cannot dynamically adapt to real-time changes in train operation. The calibration accuracy and efficiency are insufficient. In addition, the common-mode error (such as overall offset) and differential-mode error (such as local anomalies) of the multi-camera system lack targeted correction strategies, further reducing the robustness of the system.
[0003] Therefore, in order to solve the above problems, the present invention proposes a method for quickly identifying targets in a track area based on vision. Summary of the Invention
[0004] In view of the shortcomings of the existing technology, the purpose of the present invention is to provide a method for quickly identifying targets in a track area based on vision.
[0005] To achieve the above object, the present invention provides the following technical solutions:
[0006] A method for quickly identifying targets in a track area based on vision includes the following steps:
[0007] The target image sampling step uses the on-board camera to capture images of the track area to obtain a fuzzy sampled image of the target and a spatial calibration image;
[0008] The fuzzy database construction step is to train the database by collecting and comparing fuzzy image data, extract fuzzy image features and establish a mapping relationship with the specific target object to obtain the fuzzy database;
[0009] a sampling image calibration step, constructing an image calibration model based on the spatial calibration image and a pre-collected standard calibration image, and performing image calibration on the blurred sampling image of the target object using the image calibration model to obtain blurred image data of the target object;
[0010] In the target object rapid identification step, the fuzzy image data is compared with the fuzzy image features of the comparison fuzzy image data in the fuzzy database to obtain a target object with a mapping relationship and output it as the identified target object.
[0011] As a further improvement of the present invention, the on-board camera includes a sampling camera and a calibration camera, which are arranged as four parallel cameras, including a left sampling camera, a right sampling camera, a left calibration camera and a right calibration camera. The left sampling camera and the left calibration camera are arranged on the left front side of the forward direction of the rail train, and the right sampling camera and the right calibration camera are arranged on the right front side of the forward direction of the rail train. The left sampling camera and the left calibration camera are respectively mirror-symmetrically arranged with the right sampling camera and the right calibration camera along the center line of the track. The camera sampling area sizes of the left calibration camera and the right calibration camera are known and they collect standard calibration images with a directly overhead perspective.
[0012] As a further improvement of the present invention, the step of detecting a calibration camera is further included. When the sampling areas and the acquired image sizes of the left calibration camera and the right calibration camera are different, an abnormal calibration camera and a normal calibration camera are determined through a calibration layer correction strategy, and the normal calibration camera or the corrected calibration camera is selected as the calibration camera for acquiring the spatial calibration image.
[0013] As a further improvement of the present invention, the sampling image calibration step includes: constructing an image calibration model, performing pixel simplification processing on the spatial calibration image collected by the calibration camera, pixelating the spatial calibration image to obtain a spatial calibration image pixel value and comparing it with a pixel threshold preset according to the standard image feature, when the spatial calibration image pixel value is greater than the pixel threshold, performing geometric pixel value reduction on the spatial calibration image according to the standard image feature ratio, performing multi-value processing on the reduced spatial calibration image, dividing the pixel points into several preset RGB thresholds according to the preset RGB gradient range value, and comparing the multi-valued spatial calibration image according to the threshold value. The classification strategy confirms the image boundary of the area corresponding to the standard image feature of the calibration camera sampling area in the image, and performs mask processing on the spatial calibration image according to the image boundary to obtain a mask processing result. The calibration layer of the image calibration model is constructed according to the mask part and background part of the mask processing result through the fuzzy image calibration rule. The fuzzy image calibration rule calibrates the angle and size of the image input to the image calibration model by comparing the mask processing result with the size of the standard image feature; after the fuzzy sampling image of the target object is processed through the calibration layer, the fuzzy image comparison layer is input to obtain the fuzzy image data of the target object through image comparison processing.
[0014] As a further improvement of the present invention, the construction of the image calibration model includes the steps of synchronizing a calibration camera with a sampling camera, constructing a deconvolution layer through the spatial calibration image of the calibration camera, and establishing a geometric mapping relationship between image pixel values and actual track features based on the known fixed track features captured by the calibration camera; based on the geometric mapping relationship, the blurred sampling image of the target object captured by the sampling camera is deconvolved to correct the image deformation caused by the difference in installation angles between the sampling camera and the calibration camera, so that the calibrated blurred image features are consistent with the feature mapping relationship in the fuzzy database, thereby completing camera synchronization.
[0015] As a further improvement of the present invention, the threshold classification strategy includes extracting color features and shape features of the spatial calibration image, setting thresholds for the pixel points of the pixelated spatial calibration image according to the color feature data of the standard image features, and setting the pixel points of the spatial calibration image to several fixed RGB values according to the threshold partitions. By comparing the color features of the spatial calibration image and the standard image features, the RGB value difference is reduced to obtain an RGB threshold, and the pixel points in the spatial calibration image whose RGB values are greater than the threshold are extracted to generate an image boundary.
[0016] As a further improvement of the present invention, it also includes a calibration layer correction step, which includes a common-mode error correction step and a differential-mode error correction step. When the error amounts of the left calibration camera and the right calibration camera are the same, the output is a common-mode error, otherwise the output is a differential-mode error. The common-mode error correction step calculates the error through the overall translation in the spatial calibration image captured by the two calibration cameras; the differential-mode error is calculated through the differential translation caused by the calibration camera when the local orbital characteristics are abnormal.
[0017] As a further improvement of the present invention, the common-mode error correction step includes obtaining spatial calibration images captured by the left calibration camera and the right calibration camera, comparing the overall offset of the spatial calibration image with the pre-stored standard calibration image, calculating the common-mode error coefficient based on the overall offset, and generating an inverse compensation matrix based on the common-mode error coefficient, applying the inverse compensation matrix to the blurred sampling image of the sampling camera, performing translation or scaling compensation on the blurred sampling image, and eliminating the common-mode error.
[0018] As a further improvement of the present invention, the differential mode error correction step includes extracting pixel abnormality features of local areas in the spatial calibration images of the left calibration camera and the right calibration camera, and performing difference comparison with the corresponding areas of the standard calibration image; determining the differential mode error area according to the difference comparison results, performing pixel-level segmentation on the differential mode error area, extracting the RGB values and spatial coordinates of the abnormal pixel points, and using a neighborhood pixel interpolation algorithm based on the RGB gradient distribution of the neighborhood pixels to reconstruct the target values of the abnormal pixel points using a bilinear interpolation algorithm to repair the abnormal area, and using the repaired calibration image as input to update the calibration layer parameters.
[0019] As a further improvement of the present invention, an error elimination strategy is also included. The error elimination strategy includes dynamically updating a preset pixel threshold and RGB gradient range threshold in the pixel simplification process based on the historical error data of the calibration camera, setting a feedback loop in the calibration layer, performing a secondary comparison between each corrected image and the standard calibration image, and adjusting the deconvolution layer parameters or compensation matrix based on the residual error until the error is lower than the preset threshold. When the error of the calibration camera on one side continues to exceed the tolerance range, it is marked as an abnormal camera and switched to a spare calibration camera or the calibration data of the mirror-symmetric side is used to complete the correction.
[0020] The beneficial effects of the present invention are:
[0021] (1) Efficiently deal with image blur and dynamic interference to achieve real-time and accurate detection. Traditional methods are limited by motion blur and vibration interference, with low image resolution and significant processing delay, making it difficult to meet the real-time detection requirements of high-speed trains. The present invention solves this problem and achieves the following beneficial effects:
[0022] By collecting and comparing a large amount of blurred image data to train the database, a direct mapping relationship between blurred image features and target objects is established, avoiding the feature mismatch problem caused by relying on a clear image database. For example, the database can store the gradient distribution model of the edge deformation characteristics of blurred images of rail fasteners at different blur levels, allowing the recognition algorithm to quickly match the corresponding target object.
[0023] An image calibration model consisting of a calibration layer and a comparison layer is constructed using the spatial calibration images collected by the calibration camera. The angle and size of the fuzzy sampled image are calibrated through pixel simplification, multi-value processing and mask rules.
[0024] (2) Multi-camera collaborative calibration mechanism improves system robustness and detection coverage. Existing multi-camera systems have low calibration efficiency due to installation angle differences and environmental interference. This invention significantly optimizes performance through symmetrical layout and dynamic correction strategy:
[0025] The left sampling / calibration camera and the right sampling / calibration camera are mirror-symmetrically set along the centerline of the track, covering the full width of the track (for example, the detection width of a single camera is 3.5 meters, and the total detection width of both sides is 7 meters), avoiding the blind spot problem of traditional single-sided cameras.
[0026] By distinguishing between common-mode errors (overall offset) and differential-mode errors (local anomalies), targeted correction is achieved. Common-mode errors eliminate overall translation or scaling through an inverse compensation matrix, while differential-mode errors correct local anomalies through pixel-level interpolation, significantly enhancing system robustness.
[0027] (3) Dynamic error elimination strategy, adapted to complex operating environments, and targeting dynamic interference such as vibration and illumination changes during train operation, the present invention establishes a multi-level error suppression mechanism:
[0028] Dynamically adjust pixel threshold and RGB gradient range based on historical error data of the calibrated camera.
[0029] Through a secondary comparison between the calibration layer and the standard image (e.g., mean squared error (MSE)), the deconvolution layer parameters or compensation matrix are dynamically adjusted. If the error on one camera persists beyond the limit, the system automatically switches to a backup camera or utilizes mirror-symmetric data (e.g., horizontally flipping the right camera image to replace the left), ensuring uninterrupted system operation and improving fault tolerance.
[0030] (4) Improve detection reliability and security. Existing fuzzy image matching is prone to false detection or missed detection due to feature distortion. This invention ensures the reliability of the results through full process optimization:
[0031] For local anomalies (such as camera shake artifacts caused by vibration), the bilinear interpolation algorithm is used to reconstruct the abnormal pixel values, which improves the recognition accuracy of subtle features such as track cracks and avoids missed detections due to blur.
[0032] Reduce safety hazards, shorten processing delays, and buy critical time for train braking or manual intervention. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 is a flow chart of the method for rapid identification of a target object of the present invention;
[0034] Figure 2 is a schematic diagram of the vehicle-mounted camera of the present invention;
[0035] Figure 3 It is a structural diagram of the image calibration model of the present invention;
[0036] Figure 4 It is a flow chart of the error elimination steps of the present invention. DETAILED DESCRIPTION
[0037] The present invention will be described in further detail below with reference to the accompanying drawings and embodiments. Identical components are denoted by the same reference numerals. It should be noted that the terms "front," "rear," "left," "right," "upper," and "lower" used in the following description refer to directions in the accompanying drawings, and the terms "bottom," "top," "inner," and "outer" refer to directions toward or away from the geometric center of a particular component, respectively.
[0038] This embodiment aims to solve the problems of image blur processing delay, insufficient matching accuracy and low efficiency of multi-camera collaborative calibration in existing track visual recognition methods, and provide a method that can quickly and accurately identify track targets, such as Figures 1 to 4 Shown, including:
[0039] A method for quickly identifying targets in a track area based on vision includes the following steps:
[0040] The target image sampling step uses the on-board camera to capture images of the track area to obtain a fuzzy sampled image of the target and a spatial calibration image;
[0041] The fuzzy database construction step is to train the database by collecting and comparing fuzzy image data, extract fuzzy image features and establish a mapping relationship with the specific target object to obtain the fuzzy database;
[0042] a sampling image calibration step, constructing an image calibration model based on the spatial calibration image and a pre-collected standard calibration image, and performing image calibration on the blurred sampling image of the target object using the image calibration model to obtain blurred image data of the target object;
[0043] In the target object rapid identification step, the fuzzy image data is compared with the fuzzy image features of the comparison fuzzy image data in the fuzzy database to obtain a target object with a mapping relationship and output it as the identified target object.
[0044] In practical applications, onboard cameras are mounted on the bottom or side of a track train. As the train moves, a sampling camera and a calibration camera simultaneously capture images of the track area. The sampling camera captures blurred sampling images of the target object, while the calibration camera captures spatial calibration images. The captured image data is transmitted in real time to the onboard computer system. The computer system first processes the collected comparison blurred image data, extracting blurred image features such as edges, texture, and color. These features are then mapped to specific targets, such as foreign objects or track cracks, to construct a fuzzy database. An image calibration model is then constructed based on the spatial calibration images and pre-acquired standard calibration images. The standard calibration images are clear images of known track features captured in a laboratory environment using the calibration camera from a direct overhead perspective. The blurred sampling images of the target object are calibrated to produce clear blurred image data. Finally, the calibrated blurred image data is compared with the features in the fuzzy database. A feature matching recognition algorithm is used to identify the corresponding target object and output the recognition result.
[0045] Specifically, the on-board camera includes a sampling camera and a calibration camera, which is arranged as four parallel cameras, including a left sampling camera, a right sampling camera, a left calibration camera and a right calibration camera. The left sampling camera and the left calibration camera are arranged on the left front side of the forward direction of the rail train, and the right sampling camera and the right calibration camera are arranged on the right front side of the forward direction of the rail train. The left sampling camera and the left calibration camera are respectively mirror-symmetrically arranged with the right sampling camera and the right calibration camera along the center line of the track. The camera sampling area sizes of the left calibration camera and the right calibration camera are known and they collect standard calibration images with a directly overhead perspective.
[0046] The four onboard cameras are installed in a mirror-symmetrical manner along the center line of the track, with the left sampling camera and the left calibration camera set on the left front side of the track in the direction of travel of the train, and the right sampling camera and the right calibration camera set on the right front side. Figure 2 The numbers ①, ②, ③, and ④ indicate that the inner ② and ③ are calibration cameras, while ① and ④ are sampling cameras. The sampling area sizes of the left and right calibration cameras are pre-determined through measurement, for example, a rectangular area 50 cm long and 30 cm wide. Before the train leaves the factory or during regular maintenance, the calibration cameras capture a standard calibration image from a direct overhead perspective and store it in the onboard computer system, serving as a baseline for subsequent image calibration.
[0047] Specifically, such as Figures 1 to 4 As shown, the method further includes a calibration camera detection step. When the sampling areas and acquired image sizes of the left calibration camera and the right calibration camera are different, the abnormal calibration camera and the normal calibration camera are determined through the calibration layer correction strategy, and the normal calibration camera or the corrected calibration camera is selected as the calibration camera for acquiring the spatial calibration image.
[0048] If the sampling areas and captured image sizes of the left and right calibration cameras differ—for example, the left calibration camera's sampling area is 50 cm long and 30 cm wide, while the right calibration camera's is 45 cm long and 30 cm wide—this indicates that the right calibration camera may be misaligned or malfunctioning. In this case, a calibration layer correction strategy is used to compare the images captured by the two calibration cameras with the standard calibration image, determining that the right calibration camera is an abnormal calibration camera and the left calibration camera is a normal calibration camera. This calibration layer correction strategy includes an anomaly detection step, comparing the resolution of the images captured by the left and right calibration cameras and the geometric distortion rate (indicating geometric asymmetry of feature points; lower feature point distribution uniformity indicates higher geometric distortion rate) calculated using Harris corner detection. If the difference exceeds a preset threshold, with a resolution deviation greater than 5% or a distortion rate difference greater than 10%, the camera is identified as an abnormal camera. A polynomial geometric correction algorithm is then used to establish a coordinate transformation model using at least 20 control points to correct the sampling area deviation. In subsequent image acquisition, the left calibration camera is preferentially used to capture spatial calibration images. If the left calibration camera also has an abnormality, the right calibration camera is calibrated, for example, by adjusting its sampling area parameters through a software algorithm to make it consistent with the standard sampling area. The calibrated right calibration camera is used as the calibration camera for collecting spatial calibration images.
[0049] Specifically, such as Figures 1 to 4As shown, the sampled image calibration step includes constructing an image calibration model, performing pixel simplification processing on the spatial calibration image captured by the calibration camera, pixelizing the spatial calibration image to obtain pixel values, and comparing them with a preset pixel threshold based on standard image characteristics. The pixel threshold is determined by calculating the optimal segmentation point based on the pixel value distribution of 1000 standard calibration images using the Otsu algorithm. The RGB gradient range value is based on the typical color distribution statistics of track scenes, such as the RGB range of rail steel (150±30, 100±20, 50±10), and is obtained by fitting a Gaussian mixture model. The pixel offset threshold is 5 pixels (corresponding to the actual track distance of 50 mm, set according to the train detection accuracy requirements); the MSE threshold is 50 (corresponding to the acceptable range of image quality, determined through subjective evaluation experiments). When the pixel value of the spatial calibration image is greater than the pixel threshold, the spatial calibration image is proportionally reduced in pixel value according to the standard image feature ratio, the reduced spatial calibration image is multi-valued, and the pixel points are divided into a number of preset RGB thresholds according to the preset RGB gradient range value. The image boundary of the area corresponding to the standard image feature of the calibration camera sampling area in the multi-valued spatial calibration image is confirmed according to the threshold classification strategy, and the spatial calibration image is masked according to the image boundary to obtain a mask processing result. The mask part and background part of the mask processing result are fuzzy image calibration rules to complete the construction of the calibration layer of the image calibration model. The mask result is combined with the calibration rule in the way that the contour centroid (x m ,y m ) and the center of mass of the corresponding area of the standard image (x s ,y s ), calculate the angle deviation (Rotation correction is only required when the camera optical axis is non-vertical), the scaling factor s is determined in combination with the aspect ratio difference, and finally the calibration layer parameters are initialized through the affine transformation matrix. The blurred image calibration rule calibrates the angle and size of the image input to the image calibration model by comparing the mask processing result with the size of the standard image feature; after the blurred sampled image of the target object is processed through the calibration layer, the blurred image data of the target object is obtained through image comparison processing in the input blurred image comparison layer. The rule is implemented based on the geometric transformation matrix. The specific steps are: calculate the aspect ratio difference between the minimum circumscribed rectangle of the mask area and the corresponding area of the standard image to determine the scaling factor; calculate the coordinate difference between the center of mass of the mask area and the center of mass of the standard image to determine the translation amount; and complete the angle and size calibration through the affine transformation matrix.
[0050] When building the image calibration model, the spatial calibration image captured by the calibration camera is first subjected to pixel simplification. Using a clustered downsampling algorithm, the spatial calibration image is divided into 16×16 pixel blocks. The pixel values within each block are averaged, reducing the image resolution from 1920×1080 to 120×67 pixels, increasing processing speed by 30 times. Assuming a pixel threshold of 100 for standard image features, the spatial calibration image is pixelated and the pixel value of each pixel is compared to 100. If a pixel value is greater than 100, the pixel value is geometrically reduced, for example, to 80% of its original value, based on the standard image feature ratio (e.g., the pixel width of a track edge in a standard image has a ratio of 1:10 to its actual width). The reduced spatial calibration image is then multi-valued, with pixels divided into five RGB thresholds (e.g., track metal color, fastener gray, roadbed brown, foreign matter color, and background black). This division is based on the color distribution clustering results of 1,000 standard images using the K-means clustering algorithm. Each threshold corresponds to the typical color range of a material type. The preset RGB gradient ranges are R (100-200), G (50-150), and B (0-100). Pixels are divided into several preset RGB threshold ranges, such as R1 (100-150), G1 (50-100), and B1 (0-50). Next, using a threshold classification strategy, the color and shape features of the spatial calibration image are extracted and compared with the color feature data of the standard image (the standard track color is R=150, G=100, and B=50). The RGB value differences of the pixels are minimized to obtain RGB thresholds (R threshold 140-160, G threshold 90-110, and B threshold 40-60). Pixels in the spatial calibration image with RGB values greater than the threshold are extracted to generate image boundaries, such as the track edge. The spatial calibration image is masked based on the image boundaries, with the masked portion representing the track area and the background portion representing the non-track area. Based on the masked and background portions of the masked portion, the image's angle and scale are adjusted using the fuzzy image calibration rules by comparing the size of the masked portion with the size of the standard image features. Finally, the fuzzy sampled image of the target object is processed through the calibration layer to correct the image's angle and size. The image is then input into the fuzzy image comparison layer, where image similarity is calculated using mean square error and peak signal-to-noise ratio for image comparison, resulting in the fuzzy image data of the target object.
[0051] Specifically, such as Figures 1 to 4As shown, the construction of the image calibration model includes the steps of synchronizing the calibration camera and the sampling camera, constructing a deconvolution layer through the spatial calibration image of the calibration camera, adopting a U-Net network structure, and inputting a low-resolution spatial calibration image (512×256 pixels) of the calibration camera. It is restored to 1024×512 pixels through three layers of deconvolution layers (convolution kernel size 4×4, step size 2). At the same time, the camera intrinsic parameter matrix (focal length, principal point coordinates) is combined to establish a mapping between pixel coordinates and actual track coordinates. According to the known fixed track features collected by the calibration camera, a geometric mapping relationship between image pixel values and actual track features is established; the geometric mapping is implemented based on the homography matrix. By setting at least 4 checkerboard calibration plates on the track plane, after collecting the calibration camera image, the homography matrix H is calculated using the findHomography function of OpenCV to establish a mapping between pixel coordinates (u, v) and world coordinates (X, Y):
[0052] ; The steps of deconvolution to correct deformation include sampling through homography matrix
[0053] The image is perspective-corrected to eliminate the trapezoidal distortion caused by the installation angle, and then input into the deconvolution layer for resolution restoration. The processing flow is: perspective-corrected image → deconvolution layer (3 layers, the number of output channels in each layer is halved) → high-resolution calibration image.
[0054] Based on the geometric mapping relationship, deconvolution processing is performed on the blurred sampling image of the target object collected by the sampling camera to correct the image deformation caused by the difference in installation angle between the sampling camera and the calibration camera, so that the calibrated blurred image features are consistent with the feature mapping relationship in the fuzzy database, thereby completing camera synchronization.
[0055] In the step of synchronizing the calibration camera and the sampling camera, a deconvolution layer is constructed using the spatial calibration image captured by the calibration camera. The deconvolution layer is a neural network layer that can restore a low-resolution image to a high-resolution image. Based on the known fixed track features captured by the calibration camera, such as track joints and bolts, a geometric mapping relationship between the image pixel values and the actual track features is established. For example, each pixel corresponds to a distance of 1mm on the actual track. Based on this geometric mapping relationship, the blurred sampling image of the target object captured by the sampling camera is deconvolved. Through the deconvolution operation, the image deformation caused by the difference in installation angles between the sampling camera and the calibration camera, such as perspective deformation, is corrected. The calibrated blurred image features, such as the position and shape of the track joints, are made consistent with the feature mapping relationship in the fuzzy database to complete camera synchronization.
[0056] Specifically, such as Figures 1 to 4As shown, the threshold classification strategy includes extracting the color features and shape features of the spatial calibration image, setting the threshold of the pixel points of the pixelated spatial calibration image according to the color feature data of the standard image feature, and setting the pixel points of the spatial calibration image to several fixed RGB values according to the threshold partition. By comparing the color features of the spatial calibration image and the standard image feature, the RGB value difference is reduced to obtain the RGB threshold, and the pixel points in the spatial calibration image with RGB values greater than the threshold are extracted to generate the image boundary. In the threshold classification strategy, the image segmentation algorithm is first used to extract the color features and shape features of the spatial calibration image. The color feature extraction adopts the mean-variance statistics of the HSV color space to calculate the color deviation of each pixel. , where (H s , S s , V s ) is the color mean of the standard track feature. Shape features are extracted using Canny edge detection to extract contours. The ratio of the contour perimeter to area, i.e., compactness, is calculated. During threshold partitioning, three RGB threshold intervals are divided according to D, corresponding to the track body (D < 10), suspected features (10 ≤ D < 20), and background (D ≥ 20). The interval boundaries are automatically optimized using the Otsu algorithm. Color features are represented by statistically analyzing the RGB value distribution of each pixel in the image. Shape features are represented by extracting parameters such as edge contours, perimeters, and areas. Based on the color feature data of the standard image features, the color distribution of the standard track is R between 140-160, G between 90-110, and B between 40-60. Pixels in the pixelated spatial calibration image are thresholded. For example, pixels with R less than 140 or greater than 160 are set as the threshold for the non-track area. Then, the pixels of the spatial calibration image are partitioned into fixed RGB values based on threshold values. For example, pixels in the track area are set to R=150, G=100, and B=50, while pixels in the non-track area are set to R=255, G=255, and B=255. By comparing the color features of the spatial calibration image and the standard image, the thresholds are adjusted to reduce the difference in RGB values. The RGB thresholds are determined to be 145-155 for R, 95-105 for G, and 45-55 for B. Pixels in the spatial calibration image with RGB values greater than the thresholds are extracted to generate image boundaries, such as the edge of the track.
[0057] Specifically, such as Figures 1 to 4As shown, the system also includes a calibration layer correction step, which includes common-mode error correction and differential-mode error correction. When the errors of the left and right calibration cameras are the same, the common-mode error is output; otherwise, the differential-mode error is output. Quantification indicators are: common-mode error: the difference in pixel offset between the left / right camera images and the standard image is ≤ 2 pixels, and the difference in the mean color error is ≤ 5 (RGB value); differential-mode error: if it exceeds the specified range, it is determined to be a differential-mode error. The common-mode error correction step calculates the error based on the overall translation in the spatial calibration images captured by the two calibration cameras; the differential-mode error is calculated based on the differential translation caused by the calibration cameras when local track characteristics are abnormal.
[0058] During the calibration layer correction step, if the error between the left and right calibration cameras is the same—for example, if the images captured by both cameras are offset by 5 pixels to the left—it's considered a common-mode error. If the image captured by the left calibration camera is offset by 5 pixels to the left, while the image captured by the right calibration camera is offset by 3 pixels to the right, it's considered a differential-mode error. The common-mode error correction step analyzes the overall translation of the spatial calibration images captured by the two calibration cameras, calculates the common-mode error coefficient, and generates an inverse compensation matrix based on the common-mode error coefficient. The onboard computer's error analysis module distinguishes between common-mode and differential-mode errors. This module monitors the image data from the left and right calibration cameras in real time and calculates the pixel offset difference between the images captured by the two cameras and the standard calibration image. If the difference is within a preset tolerance, such as ±2 pixels, it's considered a common-mode error; if it's outside the tolerance, it's considered a differential-mode error.
[0059] Specifically, such as Figures 1 to 4 As shown, the common-mode error correction step includes obtaining a spatial calibration image captured by a left calibration camera and a right calibration camera, comparing the overall offset of the spatial calibration image with a pre-stored standard calibration image, calculating a common-mode error coefficient based on the overall offset, and generating an inverse compensation matrix based on the common-mode error coefficient. The inverse compensation matrix is applied to the blurred sampling image of the sampling camera to perform translation or scaling compensation on the blurred sampling image to eliminate the common-mode error.
[0060] Specifically, such as Figures 1 to 4As shown, the differential mode error correction step includes extracting pixel abnormality features in the local area of the spatial calibration image of the left calibration camera and the right calibration camera, and performing a difference comparison with the corresponding area of the standard calibration image; determining the differential mode error area based on the difference comparison result, performing pixel-level segmentation on the differential mode error area, extracting the RGB value and spatial coordinates of the abnormal pixel point, and using the neighborhood pixel interpolation algorithm based on the RGB gradient distribution of the neighborhood pixels, using the bilinear interpolation algorithm to reconstruct the target value of the abnormal pixel point to repair the abnormal area, and using the repaired calibration image as input to update the calibration layer parameters. The neighborhood range of the bilinear interpolation algorithm adopts a 3×3 neighborhood, and the weight calculation method is , where d i is the Manhattan distance between the neighborhood pixel and the abnormal pixel.
[0061] The common-mode error correction steps include:
[0062] Error calculation: Using the SIFT algorithm based on feature points, the spatial calibration images from the left and right calibration cameras are globally matched with the standard calibration image to calculate the overall translation (Δx, Δy) and the scaling factor k. For example, if the image is translated 10 pixels to the left and 5 pixels downward, and the scaling factor is 0.9, the common mode error coefficient is (Δx = -10, Δy = -5, k = 0.9).
[0063] Compensation matrix generation: Generate an inverse compensation matrix based on the common mode error coefficient. The matrix contains translation, scaling, and rotation parameters. Translation compensation is achieved through the affine transformation matrix, and scaling compensation is achieved through the scaling matrix. For example, the inverse compensation matrix is:
[0064] ;
[0065] Image compensation: The inverse compensation matrix is applied to the blurred sampled image from the sampling camera, and the pixel values are resampled using a bilinear interpolation algorithm to eliminate the overall offset and scaling errors.
[0066] Specifically, the common mode error correction is implemented based on the image transformation algorithm library, taking the overall rightward deviation of the track as an example:
[0067] Offset calculation: Using the template matching algorithm, the left and right calibration images are matched with the track centerline in the standard image, and the overall offset to the right is calculated to be 15 pixels.
[0068] Inverse compensation matrix generation: Generate translation matrix, , compensate the sampled image by shifting it 15 pixels to the left.
[0069] Scaling compensation example: If the overall image scaling ratio is 0.8 (i.e. the image size is reduced by 20%), then generate the scaling matrix , enlarge the image to standard size.
[0070] The steps for differential mode error correction include:
[0071] Local feature extraction: Use a convolutional neural network (CNN) to extract local features in the left and right calibration camera images, such as rail fasteners and welds, and compare them with the features of the corresponding areas in the standard calibration image to calculate pixel-level differences, such as RGB value deviation and position offset.
[0072] Error region segmentation: A threshold segmentation algorithm is used to mark areas with significant differences as differential error regions. For example, an area where the RGB values of pixels deviate from the standard by more than 30% and the area is larger than 50×50 pixels is considered an abnormal area.
[0073] Pixel repair: Segment the abnormal area at the pixel level and extract the coordinates (x, y) and RGB values (r, g, b) of each abnormal pixel. Calculate the RGB gradient distribution of the 8 pixels in the neighborhood using a bilinear interpolation algorithm.
[0074] The target value for this pixel:
[0075] The weight It is inversely proportional to the distance from the neighboring pixel to the abnormal pixel. The repaired image is used as the new calibration data and input into the calibration layer to update the parameters.
[0076] Specifically, the specific implementation of differential mode error correction takes the pixel abnormality in the local area of the right calibration camera as an example:
[0077] Anomaly detection: By comparing the right calibration image with the standard image, a 50×30 pixel color block anomaly is found in the track fastener area. The RGB value is (200, 180, 150), while the standard value is (150, 100, 50).
[0078] Pixel-level segmentation: Use the flood fill algorithm to mark the abnormal area and extract the coordinates and RGB values of all pixels in the area.
[0079] Neighborhood interpolation repair: For each abnormal pixel, take the normal pixels (pixels in the non-abnormal area) within its 3×3 neighborhood and calculate the RGB mean of the neighborhood pixels as the repair value. For example, if the neighborhood mean of an abnormal pixel is (145, 98, 52), the pixel is repaired to this value.
[0080] Parameter update: The repaired calibration image is input into the calibration layer, and the weight parameters of the deconvolution layer are adjusted through the back-propagation algorithm to improve the subsequent calibration accuracy.
[0081] Specifically, such as Figures 1 to 4As shown, it also includes an error elimination strategy, which includes dynamically updating the preset pixel threshold and RGB gradient range threshold in the pixel simplification processing based on the historical error data of the calibration camera, setting a feedback loop in the calibration layer, comparing the image after each correction with the standard calibration image twice, and adjusting the deconvolution layer parameters or compensation matrix according to the residual error until the error is lower than the preset threshold. When the error of the calibration camera on one side continues to exceed the tolerance range, it is marked as an abnormal camera and switched to the spare calibration camera or the calibration data of the mirror-symmetrical side is used to complete the correction. The trigger mechanism is that the MSE of the camera on one side is >80 for three consecutive calibrations and the difference with the MSE of the camera on the opposite side is >30, which is judged as "continuously out of tolerance" and automatically switches to the horizontal flip data of the opposite image. The residual error is calculated using the mean square error (MSE) and the formula is , where I i is the pixel value of the corrected image, I std,i is the pixel value corresponding to the standard image, and the threshold is set to 30 (the threshold is determined by statistics of 1000 calibration data). Its implementation includes:
[0082] Dynamic threshold update: The onboard system maintains an error history database, recording residual error data from the past 100 calibrations. If calibration errors in a particular area exceed a preset threshold for five consecutive times, such as a pixel offset >3 pixels or an RGB deviation >20%, the system automatically adjusts the pixel threshold used in pixel simplification (e.g., from 100 to 120) and the RGB gradient range threshold (e.g., from 100-200 to 80-220) to accommodate image differences caused by lighting changes or camera aging.
[0083] Feedback loop correction: A closed-loop feedback mechanism is set up in the calibration layer: each calibrated image is compared twice with the standard calibration image, and the mean square error (MSE) is calculated. If MSE>50, parameter adjustment is triggered:
[0084] If it is a geometric deformation error, such as tilt, adjust the convolution kernel parameters of the deconvolution layer;
[0085] If it is a brightness / color error, adjust the brightness scaling factor or color balance coefficient of the compensation matrix.
[0086] The alignment-adjustment process was repeated until MSE < 30 or the maximum number of iterations, 10, was reached.
[0087] Abnormal camera switching: When the error of a calibration camera on one side (such as the left calibration camera) exceeds the tolerance range for 10 consecutive times, the system marks the camera as "abnormal" and automatically switches to the backup calibration camera or enables the mirror symmetry strategy: using the image data from the right calibration camera, a horizontal flip algorithm is used to generate a left-view calibration image, which replaces the abnormal camera data to complete the calibration.
[0088] The above shows and describes the basic features, principles, and advantages of the present invention. It should be noted that the present invention is not limited to the above embodiments, which are only some embodiments. Without departing from the spirit and scope of the present invention, various improvements and supplements made are considered to be within the scope of protection of the present invention.
Claims
1. A method for quickly identifying targets in a track area based on vision, characterized in that: The steps include: The target image sampling step uses the on-board camera to capture images of the track area to obtain a fuzzy sampled image of the target and a spatial calibration image; The fuzzy database construction step is to train the database by collecting and comparing fuzzy image data, extract fuzzy image features and establish a mapping relationship with the specific target object to obtain the fuzzy database; a sampling image calibration step, constructing an image calibration model based on the spatial calibration image and a pre-collected standard calibration image, and performing image calibration on the blurred sampling image of the target object using the image calibration model to obtain blurred image data of the target object; In the target object rapid identification step, the fuzzy image data is compared with the fuzzy image features of the comparison fuzzy image data in the fuzzy database to obtain a target object with a mapping relationship and output it as the identified target object.
2. The method for rapid identification of targets in a track area based on vision according to claim 1, characterized in that: The on-board camera includes a sampling camera and a calibration camera, which are arranged as four parallel cameras, including a left sampling camera, a right sampling camera, a left calibration camera and a right calibration camera. The left sampling camera and the left calibration camera are arranged on the left front side of the forward direction of the rail train, and the right sampling camera and the right calibration camera are arranged on the right front side of the forward direction of the rail train. The left sampling camera and the left calibration camera are respectively arranged in mirror symmetry with the right sampling camera and the right calibration camera along the center line of the track. The camera sampling areas of the left calibration camera and the right calibration camera are known in size and collect standard calibration images with a directly overhead perspective.
3. The method for rapid identification of targets in a track area based on vision according to claim 2, characterized in that: The method further includes a calibration camera detection step. When the sampling areas and the acquired image sizes of the left calibration camera and the right calibration camera are different, an abnormal calibration camera and a normal calibration camera are determined through a calibration layer correction strategy, and the normal calibration camera or the corrected calibration camera is selected as the calibration camera for acquiring the spatial calibration image.
4. The method for rapid identification of targets in a track area based on vision according to claim 1, characterized in that: The sampling image calibration step includes: constructing an image calibration model, performing pixel simplification processing on a spatial calibration image acquired by a calibration camera, pixelizing the spatial calibration image to obtain a spatial calibration image pixel value, and comparing the pixel value with a preset pixel threshold value based on a standard image feature; when the pixel value of the spatial calibration image is greater than the pixel threshold value, geometrically reducing the pixel value of the spatial calibration image according to a standard image feature ratio; performing multi-valued processing on the reduced spatial calibration image; dividing the pixel points into a plurality of preset RGB threshold values based on a preset RGB gradient range value; confirming the image boundary of the area corresponding to the standard image feature of the calibration camera sampling area in the multi-valued spatial calibration image according to a threshold classification strategy; performing mask processing on the spatial calibration image according to the image boundary to obtain a mask processing result; completing construction of a calibration layer of the image calibration model based on a mask portion and a background portion of the mask processing result using a fuzzy image calibration rule; the fuzzy image calibration rule calibrates the angle and size of the image input to the image calibration model by comparing the mask processing result with the size of the standard image feature; after the fuzzy sampling image of the target object is processed through the calibration layer, the input fuzzy image comparison layer obtains fuzzy image data of the target object through image comparison processing.
5. The method for rapid identification of targets in a track area based on vision according to claim 4, characterized in that: The construction of the image calibration model includes the steps of synchronizing a calibration camera with a sampling camera, constructing a deconvolution layer using a spatial calibration image from the calibration camera, and establishing a geometric mapping relationship between image pixel values and actual track features based on known fixed track features collected by the calibration camera; Based on the geometric mapping relationship, deconvolution processing is performed on the blurred sampling image of the target object collected by the sampling camera to correct the image deformation caused by the difference in installation angle between the sampling camera and the calibration camera, so that the calibrated blurred image features are consistent with the feature mapping relationship in the fuzzy database, thereby completing camera synchronization.
6. The method for rapid identification of targets in a track area based on vision according to claim 4, characterized in that: The threshold classification strategy includes extracting color features and shape features of the spatial calibration image, setting thresholds for pixel points of the pixelated spatial calibration image based on the color feature data of the standard image features, and setting the pixels of the spatial calibration image to several fixed RGB values based on the threshold partitions. By comparing the color features of the spatial calibration image and the standard image features, the difference in RGB values is reduced to obtain an RGB threshold, and pixels in the spatial calibration image with RGB values greater than the threshold are extracted to generate an image boundary.
7. The method for rapid identification of targets in a track area based on vision according to claim 2, characterized in that: It also includes a calibration layer correction step, which includes a common-mode error correction step and a differential-mode error correction step. When the error amounts of the left calibration camera and the right calibration camera are the same, the output is a common-mode error, otherwise the output is a differential-mode error. The common-mode error correction step calculates the error through the overall translation in the spatial calibration image captured by the two calibration cameras; the differential-mode error is calculated through the differential translation caused by the calibration camera when the local orbital characteristics are abnormal.
8. The method for rapid identification of targets in a track area based on vision according to claim 7, characterized in that: The common-mode error correction step includes obtaining spatial calibration images captured by the left calibration camera and the right calibration camera, comparing the overall offset of the spatial calibration image with a pre-stored standard calibration image, calculating a common-mode error coefficient based on the overall offset, and generating an inverse compensation matrix based on the common-mode error coefficient. The inverse compensation matrix is applied to the blurred sampling image of the sampling camera to perform translation or scaling compensation on the blurred sampling image to eliminate the common-mode error.
9. The method for rapid identification of targets in a track area based on vision according to claim 7, characterized in that: The differential mode error correction step includes extracting pixel abnormality features of local areas in the spatial calibration images of the left calibration camera and the right calibration camera, and performing difference comparison with the corresponding areas of the standard calibration image; determining the differential mode error area based on the difference comparison result, performing pixel-level segmentation on the differential mode error area, extracting the RGB values and spatial coordinates of the abnormal pixel points, and reconstructing the target values of the abnormal pixel points using a bilinear interpolation algorithm based on the RGB gradient distribution of the neighboring pixels through a neighborhood pixel interpolation algorithm to repair the abnormal area, and using the repaired calibration image as input to update the calibration layer parameters.
10. The method for rapid identification of targets in a track area based on vision according to claim 7, characterized in that: The method also includes an error elimination strategy, which includes dynamically updating a preset pixel threshold and RGB gradient range threshold in the pixel simplification process based on the historical error data of the calibration camera, setting a feedback loop in the calibration layer, performing a secondary comparison between each corrected image and the standard calibration image, and adjusting the deconvolution layer parameters or the compensation matrix according to the residual error until the error is lower than the preset threshold. When the error of the calibration camera on one side continues to exceed the tolerance range, it is marked as an abnormal camera, and the camera is switched to a spare calibration camera or the calibration data of the mirror-symmetrical side is used to complete the correction.
Citation Information
Patent Citations
Track foreign matter identification method and system, electronic equipment and medium
CN118736527A
Remote rail identification and obstacle detection method and system
CN119625679A