Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete
Site preparation is described, it is clear that described embodiment is only a part of embodiment of the invention, rather than whole embodiments.It is based on
Embodiment in the present invention, it is every other that those of ordinary skill in the art are obtained under the premise of creative work is not made
Embodiment, belongs to the scope of protection of the invention.
As it was previously stated, when being measured using CCD line-scan cameras to the geometric parameter of contact line, involved sets
Standby complicated, system cost is higher;When using lidar measurement contact line geometric parameter, the more interference due to existing
Data cause its measurement accuracy not high, and the measurement frequency of this scheme is relatively low.The embodiment of the present invention selection fusion it is infrared into
Picture, Video Analysis Technology carry out the measurement of contact net dynamic geometry parameter.Thermal infrared imager, collection bow net operation are installed in roof
State IR video stream, and carry out the real-time Treatment Analysis of high speed image.Intelligence point is carried out to image based on mode identification technology
Analysis, extracts the accurate location in the picture such as pantograph pan, contact line, and view-based access control model measurement model, carries out coordinate change
Change, finally draw the dynamic geometry parameter such as dynamic pull-out values, height of contact wire.
When carrying out the detection of contact net geometric parameter based on infrared image, it is necessary first to which the pantograph in infrared image is slided
Plate is detected and is accurately positioned.Through algorithm research and debugging, the embodiment of the present invention is based on the template matches in computer vision
Technology, realizes the detection to pantograph pan in image.
Image matching problems are a classical problems in image procossing, are had in terms of computer vision, pattern-recognition
And be widely applied.Images match be one in piece image find (i.e. most like) portion is most matched with another width template image
The technology divided.Carry out images match calculating when, can use feature based image matching algorithm, it would however also be possible to employ based on pair
Image understanding is analyzed with the matching algorithm explained, the separately below advantage and disadvantage to both algorithms.
Based on be to image understanding and the matching algorithm explained the model in computer with the object in the external world and
Phenomenon sets up corresponding relation, and this method is related to many fields such as computer vision, artificial intelligence, pattern-recognition,
I.e. can be with knowledge and rule come profile matching object.It is substantially to impart a kind of solution to matching object using knowledge and rule
Release, but this method is when realizing, makes the relationship description between structure and point often incomplete to reduce amount of calculation,
And they lack it is a kind of effectively weigh between point set whether identical means, institute is prominent there is presently no obtaining in this way
The progress of broken property.
The image matching algorithm of feature based is typically not directly dependent on pixel value, it usually needs pass through more complicated image
Processing generally extracts comparative example, scaling, rotation, greyscale transformation with not to extract feature in the image after image and conversion
The feature of denaturation.The advantage of this method is to take full advantage of gradation of image characteristic and correlation properties, effectively eliminate due to
Error hiding caused by background or illumination, and (such as rotation, scaling and illumination are strong for various non-intrinsically safes change of this method to image
Degree change etc.) it is insensitive, the image containing certain noise and mild distortion can be matched.And this method lacks there is also certain
Point, such as algorithm is extremely complex, relates generally to substantial amounts of geometry and is calculated with morphological image, computationally intensive, calculates the time longer
And be difficult to reach requirement of real-time, and no universal model can be followed, it is necessary to each suitable for the selection of different application occasion
Feature.
According to the characteristics of infrared image processing problem and communication command and control system application demand, the embodiment of the present invention use be based on gray scale
Image matching algorithm carry out pantograph pan be contact line detection.Due to the shooting of roof infrared eye and pantograph
Distance is relatively fixed, and pantograph pan is substantially not present rotation and scaled in the picture, also, compared with visible images, it is red
The image quality of outer image is stablized relatively, can also avoid more sensitive to gray scale, illumination etc. in the images match based on gray scale ask
Topic.
On the image matching algorithm based on gray scale, this kind of method is directly matched using the half-tone information of image, is led to
The global optimization for crossing between pixel pair certain similarity measurement (such as Minimum Mean Square Error, normalization product are related, SSDA) realizes
Matching, is not required to carry out image segmentation and image characteristics extraction, thus can avoid by the loss of significance caused by these pretreatments.
Its principle of this class method is relatively simple, and mathematical statistical model and convergence rate, positioning precision, estimation error etc. are
Have very ripe achievement in research.Image matching algorithm based on gray scale, as a kind of one of basic matching process, a lot
Field has obtained sufficient application, can make full use of all information of image, is particluarly suitable for image and only has translation etc. slightly
In the case of relative movement.This kind of matching process need solve the problem of be:To half-tone information change, illumination variation, noise ratio
It is more sensitive, gray-scale statistical characteristic is not made full use of, larger is relied on to the half-tone information of every bit, matching object is not suitable for and deposits
Matching problem in the case of rotation and scaling.
The embodiment of the present invention is described with reference to each figure.
Fig. 3 is the schematic flow sheet of contact net geometric parameter detection method of the embodiment of the present invention based on infrared image.Such as
Shown in Fig. 1, this method mainly includes:
Step S301, the infrared image in the case where detection car roof sets thermal infrared imager, collection bow net running status.
Step S302, the template matches based on gray scale are carried out to the infrared image, are obtained pantograph pan, contact line and are existed
Intersecting point coordinate in the infrared image.
Step S303, according to from infrared image coordinate to the demarcation of space geometry coordinate transform, to the pantograph pan,
Intersecting point coordinate of the contact line in infrared image carries out coordinate transform, obtains the height and stagger of the contact line.
In one embodiment, to the infrared image carry out the template matches based on gray scale, obtain pantograph pan,
During intersecting point coordinate of the contact line in the infrared image, the infrared image under bow net running status first can be converted into gray scale
Image, then carries out template matches to the corresponding gray level image of the infrared image, obtains the pantograph pan described red
Position in outer image.Afterwards, then to the corresponding gray level image of the infrared image straight-line detection is carried out, determines contact line in institute
State the position in infrared image., can be according to institute it is determined that behind the position of pantograph pan and contact line in the infrared image
The position of pantograph pan and the position of contact line are stated, the intersecting point coordinate of the contact line and pantograph pan is obtained, to carry out
Subsequent treatment.
In one embodiment, pattern-recognition is carried out to the infrared image described, obtains the pantograph pan and exist
, it is necessary to pre-establish the image template of pantograph pan during position in the infrared image, default image mould is then utilized
Plate carries out template image matching in the infrared image, detects what is most matched with described image template in the infrared image
Region, is used as position of the pantograph pan in the infrared image.Wherein, it is described that template is carried out in infrared image
Images match specifically refers to carry out template image matching in the corresponding gray level image of the infrared image.
The image matching method based on gray scale used in the embodiment of the present invention, also referred to as Image Matching, utilize sky
Between two-dimentional sleiding form carry out images match.The difference of different images matching algorithm is mainly reflected in the choosing of template and correlation criterion
Aspect is selected, wherein classical correlation matching algorithm has:MAD algorithm (Mean Absolute Differences,
MAD), mean square difference algorithm (Mean Square Deviation, MSD), normalized crosscorrelation algorithm (Normalized
Cross Correlation, NCC) etc..Wherein, the robustness of normalized crosscorrelation matching algorithm is of a relatively high, it also therefore quilt
In the algorithm frame for being applied to the search of increasingly complex nondenaturing PAGE optimization matching.
If figure S is the image that size is M × M in real time, with reference to figure T be size for N × N image, and M > N, such as Fig. 4
It is shown.Images match is will to overlay to translate on figure S in real time with reference to figure T, the search that block size under template covering is N × N
Figure is called subgraph Su,v, (u, v) is coordinate of the upper left corner picture point of this block subgraph in S figures, referred to as reference point, the value of (u, v)
Scope is:
1≤u, v < M-N+1
Our target is the region that most matching is found on figure S in real time with reference to figure T, in order to determine matching area, it is necessary to
Slide with reference to figure T and scheme S in real time and be compared.When sliding with reference to figure T, a pixel will be once moved with reference to figure T (past from a left side
It is right, from top to bottom), in each position, all carry out a metric calculation show it be " good " or " bad " covered with it
Real-time figure S specific region match, in other words with reference to figure T and the similarity degree of the real-time figure S of its covering specific region.
Each position on S is covered in for T, if metric is saved in result images matrix R, each position (x, y) in R
All include matching degree value.Matching degree value maximum in the matrix is obtained, with the corresponding result figure of the maximum matching degree value
Position coordinates in picture matrix is as top left corner apex, and long and wide and T matrixes of a size are scheming S in real time as with reference to figure T
In position, that is, detect in figure S in real time with the region that is most matched with reference to figure T.
Wherein, matrix R can also be presented in the form of images, and most white point (i.e. most bright point) represents matching degree most
Height, so using this point as summit, long and width and be considered as most to be matched with reference to figure T with reference to figure T figures of a size.
Wherein, conventional matching algorithm mainly has following three kinds, and difference is as follows:
1) MAD algorithm (MAD):
2) mean square difference algorithm (MSD):
It will be apparent that the calculating process of MAD and MSD algorithm is very simple, without complicated computing, but it is quicker to noise
Sense, in the presence of noise, matching accuracy rate is reduced with the increase of signal to noise ratio.
3) normalized crosscorrelation algorithm (NCC):
In formula,WithRespectively with reference to figure T and in real time, figure S gradation of image average, can be asked according to the following formula respectively
Take:
The advantage of normalized crosscorrelation algorithm (NCC) is that anti-white noise disturbance ability is strong and abnormal in grey scale change and geometry
Precision is very high in the case of becoming less.
When normalized crosscorrelation algorithm (NCC) is applied in the detection of pantograph pan by the embodiment of the present invention, need advance
Set up the image template of pantograph pan.Subsequent acquisition to infrared image sequence in, frame by frame carry out template image matching, inspection
Measure the region most matched with pantograph pan image template in image.Afterwards, based on the pantograph pan detected infrared
Height in image coordinate system, you can be converted to the contact line dynamic height in world coordinate system.Wherein, it is described to detect figure
The region that is most matched with pantograph pan image template as in, specifically detect in the corresponding gray level image of infrared image with by
The region that pantograph slider image template is most matched.
For the detection of stagger, then the position of contact line need to be detected in infrared image, and calculate contact
The abscissa value of line and pantograph pan intersection point, and then calculate the stagger in space.
Alternatively it is also possible to first according to the position and the position of pantograph pan of contact line in infrared image, obtain by electricity
Bend slide plate and the intersecting point coordinate of contact line, coordinate transform is carried out by the abscissa to the intersection point, ordinate, you can respectively obtain
The dynamic height of contact line and the numerical value of stagger.Exist at online trouble, overlap at two groups of contact lines, two can be connect
The stagger for touching line subtracts each other, you can obtain the horizontal range of double branch contact lines.
In one embodiment, template is being carried out in the infrared image using default pantograph pan image template
(Fig. 4 example showns can be combined to understand, the real-time figure S in Fig. 4 can be understood as gathering in the embodiment of the present invention during images match
The corresponding gray level image of infrared image arrived, the image template of pantograph pan is can be understood as with reference to figure T), by described image
Template, according to direction is moved from top to bottom, from left to right, moves one every time from the top left corner apex of the infrared image
Pixel, often movement once, carries out metric calculation to described image template in each position, obtains image template covering
Matching degree value on the infrared image at each position, and the matching degree value is saved in result images matrix
In.Matching degree value herein is used to show that how similar image template and the current region of its infrared image covered have.
Each position on infrared image is covered in for image template, if matching degree value is preserved in road result images matrix, that
Each position in result images matrix includes matching degree value.The maximum in the result images matrix is obtained, with
Position coordinates in the corresponding result images matrix of the maximum is as top left corner apex, and long and width is as described image template
Position of the matrix of size as the pantograph pan in the infrared image, that is, detect in the infrared image with institute
State the region that pantograph pan image template is most matched.
In one embodiment, the image template of described pantograph pan can be obtained from the infrared image currently obtained
Take, can also be obtained from history infrared image.The embodiment of the present invention from the infrared image currently obtained only to obtain by electricity
Illustrated exemplified by bow slide plate image template, Fig. 5 is the infrared image under bow net running status provided in an embodiment of the present invention,
The rectangular area for substantially including pantograph pan is obtained from the infrared image as the image template of pantograph pan (see figure
6).According to above-mentioned matching step, infrared figure of the image template under another bow net running status shown in Fig. 7 according to Fig. 6
Scanned for as in, the image-region matched the most with image template shown in Fig. 6, black side as shown in Figure 7 can be obtained
Frame region, as pantograph pan position.
The characteristics of uniqueness of its own is possessed compared to common wiring due to contact line, therefore, described to described infrared
Image carries out straight-line detection, and when determining the position of contact line, the experience gray scale generally previously according to contact line in infrared image is set
A gray threshold interval is put, or a width threshold value interval is set according to the width range of contact line in infrared image.
Straight-line detection is carried out to the upper area of pantograph pan described in the infrared image, got after a plurality of straight line, Ke Yigen
According to the gray threshold of setting is interval and/or width threshold value interval judgement these straight lines in which meet feature (the i.e. width of contact line
Degree and/or gray scale are fallen into the respective threshold interval of contact line).Further, in order to more accurately judge in above-mentioned straight line
Which bar straight line is contact line, can also be set previously according to the contact line on current line and the size of the angle of pantograph pan
Whether one angle threshold value is interval, after the straight line is got, by judging the angle of these straight lines and pantograph pan at this
During one angle threshold value is interval, to judge whether above-mentioned straight line is contact line, so as to determine contact line from the position of the straight line
Position.In one embodiment, above three restrictive condition (gray threshold interval, width threshold value interval, angle can only be chosen
Threshold interval) in one or two whether be that contact line judges to the straight line, above three can also be utilized simultaneously
Whether condition is that contact line judges to the straight line.
In one embodiment, before using above method detection contact line geometric parameter, in addition it is also necessary to described by electricity
Section part where bending slide plate installs two-dimensional calibrations plate, and the two-dimensional calibrations plate covers height and the stagger inspection of the contact line
Scope is surveyed, then recycles thermal infrared imager to gather the infrared image of the two-dimensional calibrations plate, to carry out from infrared image coordinate
To the demarcation of space geometry coordinate transform.Wherein, two-dimensional calibrations plate is installed temporarily, after system calibrating to be done, can be with
This two-dimensional calibrations plate is removed.
The amount of calculation of contact net geometric parameter detection method provided in an embodiment of the present invention based on infrared image is small, detection
Precision is higher, is not influenceed by original image quality, and device therefor is simple in construction, and cost is relatively low.
Based on the contact net geometric parameter detection method identical inventive concept based on infrared image shown in Fig. 3, this
Inventive embodiments additionally provide a kind of contact net geometric parameter detecting system based on infrared image, embodiment institute in face specific as follows
State.Because the principle that the device solves problem is similar to the method in Fig. 3, therefore the implementation of the system may refer to shown in Fig. 3
The implementation of method, repeats part and repeats no more.
As shown in figure 8, the embodiment of the present invention additionally provides a kind of contact net geometric parameter detection system based on infrared image
System 800.The system includes:Thermal infrared imager 81, template matches unit 82 and parameter calculation unit 83.
Wherein, thermal infrared imager 81 is arranged on detection car roof, for gathering the infrared image under bow net running status.Mould
Plate matching unit 82 is used to carry out the template matches based on gray scale to the infrared image, obtains pantograph pan, contact line and exists
Intersecting point coordinate in the infrared image.Parameter calculation unit 83 is used to become according to from infrared image coordinate to space geometry coordinate
The demarcation changed, to the intersecting point coordinate progress coordinate transform of the pantograph pan, contact line in infrared image, connects described in acquisition
Touch the height and stagger of line.
For example, all constituents of system 800 can be arranged on the roof of detection car, inspection can also be partly arranged on
The roof of measuring car, another part is arranged at elsewhere, is communicated by wired or wireless way.For example, by thermal infrared imager
81 are arranged on after detection car roof, and template matches unit 82 can be arranged in detection car with parameter calculation unit 83, the present invention
It is not intended to limit.
In one embodiment, template matches unit 82 structure as shown in figure 9, including:It is template matches module 821, straight
Line detection module 822 and intersecting point coordinate acquisition module 823.Wherein, template matches module 821 is used to carry out the infrared image
Template matches based on gray scale, obtain position of the pantograph pan in the infrared image.Straight-line detection module 822 is used
In carrying out straight-line detection to the infrared image, the position of contact line is determined.Intersecting point coordinate acquisition module 823 is used for according to described
The position of pantograph pan and the position of contact line, obtain the intersecting point coordinate of the contact line and pantograph pan.
In one embodiment, template matches module 821 specifically for:Utilize the image template of default pantograph pan
Template image matching is carried out in the infrared image, the area most matched with described image template in the infrared image is detected
Domain, is used as position of the pantograph pan in the infrared image.
In one embodiment, Prototype drawing is carried out in the infrared image using default pantograph pan image template
As matching, the region most matched with the pantograph pan image template in the infrared image is detected, is specifically included:By institute
State image template to move from top to bottom, from left to right from the top left corner apex of the infrared image, every time a mobile picture
Element;Metric calculation is carried out to described image template in each position, described image template is obtained and is covered in the infrared figure
It is saved in as the matching degree value at upper each position, and by the matching degree value in result images matrix;Obtain the knot
Maximum in fruit image array, using the position coordinates in the corresponding result images matrix of the maximum as top left corner apex,
Long and wide and position of the described image template matrix of a size as the pantograph pan in the infrared image.
In one embodiment, straight-line detection module 822 specifically for:To pantograph pan described in the infrared image
Upper area carry out straight-line detection, obtain the position of the straight line described in the infrared image in pantograph pan upper area
Put;According to the angle in default contact line gray threshold interval, contact line width threshold value interval and contact line and pantograph pan
Threshold interval, determines the position of contact line from the position of the straight line.
In one embodiment, system 800 also includes:Two-dimensional calibrations plate (not shown), be temporarily installed at it is described by
Section part where pantograph slider, and cover the height and stagger detection range of the contact line.Adopted in thermal infrared imager 81
After the infrared image for having collected two-dimensional calibrations plate, then two-dimensional calibrations plate removed, the infrared image of the two-dimensional calibrations plate collected is used
In progress from infrared image coordinate to the demarcation of space geometry coordinate transform.
Obtained by contact net geometric parameter detection method of the offer of the embodiment of the present invention based on infrared image and system
The measurement result of the dynamic pull-out values of contact line is shown in Figure 10 in bow net, and the dynamic height measurement result of contact line is shown in Figure 11.
Contact net geometric parameter provided in an embodiment of the present invention based on infrared image detects that the amount of calculation in Western Paradise is small, detection
Precision is higher, is not influenceed by original image quality, and device therefor is simple in construction, and cost is relatively low.
It should be understood by those skilled in the art that, embodiments of the invention can be provided as method, system or computer program
Product.Therefore, the present invention can be using the reality in terms of complete hardware embodiment, complete software embodiment or combination software and hardware
Apply the form of example.Moreover, the present invention can be used in one or more computers for wherein including computer usable program code
The computer program production that usable storage medium is implemented on (including but is not limited to magnetic disk storage, CD-ROM, optical memory etc.)
The form of product.
The present invention is the flow with reference to method according to embodiments of the present invention, equipment (system) and computer program product
Figure and/or block diagram are described.It should be understood that can be by every first-class in computer program instructions implementation process figure and/or block diagram
Journey and/or the flow in square frame and flow chart and/or block diagram and/or the combination of square frame.These computer programs can be provided
The processor of all-purpose computer, special-purpose computer, Embedded Processor or other programmable data processing devices is instructed to produce
A raw machine so that produced by the instruction of computer or the computing device of other programmable data processing devices for real
The device for the function of being specified in present one flow of flow chart or one square frame of multiple flows and/or block diagram or multiple square frames.
These computer program instructions, which may be alternatively stored in, can guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works so that the instruction being stored in the computer-readable memory, which is produced, to be included referring to
Make the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one square frame of block diagram or
The function of being specified in multiple square frames.
These computer program instructions can be also loaded into computer or other programmable data processing devices so that in meter
Series of operation steps is performed on calculation machine or other programmable devices to produce computer implemented processing, thus in computer or
The instruction performed on other programmable devices is provided for realizing in one flow of flow chart or multiple flows and/or block diagram one
The step of function of being specified in individual square frame or multiple square frames.
Apply specific embodiment in the present invention to be set forth the principle and embodiment of the present invention, above example
Explanation be only intended to help to understand the method and its core concept of the present invention;Simultaneously for those of ordinary skill in the art,
According to the thought of the present invention, it will change in specific embodiments and applications, in summary, in this specification
Appearance should not be construed as limiting the invention.