A non-contact contact line geometry parameter measurement algorithm based on a monocular camera
By using a non-contact contact line geometry parameter measurement algorithm based on a monocular camera, combined with automatic exposure adjustment and bright spot tracking, the problem of inconsistent performance of contact line detection algorithms under different lighting conditions has been solved. This has enabled high-precision, real-time measurement of contact line geometry parameters, improving detection speed and equipment utilization.
Patent Information
- Application Number
- CN202211598804.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2022-11-21
- Filing Date
- 2022-12-12
- Publication Date
- 2026-01-30
- Estimated Expiration
- 2042-12-12
AI Technical Summary
Existing contact wire geometry parameter detection algorithms have inconsistent detection results under different lighting conditions, lack intelligent equipment start-up and shutdown, cannot monitor contact wire replacement in real time, have slow calculation speed, and increase system load.
A non-contact contact line geometry parameter measurement algorithm based on a monocular camera is adopted, combined with industrial cameras, inertial navigation and infrared laser equipment, to realize automatic exposure adjustment, bright spot tracking and line change detection. The inertial navigation signal is used to intelligently control the equipment, reduce program load and improve detection speed.
It achieves high-precision, real-time detection under different lighting conditions, accurately records data during train track changing, reduces system load, and improves detection speed and equipment utilization.
Smart Images

Figure CN116182713B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of rail transit detection technology, and particularly relates to a non-contact contact line geometric parameter measurement algorithm based on a monocular camera. BACKGROUND
[0002] As one of important equipment of electrified railway traction power supply system, the contact network provides power for high-speed trains running on the line. However, due to its non-redundancy and exposure to the outside world, it is easy to fail, and it is the most likely link to fail in the power supply system. Once the contact network fails, it will cause the interruption of railway operation and even major safety accidents. The daily detection of contact network geometric parameters is an important part of the detection of contact network operation state, and keeping the contact network geometric parameters within a reasonable range is the premise of ensuring good pantograph-catenary relationship and high-speed train operation.
[0003] The existing contact line geometric parameter detection schemes include static detection, contact detection and non-contact detection. The static detection scheme is difficult to measure in real time. The contact detection scheme has simple design principle, but the later maintenance cost is high. In the non-contact detection scheme, the image measurement method has low equipment cost and can realize all-weather real-time monitoring, but the detection accuracy and speed depend on the specific implementation of the detection algorithm.
[0004] The detection algorithm used in the industry has several problems in function implementation and detection accuracy. First, the detection algorithm is difficult to adapt to different light environments, and the detection effect of the detection equipment in the tunnel section and the outdoor section is quite different, which leads to the fact that only the data obtained under certain light conditions is usable. Second, the time node for controlling the start and stop of the detection equipment is not intelligent enough, and manual start of the equipment is required for detection, which greatly reduces the utilization rate of the equipment and cannot record and detect data at the first time of train start. Third, the detection algorithm cannot monitor the geometric parameters of multiple contact lines at the same time during the train running process, which will lead to invalid data in the line changing section. Fourth, the detection of the contact line is usually based on the analysis of the whole picture captured by the camera, and the calculation speed is relatively slow. At this time, if the resolution and frame rate of the camera are high, the calculation speed may be less than the camera image grabbing speed, which not only causes calculation delay, but also increases the system load and causes more heat. To solve the above problems, a non-contact contact line geometric parameter measurement algorithm based on a monocular camera is developed. SUMMARY
[0005] The purpose of the present application is to provide a monocular camera-based non-contact contact line geometric parameter measurement algorithm monitoring system to solve the problem that if the resolution and frame rate of the camera are both high, the calculation speed may be less than the camera snapshot speed, not only causing calculation delay, but also increasing the load of the system, causing more heat.
[0006] To achieve the above purpose, the present application provides the following technical solution: a monocular camera-based non-contact contact line geometric parameter measurement algorithm, comprising:
[0007] S1: Detect the equipment operation equipment and load the configuration file, the configuration file information including camera configuration information, camera calibration information, inertial navigation configuration information and algorithm parameters, send execution commands to the execution device end according to the detection device data, the execution device including a detection vehicle, a camera and an infrared laser device;
[0008] S2: During normal operation of the execution device, the camera in the execution device takes pictures at a certain frequency and returns the pictures;
[0009] S3: The collected camera return pictures are automatically exposed and adjusted, and then the pictures are preprocessed, the preprocessing including gray scale conversion, image rotation and image format conversion, to obtain first detection picture data;
[0010] S4: The first detection picture data is automatically exposed and adjusted by the preset brightness detection area to obtain second detection picture data;
[0011] S5: Detect the laser bright spot of the second detection picture data, if the detected brightness is within the preset threshold, it is judged that the laser is irradiated on the contact line to form a bright spot, the center pixel coordinates of the bright spot are obtained, the conversion matrix obtained by camera calibration is used to convert the image coordinates of the bright spot into actual physical coordinates, and finally the pull-out value and the height value are obtained;
[0012] S6: After detecting the bright spot for the first time, the detection is no longer performed on the whole detection area, but a smaller tracking frame is set as the detection area, and only the bright spot detection is performed in the tracking frame area, the position of the tracking frame is dynamically updated according to the position of the bright spot detected in the last frame, according to the jump detection logic, for the bright spot jump within 3 frames, the algorithm will maintain the original tracking frame, if the bright spot is detected again in the tracking frame at this time, the subsequent algorithm is continued to be executed, if the bright spot is not detected after 3 frames, the detection area of the current height is returned to detect the bright spot;
[0013] S7: The line change state of the two groups of contact wires can be accurately detected during the line change process of the overhead contact line, line change monitoring areas are arranged on both sides of the tracking frame, and a bright spot detection algorithm is executed in the line change detection area, if the laser bright spot of the other contact wire is detected in the line change monitoring area, the program will enter the line change mode, and the two groups of contact wires are tracked to obtain the line change result;
[0014] S8: The detected pull-out gauge value and alarm information during the program running are stored in the MySQL database in chronological order, and the time sequence and spatial graph of the pull-out gauge value are drawn using Matplotlib.
[0015] Preferably, the execution equipment normally operates by the camera in the execution equipment to shoot and return pictures at a certain frequency, including;
[0016] The program uses a json format file to save the corresponding configuration information, judges the running state of the train according to the inertial navigation information, starts all hardware devices when the train is detected to start, reserves 30 to 60 seconds of starting time for the hardware devices, then loads the json configuration parameters, initializes the control modules of the camera, inertial navigation and infrared laser devices, and checks whether the devices are normally operated, detects no error, and shoots and returns pictures at a certain frequency;
[0017] When the train is detected to have no speed temporarily, the devices are not immediately turned off, but continue to operate to avoid stopping the algorithm detection due to the stop of the train at the station;
[0018] If the train is detected to have no speed signal for a long time, the algorithm program will be automatically turned off, all called devices will be turned off, and the power supply of the devices will be cut off.
[0019] The monocular camera-based non-contact contact wire geometric parameter measurement algorithm according to claim 1, characterized in that the collected camera return pictures are automatically exposed and adjusted, and then the pictures are preprocessed, the preprocessing includes gray image conversion, image rotation and image format conversion, and first detection picture data is obtained, including;
[0020] After the program is started, the image is first preprocessed, including image rotation, image format conversion and the like, since the color information of the picture is not required by the detection algorithm, the image is first converted into a gray image for subsequent processing, the image rotation adopts an affine transformation scheme, a 3*3 transformation matrix is created according to the angle of rotation, and the original image is multiplied to obtain the rotated image.
[0021] Preferably, the preset brightness detection area is automatically adjusted for exposure of the first detection picture data to obtain second detection picture data, including:
[0022] A preset brightness detection area is set, and brightness values of the area in the returned picture are analyzed in real time to determine whether the current ambient brightness is in a reasonable range, and the average value of the pixel brightness in the detection area is calculated, if the average value exceeds the threshold range, the algorithm will call the exposure adjustment interface of the camera, and dynamically adjust the exposure value of the camera according to the preset gear of the algorithm, because there is a certain delay in adjusting the exposure of the camera, the algorithm will reserve 3 frames of image time for exposure adjustment, and then detect the brightness value again, if the brightness has not reached the reasonable range, continue to adjust until the brightness reaches the reasonable threshold.
[0023] Preferably, the laser bright spot of the second to-be-detected picture data is detected, and if the detected brightness is within a preset threshold, the bright spot is judged as a bright spot formed by laser irradiation on the contact line, the center pixel coordinates of the bright spot are obtained, the conversion matrix obtained by camera calibration is used to convert the image coordinates of the bright spot into actual physical coordinates, and finally the pull-out value and the height value are obtained.
[0024] The bright spot detection first needs to perform image binarization on the detection area, adopt the OTSU method to adaptively select a binarization threshold, can adapt to different light conditions, and then scan each pixel point from the bottom of the detection area upwards, if a pixel point with a brightness equal to 255 is found and the width of the bright spot is greater than 3 pixels, the bright spot is judged as a bright spot formed by laser irradiation on the contact line, and the center pixel coordinates of the bright spot are obtained.
[0025] Compared with the prior art, the beneficial effects of the present application are as follows: based on the defects of the current detection algorithm, the present application proposes a non-contact contact line geometric measurement method based on a monocular camera, which uses an industrial camera, an inertial navigation system and an infrared laser device, combines camera calibration and image processing algorithms, realizes an automatic exposure algorithm to adapt to detection requirements in different light environments, uses inertial navigation signals, intelligently turns on and off the detection device according to the start and stop of the train, realizes a line changing detection algorithm, can effectively record the line changing data, realizes a bright spot tracking algorithm, can greatly improve the detection speed and reduce the program load, and the above innovations in the algorithm can complete high-precision, real-time and automatic measurement of the contact line pull-out value and the height value, and further provide reliable support for rail transit operation and maintenance. BRIEF DESCRIPTION OF DRAWINGS
[0026] Figure 1 The present application is a contact line geometric parameter detection algorithm flowchart.
[0027] Figure 2 The present application is a contact line geometric parameter detection method step schematic diagram. DETAILED DESCRIPTION
[0028] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0029] The present invention provides a technical solution that will be further illustrated below with reference to the accompanying drawings and specific embodiments.
[0030] See Figure 1 This patent provides an algorithm for detecting the geometric parameters of contact wires in rail transit systems. It records the detected pull-out and guide height values in a database for subsequent analysis and visualization. For cases where the pull-out and guide height values are missing or exceed a threshold, an alarm is recorded, and relevant images and alarm data are stored for later analysis.
[0031] The algorithm in this patent primarily uses C++ as its programming language. It combines open-source code libraries such as OpenCV, ODBC, and Matplotlib to analyze and process image data transmitted from camera devices. The algorithm calculates the geometric parameters of the contact wire by identifying the light spots generated when infrared lasers illuminate the contact wire during train travel.
[0032] The specific implementation process of the above algorithm is as follows:
[0033] 1. Program and equipment control
[0034] The program uses a JSON file to store relevant configuration information, including camera configuration, camera calibration, inertial navigation system (INS) configuration, and related algorithm parameters. The program determines the train's running status based on the INS information. When the train starts, the program prioritizes activating all hardware devices, allowing 30 to 60 seconds for startup. It then loads the JSON configuration parameters, initializes the control modules for the camera, INS, and infrared laser equipment, and checks if the devices are functioning correctly. If all checks are successful, the program takes and transmits images at a certain frequency. When the program detects a temporary lack of train speed, it does not immediately shut down the equipment but continues processing to prevent the algorithm from stopping due to the train's stops. If the program detects a prolonged period without a train speed signal, it automatically shuts down the algorithm, closes all called devices, and cuts off the power to the devices.
[0035] 2. Image preprocessing
[0036] After the program starts, a series of preprocessing operations will be performed on the image, including image rotation, image format conversion, etc. Since the detection algorithm does not require color information of the image, in order to improve the processing speed, the image will be converted to a grayscale image for subsequent processing, which can theoretically improve the processing speed by 2 times. The image rotation uses an affine transformation scheme. According to the angle of rotation, a 3*3 transformation matrix is created and multiplied by the original image to obtain the rotated image. Compared with the traditional image rotation scheme, the processing speed is faster.
[0037] 3. Automatic exposure adjustment
[0038] To ensure that the camera can capture the light spot of the infrared laser irradiated on the catenary under various brightness conditions, the algorithm realizes the function of automatic exposure adjustment of the camera. The algorithm parameters will preset a brightness detection area, and the brightness value of this area in the returned picture will be analyzed in real time to determine whether the current environment brightness is in a reasonable range. The specific implementation is as follows: calculate the average value of the pixel brightness in the detection area. If the average value exceeds the threshold range, the algorithm will call the exposure adjustment interface of the camera and dynamically adjust the exposure value of the camera according to the gear preset by the algorithm. Since there is a certain delay in adjusting the exposure of the camera, the algorithm will reserve 3 frames of images for exposure adjustment, and then detect the brightness value again. If the brightness has not reached the reasonable range, continue to adjust until the brightness reaches the reasonable threshold. In this way, the detection device can realize all-weather catenary detection, and at the same time, it can quickly adjust the exposure at the junction of the tunnel section and the outdoor section, and improve the imaging quality of the camera.
[0039] 4. Detection of laser bright spot
[0040] Bright spot detection first needs to perform image binarization on the detection area. OTSU method is used to maximize the variance between A and B in the image to adaptively select the binarization threshold k, and to adapt to different lighting conditions. The OTSU method calculation formula is as follows:
[0041]
[0042] Where:
[0043] m G is the gray value of the entire image
[0044] m is the cumulative average value of the gray level k
[0045] p A (k) is the probability of the pixel being assigned to A when the threshold is k
[0046] Then from the bottom of the detection area, each pixel point is scanned row by row upwards, if a pixel point with brightness equal to 255 is found and the width of the bright spot is greater than 3 pixels, it is judged that the bright spot formed by the laser irradiation on the contact line, and the center pixel coordinates of the bright spot are obtained. In order to convert the bright spot coordinates in the image into actual physical coordinates, it is necessary to find the mapping relationship between the physical space plane and the pixel plane. Here, the perspective change algorithm is adopted. Since the contact line detection plane and the camera target surface are relatively fixed, the transformation matrix M can be calculated in advance by camera calibration. The general transformation formula is as follows:
[0047]
[0048] Wherein:
[0049] [x y z] is the two-dimensional homogeneous coordinates of the contact line detection plane, is the corresponding two-dimensional plane coordinates
[0050] [u v w] is the two-dimensional homogeneous coordinates of the pixel plane, is the corresponding two-dimensional plane coordinates
[0051] is the transformation matrix M, for linear transformation, [a 31 a 32 ] for translation, for perspective change
[0052] Four sets of corresponding coordinates of physical plane and pixel plane are provided. The simultaneous equations can be solved to obtain the transformation matrix M. Finally, the transformation matrix M and the pixel coordinates are subjected to matrix operation according to the transformation formula, the pixel coordinates of the bright spot are converted into actual physical coordinates, and the pull-out value and the lead height value are finally obtained.
[0053] 5. Laser bright spot tracking
[0054] In order to improve the algorithm calculation speed and reduce the program load, the algorithm divides different height detection areas in the whole image according to the preset configuration parameters, which meets the detection requirements of different height catenary in outdoor, tunnel, garage and other places, avoids the speed loss caused by identifying the whole image, and avoids the foreign matter interference to a certain extent. In order to further improve the calculation efficiency, the algorithm no longer detects the whole detection area after detecting the bright spot for the first time, but sets a smaller tracking frame as the detection area, and only detects the bright spot in the tracking frame area in the future. The position of the tracking frame is dynamically updated according to the position of the bright spot detected in the last frame. In order to prevent the catenary bright spot from being temporarily blocked by other objects or equipment during the train running, causing the loss of bright spot or bright spot jump during tracking, the jump detection logic is introduced. For the bright spot jump within 3 frames, the algorithm will maintain the original tracking frame. If the bright spot is detected again in the tracking frame at this time, the subsequent algorithm will be executed. If the bright spot is not detected after 3 frames, the bright spot detection will be carried out in the detection area of the current height.
[0055] 6. Line change monitoring
[0056] In order to accurately detect the line change state of the two groups of contact wires during the line change of the catenary, line change monitoring areas are set on both sides of the tracking frame. The bright spot detection algorithm in step 4 is executed in the line change detection area. If the laser bright spot of the other contact wire is detected in the line change monitoring area, the program will enter the line change mode. During the train line change process, the contact wire being switched will gradually approach the pantograph, and the other contact wire will gradually move away from the pantograph. According to this characteristic, the bright spot detection algorithm in step 4 is executed in the line change monitoring area respectively, and the guide height value calculated is used to judge the height difference of the two groups of contact wires being tracked at the same time. When the height difference reaches a certain threshold, it is determined that the line change is completed.
[0057] 7. Data storage and visualization
[0058] The detected pull-out guide height value and alarm information during the program running are stored in the MySQL database in chronological order, and the time sequence and space diagram of the pull-out guide height value are drawn by using Matplotlib.
[0059] The technical scheme of the present application uses the principle that, based on the defects of the current detection algorithm, the patent proposes a non-contact geometric measurement method of the contact line based on a monocular camera, uses an industrial camera, inertial navigation and infrared laser equipment, combines camera calibration and image processing algorithms, realizes an automatic exposure algorithm to adapt to the detection needs in different light environments, uses inertial navigation signals, intelligently starts and stops the detection equipment according to the start and stop of the train, realizes a line changing detection algorithm, can effectively record the line changing data, realizes a bright spot tracking algorithm, can greatly improve the detection speed and reduce the program load, and in combination with the above algorithm innovation, can complete the measurement of the high-precision, real-time and automatic contact line pull-out value and guide height value, and further provide reliable support for rail transit operation and maintenance.
[0060] Although embodiments of the present application have been shown and described, it is to be understood that various modifications, substitutions, replacements and changes can be made to these embodiments without departing from the principles and spirit of the present application, and the scope of the present application is defined by the appended claims and their equivalents.
Claims
1. A monocular camera-based non-contact contact line geometric parameter measurement method, characterized in that: Comprise: S1: detect equipment running equipment and load configuration file, the configuration file information includes camera configuration information, camera calibration information, inertial navigation configuration information and algorithm parameters, according to the detection equipment data to the execution equipment end sends execution command, the execution equipment includes detection car, camera and infrared laser equipment; S2: during normal operation of the execution equipment, the camera in the execution equipment shoots and returns pictures at a certain frequency; S3: the collected camera return pictures are automatically exposed and adjusted, and then the pictures are pretreated, including gray scale conversion, image rotation and image format conversion, to obtain first detection picture data; S4: the preset brightness detection area is automatically exposed and adjusted to obtain second detection picture data; S5: detect the laser bright spot of the second detection picture data, if the detected brightness is within the preset threshold, it is judged that the bright spot formed by the laser irradiation on the contact line, the center pixel coordinates of the bright spot are obtained, the conversion matrix obtained by camera calibration is used to convert the image coordinates of the bright spot into actual physical coordinates, and finally the pull-out value and the height value are obtained; S6: after detecting the bright spot for the first time, the detection area is no longer detected, but a smaller tracking box is set as the detection area, and only the bright spot detection is performed in the tracking box area. The position of the tracking box is dynamically updated according to the position of the bright spot detected in the last frame. According to the jump detection logic, for the bright spot jump within 3 frames, the algorithm will maintain the original tracking box. If the bright spot is detected again in the tracking box at this time, the subsequent algorithm will be continued. If the bright spot is not detected after 3 frames, the detection area of the current height is returned to detect the bright spot; S7: the line changing state of the two groups of contact lines can be accurately detected during the contact line changing process. The line changing monitoring area is set on both sides of the tracking box, and the bright spot detection algorithm is executed in the line changing detection area. If the laser bright spot of other contact lines is detected in the line changing monitoring area, the program will enter the line changing mode, and the two groups of contact lines will be tracked to obtain the line changing result; S8: the pull-out height value and alarm information detected during program running are stored in the MySQL database in time sequence, and the time sequence and space graph of the pull-out height value are drawn by using Matplotlib.
2. The monocular camera based non-contact trolley wire geometric parameter measurement method according to claim 1, characterized in that: During normal operation of the execution equipment, the camera in the execution equipment shoots and returns pictures at a certain frequency, including: The program uses a json format file to save the corresponding configuration information. According to the inertial navigation information, the running state of the train is judged. When the train is detected to start, all hardware devices are started. The hardware devices are reserved for 30 to 60 seconds of starting time. Then the json configuration parameters are loaded, the control modules of the camera, inertial navigation and infrared laser equipment are initialized, and whether the devices are running normally is checked. After the detection is correct, the pictures are shot and returned at a certain frequency; When the train is detected to have no speed temporarily, the devices will not be closed immediately, but the operation will be continued to avoid stopping the algorithm detection because of the stop station of the train; If the train is detected to have no speed signal for a long time, the algorithm program will be automatically closed, all called devices will be closed and the power of the devices will be cut off.
3. The monocular camera based non-contact trolley wire geometry parameter measurement method according to claim 1, characterized in that: The collected camera return picture is automatically exposed and adjusted, and then the picture is preprocessed, including gray scale conversion, image rotation and image format conversion, to obtain first detection picture data, including; After the program starts, the image is first preprocessed, including image rotation, image format conversion, etc. Since the detection algorithm does not require color information of the picture, the image is first converted into a gray scale image for subsequent processing. Image rotation uses an affine transformation scheme. According to the angle of rotation, a 3*3 transformation matrix is created and multiplied with the original image to obtain the rotated image.
4. The monocular camera based non-contact trolley wire geometric parameter measurement method according to claim 1, characterized in that: The preset brightness detection area is automatically exposed and adjusted to obtain second detection picture data, including: A preset brightness detection area is set to analyze the brightness value of the area in the return picture in real time, to determine whether the current ambient brightness is within a reasonable range. The average brightness of the pixels in the detection area is calculated. If the average value exceeds the threshold range, the algorithm will call the exposure adjustment interface of the camera to dynamically adjust the exposure value of the camera according to the algorithm preset gear. Since there is a certain delay in adjusting the camera exposure, the algorithm will reserve 3 frames of image time for exposure adjustment. Then the brightness value is detected again. If the brightness has not reached the reasonable range, the adjustment will continue until the brightness reaches the reasonable threshold.
5. The monocular camera based non-contact trolley wire geometric parameter measurement method according to claim 1, characterized in that: The laser bright spot of the second detection picture data is detected. If the detected brightness is within the preset threshold, it is judged to be the bright spot formed by the laser irradiation on the contact line. The center pixel coordinates of the bright spot are obtained. According to the conversion matrix obtained by camera calibration, the image coordinates of the bright spot are converted into actual physical coordinates. Finally, the pull-out value and the lead height value are obtained, including; The bright spot detection first needs to do image binarization on the detection area. The OTSU method is used to adaptively select the binarization threshold, which can adapt to different lighting conditions. Then from the bottom of the detection area, each pixel point is scanned row by row upwards. If a pixel point with brightness equal to 255 is found and the width of the bright spot is greater than 3 pixels, it is judged to be the bright spot formed by the laser irradiation on the contact line, and the center pixel coordinates of the bright spot are obtained.
Citation Information
Patent Citations
Non-contact contact line geometrical parameter detecting method
CN103217111A
A method and a device for measuring the geometric parameters of an overhead line system by using scale factors and frame differences
CN107462174A