Method and device for detecting poor shunting of track circuit and computer equipment
By acquiring unoccupied and real-time images of the track, and using image matching information and multiple detection branches of target detection for fusion processing, the system automatically detects faulty track circuits, solving the problem of low detection efficiency in existing technologies and improving the reliability and accuracy of detection.
Patent Information
- Application Number
- CN202511346166.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-19
- Publication Date
- 2025-12-23
AI Technical Summary
The detection efficiency of faulty track circuit shunts in existing technologies is low, leading to potential safety hazards in railway transportation, and usually relies on manual on-site inspection.
By acquiring images of unoccupied tracks and real-time data, and utilizing image matching information, target detection, and the fusion processing of multiple detection branches, the system automatically detects track occupancy status and identifies faulty track circuits.
It improves the detection efficiency of faulty track circuit shunts, reduces reliance on manual on-site inspection, and enhances the reliability and accuracy of detection.
Smart Images

Figure CN121180271A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of rail transit technology, and in particular to a method, apparatus, computer equipment, computer-readable storage medium, and computer program product for detecting faulty track circuit shunts. Background Technology
[0002] A faulty track circuit shunt refers to a situation where the track is occupied, specifically when a train occupies the track circuit, but the control panel does not display the occupancy status or does not reliably display it, leading to a failure of the signal interlocking. Faulty track circuit shunts can seriously threaten railway transportation safety; therefore, it is often necessary to detect faulty track circuit shunts.
[0003] In related technologies, the detection efficiency of track circuit malfunctions is usually low because it is usually based on manual on-site inspection of the track. Summary of the Invention
[0004] Therefore, it is necessary to address the aforementioned technical problem of low detection efficiency for track circuit shunt defects by providing a method, apparatus, computer equipment, computer-readable storage medium, and computer program product that can improve the detection efficiency of track circuit shunt defects.
[0005] In a first aspect, this application provides a method for detecting faulty track circuit shunts, comprising:
[0006] Acquire a first image and a second image of the track; the first image is an image of the track when it is not occupied, and the second image is a real-time image of the track;
[0007] Based on the first matching information between the second image and the first image, a first track occupancy detection result is determined for the track; based on the second matching information between the second image and the first image, a second track occupancy detection result is determined for the track; and based on target detection processing of the second image, a third track occupancy detection result is determined for the track. The first matching information is used to characterize the changes in the second image compared to the first image, and the second matching information is used to characterize the similarity between the second image and the first image.
[0008] The first track occupancy detection result, the second track occupancy detection result, and the third track occupancy detection result are fused together to obtain the target track occupancy detection result of the track.
[0009] Based on the target track occupancy detection results, the track circuit shunt failure detection results for the track are determined.
[0010] In one embodiment, each second pixel in the second image has a corresponding first pixel in the first image;
[0011] The step of determining the first track occupancy detection result of the track based on the first matching information between the second image and the first image includes:
[0012] For each second pixel, a classification result is determined relative to the corresponding first pixel; the classification result includes a first classification result and a second classification result, wherein the first classification result is used to characterize that the second pixel has not changed relative to the corresponding first pixel; and the second classification result is used to characterize that the second pixel has changed relative to the corresponding first pixel.
[0013] Based on the second pixel point whose corresponding classification result is the second classification result, the changed region in the second image is obtained;
[0014] The first intersection is obtained by taking the intersection of the orbit region where the orbit is located in the second image and the change region;
[0015] If the first intersection is empty, the first track occupancy detection result is determined to be unoccupied; if the first intersection is not empty, the first track occupancy detection result is determined to be occupied.
[0016] In one embodiment, determining the classification result of the second pixel relative to the corresponding first pixel includes:
[0017] Obtain each sample image from the sample image library; each sample image is obtained based on data augmentation processing of the first image;
[0018] For each of the sample images, a sample pixel corresponding to the second pixel is determined in the sample image, and the grayscale distance between the second pixel and the sample pixel is determined based on the grayscale value of the second pixel and the grayscale value of the sample pixel.
[0019] Count the number of grayscale distances corresponding to the second pixel whose distance values are greater than the distance value threshold.
[0020] If the number of distances is less than or equal to a threshold, the classification result of the second pixel is determined to be the first classification result; if the number of distances is greater than the threshold, the classification result of the second pixel is determined to be the second classification result.
[0021] In one embodiment, the method further includes:
[0022] Based on the resolution of the first image, a counting matrix and an image binarization matrix are constructed; each first pixel has a corresponding element in the counting matrix and the image binarization matrix; the element values of each element in the counting matrix and the image binarization matrix are initialized to a first value;
[0023] When the number of distances is less than or equal to a threshold, after determining that the classification result of the second pixel is the first classification result, the method further includes:
[0024] The element values of the target elements corresponding to the second pixel in the counting matrix and the image binarization matrix are all set to the first value; the target elements corresponding to the second pixel in the counting matrix and the image binarization matrix are the elements corresponding to the first pixel in the counting matrix and the image binarization matrix.
[0025] According to the preset update probability and the second pixel, update the grayscale value of each sample pixel corresponding to the second pixel;
[0026] After determining the classification result of the second pixel as the second classification result when the number of distances is greater than the number threshold, the method further includes:
[0027] Set the element value of the target element corresponding to the second pixel in the image binarization matrix to the second value, and increase the element value of the target element corresponding to the second pixel in the counting matrix;
[0028] If the increase of the target element corresponding to the second pixel in the counting matrix exceeds a numerical threshold, the grayscale value of each sample pixel corresponding to the second pixel is updated according to the second pixel.
[0029] In one embodiment, the number of the first images is multiple;
[0030] The determination of the second track occupancy detection result based on the second matching information between the second image and the first image includes:
[0031] Obtain the second-direction gradient features of the second image;
[0032] For each of the first images, a correlation filter classification model corresponding to the first image is obtained. Based on the correlation filter classification model and the second directional gradient feature, a confidence response map of the second image corresponding to the first image is determined. Each correlation filter classification model is trained based on the first directional gradient feature of the corresponding first image. The confidence response map of the second image corresponding to the first image is used to characterize the similarity between the second image and the first image.
[0033] Determine the maximum response value in each of the confidence response graphs corresponding to the second image;
[0034] If the maximum response value is greater than or equal to the response value threshold, the second track occupancy detection result is determined to be unoccupied; if the maximum response value is less than the response value threshold, the second track occupancy detection result is determined to be occupied.
[0035] In one embodiment, determining the third track occupancy detection result of the track based on the target detection processing of the second image includes:
[0036] The target detection model obtained through pre-training is used to perform target detection processing on the second image. If the target detection processing determines that there is a train in the second image, the train region in the second image is determined.
[0037] The intersection of the track region and the train region in the second image is obtained to form a second intersection.
[0038] If the second intersection is empty, the third track occupancy detection result is determined to be unoccupied; if the second intersection is not empty, the third track occupancy detection result is determined to be occupied.
[0039] Secondly, this application also provides a detection device for faulty track circuit shunts, comprising:
[0040] The track image acquisition module is used to acquire a first image and a second image of the track; the first image is an image of the track when it is not occupied, and the second image is a real-time image of the track;
[0041] The track occupancy detection module is used to determine a first track occupancy detection result of the track based on a first matching information between the second image and the first image, to determine a second track occupancy detection result of the track based on a second matching information between the second image and the first image, and to determine a third track occupancy detection result of the track based on target detection processing of the second image; the first matching information is used to characterize the changes in the second image compared to the first image, and the second matching information is used to characterize the similarity between the second image and the first image;
[0042] The occupancy result fusion module is used to fuse the first track occupancy detection result, the second track occupancy detection result and the third track occupancy detection result to obtain the target track occupancy detection result of the track.
[0043] The circuit malfunction detection module is used to determine the circuit malfunction detection result of the track circuit based on the target track occupancy detection result.
[0044] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0045] Acquire a first image and a second image of the track; the first image is an image of the track when it is not occupied, and the second image is a real-time image of the track;
[0046] Based on the first matching information between the second image and the first image, a first track occupancy detection result is determined for the track; based on the second matching information between the second image and the first image, a second track occupancy detection result is determined for the track; and based on target detection processing of the second image, a third track occupancy detection result is determined for the track. The first matching information is used to characterize the changes in the second image compared to the first image, and the second matching information is used to characterize the similarity between the second image and the first image.
[0047] The first track occupancy detection result, the second track occupancy detection result, and the third track occupancy detection result are fused together to obtain the target track occupancy detection result of the track.
[0048] Based on the target track occupancy detection results, the track circuit shunt failure detection results for the track are determined.
[0049] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:
[0050] Acquire a first image and a second image of the track; the first image is an image of the track when it is not occupied, and the second image is a real-time image of the track;
[0051] Based on the first matching information between the second image and the first image, a first track occupancy detection result is determined for the track; based on the second matching information between the second image and the first image, a second track occupancy detection result is determined for the track; and based on target detection processing of the second image, a third track occupancy detection result is determined for the track. The first matching information is used to characterize the changes in the second image compared to the first image, and the second matching information is used to characterize the similarity between the second image and the first image.
[0052] The first track occupancy detection result, the second track occupancy detection result, and the third track occupancy detection result are fused together to obtain the target track occupancy detection result of the track.
[0053] Based on the target track occupancy detection results, the track circuit shunt failure detection results for the track are determined.
[0054] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:
[0055] Acquire a first image and a second image of the track; the first image is an image of the track when it is not occupied, and the second image is a real-time image of the track;
[0056] Based on the first matching information between the second image and the first image, a first track occupancy detection result is determined for the track; based on the second matching information between the second image and the first image, a second track occupancy detection result is determined for the track; and based on target detection processing of the second image, a third track occupancy detection result is determined for the track. The first matching information is used to characterize the changes in the second image compared to the first image, and the second matching information is used to characterize the similarity between the second image and the first image.
[0057] The first track occupancy detection result, the second track occupancy detection result, and the third track occupancy detection result are fused together to obtain the target track occupancy detection result of the track.
[0058] Based on the target track occupancy detection results, the track circuit shunt failure detection results for the track are determined.
[0059] The aforementioned method, apparatus, computer equipment, computer-readable storage medium, and computer program product for detecting faulty track circuit shunting acquire a first image of the track when it is unoccupied and a second image of the track in real time through image processing. From the perspectives of changes in the second image compared to the first image, similarities between the two images, and target detection results in the second image, the method obtains a first track occupancy detection result, a second track occupancy detection result, and a third track occupancy detection result. Based on the fusion processing of multiple track occupancy detection results, the method obtains the target track occupancy detection result, and thus the track circuit faulty detection result. This method for detecting faulty track circuit shunting no longer relies on manual on-site inspection; instead, it detects faulty track circuit shunting by processing the first image of the track when it is unoccupied and the second image of the track in real time, thereby improving the detection efficiency of faulty track circuit shunting. Attached Figure Description
[0060] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0061] Figure 1 This is a flowchart illustrating a method for detecting faulty shunt circuits in one embodiment;
[0062] Figure 2 This is a schematic diagram illustrating the construction of a sample image library in one embodiment;
[0063] Figure 3 This is a flowchart illustrating a method for monitoring track occupancy due to poor routing in one embodiment;
[0064] Figure 4 This is a structural block diagram of a detection device for faulty track circuit shunt in one embodiment;
[0065] Figure 5 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0066] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0067] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.
[0068] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0069] In one exemplary embodiment, such as Figure 1 As shown, a method for detecting faulty shunt circuits in a track circuit is provided. This embodiment illustrates the application of this method to a server, but it is understood that the method can also be applied to a terminal, or to a system including both a server and a terminal, and is implemented through interaction between the server and the terminal. The server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. The terminal can be, but is not limited to, various personal computers, laptops, smartphones, tablets, drones, low-altitude aircraft, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart vehicle devices, projection devices, etc. Portable wearable devices can include smartwatches, smart bracelets, head-mounted devices, etc. Head-mounted devices can be virtual reality (VR) devices, augmented reality (AR) devices, smart glasses, etc. In this embodiment, the method includes the following steps S102 to S108:
[0070] Step S102: Obtain the first and second images of the track.
[0071] The first image is of the track when it is not occupied, and the second image is of the track in real time.
[0072] In practical applications, the server uses image acquisition devices, such as pan-tilt cameras, to detect track circuit malfunctions in the monitored area of the track within the station. Before detecting track circuit malfunctions, the server needs to configure the monitoring positions of the image acquisition devices: First, the focal length of the image acquisition devices is adjusted according to the distance to the monitored area to ensure that the devices can clearly capture images of the track. Then, by adjusting parameters such as the horizontal angle, pitch angle, zoom parameters, and focal length of the image acquisition devices, the monitored area is scanned to determine multiple monitoring positions. It is necessary to ensure that there is a certain degree of overlap between images captured by adjacent monitoring positions, such as 10% overlap, while ensuring that images captured by all monitoring positions completely cover the monitored area. Next, each monitoring position is numbered, and the parameters of the image acquisition devices at each monitoring position are recorded, such as the horizontal angle, pitch angle, zoom parameters, and focal length.
[0073] Specifically, after setting the monitoring positions of the image acquisition device, the server controls the image acquisition device to traverse each monitoring position. For each monitoring position, the image acquisition device acquires an image of the track in the monitoring sub-area (the part of the monitoring area that can be captured by the monitoring position) corresponding to that monitoring position when the track is not occupied, thus obtaining the first image under that monitoring position. Then, the track in the monitoring sub-area is marked in the first image, that is, the track area in the first image is marked.
[0074] When it is necessary to detect faulty circuits in the track circuit, the server controls the image acquisition device to traverse each monitoring position. For each monitoring position, the image acquisition device acquires the image of the monitoring sub-area corresponding to that monitoring position in real time to obtain the second image of that monitoring position. The server also obtains the first image of that monitoring position from the pre-acquired first images.
[0075] Step S104: Based on the first matching information between the second image and the first image, determine the first track occupancy detection result of the track; based on the second matching information between the second image and the first image, determine the second track occupancy detection result of the track; based on the target detection processing of the second image, determine the third track occupancy detection result of the track.
[0076] The first matching information is used to characterize the changes in the second image compared to the first image; in specific applications, the changes include at least the changed regions.
[0077] The second matching information is used to characterize the similarity between the second image and the first image; in specific applications, the similarity includes at least the similarity degree that characterizes the degree of similarity.
[0078] The track occupancy detection result is used to characterize whether a track is occupied; in specific applications, the track occupancy detection result includes unoccupied and occupied.
[0079] Specifically, the server performs track occupancy detection on the tracks within the monitored sub-area using three different and parallel detection branches, i.e., detecting whether a train is occupying the track circuit. In a specific application, the server performs track occupancy detection on the tracks within the monitored sub-area based on the first matching information between the second and first images, obtaining the first track occupancy detection result. Based on the second matching information between the second and first images, the server performs track occupancy detection on the tracks within the monitored sub-area based on the second matching information, obtaining the second track occupancy detection result. Based on target detection processing of the second image, the server performs track occupancy detection on the tracks within the monitored sub-area based on the third detection branch, obtaining the third track occupancy detection result.
[0080] Step S106: The first track occupancy detection result, the second track occupancy detection result, and the third track occupancy detection result are fused to obtain the target track occupancy detection result.
[0081] Specifically, the server obtains the weights of each detection branch and, based on the weights of each detection branch, performs weighted fusion processing on the track occupancy detection results corresponding to each detection branch within the monitored sub-area to obtain the target track occupancy detection results for the track within the monitored sub-area. For example, the server obtains the first weight of the first detection branch, the second weight of the second detection branch, and the third weight of the third detection branch, and, based on the first weight of the first detection branch, the second weight of the second detection branch, and the third weight of the third detection branch, performs weighted fusion processing on the first track occupancy detection results corresponding to the first detection branch, the second track occupancy detection results corresponding to the second detection branch, and the third track occupancy detection results corresponding to the third detection branch.
[0082] In this step, the track occupancy detection results obtained from different detection branches are weighted and fused to improve the reliability and accuracy of track occupancy detection.
[0083] Step S108: Based on the target track occupancy detection results, determine the track circuit shunt failure detection results.
[0084] Among them, the track circuit shunt failure detection result is used to characterize whether there is a track circuit shunt failure; in specific applications, the track circuit shunt failure detection result includes whether there is no track circuit shunt failure or whether there is a track circuit shunt failure.
[0085] Specifically, based on the target occupancy detection results of the tracks within the monitored sub-area, combined with the occupancy display of the tracks within the monitored sub-area on the console, the server determines whether there are any track circuit malfunctions in the tracks within the monitored sub-area, thereby obtaining the track circuit malfunction detection results for the tracks within the monitored sub-area.
[0086] In practical applications, if the target track occupancy detection result for the track within the monitored sub-area is that it is occupied, and the console does not display the occupancy or does not reliably display the occupancy, then the server determines that there is a problem with the track circuit shunt in the monitored sub-area.
[0087] In the aforementioned method for detecting faulty track circuit shunting, the server acquires a first image of the track when it is unoccupied and a second image of the track in real time. Through image processing, it obtains first, second, and third track occupancy detection results from the perspectives of changes in the second image compared to the first image, similarities between the two images, and target detection results in the second image. Based on the fusion processing of these multiple track occupancy detection results, it obtains the target track occupancy detection result, and thus the track circuit faulty detection result. This method, based on the above process, no longer relies on manual on-site inspection. Instead, it detects track circuit faulty circuits by processing the first image of the track when it is unoccupied and the second image of the track in real time, thus improving the detection efficiency.
[0088] In an exemplary embodiment, the first image includes a plurality of first pixels, and the second image includes a plurality of second pixels. The second image has the same resolution as the first image. Therefore, each second pixel in the second image has a corresponding first pixel in the first image, and the coordinates of the two corresponding pixels are the same in their respective images. For example, the first pixel in the first image (x... i y j ) and the second pixel in the second image (x) i y j )correspond.
[0089] Step S104 above, which determines the first track occupancy detection result based on the first matching information between the second image and the first image, specifically includes the following steps: for each second pixel, determine the classification result of the second pixel relative to the corresponding first pixel; based on the second pixel whose corresponding classification result is the second classification result, obtain the change region in the second image; take the intersection of the track region and the change region where the track is located in the second image to obtain the first intersection; if the first intersection is empty, determine that the first track occupancy detection result is unoccupied; if the first intersection is not empty, determine that the first track occupancy detection result is occupied.
[0090] The classification result of the second pixel relative to the corresponding first pixel is used to characterize whether the second pixel has changed compared to the corresponding first pixel. In specific applications, the classification result includes a first classification result and a second classification result. The first classification result is used to characterize whether the second pixel has changed compared to the corresponding first pixel. The second classification result is used to characterize whether the second pixel has changed compared to the corresponding first pixel.
[0091] The corresponding classification result is the change region composed of the second pixel of the second classification result.
[0092] Specifically, the server iterates through each second pixel in the second image under the monitored sub-region. For the second pixel being iterated, the server first determines the first pixel corresponding to the second pixel in each first pixel in the first image under the monitored sub-region. Then, based on the changes of the second pixel relative to the corresponding first pixel, the server classifies the second pixel to obtain the classification result of the second pixel relative to the corresponding first pixel.
[0093] Next, based on the second pixel of the second classification result, the server determines the area in the second image that has changed compared to the first image, thus obtaining the changed area. Then, the server obtains the area in the second image where the track is located within the monitoring sub-region, i.e., the track area, and takes the intersection of the track area and the changed area to obtain the first intersection. If the first intersection is empty, it means that the area in the second image that has changed compared to the first image does not overlap with the area where the track is located within the monitoring sub-region. Therefore, the server determines that the first track occupancy detection result of the track within the monitoring sub-region is unoccupied. If the first intersection is not empty, it means that the area in the second image that has changed compared to the first image overlaps with the area where the track is located within the monitoring sub-region. Therefore, the server determines that the first track occupancy detection result of the track within the monitoring sub-region is occupied.
[0094] In this embodiment, the server can determine whether the track in the monitoring sub-region is occupied based on the overlap between the area where the second image changes compared to the first image and the area where the track is located in the monitoring sub-region.
[0095] In an exemplary embodiment, the above steps, determining the classification result of the second pixel relative to the corresponding first pixel, specifically include the following steps: acquiring each sample image in the sample image library; for each sample image, determining the sample pixel corresponding to the second pixel in the sample image, and determining the grayscale distance between the second pixel and the sample pixel based on the grayscale value of the second pixel and the grayscale value of the sample pixel; counting the number of grayscale distances corresponding to the second pixel whose corresponding distance value is greater than a distance value threshold; if the number of distances is less than or equal to the number threshold, determining the classification result of the second pixel as the first classification result, and if the number of distances is greater than the number threshold, determining the classification result of the second pixel as the second classification result.
[0096] Each sample image is obtained based on data augmentation processing of the first image; in specific applications, each sample image includes the first image and a data-augmented image based on the first image.
[0097] Each sample image includes multiple sample pixels. The first image, the second image, and the sample images have the same resolution. Therefore, each first pixel in the first image has a corresponding sample pixel in each sample image. Similarly, since each second pixel in the second image has a corresponding first pixel in the first image, each second pixel in the second image also has a corresponding sample pixel in each sample image. The coordinates of these corresponding pixels are the same within their respective images. For example, the first pixel in the first image (x...)... i y j The second pixel in the second image (x) i y j ) and sample pixels (x) in the sample image i y j There are pairwise correspondences between them.
[0098] Specifically, the server obtains each sample image from the sample image library corresponding to the monitored sub-region; for each sample image, the server first determines the sample pixel corresponding to the second pixel being traversed among the sample pixels in the sample image, and then the server calculates the Euclidean distance between the second pixel and the corresponding sample pixel based on the grayscale values of the second pixel and the corresponding sample pixel, which is used as the grayscale distance between the second pixel and the corresponding sample pixel.
[0099] Next, the server counts the number of grayscale distances between the second pixel and each corresponding sample pixel whose corresponding distance value is greater than a preset distance value threshold. If the number of distances is less than or equal to the preset number threshold, the server determines the classification result of the second pixel as the first classification result, that is, the second pixel has not changed compared to the corresponding first pixel. If the number of distances is greater than the preset number threshold, the server determines the classification result of the second pixel as the second classification result, that is, the second pixel has changed compared to the corresponding first pixel.
[0100] In practical applications, the preset distance threshold is 30; the preset number threshold is 2.
[0101] In this embodiment, the server can detect whether the second pixel has changed compared to the corresponding first pixel based on each sample image obtained by enhancing the first image data.
[0102] In one exemplary embodiment, the sample images in the sample image library corresponding to the monitored sub-region are obtained in the following way:
[0103] First, the server acquires a first image of the monitored sub-region and, based on the resolution of this first image, constructs a preset number of blank images with the same resolution. The grayscale value of each pixel in each blank image is initialized to zero. Since the first image and the blank images have the same resolution, each first pixel in the first image has a corresponding pixel in each blank image, and the coordinates of the two corresponding pixels are the same in their respective images. For example, the first pixel in the first image (x...)... i y j ) and pixels in a blank image (x i y j (Corresponding to ) In specific applications, the number of blank images is 20.
[0104] Then, the server iterates through each first pixel in the first image. For the first pixel being iterated over, the server uses that first pixel as the center and determines each of the first neighboring pixels of that first pixel in the first image, such as the eight surrounding pixels, and designates both the first pixel and each of the first neighboring pixels as target pixels. Next, the server determines the grayscale value of the corresponding pixel in each blank image based on the grayscale value of each target pixel. For example, for each blank image, the server can randomly select the grayscale value of any target pixel as the grayscale value of the sample pixel corresponding to the first pixel in the blank sample image, or the server can randomly select the average of any number of grayscale values of target pixels as the grayscale value of the sample pixel corresponding to the first pixel in the blank sample image. Based on the above process, the server completes the grayscale value filling of each blank sample image, obtains each sample image, and then constructs a sample image library.
[0105] like Figure 2 The diagram shown illustrates the construction of the sample image library in this embodiment.
[0106] In an exemplary embodiment, after constructing the sample image library corresponding to the monitored sub-region, the method further includes the following steps: constructing a counting matrix and an image binarization matrix according to the resolution of the first image.
[0107] In this matrix, both the counting matrix and the image binarization matrix have the same dimension as the resolution of the first image. Therefore, each first pixel has a corresponding element in both the counting matrix and the image binarization matrix. The coordinates of the corresponding first pixel and element in their respective first images and matrices are the same. For example, the first pixel (x...) of the first image... i y j ) and the elements (x) in the counting matrix i y j Corresponding to the first pixel point (x) of the first image. i y j ) and the elements (x) in the image binarization matrix i y j )correspond.
[0108] In this system, the element values of each element in the counting matrix and the image binarization matrix are initialized to a first value. In practical applications, this first value is zero.
[0109] Specifically, after the server constructs the sample image library, it constructs two blank matrices with the same matrix dimension and resolution as the first image. The element values of each element in the two blank matrices are initialized to the first value. One blank matrix is used as a counting matrix, and the other blank matrix is used as an image binarization matrix.
[0110] In this embodiment, after determining the classification result of the second pixel as the first classification result when the number of distances is less than or equal to the number threshold, the following steps are further included: setting the element values of the target elements corresponding to the second pixel in the counting matrix and the image binarization matrix to the first value; updating the gray values of each sample pixel corresponding to the second pixel according to the preset update probability and the second pixel.
[0111] Wherein, the target element corresponding to the second pixel in the counting matrix and the image binarization matrix is the element corresponding to the first pixel in the counting matrix and the image binarization matrix.
[0112] Specifically, for each second pixel, if the classification result of the second pixel is the first classification result, that is, the second pixel has not changed compared to the corresponding first pixel, then the server updates the element value of the corresponding element of the first pixel in the counting matrix to the first value, and updates the element value of the corresponding element of the first pixel in the image binarization matrix to the first value; then, the server updates the gray values of each sample pixel corresponding to the second pixel according to the preset update probability and the second pixel. Optionally, the server uses the gray value of the second pixel as the gray value of at least one corresponding sample pixel, or the server updates the gray value of at least one corresponding sample pixel based on the second pixel and the gray values of each second adjacent pixel of the second pixel in the second image. The process is similar to the process of determining the gray values of each sample pixel in the sample image, and will not be described in detail here.
[0113] In practical applications, the preset update probability is 1 / 16.
[0114] In this embodiment, after determining the classification result of the second pixel as the second classification result when the number of distances is greater than the number threshold, the following steps are further included: setting the element value of the target element corresponding to the second pixel in the image binarization matrix to a second value, and increasing the element value of the target element corresponding to the second pixel in the counting matrix; if the element value of the target element corresponding to the second pixel in the counting matrix is greater than the value threshold after the increase, updating the grayscale value of each sample pixel corresponding to the second pixel based on the second pixel.
[0115] In practical applications, the second value is 255.
[0116] Specifically, for each second pixel, if the classification result of the second pixel is the second classification result, that is, the second pixel has changed compared to the corresponding first pixel, then the server updates the element value of the corresponding element of the first pixel in the image binarization matrix to the second value, and increments the element value of the corresponding element of the first pixel in the counting matrix by 1 to obtain the incremented element value of the corresponding element of the first pixel in the counting matrix; then, the server determines whether the incremented element value of the corresponding element of the first pixel in the counting matrix is greater than a preset value threshold. If it is greater, it means that the second pixel has been misclassified as the second classification result. Therefore, the server updates the grayscale value of each sample pixel corresponding to the second pixel based on the second pixel. The update process is the same as the update process when the classification result of the second pixel is the first classification result, and will not be described in detail here.
[0117] In practical applications, the preset numerical threshold is 50.
[0118] In this embodiment, the server can update the sample image library based on the updating and judgment of the counting matrix and the image binarization matrix, thereby ensuring the accuracy of the first detection branch.
[0119] In one exemplary embodiment, the number of first images is multiple; in specific applications, the multiple first images can be multiple first images from different monitoring sub-areas, or multiple first images from the same monitoring sub-area.
[0120] Step S104 above, which determines the second track occupancy detection result based on the second matching information between the second image and the first image, specifically includes the following steps: obtaining the second directional gradient features of the second image; for each first image, obtaining the correlation filter classification model corresponding to the first image, and determining the confidence response map of the second image corresponding to the first image based on the correlation filter classification model and the second directional gradient features; determining the maximum response value in each confidence response map corresponding to the second image; if the maximum response value is greater than or equal to the response value threshold, determining the second track occupancy detection result as unoccupied, and if the maximum response value is less than the response value threshold, determining the second track occupancy detection result as occupied.
[0121] Among them, the directional gradient features may include, but are not limited to, the HOG (Histogram of Oriented Gradients) feature or the FHOG (Fast HOG) feature of the gray value of the pixel.
[0122] The correlation filter classification model is a correlation filter classifier; each correlation filter classification model is trained based on the first-direction gradient features of the corresponding first image. In specific applications, the server extracts the first-direction gradient features of the first image under each monitored sub-region, and uses these first-direction gradient features to train the corresponding correlation filter classification model for that sub-region. In specific applications, when the trained correlation filter classifier processes an image, the classifier calculates a "matching score," or response value, for each pixel of the image. The two-dimensional matrix composed of these matching scores is the confidence response map of the image.
[0123] The confidence response map of the second image to the first image is used to characterize the similarity between the second image and the first image. The confidence response map of the second image to the first image includes multiple response values, each of which characterizes the similarity between a second pixel in the second image and its corresponding first pixel in the first image, i.e., the "matching score".
[0124] Specifically, the server extracts the second-direction gradient features of the second image under the monitored sub-region. Then, for each first image, the server obtains the correlation filter classification model corresponding to the first image. Based on the first-direction gradient features of the first image and the second-direction gradient features of the second image, the correlation filter classification model calculates the confidence response map of the second image corresponding to the first image. Then, the server determines the maximum response value among the response values in the confidence response maps of the second image corresponding to each first image. If the maximum response value is greater than or equal to a preset response value threshold, it indicates that the second image is relatively similar to at least one of the first images. Therefore, the server determines that the second track occupancy detection result of the track in the monitored sub-region is unoccupied. If the maximum response value is less than the preset response value threshold, it indicates that the second image is relatively dissimilar to all the first images. Therefore, the server determines that the second track occupancy detection result of the track in the monitored sub-region is occupied.
[0125] In practical applications, the preset response value threshold is 0.35.
[0126] In practical applications, if the second image of a track that is not actually occupied is determined to be occupied in the second detection branch, the server can use the second image as the newly added first image and update the corresponding correlation filter classification model.
[0127] In this embodiment, the server can determine whether the track in the monitored sub-area is occupied based on the similarity between the second image and the first image.
[0128] In an exemplary embodiment, step S104 above, which determines the third track occupancy detection result based on the target detection processing of the second image, specifically includes the following steps: performing target detection processing on the second image using a pre-trained target detection model; determining the train region in the second image where the train is located if the target detection processing determines that a train exists in the second image; taking the intersection of the track region and the train region in the second image to obtain a second intersection; determining that the third track occupancy detection result is unoccupied if the second intersection is empty, and determining that the third track occupancy detection result is occupied if the second intersection is not empty.
[0129] The object detection model is trained based on the YOLOv5 algorithm. In specific applications, the object detection model mainly includes a feature extraction module (Backbone), a feature fusion module (Neck), and a target prediction module (Head). The feature extraction module (Backbone) uses basic structures such as Conv (Convolutional), CSP (Cross Stage Partial), and SPPF (Spatial Pyramid Pooling – Fast) to extract features from the input image. Conv is used to downsample the input layer, CSP is used to extract and fuse features from the input to enrich the semantic information of the features, and SPP uses pooling and feature fusion to enrich the semantic information of the features, so that the deepest feature map has more semantic information. The feature fusion module (Neck) fuses the features of the three scales of object detection, so that the feature map contains rich semantic information while increasing the accurate location information of the object. The target prediction module (Head) judges the processed feature map and outputs the location and confidence of the target.
[0130] The targets to be detected in the target detection processing include at least the front, rear, and carriage of the vehicle.
[0131] Specifically, the server uses a pre-trained object detection model to perform object detection processing on the second image under the monitored sub-region to detect whether there is a train's front, rear, or carriage in the second image. If at least one of these three elements is present in the second image, the server determines that a train exists in the second image. If a train is found in the second image, the server determines the region where the train is located in the second image based on the bounding box output by the object detection model, thus obtaining the train region. Then, the server obtains the region where the track within the monitored sub-region is located in the second image, i.e., the track region, and takes the intersection of the track region and the train region to obtain the second intersection. If the second intersection is empty, it means that the train in the second image does not overlap with the track within the monitored sub-region, so the server determines that the third track occupancy detection result for the track within the monitored sub-region is unoccupied. If the second intersection is not empty, it means that the train in the second image overlaps with the track within the monitored sub-region, so the server determines that the third track occupancy detection result for the track within the monitored sub-region is occupied.
[0132] In this embodiment, the server can determine whether the track in the monitored sub-region is occupied based on the target detection processing of the second image.
[0133] In an exemplary embodiment, the track region located in the second image within the monitored sub-region is determined by the following method: for each monitored sub-region, a first image and a second image under the monitored sub-region are obtained; a first track region marked in the first image is obtained; and a second track region in the second image is determined based on the pixel correspondence between the first image and the second image.
[0134] In an exemplary embodiment, the track region located in the second image within the monitored sub-region can also be determined by the following method: For each monitored sub-region, a first image and a second image under that monitored sub-region are obtained; the first SURF feature of the first image under that monitored sub-region and the second SURF feature of the second image under that monitored sub-region are calculated using the SURF (Speeded Up Robust Features) algorithm. In specific applications, the SURF features include at least feature points and feature vectors; the first SURF feature and the second SURF feature are matched to calculate the transformation matrix between the first image and the second image; the first track region is transformed based on the transformation matrix to obtain the transformed first track region; based on the transformed first track region and the pixel correspondence between the first image and the second image, the second track region in the second image is determined.
[0135] To more clearly illustrate the method for detecting faulty track circuit shunting provided in this application, a specific embodiment is given below for detailed description. However, it should be understood that the embodiments of this application are not limited thereto. Figure 3 As shown, in one exemplary embodiment, this application also provides a method for monitoring track occupancy due to poor shunting, specifically including the following steps:
[0136] Step S302: Acquire a first image of the track when it is not occupied and a real-time second image using a gimbal camera.
[0137] Following step S302, the process includes a first detection branch consisting of steps S304 to S306, a second detection branch consisting of steps S308 to S310, and a third detection branch consisting of steps S312 to S314.
[0138] Step S304: Determine the changed region in the second image compared to the first image, and take the intersection of the track region and the changed region in the second image to obtain the first intersection.
[0139] Step S306: If the first intersection is empty, determine that the first track occupancy detection result is not occupied; if the first intersection is not empty, determine that the first track occupancy detection result is occupied.
[0140] Step S308: Obtain the second-direction gradient features of the second image, and determine the confidence response map of the second image for each first image based on the correlation filter classification model and the second-direction gradient features corresponding to each first image.
[0141] Step S310: Determine the maximum response value in each confidence response map corresponding to the second image. If the maximum response value is greater than or equal to the response value threshold, determine that the second track occupancy detection result is unoccupied. If the maximum response value is less than the response value threshold, determine that the second track occupancy detection result is occupied.
[0142] Step S312: Using the pre-trained target detection model, determine the train region in the second image, and take the intersection of the track region and the train region in the second image to obtain the second intersection.
[0143] Step S314: If the second intersection is empty, determine that the third track occupancy detection result is not occupied; if the second intersection is not empty, determine that the third track occupancy detection result is occupied.
[0144] Following the first detection branch, the second detection branch, and the third detection branch, the following step S316 is also included.
[0145] Step S316: The first track occupancy detection result, the second track occupancy detection result, and the third track occupancy detection result are fused to obtain the target track occupancy detection result. Based on the target track occupancy detection result, the track circuit shunt failure detection result is determined.
[0146] This embodiment also includes the following: when it is determined that there is a faulty track circuit shunt, a corresponding warning message is sent to the dispatch control console in the station.
[0147] This embodiment provides a method for monitoring track occupancy issues in a branch line. Multiple pan-tilt cameras installed within the station acquire real-time track occupancy data for several key areas. The method then comprehensively evaluates track occupancy using various detection algorithm models, thereby increasing the reliability and accuracy of the detection results. Upon detecting unauthorized track occupancy, the method promptly sends corresponding warning information to the station's dispatch control console. This effectively avoids the risk of train track occupancy not being properly displayed due to abnormal track circuits within the station, and significantly improves the safety and intelligent management level of intermediate stations on heavy-haul railways.
[0148] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.
[0149] Based on the same inventive concept, this application also provides a track circuit shunt failure detection device for implementing the above-described track circuit shunt failure detection method. The solution provided by this device is similar to the implementation described in the above method; therefore, the specific limitations in one or more track circuit shunt failure detection device embodiments provided below can be found in the limitations of the track circuit shunt failure detection method described above, and will not be repeated here.
[0150] In one exemplary embodiment, such as Figure 4As shown, a detection device for faulty circuit shunting in track circuits is provided, comprising: a track image acquisition module 402, a track occupancy detection module 404, an occupancy result fusion module 406, and a faulty circuit detection module 408, wherein:
[0151] The track image acquisition module 402 is used to acquire a first image and a second image of the track; the first image is an image of the track when it is not occupied, and the second image is a real-time image of the track.
[0152] The track occupancy detection module 404 is used to determine a first track occupancy detection result based on a first matching information between a second image and a first image, to determine a second track occupancy detection result based on a second matching information between the second image and the first image, and to determine a third track occupancy detection result based on target detection processing of the second image; the first matching information is used to characterize the changes in the second image compared to the first image, and the second matching information is used to characterize the similarity between the second image and the first image.
[0153] The occupancy result fusion module 406 is used to fuse the first track occupancy detection result, the second track occupancy detection result, and the third track occupancy detection result to obtain the target track occupancy detection result.
[0154] The circuit malfunction detection module 408 is used to determine the circuit malfunction detection result of the track circuit based on the target track occupancy detection result.
[0155] In one exemplary embodiment, each second pixel in the second image has a corresponding first pixel in the first image.
[0156] The track occupancy detection module 404 is further configured to, for each second pixel, determine the classification result of the second pixel relative to the corresponding first pixel; the classification result includes a first classification result and a second classification result, the first classification result being used to characterize that the second pixel has not changed relative to the corresponding first pixel; the second classification result being used to characterize that the second pixel has changed relative to the corresponding first pixel; based on the second pixel whose corresponding classification result is the second classification result, the changed region in the second image is obtained; the intersection of the track region and the changed region in the second image is taken to obtain the first intersection; if the first intersection is empty, the first track occupancy detection result is determined to be unoccupied, and if the first intersection is not empty, the first track occupancy detection result is determined to be occupied.
[0157] In an exemplary embodiment, the track occupancy detection module 404 is further configured to acquire each sample image in the sample image library; each sample image is obtained based on data enhancement processing of the first image; for each sample image, the sample pixel corresponding to the second pixel is determined in the sample image, and the grayscale distance between the second pixel and the sample pixel is determined according to the grayscale value of the second pixel and the grayscale value of the sample pixel; the number of grayscale distances corresponding to the second pixel with a distance value greater than a distance value threshold is counted; if the number of distances is less than or equal to the number threshold, the classification result of the second pixel is determined as the first classification result, and if the number of distances is greater than the number threshold, the classification result of the second pixel is determined as the second classification result.
[0158] In an exemplary embodiment, the detection device for faulty track circuit shunting further includes a matrix construction module for constructing a counting matrix and an image binarization matrix based on the resolution of the first image; each first pixel has a corresponding element in the counting matrix and the image binarization matrix; the element values of each element in the counting matrix and the image binarization matrix are initialized to a first value.
[0159] The track occupancy detection module 404 is further configured to set the element value of the target element corresponding to the second pixel in the counting matrix and the image binarization matrix to the first value; the target element corresponding to the second pixel in the counting matrix and the image binarization matrix is the element corresponding to the first pixel in the counting matrix and the image binarization matrix; and update the gray value of each sample pixel corresponding to the second pixel according to the preset update probability and the second pixel.
[0160] The track occupancy detection module 404 is also used to set the element value of the target element corresponding to the second pixel in the image binarization matrix to a second value, and increase the element value of the target element corresponding to the second pixel in the counting matrix; if the element value of the target element corresponding to the second pixel in the counting matrix is greater than the numerical threshold after the increase, the gray value of each sample pixel corresponding to the second pixel is updated according to the second pixel.
[0161] In one exemplary embodiment, the number of first images is multiple.
[0162] The track occupancy detection module 404 is also used to acquire the second direction gradient features of the second image; for each first image, acquire the correlation filter classification model corresponding to the first image, and determine the confidence response map of the second image corresponding to the first image based on the correlation filter classification model and the second direction gradient features; each correlation filter classification model is trained based on the first direction gradient features of the corresponding first image; the confidence response map of the second image corresponding to the first image is used to characterize the similarity between the second image and the first image; determine the maximum response value in each confidence response map corresponding to the second image; if the maximum response value is greater than or equal to the response value threshold, determine that the second track occupancy detection result is unoccupied, and if the maximum response value is less than the response value threshold, determine that the second track occupancy detection result is occupied.
[0163] In an exemplary embodiment, the track occupancy detection module 404 is further configured to perform target detection processing on the second image using a pre-trained target detection model; if the target detection processing determines that a train exists in the second image, determine the train region in the second image where the train is located; take the intersection of the track region and the train region in the second image to obtain a second intersection; if the second intersection is empty, determine that the third track occupancy detection result is unoccupied; if the second intersection is not empty, determine that the third track occupancy detection result is occupied.
[0164] Each module in the aforementioned track circuit malfunction detection device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the corresponding operations of each module.
[0165] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 5As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores image data of the track. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When executed by the processor, the computer program implements a method for detecting faulty track circuit shunts.
[0166] Those skilled in the art will understand that Figure 5 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0167] In one exemplary embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0168] In one exemplary embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above-described method embodiments.
[0169] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.
[0170] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0171] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0172] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for detecting faulty shunt circuits in a track circuit, characterized in that, The method includes: Acquire a first image and a second image of the track; the first image is an image of the track when it is not occupied, and the second image is a real-time image of the track; Based on the first matching information between the second image and the first image, a first track occupancy detection result is determined for the track; based on the second matching information between the second image and the first image, a second track occupancy detection result is determined for the track; and based on target detection processing of the second image, a third track occupancy detection result is determined for the track. The first matching information is used to characterize the changes in the second image compared to the first image, and the second matching information is used to characterize the similarity between the second image and the first image. The first track occupancy detection result, the second track occupancy detection result, and the third track occupancy detection result are fused together to obtain the target track occupancy detection result of the track. Based on the target track occupancy detection results, the track circuit shunt failure detection results for the track are determined.
2. The method according to claim 1, characterized in that, Each second pixel in the second image has a corresponding first pixel in the first image; The step of determining the first track occupancy detection result of the track based on the first matching information between the second image and the first image includes: For each second pixel, a classification result is determined relative to the corresponding first pixel; the classification result includes a first classification result and a second classification result, wherein the first classification result is used to characterize that the second pixel has not changed relative to the corresponding first pixel; and the second classification result is used to characterize that the second pixel has changed relative to the corresponding first pixel. Based on the second pixel point whose corresponding classification result is the second classification result, the changed region in the second image is obtained; The first intersection is obtained by taking the intersection of the orbit region where the orbit is located in the second image and the change region; If the first intersection is empty, the first track occupancy detection result is determined to be unoccupied; if the first intersection is not empty, the first track occupancy detection result is determined to be occupied.
3. The method according to claim 2, characterized in that, Determining the classification result of the second pixel relative to the corresponding first pixel includes: Obtain each sample image from the sample image library; each sample image is obtained based on data augmentation processing of the first image; For each of the sample images, a sample pixel corresponding to the second pixel is determined in the sample image, and the grayscale distance between the second pixel and the sample pixel is determined based on the grayscale value of the second pixel and the grayscale value of the sample pixel. Count the number of grayscale distances corresponding to the second pixel whose distance values are greater than the distance value threshold. If the number of distances is less than or equal to a threshold, the classification result of the second pixel is determined to be the first classification result; if the number of distances is greater than the threshold, the classification result of the second pixel is determined to be the second classification result.
4. The method according to claim 3, characterized in that, The method further includes: Based on the resolution of the first image, a counting matrix and an image binarization matrix are constructed; each first pixel has a corresponding element in the counting matrix and the image binarization matrix; the element values of each element in the counting matrix and the image binarization matrix are initialized to a first value; When the number of distances is less than or equal to a threshold, after determining that the classification result of the second pixel is the first classification result, the method further includes: The element values of the target elements corresponding to the second pixel in the counting matrix and the image binarization matrix are all set to the first value; the target elements corresponding to the second pixel in the counting matrix and the image binarization matrix are the elements corresponding to the first pixel in the counting matrix and the image binarization matrix. According to the preset update probability and the second pixel, update the grayscale value of each sample pixel corresponding to the second pixel; After determining the classification result of the second pixel as the second classification result when the number of distances is greater than the number threshold, the method further includes: Set the element value of the target element corresponding to the second pixel in the image binarization matrix to the second value, and increase the element value of the target element corresponding to the second pixel in the counting matrix; If the value of the target element corresponding to the second pixel in the counting matrix is greater than the numerical threshold after the increase, the grayscale value of each sample pixel corresponding to the second pixel is updated according to the second pixel.
5. The method according to claim 1, characterized in that, The number of the first images is multiple; The determination of the second track occupancy detection result based on the second matching information between the second image and the first image includes: Obtain the second-direction gradient features of the second image; For each of the first images, a correlation filter classification model corresponding to the first image is obtained. Based on the correlation filter classification model and the second directional gradient feature, a confidence response map of the second image corresponding to the first image is determined. Each correlation filter classification model is trained based on the first directional gradient feature of the corresponding first image. The confidence response map of the second image corresponding to the first image is used to characterize the similarity between the second image and the first image. Determine the maximum response value in each of the confidence response graphs corresponding to the second image; If the maximum response value is greater than or equal to the response value threshold, the second track occupancy detection result is determined to be unoccupied; if the maximum response value is less than the response value threshold, the second track occupancy detection result is determined to be occupied.
6. The method according to claim 1, characterized in that, The step of determining the third track occupancy detection result of the track based on the target detection processing of the second image includes: The target detection model obtained through pre-training is used to perform target detection processing on the second image. If the target detection processing determines that there is a train in the second image, the train region in the second image is determined. The intersection of the track region and the train region in the second image is obtained to form a second intersection. If the second intersection is empty, the third track occupancy detection result is determined to be unoccupied; if the second intersection is not empty, the third track occupancy detection result is determined to be occupied.
7. A detection device for faulty track circuit shunts, characterized in that, The device includes: The track image acquisition module is used to acquire a first image and a second image of the track; the first image is an image of the track when it is not occupied, and the second image is a real-time image of the track; The track occupancy detection module is used to determine a first track occupancy detection result of the track based on a first matching information between the second image and the first image, to determine a second track occupancy detection result of the track based on a second matching information between the second image and the first image, and to determine a third track occupancy detection result of the track based on target detection processing of the second image; the first matching information is used to characterize the changes in the second image compared to the first image, and the second matching information is used to characterize the similarity between the second image and the first image; The occupancy result fusion module is used to fuse the first track occupancy detection result, the second track occupancy detection result and the third track occupancy detection result to obtain the target track occupancy detection result of the track. The circuit malfunction detection module is used to determine the circuit malfunction detection result of the track circuit based on the target track occupancy detection result.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.