Real-time flexible contact net positioning point identification method

文档序号:1113572 发布日期:2020-09-29 浏览:6次 中文

阅读说明:本技术 一种实时柔性接触网定位点识别方法 (Real-time flexible contact net positioning point identification method ) 是由 于龙 高仕斌 占栋 *** 张楠 于 2020-06-24 设计创作,主要内容包括:本发明属于本发明接触网智能检测技术领域,公开了一种实时柔性接触网定位点识别方法,包括图像预处理步骤、柔性接触线区域定位步骤和柔性定位点定位步骤,先对图像中的柔性接触线区域进行初步识别,然后在进行柔性定位点的具体精确定位,是一种基于图像处理检测技术的非接触式的柔性接触线定位点检测方法。(The invention belongs to the technical field of intelligent detection of a contact network, and discloses a real-time flexible contact network positioning point identification method which comprises an image preprocessing step, a flexible contact line region positioning step and a flexible positioning point positioning step.)

1. A real-time flexible contact net positioning point identification method is characterized by comprising the following steps:

an image preprocessing step, namely acquiring an original image and performing gray level enhancement processing on the original image;

a flexible contact line region positioning step, namely forming a candidate region by sequentially performing horizontal gradient calculation, line extraction and line clustering on the image subjected to gray level enhancement processing, and performing region screening processing on the candidate region to position a flexible contact line region in the image;

a flexible positioning point positioning step, namely firstly, taking the flexible contact line region positioned in the contact line region positioning step as an input image, traversing gray image pixel points of the input image, respectively counting pixel segments with continuous gray values of more than a set threshold value in the directions of 0 degree, 45 degrees, 90 degrees and 135 degrees as a stroke, and screening out a characteristic stroke according to whether the stroke length meets the set threshold value; then traversing all the characteristic strokes, expanding the characteristic strokes to the periphery by taking the middle points of the characteristic strokes as centers, intercepting a small image with a set size and carrying out binarization processing on the small image; and then carrying out connected domain processing on the small images subjected to binarization processing, calculating geometric parameter characteristics including area, length-width ratio and perimeter value of the connected domain, and marking the connected domain with each geometric parameter characteristic meeting set conditions as a flexible positioning point for output.

2. The method for identifying the positioning point of the flexible contact line in real time according to claim 1, wherein the method comprises the following steps: the image preprocessing step is to calculate a gradient value of each pixel point in the original image G (x, y) by using a numerical gradient function gradient (x, y), and superimpose the gradient value and the original image G (x, y) to obtain an enhanced image G '(x, y), that is, G' (x, y) is equal to G (x, y) + gradient (x, y).

3. The method for identifying the positioning point of the flexible contact line in real time as claimed in claim 2, wherein in the flexible contact line region positioning step, the horizontal gradient calculation is to perform gradient calculation in the x direction on the image processed in the image preprocessing step, so as to filter gradient information in other directions in the image, wherein the gradient in the x direction of each pixel point (x, y) in the image is as follows:

Gx(x,y)=H(x+1,y)-H(x-1,y)

h (x +1, y) and H (x-1, y) are gray values of pixel points on two sides of the pixel point (x, y).

4. The method for identifying the positioning point of the flexible contact line in real time according to claim 3, wherein the method comprises the following steps: in the flexible contact line region positioning step, the line extraction is to set a fixed gray threshold, sequentially traverse each pixel point in the image after the gradient calculation according to lines, and mark the gray value of a certain pixel point as 1 when the gray value of the certain pixel point is greater than the threshold; then, calculating the midpoint of an interval of the interval marked as 1 continuously in each line, wherein the midpoint is used as a line candidate point of the interval; and then connecting the line candidate points of two adjacent lines within the distance of the specified pixel in the x direction and outputting the line candidate points as the same line.

5. The method for identifying the positioning point of the flexible contact line in real time according to claim 4, wherein the method comprises the following steps: in the step of positioning the flexible contact line region, line clustering firstly sequentially traverses each line obtained by extracting the lines, calculates the average value x _ mean of all pixel points in each line in the x direction, and sorts all the lines from small to large according to the x _ mean;

clustering the lines after sequencing, classifying the first line into a first class, namely the first line after sequencing, traversing each line from left to right from the second line in turn, calculating the distance between the line and the first line and the last line in all the previous classes in the x direction by using the average value x _ mean, classifying the lines into the same class if the distance meets the threshold condition, and classifying the lines into one class if the distance does not meet the threshold condition of the distance with all the previous classes; finally, each class is a contact line candidate area.

6. The method for identifying the positioning point of the flexible contact line in real time according to claim 5, wherein the method comprises the following steps: in the flexible contact line region positioning step, region screening is to calculate the region widths of all candidate regions obtained after line clustering, calculate the difference between the x _ mean of the first line and the last line as the region width according to the average value x _ mean of all pixel points in the x direction obtained by the line clustering, and screen out the flexible contact line region according to whether the region width meets the threshold region of the flexible contact line region width.

7. The method for identifying the positioning point of the flexible contact line in real time according to claim 1, wherein the method comprises the following steps:

the threshold value set by binarization processing in the flexible positioning point positioning step is determined by adopting an iterative optimal threshold value mode;

the aspect ratio of the connected domain is calculated by calculating the centroid of the region and then calculating the major axis and the minor axis of the region according to the centroid, specifically, assuming that the binary image f (x, y) and the area of the region is S, the centroid coordinate is

Figure FDA0002555985970000021

after the centroid of the region is obtained, traversing each coordinate point of the connected domain, and calculating the closest point p1 and the farthest point p2 from the centroid in the region; defining the distance between the closest point p1 and the centroid as the short axis D1, and the distance between the farthest point p2 and the centroid as the long axis D2, the aspect ratio pwr is D2/D1.

8. The method for identifying the positioning point of the flexible contact line in real time according to claim 1, wherein the method comprises the following steps: in the step of positioning the flexible positioning points, the perimeter of the connected domain is calculated, namely the area occupied by the boundary pixel points is defined as the perimeter, namely the number of the pixel points occupied by the boundary points;

or the length of the curve coded by 8-chain codesWherein N is1Number of pixel points, N, indicating a pointing direction of 0, 2, 4, 62The number of pixel points pointing to 1, 3, 5, 7.

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 real-time flexible contact line location point identification method according to any one of the preceding claims 1 to 8.

10. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the real-time flexible contact network location point identification method according to any one of claims 1 to 8 when executing the computer program.

Technical Field

The invention belongs to the technical field of intelligent detection of a contact network, and particularly relates to a real-time flexible contact network positioning point identification method.

Background

In the design of an electrified railway, a contact network mainly comprises a contact suspension device, a positioning device, a supporting device, a support column, related infrastructure and the like, and is a special power transmission line erected in the air along a railway line. Its function is to provide electric energy to the electric locomotive through the contact between the wire and the pantograph. And two state parameters are mainly referred to for evaluating the current collection performance of the contact network: geometric parameters and kinetic parameters. The geometric parameters comprise the height of the wire, the pull-out value, the gradient of the positioning pipe, the line fork, the abrasion of the wire, the position of the strut and the like, and the geometric parameter evaluation of the contact network requires accurate positioning detection of the positioning point of the contact network.

The positioning point detection technology is applied to the contact network, is used as a basis for triggering an area-array camera to acquire and shoot images in a contact network defect detection system, and is also used as a basis for storing and managing one-rod one-file data. Whether the positioning point is detected accurately or not greatly influences the triggering accuracy of the area-array camera, and further influences the subsequent data analysis difficulty, increases the missing detection rate and the workload of data analysis and the accuracy of one-level-one-file data storage.

In the prior art, there are some overhead line system identification and maintenance technical solutions based on radar detection technology, for example, chinese utility model patent documents with publication number CN205097980U, publication time of 2016, 3, and 23 days, entitled "overhead line system detection and maintenance vehicle based on laser radar", the disclosed technical solution includes a detection vehicle body, a data acquisition unit, a lifting and rotating operation platform, and a server for data analysis and processing; the data acquisition unit is arranged on the detection vehicle body, and the lifting rotary operation platform is arranged behind the top of the detection vehicle body in a lifting and rotating manner; a display and control panel is arranged on the lifting rotary operation platform; the server is respectively connected with the data acquisition unit and the display and control panel, and the data acquired by the data acquisition unit is analyzed and processed by the server and then transmitted to the display and control panel. However, according to practical experience, the radar-based detection technology has the defects that the detection frequency is low, the detection technology is not suitable for a train with a high speed, and the defects are obvious under the requirement of the current rail transit speed increase.

Besides the detection technology based on radar, there are other technical solutions suitable for detecting the location point of the catenary, such as the detection technology based on an electronic tag and the detection technology based on GPS, but these new technologies also have some problems: although the detection technology based on the electronic tags has high detection precision, the investment cost is too large, and the detection technology can be realized only by adding corresponding electronic tags on all detected objects, which can be realized only by ultrahigh investment of material resources and manpower, particularly for the reconstruction of the existing line; the detection technology based on the GPS also has the problems of high construction and operation and maintenance cost, and the technology has poor signals under the conditions of tunnels and shielding and interference, is easy to miss positioning and has insufficient precision.

Disclosure of Invention

In order to overcome the problems and disadvantages in the prior art, the present invention aims to provide a non-contact flexible contact line location point detection algorithm based on an image processing detection technology.

The invention discloses a real-time flexible contact net positioning point identification method, which comprises the following steps:

an image preprocessing step, namely acquiring an original image and performing gray level enhancement processing on the original image;

a flexible contact line region positioning step, namely forming a candidate region by sequentially performing horizontal gradient calculation, line extraction and line clustering on the image subjected to gray level enhancement processing, and performing region screening processing on the candidate region to position a flexible contact line region in the image;

a flexible positioning point positioning step, namely firstly, taking the flexible contact line region positioned in the contact line region positioning step as an input image, traversing gray image pixel points of the input image, respectively counting pixel segments with continuous gray values of more than a set threshold value in the directions of 0 degree, 45 degrees, 90 degrees and 135 degrees as strokes, namely strokes with all lengths, and extracting characteristic strokes according to whether the stroke lengths accord with the set threshold value; then traversing all the characteristic strokes, expanding the characteristic strokes to the periphery by taking the middle points of the characteristic strokes as centers, intercepting a small image with a set size and carrying out binarization processing on the small image; and carrying out connected domain processing on the small graph subjected to binarization processing, calculating geometric parameter characteristics including area, length-width ratio and perimeter value of the connected domain, and marking the connected domain with each geometric parameter characteristic meeting set conditions as a flexible positioning point for output.

Specifically, the threshold is set in the flexible positioning point positioning step and is determined in an iterative optimal threshold mode, the iterative optimal threshold is assumed to have no prior knowledge of the exact position of the related object, as a first step approximation, four corners of the image are considered to contain background pixels, and other parts of the image contain object pixels, specifically, in the t step, the gray level mean values of the background and the object are respectively calculatedAnd

Figure BDA0002555985980000022

wherein the threshold for segmenting the image into background and object at the T-th step is TtIt is determined at step S3:

S1,

Figure BDA0002555985980000023

s2, placingTt+1An updated background and object discrimination is provided.

S3, if Tt+1=TtStopping; otherwise, the operation returns to the step S2.

The area of the connected domain, the area of the region, that is, the number of pixels in the pixel point set of the region, that is, the number of pixels included in the boundary of the region, is calculated, and specifically, a connected domain of the binary image f (x, y) is setIs of a size M x N,

wherein:

then the area of the region is

Further, the aspect ratio of the connected domain may be obtained by calculating a centroid of the region and then calculating a major axis and a minor axis of the region according to the centroid, and specifically, assuming that the binary image f (x, y) and the area of the region is S, the centroid coordinate is S

Figure BDA0002555985980000034

After the centroid of the region is obtained, traversing each coordinate point of the connected domain, and calculating the closest point p1 and the farthest point p2 from the centroid in the region; defining the distance between the closest point p1 and the centroid as the short axis D1, and the distance between the farthest point p2 and the centroid as the long axis D2, the aspect ratio pwr is D2/D1.

The calculation of the perimeter of the connected domain mainly has two defining modes:

1. length of curve coded with 8-chain code:

Figure BDA0002555985980000035

wherein N is1The number of pixel points with pointing directions of 0, 2, 4 and 6 is represented; n is a radical of2Number of pixel points pointing to 1, 3, 5, 7;

2. the area occupied by the boundary pixel points is defined as the perimeter, namely the number of the pixel points occupied by the boundary points.

Then, the image preprocessing step is to calculate a gradient value of each pixel point in the original image G (x, y) by using a numerical gradient function gradient (x, y), and superimpose the result with the original image G (x, y) to obtain an enhanced image G '(x, y), that is, G' (x, y) is equal to G (x, y) + gradient (x, y), if the values of adjacent pixels in the image change, that is, there is a gradient, the gradient is added to the corresponding original pixel, and the gray value is increased; on the contrary, if the gradient is 0, the original pixels are unchanged, that is, the contrast of the new image after addition is obviously enhanced, especially the outlines and edges of objects in the image are obviously different from the background.

In the step of locating the contact line region, the gradient calculation is to obtain a gradient map of the image in one direction and remove interference with objects in other directions to reduce the processing time of a subsequent program, and the specific method of the gradient calculation is as follows: the image subjected to the enhancement processing in the image preprocessing step is arranged along the Y direction, the angle between the contact line area and the x axis is about 90 degrees when viewed from the image, the image subjected to the enhancement processing in the image preprocessing step is subjected to gradient calculation in the x direction, and gradient information in other directions in the image is filtered, wherein the gradient of each pixel point (x, Y) in the x direction is

Gx(x,y)=H(x+1,y)-H(x-1,y)

H (x +1, y) and H (x-1, y) are gray values of pixel points on two sides of the pixel point.

Preferably, in the step of locating the contact line region, the line extraction is to set a fixed gray threshold, sequentially traverse each pixel point in the image after the gradient calculation by row, and mark a certain pixel point as 1 when the gray value of the certain pixel point is greater than the threshold; then, calculating the midpoint of an interval of the interval marked as 1 continuously in each line, wherein the midpoint is used as a line candidate point of the interval; and then connecting the line candidate points of two adjacent lines within the distance of the specified pixel in the x direction and outputting the line candidate points as the same line, otherwise, outputting the line candidate points as different lines.

In the step of locating the contact line region, line clustering firstly sequentially traverses each line obtained by extracting the lines, calculates an average value x _ mean of all pixel points in each line in the x direction, and sorts all the lines from small to large according to the x _ mean, namely sorts all the lines from left to right in the x direction;

clustering the sequenced lines, wherein line clustering is to form a candidate area, classifying a first line into a first class, namely the first line after sequencing is finished, traversing each line from left to right from the second line in turn, calculating the distance between the line and the first line and the last line in all the previous classes in the x direction by using the average value x _ mean, classifying the line into the same class if the distance meets a threshold condition, and classifying the line into one class if the distance does not meet the threshold condition of the distance with all the previous classes; finally, each class is a contact line candidate area.

In the contact line area positioning step, area screening is to calculate the area widths of all candidate areas obtained after line clustering, the average value x _ mean of all pixel points of all lines in the candidate areas in the x direction is known, the difference between the x _ mean of the first line and the x _ mean of the last line (namely the difference of the abscissa of each line; the difference between the leftmost line and the rightmost line is the width) is calculated, the area width is determined, the final contact line area can be screened out according to the area width, and the flexible contact line area can be screened out according to whether the area width accords with the threshold interval of the flexible contact line area width or not.

Compared with the prior art, the technical scheme of the invention has the following beneficial effects:

1. the real-time flexible contact net positioning point identification algorithm in the technical scheme of the invention realizes non-contact detection of the contact net positioning point based on the image processing detection technology, and has lower implementation cost, higher detection efficiency and better positioning reliability compared with the positioning point identification scheme adopting an electronic tag, a radar or a GPS and the like.

2. According to the technical scheme, the gray level enhancement pretreatment is carried out on the original image, so that the image quality is improved, and the image contrast is enhanced; meanwhile, a gradient map of the image in the horizontal direction is obtained in the positioning process of the contact line area, so that the interference of objects in other directions is removed, and the time for subsequent program processing is reduced. Due to the adoption of the image processing scheme based on the gradient, compared with the prior art, the real-time flexible contact net positioning point identification algorithm is insensitive to the light source, and the method can be suitable for carrying out flexible positioning point identification on images under different illumination conditions and can be used in the day and at night.

3. According to the technical scheme, the contact line candidate area is formed through the line extraction and line clustering modes, and the flexible contact line area is screened out from the contact line candidate area according to the width interval of the flexible contact line.

4. According to the technical scheme, the flexible positioning point is positioned by the positioning rod, the characteristic that the background interference of the flexible positioning point area is less than that of the rigid positioning point is fully considered, the stroke which does not meet the requirement is filtered according to the stroke characteristic threshold in the specific direction, and the flexible positioning point area is finally obtained by carrying out binaryzation and area characteristic calculation on the stroke which meets the requirement, so that the positioning real-time performance is strong, and the accuracy is high.

5. The algorithm adopted by the technical scheme of the invention is convenient for parameter modification, and after the code is written, no professional is needed, and other non-professionals can modify the related parameters.

Drawings

The foregoing and following detailed description of the invention will be apparent when read in conjunction with the following drawings, in which:

FIG. 1 is a schematic diagram of the logical relationship of the present invention;

fig. 2 is a schematic diagram of a preferred scheme of the binarization processing in the technical scheme of the invention.

Detailed Description

The technical solutions for achieving the objects of the present invention are further illustrated by the following specific examples, and it should be noted that the technical solutions claimed in the present invention include, but are not limited to, the following examples.

11页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:异常车牌识别方法、装置、电子设备及存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!