Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
As mentioned above, when the CCD line scan camera is used to measure the geometric parameters of the contact line, the involved equipment structure is complex and the system cost is high; when the contact line geometric parameters are measured by using the laser radar, the measurement accuracy is not high due to the existence of more interference data, and the measurement frequency of the scheme is low. According to the embodiment of the invention, the infrared imaging and video analysis technology is selected and fused to measure the dynamic geometric parameters of the overhead contact system. And installing an infrared thermal imager on the roof of the vehicle, collecting infrared video data of the pantograph-catenary operation state, and performing high-speed image real-time processing and analysis. The image is intelligently analyzed based on a pattern recognition technology, the accurate positions of the pantograph slide plate, the contact line and the like in the image are extracted, coordinate transformation is carried out based on a vision measurement model, and finally dynamic geometric parameters such as a dynamic pull-out value, the height of the contact line and the like are obtained.
When the geometric parameters of the overhead line system are detected based on the infrared images, the pantograph slide plate in the infrared images needs to be detected and accurately positioned. Through algorithm research and debugging, the embodiment of the invention realizes the detection of the pantograph slide plate in the image based on the template matching technology in computer vision.
The image matching problem is a classic problem in image processing and has wide application in the aspects of computer vision, pattern recognition and the like. Image matching is a technique for finding the portion of one image that best matches (i.e., is most similar to) another template image. When the image matching calculation is performed, an image matching algorithm based on features may be adopted, and a matching algorithm based on understanding and explaining the image may also be adopted, and the advantages and disadvantages of the two algorithms are analyzed respectively below.
The matching algorithm based on image understanding and interpretation is to establish corresponding relationship between the model in the computer and the objects and phenomena in the external world, and the method relates to many fields of computer vision, artificial intelligence, pattern recognition and the like, namely, the matched objects can be described by using knowledge and rules. The use of knowledge and rules essentially gives an explanation to the matching object, but the method is implemented in such a way that the description of the relationship between the structure and the points is often incomplete to reduce the amount of computation, and they lack a means for effectively measuring whether the point sets are the same or not, so that the method has not been developed in a breakthrough manner.
Feature-based image matching algorithms generally do not depend directly on pixel values, and generally require more complex image processing to extract features, often with invariance to scale, rotation, and grayscale transformations, in both the image and the transformed image. The method has the advantages that the gray scale characteristics and the related characteristics of the image are fully utilized, mismatching caused by background or illumination is effectively eliminated, the method is insensitive to various insubstantial changes (such as rotation, scaling, illumination intensity change and the like) of the image, and the image containing certain noise and slight distortion can be matched. The method also has certain disadvantages, such as very complex algorithm, large amount of geometrical and image morphological calculation, large calculation amount, long calculation time and difficulty in meeting the real-time requirement, no common model can follow, and the method needs to select the respective proper characteristics according to different application occasions.
According to the characteristics of the infrared image processing problem and the application requirement of the 3C system, the embodiment of the invention adopts an image matching algorithm based on gray scale to detect the pantograph slide plate, namely the contact line. Because the shooting distance between the infrared camera device on the roof and the pantograph is relatively fixed, the pantograph slide plate basically has no rotation and scaling in an image, and compared with a visible light image, the imaging quality of the infrared image is relatively stable, and the problem that the infrared image is sensitive to gray scale, illumination and the like in gray scale-based image matching can be avoided.
Regarding the gray-based image matching algorithm, the method directly uses the gray information of the image for matching, and realizes matching through global optimization of certain similarity measurement (such as minimum mean square error, normalized product correlation, SSDA and the like) between pixel pairs without image segmentation and image feature extraction, so that the precision loss caused by the preprocessing can be avoided. The principle of the method is relatively simple, and the mathematical statistical model, the convergence speed, the positioning accuracy, the error estimation and the like have mature research results. The gray-scale-based image matching algorithm is one of basic matching methods, is fully applied in many fields, can fully utilize all information of an image, and is particularly suitable for the condition that the image only has small relative movement such as translation and the like. The problems to be solved by such matching methods are: the method is sensitive to gray information change, illumination change and noise, does not fully utilize gray statistical characteristics, has high dependence on gray information of each point, and is not suitable for the matching problem of a matched object under the conditions of rotation and scaling.
Embodiments of the present invention are described below with reference to the various figures.
Fig. 3 is a schematic flow chart of the method for detecting the geometric parameters of the overhead line system based on the infrared image in the embodiment of the invention. As shown in fig. 1, the method mainly includes:
and S301, arranging an infrared thermal imager on the roof of the detection vehicle, and collecting an infrared image in the pantograph-catenary running state.
And S302, performing template matching based on gray scale on the infrared image to obtain intersection point coordinates of the pantograph slide plate and the contact line in the infrared image.
Step S303, according to the calibration of the transformation from the infrared image coordinate to the space geometric coordinate, the coordinate transformation is carried out on the coordinates of the intersection point of the pantograph slide plate and the contact line in the infrared image, and the height and the pull-out value of the contact line are obtained.
In an embodiment, when performing template matching based on gray scale on the infrared image to obtain the intersection point coordinates of the pantograph slide plate and the contact line in the infrared image, the infrared image in the pantograph pan running state may be converted into a gray scale image, and then the gray scale image corresponding to the infrared image may be subjected to template matching to obtain the position of the pantograph slide plate in the infrared image. And then, carrying out linear detection on the gray level image corresponding to the infrared image, and determining the position of the contact line in the infrared image. After the positions of the pantograph slide plate and the contact line in the infrared image are determined, the coordinates of the intersection point of the contact line and the pantograph slide plate can be obtained according to the position of the pantograph slide plate and the position of the contact line, so that subsequent processing can be performed.
In an embodiment, when the infrared image is subjected to pattern recognition to obtain the position of the pantograph slide plate in the infrared image, an image template of the pantograph slide plate needs to be established in advance, then template image matching is performed in the infrared image by using a preset image template, and an area in the infrared image, which is most matched with the image template, is detected as the position of the pantograph slide plate in the infrared image. The step of performing template image matching in the infrared image specifically refers to performing template image matching in a grayscale image corresponding to the infrared image.
The image matching method based on gray scale, also called correlation matching method, adopted in the embodiment of the invention utilizes a spatial two-dimensional sliding template to carry out image matching. The difference between different image matching algorithms is mainly reflected in the selection of templates and related criteria, wherein the classical related matching algorithms include: mean Absolute Difference (MAD) algorithms, Mean Square Deviation (MSD) algorithms, normalized cross-Correlation (NCC) algorithms, and the like. The robustness of the normalized cross-correlation matching algorithm is relatively high, and therefore the method is applied to the algorithm framework of more complex non-ergodic optimization matching search.
Let the live view S be an image of size M × M, the reference view T be an image of size N × N, and M > N, as shown in FIG. 4 image matching is a translation of the reference view T superimposed on the live view S, the search view of size N × N under the template overlay is called a sub-view Su,v(u, v) is the blockThe coordinates of the upper left image point in the S picture, called the reference point, have the following value ranges:
1≤u,v<M-N+1
our goal is to find the region on the real-time map S that best matches the reference map T, and to determine the matching region, a sliding reference map T and the real-time map S need to be compared. Sliding the reference map T one pixel at a time (left to right, top to bottom), a metric calculation is performed at each location to indicate whether it is "good" or "bad" to match the particular area of the real-time map S it covers, or how similar the reference map T and the particular area of the real-time map S it covers. For each position of T overlaid on S, if the metric values are stored in the resulting image matrix R, each position (x, y) in R contains a matching metric value. And acquiring the maximum matching metric value in the matrix, taking the position coordinate in the result image matrix corresponding to the maximum matching metric value as the top left corner vertex, and taking the matrix with the length and width being the same as those of the T as the position of the reference image T in the real-time image S, namely detecting the area which is most matched with the reference image T in the real-time image S.
Here, the matrix R may also be presented in the form of an image, and the whitest point (i.e., the brightest point) represents the highest degree of matching, so that with this point as a vertex, a graph having the same size as the reference map T in length and width is considered to be the closest match to the reference map T.
The following three common matching algorithms are mainly used, and are respectively shown as follows:
1) mean absolute difference algorithm (MAD):
2) mean square error algorithm (MSD):
it is clear that the computation process of the MAD and MSD algorithms is very simple, does not require complex operations, but is sensitive to noise, and in the presence of noise, the matching accuracy decreases as the signal-to-noise ratio increases.
3) Normalized cross-correlation algorithm (NCC):
in the formula (I), the compound is shown in the specification,
and
the image gray level mean values of the reference image T and the real-time image S can be obtained according to the following formula:
the normalized cross-correlation algorithm (NCC) has the advantages of strong white noise interference resistance and high accuracy under the condition of small gray scale change and geometric distortion.
When the embodiment of the invention applies a normalized cross-correlation algorithm (NCC) to the detection of the pantograph slide plate, an image template of the pantograph slide plate needs to be established in advance. And in the subsequent collected infrared image sequence, template image matching is carried out frame by frame, and the area which is most matched with the pantograph pan image template in the image is detected. And then, the height of the pantograph slide plate in the infrared image coordinate system is converted into the contact line dynamic height in the world coordinate system based on the detected height of the pantograph slide plate in the infrared image coordinate system. The detection of the area, which is most matched with the pantograph pan image template, in the image is specifically to detect the area, which is most matched with the pantograph pan image template, in the grayscale image corresponding to the infrared image.
For detecting the contact line pulling value, the position of the contact line needs to be detected in the infrared image, the abscissa value of the intersection point of the contact line and the pantograph slide plate is calculated, and then the contact line pulling value in the space is calculated.
Optionally, the coordinates of the intersection point of the pantograph slide plate and the contact line may be obtained according to the position of the contact line and the position of the pantograph slide plate in the infrared image, and the values of the dynamic height and the pull-out value of the contact line may be obtained by performing coordinate transformation on the abscissa and the ordinate of the intersection point. Two groups of contact lines exist at the joint of the line fork and the anchor section, and the horizontal distance of the two contact lines can be obtained by subtracting the pull-out values of the two contact lines.
In an embodiment, when template image matching is performed on the infrared image by using a preset pantograph pan image template (as can be understood by referring to an example shown in fig. 4, a real-time image S in fig. 4 may be understood as a grayscale image corresponding to the infrared image collected in the embodiment of the present invention, and a reference image T may be understood as an image template of the pantograph pan), the image template is moved from a top left corner vertex of the infrared image in a direction from top to bottom and from left to right, each time the image template is moved by one pixel, measurement calculation is performed on the image template at each position every time the image template is moved once, a matching metric value of the image template covering each position on the infrared image is obtained, and the matching metric value is stored in a result image matrix. The match metric here is used to indicate how similar the image template is to the current area of the infrared image it covers. For each location where the image template overlays the infrared image, if the matching metric is stored in the result image matrix, then each location in the result image matrix contains the matching metric. And acquiring a maximum value in the result image matrix, taking a position coordinate in the result image matrix corresponding to the maximum value as a top point at the upper left corner, and taking a matrix with the length and width as same as those of the image template as the position of the pantograph slide plate in the infrared image, namely detecting an area which is most matched with the pantograph slide plate image template in the infrared image.
In one embodiment, the image template of the pantograph pan may be obtained from currently acquired infrared images or from historical infrared images. The embodiment of the present invention is described by taking only an example of acquiring an image template of a pantograph pan from a currently acquired infrared image, and fig. 5 is an infrared image of a pantograph pan in an operating state according to an embodiment of the present invention, and a rectangular area approximately including the pantograph pan is acquired from the infrared image as the image template of the pantograph pan (see fig. 6). According to the above matching procedure, the image template shown in fig. 6 is searched in the infrared image in the other pantograph operating state shown in fig. 7, and the image area most matched with the image template shown in fig. 6, such as the black square area shown in fig. 7, is the position of the pantograph pan.
Since the contact line has its own unique characteristics compared with a common electric wire, when the infrared image is subjected to the straight line detection to determine the position of the contact line, a gray threshold interval is usually set in advance according to the empirical gray level of the contact line in the infrared image, or a width threshold interval is set according to the width range of the contact line in the infrared image. After a plurality of straight lines are obtained by performing straight line detection on the area above the pantograph slide plate in the infrared image, which of the straight lines meets the characteristics of the contact line can be judged according to the set gray threshold interval and/or the set width threshold interval (namely, the width and/or the gray level falls into the corresponding threshold interval of the contact line). Further, in order to more accurately determine which of the straight lines is a contact line, an included angle threshold interval may be set in advance according to the size of an included angle between the contact line on the current line and the pantograph slide plate, and after the straight lines are obtained, whether the straight lines are contact lines is determined by determining whether the included angles between the straight lines and the pantograph slide plate are in the included angle threshold interval, so as to determine the position of the contact line from the positions of the straight lines. In an embodiment, only one or two of the three limiting conditions (gray threshold interval, width threshold interval, and included angle threshold interval) may be selected to determine whether the straight line is a contact line, or the three conditions may be used to determine whether the straight line is a contact line.
In one embodiment, before the method is used for detecting the geometric parameters of the contact line, a two-dimensional calibration plate is further required to be installed on the section where the pantograph slide plate is located, the two-dimensional calibration plate covers the height and the pull-out value detection range of the contact line, and then an infrared thermal imager is used for collecting an infrared image of the two-dimensional calibration plate so as to calibrate the transformation from the infrared image coordinate to the space geometric coordinate. The two-dimensional calibration plate is temporarily installed, and can be detached after the system calibration is finished.
The method for detecting the geometric parameters of the overhead line system based on the infrared images, provided by the embodiment of the invention, has the advantages of small calculated amount, high detection precision, no influence of the quality of an original image, simple structure of used equipment and low cost.
Based on the same inventive concept as the method for detecting the geometric parameters of the overhead line system based on the infrared image shown in fig. 3, the embodiment of the invention further provides a system for detecting the geometric parameters of the overhead line system based on the infrared image, which is specifically described in the following embodiments. Since the principle of the device for solving the problems is similar to the method in fig. 3, the implementation of the system can refer to the implementation of the method shown in fig. 3, and repeated descriptions are omitted.
As shown in fig. 8, an embodiment of the present invention further provides a system 800 for detecting geometric parameters of a catenary based on infrared images. The system comprises: a thermal infrared imager 81, a template matching unit 82 and a parameter calculation unit 83.
The thermal infrared imager 81 is arranged on the roof of the inspection vehicle and used for acquiring infrared images of the pantograph-catenary operating state. The template matching unit 82 is used for performing template matching based on gray scale on the infrared image to acquire intersection point coordinates of the pantograph slide plate and the contact line in the infrared image. The parameter calculation unit 83 is configured to perform coordinate transformation on coordinates of an intersection point of the pantograph slide plate and the contact line in the infrared image according to calibration of transformation from the infrared image coordinates to the space geometric coordinates, and obtain a height and a pull-out value of the contact line.
For example, all components of the system 800 may be disposed on the roof of the inspection vehicle, or may be partially disposed on the roof of the inspection vehicle, and the other portion may be disposed at another place and communicate through wired or wireless communication. For example, after the thermal infrared imager 81 is disposed on the roof of the inspection vehicle, the template matching unit 82 and the parameter calculation unit 83 may be disposed in the inspection vehicle, and the present invention is not limited thereto.
In one embodiment, the structure of the template matching unit 82 is shown in fig. 9, and includes: a template matching module 821, a straight line detection module 822 and an intersection coordinate acquisition module 823. The template matching module 821 is configured to perform grayscale-based template matching on the infrared image, and acquire a position of the pantograph slider in the infrared image. The straight line detection module 822 is configured to perform straight line detection on the infrared image to determine a position of a contact line. The intersection coordinate obtaining module 823 is configured to obtain an intersection coordinate of the contact line and the pantograph slider according to the position of the pantograph slider and the position of the contact line.
In one embodiment, template matching module 821 is specifically configured to: and carrying out template image matching in the infrared image by utilizing a preset image template of the pantograph slide plate, and detecting an area which is most matched with the image template in the infrared image as the position of the pantograph slide plate in the infrared image.
In one embodiment, template image matching is performed in the infrared image by using a preset pantograph slide plate image template, and an area in the infrared image that is most matched with the pantograph slide plate image template is detected, which specifically includes: moving the image template from the top left corner vertex of the infrared image to the bottom and from left to right, wherein the image template is moved by one pixel each time; carrying out measurement calculation on the image template at each position, acquiring a matching metric value of the image template covering each position on the infrared image, and storing the matching metric value into a result image matrix; and acquiring a maximum value in the result image matrix, taking a position coordinate in the result image matrix corresponding to the maximum value as a top point at the upper left corner, and taking a matrix with the length and width as same as those of the image template as the position of the pantograph slide plate in the infrared image.
In one embodiment, the line detection module 822 is specifically configured to: performing linear detection on an area above the pantograph slide plate in the infrared image to acquire the position of a straight line in the area above the pantograph slide plate in the infrared image; and determining the position of the contact line from the positions of the straight line according to a preset contact line gray threshold interval, a preset contact line width threshold interval and a preset included angle threshold interval between the contact line and the pantograph slide plate.
In one embodiment, the system 800 further comprises: and a two-dimensional calibration plate (not shown in the figure) temporarily installed at the section where the pantograph slide plate is located and covering the height of the contact line and the detection range of the pull-out value. After the thermal infrared imager 81 collects the infrared image of the two-dimensional calibration plate, the two-dimensional calibration plate is removed, and the collected infrared image of the two-dimensional calibration plate is used for calibration from the infrared image coordinate to the space geometric coordinate.
The measurement result of the dynamic pull-out value of the contact line in the pantograph is shown in fig. 10, and the measurement result of the dynamic height of the contact line is shown in fig. 11.
The contact net geometric parameter detection method based on the infrared image has the advantages of small calculation amount in western days, high detection precision, no influence of the quality of an original image, simple structure of used equipment and low cost.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The principle and the implementation mode of the invention are explained by applying specific embodiments in the invention, and the description of the embodiments is only used for helping to understand the method and the core idea of the invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.