CN110910443A - Contact net geometric parameter real-time measuring method and device based on single monitoring camera - Google Patents

Contact net geometric parameter real-time measuring method and device based on single monitoring camera Download PDF

Info

Publication number
CN110910443A
CN110910443A CN201911228863.3A CN201911228863A CN110910443A CN 110910443 A CN110910443 A CN 110910443A CN 201911228863 A CN201911228863 A CN 201911228863A CN 110910443 A CN110910443 A CN 110910443A
Authority
CN
China
Prior art keywords
image
pantograph
line
edge
straight line
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201911228863.3A
Other languages
Chinese (zh)
Other versions
CN110910443B (en
Inventor
佘朝富
宋平
周蕾
张楠
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chengdu Tang Source Electrical Ltd By Share Ltd
Original Assignee
Chengdu Tang Source Electrical Ltd By Share Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chengdu Tang Source Electrical Ltd By Share Ltd filed Critical Chengdu Tang Source Electrical Ltd By Share Ltd
Priority to CN201911228863.3A priority Critical patent/CN110910443B/en
Publication of CN110910443A publication Critical patent/CN110910443A/en
Application granted granted Critical
Publication of CN110910443B publication Critical patent/CN110910443B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B11/00Measuring arrangements characterised by the use of optical techniques
    • G01B11/02Measuring arrangements characterised by the use of optical techniques for measuring length, width or thickness
    • G01B11/022Measuring arrangements characterised by the use of optical techniques for measuring length, width or thickness by means of tv-camera scanning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/90Dynamic range modification of images or parts thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/12Edge-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/168Segmentation; Edge detection involving transform domain methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/194Segmentation; Edge detection involving foreground-background segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/62Analysis of geometric attributes of area, perimeter, diameter or volume
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20048Transform domain processing
    • G06T2207/20061Hough transform
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30232Surveillance

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Geometry (AREA)
  • Image Processing (AREA)
  • Image Analysis (AREA)
  • Length Measuring Devices By Optical Means (AREA)

Abstract

The invention discloses a method and a device for measuring geometrical parameters of a contact net in real time based on a single monitoring camera, and relates to the technical field of contact net measurement. The method for measuring the geometrical parameters of the contact net, provided by the invention, can be suitable for application scenes under different illumination conditions and different background conditions, can better distinguish a lead, a carrier cable and a dropper, can reduce the frame rate and pixel requirements on a camera, and can accurately measure the geometrical parameters of the contact net.

Description

Contact net geometric parameter real-time measuring method and device based on single monitoring camera
Technical Field
The invention relates to the technical field of contact network measurement, in particular to a method and a device for measuring geometric parameters of a contact network in real time based on a single monitoring camera.
Background
The catenary is a high-voltage power transmission line for supplying power to electric locomotives, and is responsible for directly transmitting electric energy obtained from traction power transformation to trains for use. The two most critical parameters of the contact net geometric parameters are the lead height and the pull-out value of a contact net lead, and the lead height and the pull-out value are respectively defined as the vertical distance between the lead and the plane on the track and the horizontal distance between the lead and the central line of the track. According to the construction characteristics of railways in China, the geometric position of a contact network in space is easy to change, and particularly under the condition that high-speed motor train units are put into operation in large batches, each geometric parameter needs to be measured and corrected frequently. Therefore, the real state of the contact network can be reliably measured in real time, which is an important guarantee for normal operation and safe driving of the electrified railway and provides a theoretical basis for daily maintenance and overhaul of the contact network.
The current methods for detecting the geometrical parameters of the contact net mainly comprise the following methods: 1) contact measurement, such as the drop wire method, the insulation measuring rod method, and the pantograph mount sensor method. The contact measurement needs to contact the measurement equipment with the pantograph, and the method has the defects of low efficiency, large workload and low measurement precision; 2) non-contact measurements, such as ultrasound measurements, lidar methods, image detection methods. Although the method is non-contact detection and can measure the geometric parameters of the contact network in both static state and dynamic state, the method has the defects of complex installation, complex calibration, extremely high requirements on the frame rate and pixels of a camera and the like.
The national intellectual property office discloses an invention patent application with the publication number of CN110174059A and the name of 'a pantograph height and pull-out value measuring method based on monocular images' in 2019, 27.8.8.78. Due to the change of shooting conditions, the position of the pantograph in the image is changed, and the extraction of the ROI by using the fixed rectangular region is easy to cause target loss.
In addition, when the contour line and the contact line of the pantograph slide bar are analyzed by adopting an image detection method at present, a lot of interferences exist in an intercepted image, so that the contour line and/or the contact line of the pantograph slide bar are easy to have extraction errors, and the height of the pantograph slide bar and the calculation errors of a pull-out value are caused. When the geometric parameters of the contact net are measured by adopting an image detection method, how to eliminate the interference in the image so as to obtain accurate contour lines and/or contact lines is the important factor in measuring the geometric parameters of the contact net by adopting the image detection method, and the current method for measuring the geometric parameters of the contact net does not solve the problems.
Disclosure of Invention
In order to overcome the defects and shortcomings in the prior art, the invention provides a method for measuring geometrical parameters of a contact net in real time based on a single monitoring camera, and aims to solve the problems that interference images cannot be eliminated, the measurement precision is low, and errors are large in the prior art.
In order to solve the problems in the prior art, the invention is realized by the following technical scheme:
the method comprises the steps of image input, pantograph positioning, pantograph slide bar contour extraction, contact line extraction, intersection point acquisition and height and pull value calculation;
the pantograph slide bar contour extraction step specifically includes the steps of performing linear gray level enhancement on the pantograph region image reserved in the pantograph positioning step, and calculating the edge of the pantograph region image after the linear gray level enhancement by adopting a second-order difference method; calculating the length of the edge, and removing the shorter edge; and after the shorter edge is removed, connecting end points at two ends of the reserved edge into a straight line, judging an included angle between the straight line and the horizontal direction, reserving edge lines with the included angle meeting a set angle, and selecting an edge line at the uppermost end from the reserved edge lines to be used as a pantograph slide bar contour line for output. Those skilled in the art will appreciate that the shorter edge refers to an image edge having an edge length that is significantly less than the contour of the pantograph slider.
The contact line extraction step specifically includes the steps of obtaining a gradient map in the horizontal direction in the pantograph region image according to the pantograph region image reserved in the pantograph positioning step, and performing binarization processing on the gradient amplitude of the gradient map to obtain a binary map; carrying out opening operation processing on the binary image, carrying out straight line detection on the image subjected to the opening operation processing by utilizing Hough transform, and detecting all possible straight lines in the image; calculating the slope of each detected straight line in sequence, and reserving the straight lines with the slopes meeting set conditions; calculating the width of the line where each straight line is located, and screening out candidate lines meeting the set width; positioning a wire clamp area in the pantograph area image, and if a wire clamp is positioned, taking a candidate line in the center of the wire clamp area as a contact line to be output linearly; and if the line clamp cannot be positioned, sequentially calculating the distance and the slope difference between the output contact line in the image of the previous frame and the candidate line of the current frame, and selecting one candidate line with the shortest distance and/or the smallest slope difference as the contact line to be output linearly. In the preferred embodiment, the candidate lines are selected as the contact line straight line output by integrating two factors of shortest distance and minimum slope difference, so that the contact line straight line extraction accuracy under the condition that the current frame cannot be positioned to the line clamp is improved.
The pantograph positioning step specifically comprises the steps of carrying out binarization processing on an input image and extracting a foreground image; solving the area outline of the extracted foreground image; and sequentially calculating the geometric features of the outlines of the areas, judging whether the geometric features of the outlines of the areas meet a set geometric feature threshold value, if not, determining the areas as interference areas, and filtering the interference areas to only reserve pantograph areas.
In the pantograph positioning step, extracting the foreground image specifically means that each pixel point in the input image is traversed, a pixel within a range of [0, n ] is assigned as 255, and the other pixels are assigned as 0, where n is greater than or equal to 10 and less than or equal to 30.
The specific step of obtaining the region contour of the extracted foreground image is that different boundaries are endowed with different integer values, the boundaries are determined to be outer boundaries, hole boundaries and hierarchical relations of the hole boundaries, then pixels on the boundaries are marked from a starting point, and the region contour is finally formed.
The geometric features of the zone profile include at least one of zone perimeter, zone length, zone width, zone mass, and zone centroid.
The perimeter of the region refers to the number of contour points of the boundary of the region, and the length and the width of the region refer to the external rectangle of the region, and the length and the width of the region are obtained according to the external rectangle; the regional quality means that the zeroth order moment of the image is expressed as
Figure DEST_PATH_IMAGE001
Wherein
Figure 903414DEST_PATH_IMAGE002
Represent an image in
Figure DEST_PATH_IMAGE003
The gray value at the point, when the image is a binary image,
Figure 87271DEST_PATH_IMAGE004
the sum of pixels of a certain white area of the image is used for solving the gray quality of the white area; the centroid of the region means that the first moment of the image is expressed as
Figure DEST_PATH_IMAGE005
Figure 768656DEST_PATH_IMAGE006
When the image is a binary image,
Figure 924831DEST_PATH_IMAGE002
is a value of 0 or 255,
Figure DEST_PATH_IMAGE007
representing the accumulation of the x-coordinates of the white area on the image,
Figure 784203DEST_PATH_IMAGE008
representing the accumulation of y-coordinates of white areas on the image, the centroid of the image
Figure DEST_PATH_IMAGE009
Figure 206088DEST_PATH_IMAGE010
In a preferred embodiment, respective thresholds are set for the above 4 types of geometric features, and for a certain contour, when all the calculated geometric feature values satisfy the threshold range, the current region is retained, so that other interference regions are filtered out, and finally only the pantograph region is retained. By integrating the 4 types of geometric characteristics provided by the application, the accuracy of the pantograph region positioning is obviously improved.
And performing linear gray scale enhancement on the reserved pantograph region image, specifically, converting the gray scales of all points in the image according to a linear gray scale conversion function. In particular, images
Figure DEST_PATH_IMAGE011
Representing the gray scale range before transformation is
Figure 114001DEST_PATH_IMAGE012
The transformed image is
Figure DEST_PATH_IMAGE013
Then, the gray scale linear transformation function expression is:
Figure 186999DEST_PATH_IMAGE014
(ii) a Transformed image
Figure 154956DEST_PATH_IMAGE013
To expand the gray scale range to
Figure DEST_PATH_IMAGE015
The method for obtaining the gradient map in the horizontal direction in the pantograph region image comprises the following specific steps:
pixel point in image
Figure 565602DEST_PATH_IMAGE016
The gradient of (d) is:
Figure DEST_PATH_IMAGE017
(1)。
the binarization processing of the gradient amplitude of the gradient map specifically includes setting a threshold value and converting G x x,y) The pixels larger than the threshold are set to 255, and the remaining pixels are set to 0.
And calculating the width of the line where each straight line is located, specifically, taking any point of the straight line as a starting point, extracting the gray value gray of the straight line, searching pixel points leftwards and rightwards along the x direction, if the gray value of the point is equal to the gray, adding 1 to the width of the line, and otherwise, stopping searching.
In the intersection point obtaining step, the pantograph slide bar contour line output in the pantograph slide bar contour line extracting step is received, a coordinate point set of the pantograph slide bar contour line is created according to the received pantograph slide bar contour line, the maximum value and the minimum value of the abscissa are found out from the coordinate point set, and the median of the abscissa is obtained according to the maximum value and the minimum value of the abscissa; sorting coordinate points in the coordinate point set of the pantograph slide bar contour line from small to large by taking the abscissa as a reference, and finding out the coordinate point of which the abscissa is equal to the solved median of the abscissa
Figure 339523DEST_PATH_IMAGE018
In terms of coordinate points
Figure 470290DEST_PATH_IMAGE018
A plurality of coordinate points are respectively expanded to the left and right of the adjacent central point, and are intercepted to form a new pantograph slider contour line coordinate point set; and performing linear fitting on the new coordinate point set of the pantograph slider contour line by using a least square method to obtain a linear equation of the coordinate point set, and solving the intersection point according to the linear equation of the contact line extracted in the contact line extraction step and the linear method of the pantograph slider contour line obtained after linear fitting.
Specifically, two end points p1, p2 on the contact line are known, and the linear expression of the contact line is as follows:
A1X+B1Y+C1=0 (2);
two end points p3, p4 on the contour line of the pantograph slide bar obtained after straight line fitting, and the straight line expression is as follows:
A2X+B2Y+C2=0 (3);
simultaneous equations (5) and (6), and let B1= -1, B2= -1, one can obtain:
X=(C1+Y)/A1 (4);
Y=(A2C1-A1C2)/(A2-A1) (5);
according to the known coordinate points, the values of equation coefficients A1, B1, C1, A2, B2 and C2 are obtained through solving, and the intersection point is further obtained according to the obtained equation coefficients.
In the step of obtaining the height guiding and pulling-out value, the camera calibration condition is that the coordinate of the center point x of the pantograph is superposed with the coordinate of the center point of the chessboard grid calibration plate, and the coordinate of the y is not required; the world coordinate system is established in the center of the chessboard, the horizontal right direction is the positive direction of x, and the vertical upward direction is the positive direction of y; the camera calibration means that intersection point image coordinates are converted into established world coordinates to obtain an actual physical position of an intersection point, and if coordinates obtained by converting an intersection point P into a world coordinate system are P (x, y), an obtained derivative height H and a pull-out value S are as follows:
H=L+Py (6);
s = Px (7); wherein L represents the distance of the center point of the checkerboard from the rail surface.
The invention also provides a device for measuring the geometric parameters of the overhead line system in real time based on the single monitoring camera, which comprises an image input module, a pantograph positioning module, a pantograph slider outline extraction module, a contact line extraction module, an intersection point acquisition module and a lead-height and pull-out value calculation module; the image input module is used for receiving the image transmitted by the single monitoring camera and transmitting the received image to the pantograph positioning module; the pantograph positioning module is used for positioning a pantograph area image in the image received by the image input module and transmitting the reserved pantograph area image to the pantograph slide bar outline extraction module and the contact line extraction module;
the pantograph slide bar outline extraction module is used for performing linear gray level enhancement on a pantograph region image reserved in the pantograph positioning module and calculating the edge of the pantograph region image subjected to linear gray level enhancement by adopting a second-order difference method; calculating the length of the edge, and removing the shorter edge; after removing the shorter edge, connecting end points at two ends of the reserved edge into a straight line, judging an included angle between the straight line and the horizontal direction, reserving edge lines with the included angle meeting a set angle, selecting an edge line at the uppermost end from the reserved edge lines as a pantograph slide bar contour line, and outputting the edge line to an intersection point solving module;
the contact line extraction module is used for receiving the pantograph region image transmitted by the pantograph positioning module, solving a gradient map in the horizontal direction in the pantograph region image according to the pantograph region image, and performing binarization processing on a gradient amplitude value of the gradient map to obtain a binary map; carrying out opening operation processing on the binary image, carrying out straight line detection on the image subjected to the opening operation processing by utilizing Hough transform, and detecting all possible straight lines in the image; calculating the slope of each detected straight line in sequence, and reserving the straight lines with the slopes meeting set conditions; calculating the width of the line where each straight line is located, and screening out candidate lines meeting the set width; positioning a wire clamp area in the pantograph area image, and if a wire clamp is positioned, taking a candidate line in the center of the wire clamp area as a contact line to be output linearly; if the line clamp can not be positioned, the distance and the slope difference between the output contact line in the image of the previous frame and the candidate line of the current frame are sequentially calculated, and one candidate line with the shortest distance and/or the smallest slope difference is selected as the contact line straight line to be output to the intersection point solving module.
The pantograph positioning module is used for carrying out binarization processing on an input image and extracting a foreground image; solving the area outline of the extracted foreground image; and sequentially calculating the geometric features of the outlines of the areas, judging whether the geometric features of the outlines of the areas meet a set geometric feature threshold value, if not, determining the areas as interference areas, and filtering the interference areas to only reserve pantograph areas.
In the pantograph positioning module, extracting the foreground image specifically means traversing each pixel point in the input image, assigning pixels within a range of [0, n ], 10 ≦ n ≦ 30, to 255, and assigning the remaining pixels to 0.
The specific step of obtaining the region contour of the extracted foreground image is that different boundaries are endowed with different integer values, the boundaries are determined to be outer boundaries, hole boundaries and hierarchical relations of the hole boundaries, then pixels on the boundaries are marked from a starting point, and the region contour is finally formed.
The geometric features of the zone profile include at least one of zone perimeter, zone length, zone width, zone mass, and zone centroid.
The perimeter of the region refers to the number of contour points of the boundary of the region, and the length and the width of the region refer to the external rectangle of the region, and the length and the width of the region are obtained according to the external rectangle; the regional quality means that the zeroth order moment of the image is expressed as
Figure 422196DEST_PATH_IMAGE001
Wherein
Figure 740045DEST_PATH_IMAGE002
Represent an image in
Figure 255340DEST_PATH_IMAGE003
The gray value at the point, when the image is a binary image,
Figure 240614DEST_PATH_IMAGE004
the sum of pixels of a certain white area of the image is used for solving the gray quality of the white area; the centroid of the region means that the first moment of the image is expressed as
Figure 612689DEST_PATH_IMAGE005
Figure 417834DEST_PATH_IMAGE006
When the image is a binary image,
Figure 782825DEST_PATH_IMAGE002
is a value of 0 or 255,
Figure 622605DEST_PATH_IMAGE007
representing the accumulation of the x-coordinates of the white area on the image,
Figure 103265DEST_PATH_IMAGE008
representing the accumulation of y-coordinates of white areas on the image, the centroid of the image
Figure 723602DEST_PATH_IMAGE009
Figure 315121DEST_PATH_IMAGE010
And performing linear gray scale enhancement on the reserved pantograph region image, specifically, converting the gray scales of all points in the image according to a linear gray scale conversion function. In particular, images
Figure 274986DEST_PATH_IMAGE011
Representing the gray scale range before transformation is
Figure 739597DEST_PATH_IMAGE012
After transformation into
Figure 519334DEST_PATH_IMAGE013
Then, the gray scale linear transformation function expression is:
Figure 914543DEST_PATH_IMAGE014
(ii) a Transformed image
Figure 791233DEST_PATH_IMAGE013
To expand the gray scale range to
Figure 613695DEST_PATH_IMAGE015
The method for obtaining the horizontal gradient map in the pantograph region image comprises the following specific steps:
pixel point in image
Figure 880728DEST_PATH_IMAGE016
The gradient of (d) is:
Figure 394143DEST_PATH_IMAGE017
(1)。
the binarization processing of the gradient amplitude of the gradient map specifically includes setting a threshold value and converting G x x,y) The pixels larger than the threshold are set to 255, and the remaining pixels are set to 0.
And calculating the width of the line where each straight line is located, specifically, taking any point of the straight line as a starting point, extracting the gray value gray of the straight line, searching pixel points leftwards and rightwards along the x direction, if the gray value of the point is equal to the gray, adding 1 to the width of the line, and otherwise, stopping searching.
The intersection point calculating module receives the pantograph slide bar contour line output in the pantograph slide bar contour line extracting step, creates a pantograph slide bar contour line coordinate point set according to the received pantograph slide bar contour line, finds out an abscissa maximum value and an abscissa minimum value from the coordinate point set, and calculates an abscissa median value according to the abscissa maximum value and the abscissa minimum value; sorting coordinate points in the coordinate point set of the pantograph slide bar contour line from small to large by taking the abscissa as a reference, and finding out the coordinate point of which the abscissa is equal to the solved median of the abscissa
Figure 63021DEST_PATH_IMAGE018
In terms of coordinate points
Figure 56385DEST_PATH_IMAGE018
A plurality of coordinate points are respectively expanded to the left and right of the adjacent central point, and are intercepted to form a new pantograph slider contour line coordinate point set; and performing linear fitting on the new coordinate point set of the pantograph slider contour line by using a least square method to obtain a linear equation of the coordinate point set, and solving the intersection point according to the linear equation of the contact line extracted in the contact line extraction step and the linear method of the pantograph slider contour line obtained after linear fitting.
Specifically, two end points p1, p2 on the contact line are known, and the linear expression of the contact line is as follows:
A1X+B1Y+C1=0 (2);
two end points p3, p4 on the contour line of the pantograph slide bar obtained after straight line fitting, and the straight line expression is as follows:
A2X+B2Y+C2=0 (3);
simultaneous equations (5) and (6), and let B1= -1, B2= -1, one can obtain:
X=(C1+Y)/A1 (4);
Y=(A2C1-A1C2)/(A2-A1) (5);
according to the known coordinate points, the values of equation coefficients A1, B1, C1, A2, B2 and C2 are obtained through solving, and the intersection point is further obtained according to the obtained equation coefficients.
In the height leading and pulling value obtaining module, the camera calibration condition is that the coordinate of the center point x of the pantograph is superposed with the coordinate of the center point of the chessboard grid calibration plate, and the coordinate of the y is not required; the world coordinate system is established in the center of the chessboard, the horizontal right direction is the positive direction of x, and the vertical upward direction is the positive direction of y; the camera calibration means that intersection point image coordinates are converted into established world coordinates to obtain an actual physical position of an intersection point, and if coordinates obtained by converting an intersection point P into a world coordinate system are P (x, y), an obtained derivative height H and a pull-out value S are as follows:
H=L+Py (6);
s = Px (7); wherein L represents the distance of the center point of the checkerboard from the rail surface.
Compared with the prior art, the beneficial technical effects brought by the invention are as follows:
1. in the invention, further improvements are respectively provided for a pantograph positioning step, a pantograph slide bar outline extraction step and a contact line extraction step in the existing method for measuring the geometrical parameters of the overhead line system of the single monitoring camera in real time. In the pantograph positioning step, foreground image extraction, contour extraction and contour screening are adopted, so that the pantograph region is accurately positioned.
2. The pantograph slider outline extraction step comprises image enhancement, namely, the gray levels of all points in an image are converted according to a linear gray level conversion function, each pixel in the image is linearly expanded, and the image quality is effectively improved; the method also comprises line detection, and the image edge is calculated by adopting a second-order difference method, so that the calculation precision is higher. The method also comprises line screening, wherein the contour lines are screened, so that one contour line is determined to be output as the contour line of the pantograph slider, the accuracy of the contour line of the pantograph slider is ensured, and the accuracy of subsequent height guidance and pull-out value calculation is improved.
3. The contact line extraction step comprises gradient calculation, and aims to overcome the influence of illumination, ensure that the integral gray difference of the image under different light bars is larger, and the gradient characteristics in a specific direction are relatively stable. Because the gradient amplitude represents the intensity of pixel mutation, and the edge of the wire is an area with stronger pixel mutation, the gradient amplitude is subjected to binarization processing, and a lot of noise exists after the binarization processing of the gradient image, so that the binary image is subjected to open operation processing, the contour is smoothed, narrow connection is broken, and a small salient part is removed. And then, carrying out straight line detection on the morphologically processed image by using Hough transform, detecting all possible straight lines in the image, wherein a plurality of initial straight lines are extracted, such as contact lines, messenger lines, suspenders, inclined pull lines and the like, and interference straight lines (messenger lines, suspenders, inclined pull lines and the like) need to be removed. In the invention, a slope calculation mode is adopted, so that a part of unqualified straight lines are filtered, then a part of unqualified straight lines are filtered according to the line width, and then a line clamp area is positioned, if a line clamp is positioned, because a real contact line is clamped by the line clamp, a candidate line at the center of the line clamp area is taken as a contact line straight line to be output; if the line clamp can not be positioned, the distance and the slope difference between the output contact line and a plurality of wires of the current frame in the image of the current frame are calculated in sequence, and one line with the shortest distance and the smallest slope difference is selected as the linear output of the contact line (if the first input image is adopted, the real contact line is marked manually).
4. The pantograph contour lines are screened through the edge line length, the edge line included angle and the position characteristics of the edge lines, the extraction precision of the pantograph contour lines is further improved, and the pantograph contour lines are guaranteed to be extracted correctly.
5. The method is insensitive to the light source, can be suitable for calculating the leading-out value and the pull-out value of the image under different illumination conditions, and can be suitable for both day and night. The method has strong field applicability, the algorithm parameters of the method are convenient to modify, no professional is needed, other non-professionals can modify the related parameters, and the method can be suitable for calculating the leading-up and the pull-out values of different background images under different field conditions. The invention has high detection accuracy and low false detection rate and missed detection rate.
Drawings
FIG. 1 is a flow chart of the measurement of geometrical parameters of the overhead line system of the present invention;
FIG. 2 is an original photograph taken by the camera of the present invention;
FIG. 3 is a diagram of pantograph positioning according to the present invention;
FIG. 4 is a diagram of an outline extraction of a pantograph in accordance with the present invention;
FIG. 5 is a schematic diagram of a multi-interference line of the present invention;
FIG. 6 is a previous frame of image in the straight line filtering step according to the present invention;
FIG. 7 is a current frame image in the straight line filtering step of the present invention;
FIG. 8 is a cross-point output plot of the present invention.
Detailed Description
The technical scheme of the invention is further elaborated in the following by combining the drawings in the specification.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as methods, apparatus, computer program products. 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.
Example 1
Referring to fig. 1-8 of the specification, this embodiment discloses: a contact net geometric parameter real-time measurement method based on a single monitoring camera can accurately extract a pantograph slider contour line, can well distinguish a lead, a carrier cable and a dropper, accurately extract a contact line, improve measurement precision and reduce errors. Specifically, the method comprises the following steps:
the method comprises an image input step, a pantograph positioning step, a pantograph slide bar outline extraction step, a contact line extraction step, an intersection point obtaining step and a height and pull value calculation step, wherein the pantograph slide bar outline extraction step specifically refers to the steps of performing linear gray level enhancement on a pantograph region image reserved in the pantograph positioning step and calculating the edge of the pantograph region image after linear gray level enhancement by adopting a second-order difference method; calculating the length of the edge, and removing the shorter edge; after removing the shorter edge, connecting end points at two ends of the reserved edge into a straight line, judging an included angle between the straight line and the horizontal direction, reserving edge lines with the included angle meeting a set angle, and selecting an edge line at the uppermost end from the reserved edge lines as a pantograph slide bar contour line for output;
the contact line extraction step specifically includes the steps of obtaining a horizontal gradient map in the pantograph region image according to the pantograph region image reserved in the pantograph positioning step, and performing binarization processing on the gradient amplitude of the gradient map to obtain a binary map; carrying out opening operation processing on the binary image, carrying out straight line detection on the image subjected to the opening operation processing by utilizing Hough transform, and detecting all possible straight lines in the image; calculating the slope of each detected straight line in sequence, and reserving the straight lines with the slopes meeting set conditions; calculating the width of the line where each straight line is located, and screening out candidate lines meeting the set width; positioning a wire clamp area in the pantograph area image, and if a wire clamp is positioned, taking a candidate line in the center of the wire clamp area as a contact line to be output linearly; and if the line clamp cannot be positioned, calculating the distance and the slope difference between the output contact line in the image of the previous frame and the candidate line of the current frame in sequence, and selecting one candidate line with the shortest distance and the smallest slope difference as the contact line to be output linearly.
Inputting an acquired image of a single monitoring camera, wherein the image format is JPG coding, the image needs to be decoded into an original gray image, and the image input size is 2048 x 1536; the pantograph positioning step specifically comprises the steps of carrying out binarization processing on an input image and extracting a foreground image; solving the area outline of the extracted foreground image; and sequentially calculating the geometric features of the outlines of the areas, judging whether the geometric features of the outlines of the areas meet a set geometric feature threshold value, if not, determining the areas as interference areas, and filtering the interference areas to only reserve pantograph areas.
In the pantograph positioning step, extracting the foreground image specifically means traversing each pixel point in the input image, assigning the pixels within the range of [0, n ], where n is greater than or equal to 10 and less than or equal to 30 to 255, and assigning the remaining pixels to 0.
The specific step of obtaining the region contour of the extracted foreground image is that different boundaries are endowed with different integer values, the boundaries are determined to be outer boundaries, hole boundaries and hierarchical relations of the hole boundaries, then pixels on the boundaries are marked from a starting point, and the region contour is finally formed.
Specifically, a foreground image is input to
Figure DEST_PATH_IMAGE019
Represented as pixel values of the image, each line scan is terminated with two cases: (1)
Figure 873031DEST_PATH_IMAGE020
at this time
Figure 875623DEST_PATH_IMAGE019
Is the starting point of the outer boundary; (2)
Figure DEST_PATH_IMAGE021
at this time
Figure 212057DEST_PATH_IMAGE019
Is the starting point of the hole boundary; then, starting from the starting point, pixels on the boundary are marked, and finally, the region outline is formed.
The geometric characteristics of the region outline comprise region perimeter, region length, region width, region mass and region centroid.
The perimeter of the region refers to the number of contour points of the boundary of the region, and the length and the width of the region refer to the external rectangle of the region, and the length and the width of the region are obtained according to the external rectangle; the regional quality means that the zeroth order moment of the image is expressed as
Figure 438639DEST_PATH_IMAGE001
Wherein
Figure 680265DEST_PATH_IMAGE002
Represent an image in
Figure 220967DEST_PATH_IMAGE003
The gray value at the point, when the image is a binary image,
Figure 910443DEST_PATH_IMAGE004
is the sum of pixels of a white area of the image, which is usedSolving the gray quality of the white area; the centroid of the region means that the first moment of the image is expressed as
Figure 511189DEST_PATH_IMAGE005
Figure 974531DEST_PATH_IMAGE006
When the image is a binary image,
Figure 381242DEST_PATH_IMAGE002
is a value of 0 or 255,
Figure 613640DEST_PATH_IMAGE007
representing the accumulation of the x-coordinates of the white area on the image,
Figure 385287DEST_PATH_IMAGE008
representing the accumulation of y-coordinates of white areas on the image, the centroid of the image
Figure 148975DEST_PATH_IMAGE009
Figure 31480DEST_PATH_IMAGE010
And performing linear gray scale enhancement on the reserved pantograph region image, specifically, converting the gray scales of all points in the image according to a linear gray scale conversion function. In particular, images
Figure 383964DEST_PATH_IMAGE011
Representing the gray scale range before transformation is
Figure 388829DEST_PATH_IMAGE012
After transformation into
Figure 826764DEST_PATH_IMAGE013
Then, the gray scale linear transformation function expression is:
Figure 512960DEST_PATH_IMAGE014
(ii) a Transformed image
Figure 46184DEST_PATH_IMAGE013
To expand the gray scale range to
Figure 159633DEST_PATH_IMAGE015
The method for calculating the edge of the pantograph region image after linear gray scale enhancement by adopting a second-order difference method specifically means that under the condition of a continuous function, a maximum value or a minimum value in a first-order differential diagram represents the edge, a zero crossing point between the maximum value and the minimum value in the second-order differential diagram represents the edge, and then a first-order difference represents the edge
Figure 84864DEST_PATH_IMAGE022
(ii) a The second order difference is expressed as:
Figure DEST_PATH_IMAGE023
it can be derived from this that,
Figure 371489DEST_PATH_IMAGE024
extracting the coefficients [1, -2,1 ] thereof](ii) a In the case of two dimensions, the same can be said:
Figure DEST_PATH_IMAGE025
extracting coefficients of the above functions, expressed in the form of a template
Figure 511614DEST_PATH_IMAGE026
And performing convolution operation on the obtained two-dimensional template and the image to obtain the image edge.
In the step of extracting the outline of the pantograph slide bar, a rectangular coordinate system is established in a reserved pantograph area, a Y axis is represented in a top-down direction, an X axis is represented in a left-to-right direction, the edge length is calculated according to the edge of an image calculated by a second-order difference method, and a shorter edge is removed; sorting the coordinate points of each edge by taking the X axis as a reference; selecting end points at two ends of the edge line to be connected into a straight line, calculating an included angle between the straight line and the x axis, and leaving the edge line which accords with a set angle; and calculating the distance between a straight line formed by connecting two end points of the left edge line and a straight line with y =0, and selecting a contour line closest to the straight line as a pantograph slider contour line for output.
Or in the step of extracting the outline of the pantograph slide bar, establishing a rectangular coordinate system by using a reserved pantograph region, representing a Y axis by using a direction from bottom to top, representing an X axis by using a direction from left to right, calculating the edge length according to the edge of the image calculated by a second-order difference method, and removing a shorter edge; sorting the coordinate points of each edge by taking the X axis as a reference; selecting end points at two ends of the edge line to be connected into a straight line, calculating an included angle between the straight line and the x axis, and leaving the edge line which accords with a set angle; and calculating the distance between a straight line formed by connecting two end points of the left edge line and a straight line with y =0, and selecting a contour line with the farthest distance as a pantograph slide bar contour line for output.
The method for obtaining the gradient map in the horizontal direction in the pantograph region image comprises the following specific steps:
pixel point in image
Figure 530386DEST_PATH_IMAGE016
The gradient of (d) is:
Figure 5229DEST_PATH_IMAGE017
(1)
the binarization processing of the horizontal gradient amplitude of the gradient map specifically means setting a threshold value to be used for binarization processingG x (x,y) The pixels larger than the threshold are set to 255, and the remaining pixels are set to 0.
And calculating the width of the line where each straight line is located, specifically, taking any point of the straight line as a starting point, extracting the gray value gray of the straight line, searching pixel points leftwards and rightwards along the x direction, if the gray value of the point is equal to the gray, adding 1 to the width of the line, and otherwise, stopping searching.
In the intersection point obtaining step, the pantograph slide bar contour line output in the pantograph slide bar contour line extracting step is received, and a pantograph slide bar wheel is created according to the received pantograph slide bar contour lineA coordinate point set of the profile line is used for finding out the maximum value and the minimum value of the abscissa from the coordinate point set, and the median value of the abscissa is obtained according to the maximum value and the minimum value of the abscissa; sorting coordinate points in the coordinate point set of the pantograph slide bar contour line from small to large by taking the abscissa as a reference, and finding out the coordinate point of which the abscissa is equal to the solved median of the abscissa
Figure 33228DEST_PATH_IMAGE018
In terms of coordinate points
Figure 214811DEST_PATH_IMAGE018
A plurality of coordinate points are respectively expanded to the left and right of the adjacent central point, and are intercepted to form a new pantograph slider contour line coordinate point set; and performing linear fitting on the new coordinate point set of the pantograph slider contour line by using a least square method to obtain a linear equation of the coordinate point set, and solving the intersection point according to the linear equation of the contact line extracted in the contact line extraction step and the linear method of the pantograph slider contour line obtained after linear fitting.
Specifically, two end points p1, p2 on the contact line are known, and the linear expression of the contact line is as follows:
A1X+B1Y+C1=0 (2);
two end points p3, p4 on the contour line of the pantograph slide bar obtained after straight line fitting, and the straight line expression is as follows:
A2X+B2Y+C2=0 (3);
simultaneous equations (5) and (6), and let B1= -1, B2= -1, one can obtain:
X=(C1+Y)/A1 (4);
Y=(A2C1-A1C2)/(A2-A1) (5);
according to the known coordinate points, the values of equation coefficients A1, B1, C1, A2, B2 and C2 are obtained through solving, and the intersection point is further obtained according to the obtained equation coefficients.
In the step of obtaining the height guiding and pulling-out value, the camera calibration condition is that the coordinate of the center point x of the pantograph is superposed with the coordinate of the center point of the chessboard grid calibration plate, and the coordinate of the y is not required; the world coordinate system is established in the center of the chessboard, the horizontal right direction is the positive direction of x, and the vertical upward direction is the positive direction of y; the camera calibration means that intersection point image coordinates are converted into established world coordinates to obtain an actual physical position of an intersection point, and if coordinates obtained by converting an intersection point P into a world coordinate system are P (x, y), an obtained derivative height H and a pull-out value S are as follows:
H=L+Py (6);
s = Px (7); wherein L represents the distance of the center point of the checkerboard from the rail surface.
Example 2
Referring to fig. 1-8 of the specification, this embodiment discloses as another preferred embodiment of the present invention: a device for measuring geometrical parameters of a contact network in real time based on a single monitoring camera comprises an image input module, a pantograph positioning module, a pantograph slide bar outline extraction module, a contact line extraction module, an intersection point acquisition module and a height and pull value calculation module; the image input module is used for receiving the image transmitted by the single monitoring camera and transmitting the received image to the pantograph positioning module; the pantograph positioning module is used for positioning a pantograph area image in the image received by the image input module and transmitting the reserved pantograph area image to the pantograph slide bar outline extraction module and the contact line extraction module;
the pantograph slide bar outline extraction module is used for performing linear gray level enhancement on a pantograph region image reserved in the pantograph positioning module and calculating the edge of the pantograph region image subjected to linear gray level enhancement by adopting a second-order difference method; calculating the length of the edge, and removing the shorter edge; after removing the shorter edge, connecting end points at two ends of the reserved edge into a straight line, judging an included angle between the straight line and the horizontal direction, reserving edge lines with the included angle meeting a set angle, selecting an edge line at the uppermost end from the reserved edge lines as a pantograph slide bar contour line, and outputting the edge line to an intersection point solving module;
the contact line extraction module is used for receiving the pantograph region image transmitted by the pantograph positioning module, solving a horizontal gradient map in the pantograph region image according to the pantograph region image, and performing binarization processing on a gradient amplitude value of the gradient map to obtain a binary map; carrying out opening operation processing on the binary image, carrying out straight line detection on the image subjected to the opening operation processing by utilizing Hough transform, and detecting all possible straight lines in the image; calculating the slope of each detected straight line in sequence, and reserving the straight lines with the slopes meeting set conditions; calculating the width of the line where each straight line is located, and screening out candidate lines meeting the set width; positioning a wire clamp area in the pantograph area image, and if a wire clamp is positioned, taking a candidate line in the center of the wire clamp area as a contact line to be output linearly; if the line clamp can not be positioned, the distance and the slope difference between the output contact line in the image of the previous frame and the candidate line of the current frame are calculated in sequence, and one candidate line with the shortest distance and the smallest slope difference is selected as the contact line to be output to the intersection point solving module.
The image input module inputs the collected images of the single monitoring camera, the image format is JPG coding, the images need to be decoded into original gray images, and the image input size is 2048 x 1536; the pantograph positioning module is used for carrying out binarization processing on an input image and extracting a foreground image; solving the area outline of the extracted foreground image; and sequentially calculating the geometric features of the outlines of the areas, judging whether the geometric features of the outlines of the areas meet a set geometric feature threshold value, if not, determining the areas as interference areas, and filtering the interference areas to only reserve pantograph areas.
In the pantograph positioning module, extracting the foreground image specifically means traversing each pixel point in the input image, assigning pixels within a range of [0, n ], 10 ≦ n ≦ 30, to 255, and assigning the remaining pixels to 0.
The specific step of obtaining the region contour of the extracted foreground image is that different boundaries are endowed with different integer values, the boundaries are determined to be outer boundaries, hole boundaries and hierarchical relations of the hole boundaries, then pixels on the boundaries are marked from a starting point, and the region contour is finally formed.
Specifically, a foreground image is input to
Figure 981647DEST_PATH_IMAGE019
Represented as pixel values of the image, each line scan is terminated with two cases: (1)
Figure 615891DEST_PATH_IMAGE020
at this time
Figure 244318DEST_PATH_IMAGE019
Is the starting point of the outer boundary; (2)
Figure 545987DEST_PATH_IMAGE021
at this time
Figure 172140DEST_PATH_IMAGE019
Is the starting point of the hole boundary; then, starting from the starting point, pixels on the boundary are marked, and finally, the region outline is formed.
The geometric features of the zone profile include zone perimeter, zone length, zone width, zone mass, and zone centroid.
The perimeter of the region refers to the number of contour points of the boundary of the region, and the length and the width of the region refer to the external rectangle of the region, and the length and the width of the region are obtained according to the external rectangle; the regional quality means that the zeroth order moment of the image is expressed as
Figure 293680DEST_PATH_IMAGE001
Wherein
Figure 476531DEST_PATH_IMAGE002
Represent an image in
Figure 632706DEST_PATH_IMAGE003
The gray value at the point, when the image is a binary image,
Figure 429760DEST_PATH_IMAGE004
the sum of pixels of a certain white area of the image is used for solving the gray quality of the white area; the centroid of the region means that the first moment of the image is expressed as
Figure 100913DEST_PATH_IMAGE005
Figure 8826DEST_PATH_IMAGE006
When the image is a binary image,
Figure 19508DEST_PATH_IMAGE002
is a value of 0 or 255,
Figure 987464DEST_PATH_IMAGE007
representing the accumulation of the x-coordinates of the white area on the image,
Figure 398110DEST_PATH_IMAGE008
representing the accumulation of y-coordinates of white areas on the image, the centroid of the image
Figure 109714DEST_PATH_IMAGE009
Figure 974902DEST_PATH_IMAGE010
And performing linear gray scale enhancement on the reserved pantograph region image, specifically, converting the gray scales of all points in the image according to a linear gray scale conversion function. In particular, images
Figure 176076DEST_PATH_IMAGE011
Representing the gray scale range before transformation is
Figure 759504DEST_PATH_IMAGE012
After transformation into
Figure 274799DEST_PATH_IMAGE013
Then, the gray scale linear transformation function expression is:
Figure 994493DEST_PATH_IMAGE014
(ii) a Transformed image
Figure 117301DEST_PATH_IMAGE013
To expand the gray scale range to
Figure 188025DEST_PATH_IMAGE015
The method for calculating the edge of the pantograph region image after linear gray scale enhancement by adopting a second-order difference method specifically means that under the condition of a continuous function, a maximum value or a minimum value in a first-order differential diagram represents the edge, a zero crossing point between the maximum value and the minimum value in the second-order differential diagram represents the edge, and then a first-order difference represents the edge
Figure 241432DEST_PATH_IMAGE022
(ii) a The second order difference is expressed as:
Figure 143529DEST_PATH_IMAGE023
it can be derived from this that,
Figure 624189DEST_PATH_IMAGE024
extracting the coefficients [1, -2,1 ] thereof](ii) a In the case of two dimensions, the same can be said:
Figure 182209DEST_PATH_IMAGE025
extracting coefficients of the above functions, expressed in the form of a template
Figure 773727DEST_PATH_IMAGE026
And performing convolution operation on the obtained two-dimensional template and the image to obtain the image edge.
The pantograph slider outline extraction module establishes a rectangular coordinate system according to a reserved pantograph region, represents a Y axis in a top-down direction, represents an X axis in a left-to-right direction, calculates the edge length according to the edge of the image calculated by a second-order difference method, and removes a shorter edge; sorting the coordinate points of each edge by taking the X axis as a reference; selecting end points at two ends of the edge line to be connected into a straight line, calculating an included angle between the straight line and the x axis, and leaving the edge line which accords with a set angle; and calculating the distance between a straight line formed by connecting two end points of the left edge line and a straight line with y =0, and selecting a contour line closest to the straight line as a pantograph slider contour line for output.
Or the pantograph slide bar outline extraction module establishes a rectangular coordinate system by using a reserved pantograph region, represents a Y axis by using a direction from bottom to top, represents an X axis by using a direction from left to right, calculates the edge length according to the edge of the image calculated by a second-order difference method, and removes a shorter edge; sorting the coordinate points of each edge by taking the X axis as a reference; selecting end points at two ends of the edge line to be connected into a straight line, calculating an included angle between the straight line and the x axis, and leaving the edge line which accords with a set angle; and calculating the distance between a straight line formed by connecting two end points of the left edge line and a straight line with y =0, and selecting a contour line with the farthest distance as a pantograph slide bar contour line for output.
The method for obtaining the horizontal gradient map in the pantograph region image comprises the following specific steps:
pixel point in image
Figure 779598DEST_PATH_IMAGE016
The gradient of (d) is:
Figure 696739DEST_PATH_IMAGE017
(1)
the binarization processing of the gradient amplitude of the gradient map specifically means setting a threshold value to be used for binarization processingG x (x,y) The pixels larger than the threshold are set to 255, and the remaining pixels are set to 0.
And calculating the width of the line where each straight line is located, specifically, taking any point of the straight line as a starting point, extracting the gray value gray of the straight line, searching pixel points leftwards and rightwards along the x direction, if the gray value of the point is equal to the gray, adding 1 to the width of the line, and otherwise, stopping searching.
The intersection point calculating module receives the pantograph slide bar contour line output in the pantograph slide bar contour line extracting step, creates a pantograph slide bar contour line coordinate point set according to the received pantograph slide bar contour line, finds out an abscissa maximum value and an abscissa minimum value from the coordinate point set, and calculates an abscissa median value according to the abscissa maximum value and the abscissa minimum value; in the abscissaSequencing the coordinate points in the coordinate point set of the pantograph slide bar contour line from small to large as a reference, and finding out the coordinate point of which the abscissa is equal to the solved median of the abscissas
Figure 476476DEST_PATH_IMAGE018
In terms of coordinate points
Figure 934002DEST_PATH_IMAGE018
A plurality of coordinate points are respectively expanded to the left and right of the adjacent central point, and are intercepted to form a new pantograph slider contour line coordinate point set; and performing linear fitting on the new coordinate point set of the pantograph slider contour line by using a least square method to obtain a linear equation of the coordinate point set, and solving the intersection point according to the linear equation of the contact line extracted in the contact line extraction step and the linear method of the pantograph slider contour line obtained after linear fitting.
Specifically, two end points p1, p2 on the contact line are known, and the linear expression of the contact line is as follows:
A1X+B1Y+C1=0 (2);
two end points p3, p4 on the contour line of the pantograph slide bar obtained after straight line fitting, and the straight line expression is as follows:
A2X+B2Y+C2=0 (3);
simultaneous equations (5) and (6), and let B1= -1, B2= -1, one can obtain:
X=(C1+Y)/A1 (4);
Y=(A2C1-A1C2)/(A2-A1) (5);
according to the known coordinate points, the values of equation coefficients A1, B1, C1, A2, B2 and C2 are obtained through solving, and the intersection point is further obtained according to the obtained equation coefficients.
In the height leading and pulling value obtaining module, the camera calibration condition is that the coordinate of the center point x of the pantograph is superposed with the coordinate of the center point of the chessboard grid calibration plate, and the coordinate of the y is not required; the world coordinate system is established in the center of the chessboard, the horizontal right direction is the positive direction of x, and the vertical upward direction is the positive direction of y; the camera calibration means that intersection point image coordinates are converted into established world coordinates to obtain an actual physical position of an intersection point, and if coordinates obtained by converting an intersection point P into a world coordinate system are P (x, y), an obtained derivative height H and a pull-out value S are as follows:
H=L+Py (6);
s = Px (7); wherein L represents the distance of the center point of the checkerboard from the rail surface.
Example 3
As another preferred embodiment of the present invention, the present embodiment discloses a pantograph profile extraction method based on a single monitoring camera, which can accurately extract a pantograph slider profile and improve measurement accuracy.
A pantograph contour extraction method based on a single monitoring camera comprises an image input step, a pantograph positioning step and a pantograph slide bar contour extraction step, wherein the pantograph slide bar contour extraction step specifically refers to the steps of performing linear gray level enhancement on a pantograph region image reserved in the pantograph positioning step, and calculating the edge of the pantograph region image after the linear gray level enhancement by adopting a second-order difference method; calculating the length of the edge, and removing the shorter edge; and after the shorter edge is removed, connecting end points at two ends of the reserved edge into a straight line, judging an included angle between the straight line and the horizontal direction, reserving edge lines with the included angle meeting a set angle, and selecting an edge line at the uppermost end from the reserved edge lines to be used as a pantograph slide bar contour line for output.
Inputting an acquired image of a single monitoring camera, wherein the image format is JPG coding, the image needs to be decoded into an original gray image, and the image input size is 2048 x 1536; the pantograph positioning step specifically comprises the steps of carrying out binarization processing on an input image and extracting a foreground image; solving the area outline of the extracted foreground image; and sequentially calculating the geometric features of the outlines of the areas, judging whether the geometric features of the outlines of the areas meet a set geometric feature threshold value, if not, determining the areas as interference areas, and filtering the interference areas to only reserve pantograph areas.
In the pantograph positioning step, extracting the foreground image specifically means traversing each pixel point in the input image, assigning the pixels within the range of [0, n ], where n is greater than or equal to 10 and less than or equal to 30 to 255, and assigning the remaining pixels to 0.
The specific step of obtaining the region contour of the extracted foreground image is that different boundaries are endowed with different integer values, the boundaries are determined to be outer boundaries, hole boundaries and hierarchical relations of the hole boundaries, then pixels on the boundaries are marked from a starting point, and the region contour is finally formed.
Specifically, a foreground image is input to
Figure 748374DEST_PATH_IMAGE019
Represented as pixel values of the image, each line scan is terminated with two cases: (1)
Figure 570837DEST_PATH_IMAGE020
at this time
Figure 650919DEST_PATH_IMAGE019
Is the starting point of the outer boundary; (2)
Figure 849820DEST_PATH_IMAGE021
at this time
Figure 518698DEST_PATH_IMAGE019
Is the starting point of the hole boundary; then, starting from the starting point, pixels on the boundary are marked, and finally, the region outline is formed.
The geometric features of the zone profile include at least one of zone perimeter, zone length, zone width, zone mass, and zone centroid.
The perimeter of the region refers to the number of contour points of the boundary of the region, and the length and the width of the region refer to the external rectangle of the region, and the length and the width of the region are obtained according to the external rectangle; the regional quality means that the zeroth order moment of the image is expressed as
Figure 512062DEST_PATH_IMAGE001
Wherein
Figure 328708DEST_PATH_IMAGE002
Represent an image in
Figure 65720DEST_PATH_IMAGE003
The gray value at the point, when the image is a binary image,
Figure 589106DEST_PATH_IMAGE004
the sum of pixels of a certain white area of the image is used for solving the gray quality of the white area; the centroid of the region means that the first moment of the image is expressed as
Figure 333464DEST_PATH_IMAGE005
Figure 575090DEST_PATH_IMAGE006
When the image is a binary image,
Figure 850213DEST_PATH_IMAGE002
is a value of 0 or 255,
Figure 493684DEST_PATH_IMAGE007
representing the accumulation of the x-coordinates of the white area on the image,
Figure 891167DEST_PATH_IMAGE008
representing the accumulation of y-coordinates of white areas on the image, the centroid of the image
Figure 620089DEST_PATH_IMAGE009
Figure 698903DEST_PATH_IMAGE010
And performing linear gray scale enhancement on the reserved pantograph region image, specifically, converting the gray scales of all points in the image according to a linear gray scale conversion function. In particular, images
Figure 744351DEST_PATH_IMAGE011
Representing the gray scale range before transformation is
Figure 375052DEST_PATH_IMAGE012
After transformation into
Figure 60112DEST_PATH_IMAGE013
Then, the gray scale linear transformation function expression is:
Figure 677038DEST_PATH_IMAGE014
(ii) a Transformed image
Figure 29522DEST_PATH_IMAGE013
To expand the gray scale range to
Figure 972070DEST_PATH_IMAGE015
The method for calculating the edge of the pantograph region image after linear gray scale enhancement by adopting a second-order difference method specifically means that under the condition of a continuous function, a maximum value or a minimum value in a first-order differential diagram represents the edge, a zero crossing point between the maximum value and the minimum value in the second-order differential diagram represents the edge, and then a first-order difference represents the edge
Figure 410004DEST_PATH_IMAGE022
(ii) a The second order difference is expressed as:
Figure 142206DEST_PATH_IMAGE023
it can be derived from this that,
Figure 614776DEST_PATH_IMAGE024
extracting the coefficients [1, -2,1 ] thereof](ii) a In the case of two dimensions, the same can be said:
Figure 728225DEST_PATH_IMAGE025
extracting coefficients of the above functions, expressed in the form of a template
Figure 715773DEST_PATH_IMAGE026
Performing convolution operation on the obtained two-dimensional template and the image to obtain an image edgeA rim.
In the step of extracting the outline of the pantograph slide bar, a rectangular coordinate system is established in a reserved pantograph area, a Y axis is represented in a top-down direction, an X axis is represented in a left-to-right direction, the edge length is calculated according to the edge of an image calculated by a second-order difference method, and a shorter edge is removed; sorting the coordinate points of each edge by taking the X axis as a reference; selecting end points at two ends of the edge line to be connected into a straight line, calculating an included angle between the straight line and the x axis, and leaving the edge line which accords with a set angle; and calculating the distance between a straight line formed by connecting two end points of the left edge line and a straight line with y =0, and selecting a contour line closest to the straight line as a pantograph slider contour line for output.
Or in the step of extracting the outline of the pantograph slide bar, establishing a rectangular coordinate system by using a reserved pantograph region, representing a Y axis by using a direction from bottom to top, representing an X axis by using a direction from left to right, calculating the edge length according to the edge of the image calculated by a second-order difference method, and removing a shorter edge; sorting the coordinate points of each edge by taking the X axis as a reference; selecting end points at two ends of the edge line to be connected into a straight line, calculating an included angle between the straight line and the x axis, and leaving the edge line which accords with a set angle; and calculating the distance between a straight line formed by connecting two end points of the left edge line and a straight line with y =0, and selecting a contour line with the farthest distance as a pantograph slide bar contour line for output.
Example 4
As another preferred embodiment of the present invention, the present embodiment discloses: a pantograph contour extraction device based on a single monitoring camera comprises an image input module, a pantograph positioning module and a pantograph slider contour extraction module, wherein the image input module is used for receiving a pantograph image shot by the single monitoring camera and transmitting the received image to the pantograph positioning module; the pantograph slide bar outline extraction module performs linear gray level enhancement on the pantograph region image transmitted by the pantograph positioning module, and calculates the edge of the pantograph region image after linear gray level enhancement by adopting a second-order difference method; calculating the length of the edge, and removing the shorter edge; and after the shorter edge is removed, connecting end points at two ends of the reserved edge into a straight line, judging an included angle between the straight line and the horizontal direction, reserving edge lines with the included angle meeting a set angle, and selecting an edge line at the uppermost end from the reserved edge lines to be used as a pantograph slide bar contour line for output.
The image input module receives an acquired image of the single monitoring camera, the image format is JPG coding, the image is decoded into an original gray image, and the image output size is 2048 x 1536; the method comprises the steps of outputting an image to a pantograph positioning module, wherein the pantograph positioning module is used for carrying out binarization processing on the input image and extracting a foreground image; solving the area outline of the extracted foreground image; and sequentially calculating the geometric features of the outlines of the areas, judging whether the geometric features of the outlines of the areas meet a set geometric feature threshold value, if not, determining the areas as interference areas, and filtering the interference areas to only reserve pantograph areas.
The pantograph positioning module extracts the foreground image, specifically, traversing each pixel point in the input image, assigning a pixel within a range of [0, n ], 10 ≦ n ≦ 30, to 255, and assigning the remaining pixels to 0.
The specific step of obtaining the region contour of the extracted foreground image is that different boundaries are endowed with different integer values, the boundaries are determined to be outer boundaries, hole boundaries and hierarchical relations of the hole boundaries, then pixels on the boundaries are marked from a starting point, and the region contour is finally formed.
Specifically, a foreground image is input to
Figure 940081DEST_PATH_IMAGE019
Represented as pixel values of the image, each line scan is terminated with two cases: (1)
Figure 1578DEST_PATH_IMAGE020
at this time
Figure 98978DEST_PATH_IMAGE019
Is the starting point of the outer boundary; (2)
Figure 511504DEST_PATH_IMAGE021
at this time
Figure 539503DEST_PATH_IMAGE019
Is the starting point of the hole boundary; then, starting from the starting point, pixels on the boundary are marked, and finally, the region outline is formed.
The geometric features of the zone profile include at least one of zone perimeter, zone length, zone width, zone mass, and zone centroid.
The perimeter of the region refers to the number of contour points of the boundary of the region, and the length and the width of the region refer to the external rectangle of the region, and the length and the width of the region are obtained according to the external rectangle; the regional quality means that the zeroth order moment of the image is expressed as
Figure 783403DEST_PATH_IMAGE001
Wherein
Figure 973076DEST_PATH_IMAGE002
Represent an image in
Figure 872899DEST_PATH_IMAGE003
The gray value at the point, when the image is a binary image,
Figure 439009DEST_PATH_IMAGE004
the sum of pixels of a certain white area of the image is used for solving the gray quality of the white area; the centroid of the region means that the first moment of the image is expressed as
Figure 55192DEST_PATH_IMAGE005
Figure 415766DEST_PATH_IMAGE006
When the image is a binary image,
Figure 802885DEST_PATH_IMAGE002
is a value of 0 or 255,
Figure 172686DEST_PATH_IMAGE007
representing the accumulation of the x-coordinates of the white area on the image,
Figure 125599DEST_PATH_IMAGE008
representing the accumulation of y-coordinates of white areas on the image, the centroid of the image
Figure 922654DEST_PATH_IMAGE009
Figure 531489DEST_PATH_IMAGE010
And performing linear gray scale enhancement on the reserved pantograph region image, specifically, converting the gray scales of all points in the image according to a linear gray scale conversion function. In particular, images
Figure 518031DEST_PATH_IMAGE011
Representing the gray scale range before transformation is
Figure 528712DEST_PATH_IMAGE012
After transformation into
Figure 496668DEST_PATH_IMAGE013
Then, the gray scale linear transformation function expression is:
Figure 655117DEST_PATH_IMAGE014
(ii) a Transformed image
Figure 366721DEST_PATH_IMAGE013
To expand the gray scale range to
Figure 231909DEST_PATH_IMAGE015
The method for calculating the edge of the pantograph region image after linear gray scale enhancement by adopting a second-order difference method specifically means that under the condition of a continuous function, a maximum value or a minimum value in a first-order differential diagram represents the edge, a zero crossing point between the maximum value and the minimum value in the second-order differential diagram represents the edge, and then a first-order difference represents the edge
Figure 370767DEST_PATH_IMAGE022
(ii) a The second order difference is expressed as:
Figure 200DEST_PATH_IMAGE023
it can be derived from this that,
Figure 249916DEST_PATH_IMAGE024
extracting the coefficients [1, -2,1 ] thereof](ii) a In the case of two dimensions, the same can be said:
Figure 235189DEST_PATH_IMAGE025
extracting coefficients of the above functions, expressed in the form of a template
Figure 544948DEST_PATH_IMAGE026
And performing convolution operation on the obtained two-dimensional template and the image to obtain the image edge.
Furthermore, the pantograph slider outline extraction module establishes a rectangular coordinate system according to a reserved pantograph region, represents a Y axis in a top-down direction, represents an X axis in a left-to-right direction, calculates the edge length according to the edge of the image calculated by the second-order difference method, and removes a shorter edge; sorting the coordinate points of each edge by taking the X axis as a reference; selecting end points at two ends of the edge line to be connected into a straight line, calculating an included angle between the straight line and the x axis, and leaving the edge line which accords with a set angle; and calculating the distance between a straight line formed by connecting two end points of the left edge line and a straight line with y =0, and selecting a contour line closest to the straight line as a pantograph slider contour line for output.
Or the pantograph slide bar outline extraction module establishes a rectangular coordinate system by using a reserved pantograph region, represents a Y axis by using a direction from bottom to top, represents an X axis by using a direction from left to right, calculates the edge length according to the edge of the image calculated by a second-order difference method, and removes a shorter edge; sorting the coordinate points of each edge by taking the X axis as a reference; selecting end points at two ends of the edge line to be connected into a straight line, calculating an included angle between the straight line and the x axis, and leaving the edge line which accords with a set angle; and calculating the distance between a straight line formed by connecting two end points of the left edge line and a straight line with y =0, and selecting a contour line with the farthest distance as a pantograph slide bar contour line for output.
Example 5
As another preferred embodiment of the present invention, this embodiment discloses a contact line extraction method based on a single monitoring camera, and the present embodiment provides a contact line extraction method based on a single monitoring camera, which aims to solve the problems in the prior art that the interference of a contact line in an image cannot be eliminated, the contact line cannot be accurately extracted, the measurement accuracy is low, and the error is large. The contact line extraction method based on the single monitoring camera provided by the embodiment can well distinguish the lead, the carrier cable and the dropper, accurately extract the contact line, improve the measurement precision and reduce the error.
A contact line extraction method based on a single monitoring camera comprises an image input step, a pantograph positioning step and a contact line extraction step, wherein the contact line extraction step specifically comprises the steps of obtaining a horizontal gradient map in a pantograph area image according to the pantograph area image reserved in the pantograph positioning step, and carrying out binarization processing on the gradient amplitude of the gradient map to obtain a binary map; carrying out opening operation processing on the binary image, carrying out straight line detection on the image subjected to the opening operation processing by utilizing Hough transform, and detecting all possible straight lines in the image; calculating the slope of each detected straight line in sequence, and reserving the straight lines with the slopes meeting set conditions; calculating the width of the line where each straight line is located, and screening out candidate lines meeting the set width; positioning a wire clamp area in the pantograph area image, and if a wire clamp is positioned, taking a candidate line in the center of the wire clamp area as a contact line to be output linearly; and if the line clamp cannot be positioned, calculating the distance and the slope difference between the output contact line in the image of the previous frame and the candidate line of the current frame in sequence, and selecting one candidate line with the shortest distance and the smallest slope difference as the contact line to be output linearly.
And an image input step, wherein the acquired image of the single monitoring camera is input, the image format is JPG coding, the image needs to be decoded into an original gray image, and the image input size is 2048 × 1536.
The pantograph positioning step specifically comprises the steps of carrying out binarization processing on an input image and extracting a foreground image; solving the area outline of the extracted foreground image; and sequentially calculating the geometric features of the outlines of the areas, judging whether the geometric features of the outlines of the areas meet a set geometric feature threshold value, if not, determining the areas as interference areas, and filtering the interference areas to only reserve pantograph areas.
In the pantograph positioning step, extracting the foreground image specifically means traversing each pixel point in the input image, assigning the pixels within the range of [0, n ], where n is greater than or equal to 10 and less than or equal to 30 to 255, and assigning the remaining pixels to 0.
The specific step of obtaining the region contour of the extracted foreground image is that different boundaries are endowed with different integer values, the boundaries are determined to be outer boundaries, hole boundaries and hierarchical relations of the hole boundaries, then pixels on the boundaries are marked from a starting point, and the region contour is finally formed.
Specifically, a foreground image is input to
Figure 677989DEST_PATH_IMAGE019
Represented as pixel values of the image, each line scan is terminated with two cases: (1)
Figure 731395DEST_PATH_IMAGE020
at this time
Figure 571176DEST_PATH_IMAGE019
Is the starting point of the outer boundary; (2)
Figure 864885DEST_PATH_IMAGE021
at this time
Figure 157326DEST_PATH_IMAGE019
Is the starting point of the hole boundary; then, starting from the starting point, pixels on the boundary are marked, and finally, the region outline is formed.
The geometric features of the zone profile include at least one of zone perimeter, zone length, zone width, zone mass, and zone centroid.
The perimeter of the region refers to the number of contour points of the boundary of the region, and the length and the width of the region refer to the external rectangle of the region, and the length and the width of the region are obtained according to the external rectangle; the regional quality means that the zeroth order moment of the image is expressed as
Figure 76740DEST_PATH_IMAGE001
Wherein
Figure 771027DEST_PATH_IMAGE002
Represent an image in
Figure 422588DEST_PATH_IMAGE003
The gray value at the point, when the image is a binary image,
Figure 467904DEST_PATH_IMAGE004
the sum of pixels of a certain white area of the image is used for solving the gray quality of the white area; the centroid of the region means that the first moment of the image is expressed as
Figure 165909DEST_PATH_IMAGE005
Figure 714702DEST_PATH_IMAGE006
When the image is a binary image,
Figure 802744DEST_PATH_IMAGE002
is a value of 0 or 255,
Figure 132094DEST_PATH_IMAGE007
representing the accumulation of the x-coordinates of the white area on the image,
Figure 330994DEST_PATH_IMAGE008
representing the accumulation of y-coordinates of white areas on the image, the centroid of the image
Figure 734294DEST_PATH_IMAGE009
Figure 806286DEST_PATH_IMAGE010
The method for obtaining the horizontal gradient map in the pantograph region image comprises the following specific steps:
pixel point in image
Figure 560615DEST_PATH_IMAGE016
The gradient of (d) is:
Figure 297627DEST_PATH_IMAGE017
(1);
the binarization processing of the gradient amplitude of the gradient map specifically means setting a threshold value to be used for binarization processing
Figure DEST_PATH_IMAGE027
The pixels larger than the threshold are set to 255, and the remaining pixels are set to 0.
And calculating the width of the line where each straight line is located, specifically, taking any point of the straight line as a starting point, extracting the gray value gray of the straight line, searching pixel points leftwards and rightwards along the x direction, if the gray value of the point is equal to the gray, adding 1 to the width of the line, and otherwise, stopping searching.
Example 6
As another preferred embodiment of the present invention, the embodiment discloses a contact line extraction device based on a single monitoring camera, including an image input module, a pantograph positioning module and a contact line extraction module, where the image input module is configured to receive a pantograph image captured by the single monitoring camera and transmit the received image to the pantograph positioning module, the pantograph positioning module processes the received image, reserves a pantograph region image, and transmits the reserved pantograph region image to the contact line extraction module, and the contact line extraction module, according to the pantograph region image reserved in the pantograph positioning module, obtains a horizontal gradient map in the pantograph region image, and performs binarization processing on a gradient amplitude of the gradient map to obtain a binary map; carrying out opening operation processing on the binary image, carrying out straight line detection on the image subjected to the opening operation processing by utilizing Hough transform, and detecting all possible straight lines in the image; calculating the slope of each detected straight line in sequence, and reserving the straight lines with the slopes meeting set conditions; calculating the width of the line where each straight line is located, and screening out candidate lines meeting the set width; positioning a wire clamp area in the pantograph area image, and if a wire clamp is positioned, taking a candidate line in the center of the wire clamp area as a contact line to be output linearly; and if the line clamp cannot be positioned, calculating the distance and the slope difference between the output contact line in the image of the previous frame and the candidate line of the current frame in sequence, and selecting one candidate line with the shortest distance and the smallest slope difference as the contact line to be output linearly.
The image input module inputs the collected images of the single monitoring camera, the image format is JPG coding, the images need to be decoded into original gray images, and the image input size is 2048 x 1536.
The pantograph positioning module is used for carrying out binarization processing on an input image and extracting a foreground image; solving the area outline of the extracted foreground image; and sequentially calculating the geometric features of the outlines of the areas, judging whether the geometric features of the outlines of the areas meet a set geometric feature threshold value, if not, determining the areas as interference areas, and filtering the interference areas to only reserve pantograph areas.
In the pantograph positioning module, extracting the foreground image specifically means traversing each pixel point in the input image, assigning pixels within a range of [0, n ], 10 ≦ n ≦ 30, to 255, and assigning the remaining pixels to 0.
The specific step of obtaining the region contour of the extracted foreground image is that different boundaries are endowed with different integer values, the boundaries are determined to be outer boundaries, hole boundaries and hierarchical relations of the hole boundaries, then pixels on the boundaries are marked from a starting point, and the region contour is finally formed.
Specifically, a foreground image is input to
Figure 883329DEST_PATH_IMAGE019
Represented as pixel values of the image, each line scan is terminated with two cases: (1)
Figure 313174DEST_PATH_IMAGE020
at this time
Figure 289220DEST_PATH_IMAGE019
Is the starting point of the outer boundary; (2)
Figure 141507DEST_PATH_IMAGE021
at this time
Figure 784978DEST_PATH_IMAGE019
Is the starting point of the hole boundary; then, starting from the starting point, pixels on the boundary are marked, and finally, the region outline is formed.
The geometric features of the zone profile include at least one of zone perimeter, zone length, zone width, zone mass, and zone centroid.
The perimeter of the region refers to the number of contour points of the boundary of the region, and the length and the width of the region refer to the external rectangle of the region, and the length and the width of the region are obtained according to the external rectangle; the regional quality means that the zeroth order moment of the image is expressed as
Figure 120144DEST_PATH_IMAGE001
Wherein
Figure 911383DEST_PATH_IMAGE002
Represent an image in
Figure 990197DEST_PATH_IMAGE003
The gray value at the point, when the image is a binary image,
Figure 488175DEST_PATH_IMAGE004
the sum of pixels of a certain white area of the image is used for solving the gray quality of the white area; the centroid of the region means that the first moment of the image is expressed as
Figure 994243DEST_PATH_IMAGE005
Figure 23510DEST_PATH_IMAGE006
When the image is a binary image,
Figure 906015DEST_PATH_IMAGE002
is a value of 0 or 255,
Figure 258499DEST_PATH_IMAGE007
representing the accumulation of the x-coordinates of the white area on the image,
Figure 263364DEST_PATH_IMAGE008
representing the accumulation of y-coordinates of white areas on the image, the centroid of the image
Figure 701299DEST_PATH_IMAGE009
Figure 121916DEST_PATH_IMAGE010
The method for obtaining the horizontal gradient map in the pantograph region image comprises the following specific steps:
pixel point in image
Figure 594485DEST_PATH_IMAGE016
The gradient of (d) is:
Figure 756870DEST_PATH_IMAGE017
(1)。
the binarization processing of the gradient amplitude of the gradient map specifically means setting a threshold value to be used for binarization processing
Figure 682100DEST_PATH_IMAGE027
The pixels larger than the threshold are set to 255, and the remaining pixels are set to 0.
And calculating the width of the line where each straight line is located, specifically, taking any point of the straight line as a starting point, extracting the gray value gray of the straight line, searching pixel points leftwards and rightwards along the x direction, if the gray value of the point is equal to the gray, adding 1 to the width of the line, and otherwise, stopping searching.
Example 7
In order to achieve the above object, according to another aspect of the present application, there is also provided a computer-readable storage medium storing a computer program, which when executed in a computer processor, implements the steps in the above method for measuring geometrical parameters of a catenary in real time based on a single monitoring camera.
Example 8
In order to achieve the above object, according to another aspect of the present application, there is also provided a computer-readable storage medium storing a computer program which, when executed in a computer processor, implements the steps in the above single-monitored-camera-based pantograph contour extraction method.
Example 9
In order to achieve the above object, according to another aspect of the present application, there is also provided a computer-readable storage medium storing a computer program which, when executed in a computer processor, implements the steps in the above-mentioned single monitoring camera-based contact line extraction method.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a Flash Memory (Flash Memory), a Hard disk (Hard disk Drive, abbreviated as HDD) or a Solid State Drive (SSD), etc.; the storage medium may also comprise a combination of memories of the kind described above. It will be apparent to those skilled in the art that the modules or steps of the present invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and they may alternatively be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, or fabricated separately as individual integrated circuit modules, or fabricated as a single integrated circuit module from multiple modules or steps. Thus, the present invention is not limited to any specific combination of hardware and software.
Example 10
In order to achieve the above object, according to another aspect of the present application, there is also provided a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program to implement the steps in the above method for measuring geometric parameters of a catenary in real time based on a single monitoring camera.
Example 11
In order to achieve the above object, according to another aspect of the present application, there is also provided a computer device including a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the steps in the pantograph profile extraction method based on a single monitoring camera when executing the computer program.
Example 12
In order to achieve the above object, according to another aspect of the present application, there is also provided a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the steps in the above contact line extraction method based on a single monitoring camera when executing the computer program.
In the above embodiments 10-12, the processor may be a Central Processing Unit (CPU). The Processor may also be other general purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, or a combination thereof.
The memory, which is a non-transitory computer readable storage medium, may be used to store non-transitory software programs, non-transitory computer executable programs, and units, such as the corresponding program units in the above-described method embodiments of the present invention. The processor executes various functional applications of the processor and the processing of the work data by executing the non-transitory software programs, instructions and modules stored in the memory, that is, the method in the above method embodiment is realized.
The memory may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created by the processor, and the like. Further, the memory may include high speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory optionally includes memory located remotely from the processor, and such remote memory may be coupled to the processor via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The one or more units are stored in the memory and when executed by the processor perform the methods of embodiments 1, 3, 5 above.
The specific details of the computer device may be understood by referring to the corresponding related descriptions and effects in the above embodiments, and are not described herein again.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. The method for measuring the geometrical parameters of the contact network in real time based on the single monitoring camera comprises an image input step, a pantograph positioning step, a pantograph slide bar outline extraction step, a contact line extraction step, an intersection point obtaining step and a height and pull value calculation step, and is characterized in that:
the pantograph slide bar contour extraction step specifically comprises the following steps: performing linear gray scale enhancement on the pantograph region image reserved in the pantograph positioning step, and calculating the edge of the pantograph region image after the linear gray scale enhancement by adopting a second-order difference method; calculating the length of the edge, and removing the shorter edge; after removing the shorter edge, connecting end points at two ends of the reserved edge into a straight line, judging an included angle between the straight line and the horizontal direction, reserving edge lines with the included angle meeting a set angle, and selecting an edge line at the uppermost end from the reserved edge lines as a pantograph slide bar contour line for output;
the contact line extraction step specifically comprises the following steps: according to the pantograph region image reserved in the pantograph positioning step, obtaining a gradient map in the horizontal direction in the pantograph region image, and performing binarization processing on the gradient amplitude of the gradient map to obtain a binary map; carrying out opening operation processing on the binary image, carrying out straight line detection on the image subjected to the opening operation processing by utilizing Hough transform, and detecting all possible straight lines in the image; calculating the slope of each detected straight line in sequence, and reserving the straight lines with the slopes meeting set conditions; calculating the width of the line where each straight line is located, and screening out candidate lines meeting the set width; positioning a wire clamp area in the pantograph area image, and if a wire clamp is positioned, taking a candidate line in the center of the wire clamp area as a contact line to be output linearly; and if the line clamp cannot be positioned, sequentially calculating the distance and the slope difference between the output contact line in the image of the previous frame and the candidate line of the current frame, and selecting one candidate line with the shortest distance and/or the smallest slope difference as the contact line to be output linearly.
2. The method for measuring the geometric parameters of the overhead line system based on the single monitoring camera in real time as claimed in claim 1, wherein the method comprises the following steps: the pantograph positioning step specifically comprises the steps of carrying out binarization processing on an input image and extracting a foreground image; solving the area outline of the extracted foreground image; and sequentially calculating the geometric features of the outlines of the areas, judging whether the geometric features of the outlines of the areas meet a set geometric feature threshold value, if not, determining the areas as interference areas, and filtering the interference areas to only reserve pantograph areas.
3. The real-time measurement method for the geometric parameters of the overhead line system based on the single monitoring camera as claimed in claim 2, is characterized in that: the specific step of obtaining the region contour of the extracted foreground image is that different boundaries are endowed with different integer values, the boundaries are determined to be outer boundaries, hole boundaries and hierarchical relations of the hole boundaries, then pixels on the boundaries are marked from a starting point, and the region contour is finally formed.
4. The real-time measurement method for the geometric parameters of the overhead line system based on the single monitoring camera as claimed in claim 2, is characterized in that: the geometric features of the zone profile include at least one of zone perimeter, zone length, zone width, zone mass, and zone centroid.
5. The method for measuring the geometric parameters of the overhead line system based on the single monitoring camera in real time as claimed in claim 1, wherein the method comprises the following steps: and calculating the width of the line where each straight line is located, specifically, taking any point of the straight line as a starting point, extracting the gray value gray of the straight line, searching pixel points leftwards and rightwards along the x direction, if the gray value of the point is equal to the gray, adding 1 to the width of the line, and otherwise, stopping searching.
6. The method for measuring the geometric parameters of the overhead line system based on the single monitoring camera in real time as claimed in claim 1, wherein the method comprises the following steps: in the intersection point obtaining step, the pantograph slide bar contour line output in the pantograph slide bar contour line extracting step is received, a coordinate point set of the pantograph slide bar contour line is created according to the received pantograph slide bar contour line, the maximum value and the minimum value of the abscissa are found out from the coordinate point set, and the median of the abscissa is obtained according to the maximum value and the minimum value of the abscissa; sorting coordinate points in the coordinate point set of the pantograph slide bar contour line from small to large by taking the abscissa as a reference, and finding out the coordinate point of which the abscissa is equal to the solved median of the abscissa
Figure DEST_PATH_IMAGE002
In terms of coordinate points
Figure 342007DEST_PATH_IMAGE002
A plurality of coordinate points are respectively expanded to the left and right of the adjacent central point, and are intercepted to form a new pantograph slider contour line coordinate point set; and performing linear fitting on the new coordinate point set of the pantograph slider contour line by using a least square method to obtain a linear equation of the coordinate point set, and solving the intersection point according to the linear equation of the contact line extracted in the contact line extraction step and the linear method of the pantograph slider contour line obtained after linear fitting.
7. The method for measuring the geometric parameters of the overhead line system based on the single monitoring camera in real time as claimed in claim 1, wherein the method comprises the following steps: in the step of obtaining the lead-height and the pull-out value, the intersection point P acquired in the image is converted into a coordinate P (x, y) of a world coordinate system according to a camera calibration result, and the obtained lead-height H and the pull-out value S are as follows:
H=L+Py;
s = Px; the camera calibration condition is to ensure that the x coordinate of the center point of the bow is coincident with the coordinate of the center point of the chessboard calibration plate, the y coordinate does not make a requirement, a world coordinate system is established at the center of the chessboard, the horizontal right direction is the positive direction of x, and the vertical upward direction is the positive direction of y.
8. Contact net geometric parameters real-time measurement device based on single surveillance camera machine, its characterized in that: the pantograph control system comprises an image input module, a pantograph positioning module, a pantograph slide bar outline extraction module, a contact line extraction module, an intersection point acquisition module and a height guide and pull value calculation module; the image input module is used for receiving the image transmitted by the single monitoring camera and transmitting the received image to the pantograph positioning module; the pantograph positioning module is used for positioning a pantograph area image in the image received by the image input module and transmitting the reserved pantograph area image to the pantograph slide bar outline extraction module and the contact line extraction module;
the pantograph slide bar outline extraction module is used for performing linear gray level enhancement on a pantograph region image reserved in the pantograph positioning module and calculating the edge of the pantograph region image subjected to linear gray level enhancement by adopting a second-order difference method; calculating the length of the edge, and removing the shorter edge; after removing the shorter edge, connecting end points at two ends of the reserved edge into a straight line, judging an included angle between the straight line and the horizontal direction, reserving edge lines with the included angle meeting a set angle, selecting an edge line at the uppermost end from the reserved edge lines as a pantograph slide bar contour line, and outputting the edge line to an intersection point solving module;
the contact line extraction module is used for receiving the pantograph region image transmitted by the pantograph positioning module, solving a gradient map in the horizontal direction in the pantograph region image according to the pantograph region image, and performing binarization processing on a gradient amplitude value of the gradient map to obtain a binary map; carrying out opening operation processing on the binary image, carrying out straight line detection on the image subjected to the opening operation processing by utilizing Hough transform, and detecting all possible straight lines in the image; calculating the slope of each detected straight line in sequence, and reserving the straight lines with the slopes meeting set conditions; calculating the width of the line where each straight line is located, and screening out candidate lines meeting the set width; positioning a wire clamp area in the pantograph area image, and if a wire clamp is positioned, taking a candidate line in the center of the wire clamp area as a contact line to be output linearly; if the line clamp can not be positioned, the distance and the slope difference between the output contact line in the image of the previous frame and the candidate line of the current frame are sequentially calculated, and one candidate line with the shortest distance and/or the smallest slope difference is selected as the contact line straight line to be output to the intersection point solving module.
9. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program, which when executed in a computer processor, implements the steps of the method for measuring geometrical parameters of a catenary in real time based on a single monitoring camera according to any one of claims 1 to 7.
10. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the method for measuring geometrical parameters of a catenary based on a single monitoring camera in real time according to any one of claims 1 to 7.
CN201911228863.3A 2019-12-04 2019-12-04 Contact net geometric parameter real-time measuring method and device based on single monitoring camera Active CN110910443B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911228863.3A CN110910443B (en) 2019-12-04 2019-12-04 Contact net geometric parameter real-time measuring method and device based on single monitoring camera

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911228863.3A CN110910443B (en) 2019-12-04 2019-12-04 Contact net geometric parameter real-time measuring method and device based on single monitoring camera

Publications (2)

Publication Number Publication Date
CN110910443A true CN110910443A (en) 2020-03-24
CN110910443B CN110910443B (en) 2023-03-21

Family

ID=69822033

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911228863.3A Active CN110910443B (en) 2019-12-04 2019-12-04 Contact net geometric parameter real-time measuring method and device based on single monitoring camera

Country Status (1)

Country Link
CN (1) CN110910443B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111723794A (en) * 2020-06-24 2020-09-29 西南交通大学 Real-time flexible contact net positioning point identification method
CN112985263A (en) * 2021-02-09 2021-06-18 中国科学院上海微***与信息技术研究所 Method, device and equipment for detecting geometrical parameters of bow net
CN113763379A (en) * 2021-09-23 2021-12-07 成都唐源电气股份有限公司 Method and device for detecting broken string of dropper, computer equipment and storage medium
CN114322768A (en) * 2021-12-29 2022-04-12 成都翰瑞威自动化测控设备有限责任公司 Mobile contact net geometric parameter measuring system, method and device
CN114549440A (en) * 2022-02-11 2022-05-27 广州科易光电技术有限公司 Method and device for detecting dynamic geometric parameters of contact network and electronic equipment
CN116242316A (en) * 2023-03-31 2023-06-09 合肥中车轨道交通车辆有限公司 Method and device for detecting positioning points of rigid contact net in real time

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100322465A1 (en) * 2007-08-06 2010-12-23 Qr Limited Pantograph damage and wear monitoring system
CN103759658A (en) * 2014-01-27 2014-04-30 成都国铁电气设备有限公司 Method for detecting contact net geometrical parameters based on infrared image processing
CN104794720A (en) * 2015-05-04 2015-07-22 成都唐源电气有限责任公司 Method and system for positioning steady ears in catenary images
CN105740539A (en) * 2016-01-29 2016-07-06 中铁第一勘察设计院集团有限公司 Bracket preassembling method based on parameterized parametric constraint model
CN106403828A (en) * 2016-08-30 2017-02-15 成都唐源电气股份有限公司 Monorail contact line remain height measurement method based on checkerboard calibration and monorail contact line remain height measurement system thereof
CN108694349A (en) * 2017-04-07 2018-10-23 成都唐源电气股份有限公司 A kind of pantograph image extraction method and device based on line-scan digital camera
CN108917621A (en) * 2018-06-29 2018-11-30 南京航空航天大学 A kind of pantograph pan top edge single pixel tracking detection method
CN110174059A (en) * 2019-06-12 2019-08-27 合肥中车轨道交通车辆有限公司 A kind of pantograph based on monocular image is led high and pulls out value measurement method

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100322465A1 (en) * 2007-08-06 2010-12-23 Qr Limited Pantograph damage and wear monitoring system
CN103759658A (en) * 2014-01-27 2014-04-30 成都国铁电气设备有限公司 Method for detecting contact net geometrical parameters based on infrared image processing
CN104794720A (en) * 2015-05-04 2015-07-22 成都唐源电气有限责任公司 Method and system for positioning steady ears in catenary images
CN105740539A (en) * 2016-01-29 2016-07-06 中铁第一勘察设计院集团有限公司 Bracket preassembling method based on parameterized parametric constraint model
CN106403828A (en) * 2016-08-30 2017-02-15 成都唐源电气股份有限公司 Monorail contact line remain height measurement method based on checkerboard calibration and monorail contact line remain height measurement system thereof
CN108694349A (en) * 2017-04-07 2018-10-23 成都唐源电气股份有限公司 A kind of pantograph image extraction method and device based on line-scan digital camera
CN108917621A (en) * 2018-06-29 2018-11-30 南京航空航天大学 A kind of pantograph pan top edge single pixel tracking detection method
CN110174059A (en) * 2019-06-12 2019-08-27 合肥中车轨道交通车辆有限公司 A kind of pantograph based on monocular image is led high and pulls out value measurement method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
菜鸟知识搬运工: "OpenCV3学习(9.1)图像轮廓查找与绘制函数findContours()与drawContours()", 《HTTPS://BLOG.CSDN.NET/QQ_30815237/ARTICLE/DETAILS/86890067》 *
还浴月: "形态学图像处理1", 《HTTPS://WWW.JIANSHU.COM/P/85AD9DDBBCD3》 *

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111723794A (en) * 2020-06-24 2020-09-29 西南交通大学 Real-time flexible contact net positioning point identification method
CN111723794B (en) * 2020-06-24 2022-07-22 西南交通大学 Real-time flexible contact net positioning point identification method
CN112985263A (en) * 2021-02-09 2021-06-18 中国科学院上海微***与信息技术研究所 Method, device and equipment for detecting geometrical parameters of bow net
CN113763379A (en) * 2021-09-23 2021-12-07 成都唐源电气股份有限公司 Method and device for detecting broken string of dropper, computer equipment and storage medium
CN113763379B (en) * 2021-09-23 2023-07-18 成都唐源电气股份有限公司 Hanger strand breakage detection method and device, computer equipment and storage medium
CN114322768A (en) * 2021-12-29 2022-04-12 成都翰瑞威自动化测控设备有限责任公司 Mobile contact net geometric parameter measuring system, method and device
CN114322768B (en) * 2021-12-29 2022-08-26 成都翰瑞威自动化测控设备有限责任公司 Mobile contact net geometric parameter measuring system, method and device
CN114549440A (en) * 2022-02-11 2022-05-27 广州科易光电技术有限公司 Method and device for detecting dynamic geometric parameters of contact network and electronic equipment
CN116242316A (en) * 2023-03-31 2023-06-09 合肥中车轨道交通车辆有限公司 Method and device for detecting positioning points of rigid contact net in real time
CN116242316B (en) * 2023-03-31 2024-05-14 合肥中车轨道交通车辆有限公司 Method and device for detecting positioning points of rigid contact net in real time

Also Published As

Publication number Publication date
CN110910443B (en) 2023-03-21

Similar Documents

Publication Publication Date Title
CN110910443B (en) Contact net geometric parameter real-time measuring method and device based on single monitoring camera
US11958197B2 (en) Visual navigation inspection and obstacle avoidance method for line inspection robot
CN107014294B (en) Contact net geometric parameter detection method and system based on infrared image
CN104331876B (en) Method for detecting straight line and processing image and related device
CN106679567A (en) Contact net and strut geometric parameter detecting measuring system based on binocular stereoscopic vision
Zhang et al. A robust pantograph–catenary interaction condition monitoring method based on deep convolutional network
CA2959967C (en) Identification of a contact point between a pantograph and a power supply line in an image
CN105203552A (en) 360-degree tread image detecting system and method
CN104268519B (en) Image recognition terminal and its recognition methods based on pattern match
CN110097591B (en) Bow net state detection method
CN108921164B (en) Contact net locator gradient detection method based on three-dimensional point cloud segmentation
CN105426894B (en) Railway plug pin image detecting method and device
CN109376740A (en) A kind of water gauge reading detection method based on video
CN107578397A (en) A kind of novel non-contact abrasion of contact wire detection method
CN108734715B (en) Contact net rigid wire identification method and device for adaptive learning
CN108765393B (en) Method for detecting vibration behavior of high-speed railway contact net
CN111242052B (en) Automatic distinguishing method and device for rigid-flexible wires of contact net
CN110782411B (en) Anti-vibration hammer slip identification method based on image processing
CN111127381B (en) Non-parallel detection method for pantograph slide plate
Zheng et al. Rail detection based on LSD and the least square curve fitting
CN115272852A (en) Method, equipment and medium for identifying hidden danger of power transmission line protection area
CN108759671B (en) Dynamic detection method for contact line abrasion
JP2013210991A (en) Apparatus and method for detecting crossing
CN114638835B (en) Sleeper foreign matter detection method based on depth camera
JP5952759B2 (en) Overhead wire position measuring apparatus and method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant