CN107590441A - A kind of pantograph goat's horn on-line measuring device and method based on image procossing - Google Patents

A kind of pantograph goat's horn on-line measuring device and method based on image procossing Download PDF

Info

Publication number
CN107590441A
CN107590441A CN201710719718.XA CN201710719718A CN107590441A CN 107590441 A CN107590441 A CN 107590441A CN 201710719718 A CN201710719718 A CN 201710719718A CN 107590441 A CN107590441 A CN 107590441A
Authority
CN
China
Prior art keywords
mrow
msubsup
msub
horn
image
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.)
Pending
Application number
CN201710719718.XA
Other languages
Chinese (zh)
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.)
Nanjing University of Science and Technology
Original Assignee
Nanjing University of Science and Technology
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 Nanjing University of Science and Technology filed Critical Nanjing University of Science and Technology
Priority to CN201710719718.XA priority Critical patent/CN107590441A/en
Publication of CN107590441A publication Critical patent/CN107590441A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Processing (AREA)

Abstract

本发明公开了一种基于图像处理的受电弓羊角在线检测装置与方法。该装置包括图像采集模块、数据传输模块、图像处理模块三部分,数据传输模块将图像采集模块采集的图像数据传输到图像处理模块,图像处理模块对实时捕捉到的受电弓羊角图像利用主动形状模型学习算法来判断羊角存在或缺失。方位为:首先,对采集到的图像进行预处理,包括滤波、图像增强、边缘检测;然后,对羊角图像进行特征点标记、构建ASM模型;接着对羊角进行初始区域定位;最后根据构建的羊角模型及初始区域定位,对羊角进行精确定位,并判断羊角是否缺失。本发明结构布设方便、系统稳定,能够进行高精度的在线非接触式测量。

The invention discloses an image processing-based online pantograph horn detection device and method. The device includes three parts: an image acquisition module, a data transmission module, and an image processing module. The data transmission module transmits the image data collected by the image acquisition module to the image processing module. The image processing module utilizes the active shape Model learning algorithm to judge the presence or absence of horns. The orientation is: firstly, preprocess the collected images, including filtering, image enhancement, and edge detection; then, mark the feature points of the horn image and build an ASM model; then perform initial area positioning on the horn; finally, according to the constructed horn Model and initial area positioning, precise positioning of the horns, and judging whether the horns are missing. The invention has the advantages of convenient structure layout, stable system and high-precision online non-contact measurement.

Description

一种基于图像处理的受电弓羊角在线检测装置与方法A device and method for on-line detection of pantograph horns based on image processing

技术领域technical field

本发明涉及交通安全工程技术领域,特别是一种基于图像处理的受电弓羊角在线检测装置与方法。The invention relates to the technical field of traffic safety engineering, in particular to an image processing-based on-line pantograph horn detection device and method.

背景技术Background technique

受电弓滑板是列车与接触网唯一接触的部件,是整个列车供电系统最为重要的取电装置。在列车的运行过程中,受电弓滑板不断与接触网接触造成损耗;若磨损严重,接触网导线卡会在滑板表面裂口或深槽中,使弓头与接触网发生机械碰撞,造成受电弓故障。因此,及时有效地对受电弓羊角进行精确检测和识别是保证弓网安全的重要措施,不仅能够预防各类安全事故的发生,同时为城轨车辆受电弓的检修提供依据。The pantograph slide is the only part in contact between the train and the catenary, and is the most important power-taking device for the entire train power supply system. During the operation of the train, the pantograph slide plate is constantly in contact with the catenary, causing wear and tear; if the wear is serious, the catenary wire clip will be in the crack or deep groove on the surface of the slide plate, causing mechanical collision between the bow head and the catenary, resulting in power failure. Bow malfunction. Therefore, accurate detection and identification of pantograph horns in a timely and effective manner is an important measure to ensure pantograph-catenary safety. It can not only prevent various safety accidents, but also provide a basis for the maintenance of urban rail vehicle pantographs.

国内城市轨道交通尚处于发展时期,受电弓检测的方法仍以人工登顶手动检测为主。人工检测需要列车回库并将接触网断电才可进行,检测效率低,检测精度差,不利于受电弓保养和维护。受电弓的在线检测系统尚处于起步阶段,目前采用的基本原理包括超声波测距、CCD成像、图像处理和图像识别等。Domestic urban rail transit is still in the development period, and the pantograph detection method is still dominated by manual detection by climbing to the top. Manual detection requires the train to return to the depot and the catenary is powered off. The detection efficiency is low, the detection accuracy is poor, and it is not conducive to the maintenance and maintenance of the pantograph. The online detection system of the pantograph is still in its infancy, and the basic principles currently used include ultrasonic ranging, CCD imaging, image processing and image recognition.

谢力等在对实际现场安装检测环境进行分析后,通过采用三组照相机和一组摄相机的方法对受电弓进行多角度拍摄。该方法虽然能够实现受电弓滑板故障的在线诊断,但系统对关键硬件的安装位置有严格的要求,且系统采用的算法不能有效消除周围环境对图像质量的干扰。当周围背景环境颜色与滑板颜色接近时,不能正确提取受电弓滑板的上下边缘,导致检测精度低,不满足现场实际应用。After analyzing the actual on-site installation and testing environment, Xie Li et al. took multi-angle shots of the pantograph by using three sets of cameras and one set of cameras. Although this method can realize online diagnosis of pantograph slide faults, the system has strict requirements on the installation location of key hardware, and the algorithm adopted by the system cannot effectively eliminate the interference of the surrounding environment on image quality. When the color of the surrounding background environment is close to the color of the skateboard, the upper and lower edges of the pantograph skateboard cannot be correctly extracted, resulting in low detection accuracy, which does not meet the actual application in the field.

发明内容Contents of the invention

本发明的目的在于提供一种结构布设方便、系统稳定的基于图像处理的受电弓羊角在线检测装置与方法,实现高精度的在线非接触式测量。The object of the present invention is to provide a pantograph horn online detection device and method based on image processing with convenient structure layout and stable system, so as to realize high-precision online non-contact measurement.

实现本发明目的的技术解决方案为:一种基于图像处理的受电弓羊角在线检测装置,包括图像采集模块、数据传输模块和图像处理模块,其中:The technical solution for realizing the object of the present invention is: a pantograph horn online detection device based on image processing, including an image acquisition module, a data transmission module and an image processing module, wherein:

所述图像采集模块,包括按列车行进方向顺次设置的第一车轮轴位传感器、第一光电传感器、补光设备、相机模组、第二光电传感器和第二车轮轴位传感器;所述相机模组有两组,每组包含2个面阵相机称为半弓相机,安装在车顶上侧,设30度的俯视角度,观察车顶与受电弓状态;2个面阵相机分别从左右两个方向采集受电弓滑板图像;两组共4个面阵相机分别拍摄受电弓滑板前方左半弓、前方右半弓、后方左半弓、后方右左半弓,4个面阵相机有裕量能拍摄到受电弓滑板中心区域;The image acquisition module includes a first wheel axis position sensor, a first photoelectric sensor, a supplementary light device, a camera module, a second photoelectric sensor and a second wheel axis position sensor arranged sequentially in the direction of travel of the train; the camera There are two groups of modules, and each group contains 2 area array cameras called half-bow cameras, which are installed on the upper side of the roof and set a 30-degree overlooking angle to observe the state of the roof and the pantograph; the two area array cameras are respectively from The images of the pantograph skateboard are collected in left and right directions; two groups of 4 area array cameras respectively photograph the front left half bow of the pantograph skateboard, the front right half bow, the rear left half bow, the rear right left half bow, 4 area array cameras There is a margin to photograph the center area of the pantograph slide;

所述数据传输模块,用于将图像采集模块采集的图像数据传输到图像处理模块;The data transmission module is used to transmit the image data collected by the image acquisition module to the image processing module;

所述图像处理模块,用于对接收的图像数据进行处理,通过羊角样本学习建立主动形状模型,并结合受电弓羊角初始定位,对实时捕捉到的受电弓羊角图像利用主动形状模型学习算法来判断羊角存在或缺失。The image processing module is used to process the received image data, establish an active shape model through learning of horn samples, and use an active shape model learning algorithm for the pantograph horn images captured in real time in combination with the initial positioning of the pantograph horns To judge the presence or absence of horns.

进一步地,所述图像采集模块中,当第一车轮轴位传感器检测到列车第一个车轮时,表明列车进入检测区域,同时开启第一、二光电传感器;当第一光电传感器检测到受电弓进入受电弓检测区域,开启补光设备对照明区域进行补光,使区域照明符合拍照要求,同时开启相机模组进行拍照;当第二光电传感器检测到受电弓离开受电弓检测区域,关闭相机模组;当第二车轮轴位传感器检测到第24个车轮时,表明列车已经离开检测区域,关闭图像采集模块中图像采集设备及照明设备。Further, in the image acquisition module, when the first wheel axle position sensor detects the first wheel of the train, it indicates that the train enters the detection area, and the first and second photoelectric sensors are turned on at the same time; When the bow enters the pantograph detection area, turn on the supplementary light equipment to supplement the light in the lighting area, so that the area lighting meets the requirements for taking pictures, and at the same time turn on the camera module to take pictures; when the second photoelectric sensor detects that the pantograph leaves the pantograph detection area , turn off the camera module; when the second wheel shaft position sensor detects the 24th wheel, it indicates that the train has left the detection area, and the image acquisition device and lighting equipment in the image acquisition module are turned off.

一种基于图像处理的受电弓羊角在线检测方法,包括以下步骤:A method for on-line detection of pantograph horns based on image processing, comprising the following steps:

步骤1,图像获取:由图像采集模块中的高速相机拍照,获取原始图像;Step 1, image acquisition: take pictures by the high-speed camera in the image acquisition module to obtain the original image;

步骤2,图像预处理:对图像进行滤波、图像增强、边缘检测处理;Step 2, image preprocessing: filtering, image enhancement, and edge detection are performed on the image;

步骤3,羊角ASM构建方法:包括羊角学习样本标定、ASM训练;Step 3, ASM construction method of croissant: including croissant learning sample calibration and ASM training;

步骤4,羊角区域初步定位:对羊角区域进行初始定位;Step 4, preliminary positioning of the goat horn area: perform initial positioning of the goat horn area;

步骤5,羊角检测与识别:结合主动形状模型学习算法对羊角进行匹配,并采用单分辨率搜索算法匹配羊角形状,判断初始定位区域羊角是否缺失。Step 5, detection and recognition of horns: Combine the active shape model learning algorithm to match the horns, and use the single-resolution search algorithm to match the shape of the horns, and judge whether the horns are missing in the initial positioning area.

进一步地,步骤3所述羊角ASM构建方法包括羊角学习样本标定、ASM训练,具体如下:Further, the croissant ASM construction method described in step 3 includes croissant learning sample calibration, ASM training, specifically as follows:

(3.1)羊角学习样本标定(3.1) Claw learning sample calibration

经图像预处理后,选取羊角轮廓边界点、角点作为特征点,采用人工方式对羊角特征点进行标记;在标记过程中,要求每张羊角图像特征点的数量保持一致且相互对应,并采用PDM对羊角形状进行描述,即羊角图像i的形状通过其所有特征点数学表示为:After image preprocessing, the boundary points and corner points of the horns were selected as feature points, and the feature points of the horns were marked manually; in the process of marking, the number of feature points of each horn image was required to be consistent and corresponded to each other, and used PDM describes the shape of the horn, that is, the shape of the horn image i is mathematically expressed as:

其中,N为羊角图像特征点总数;Wherein, N is the total number of feature points of the horn image;

羊角图像学习样本集表示为:The image learning sample set of croissants is expressed as:

其中,M为羊角图像总数;Wherein, M is the total number of horn images;

(2)ASM训练(2) ASM training

第一步、特征点对齐,具体步骤如下:The first step is to align the feature points. The specific steps are as follows:

a)将羊角形状xi,i=1,2,3,…,M,逐个进行平移、旋转、缩放变换使与形状x1对齐,从而得到变换后的形状集合 a) Translate, rotate, and scale the croissant shape x i , i=1, 2, 3,..., M one by one to align with the shape x 1 , so as to obtain the transformed shape set

b)对计算变换后的羊角图像进行取平均值得平均形状m:b) averaging the transformed croissant images to obtain the average shape m:

其中, in,

c)将平均形状m进行平移、旋转、缩放变换,与对齐;c) Translate, rotate, and scale the average shape m, and alignment;

d)将进行平移、旋转、缩放变换,然后与平均形状m进行对齐匹配;d) will Perform translation, rotation, and scaling transformations, and then align and match with the average shape m;

e)若平均形状收敛,则停止,否则转至步骤b);e) If the average shape converges, then stop, otherwise go to step b);

上述步骤e中收敛的判断依据是使对齐后的各个羊角形状与平均形状之差的平方和最小,即寻找变换Ti使得下式最小:The basis for judging convergence in the above step e is to minimize the sum of the squares of the difference between each horn shape after alignment and the average shape, that is, to find the transformation T i so that the following formula is minimum:

∑|m-Ti(xi)|2 (4)∑|mT i ( xi )| 2 (4)

羊角图像对齐描述为:以两个羊角形状为例,每个形状有N个坐标对:The alignment of horn images is described as: Take two horn shapes as an example, each shape has N coordinate pairs:

首先定义变换矩阵T,T由4个参数构成,分别是旋转角度θ,尺度s和平移向量(tx,ty),将形状x2进行变换:First define the transformation matrix T, T is composed of 4 parameters, which are the rotation angle θ, the scale s and the translation vector (t x , t y ), to transform the shape x 2 :

Assume

利用T变换将x2与x1对齐,最佳变换通过最小化式(4)得到:Align x2 with x1 using the T - transform, and the optimal transformation is obtained by minimizing equation (4):

E=[x1-Rx2-(tx,ty)T]T (9)E=[x 1 -Rx 2 -(t x ,t y ) T ] T (9)

通过计算E对未知参数θ、s、tx、ty的偏微分,并令微分方程为零,从而求解得到变换矩阵T;By calculating the partial differential of E to the unknown parameters θ, s, t x , ty , and making the differential equation zero, the transformation matrix T is obtained by solving;

第二步、ASM建立The second step, ASM establishment

由对齐处理后得到M个训练形状每个形状由N对坐标给出:平均形状设为:则协方差矩阵为:M training shapes are obtained after alignment processing Each shape is given by N pairs of coordinates: The average shape is set to: Then the covariance matrix is:

其中,S为2N×2N矩阵;Among them, S is a 2N×2N matrix;

训练形状在某些方向上的变化通过协方差矩阵S的特征向量得到,即求解线性方程:The variation of the training shape in certain directions is obtained through the eigenvectors of the covariance matrix S, i.e. solving the linear equation:

Spk=λkpk,k=1,2,3,…,2N (11)Sp kk p k ,k=1,2,3,...,2N (11)

其中,S的特征向量为P,P表示为:P=(p1,p2,…,p2N);Wherein, the eigenvector of S is P, and P is expressed as: P=(p 1 ,p 2 ,...,p 2N );

对于任何向量X,存在形状模型参数b,满足:For any vector X, there exists a shape model parameter b such that:

令:make:

从而得到形状的估计:This gives an estimate of the shape:

向量bt定义了一组可变模型参数,不同的bt能够拟合出不同变化的形状;The vector b t defines a set of variable model parameters, and different b t can fit different shapes;

由于bi在训练集上的方差与特征值λi有关,bi要满足下式:Since the variance of bi on the training set is related to the eigenvalue λ i , bi must satisfy the following formula:

进一步地,步骤4所述羊角区域初步定位,具体如下:Further, the preliminary positioning of the sheep horn region described in step 4 is as follows:

(1)采集的受电弓羊角分布在图像的左右两侧,以交点为特征点,左半弓和右半弓图像分别以交点左、右延长线方向为搜索方向;(1) The collected pantograph horns are distributed on the left and right sides of the image, with the intersection point as the feature point, and the left and right half-bow images of the left and right half-bow images are respectively searched in the direction of the left and right extension lines of the intersection point;

(2)区域中至少包含两条直线l1和l2,用直线法描述两直线的角度二者之间若满足则该区域为待确定区域;其中,分别是直线l1和l2的倾斜角度;(2) The area contains at least two straight lines l 1 and l 2 , and the angle between the two straight lines is described by the straight line method with between the two if satisfied Then the area is the area to be determined; among them, with are the inclination angles of straight lines l 1 and l 2 respectively;

在定位到羊角待确定区域后,由于羊角检测算法中输入图像为边缘图像,因此直接在此基础上,对搜索区域中的边缘线段进行曲线数据压缩,然后去除边缘线段中长度小于设定阈值的线段;由于左右羊角的边缘线段的方向分别在35°~55°和125°~145°范围内,因此利用Hough变换检测直线,并根据结果搜索角度范围在上述两区间内的直线段,然后将倾斜边缘线段区域作为羊角初始定位区域。After locating the area to be determined by the horns, since the input image in the horns detection algorithm is an edge image, on this basis, the edge line segment in the search area is directly compressed for curve data, and then the length of the edge line segment is less than the set threshold. line segment; since the directions of the edge line segments of the left and right horns are in the range of 35° to 55° and 125° to 145° respectively, the Hough transform is used to detect the straight line, and the straight line segment whose angle range is in the above two intervals is searched according to the result, and then the The area of the inclined edge line segment is used as the initial positioning area of the horns.

进一步地,步骤5所述羊角检测与识别,具体如下:Further, the horn detection and identification described in step 5 are as follows:

(1)根据羊角主动形状模型中的平均形状和羊角的初始位置,初始化羊角形状,表示如下:(1) According to the average shape in the horn active shape model and the initial position of the horn, initialize the horn shape, expressed as follows:

(2)在羊角初始定位区域的每个标记点处沿边界法向搜索,进而获取具有最大梯度的像素点,并将该点标记为最佳目标点,将标记点向最佳目标点移动,若未搜索到新的目标点,则标记点位置不移动;(2) Search along the boundary normal direction at each marker point in the initial positioning area of the horns, and then obtain the pixel point with the largest gradient, mark this point as the best target point, and move the marker point to the best target point, If no new target point is found, the position of the marked point will not move;

(3)将上述标记点进行移动后,形状会发生改变,发生改变的形状与初始化羊角形状间存在位移向量根据式(15)可知,发生位移后的表达式为:(3) After moving the above mark points, the shape will change, and there is a displacement vector between the changed shape and the initial horn shape According to formula (15), it can be seen that the expression after displacement is:

由式(15)和式(18)推导得:Deduced from formula (15) and formula (18):

(4)重复步骤(2)~(3),若经过设定次数的重复后,p2N,p2N-1,…小于阈值σ,σ趋于零,则判断羊角存在,否则判断图像中羊角缺失。(4) Repeat steps (2) to (3). If p 2N , p 2N-1 , ... is less than the threshold σ and σ tends to zero after the set number of repetitions, it is judged that the horn exists, otherwise it is judged that the horn in the image missing.

本发明与现有技术相比,其显著优点在于:(1)结构布设方便、系统稳定,能够进行高精度的在线非接触式测量;(2)可以在列车运行过程中对受电弓羊角进行检测,不仅保证了运行安全,而且提高了检测效率。Compared with the prior art, the present invention has the following remarkable advantages: (1) convenient structure layout, stable system, and high-precision online non-contact measurement; (2) pantograph horns can be measured during train operation The detection not only ensures the safety of operation, but also improves the detection efficiency.

下面结合附图,对本发明作进一步详细描述。The present invention will be described in further detail below in conjunction with the accompanying drawings.

附图说明Description of drawings

图1是本发明基于图像处理的受电弓羊角在线检测装置的系统总体结构图。Fig. 1 is a system overall structure diagram of the pantograph horn on-line detection device based on image processing in the present invention.

图2是本发明基于图像处理的受电弓羊角在线检测方法的流程图。Fig. 2 is a flow chart of the online pantograph horn detection method based on image processing in the present invention.

图3是本发明中采集的羊角部分图,其中(a)~(l)分别为采集的12幅羊角部分图。Fig. 3 is the croiss part figure that collects in the present invention, and wherein (a)~(l) is 12 croiss part figure that collect respectively.

图4是本发明中羊角特征点标记示意图。Fig. 4 is a schematic diagram of marking characteristic points of sheep's horns in the present invention.

图5是本发明中羊角在图像中的位置示意图,其中(a)为左半弓示意图,(b)为右半弓示意图。Fig. 5 is a schematic diagram of the position of the sheep's horn in the image in the present invention, wherein (a) is a schematic diagram of the left half-arch, and (b) is a schematic diagram of the right half-arch.

图6是本发明中羊角检测结果显示图。Fig. 6 is a display diagram of the detection result of horns in the present invention.

图7是本发明中羊角误检结果图,其中(a)为补光不均的羊角误检结果图,(b)为羊角倾斜角度过大的羊角误检结果图。Fig. 7 is a diagram of misdetection results of horns in the present invention, wherein (a) is a diagram of misdetection results of horns with uneven fill light, and (b) is a diagram of misdetection results of horns with excessive angle of inclination.

具体实施方式detailed description

本发明是一种基于图像处理的受电弓羊角在线检测装置及方法,首先对采集到的受电弓滑板图像进行滤波、对比度增强处理;然后对羊角进行初步定位,接着结合已学习的主动形状模型(Active Shape Model,ASM)算法对待识别的羊角图像进行准确定位,若定位成功,则判断羊角存在,否则,判断羊角缺失。The invention is an image processing-based on-line detection device and method for pantograph horns. Firstly, filtering and contrast enhancement processing are performed on the collected images of the pantograph slide plate; The model (Active Shape Model, ASM) algorithm accurately locates the horn image to be recognized. If the positioning is successful, it is judged that the horn exists, otherwise, it is judged that the horn is missing.

下面结合附图及具体实施例对本发明作进一步详细说明。The present invention will be described in further detail below in conjunction with the accompanying drawings and specific embodiments.

结合图1,本发明基于图像处理的受电弓羊角在线检测装置,包括图像采集模块、数据传输模块和图像处理模块,其中:In conjunction with Fig. 1, the pantograph horn online detection device based on image processing of the present invention includes an image acquisition module, a data transmission module and an image processing module, wherein:

所述图像采集模块,包括按列车行进方向顺次设置的第一车轮轴位传感器、第一光电传感器、补光设备、相机模组、第二光电传感器和第二车轮轴位传感器;所述相机模组有两组,每组包含2个面阵相机称为半弓相机,安装在车顶上侧,设30度的俯视角度,观察车顶与受电弓状态;2个面阵相机分别从左右两个方向采集受电弓滑板图像;两组共4个面阵相机分别拍摄受电弓滑板前方左半弓、前方右半弓、后方左半弓、后方右左半弓,4个面阵相机有裕量能拍摄到受电弓滑板中心区域;The image acquisition module includes a first wheel axis position sensor, a first photoelectric sensor, a supplementary light device, a camera module, a second photoelectric sensor and a second wheel axis position sensor arranged sequentially in the direction of travel of the train; the camera There are two groups of modules, and each group contains 2 area array cameras called half-bow cameras, which are installed on the upper side of the roof and set a 30-degree overlooking angle to observe the state of the roof and the pantograph; the two area array cameras are respectively from The images of the pantograph skateboard are collected in left and right directions; two groups of 4 area array cameras respectively photograph the front left half bow of the pantograph skateboard, the front right half bow, the rear left half bow, the rear right left half bow, 4 area array cameras There is a margin to photograph the center area of the pantograph slide;

所述数据传输模块,用于将图像采集模块采集的图像数据传输到图像处理模块;The data transmission module is used to transmit the image data collected by the image acquisition module to the image processing module;

所述图像处理模块,用于对接收的图像数据进行处理,通过羊角样本学习建立主动形状模型,并结合受电弓羊角初始定位,对实时捕捉到的受电弓羊角图像利用主动形状模型学习算法来判断羊角存在或缺失。The image processing module is used to process the received image data, establish an active shape model through learning of horn samples, and use an active shape model learning algorithm for the pantograph horn images captured in real time in combination with the initial positioning of the pantograph horns To judge the presence or absence of horns.

所述图像采集模块中,当第一车轮轴位传感器检测到列车第一个车轮时,表明列车进入检测区域,同时开启第一、二光电传感器;当第一光电传感器检测到受电弓进入受电弓检测区域,开启补光设备对照明区域进行补光,使区域照明符合拍照要求,同时开启相机模组进行拍照;当第二光电传感器检测到受电弓离开受电弓检测区域,关闭相机模组;当第二车轮轴位传感器检测到第24个车轮时,表明列车已经离开检测区域,关闭图像采集模块中图像采集设备及照明设备。In the image acquisition module, when the first wheel axis position sensor detects the first wheel of the train, it indicates that the train enters the detection area, and the first and second photoelectric sensors are turned on at the same time; when the first photoelectric sensor detects that the pantograph enters the In the pantograph detection area, turn on the supplementary light equipment to supplement the light in the lighting area, so that the area lighting meets the requirements for taking pictures, and at the same time turn on the camera module to take pictures; when the second photoelectric sensor detects that the pantograph has left the pantograph detection area, turn off the camera Module; when the second wheel shaft position sensor detects the 24th wheel, it indicates that the train has left the detection area, and the image acquisition device and lighting equipment in the image acquisition module are turned off.

结合图2,本发明基于图像处理的受电弓羊角在线检测方法,包括以下几个步骤:In conjunction with Fig. 2, the pantograph horn online detection method based on image processing of the present invention comprises the following steps:

步骤1,图像获取:由图像采集模块中的高速相机拍照,获取原始图像;Step 1, image acquisition: take pictures by the high-speed camera in the image acquisition module to obtain the original image;

布置系统装置并获取原始图像:图1是系统的总体设计图。受电弓羊角检测系统采用动态非接触式图像测量技术,检测受电弓羊角情况。主要由现场检测设备和位于设备间的控制、支持和处理设备组成。现场检测设备包括图像采集模块、数据传输模块、图像处理模块。Arrange system devices and obtain original images: Figure 1 is the overall design of the system. The pantograph horn detection system uses dynamic non-contact image measurement technology to detect the condition of the pantograph horn. It is mainly composed of on-site detection equipment and control, support and processing equipment located in the equipment room. On-site detection equipment includes image acquisition module, data transmission module and image processing module.

所述图像采集模块,用于采集受电弓图像。当车轮轴位传感器1检测到列车第一个车轮时,表明列车进入检测区域,同时开启光电传感器。当光电传感器1检测到受电弓进入受电弓检测区域,开启补光设备对照明区域进行补光使区域照明符合拍照要求,同时开启高速相机进行拍照。当光电传感器2检测到受电弓离开受电弓检测区域,关闭高速相机。当车轮轴位传感器2检测到第24个车轮时,表明列车已经离开检测区域,关闭图像采集设备及照明设备。The image acquisition module is used to acquire pantograph images. When the wheel shaft position sensor 1 detects the first wheel of the train, it indicates that the train has entered the detection area, and the photoelectric sensor is turned on simultaneously. When the photoelectric sensor 1 detects that the pantograph enters the pantograph detection area, the supplementary light device is turned on to supplement the light in the lighting area so that the area lighting meets the requirements for taking pictures, and at the same time, the high-speed camera is turned on to take pictures. When the photoelectric sensor 2 detects that the pantograph leaves the pantograph detection area, the high-speed camera is turned off. When the wheel shaft position sensor 2 detects the 24th wheel, it indicates that the train has left the detection area, and the image acquisition equipment and lighting equipment are turned off.

所述数据传输模块,用于将采集的图像数据传输到数据处理模块,本方案采用GigE网线传输。The data transmission module is used to transmit the collected image data to the data processing module. In this solution, GigE network cable is used for transmission.

所述图像处理模块,用于对图像采集模块采集到的图像进行处理。首先对采集到的图像进行图像分割,去除无用信息的区域保留有用信息的区域,再对图像分割后的有用信息区域进行图像去噪、图像增强等图像预处理,然后通过羊角样本学习建立主动形状模型,并结合受电弓羊角初始定位,对实时捕捉到的受电弓羊角图像利用主动形状模型学习算法来判断羊角存在或缺失。若系统检测到受电弓故障,将进行声音报警并提交故障原因,以及时对受电弓故障进行维修,保证弓网安全The image processing module is used to process the images collected by the image collection module. Firstly, image segmentation is performed on the collected images to remove useless information areas and retain useful information areas, and then image denoising, image enhancement and other image preprocessing are performed on the useful information areas after image segmentation, and then the active shape is established through croissant sample learning Combined with the initial positioning of the pantograph horns, the active shape model learning algorithm is used to judge the presence or absence of the pantograph horns images captured in real time. If the system detects a pantograph failure, it will give an audible alarm and submit the cause of the failure, so as to repair the pantograph failure in time to ensure the safety of pantograph-catenary

步骤2,图像预处理:对图像进行滤波、图像增强、边缘检测处理;Step 2, image preprocessing: filtering, image enhancement, and edge detection are performed on the image;

步骤3,羊角ASM构建方法:包括羊角学习样本标定、ASM训练;Step 3, ASM construction method of croissant: including croissant learning sample calibration and ASM training;

羊角ASM构建方法:Claw ASM construction method:

ASM是建立在点分布模型(Point Distribution Model,PDM)基础上的,通过训练图像样本获取样本特征点分布的统计信息,并且允许待定目标存在变化方向,以实现目标图像上对应的特征点位置的寻找。ASM is based on the point distribution model (Point Distribution Model, PDM). The statistical information of the sample feature point distribution is obtained through the training image sample, and the change direction of the undetermined target is allowed to realize the position of the corresponding feature point on the target image. Search.

羊角ASM构建方法的具体步骤如下:The specific steps of the Chow Horn ASM construction method are as follows:

(3.1)羊角学习样本标定(3.1) Claw learning sample calibration

图3是羊角部分图像集,其中(a)~(l)分别为采集的12幅羊角部分图。经图像预处理后,选取羊角轮廓边界点、角点作为特征点,采用人工方式对羊角特征点进行标记。在标记过程中,要求每张羊角图像特征点的数量保持一致且相互对应,并采用PDM对羊角形状进行描述,即羊角图像i的形状可以通过其所有特征点数学表示为:Figure 3 is an image set of horn parts, where (a) to (l) are 12 pictures of horn parts collected respectively. After image preprocessing, the boundary points and corner points of the horns were selected as feature points, and the feature points of horns were marked manually. In the marking process, the number of feature points of each horn image is required to be consistent and correspond to each other, and the shape of the horn is described by PDM, that is, the shape of the horn image i can be mathematically expressed as:

其中,N为羊角图像特征点总数。羊角图像学习样本集可表示为:Among them, N is the total number of feature points of the horn image. The learning sample set of croissant images can be expressed as:

其中,M为羊角图像总数。羊角特征点标记示意图如图4所示。Among them, M is the total number of horn images. The schematic diagram of the sheep horn feature point marking is shown in Figure 4.

(2)ASM训练(2) ASM training

ASM训练分为两个步骤,第一步特征点对齐,第二步ASM建立。特征点对齐即形状归一化,其目的是消除图像中由于角度、距离、姿态变换等外界因素造成的羊角非形状干扰,从而使模型更加有效。一般采用泛用型普氏分析(generalized procrustes analysis,GPA)方法进行归一化。该方法是将一系列的点分布模型通过适当的平移、旋转、缩放变换,在不改变PDM基础上对齐到同一个PDM,使获取的原始数据不再是杂乱无章的状态,以减少非形状因素的干扰。对齐的具体步骤如下:ASM training is divided into two steps, the first step is to align the feature points, and the second step is to establish ASM. Feature point alignment is shape normalization, the purpose of which is to eliminate the non-shape interference of horns caused by external factors such as angle, distance, and pose transformation in the image, so as to make the model more effective. Generally, the generalized procrustes analysis (GPA) method was used for normalization. This method is to align a series of point distribution models to the same PDM without changing the PDM through appropriate translation, rotation, and scaling transformations, so that the acquired original data is no longer in a messy state, so as to reduce non-shape factors. interference. The specific steps of alignment are as follows:

a.将羊角形状xi,i=1,2,3,…,M,逐个进行平移、旋转、缩放变换使之与形状x1对齐,从而得到变换后的形状集合 a. Translate, rotate, and scale the croissant shape x i , i=1, 2, 3,..., M one by one to align with the shape x 1 , so as to obtain the transformed shape set

b.计算变换后的羊角图像进行取平均值:b. Calculate the transformed horn image for averaging:

其中, in,

c.将平均形状m进行平移、旋转、缩放变换,与对齐;c. Translate, rotate, and scale the average shape m, and alignment;

d.将进行平移、旋转、缩放变换,然后与平均形状m进行对齐匹配;d. Will Perform translation, rotation, and scaling transformations, and then align and match with the average shape m;

e.若平均形状收敛,则停止,否则转至步骤b。e. If the average shape converges, stop, otherwise go to step b.

上述步骤e中收敛的判断依据是使对齐后的各个羊角形状与平均形状之差的平方和最小,即寻找变换Ti使得下式最小:The basis for judging convergence in the above step e is to minimize the sum of the squares of the difference between each horn shape after alignment and the average shape, that is, to find the transformation T i so that the following formula is minimum:

∑|m-Ti(xi)|2 (4)∑|mT i ( xi )| 2 (4)

羊角图像对齐可描述为:以两个羊角形状为例,每个形状有N个坐标对:Alignment of horn images can be described as: Take two horn shapes as an example, each shape has N coordinate pairs:

首先定义变换矩阵T,T由4个参数构成,分别是旋转角度θ,尺度s和平移向量(tx,ty),将形状x2进行变换:First define the transformation matrix T, T is composed of 4 parameters, which are the rotation angle θ, the scale s and the translation vector (t x , t y ), to transform the shape x 2 :

Assume

利用T变换将x2与x1对齐,最佳变换可通过最小化式(4.37)得到:Using the T transformation to align x 2 with x 1 , the optimal transformation can be obtained by minimizing equation (4.37):

E=[x1-Rx2-(tx,ty)T]T (9)E=[x 1 -Rx 2 -(t x ,t y ) T ] T (9)

通过计算E对未知参数θ、s、tx、ty的偏微分,并令微分方程为零,从而求解得到变换矩阵T。By calculating the partial differential of E to the unknown parameters θ, s, t x , ty , and making the differential equation zero, the transformation matrix T is obtained.

在羊角图像形状归一化后,可建立ASM。由对齐处理后可得到M个训练形状每个形状由N对坐标给出:平均形状可设为:则协方差矩阵为:After normalizing the shape of the horn image, an ASM can be built. After alignment processing, M training shapes can be obtained Each shape is given by N pairs of coordinates: The average shape can be set to: Then the covariance matrix is:

其中,S为2N×2N矩阵。Among them, S is a 2N×2N matrix.

训练形状在某些方向上的变化能够描述羊角形状的重要性质,而这些性质可以通过协方差矩阵S的特征向量得到,即求解线性方程:The variation of the training shape in certain directions can describe important properties of the horn shape, and these properties can be obtained through the eigenvectors of the covariance matrix S, that is, solving the linear equation:

Spk=λkpk,k=1,2,3,…,2N (11)Sp kk p k ,k=1,2,3,...,2N (11)

其中,S的特征向量为P,P可表示为:P=(p1,p2,…,p2N)。Wherein, the feature vector of S is P, and P can be expressed as: P=(p 1 ,p 2 ,...,p 2N ).

对于任何向量X,存在形状模型参数b,满足:For any vector X, there exists a shape model parameter b such that:

特征值大的向量用于描述训练形状变化大的方向,在描述合理形状与平均形状偏差大小时,p2N,p2N-1,…是可以忽略的,因此可令:Vectors with large eigenvalues are used to describe the direction in which the training shape changes greatly. When describing the deviation between a reasonable shape and the average shape, p 2N , p 2N-1 ,... can be ignored, so it can be ordered:

从而可得到形状的估计:This gives an estimate of the shape:

若X与训练集是相关的合理形状,则对于足够大的t,该估计能较好的拟合真实形状。If X is of reasonable shape relative to the training set, then for sufficiently large t the estimate fits the true shape well.

向量bt定义了一组可变模型参数,不同的bt能够拟合出不同变化的形状。由于bi在训练集上的方差与特征值λi有关,对于较好的形状,bi要满足下式:The vector b t defines a set of variable model parameters, and different b t can fit different shapes. Since the variance of b i on the training set is related to the eigenvalue λ i , for a better shape, b i should satisfy the following formula:

步骤4,羊角区域初步定位:对羊角区域进行初始定位;Step 4, preliminary positioning of the goat horn area: perform initial positioning of the goat horn area;

由于4个CCD相机采集的受电弓羊角分布在图像的左右两侧,其位置示意图如图5(a)~(b)所示。羊角区域搜索步骤如下:Since the pantograph horns collected by the four CCD cameras are distributed on the left and right sides of the image, the schematic diagrams of their positions are shown in Figure 5(a)-(b). The search steps for the horn area are as follows:

(1)以交点为特征点,图5中的左半弓和右半弓图像分别以交点左右延长线方向为搜索方向;(1) Taking the intersection point as the feature point, the left half-bow and right half-bow images in Fig. 5 take the direction of the left and right extension lines of the intersection point as the search direction respectively;

(2)区域中至少包含两条直线l1和l2,用直线法描述两直线的角度二者之间若满足则该区域为待确定区域。其中,分别是直线l1和l2的倾斜角度。(2) The area contains at least two straight lines l 1 and l 2 , and the angle between the two straight lines is described by the straight line method with between the two if satisfied Then this area is the area to be determined. in, with are the inclination angles of straight lines l1 and l2 , respectively.

在定位到羊角可能区域后,由于羊角检测算法中输入图像为边缘图像,因此可以直接在此基础上,对搜索区域中的边缘线段进行曲线数据压缩,然后去除边缘线段中较短的线段。由于左右羊角的边缘线段的方向分别在35°~55°和125°~145°范围内,因此利用Hough变换检测直线并根据结果搜索角度范围在上述两区间内的直线段,然后将倾斜边缘线段区域作为羊角初始定位区域。After locating the possible area of the horns, since the input image in the horns detection algorithm is an edge image, it is possible to directly compress the edge segments in the search area on the basis of the curve data, and then remove the shorter segments of the edge segments. Since the directions of the edge segments of the left and right horns are in the range of 35°-55° and 125°-145° respectively, the Hough transform is used to detect the straight line and the straight line segment whose angle range is within the above two intervals is searched according to the result, and then the inclined edge line segment The region is used as the initial positioning region of the horns.

步骤5,羊角检测与识别:结合主动形状模型学习算法对羊角进行匹配,并采用单分辨率搜索算法匹配羊角形状,判断初始定位区域羊角是否缺失。Step 5, detection and recognition of horns: Combine the active shape model learning algorithm to match the horns, and use the single-resolution search algorithm to match the shape of the horns, and judge whether the horns are missing in the initial positioning area.

结合主动形状模型学习算法可对羊角进行精确匹配,并采用单分辨率搜索算法精确匹配羊角形状,进而判断初始定位区域是否真实存在羊角,算法的具体步骤如下:Combined with the active shape model learning algorithm, the horns can be accurately matched, and the single-resolution search algorithm is used to accurately match the shape of the horns, and then judge whether the horns actually exist in the initial positioning area. The specific steps of the algorithm are as follows:

(1)根据羊角主动形状模型中的平均形状和羊角的初始位置,初始化羊角形状,表示如下:(1) According to the average shape in the horn active shape model and the initial position of the horn, initialize the horn shape, expressed as follows:

(2)在羊角形状初始定位的每个标记点处沿边界法向搜索,进而获取具有最大梯度的像素点,并将该点标记为最佳目标位置,将标记点向最佳目标点移动,若未搜索到新的目标点,则标记点位置不移动;(2) Search along the boundary normal direction at each marker point initially positioned in the horn shape, and then obtain the pixel point with the largest gradient, mark this point as the best target position, and move the marker point to the best target point, If no new target point is found, the position of the marked point will not move;

(3)将上述标记点进行移动后,形状会发生改变,发生改变的形状与初始化羊角形状间存在位移向量根据式(15)可知,发生位移后的表达式为:(3) After moving the above mark points, the shape will change, and there is a displacement vector between the changed shape and the initial horn shape According to formula (15), it can be seen that the expression after displacement is:

由式(15)和式(18)可推导得:It can be deduced from formula (15) and formula (18):

(4)重复步骤(2)、(3),若经过若干次重复后姿态参数p2N,p2N-1,…可以忽略不计,则判断羊角存在,否则判断图像中羊角缺失。(4) Repeat steps (2) and (3). If the attitude parameters p 2N , p 2N-1 ,... are negligible after several repetitions, it is judged that the horn exists, otherwise it is judged that the horn is missing in the image.

利用上述算法对羊角图像进行识别定位,羊角正确检测结果显示图如图6所示。Using the above algorithm to identify and locate the horn image, the correct detection result of the horn is shown in Figure 6.

实施例1Example 1

本试验选取396张羊角图像作为训练集,这些图像中羊角姿态各异,且图片曝光程度不同。羊角姿态的变化大约在25°范围内,图像亮度包括补光不足、补光过度、补光不均等,用于检测的羊角图像质量具体比例情况如表1所示。在对样本进行训练前首先对396张图像进行人工标定,每幅图像标定28个特征点,从而建立羊角ASM模型。In this experiment, 396 images of horns are selected as the training set. The horns in these images have different poses and exposure levels. The change of horn posture is about 25°, and the image brightness includes insufficient fill light, excessive fill light, uneven fill light, etc. The specific proportion of the horn image quality used for detection is shown in Table 1. Before training the samples, 396 images are manually calibrated, and each image is calibrated with 28 feature points, so as to establish the horn ASM model.

表1图像类型统计表Table 1 Statistical Table of Image Types

本试验选取264张图片作为测试集进行羊角存在检测,训练集与测试集的图像不重复。测试集图像中除包含正常羊角图像外,还包括羊角部分缺失或完全缺失,以及光照不均等图像,测试集图像具体比例情况如表2所示。In this experiment, 264 pictures were selected as the test set to detect the existence of horns, and the images in the training set and the test set were not repeated. In addition to normal horn images, the test set images also include partially or completely missing horns, and images with uneven illumination. The specific proportions of the test set images are shown in Table 2.

表2测试集图像类型统计表Table 2 Statistical table of test set image types

利用本文提出的羊角检测算法对上述264张羊角图像进行检测,每张图片羊角识别耗时约340ms,试验图像中实际有8张图像存在羊角缺失,试验共检测出25幅图像中不存在羊角,检测结果统计表如表3所示。其中,羊角缺失的8张图像均被正确识别,而其余17张图像中存在羊角的图像被判断为羊角缺失,羊角误检率为6.4%。其次,非理想图像的羊角识别准确率为79.45%。其中,羊角倾斜程度大小对羊角检测准确率影响较大。当羊角倾斜程度较大时,羊角识别准确率仅为60%。另外,补光效果的好坏同样对羊角识别准确率有较大影响,从表3中可以看出,对于图像补光效果不理想情况下的羊角识别准确率较低。Using the horn detection algorithm proposed in this paper to detect the above 264 images of horns, the recognition time of each image is about 340ms, and there are actually 8 images in the test images that lack horns, and the test detects that there are no horns in 25 images. The statistical table of test results is shown in Table 3. Among them, 8 images with missing horns were correctly identified, while the images with horns in the remaining 17 images were judged as missing horns, and the false detection rate of horns was 6.4%. Second, the recognition accuracy of the horns for non-ideal images is 79.45%. Among them, the degree of inclination of the horns has a great influence on the detection accuracy of the horns. When the degree of inclination of the horns is large, the recognition accuracy of the horns is only 60%. In addition, the effect of supplementary light also has a great impact on the accuracy of horn recognition. It can be seen from Table 3 that the accuracy of horn recognition is low when the effect of image supplementary light is not ideal.

表3检测结果统计表Table 3 Statistical table of test results

由于本专利采用基于主动形状模型算法对羊角进行精确定位,理论上光照应对检测结果影响较小,但从表可知,补光效果不理想时的检测准确率相对较低。这主要是因为补光效果不佳易使羊角图像灰度分布不均匀。其次,光照投射出的阴影,会加强或减弱原有的羊角特征,从而降低羊角识别准确率。为分析光照和羊角倾斜角度对羊角识别的具体影响,选取试验中误检的两幅图像,羊角误检结果图像如图7所示。通过分析图7(a)可知,在系统采集图像时,由于补光不均造成受电弓羊角大部分区域的图像较暗,尽管对图像进行增强,但不能有效弥补光照不均造成的影响。基于主动形状模型的羊角定位方法在建立局部灰度结构模型时,所提取的灰度值是特征点沿其轮廓法向灰度变化的导数值,而非绝对值,能够在一定程度上克服外界光线对定位准确性的影响。但由于测试图像质量差,光线不均导致部分信息缺失,从而导致羊角检测出错。图7(b)是由于羊角倾斜角度过大从而造成误检,尽管基于主动形状模型的羊角定位方法对不同姿态的影响有一定的鲁棒性,然而若羊角倾斜角度超出一定范围时,则无法在图像中找到与特征点匹配的区域,进而发生羊角检测失败的情况。Since this patent uses an algorithm based on the active shape model to accurately locate the horns, theoretically, the light should have little effect on the detection results, but it can be seen from the table that the detection accuracy is relatively low when the light supplement effect is not ideal. This is mainly because the poor lighting effect tends to make the gray distribution of the horn image uneven. Secondly, the shadow cast by the light will strengthen or weaken the original horn characteristics, thereby reducing the accuracy of horn recognition. In order to analyze the specific influence of the illumination and angle of inclination of the horns on the recognition of the horns, two images that were misdetected in the experiment were selected, and the images of the misdetection results of the horns are shown in Figure 7. By analyzing Figure 7(a), it can be seen that when the system collects images, the images in most areas of the pantograph horns are dark due to uneven light supplementation. Although the image is enhanced, it cannot effectively compensate for the impact caused by uneven illumination. When the horn localization method based on the active shape model establishes the local gray-scale structure model, the extracted gray-scale value is the derivative value of the feature point along its contour normal to the gray-scale change, rather than the absolute value, which can overcome the external environment to a certain extent. The effect of light on positioning accuracy. However, due to the poor quality of the test image and the uneven light, some information is missing, which leads to errors in the horn detection. Figure 7(b) is due to the excessive inclination angle of the sheep’s horns, which causes false detection. Although the sheep’s horns positioning method based on the active shape model has certain robustness to the influence of different attitudes, if the angle of the sheep’s horns is beyond a certain range, it cannot be detected. Find the region that matches the feature point in the image, and then the horn detection fails.

Claims (6)

1.一种基于图像处理的受电弓羊角在线检测装置,其特征在于,包括图像采集模块、数据传输模块和图像处理模块,其中:1. a pantograph horn online detection device based on image processing, is characterized in that, comprises image acquisition module, data transmission module and image processing module, wherein: 所述图像采集模块,包括按列车行进方向顺次设置的第一车轮轴位传感器、第一光电传感器、补光设备、相机模组、第二光电传感器和第二车轮轴位传感器;所述相机模组有两组,每组包含2个面阵相机称为半弓相机,安装在车顶上侧,设30度的俯视角度,观察车顶与受电弓状态;2个面阵相机分别从左右两个方向采集受电弓滑板图像;两组共4个面阵相机分别拍摄受电弓滑板前方左半弓、前方右半弓、后方左半弓、后方右左半弓,4个面阵相机有裕量能拍摄到受电弓滑板中心区域;The image acquisition module includes a first wheel axis position sensor, a first photoelectric sensor, a supplementary light device, a camera module, a second photoelectric sensor and a second wheel axis position sensor arranged sequentially in the direction of travel of the train; the camera There are two groups of modules, and each group contains 2 area array cameras called half-bow cameras, which are installed on the upper side of the roof and set a 30-degree overlooking angle to observe the state of the roof and the pantograph; the two area array cameras are respectively from The images of the pantograph skateboard are collected in left and right directions; two groups of 4 area array cameras respectively photograph the front left half bow of the pantograph skateboard, the front right half bow, the rear left half bow, the rear right left half bow, 4 area array cameras There is a margin to photograph the center area of the pantograph slide; 所述数据传输模块,用于将图像采集模块采集的图像数据传输到图像处理模块;The data transmission module is used to transmit the image data collected by the image acquisition module to the image processing module; 所述图像处理模块,用于对接收的图像数据进行处理,通过羊角样本学习建立主动形状模型,并结合受电弓羊角初始定位,对实时捕捉到的受电弓羊角图像利用主动形状模型学习算法来判断羊角存在或缺失。The image processing module is used to process the received image data, establish an active shape model through learning of horn samples, and use an active shape model learning algorithm for the pantograph horn images captured in real time in combination with the initial positioning of the pantograph horns To judge the presence or absence of horns. 2.根据权利要求1所述的基于图像处理的受电弓羊角在线检测装置,其特征在于,所述图像采集模块中,当第一车轮轴位传感器检测到列车第一个车轮时,表明列车进入检测区域,同时开启第一、二光电传感器;当第一光电传感器检测到受电弓进入受电弓检测区域,开启补光设备对照明区域进行补光,使区域照明符合拍照要求,同时开启相机模组进行拍照;当第二光电传感器检测到受电弓离开受电弓检测区域,关闭相机模组;当第二车轮轴位传感器检测到第24个车轮时,表明列车已经离开检测区域,关闭图像采集模块中图像采集设备及照明设备。2. The pantograph horn online detection device based on image processing according to claim 1, characterized in that, in the image acquisition module, when the first wheel shaft position sensor detects the first wheel of the train, it indicates that the train Enter the detection area, turn on the first and second photoelectric sensors at the same time; when the first photoelectric sensor detects that the pantograph enters the pantograph detection area, turn on the supplementary light device to supplement the light in the lighting area, so that the area lighting meets the requirements for taking pictures, and turn on the The camera module takes pictures; when the second photoelectric sensor detects that the pantograph has left the pantograph detection area, close the camera module; when the second wheel axle position sensor detects the 24th wheel, it indicates that the train has left the detection area, Turn off the image acquisition equipment and lighting equipment in the image acquisition module. 3.一种基于图像处理的受电弓羊角在线检测方法,其特征在于,包括以下步骤:3. a pantograph horn online detection method based on image processing, is characterized in that, comprises the following steps: 步骤1,图像获取:由图像采集模块中的高速相机拍照,获取原始图像;Step 1, image acquisition: take pictures by the high-speed camera in the image acquisition module to obtain the original image; 步骤2,图像预处理:对图像进行滤波、图像增强、边缘检测处理;Step 2, image preprocessing: filtering, image enhancement, and edge detection are performed on the image; 步骤3,羊角ASM构建方法:包括羊角学习样本标定、ASM训练;Step 3, ASM construction method of croissant: including croissant learning sample calibration and ASM training; 步骤4,羊角区域初步定位:对羊角区域进行初始定位;Step 4, preliminary positioning of the goat horn area: perform initial positioning of the goat horn area; 步骤5,羊角检测与识别:结合主动形状模型学习算法对羊角进行匹配,并采用单分辨率搜索算法匹配羊角形状,判断初始定位区域羊角是否缺失。Step 5, detection and recognition of horns: Combine the active shape model learning algorithm to match the horns, and use the single-resolution search algorithm to match the shape of the horns, and judge whether the horns are missing in the initial positioning area. 4.根据权利要求3所述的基于图像处理的受电弓羊角在线检测方法,其特征在于,步骤3所述羊角ASM构建方法包括羊角学习样本标定、ASM训练,具体如下:4. the pantograph horn online detection method based on image processing according to claim 3, is characterized in that, the horn ASM construction method described in step 3 comprises horn learning sample calibration, ASM training, specifically as follows: (3.1)羊角学习样本标定(3.1) Claw learning sample calibration 经图像预处理后,选取羊角轮廓边界点、角点作为特征点,采用人工方式对羊角特征点进行标记;在标记过程中,要求每张羊角图像特征点的数量保持一致且相互对应,并采用PDM对羊角形状进行描述,即羊角图像i的形状通过其所有特征点数学表示为:After image preprocessing, the boundary points and corner points of the horns were selected as feature points, and the feature points of the horns were marked manually; in the process of marking, the number of feature points of each horn image was required to be consistent and corresponded to each other, and used PDM describes the shape of the horn, that is, the shape of the horn image i is mathematically expressed as: <mrow> <msup> <mi>x</mi> <mi>i</mi> </msup> <mo>=</mo> <msup> <mrow> <mo>(</mo> <msubsup> <mi>x</mi> <mn>1</mn> <mi>i</mi> </msubsup> <mo>,</mo> <msubsup> <mi>y</mi> <mn>1</mn> <mi>i</mi> </msubsup> <mo>,</mo> <msubsup> <mi>x</mi> <mn>2</mn> <mi>i</mi> </msubsup> <mo>,</mo> <msubsup> <mi>y</mi> <mn>2</mn> <mi>i</mi> </msubsup> <mo>,</mo> <mo>...</mo> <mo>,</mo> <msubsup> <mi>x</mi> <mi>N</mi> <mi>i</mi> </msubsup> <mo>,</mo> <msubsup> <mi>y</mi> <mi>N</mi> <mi>i</mi> </msubsup> <mo>)</mo> </mrow> <mi>T</mi> </msup> <mo>-</mo> <mo>-</mo> <mo>-</mo> <mrow> <mo>(</mo> <mn>1</mn> <mo>)</mo> </mrow> </mrow> <mrow><msup><mi>x</mi><mi>i</mi></msup><mo>=</mo><msup><mrow><mo>(</mo><msubsup><mi>x</mi><mn>1</mn><mi>i</mi></msubsup><mo>,</mo><msubsup><mi>y</mi><mn>1</mn><mi>i</mi></msubsup><mo>,</mo><msubsup><mi>x</mi><mn>2</mn><mi>i</mi></msubsup><mo>,</mo><msubsup><mi>y</mi><mn>2</mn><mi>i</mi></msubsup><mo>,</mo><mo>...</mo><mo>,</mo><msubsup><mi>x</mi><mi>N</mi><mi>i</mi></msubsup><mo>,</mo><msubsup><mi>y</mi><mi>N</mi><mi>i</mi></msubsup><mo>)</mo></mrow><mi>T</mi></msup><mo>-</mo><mo>-</mo><mo>-</mo><mrow><mo>(</mo><mn>1</mn><mo>)</mo></mrow></mrow> 其中,N为羊角图像特征点总数;Wherein, N is the total number of feature points of the horn image; 羊角图像学习样本集表示为:The croissant image learning sample set is expressed as: <mrow> <msup> <mi>x</mi> <mi>i</mi> </msup> <mo>=</mo> <msup> <mrow> <mo>(</mo> <msubsup> <mi>x</mi> <mn>1</mn> <mi>i</mi> </msubsup> <mo>,</mo> <msubsup> <mi>y</mi> <mn>1</mn> <mi>i</mi> </msubsup> <mo>,</mo> <msubsup> <mi>x</mi> <mn>2</mn> <mi>i</mi> </msubsup> <mo>,</mo> <msubsup> <mi>y</mi> <mn>2</mn> <mi>i</mi> </msubsup> <mo>,</mo> <mo>...</mo> <mo>,</mo> <msubsup> <mi>x</mi> <mi>N</mi> <mi>i</mi> </msubsup> <mo>,</mo> <msubsup> <mi>y</mi> <mi>N</mi> <mi>i</mi> </msubsup> <mo>)</mo> </mrow> <mi>T</mi> </msup> <mo>,</mo> <mi>i</mi> <mo>=</mo> <mn>1</mn> <mo>,</mo> <mn>2</mn> <mo>,</mo> <mn>3</mn> <mo>,</mo> <mo>...</mo> <mo>,</mo> <mi>M</mi> <mo>-</mo> <mo>-</mo> <mo>-</mo> <mrow> <mo>(</mo> <mn>2</mn> <mo>)</mo> </mrow> </mrow> <mrow><msup><mi>x</mi><mi>i</mi></msup><mo>=</mo><msup><mrow><mo>(</mo><msubsup><mi>x</mi><mn>1</mn><mi>i</mi></msubsup><mo>,</mo><msubsup><mi>y</mi><mn>1</mn><mi>i</mi></msubsup><mo>,</mo><msubsup><mi>x</mi><mn>2</mn><mi>i</mi></msubsup><mo>,</mo><msubsup><mi>y</mi><mn>2</mn><mi>i</mi></msubsup><mo>,</mo><mo>...</mo><mo>,</mo><msubsup><mi>x</mi><mi>N</mi><mi>i</mi></msubsup><mo>,</mo><msubsup><mi>y</mi><mi>N</mi><mi>i</mi></msubsup><mo>)</mo></mrow><mi>T</mi></msup><mo>,</mo><mi>i</mi><mo>=</mo><mn>1</mn><mo>,</mo><mn>2</mn><mo>,</mo><mn>3</mn><mo>,</mo><mo>...</mo><mo>,</mo><mi>M</mi><mo>-</mo><mo>-</mo><mo>-</mo><mrow><mo>(</mo><mn>2</mn><mo>)</mo></mrow></mrow> 其中,M为羊角图像总数;Wherein, M is the total number of horn images; (2)ASM训练(2) ASM training 第一步、特征点对齐,具体步骤如下:The first step is to align the feature points. The specific steps are as follows: a)将羊角形状xi,i=1,2,3,…,M,逐个进行平移、旋转、缩放变换使与形状x1对齐,从而得到变换后的形状集合 a) Translate, rotate, and scale the croissant shape x i , i=1, 2, 3,..., M one by one to align with the shape x 1 , so as to obtain the transformed shape set b)对计算变换后的羊角图像进行取平均值得平均形状m:b) averaging the transformed croissant images to obtain the average shape m: 其中, in, c)将平均形状m进行平移、旋转、缩放变换,与对齐;c) Translate, rotate, and scale the average shape m, and alignment; d)将进行平移、旋转、缩放变换,然后与平均形状m进行对齐匹配;d) will Perform translation, rotation, and scaling transformations, and then align and match with the average shape m; e)若平均形状收敛,则停止,否则转至步骤b);e) If the average shape converges, then stop, otherwise go to step b); 上述步骤e中收敛的判断依据是使对齐后的各个羊角形状与平均形状之差的平方和最小,即寻找变换Ti使得下式最小:The basis for judging convergence in the above step e is to minimize the sum of the squares of the difference between each horn shape after alignment and the average shape, that is, to find the transformation T i so that the following formula is minimum: ∑|m-Ti(xi)|2 (4)∑|mT i ( xi )| 2 (4) 羊角图像对齐描述为:以两个羊角形状为例,每个形状有N个坐标对:The alignment of horn images is described as: Take two horn shapes as an example, each shape has N coordinate pairs: <mrow> <msup> <mi>x</mi> <mn>1</mn> </msup> <mo>=</mo> <msup> <mrow> <mo>(</mo> <msubsup> <mi>x</mi> <mn>1</mn> <mn>1</mn> </msubsup> <mo>,</mo> <msubsup> <mi>y</mi> <mn>1</mn> <mn>1</mn> </msubsup> <mo>,</mo> <msubsup> <mi>x</mi> <mn>2</mn> <mn>1</mn> </msubsup> <mo>,</mo> <msubsup> <mi>y</mi> <mn>2</mn> <mn>1</mn> </msubsup> <mo>,</mo> <mo>...</mo> <mo>,</mo> <msubsup> <mi>x</mi> <mi>N</mi> <mn>1</mn> </msubsup> <mo>,</mo> <msubsup> <mi>y</mi> <mi>N</mi> <mn>1</mn> </msubsup> <mo>)</mo> </mrow> <mi>T</mi> </msup> <mo>-</mo> <mo>-</mo> <mo>-</mo> <mrow> <mo>(</mo> <mn>5</mn> <mo>)</mo> </mrow> </mrow> <mrow><msup><mi>x</mi><mn>1</mn></msup><mo>=</mo><msup><mrow><mo>(</mo><msubsup><mi>x</mi><mn>1</mn><mn>1</mn></msubsup><mo>,</mo><msubsup><mi>y</mi><mn>1</mn><mn>1</mn></msubsup><mo>,</mo><msubsup><mi>x</mi><mn>2</mn><mn>1</mn></msubsup><mo>,</mo><msubsup><mi>y</mi><mn>2</mn><mn>1</mn></msubsup><mo>,</mo><mo>...</mo><mo>,</mo><msubsup><mi>x</mi><mi>N</mi><mn>1</mn></msubsup><mo>,</mo><msubsup><mi>y</mi><mi>N</mi><mn>1</mn></msubsup><mo>)</mo></mrow><mi>T</mi></msup><mo>-</mo><mo>-</mo><mo>-</mo><mrow><mo>(</mo><mn>5</mn><mo>)</mo></mrow></mrow> <mrow> <msup> <mi>x</mi> <mn>2</mn> </msup> <mo>=</mo> <msup> <mrow> <mo>(</mo> <msubsup> <mi>x</mi> <mn>1</mn> <mn>2</mn> </msubsup> <mo>,</mo> <msubsup> <mi>y</mi> <mn>1</mn> <mn>2</mn> </msubsup> <mo>,</mo> <msubsup> <mi>x</mi> <mn>2</mn> <mn>2</mn> </msubsup> <mo>,</mo> <msubsup> <mi>y</mi> <mn>2</mn> <mn>2</mn> </msubsup> <mo>,</mo> <mo>...</mo> <mo>,</mo> <msubsup> <mi>x</mi> <mi>N</mi> <mn>2</mn> </msubsup> <mo>,</mo> <msubsup> <mi>y</mi> <mi>N</mi> <mn>2</mn> </msubsup> <mo>)</mo> </mrow> <mi>T</mi> </msup> <mo>-</mo> <mo>-</mo> <mo>-</mo> <mrow> <mo>(</mo> <mn>6</mn> <mo>)</mo> </mrow> </mrow> <mrow><msup><mi>x</mi><mn>2</mn></msup><mo>=</mo><msup><mrow><mo>(</mo><msubsup><mi>x</mi><mn>1</mn><mn>2</mn></msubsup><mo>,</mo><msubsup><mi>y</mi><mn>1</mn><mn>2</mn></msubsup><mo>,</mo><msubsup><mi>x</mi><mn>2</mn><mn>2</mn></msubsup><mo>,</mo><msubsup><mi>y</mi><mn>2</mn><mn>2</mn></msubsup><mo>,</mo><mo>...</mo><mo>,</mo><msubsup><mi>x</mi><mi>N</mi><mn>2</mn></msubsup><mo>,</mo><msubsup><mi>y</mi><mi>N</mi><mn>2</mn></msubsup><mo>)</mo></mrow><mi>T</mi></msup><mo>-</mo><mo>-</mo><mo>-</mo><mrow><mo>(</mo><mn>6</mn><mo>)</mo></mrow></mrow> 首先定义变换矩阵T,T由4个参数构成,分别是旋转角度θ,尺度s和平移向量(tx,ty),将形状x2进行变换:First define the transformation matrix T, T is composed of 4 parameters, which are the rotation angle θ, the scale s and the translation vector (t x , t y ), to transform the shape x 2 : <mrow> <mi>T</mi> <mrow> <mo>(</mo> <msup> <mi>x</mi> <mn>2</mn> </msup> <mo>)</mo> </mrow> <mo>=</mo> <mfenced open = "(" close = ")"> <mtable> <mtr> <mtd> <mrow> <mi>s</mi> <mi> </mi> <mi>c</mi> <mi>o</mi> <mi>s</mi> <mi>&amp;theta;</mi> </mrow> </mtd> <mtd> <mrow> <mo>-</mo> <mi>s</mi> <mi>i</mi> <mi>n</mi> <mi>&amp;theta;</mi> </mrow> </mtd> </mtr> <mtr> <mtd> <mrow> <mi>s</mi> <mi> </mi> <mi>s</mi> <mi>i</mi> <mi>n</mi> <mi>&amp;theta;</mi> </mrow> </mtd> <mtd> <mrow> <mi>s</mi> <mi> </mi> <mi>c</mi> <mi>o</mi> <mi>s</mi> <mi>&amp;theta;</mi> </mrow> </mtd> </mtr> </mtable> </mfenced> <mfenced open = "(" close = ")"> <mtable> <mtr> <mtd> <msubsup> <mi>x</mi> <mi>i</mi> <mn>2</mn> </msubsup> </mtd> </mtr> <mtr> <mtd> <msubsup> <mi>y</mi> <mi>i</mi> <mn>2</mn> </msubsup> </mtd> </mtr> </mtable> </mfenced> <mo>+</mo> <mfenced open = "(" close = ")"> <mtable> <mtr> <mtd> <msub> <mi>t</mi> <mi>x</mi> </msub> </mtd> </mtr> <mtr> <mtd> <msub> <mi>t</mi> <mi>y</mi> </msub> </mtd> </mtr> </mtable> </mfenced> <mo>-</mo> <mo>-</mo> <mo>-</mo> <mrow> <mo>(</mo> <mn>7</mn> <mo>)</mo> </mrow> </mrow> <mrow><mi>T</mi><mrow><mo>(</mo><msup><mi>x</mi><mn>2</mn></msup><mo>)</mo></mrow><mo>=</mo><mfenced open = "(" close = ")"><mtable><mtr><mtd><mrow><mi>s</mi><mi></mi><mi>c</mi><mi>o</mi><mi>s</mi><mi>&amp;theta;</mi></mrow></mtd><mtd><mrow><mo>-</mo><mi>s</mi><mi>i</mi><mi>n</mi><mi>&amp;theta;</mi></mrow></mtd></mtr><mtr><mtd><mrow><mi>s</mi><mi></mi><mi>s</mi><mi>i</mi><mi>n</mi><mi>&amp;theta;</mi></mrow></mtd><mtd><mrow><mi>s</mi><mi></mi><mi>c</mi><mi>o</mi><mi>s</mi><mi>&amp;theta;</mi></mrow></mtd></mtr></mtable></mfenced><mfenced open = "(" close = ")"><mtable><mtr><mtd><msubsup><mi>x</mi><mi>i</mi><mn>2</mn></msubsup></mtd></mtr><mtr><mtd><msubsup><mi>y</mi><mi>i</mi><mn>2</mn></msubsup></mtd></mtr></mtable></mfenced><mo>+</mo><mfenced open = "(" close = ")"><mtable><mtr><mtd><msub><mi>t</mi><mi>x</mi></msub></mtd></mtr><mtr><mtd><msub><mi>t</mi><mi>y</mi></msub></mtd></mtr></mtable></mfenced><mo>-</mo><mo>-</mo><mo>-</mo><mrow><mo>(</mo><mn>7</mn><mo>)</mo></mrow></mrow> Assume <mrow> <mi>R</mi> <mo>=</mo> <mfenced open = "(" close = ")"> <mtable> <mtr> <mtd> <mrow> <mi>s</mi> <mi> </mi> <mi>c</mi> <mi>o</mi> <mi>s</mi> <mi>&amp;theta;</mi> </mrow> </mtd> <mtd> <mrow> <mo>-</mo> <mi>s</mi> <mi>i</mi> <mi>n</mi> <mi>&amp;theta;</mi> </mrow> </mtd> </mtr> <mtr> <mtd> <mrow> <mi>s</mi> <mi> </mi> <mi>s</mi> <mi>i</mi> <mi>n</mi> <mi>&amp;theta;</mi> </mrow> </mtd> <mtd> <mrow> <mi>s</mi> <mi> </mi> <mi>c</mi> <mi>o</mi> <mi>s</mi> <mi>&amp;theta;</mi> </mrow> </mtd> </mtr> </mtable> </mfenced> <mo>-</mo> <mo>-</mo> <mo>-</mo> <mrow> <mo>(</mo> <mn>8</mn> <mo>)</mo> </mrow> </mrow> <mrow><mi>R</mi><mo>=</mo><mfenced open = "(" close = ")"><mtable><mtr><mtd><mrow><mi>s</mi><mi></mi><mi>c</mi><mi>o</mi><mi>s</mi><mi>&amp;theta;</mi></mrow></mtd><mtd><mrow><mo>-</mo><mi>s</mi><mi>i</mi><mi>n</mi><mi>&amp;theta;</mi></mrow></mtd></mtr><mtr><mtd><mrow><mi>s</mi><mi></mi><mi>s</mi><mi>i</mi><mi>n</mi><mi>&amp;theta;</mi></mrow></mtd><mtd><mrow><mi>s</mi><mi></mi><mi>c</mi><mi>o</mi><mi>s</mi><mi>&amp;theta;</mi></mrow></mtd></mtr></mtable></mfenced><mo>-</mo><mo>-</mo><mo>-</mo><mrow><mo>(</mo><mn>8</mn><mo>)</mo></mrow></mrow> 利用T变换将x2与x1对齐,最佳变换通过最小化式(4)得到:Align x2 with x1 using the T - transform, and the optimal transformation is obtained by minimizing equation (4): E=[x1-Rx2-(tx,ty)T]T (9)E=[x 1 -Rx 2 -(t x ,t y ) T ] T (9) 通过计算E对未知参数θ、s、tx、ty的偏微分,并令微分方程为零,从而求解得到变换矩阵T;By calculating the partial differential of E to the unknown parameters θ, s, t x , ty , and making the differential equation zero, the transformation matrix T is obtained by solving; 第二步、ASM建立The second step, ASM establishment 由对齐处理后得到M个训练形状每个形状由N对坐标给出:平均形状设为:则协方差矩阵为:M training shapes are obtained after alignment processing Each shape is given by N pairs of coordinates: The average shape is set to: Then the covariance matrix is: 其中,S为2N×2N矩阵;Among them, S is a 2N×2N matrix; 训练形状在某些方向上的变化通过协方差矩阵S的特征向量得到,即求解线性方程:The variation of the training shape in certain directions is obtained through the eigenvectors of the covariance matrix S, i.e. solving the linear equation: Spk=λkpk,k=1,2,3,…,2N (11)Sp kk p k ,k=1,2,3,...,2N (11) 其中,S的特征向量为P,P表示为:P=(p1,p2,…,p2N);Wherein, the eigenvector of S is P, and P is expressed as: P=(p 1 ,p 2 ,...,p 2N ); 对于任何向量X,存在形状模型参数b,满足:For any vector X, there exists a shape model parameter b such that: <mrow> <mi>x</mi> <mo>=</mo> <mover> <mi>x</mi> <mo>&amp;OverBar;</mo> </mover> <mo>+</mo> <mi>P</mi> <mi>b</mi> <mo>=</mo> <mover> <mi>x</mi> <mo>&amp;OverBar;</mo> </mover> <mo>+</mo> <msub> <mi>p</mi> <mn>1</mn> </msub> <msub> <mi>b</mi> <mn>1</mn> </msub> <mo>+</mo> <mo>...</mo> <mo>+</mo> <msub> <mi>p</mi> <mrow> <mn>2</mn> <mi>N</mi> </mrow> </msub> <msub> <mi>b</mi> <mrow> <mn>2</mn> <mi>N</mi> </mrow> </msub> <mo>-</mo> <mo>-</mo> <mo>-</mo> <mrow> <mo>(</mo> <mn>12</mn> <mo>)</mo> </mrow> </mrow> <mrow><mi>x</mi><mo>=</mo><mover><mi>x</mi><mo>&amp;OverBar;</mo></mover><mo>+</mo><mi>P</mi><mi>b</mi><mo>=</mo><mover><mi>x</mi><mo>&amp;OverBar;</mo></mover><mo>+</mo><msub><mi>p</mi><mn>1</mn></msub><msub><mi>b</mi><mn>1</mn></msub><mo>+</mo><mo>...</mo><mo>+</mo><msub><mi>p</mi><mrow><mn>2</mn><mi>N</mi></mrow></msub><msub><mi>b</mi><mrow><mn>2</mn><mi>N</mi></mrow></msub><mo>-</mo><mo>-</mo><mo>-</mo><mrow><mo>(</mo><mn>12</mo>mn><mo>)</mo></mrow></mrow> 令:make: <mrow> <mtable> <mtr> <mtd> <mrow> <msub> <mi>P</mi> <mi>t</mi> </msub> <mo>=</mo> <mrow> <mo>(</mo> <mrow> <msub> <mi>p</mi> <mn>1</mn> </msub> <mo>,</mo> <msub> <mi>p</mi> <mn>2</mn> </msub> <mo>,</mo> <msub> <mi>p</mi> <mn>3</mn> </msub> <mo>,</mo> <mn>...</mn> <mo>,</mo> <msub> <mi>p</mi> <mi>t</mi> </msub> </mrow> <mo>)</mo> </mrow> </mrow> </mtd> </mtr> <mtr> <mtd> <mrow> <msub> <mi>b</mi> <mi>t</mi> </msub> <mo>=</mo> <msup> <mrow> <mo>(</mo> <mrow> <msub> <mi>b</mi> <mn>1</mn> </msub> <mo>,</mo> <msub> <mi>b</mi> <mn>2</mn> </msub> <mo>,</mo> <msub> <mi>b</mi> <mn>3</mn> </msub> <mo>,</mo> <mn>...</mn> <mo>,</mo> <msub> <mi>b</mi> <mi>t</mi> </msub> </mrow> <mo>)</mo> </mrow> <mi>T</mi> </msup> </mrow> </mtd> </mtr> </mtable> <mo>,</mo> <mi>t</mi> <mo>&amp;le;</mo> <mn>2</mn> <mi>N</mi> <mo>-</mo> <mo>-</mo> <mo>-</mo> <mrow> <mo>(</mo> <mn>13</mn> <mo>)</mo> </mrow> </mrow> <mrow><mtable><mtr><mtd><mrow><msub><mi>P</mi><mi>t</mi></msub><mo>=</mo><mrow><mo>(</mo><mrow><msub><mi>p</mi><mn>1</mn></msub><mo>,</mo><msub><mi>p</mi><mn>2</mn></msub><mo>,</mo><msub><mi>p</mi><mn>3</mn></msub><mo>,</mo><mn>...</mn><mo>,</mo><msub><mi>p</mi><mi>t</mi></msub></mrow><mo>)</mo></mrow></mrow></mtd></mtr><mtr><mtd><mrow><msub><mi>b</mi><mi>t</mi></msub><mo>=</mo><msup><mrow><mo>(</mo><mrow><msub><mi>b</mi><mn>1</mn></msub>msub><mo>,</mo><msub><mi>b</mi><mn>2</mn></msub><mo>,</mo><msub><mi>b</mi>mi><mn>3</mn></msub><mo>,</mo><mn>...</mn><mo>,</mo><msub><mi>b</mi><mi>t</mi></msub></mrow><mo>)</mo></mrow><mi>T</mi></msup></mrow></mtd></mtr></mtable><mo>,</mo><mi>t</mi><mo>&amp;le;</mo><mn>2</mn><mi>N</mi><mo>-</mo><mo>-</mo><mo>-</mo><mrow><mo>(</mo><mn>13</mn><mo>)</mo></mrow></mrow> 从而得到形状的估计:This gives an estimate of the shape: <mrow> <mi>x</mi> <mo>&amp;ap;</mo> <mover> <mi>x</mi> <mo>&amp;OverBar;</mo> </mover> <mo>+</mo> <msub> <mi>P</mi> <mi>t</mi> </msub> <msub> <mi>b</mi> <mi>t</mi> </msub> <mo>-</mo> <mo>-</mo> <mo>-</mo> <mrow> <mo>(</mo> <mn>14</mn> <mo>)</mo> </mrow> </mrow> <mrow><mi>x</mi><mo>&amp;ap;</mo><mover><mi>x</mi><mo>&amp;OverBar;</mo></mover><mo>+</mo><msub><mi>P</mi><mi>t</mi></msub><msub><mi>b</mi><mi>t</mi></msub><mo>-</mo><mo>-</mo><mo>-</mo><mrow><mo>(</mo><mn>14</mn><mo>)</mo></mrow></mrow> <mrow> <msub> <mi>b</mi> <mi>t</mi> </msub> <mo>&amp;ap;</mo> <msubsup> <mi>P</mi> <mi>t</mi> <mi>T</mi> </msubsup> <mrow> <mo>(</mo> <mi>x</mi> <mo>-</mo> <mover> <mi>x</mi> <mo>&amp;OverBar;</mo> </mover> <mo>)</mo> </mrow> <mo>-</mo> <mo>-</mo> <mo>-</mo> <mrow> <mo>(</mo> <mn>15</mn> <mo>)</mo> </mrow> </mrow> <mrow><msub><mi>b</mi><mi>t</mi></msub><mo>&amp;ap;</mo><msubsup><mi>P</mi><mi>t</mi><mi>T</mi></msubsup><mrow><mo>(</mo><mi>x</mi><mo>-</mo><mover><mi>x</mi><mo>&amp;OverBar;</mo></mover><mo>)</mo></mrow><mo>-</mo><mo>-</mo><mo>-</mo><mrow><mo>(</mo><mn>15</mn><mo>)</mo></mrow></mrow> 向量bt定义了一组可变模型参数,不同的bt能够拟合出不同变化的形状;The vector b t defines a set of variable model parameters, and different b t can fit different shapes; 由于bi在训练集上的方差与特征值λi有关,bi要满足下式:Since the variance of bi on the training set is related to the eigenvalue λ i , bi must satisfy the following formula: <mrow> <mo>-</mo> <mn>3</mn> <msqrt> <msub> <mi>&amp;lambda;</mi> <mi>i</mi> </msub> </msqrt> <mo>&amp;le;</mo> <msub> <mi>b</mi> <mi>i</mi> </msub> <mo>&amp;le;</mo> <mn>3</mn> <msqrt> <msub> <mi>&amp;lambda;</mi> <mi>i</mi> </msub> </msqrt> <mo>-</mo> <mo>-</mo> <mo>-</mo> <mrow> <mo>(</mo> <mn>16</mn> <mo>)</mo> </mrow> <mo>.</mo> </mrow> <mrow><mo>-</mo><mn>3</mn><msqrt><msub><mi>&amp;lambda;</mi><mi>i</mi></msub></msqrt><mo>&amp;le;</mo><msub><mi>b</mi><mi>i</mi></msub><mo>&amp;le;</mo><mn>3</mn><msqrt><msub><mi>&amp;lambda;</mi><mi>i</mi></msub></msqrt><mo>-</mo><mo>-</mo><mo>-</mo><mrow><mo>(</mo><mn>16</mn><mo>)</mo></mrow><mo>.</mo></mrow> 5.根据权利要求3所述的基于图像处理的受电弓羊角在线检测方法,其特征在于,步骤4所述羊角区域初步定位,具体如下:5. the pantograph horn online detection method based on image processing according to claim 3, is characterized in that, the preliminary positioning of the horn region described in step 4 is specifically as follows: (1)采集的受电弓羊角分布在图像的左右两侧,以交点为特征点,左半弓和右半弓图像分别以交点左、右延长线方向为搜索方向;(1) The collected pantograph horns are distributed on the left and right sides of the image, with the intersection point as the feature point, and the left and right half-bow images of the left and right half-bow images are respectively searched in the direction of the left and right extension lines of the intersection point; (2)区域中至少包含两条直线l1和l2,用直线法描述两直线的角度二者之间若满足则该区域为待确定区域;其中,分别是直线l1和l2的倾斜角度;(2) The area contains at least two straight lines l 1 and l 2 , and the angle between the two straight lines is described by the straight line method with between the two if satisfied Then the area is the area to be determined; among them, with are the inclination angles of straight lines l 1 and l 2 respectively; 在定位到羊角待确定区域后,由于羊角检测算法中输入图像为边缘图像,因此直接在此基础上,对搜索区域中的边缘线段进行曲线数据压缩,然后去除边缘线段中长度小于设定阈值的线段;由于左右羊角的边缘线段的方向分别在35°~55°和125°~145°范围内,因此利用Hough变换检测直线,并根据结果搜索角度范围在上述两区间内的直线段,然后将倾斜边缘线段区域作为羊角初始定位区域。After locating the area to be determined by the horns, since the input image in the horns detection algorithm is an edge image, on this basis, the edge line segment in the search area is directly compressed for curve data, and then the length of the edge line segment is less than the set threshold. line segment; since the directions of the edge line segments of the left and right horns are in the range of 35° to 55° and 125° to 145° respectively, the Hough transform is used to detect the straight line, and the straight line segment whose angle range is in the above two intervals is searched according to the result, and then the The area of the inclined edge line segment is used as the initial positioning area of the horns. 6.根据权利要求3所述的基于图像处理的受电弓羊角在线检测方法,其特征在于,步骤5所述羊角检测与识别,具体如下:6. the pantograph horn online detection method based on image processing according to claim 3, is characterized in that, the horn detection and identification described in step 5 are specifically as follows: (1)根据羊角主动形状模型中的平均形状和羊角的初始位置,初始化羊角形状,表示如下:(1) According to the average shape in the horn active shape model and the initial position of the horn, initialize the horn shape, expressed as follows: (2)在羊角初始定位区域的每个标记点处沿边界法向搜索,进而获取具有最大梯度的像素点,并将该点标记为最佳目标点,将标记点向最佳目标点移动,若未搜索到新的目标点,则标记点位置不移动;(2) Search along the boundary normal direction at each marker point in the initial positioning area of the horns, and then obtain the pixel point with the largest gradient, mark this point as the best target point, and move the marker point to the best target point, If no new target point is found, the position of the marked point will not move; (3)将上述标记点进行移动后,形状会发生改变,发生改变的形状与初始化羊角形状间存在位移向量根据式(15)可知,发生位移后的表达式为:(3) After moving the above mark points, the shape will change, and there is a displacement vector between the changed shape and the initial horn shape According to formula (15), it can be seen that the expression after displacement is: <mrow> <mover> <mi>x</mi> <mo>&amp;OverBar;</mo> </mover> <mo>+</mo> <mi>&amp;zeta;</mi> <mover> <mi>x</mi> <mo>&amp;OverBar;</mo> </mover> <mo>&amp;ap;</mo> <mover> <mi>x</mi> <mo>&amp;OverBar;</mo> </mover> <mo>+</mo> <msub> <mi>P</mi> <mi>t</mi> </msub> <mrow> <mo>(</mo> <mrow> <msub> <mi>b</mi> <mi>t</mi> </msub> <mo>+</mo> <msub> <mi>&amp;zeta;b</mi> <mi>t</mi> </msub> </mrow> <mo>)</mo> </mrow> <mo>-</mo> <mo>-</mo> <mo>-</mo> <mrow> <mo>(</mo> <mn>18</mn> <mo>)</mo> </mrow> </mrow> <mrow><mover><mi>x</mi><mo>&amp;OverBar;</mo></mover><mo>+</mo><mi>&amp;zeta;</mi><mover><mi>x</mi><mo>&amp;OverBar;</mo></mover><mo>&amp;ap;</mo><mover><mi>x</mi><mo>&amp;OverBar;</mo></mover><mo>+</mo><msub><mi>P</mi><mi>t</mi></msub><mrow><mo>(</mo><mrow><msub><mi>b</mi><mi>t</mi></msub><mo>+</mo><msub><mi>&amp;zeta;b</mi><mi>t</mi></msub></mrow><mo>)</mo></mrow><mo>-</mo><mo>-</mo><mo>-</mo><mrow><mo>(</mo><mn>18</mn><mo>)</mo></mrow></mrow> 由式(15)和式(18)推导得:Deduced from formula (15) and formula (18): <mrow> <msub> <mi>&amp;zeta;b</mi> <mi>t</mi> </msub> <mo>&amp;ap;</mo> <msubsup> <mi>P</mi> <mi>t</mi> <mi>T</mi> </msubsup> <mi>&amp;zeta;</mi> <mover> <mi>x</mi> <mo>&amp;OverBar;</mo> </mover> <mo>-</mo> <mo>-</mo> <mo>-</mo> <mrow> <mo>(</mo> <mn>19</mn> <mo>)</mo> </mrow> </mrow> <mrow><msub><mi>&amp;zeta;b</mi><mi>t</mi></msub><mo>&amp;ap;</mo><msubsup><mi>P</mi><mi>t</mi><mi>T</mi></msubsup><mi>&amp;zeta;</mi><mover><mi>x</mi><mo>&amp;OverBar;</mo></mover><mo>-</mo><mo>-</mo><mo>-</mo><mrow><mo>(</mo><mn>19</mo>mn><mo>)</mo></mrow></mrow> (4)重复步骤(2)~(3),若经过设定次数的重复后,p2N,p2N-1,…小于阈值σ,σ趋于零,则判断羊角存在,否则判断图像中羊角缺失。(4) Repeat steps (2) to (3). If p 2N , p 2N-1 , ... is less than the threshold σ and σ tends to zero after the set number of repetitions, it is judged that the horn exists, otherwise it is judged that the horn in the image missing.
CN201710719718.XA 2017-08-21 2017-08-21 A kind of pantograph goat's horn on-line measuring device and method based on image procossing Pending CN107590441A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710719718.XA CN107590441A (en) 2017-08-21 2017-08-21 A kind of pantograph goat's horn on-line measuring device and method based on image procossing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710719718.XA CN107590441A (en) 2017-08-21 2017-08-21 A kind of pantograph goat's horn on-line measuring device and method based on image procossing

Publications (1)

Publication Number Publication Date
CN107590441A true CN107590441A (en) 2018-01-16

Family

ID=61042453

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710719718.XA Pending CN107590441A (en) 2017-08-21 2017-08-21 A kind of pantograph goat's horn on-line measuring device and method based on image procossing

Country Status (1)

Country Link
CN (1) CN107590441A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111260629A (en) * 2020-01-16 2020-06-09 成都地铁运营有限公司 Pantograph structure abnormity detection algorithm based on image processing
CN112132789A (en) * 2020-08-30 2020-12-25 南京理工大学 On-line detection device and method of pantograph based on cascaded neural network

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
陈双: "基于图像处理的受电弓故障检测算法研究", 《中国优秀硕士学位论文全文数据库 工程科技Ⅱ辑》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111260629A (en) * 2020-01-16 2020-06-09 成都地铁运营有限公司 Pantograph structure abnormity detection algorithm based on image processing
CN112132789A (en) * 2020-08-30 2020-12-25 南京理工大学 On-line detection device and method of pantograph based on cascaded neural network
CN112132789B (en) * 2020-08-30 2022-10-25 南京理工大学 On-line detection device and method of pantograph based on cascaded neural network

Similar Documents

Publication Publication Date Title
CN105674880B (en) Contact net geometric parameter measurement method and system based on binocular principle
CN104809738B (en) A binocular vision-based airbag contour size detection method
CN103925927B (en) A kind of traffic mark localization method based on Vehicular video
CN111996883B (en) Method for detecting width of road surface
CN106679567A (en) Contact net and strut geometric parameter detecting measuring system based on binocular stereoscopic vision
CN102252859B (en) Road train straight-line running transverse stability automatic identification system
CN110334678A (en) A Pedestrian Detection Method Based on Vision Fusion
CN103837087B (en) Pantograph automatic testing method based on active shape model
CN111272139B (en) A vehicle length measurement method based on monocular vision
CN110060298B (en) Image-based vehicle position and posture determining system and corresponding method
CN106874900A (en) A kind of tired driver detection method and detection means based on steering wheel image
CN102749061A (en) Steel rail abrasion measuring method based on dynamic template
CN105783779A (en) Steel rail contour real-time form identification and distortion calibration method based on three-layer matching
CN112966571A (en) Standing long jump flight height measurement method based on machine vision
CN105632180B (en) A kind of bridge tunnel entrance model recognition system and method based on ARM
CN106408589B (en) Based on the vehicle-mounted vehicle movement measurement method for overlooking camera
CN110502971B (en) Monocular vision-based road vehicle identification method and system
CN105938554A (en) Switch rail expansion displacement monitoring method based on image automatic interpretation and switch rail expansion displacement monitoring system thereof
CN114140394A (en) A non-contact detection method of pantograph-catenary contact force based on image processing technology
CN114735044A (en) Intelligent railway vehicle inspection robot
Wu et al. Design and implementation of vehicle speed estimation using road marking-based perspective transformation
CN111950478B (en) Method for detecting S-shaped driving behavior of automobile in weighing area of dynamic flat-plate scale
CN107590441A (en) A kind of pantograph goat&#39;s horn on-line measuring device and method based on image procossing
CN117671972A (en) Vehicle speed detection method and device for slow traffic system
CN116704458A (en) Transverse positioning method for automatic driving commercial vehicle

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20180116

RJ01 Rejection of invention patent application after publication