CN112284258A - System for measuring cable structure size parameters based on machine vision algorithm - Google Patents

System for measuring cable structure size parameters based on machine vision algorithm Download PDF

Info

Publication number
CN112284258A
CN112284258A CN202011547475.4A CN202011547475A CN112284258A CN 112284258 A CN112284258 A CN 112284258A CN 202011547475 A CN202011547475 A CN 202011547475A CN 112284258 A CN112284258 A CN 112284258A
Authority
CN
China
Prior art keywords
cable
unit
image
data processing
measured
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202011547475.4A
Other languages
Chinese (zh)
Other versions
CN112284258B (en
Inventor
褚凡武
彭超
张世泽
龚剑
张伟
张飞
畅爱文
阎孟昆
邬雄
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Electric Power Research Institute Co Ltd CEPRI
Original Assignee
China Electric Power Research Institute Co Ltd CEPRI
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 China Electric Power Research Institute Co Ltd CEPRI filed Critical China Electric Power Research Institute Co Ltd CEPRI
Priority to CN202011547475.4A priority Critical patent/CN112284258B/en
Publication of CN112284258A publication Critical patent/CN112284258A/en
Application granted granted Critical
Publication of CN112284258B publication Critical patent/CN112284258B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B11/00Measuring arrangements characterised by the use of optical techniques
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B11/00Measuring arrangements characterised by the use of optical techniques
    • G01B11/02Measuring arrangements characterised by the use of optical techniques for measuring length, width or thickness
    • G01B11/06Measuring arrangements characterised by the use of optical techniques for measuring length, width or thickness for measuring thickness ; e.g. of sheet material
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B11/00Measuring arrangements characterised by the use of optical techniques
    • G01B11/08Measuring arrangements characterised by the use of optical techniques for measuring diameters
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/70Denoising; Smoothing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/62Analysis of geometric attributes of area, perimeter, diameter or volume
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection

Landscapes

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

Abstract

The invention provides a system for measuring structural dimension parameters of a cable based on a machine vision algorithm, which adopts an illumination unit to illuminate a cable sample to be measured, a position control unit controls the sample to rotate and jump, an optical imaging unit acquires moving image information of the cable sample to be measured and transmits the image information to a data processing unit, the data processing unit calculates the structural dimension parameters of the sample according to the received image information, the method adopts a sub-pixel edge extraction and fitting algorithm to calculate the diameter parameters of a cable profile, a matching algorithm is used to calculate the thickness parameters of the cable profile, and an area filling method is used to calculate the number of conductor cores of the cable. The system and the method can accurately, quickly and comprehensively measure the structural dimension parameters of the cable, the maximum thickness of a tested cable sample can reach 10cm, the measurement time of the structural dimension parameters of the cable is greatly shortened, the measurement efficiency of the structural dimension parameters of the cable is improved, the measurement procedures are saved, and the labor intensity is reduced.

Description

一种基于机器视觉算法来测量电缆结构尺寸参数的系统A system for measuring the size parameters of cable structure based on machine vision algorithm

技术领域technical field

本发明涉及电缆参数测量领域,并且更具体地,涉及一种基于机器视觉算法来测量电缆结构尺寸参数的系统。The invention relates to the field of cable parameter measurement, and more particularly, to a system for measuring cable structure dimension parameters based on a machine vision algorithm.

背景技术Background technique

电缆结构尺寸参数测量是电缆到货检验和抽检的必检项目,也是发现电缆制造质量缺陷最基本的试验项目之一。开展电缆结构尺寸参数测量,易于发现电缆制造质量缺陷,可有效提升入网电缆质量,保证电缆长期安全运行。电缆结构尺寸测量参数主要包括:电缆结构轮廓直径参数、电缆结构厚度参数和电缆金属导体线芯根数。目前,在进行电缆结构尺寸参数测量时,主要借助器械或手工方式,将电缆逐层打开取样进行参数测量,严重依赖试验人员经验,测量工作繁琐,测量时间长,测量误差大且精度难以保证。因此,电缆制造、检测、运行等各个环节对具有非接触、精度高、速度快、一体化式的电缆结构尺寸参数智能测量系统有着迫切的需求。The measurement of cable structure and size parameters is a mandatory inspection item for cable arrival inspection and random inspection, and it is also one of the most basic test items for discovering cable manufacturing quality defects. Carrying out the measurement of cable structure and size parameters, it is easy to find defects in cable manufacturing quality, which can effectively improve the quality of network cables and ensure long-term safe operation of cables. The measurement parameters of the cable structure size mainly include: the diameter parameter of the cable structure outline, the thickness parameter of the cable structure and the number of metal conductors of the cable. At present, when measuring the parameters of the cable structure and size, the cable is opened layer by layer and sampled for parameter measurement mainly with the help of instruments or manual methods, which is heavily dependent on the experience of the test personnel. Therefore, there is an urgent need for a non-contact, high-precision, high-speed, integrated intelligent measurement system for cable structure and size parameters in all aspects of cable manufacturing, testing, and operation.

随着高清镜头、光学成像、运动控制等与图像采集相关的技术日益提升,图像去噪、边缘检测、图像分割与识别等机器视觉算法的日益完善,将图像作为信息传递的载体,依据视觉的原理和数字图像处理技术对物体的成像图像进行结构尺寸测量在现代工业检测领域中发挥着重要的作用。基于机器视觉的图像测量技术已在机械制造、通信、国防和航空航天等应用领域得到了实际应用。由于电缆结构尺寸范围跨度大,对绝缘厚度、屏蔽厚度等结构参数测量精度要求高,现有的技术文献所公开的测量方法测量精度低、测量参数少、测量速度慢、测量成本高,均不适用于结构层数多、参数跨度大、精度要求高来测量电缆结构尺寸参数的。With the increasing improvement of image acquisition-related technologies such as high-definition lenses, optical imaging, and motion control, and the increasing improvement of machine vision algorithms such as image denoising, edge detection, image segmentation and recognition, images are used as the carrier of information transmission. The principle and digital image processing technology to measure the structure size of the imaging image of the object plays an important role in the field of modern industrial inspection. Image measurement technology based on machine vision has been practically applied in application fields such as machine manufacturing, communication, national defense and aerospace. Due to the large span of cable structure size and high requirements for the measurement accuracy of structural parameters such as insulation thickness and shielding thickness, the measurement methods disclosed in the existing technical documents have low measurement accuracy, few measurement parameters, slow measurement speed, and high measurement costs. It is suitable for measuring the structural size parameters of cables with many structural layers, large parameter spans and high precision requirements.

发明内容SUMMARY OF THE INVENTION

为了解决现有技术中测量电缆参数是借助器械或手工方式,将电缆逐层打开取样进行参数测量,严重依赖试验人员经验,测量工作繁琐,测量时间长,测量误差大且精度难以保证的技术问题,本发明提供一种基于机器视觉算法来测量电缆结构尺寸参数的系统,所述系统包括:In order to solve the technical problems of measuring the parameters of the cable in the prior art by means of instruments or manual methods, the cable is opened layer by layer and sampled for parameter measurement, which is heavily dependent on the experience of the test personnel, the measurement work is cumbersome, the measurement time is long, the measurement error is large, and the accuracy is difficult to guarantee. , the present invention provides a system for measuring parameters of cable structure size based on machine vision algorithm, the system includes:

光学成像单元,其一端与数据处理单元连接,另一端与位置控制单元连接,用于在照明单元为待测量的电缆样品进行照明时,采集放置于位置控制单元的所述待测量的电缆样品的图像信息,并将图像信息传输至数据处理单元;The optical imaging unit, one end of which is connected to the data processing unit and the other end is connected to the position control unit, is used for collecting the information of the cable sample to be measured placed in the position control unit when the lighting unit illuminates the cable sample to be measured. image information, and transmit the image information to the data processing unit;

位置控制单元,其一端与数据处理单元连接,另一端与光学成像单元连接,其用于根据数据处理单元的第二指令,使待测量的电缆样品进行跳动和旋转;a position control unit, one end of which is connected to the data processing unit, and the other end is connected to the optical imaging unit, which is used for jumping and rotating the cable sample to be measured according to the second instruction of the data processing unit;

数据处理单元,其与光学成像单元,照明单元和位置控制单元分别连接,其用于输出第一指令控制照明单元,输出第二指令控制放置于位置控制单元的待测量的电缆样品进行跳动和旋转,并根据光学成像单元传输的图像信息计算待测量的电缆样品的结构尺寸参数;The data processing unit is connected with the optical imaging unit, the lighting unit and the position control unit respectively, and is used for outputting a first command to control the lighting unit, and outputting a second command to control the beating and rotating of the cable sample to be measured placed on the position control unit , and calculate the structural dimension parameters of the cable sample to be measured according to the image information transmitted by the optical imaging unit;

照明单元,其与数据处理单元连接,用于根据数据处理单元的第一指令为放置于位置控制单元的待测量的电缆样品进行照明,其中,所述照明单元包括:An illumination unit, which is connected to the data processing unit, and is used for illuminating the cable sample to be measured placed on the position control unit according to the first instruction of the data processing unit, wherein the illumination unit includes:

环形光源,其与光源控制器连接,用于根据光源控制器的指令为待测量的电缆样品进行照明;a ring light source, which is connected to the light source controller and used for illuminating the cable sample to be measured according to the instructions of the light source controller;

光源控制器,其一端与环形光源连接,另一端与数据处理单元连接,用于根据数据处理单元的第一指令控制环形光源的工作状态。The light source controller, one end of which is connected with the ring light source, and the other end is connected with the data processing unit, is used for controlling the working state of the ring light source according to the first instruction of the data processing unit.

进一步地,所述系统还包括:Further, the system also includes:

结果输出单元,其用于根据数据处理单元的计算结果,生成待测量的电缆样品的结构尺寸参数的检测报告,所述参数包括直径参数、厚度参数和导体线芯根数。The result output unit is used for generating a detection report of the structural dimension parameters of the cable sample to be measured according to the calculation result of the data processing unit, the parameters including diameter parameters, thickness parameters and the number of conductor cores.

进一步地,所述光学成像单元包括:Further, the optical imaging unit includes:

远心镜头,其一端与工业相机相连,另一端与位置控制单元连接,用于对待测量的电缆样品的图像进行放大;A telecentric lens, one end of which is connected with the industrial camera, and the other end is connected with the position control unit, for magnifying the image of the cable sample to be measured;

工业相机,其一端与远心镜头连接,另一端与数据处理单元连接,用于采集经远心镜头放大后的待测量的电缆样品图像的图像信息,并将图像信息传输至数据处理单元。An industrial camera, one end of which is connected to a telecentric lens and the other end is connected to a data processing unit, is used to collect image information of the image of the cable sample to be measured after being enlarged by the telecentric lens, and transmit the image information to the data processing unit.

进一步地,所述位置控制单元包括:Further, the position control unit includes:

运动控制单元,其一端与数据处理单元连接,另一端与对象驱动单元连接,用于接收数据处理单元的第二指令并输出信号至对象驱动单元,使对象驱动单元动作;a motion control unit, one end of which is connected to the data processing unit, and the other end is connected to the object driving unit, for receiving the second instruction of the data processing unit and outputting a signal to the object driving unit to make the object driving unit act;

对象驱动单元,其一端与运动控制单元连接,另一端与位置测量单元连接,用于接收运动控制单元的输出信号进行运动,并带动与其连接的位置测量单元进行跳动和旋转;The object drive unit, one end of which is connected with the motion control unit, and the other end is connected with the position measurement unit, is used for receiving the output signal of the motion control unit to move, and drives the position measurement unit connected to it to jump and rotate;

位置测量单元,其一端与对象驱动单元连接,另一端与光学成像单元连接,用于承载待测量的电缆样品,并通过自身运动带动待测量的电缆样品跳动和旋转。The position measurement unit, one end of which is connected with the object driving unit and the other end is connected with the optical imaging unit, is used for carrying the cable sample to be measured, and drives the cable sample to be measured to jump and rotate through its own motion.

根据本发明的另一方面,本发明提供一种基于机器视觉算法来测量电缆结构尺寸参数的方法,所述方法包括:According to another aspect of the present invention, the present invention provides a method for measuring parameters of a cable structure based on a machine vision algorithm, the method comprising:

待测量的电缆样品在照明单元的照射下,在位置控制单元带动所述待测量的电缆样品运动时,由光学成像单元对待测量的电缆样品进行放大并生成图像信息,以及根据所述图像信息获取待测量的电缆样品的截面小视场图像,传输所述截面小视场图像至数据处理单元;When the cable sample to be measured is illuminated by the lighting unit, when the position control unit drives the cable sample to be measured to move, the optical imaging unit enlarges the cable sample to be measured and generates image information, and obtains the image information according to the image information. A cross-sectional small field of view image of the cable sample to be measured, and the cross-sectional small field of view image is transmitted to the data processing unit;

数据处理单元从所述截面小视场图像中选择任意一张作为基准图像,提取基准图像与待拼接图像的特征点,对基准图像与待拼接图像的特征点进行匹配,实现对所述截面小视场图像的拼接,获得第一电缆截面轮廓图像,其中,所述待拼接图像是所述截面小视场图像中除基准图像以外的图像;The data processing unit selects any one of the cross-sectional small field of view images as a reference image, extracts the feature points of the reference image and the image to be spliced, and matches the feature points of the reference image and the image to be spliced, so as to realize the small field of view of the cross-section. image splicing to obtain a first cable cross-sectional profile image, wherein the image to be spliced is an image other than the reference image in the cross-sectional small field of view image;

对所述第一电缆截面轮廓图像进行滤波的同时保留轮廓边缘细节,并对滤波后的图像进行二值化处理以生成第二电缆截面轮廓图像;Filtering the first cable cross-sectional profile image while retaining contour edge details, and performing a binarization process on the filtered image to generate a second cable cross-sectional profile image;

对所述第二电缆截面轮廓图像进行亚像素边缘提取,以生成第三电缆截面轮廓图像;performing sub-pixel edge extraction on the second cable cross-sectional profile image to generate a third cable cross-sectional profile image;

根据所述第三电缆截面轮廓图像的数据计算所述待测量的电缆样品的结构尺寸参数,所述结构尺寸参数包括直径参数、厚度参数和导体线芯根数。The structural dimension parameter of the cable sample to be measured is calculated according to the data of the third cable cross-sectional profile image, and the structural dimension parameter includes a diameter parameter, a thickness parameter and the number of conductor cores.

进一步地,所述数据处理单元从所述截面小视场图像中选择任意一张作为基准图像,提取基准图像与待拼接图像的特征点,对基准图像与待拼接图像的特征点进行匹配,实现对所述截面小视场图像的拼接,获得第一电缆截面轮廓图像包括:Further, the data processing unit selects any one of the cross-sectional small field-of-view images as the reference image, extracts the feature points of the reference image and the image to be spliced, and matches the feature points of the reference image and the image to be spliced to realize the matching. The splicing of the cross-sectional small field of view images to obtain the first cable cross-sectional profile image includes:

采用Hessian矩阵对所述截面小视场图像构造尺度空间,生成图像稳定的边缘点以实现多种尺度的特征提取,其中,所述截面小视场图像中的每一个像素的Hessian矩阵表达式为:The Hessian matrix is used to construct a scale space for the cross-sectional small field of view image, and image-stabilized edge points are generated to achieve feature extraction of multiple scales, wherein the Hessian matrix expression of each pixel in the cross-sectional small field of view image is:

Figure 33535DEST_PATH_IMAGE001
Figure 33535DEST_PATH_IMAGE001

式中,

Figure 216255DEST_PATH_IMAGE002
表示图像函数,
Figure 527150DEST_PATH_IMAGE003
Figure 201321DEST_PATH_IMAGE004
Figure 546852DEST_PATH_IMAGE005
为图像函数
Figure 900473DEST_PATH_IMAGE002
关于
Figure 698664DEST_PATH_IMAGE006
Figure 445035DEST_PATH_IMAGE007
方向的二阶导数;In the formula,
Figure 216255DEST_PATH_IMAGE002
represents the image function,
Figure 527150DEST_PATH_IMAGE003
,
Figure 201321DEST_PATH_IMAGE004
,
Figure 546852DEST_PATH_IMAGE005
is the image function
Figure 900473DEST_PATH_IMAGE002
about
Figure 698664DEST_PATH_IMAGE006
,
Figure 445035DEST_PATH_IMAGE007
the second derivative of the direction;

采用Hessian矩阵判别式判定局部最大值,得到局部区域内最亮或最暗点,确定为特征点位置,其中,所述Hessian矩阵判别式为:The Hessian matrix discriminant is used to determine the local maximum value, and the brightest or darkest point in the local area is obtained, which is determined as the feature point position, wherein the Hessian matrix discriminant is:

Figure 645072DEST_PATH_IMAGE009
Figure 645072DEST_PATH_IMAGE009

其中,

Figure 904015DEST_PATH_IMAGE010
为Hessian矩阵的两个特征值,
Figure 736973DEST_PATH_IMAGE011
为Hessian矩阵的行列式,
Figure 5143DEST_PATH_IMAGE012
为Hessian矩阵经行列变化为对角矩阵M的行列式;in,
Figure 904015DEST_PATH_IMAGE010
are the two eigenvalues of the Hessian matrix,
Figure 736973DEST_PATH_IMAGE011
is the determinant of the Hessian matrix,
Figure 5143DEST_PATH_IMAGE012
is the determinant of the Hessian matrix transformed into the diagonal matrix M by rows and columns;

统计特征点周围的Haar小波,选取小波特征总和最大的方向为主方向;Count the Haar wavelets around the feature points, and select the direction with the largest sum of wavelet features as the main direction;

采用RANSAC算法求解待配对特征点的透视变换矩阵,将每一个待拼接图像通过透视变换矩阵转换至基准图像的坐标系中实现图像配准,其中,每一个待拼接图像坐标系下特征点像素坐标

Figure 262949DEST_PATH_IMAGE013
与基准图像坐标系下对应特征点像素坐标
Figure 20689DEST_PATH_IMAGE014
有如下对应关系:The RANSAC algorithm is used to solve the perspective transformation matrix of the feature points to be paired, and each image to be spliced is transformed into the coordinate system of the reference image through the perspective transformation matrix to achieve image registration, wherein the pixel coordinates of the feature points in the coordinate system of each image to be spliced
Figure 262949DEST_PATH_IMAGE013
The pixel coordinates of the corresponding feature points in the reference image coordinate system
Figure 20689DEST_PATH_IMAGE014
There are the following correspondences:

Figure 544206DEST_PATH_IMAGE015
Figure 544206DEST_PATH_IMAGE015

式中,

Figure 553750DEST_PATH_IMAGE017
为所求透视变换矩阵;In the formula,
Figure 553750DEST_PATH_IMAGE017
is the desired perspective transformation matrix;

将经透视变换矩阵转换后的全部待拼接图像与基准图像融合,生成第一电缆截面轮廓图像,其中,对图像拼接时存在的拼接边缘不连续的情况,采用加权融合的方法,对图像重叠区域的像素值,分别取基准图像和待拼接图像中的像素值按一定权值合成,其计算公式为:All the images to be spliced after transformation by the perspective transformation matrix are fused with the reference image to generate a first cable cross-sectional profile image, wherein, for the discontinuous splicing edge that exists during image splicing, the method of weighted fusion is used to analyze the overlapping area of the images. The pixel value of the reference image and the pixel value in the image to be spliced are respectively combined according to a certain weight. The calculation formula is:

Figure 525117DEST_PATH_IMAGE019
Figure 525117DEST_PATH_IMAGE019

式中,

Figure 670403DEST_PATH_IMAGE020
为拼接后图像的像素值,
Figure 930483DEST_PATH_IMAGE021
为基准图像的像素值,
Figure 540456DEST_PATH_IMAGE022
为待拼接图像的像素值,
Figure 304013DEST_PATH_IMAGE023
Figure 154288DEST_PATH_IMAGE024
为对应的权值,所述权值可根据像素点距离两幅图像边界的距离进行分配。In the formula,
Figure 670403DEST_PATH_IMAGE020
is the pixel value of the stitched image,
Figure 930483DEST_PATH_IMAGE021
is the pixel value of the reference image,
Figure 540456DEST_PATH_IMAGE022
is the pixel value of the image to be stitched,
Figure 304013DEST_PATH_IMAGE023
and
Figure 154288DEST_PATH_IMAGE024
is the corresponding weight value, and the weight value can be assigned according to the distance between the pixel point and the boundary of the two images.

进一步地,对所述第一电缆截面轮廓图像进行滤波的同时保留轮廓边缘细节,并对滤波后的图像进行二值化处理以生成第二电缆截面轮廓图像包括:Further, the filtering of the first cable cross-sectional profile image while retaining the contour edge details, and performing binarization processing on the filtered image to generate a second cable cross-sectional profile image includes:

对所述第一电缆截面轮廓图像采用引导滤波方法进行滤波,并在进行滤波时保留所述第一电缆截面轮廓图像的边缘细节,其中,采用最小二乘法拟合确定引导图像

Figure 370506DEST_PATH_IMAGE025
与滤波输出
Figure 784170DEST_PATH_IMAGE026
之间的局部线性模型,其代价函数为The first cable cross-sectional profile image is filtered using a guided filtering method, and the edge details of the first cable cross-sectional profile image are preserved during filtering, wherein the guided image is determined by least squares fitting
Figure 370506DEST_PATH_IMAGE025
with filtered output
Figure 784170DEST_PATH_IMAGE026
The local linear model between , whose cost function is

Figure 418544DEST_PATH_IMAGE027
Figure 418544DEST_PATH_IMAGE027

式中

Figure 688989DEST_PATH_IMAGE028
分别是引导图像和输入图像,
Figure 658082DEST_PATH_IMAGE029
是像素索引,
Figure 626169DEST_PATH_IMAGE030
是正则化参数,
Figure 426635DEST_PATH_IMAGE031
Figure 553466DEST_PATH_IMAGE032
分别是引导图像
Figure 275435DEST_PATH_IMAGE025
在窗口
Figure 30901DEST_PATH_IMAGE033
内的均值和方差,
Figure 623556DEST_PATH_IMAGE034
是窗口
Figure 924219DEST_PATH_IMAGE033
内元素总数,
Figure 867904DEST_PATH_IMAGE035
为输入图像
Figure 427061DEST_PATH_IMAGE036
在窗口
Figure 139802DEST_PATH_IMAGE033
内的均值;in the formula
Figure 688989DEST_PATH_IMAGE028
are the guide image and the input image, respectively,
Figure 658082DEST_PATH_IMAGE029
is the pixel index,
Figure 626169DEST_PATH_IMAGE030
is the regularization parameter,
Figure 426635DEST_PATH_IMAGE031
and
Figure 553466DEST_PATH_IMAGE032
bootstrap images
Figure 275435DEST_PATH_IMAGE025
in the window
Figure 30901DEST_PATH_IMAGE033
mean and variance within ,
Figure 623556DEST_PATH_IMAGE034
is the window
Figure 924219DEST_PATH_IMAGE033
the total number of inner elements,
Figure 867904DEST_PATH_IMAGE035
for the input image
Figure 427061DEST_PATH_IMAGE036
in the window
Figure 139802DEST_PATH_IMAGE033
mean within;

基于所述局部线性模型对第一电缆截面轮廓图像进行滤波后,对滤波后的图像进行二值化处理,只保留图像中黑、白两种颜色信息,以生成第二电缆截面轮廓图像。After filtering the first cable cross-sectional profile image based on the local linear model, the filtered image is binarized, and only the black and white color information in the image is retained to generate a second cable cross-sectional profile image.

进一步地,对所述第二电缆截面轮廓图像进行亚像素边缘提取,以生成第三电缆截面轮廓图像包括:Further, performing sub-pixel edge extraction on the second cable cross-sectional profile image to generate a third cable cross-sectional profile image includes:

采用Sobel边缘检测法对所述第二电缆截面轮廓图像逐点计算局部梯度模值,取所述模值中的最大值作为该点的梯度值,并记录所述最大值对应模板的梯度方向,作为该点的梯度方向,以生成具有方向信息的梯度图像,其中,计算局部梯度模值的公式为:The Sobel edge detection method is used to calculate the local gradient modulus value of the second cable cross-sectional profile image point by point, take the maximum value of the modulus values as the gradient value of this point, and record the gradient direction of the template corresponding to the maximum value, As the gradient direction of the point to generate a gradient image with direction information, the formula for calculating the local gradient modulus value is:

Figure 611366DEST_PATH_IMAGE037
Figure 611366DEST_PATH_IMAGE037

式中

Figure 42347DEST_PATH_IMAGE038
为图像局部
Figure 936354DEST_PATH_IMAGE039
区域按照从左到右、从上到下依次递增编号的9个点像素值;in the formula
Figure 42347DEST_PATH_IMAGE038
local to the image
Figure 936354DEST_PATH_IMAGE039
The area is incremented by 9 pixel values of 9 points from left to right and from top to bottom;

采用Zernike矩亚像素边缘检测法确定所述梯度图像中每个边缘像素点的亚像素位置,以生成第三电缆截面轮廓图像,其中,对每个边缘像素点,利用图像的Zernike矩旋转不变性,计算灰度阶跃高度

Figure 254334DEST_PATH_IMAGE040
、背景灰度级
Figure 146067DEST_PATH_IMAGE041
和圆心到边缘的垂直距离
Figure 64344DEST_PATH_IMAGE042
,并将所述参数
Figure 965304DEST_PATH_IMAGE040
Figure 134861DEST_PATH_IMAGE042
的计算结果分别与设定的阈值
Figure 728653DEST_PATH_IMAGE043
Figure 868648DEST_PATH_IMAGE044
进行比较以生成比较结果,当所述比较结果满足
Figure 573298DEST_PATH_IMAGE045
时,根据所述参数
Figure 865871DEST_PATH_IMAGE040
Figure 364985DEST_PATH_IMAGE042
的值确定每个边缘点的精确亚像素位置。The Zernike moment subpixel edge detection method is used to determine the subpixel position of each edge pixel in the gradient image to generate a third cable cross-sectional profile image, wherein, for each edge pixel, the Zernike moment rotation invariance of the image is used , calculate the grayscale step height
Figure 254334DEST_PATH_IMAGE040
, background grayscale
Figure 146067DEST_PATH_IMAGE041
and the vertical distance from the center to the edge
Figure 64344DEST_PATH_IMAGE042
, and set the parameter
Figure 965304DEST_PATH_IMAGE040
and
Figure 134861DEST_PATH_IMAGE042
The calculation results are respectively related to the set threshold
Figure 728653DEST_PATH_IMAGE043
and
Figure 868648DEST_PATH_IMAGE044
make a comparison to generate a comparison result, when the comparison result satisfies
Figure 573298DEST_PATH_IMAGE045
, according to the parameter
Figure 865871DEST_PATH_IMAGE040
and
Figure 364985DEST_PATH_IMAGE042
The value of determines the exact subpixel location of each edge point.

进一步地,根据所述第三电缆截面轮廓图像的数据计算所述待测量的电缆样品的结构尺寸参数包括:Further, calculating the structural dimension parameters of the cable sample to be measured according to the data of the third cable cross-sectional profile image includes:

基于所述第三电缆截面轮廓图像的数据计算所述待测量的电缆样品的直径参数,其中:The diameter parameter of the cable sample to be measured is calculated based on the data of the third cable cross-sectional profile image, wherein:

步骤1、基于所述第三电缆截面轮廓图像的

Figure 195538DEST_PATH_IMAGE046
个边缘点计算得到粗糙轮廓拟合圆的圆心
Figure 438300DEST_PATH_IMAGE047
和直径
Figure 834647DEST_PATH_IMAGE048
,其中,
Figure 255395DEST_PATH_IMAGE049
Figure 369981DEST_PATH_IMAGE050
Figure 150856DEST_PATH_IMAGE051
为自然数,
Figure 667288DEST_PATH_IMAGE052
Figure 258937DEST_PATH_IMAGE053
的初始值均为1;Step 1. Based on the third cable cross-sectional profile image
Figure 195538DEST_PATH_IMAGE046
The center of the rough contour fitting circle is obtained by calculating the edge points
Figure 438300DEST_PATH_IMAGE047
and diameter
Figure 834647DEST_PATH_IMAGE048
,in,
Figure 255395DEST_PATH_IMAGE049
,
Figure 369981DEST_PATH_IMAGE050
,
Figure 150856DEST_PATH_IMAGE051
is a natural number,
Figure 667288DEST_PATH_IMAGE052
and
Figure 258937DEST_PATH_IMAGE053
The initial value of is 1;

步骤2、计算所述第三电缆截面轮廓图像中所有边缘点

Figure 860820DEST_PATH_IMAGE054
到所述粗糙轮廓的拟合圆心
Figure 445385DEST_PATH_IMAGE047
的距离
Figure 816323DEST_PATH_IMAGE055
,确定
Figure 575944DEST_PATH_IMAGE055
与的差值
Figure 399544DEST_PATH_IMAGE056
,并生成差值集
Figure 584538DEST_PATH_IMAGE057
;Step 2. Calculate all edge points in the third cable cross-sectional profile image
Figure 860820DEST_PATH_IMAGE054
to the fitted center of the rough contour
Figure 445385DEST_PATH_IMAGE047
the distance
Figure 816323DEST_PATH_IMAGE055
,Sure
Figure 575944DEST_PATH_IMAGE055
difference with
Figure 399544DEST_PATH_IMAGE056
, and generate a difference set
Figure 584538DEST_PATH_IMAGE057
;

步骤3、滤除差值集

Figure 13245DEST_PATH_IMAGE058
中差值元素大于设定的距离差阈值的点,生成差值集
Figure 946697DEST_PATH_IMAGE059
,并根据所述差值集
Figure 523172DEST_PATH_IMAGE060
计算轮廓算数平均偏差
Figure 449539DEST_PATH_IMAGE061
Figure 795070DEST_PATH_IMAGE062
Figure 165003DEST_PATH_IMAGE063
为自然数;Step 3. Filter out the difference set
Figure 13245DEST_PATH_IMAGE058
The point whose difference element is greater than the set distance difference threshold will generate a difference set
Figure 946697DEST_PATH_IMAGE059
, and according to the difference set
Figure 523172DEST_PATH_IMAGE060
Calculate the arithmetic mean deviation of contours
Figure 449539DEST_PATH_IMAGE061
,
Figure 795070DEST_PATH_IMAGE062
,
Figure 165003DEST_PATH_IMAGE063
is a natural number;

步骤4、根据所述平均偏差

Figure 494353DEST_PATH_IMAGE064
对圆心坐标
Figure 224411DEST_PATH_IMAGE065
Figure 644023DEST_PATH_IMAGE066
和直径
Figure 434124DEST_PATH_IMAGE048
的偏导函数确定新的圆心
Figure 985191DEST_PATH_IMAGE067
和直径
Figure 987782DEST_PATH_IMAGE068
;Step 4. According to the average deviation
Figure 494353DEST_PATH_IMAGE064
coordinates of the center of the circle
Figure 224411DEST_PATH_IMAGE065
,
Figure 644023DEST_PATH_IMAGE066
and diameter
Figure 434124DEST_PATH_IMAGE048
The partial derivative of , determines the new center of the circle
Figure 985191DEST_PATH_IMAGE067
and diameter
Figure 987782DEST_PATH_IMAGE068
;

步骤5、根据圆心坐标

Figure 586866DEST_PATH_IMAGE069
Figure 751131DEST_PATH_IMAGE065
计算
Figure 258336DEST_PATH_IMAGE070
,根据圆心坐标
Figure 330197DEST_PATH_IMAGE071
和计算
Figure 255559DEST_PATH_IMAGE072
,根据直径
Figure 121884DEST_PATH_IMAGE068
Figure 647543DEST_PATH_IMAGE048
计算
Figure 257516DEST_PATH_IMAGE073
,其计算公式为:Step 5. According to the coordinates of the center of the circle
Figure 586866DEST_PATH_IMAGE069
and
Figure 751131DEST_PATH_IMAGE065
calculate
Figure 258336DEST_PATH_IMAGE070
, according to the coordinates of the center of the circle
Figure 330197DEST_PATH_IMAGE071
and calculation
Figure 255559DEST_PATH_IMAGE072
, according to the diameter
Figure 121884DEST_PATH_IMAGE068
and
Figure 647543DEST_PATH_IMAGE048
calculate
Figure 257516DEST_PATH_IMAGE073
, its calculation formula is:

Figure 489914DEST_PATH_IMAGE074
Figure 489914DEST_PATH_IMAGE074

步骤6、当

Figure 809031DEST_PATH_IMAGE070
Figure 821987DEST_PATH_IMAGE072
Figure 235651DEST_PATH_IMAGE073
均小于设定的误差阈值时,所述直径
Figure 322555DEST_PATH_IMAGE068
为待测量的电缆样品直径参数;当
Figure 609311DEST_PATH_IMAGE070
Figure 843983DEST_PATH_IMAGE072
Figure 543562DEST_PATH_IMAGE073
中任意一个大于设定的误差阈值,且
Figure 547290DEST_PATH_IMAGE075
时,令
Figure 129581DEST_PATH_IMAGE076
,返回步骤2;当
Figure 382708DEST_PATH_IMAGE070
Figure 888906DEST_PATH_IMAGE072
Figure 747141DEST_PATH_IMAGE073
中任意一个大于设定的误差阈值,且
Figure 765913DEST_PATH_IMAGE077
时,令
Figure 709598DEST_PATH_IMAGE078
Figure 3176DEST_PATH_IMAGE079
,返回步骤1,其中,所述第三电缆截面轮廓图像的
Figure 466649DEST_PATH_IMAGE046
个边缘点包括上一次迭代时选择的第三电缆截面轮廓图像的边缘点;Step 6, when
Figure 809031DEST_PATH_IMAGE070
,
Figure 821987DEST_PATH_IMAGE072
and
Figure 235651DEST_PATH_IMAGE073
are less than the set error threshold, the diameter
Figure 322555DEST_PATH_IMAGE068
is the diameter parameter of the cable sample to be measured; when
Figure 609311DEST_PATH_IMAGE070
,
Figure 843983DEST_PATH_IMAGE072
and
Figure 543562DEST_PATH_IMAGE073
Any one of them is greater than the set error threshold, and
Figure 547290DEST_PATH_IMAGE075
season
Figure 129581DEST_PATH_IMAGE076
, return to step 2; when
Figure 382708DEST_PATH_IMAGE070
,
Figure 888906DEST_PATH_IMAGE072
and
Figure 747141DEST_PATH_IMAGE073
Any one of them is greater than the set error threshold, and
Figure 765913DEST_PATH_IMAGE077
season
Figure 709598DEST_PATH_IMAGE078
,
Figure 3176DEST_PATH_IMAGE079
, return to step 1, where the third cable cross-sectional profile image is
Figure 466649DEST_PATH_IMAGE046
The edge points include the edge points of the third cable cross-section profile image selected in the last iteration;

对于所述第三电缆截面轮廓图像中待测样品的轮廓,设置外层轮廓为N,内层轮廓为M,基于搜索匹配计算所述待测量的电缆样品的厚度参数,其中:For the profile of the sample to be measured in the third cable cross-sectional profile image, set the outer layer profile as N and the inner layer profile as M, and calculate the thickness parameter of the to-be-measured cable sample based on search matching, where:

从N上选择a个点,从任意一点开始,寻找在该点某区域内且在M上的距离最短的匹配点,遍历N上a个点,记录每个点的匹配点,并保存至集合P中,a为自然数;Select a point from N, start from any point, find the matching point with the shortest distance on M within a certain area of the point, traverse a points on N, record the matching point of each point, and save it to the set In P, a is a natural number;

从M上选择a个点,从任意一点开始,寻找在该点某区域内且在N上的距离最短的匹配点,遍历M上a个点,记录每个点的匹配点,并保存至集合Q中,a为自然数;Select a point from M, start from any point, find the matching point with the shortest distance on N in a certain area of the point, traverse a points on M, record the matching point of each point, and save it to the set In Q, a is a natural number;

将集合P和集合Q中的匹配点对进行比对,选择每个点对中的两个点完全相同的点对作为匹配点对,将所有匹配成功的点对保存至集合中;Compare the matching point pairs in the set P and the set Q, select the two identical point pairs in each point pair as the matching point pair, and save all the successfully matched point pairs into the set;

对集合中匹配成功的点对,分别计算每个匹配点对之间的距离,保存至集合

Figure 718639DEST_PATH_IMAGE080
中;For the successfully matched point pairs in the set, calculate the distance between each matching point pair and save it to the set
Figure 718639DEST_PATH_IMAGE080
middle;

计算集合

Figure 149621DEST_PATH_IMAGE080
中所有匹配点对间距离的最大值、最小值以及平均值作为厚度的最大值、最小值和平均值;Computational Collection
Figure 149621DEST_PATH_IMAGE080
The maximum value, minimum value and average value of the distances between all matching point pairs in the

计算所述待测量的电缆样品的导体线芯根数,其计算公式为:Calculate the number of conductor cores of the cable sample to be measured, and the calculation formula is:

Figure 246890DEST_PATH_IMAGE081
Figure 246890DEST_PATH_IMAGE081

式中,

Figure 17399DEST_PATH_IMAGE053
为待测量的电缆样品的金属导体线芯概数,
Figure 925444DEST_PATH_IMAGE082
为所述第三电缆截面轮廓图像中的导体区域的像素总面积,
Figure DEST_PATH_IMAGE083
为所述第三电缆截面轮廓图像中单根导体对应的像素面积。In the formula,
Figure 17399DEST_PATH_IMAGE053
is the approximate number of metal conductor cores of the cable sample to be measured,
Figure 925444DEST_PATH_IMAGE082
is the total pixel area of the conductor region in the third cable cross-sectional profile image,
Figure DEST_PATH_IMAGE083
is the pixel area corresponding to a single conductor in the third cable cross-sectional profile image.

本发明技术方案提供的基于机器视觉算法来测量电缆结构尺寸参数的系统,所述系统采用照明单元为待测量的电缆样品进行照明,位置控制单元控制样品旋转和跳动,光学成像单元采集运动的待测量的电缆样品的图像信息传输至数据处理单元,数据处理单元根据接收的图像信息计算样品的结构尺寸参数,所述方法采用亚像素边缘提取和拟合算法计算电缆轮廓的直径参数,利用匹配算法计算电缆轮廓的厚度参数,利用区域填充方法计算电缆的导体线芯根数。所述系统和方法能够准确、快速、全面的测量电缆结构尺寸参数的,被测电缆样品最大厚度可达10cm,和现有技术中对电缆切片样品的测量比较,降低了样品的塑性变形,可提高测量精度;通过电缆局部小视场图像拼接,可提高图像单个像素的分辨率,进一步提高测量精度;能够自动完成电缆轮廓直径参数、厚度参数和导体线芯根数测量,和现有技术比较,测量误差小,测量的电缆结构尺寸参数更全面,测量过程由系统自动完成,避免人工参与,1分钟内可完成电缆结构尺寸参数测量,测量过程更迅速,极大地降低了电缆结构尺寸参数测量时间,避免逐层取样和测量,提高了电缆结构尺寸参数的测量效率,节省了测量工序,降低了劳动强度。The system for measuring the parameters of the cable structure based on the machine vision algorithm provided by the technical solution of the present invention, the system uses an illumination unit to illuminate the cable sample to be measured, the position control unit controls the rotation and beating of the sample, and the optical imaging unit collects the moving The measured image information of the cable sample is transmitted to the data processing unit, and the data processing unit calculates the structural size parameter of the sample according to the received image information. Calculate the thickness parameter of the cable outline, and use the area filling method to calculate the number of conductor cores of the cable. The system and method can accurately, quickly and comprehensively measure the structural size parameters of the cable, and the maximum thickness of the tested cable sample can reach 10cm. Improve the measurement accuracy; through the image stitching of the small field of view of the cable, the resolution of a single pixel of the image can be improved, and the measurement accuracy can be further improved; it can automatically complete the measurement of the cable outline diameter parameters, thickness parameters and the number of conductor cores, compared with the existing technology, The measurement error is small, the measured cable structure size parameters are more comprehensive, the measurement process is automatically completed by the system, avoiding manual participation, and the cable structure size parameter measurement can be completed within 1 minute, the measurement process is faster, and the cable structure size parameter measurement time is greatly reduced , to avoid layer-by-layer sampling and measurement, improve the measurement efficiency of cable structure size parameters, save the measurement process, and reduce labor intensity.

附图说明Description of drawings

通过参考下面的附图,可以更为完整地理解本发明的示例性实施方式:Exemplary embodiments of the present invention may be more fully understood by reference to the following drawings:

图1为根据本发明优选实施方式的基于机器视觉算法来测量电缆结构尺寸参数的系统的结构示意图;1 is a schematic structural diagram of a system for measuring parameters of cable structure dimensions based on a machine vision algorithm according to a preferred embodiment of the present invention;

图2为根据本发明优选实施方式的基于机器视觉算法来测量电缆结构尺寸参数的方法的流程图;FIG. 2 is a flowchart of a method for measuring a cable structure dimension parameter based on a machine vision algorithm according to a preferred embodiment of the present invention;

图3为根据本发明优选实施方式的待测量的电缆样品的截面小视场图像结构图;3 is a cross-sectional small field of view image structure diagram of a cable sample to be measured according to a preferred embodiment of the present invention;

图4为根据本发明优选实施方式的对电缆截面小视场图像进行拼接生形成完整电缆轮廓图像的结构图。FIG. 4 is a structural diagram of splicing a small field of view image of a cable cross-section to generate a complete cable outline image according to a preferred embodiment of the present invention.

具体实施方式Detailed ways

现在参考附图介绍本发明的示例性实施方式,然而,本发明可以用许多不同的形式来实施,并且不局限于此处描述的实施例,提供这些实施例是为了详尽地且完全地公开本发明,并且向所属技术领域的技术人员充分传达本发明的范围。对于表示在附图中的示例性实施方式中的术语并不是对本发明的限定。在附图中,相同的单元/元件使用相同的附图标记。Exemplary embodiments of the present invention will now be described with reference to the accompanying drawings, however, the present invention may be embodied in many different forms and is not limited to the embodiments described herein, which are provided for the purpose of this thorough and complete disclosure invention, and fully convey the scope of the invention to those skilled in the art. The terms used in the exemplary embodiments shown in the drawings are not intended to limit the invention. In the drawings, the same elements/elements are given the same reference numerals.

除非另有说明,此处使用的术语(包括科技术语)对所属技术领域的技术人员具有通常的理解含义。另外,可以理解的是,以通常使用的词典限定的术语,应当被理解为与其相关领域的语境具有一致的含义,而不应该被理解为理想化的或过于正式的意义。Unless otherwise defined, terms (including scientific and technical terms) used herein have the commonly understood meanings to those skilled in the art. In addition, it is to be understood that terms defined in commonly used dictionaries should be construed as having meanings consistent with the context in the related art, and should not be construed as idealized or overly formal meanings.

图1为根据本发明优选实施方式的基于机器视觉算法来测量电缆结构尺寸参数的系统的结构示意图。如图1所示,本优选实施方式所述的基于机器视觉算法来测量电缆结构尺寸参数的系统100包括:FIG. 1 is a schematic structural diagram of a system for measuring parameters of cable structure dimensions based on a machine vision algorithm according to a preferred embodiment of the present invention. As shown in FIG. 1 , the system 100 for measuring the parameters of the cable structure based on the machine vision algorithm according to the present preferred embodiment includes:

光学成像单元101,其一端与数据处理单元104连接,另一端与位置控制单元103连接,用于在照明单元102为待测量的电缆样品进行照明时,采集所述放置于位置控制单元103的待测量的电缆样品的图像信息,并将图像信息传输至数据处理单元104。One end of the optical imaging unit 101 is connected to the data processing unit 104, and the other end is connected to the position control unit 103, and is used for collecting the to-be-measured cable samples placed in the position control unit 103 when the lighting unit 102 illuminates the cable sample to be measured. The measured image information of the cable sample is transmitted to the data processing unit 104 .

优选地,所述光学成像单元101包括:Preferably, the optical imaging unit 101 includes:

远心镜头111,其一端与工业相机112相连,另一端与位置控制单元103连接,用于对待测量的电缆样品的图像进行放大;A telecentric lens 111, one end of which is connected to the industrial camera 112, and the other end is connected to the position control unit 103, for magnifying the image of the cable sample to be measured;

工业相机112,其一端与远心镜头111连接,另一端与数据处理单元104连接,用于采集经远心镜头放大后的待测量的电缆样品图像的图像信息,并传输至数据处理单104元。The industrial camera 112 has one end connected to the telecentric lens 111 and the other end connected to the data processing unit 104 for collecting the image information of the image of the cable sample to be measured after being enlarged by the telecentric lens, and transmitting it to the data processing unit 104 .

光学成像单元采用远心镜头可对待测量的电缆样品进行放大和提供优越的影像质素,而工业相机则可以稳定高效地采集图像信息,提高了待测量的电缆样品图像信息来源的精确度,为进行电缆结构尺寸参数计算提供了准确的图像信息。The optical imaging unit uses a telecentric lens to magnify the cable sample to be measured and provide superior image quality, while the industrial camera can collect image information stably and efficiently, improving the accuracy of the image information source of the cable sample to be measured. Calculating the parameters of the cable structure size provides accurate image information.

照明单元102,其与数据处理单元104连接,用于根据数据处理单元104的第一指令为放置于位置控制单元103的待测量的电缆样品进行照明。The lighting unit 102, which is connected with the data processing unit 104, is used for lighting the cable sample to be measured placed in the position control unit 103 according to the first instruction of the data processing unit 104.

优选地,所述照明单元102包括:Preferably, the lighting unit 102 includes:

环形光源121,其与光源控制器122连接,用于根据光源控制器122的指令为待测量的电缆样品进行照明;The ring light source 121, which is connected with the light source controller 122, is used for illuminating the cable sample to be measured according to the instruction of the light source controller 122;

光源控制器122,其一端与环形光源121连接,另一端与数据处理单元104连接,用于根据数据处理单元的第一指令控制环形光源的工作状态。The light source controller 122 has one end connected to the ring light source 121 and the other end connected to the data processing unit 104 for controlling the working state of the ring light source according to the first instruction of the data processing unit.

采用环形光源能够提供高亮度和高指向性的照明,而通过光源控制器控制环形光源的工作状态进一步提高了环形光源对待测量的电缆样品进行照明的精确度。The ring light source can provide illumination with high brightness and high directivity, and the working state of the ring light source is controlled by the light source controller to further improve the illumination accuracy of the cable sample to be measured by the ring light source.

位置控制单元103,其一端与数据处理单元104连接,另一端与光学成像单元101连接,其用于根据数据处理单元104的第二指令,使待测量的电缆样品进行跳动和旋转。One end of the position control unit 103 is connected to the data processing unit 104 , and the other end is connected to the optical imaging unit 101 , which is used for jumping and rotating the cable sample to be measured according to the second instruction of the data processing unit 104 .

优选地,所述位置控制单元103包括:Preferably, the position control unit 103 includes:

运动控制单元131,其一端与数据处理单元104连接,另一端与对象驱动单元132连接,用于接收数据处理单元104的第二指令并输出信号至对象驱动单元132,使对象驱动单元132动作;The motion control unit 131, one end is connected with the data processing unit 104, and the other end is connected with the object driving unit 132, for receiving the second instruction of the data processing unit 104 and outputting a signal to the object driving unit 132 to make the object driving unit 132 act;

对象驱动单元132,其一端与运动控制单元131连接,另一端与位置测量单元133连接,用于接收运动控制单元132的输出信号进行运动,并带动与其连接的位置测量单元133进行跳动和旋转;The object driving unit 132, one end is connected with the motion control unit 131, and the other end is connected with the position measurement unit 133, is used for receiving the output signal of the motion control unit 132 to move, and drives the position measurement unit 133 connected to it to jump and rotate;

位置测量单元133,其一端与对象驱动单元132连接,另一端与光学成像单元101连接,用于承载待测量的电缆样品,并通过自身运动带动待测量的电缆样品跳动和旋转。The position measurement unit 133 has one end connected to the object driving unit 132 and the other end connected to the optical imaging unit 101, for carrying the cable sample to be measured, and drives the cable sample to be measured to bounce and rotate through its own motion.

对象驱动单元由电机及驱动器组成,当驱动器接收运动控制单元的控制信号后,控制电机运动,从而带动与其连接的位置测量单元运动。所述位置测量单元为一个工作平台,用于承载待测量的电缆样品,并通过自身运动带动待测量的电缆样品跳动和旋转,其台面标有刻度尺寸,能大致估算电缆结构尺寸。The object drive unit is composed of a motor and a driver. After the driver receives the control signal from the motion control unit, it controls the movement of the motor, thereby driving the position measurement unit connected to it to move. The position measurement unit is a working platform for carrying the cable sample to be measured, and drives the cable sample to be measured to jump and rotate through its own motion. The table surface is marked with a scale size, which can roughly estimate the cable structure size.

数据处理单元104,其与光学成像单元101,照明单元102和位置控制单元103分别连接,其用于输出第一指令控制照明单元102,输出第二指令控制放置于位置控制单元103的待测量的电缆样品进行跳动和旋转,并根据光学成像单元101传输的图像信息计算待测量的电缆样品的结构尺寸参数。The data processing unit 104, which is connected with the optical imaging unit 101, the lighting unit 102 and the position control unit 103 respectively, is used for outputting a first instruction to control the lighting unit 102, and outputting a second instruction to control the object to be measured placed in the position control unit 103. The cable sample jumps and rotates, and the structural dimension parameters of the cable sample to be measured are calculated according to the image information transmitted by the optical imaging unit 101 .

结果输出单元105,其用于根据数据处理单元的计算结果,生成待测量的电缆样品的结构尺寸参数的检测报告,所述参数包括直径参数、厚度参数和导体线芯根数。The result output unit 105 is configured to generate a detection report of the structural dimension parameters of the cable sample to be measured according to the calculation result of the data processing unit, the parameters including diameter parameters, thickness parameters and the number of conductor cores.

图2为根据本发明优选实施方式的基于机器视觉算法来测量电缆结构尺寸参数的方法的流程图。如图2所示,本优选实施方式所述的基于机器视觉算法来测量电缆结构尺寸参数的方法从步骤200开始。FIG. 2 is a flow chart of a method for measuring the dimension parameters of a cable structure based on a machine vision algorithm according to a preferred embodiment of the present invention. As shown in FIG. 2 , the method for measuring the parameter of the cable structure size based on the machine vision algorithm according to the present preferred embodiment starts from step 200 .

在步骤201,待测量的电缆样品在照明单元的照射下,在位置控制单元带动所述待测量的电缆样品运动时,由光学成像单元对待测量的电缆样品进行放大并生成图像信息,以及根据所述图像信息获取待测量的电缆样品的截面小视场图像,传输所述截面小视场图像至数据处理单元。In step 201, when the cable sample to be measured is illuminated by the lighting unit, when the position control unit drives the cable sample to be measured to move, the optical imaging unit enlarges the cable sample to be measured and generates image information, and according to the The image information is used to obtain a cross-sectional small field of view image of the cable sample to be measured, and the cross-sectional small field of view image is transmitted to the data processing unit.

图3为根据本发明优选实施方式的待测量的电缆样品的截面小视场图像结构图。如图3所示,当待测量的电缆样品在照明单元的照射下,由位置控制单元带动所述待测量的电缆样品运动时,光学成像单元对样品进行放大并生成了若干样品的截面小视场图像,每张截面小视场图像中的结构并不相同。3 is a cross-sectional small field of view image structure diagram of a cable sample to be measured according to a preferred embodiment of the present invention. As shown in Figure 3, when the cable sample to be measured is moved by the position control unit under the illumination of the lighting unit, the optical imaging unit amplifies the sample and generates a small cross-sectional field of view of several samples image, the structure is not the same in each cross-sectional small field of view image.

在步骤202,数据处理单元从所述截面小视场图像中选择任意一张作为基准图像,提取基准图像与待拼接图像的特征点,对基准图像与待拼接图像的特征点进行匹配,实现对所述截面小视场图像的拼接,获得第一电缆截面轮廓图像,其中,所述待拼接图像是所述截面小视场图像中除基准图像以外的图像。In step 202, the data processing unit selects any one of the cross-sectional small field of view images as the reference image, extracts the feature points of the reference image and the image to be spliced, and matches the feature points of the reference image and the image to be spliced, so as to realize the matching of all the images. A first cable cross-sectional profile image is obtained by splicing the cross-sectional small field of view images, wherein the to-be-spliced image is an image other than the reference image in the cross-sectional small field of view image.

优选地,所述数据处理单元从所述截面小视场图像中选择任意一张作为基准图像,提取基准图像与待拼接图像的特征点,对基准图像与待拼接图像的特征点进行匹配,实现对所述截面小视场图像的拼接,获得第一电缆截面轮廓图像包括:Preferably, the data processing unit selects any one of the cross-sectional small field-of-view images as the reference image, extracts the feature points of the reference image and the image to be spliced, and matches the feature points of the reference image and the image to be spliced to realize the matching The splicing of the cross-sectional small field of view images to obtain the first cable cross-sectional profile image includes:

采用Hessian矩阵对所述截面小视场图像构造尺度空间,生成图像稳定的边缘点以实现多种尺度的特征提取,其中,所述截面小视场图像中的每一个像素的Hessian矩阵表达式为:The Hessian matrix is used to construct a scale space for the cross-sectional small field of view image, and image-stabilized edge points are generated to achieve feature extraction of multiple scales, wherein the Hessian matrix expression of each pixel in the cross-sectional small field of view image is:

Figure 374880DEST_PATH_IMAGE001
Figure 374880DEST_PATH_IMAGE001

式中,

Figure 275840DEST_PATH_IMAGE002
表示图像函数,
Figure 734413DEST_PATH_IMAGE003
Figure 265889DEST_PATH_IMAGE004
Figure 405883DEST_PATH_IMAGE005
为图像函数
Figure 376113DEST_PATH_IMAGE002
关于
Figure 917953DEST_PATH_IMAGE006
Figure 620329DEST_PATH_IMAGE007
方向的二阶导数;In the formula,
Figure 275840DEST_PATH_IMAGE002
represents the image function,
Figure 734413DEST_PATH_IMAGE003
,
Figure 265889DEST_PATH_IMAGE004
,
Figure 405883DEST_PATH_IMAGE005
is the image function
Figure 376113DEST_PATH_IMAGE002
about
Figure 917953DEST_PATH_IMAGE006
,
Figure 620329DEST_PATH_IMAGE007
the second derivative of the direction;

采用Hessian矩阵判别式判定局部最大值,得到局部区域内最亮或最暗点,确定为特征点位置,其中,所述Hessian矩阵判别式为:The Hessian matrix discriminant is used to determine the local maximum value, and the brightest or darkest point in the local area is obtained, which is determined as the feature point position, wherein the Hessian matrix discriminant is:

Figure DEST_PATH_IMAGE084
Figure DEST_PATH_IMAGE084

其中,

Figure 326248DEST_PATH_IMAGE010
为Hessian矩阵的两个特征值,
Figure 303432DEST_PATH_IMAGE011
为Hessian矩阵的行列式,
Figure 168620DEST_PATH_IMAGE012
为Hessian矩阵经行列变化为对角矩阵M的行列式;in,
Figure 326248DEST_PATH_IMAGE010
are the two eigenvalues of the Hessian matrix,
Figure 303432DEST_PATH_IMAGE011
is the determinant of the Hessian matrix,
Figure 168620DEST_PATH_IMAGE012
is the determinant of the Hessian matrix transformed into the diagonal matrix M by rows and columns;

统计特征点周围的Haar小波,选取小波特征总和最大的方向为主方向;Count the Haar wavelets around the feature points, and select the direction with the largest sum of wavelet features as the main direction;

采用RANSAC算法求解待配对特征点的透视变换矩阵,将每一个待拼接图像通过透视变换矩阵转换至基准图像的坐标系中实现图像配准,其中,每一个待拼接图像坐标系下特征点像素坐标

Figure 589368DEST_PATH_IMAGE013
与基准图像坐标系下对应特征点像素坐标
Figure 969534DEST_PATH_IMAGE014
有如下对应关系:The RANSAC algorithm is used to solve the perspective transformation matrix of the feature points to be paired, and each image to be spliced is transformed into the coordinate system of the reference image through the perspective transformation matrix to achieve image registration, wherein the pixel coordinates of the feature points in the coordinate system of each image to be spliced
Figure 589368DEST_PATH_IMAGE013
The pixel coordinates of the corresponding feature points in the reference image coordinate system
Figure 969534DEST_PATH_IMAGE014
There are the following correspondences:

Figure 750408DEST_PATH_IMAGE015
Figure 750408DEST_PATH_IMAGE015

式中,

Figure 266840DEST_PATH_IMAGE016
为所求透视变换矩阵;In the formula,
Figure 266840DEST_PATH_IMAGE016
is the desired perspective transformation matrix;

将经透视变换矩阵转换后的全部待拼接图像与基准图像融合,生成第一电缆截面轮廓图像,其中,对图像拼接时存在的拼接边缘不连续的情况,采用加权融合的方法,对图像重叠区域的像素值,分别取基准图像和待拼接图像中的像素值按一定权值合成,其计算公式为:All the images to be spliced after transformation by the perspective transformation matrix are fused with the reference image to generate a first cable cross-sectional profile image, wherein, for the discontinuous splicing edge that exists during image splicing, the method of weighted fusion is used to analyze the overlapping area of the images. The pixel value of the reference image and the pixel value in the image to be spliced are respectively combined according to a certain weight. The calculation formula is:

Figure DEST_PATH_IMAGE085
Figure DEST_PATH_IMAGE085

式中,

Figure 389648DEST_PATH_IMAGE020
为拼接后图像的像素值,
Figure 991530DEST_PATH_IMAGE021
为基准图像的像素值,
Figure 779358DEST_PATH_IMAGE022
为待拼接图像的像素值,
Figure 150296DEST_PATH_IMAGE023
Figure 909917DEST_PATH_IMAGE024
为对应的权值,所述权值可根据像素点距离两幅图像边界的距离进行分配。In the formula,
Figure 389648DEST_PATH_IMAGE020
is the pixel value of the stitched image,
Figure 991530DEST_PATH_IMAGE021
is the pixel value of the reference image,
Figure 779358DEST_PATH_IMAGE022
is the pixel value of the image to be stitched,
Figure 150296DEST_PATH_IMAGE023
and
Figure 909917DEST_PATH_IMAGE024
is the corresponding weight value, and the weight value can be assigned according to the distance between the pixel point and the boundary of the two images.

图4为根据本发明优选实施方式的对电缆截面小视场图像进行拼接生形成完整电缆轮廓图像的结构图。如图4所示,在对图3的多张待测量的电缆样品的截面小视场图像通过选择基准图像和拼接图像,并提取基准图像和待拼接图像的特征点进行匹配,获得了完整的电缆截面轮廓图像。FIG. 4 is a structural diagram of splicing a small field of view image of a cable cross-section to generate a complete cable outline image according to a preferred embodiment of the present invention. As shown in FIG. 4 , in the cross-sectional small field of view images of the multiple cable samples to be measured in FIG. 3 , a complete cable is obtained by selecting the reference image and the spliced image, and extracting the feature points of the reference image and the image to be spliced for matching. Cross-sectional profile image.

在步骤203,对所述第一电缆截面轮廓图像进行滤波的同时保留轮廓边缘细节,并对滤波后的图像进行二值化处理以生成第二电缆截面轮廓图像。In step 203, the first cable cross-sectional profile image is filtered while retaining contour edge details, and the filtered image is binarized to generate a second cable cross-sectional profile image.

优选地,对所述第一电缆截面轮廓图像进行滤波的同时保留轮廓边缘细节,并对滤波后的图像进行二值化处理以生成第二电缆截面轮廓图像包括:Preferably, the filtering of the first cable cross-sectional profile image while retaining the contour edge details, and performing binarization processing on the filtered image to generate the second cable cross-sectional profile image includes:

对所述第一电缆截面轮廓图像采用引导滤波方法进行滤波,并在进行滤波时保留所述第一电缆截面轮廓图像的边缘细节,其中,采用最小二乘法拟合确定引导图像

Figure 999096DEST_PATH_IMAGE025
与滤波输出
Figure 387352DEST_PATH_IMAGE026
之间的局部线性模型,其代价函数为The first cable cross-sectional profile image is filtered using a guided filtering method, and the edge details of the first cable cross-sectional profile image are preserved during filtering, wherein the guided image is determined by least squares fitting
Figure 999096DEST_PATH_IMAGE025
with filtered output
Figure 387352DEST_PATH_IMAGE026
The local linear model between , whose cost function is

Figure 816059DEST_PATH_IMAGE027
Figure 816059DEST_PATH_IMAGE027

式中

Figure 998779DEST_PATH_IMAGE028
分别是引导图像和输入图像,
Figure 591565DEST_PATH_IMAGE029
是像素索引,
Figure 517933DEST_PATH_IMAGE030
是正则化参数,
Figure 801147DEST_PATH_IMAGE031
Figure 420347DEST_PATH_IMAGE032
分别是引导图像
Figure 484118DEST_PATH_IMAGE025
在窗口
Figure 699330DEST_PATH_IMAGE033
内的均值和方差,
Figure 102629DEST_PATH_IMAGE034
是窗口
Figure 892731DEST_PATH_IMAGE033
内元素总数,
Figure 178219DEST_PATH_IMAGE035
为输入图像
Figure 711968DEST_PATH_IMAGE036
在窗口
Figure 517244DEST_PATH_IMAGE033
内的均值;in the formula
Figure 998779DEST_PATH_IMAGE028
are the guide image and the input image, respectively,
Figure 591565DEST_PATH_IMAGE029
is the pixel index,
Figure 517933DEST_PATH_IMAGE030
is the regularization parameter,
Figure 801147DEST_PATH_IMAGE031
and
Figure 420347DEST_PATH_IMAGE032
bootstrap images
Figure 484118DEST_PATH_IMAGE025
in the window
Figure 699330DEST_PATH_IMAGE033
mean and variance within ,
Figure 102629DEST_PATH_IMAGE034
is the window
Figure 892731DEST_PATH_IMAGE033
the total number of inner elements,
Figure 178219DEST_PATH_IMAGE035
for the input image
Figure 711968DEST_PATH_IMAGE036
in the window
Figure 517244DEST_PATH_IMAGE033
mean within;

基于所述局部线性模型对第一电缆截面轮廓图像进行滤波后,对滤波后的图像进行二值化处理,只保留图像中黑、白两种颜色信息,以生成第二电缆截面轮廓图像。After filtering the first cable cross-sectional profile image based on the local linear model, the filtered image is binarized, and only the black and white color information in the image is retained to generate a second cable cross-sectional profile image.

引导滤波方法对完整的电缆截面轮廓图像的边缘特征保持性好,并且对拼接图像进行滤波的同时可保留轮廓边缘细节,能够最大程度的还原电缆样品的轮廓图像,具有较好的图像还原效果。而对图像进行二值化处理则方便了提取图像中的信息,从而在进行计算机识别时增加识别效率。The guided filtering method retains the edge features of the complete cable cross-sectional profile image well, and can retain the edge details of the contour while filtering the spliced image, which can restore the contour image of the cable sample to the greatest extent, and has a good image restoration effect. The binarization of the image is convenient to extract the information in the image, thereby increasing the recognition efficiency during computer recognition.

在步骤204,对所述第二电缆截面轮廓图像进行亚像素边缘提取,以生成第三电缆截面轮廓图像。In step 204, sub-pixel edge extraction is performed on the second cable cross-sectional profile image to generate a third cable cross-sectional profile image.

优选地,对所述第二电缆截面轮廓图像进行亚像素边缘提取,以生成第三电缆截面轮廓图像包括:Preferably, performing sub-pixel edge extraction on the second cable cross-sectional profile image to generate a third cable cross-sectional profile image includes:

采用Sobel边缘检测法对所述第二电缆截面轮廓图像逐点计算局部梯度模值,取所述模值中的最大值作为该点的梯度值,并记录所述最大值对应模板的梯度方向,作为该点的梯度方向,以生成具有方向信息的梯度图像,其中,计算局部梯度模值的公式为:The Sobel edge detection method is used to calculate the local gradient modulus value of the second cable cross-sectional profile image point by point, take the maximum value of the modulus values as the gradient value of this point, and record the gradient direction of the template corresponding to the maximum value, As the gradient direction of the point, to generate a gradient image with direction information, where the formula for calculating the local gradient modulus value is:

Figure 415930DEST_PATH_IMAGE037
Figure 415930DEST_PATH_IMAGE037

式中

Figure 188714DEST_PATH_IMAGE038
为图像局部
Figure 526155DEST_PATH_IMAGE039
区域按照从左到右、从上到下依次递增编号的9个点像素值;in the formula
Figure 188714DEST_PATH_IMAGE038
local to the image
Figure 526155DEST_PATH_IMAGE039
The area is incremented by 9 pixel values of 9 points from left to right and from top to bottom;

采用Zernike矩亚像素边缘检测法确定所述梯度图像中每个边缘像素点的亚像素位置,以生成第三电缆截面轮廓图像,其中,对每个边缘像素点,利用图像的Zernike矩旋转不变性,计算灰度阶跃高度

Figure 435205DEST_PATH_IMAGE040
、背景灰度级
Figure 770371DEST_PATH_IMAGE041
和圆心到边缘的垂直距离
Figure 512675DEST_PATH_IMAGE042
,并将所述参数
Figure 653806DEST_PATH_IMAGE040
Figure 682942DEST_PATH_IMAGE042
的计算结果分别与设定的阈值
Figure 923430DEST_PATH_IMAGE043
Figure 670806DEST_PATH_IMAGE044
进行比较以生成比较结果,当所述比较结果满足
Figure 100782DEST_PATH_IMAGE045
时,根据所述参数
Figure 984424DEST_PATH_IMAGE040
Figure 395814DEST_PATH_IMAGE042
的值确定每个边缘点的精确亚像素位置。The Zernike moment subpixel edge detection method is used to determine the subpixel position of each edge pixel in the gradient image to generate a third cable cross-sectional profile image, wherein, for each edge pixel, the Zernike moment rotation invariance of the image is used , calculate the grayscale step height
Figure 435205DEST_PATH_IMAGE040
, background grayscale
Figure 770371DEST_PATH_IMAGE041
and the vertical distance from the center to the edge
Figure 512675DEST_PATH_IMAGE042
, and set the parameter
Figure 653806DEST_PATH_IMAGE040
and
Figure 682942DEST_PATH_IMAGE042
The calculation results are respectively related to the set threshold
Figure 923430DEST_PATH_IMAGE043
and
Figure 670806DEST_PATH_IMAGE044
make a comparison to generate a comparison result, when the comparison result satisfies
Figure 100782DEST_PATH_IMAGE045
, according to the parameter
Figure 984424DEST_PATH_IMAGE040
and
Figure 395814DEST_PATH_IMAGE042
The value of determines the exact subpixel location of each edge point.

在步骤205,根据所述第三电缆截面轮廓图像的数据计算所述待测量的电缆样品的结构尺寸参数,所述结构尺寸参数包括直径参数、厚度参数和导体线芯根数。In step 205, a structural dimension parameter of the cable sample to be measured is calculated according to the data of the third cable cross-sectional profile image, where the structural dimension parameter includes a diameter parameter, a thickness parameter and the number of conductor cores.

优选地,根据所述第三电缆截面轮廓图像的数据计算所述待测量的电缆样品的结构尺寸参数包括:Preferably, calculating the structural dimension parameters of the cable sample to be measured according to the data of the third cable cross-sectional profile image includes:

基于所述第三电缆截面轮廓图像的数据计算所述待测量的电缆样品的直径参数,其中:The diameter parameter of the cable sample to be measured is calculated based on the data of the third cable cross-sectional profile image, wherein:

步骤1、基于所述第三电缆截面轮廓图像的

Figure 443536DEST_PATH_IMAGE046
个边缘点计算得到粗糙轮廓拟合圆的圆心
Figure 660890DEST_PATH_IMAGE047
和直径
Figure 399039DEST_PATH_IMAGE048
,其中,
Figure 246909DEST_PATH_IMAGE049
Figure 703299DEST_PATH_IMAGE050
Figure 475077DEST_PATH_IMAGE051
为自然数,
Figure 333311DEST_PATH_IMAGE052
Figure 352083DEST_PATH_IMAGE053
的初始值均为1;Step 1. Based on the third cable cross-sectional profile image
Figure 443536DEST_PATH_IMAGE046
The center of the rough contour fitting circle is obtained by calculating the edge points
Figure 660890DEST_PATH_IMAGE047
and diameter
Figure 399039DEST_PATH_IMAGE048
,in,
Figure 246909DEST_PATH_IMAGE049
,
Figure 703299DEST_PATH_IMAGE050
,
Figure 475077DEST_PATH_IMAGE051
is a natural number,
Figure 333311DEST_PATH_IMAGE052
and
Figure 352083DEST_PATH_IMAGE053
The initial value of is 1;

步骤2、计算所述第三电缆截面轮廓图像中所有边缘点

Figure 30189DEST_PATH_IMAGE054
到所述粗糙轮廓的拟合圆心
Figure 589346DEST_PATH_IMAGE047
的距离
Figure 49890DEST_PATH_IMAGE055
,确定
Figure 301880DEST_PATH_IMAGE055
与的差值
Figure 732861DEST_PATH_IMAGE056
,并生成差值集
Figure 33392DEST_PATH_IMAGE057
;Step 2. Calculate all edge points in the third cable cross-sectional profile image
Figure 30189DEST_PATH_IMAGE054
to the fitted center of the rough contour
Figure 589346DEST_PATH_IMAGE047
the distance
Figure 49890DEST_PATH_IMAGE055
,Sure
Figure 301880DEST_PATH_IMAGE055
difference with
Figure 732861DEST_PATH_IMAGE056
, and generate a difference set
Figure 33392DEST_PATH_IMAGE057
;

步骤3、滤除差值集

Figure 600640DEST_PATH_IMAGE058
中差值元素大于设定的距离差阈值的点,生成差值集
Figure 508684DEST_PATH_IMAGE059
,并根据所述差值集
Figure 426962DEST_PATH_IMAGE060
计算轮廓算数平均偏差
Figure 62342DEST_PATH_IMAGE061
Figure 15255DEST_PATH_IMAGE062
Figure 546730DEST_PATH_IMAGE063
为自然数;Step 3. Filter out the difference set
Figure 600640DEST_PATH_IMAGE058
The point whose difference element is greater than the set distance difference threshold will generate a difference set
Figure 508684DEST_PATH_IMAGE059
, and according to the difference set
Figure 426962DEST_PATH_IMAGE060
Calculate the arithmetic mean deviation of contours
Figure 62342DEST_PATH_IMAGE061
,
Figure 15255DEST_PATH_IMAGE062
,
Figure 546730DEST_PATH_IMAGE063
is a natural number;

步骤4、根据所述平均偏差

Figure 437457DEST_PATH_IMAGE064
对圆心坐标
Figure 876529DEST_PATH_IMAGE065
Figure 683948DEST_PATH_IMAGE066
和直径
Figure 183062DEST_PATH_IMAGE048
的偏导函数确定新的圆心
Figure 13615DEST_PATH_IMAGE067
和直径
Figure 272689DEST_PATH_IMAGE068
;Step 4. According to the average deviation
Figure 437457DEST_PATH_IMAGE064
coordinates of the center of the circle
Figure 876529DEST_PATH_IMAGE065
,
Figure 683948DEST_PATH_IMAGE066
and diameter
Figure 183062DEST_PATH_IMAGE048
The partial derivative of , determines the new center of the circle
Figure 13615DEST_PATH_IMAGE067
and diameter
Figure 272689DEST_PATH_IMAGE068
;

步骤5、根据圆心坐标

Figure 934615DEST_PATH_IMAGE069
Figure 807893DEST_PATH_IMAGE065
计算
Figure 656900DEST_PATH_IMAGE070
,根据圆心坐标
Figure 703353DEST_PATH_IMAGE071
和计算
Figure 233167DEST_PATH_IMAGE072
,根据直径
Figure 74084DEST_PATH_IMAGE068
Figure 613650DEST_PATH_IMAGE048
计算
Figure 198215DEST_PATH_IMAGE073
,其计算公式为:Step 5. According to the coordinates of the center of the circle
Figure 934615DEST_PATH_IMAGE069
and
Figure 807893DEST_PATH_IMAGE065
calculate
Figure 656900DEST_PATH_IMAGE070
, according to the coordinates of the center of the circle
Figure 703353DEST_PATH_IMAGE071
and calculation
Figure 233167DEST_PATH_IMAGE072
, according to the diameter
Figure 74084DEST_PATH_IMAGE068
and
Figure 613650DEST_PATH_IMAGE048
calculate
Figure 198215DEST_PATH_IMAGE073
, its calculation formula is:

Figure 834733DEST_PATH_IMAGE074
Figure 834733DEST_PATH_IMAGE074

步骤6、当

Figure 597284DEST_PATH_IMAGE070
Figure 889725DEST_PATH_IMAGE072
Figure 12402DEST_PATH_IMAGE073
均小于设定的误差阈值时,所述直径
Figure 503426DEST_PATH_IMAGE068
为待测量的电缆样品直径参数;当
Figure 951725DEST_PATH_IMAGE070
Figure 13353DEST_PATH_IMAGE072
Figure 142983DEST_PATH_IMAGE073
中任意一个大于设定的误差阈值,且
Figure 754093DEST_PATH_IMAGE075
时,令
Figure 107714DEST_PATH_IMAGE076
,返回步骤2;当
Figure 905905DEST_PATH_IMAGE070
Figure 839226DEST_PATH_IMAGE072
Figure 789996DEST_PATH_IMAGE073
中任意一个大于设定的误差阈值,且
Figure 580097DEST_PATH_IMAGE077
时,令
Figure 865585DEST_PATH_IMAGE078
Figure 602597DEST_PATH_IMAGE079
,返回步骤1,其中,所述第三电缆截面轮廓图像的
Figure 657141DEST_PATH_IMAGE046
个边缘点包括上一次迭代时选择的第三电缆截面轮廓图像的边缘点;Step 6, when
Figure 597284DEST_PATH_IMAGE070
,
Figure 889725DEST_PATH_IMAGE072
and
Figure 12402DEST_PATH_IMAGE073
are less than the set error threshold, the diameter
Figure 503426DEST_PATH_IMAGE068
is the diameter parameter of the cable sample to be measured; when
Figure 951725DEST_PATH_IMAGE070
,
Figure 13353DEST_PATH_IMAGE072
and
Figure 142983DEST_PATH_IMAGE073
Any one of them is greater than the set error threshold, and
Figure 754093DEST_PATH_IMAGE075
season
Figure 107714DEST_PATH_IMAGE076
, return to step 2; when
Figure 905905DEST_PATH_IMAGE070
,
Figure 839226DEST_PATH_IMAGE072
and
Figure 789996DEST_PATH_IMAGE073
Any one of them is greater than the set error threshold, and
Figure 580097DEST_PATH_IMAGE077
season
Figure 865585DEST_PATH_IMAGE078
,
Figure 602597DEST_PATH_IMAGE079
, return to step 1, where the third cable cross-sectional profile image is
Figure 657141DEST_PATH_IMAGE046
The edge points include the edge points of the third cable cross-section profile image selected at the last iteration;

对于所述第三电缆截面轮廓图像中待测样品的轮廓,设置外层轮廓为N,内层轮廓为M,基于搜索匹配计算所述待测量的电缆样品的厚度参数,其中:For the profile of the sample to be measured in the third cable cross-sectional profile image, set the outer layer profile as N and the inner layer profile as M, and calculate the thickness parameter of the to-be-measured cable sample based on search matching, where:

从N上选择a个点,从任意一点开始,寻找在该点某区域内且在M上的距离最短的匹配点,遍历N上a个点,记录每个点的匹配点,并保存至集合P中,a为自然数;Select a point from N, start from any point, find the matching point with the shortest distance on M within a certain area of the point, traverse a points on N, record the matching point of each point, and save it to the set In P, a is a natural number;

从M上选择a个点,从任意一点开始,寻找在该点某区域内且在N上的距离最短的匹配点,遍历M上a个点,记录每个点的匹配点,并保存至集合Q中,a为自然数;Select a point from M, start from any point, find the matching point with the shortest distance on N in a certain area of the point, traverse a points on M, record the matching point of each point, and save it to the set In Q, a is a natural number;

将集合P和集合Q中的匹配点对进行比对,选择每个点对中的两个点完全相同的点对作为匹配点对,将所有匹配成功的点对保存至集合中;Compare the matching point pairs in the set P and the set Q, select the two identical point pairs in each point pair as the matching point pair, and save all the successfully matched point pairs into the set;

对集合中匹配成功的点对,分别计算每个匹配点对之间的距离,保存至集合

Figure 100367DEST_PATH_IMAGE080
中;For the successfully matched point pairs in the set, calculate the distance between each matching point pair and save it to the set
Figure 100367DEST_PATH_IMAGE080
middle;

计算集合

Figure DEST_PATH_IMAGE086
中所有匹配点对间距离的最大值、最小值以及平均值作为厚度的最大值、最小值和平均值;Computational Collection
Figure DEST_PATH_IMAGE086
The maximum value, minimum value and average value of the distances between all matching point pairs in the

计算所述待测量的电缆样品的导体线芯根数,其计算公式为:Calculate the number of conductor cores of the cable sample to be measured, and the calculation formula is:

Figure 669889DEST_PATH_IMAGE081
Figure 669889DEST_PATH_IMAGE081

式中,

Figure 945012DEST_PATH_IMAGE053
为待测量的电缆样品的金属导体线芯概数,
Figure 854062DEST_PATH_IMAGE082
为所述第三电缆截面轮廓图像中的导体区域的像素总面积,
Figure 2278DEST_PATH_IMAGE083
为所述第三电缆截面轮廓图像中单根导体对应的像素面积。In the formula,
Figure 945012DEST_PATH_IMAGE053
is the approximate number of metal conductor cores of the cable sample to be measured,
Figure 854062DEST_PATH_IMAGE082
is the total pixel area of the conductor region in the third cable cross-sectional profile image,
Figure 2278DEST_PATH_IMAGE083
is the pixel area corresponding to a single conductor in the third cable cross-sectional profile image.

已经通过参考少量实施方式描述了本发明。然而,本领域技术人员所公知的,正如附带的专利权利要求所限定的,除了本发明以上公开的其他的实施例等同地落在本发明的范围内。The present invention has been described with reference to a few embodiments. However, as is known to those skilled in the art, other embodiments than the above disclosed invention are equally within the scope of the invention, as defined by the appended patent claims.

通常地,在权利要求中使用的所有术语都根据他们在技术领域的通常含义被解释,除非在其中被另外明确地定义。所有的参考“一个/所述/该[装置、组件等]”都被开放地解释为所述装置、组件等中的至少一个实例,除非另外明确地说明。这里公开的任何方法的步骤都没必要以公开的准确的顺序运行,除非明确地说明。Generally, all terms used in the claims are to be interpreted according to their ordinary meaning in the technical field, unless explicitly defined otherwise herein. All references to "a/the/the [means, component, etc.]" are open to interpretation as at least one instance of said means, component, etc., unless expressly stated otherwise. The steps of any method disclosed herein do not have to be performed in the exact order disclosed, unless explicitly stated.

本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。As will be appreciated by those skilled in the art, the embodiments of the present application may be provided as a method, a system, or a computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.

本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present application. It will be understood that each flow and/or block in the flowcharts and/or block diagrams, and combinations of flows and/or blocks in the flowcharts and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to the processor of a general purpose computer, special purpose computer, embedded processor or other programmable data processing device to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing device produce Means for implementing the functions specified in one or more of the flowcharts and/or one or more blocks of the block diagrams.

这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer readable memory result in an article of manufacture comprising instruction means, the instructions An apparatus implements the functions specified in a flow or flows of the flowcharts and/or a block or blocks of the block diagrams.

这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded on a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that The instructions provide steps for implementing the functions specified in the flow or blocks of the flowcharts and/or the block or blocks of the block diagrams.

最后应当说明的是:以上实施例仅用以说明本发明的技术方案而非对其限制,尽管参照上述实施例对本发明进行了详细的说明,所属领域的普通技术人员应当理解:依然可以对本发明的具体实施方式进行修改或者等同替换,而未脱离本发明精神和范围的任何修改或者等同替换,其均应涵盖在本发明的权利要求保护范围之内。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to the above embodiments, those of ordinary skill in the art should understand that: the present invention can still be Modifications or equivalent replacements are made to the specific embodiments of the present invention, and any modifications or equivalent replacements that do not depart from the spirit and scope of the present invention shall be included within the protection scope of the claims of the present invention.

Claims (4)

1. A system for measuring dimensional parameters of a cable structure based on machine vision algorithms, the system comprising:
the optical imaging unit is connected with the data processing unit at one end and the position control unit at the other end, and is used for collecting image information of the cable sample to be measured placed in the position control unit and transmitting the image information to the data processing unit when the illumination unit illuminates the cable sample to be measured, wherein the thickness of the cable sample to be measured is not more than 10 cm;
the position control unit is connected with the data processing unit at one end and the optical imaging unit at the other end and used for jumping and rotating the cable sample to be measured according to a second instruction of the data processing unit;
the data processing unit is respectively connected with the optical imaging unit, the illuminating unit and the position control unit and is used for outputting a first instruction to control the illuminating unit, outputting a second instruction to control the jumping and rotation of a cable sample to be measured placed in the position control unit and calculating the structural size parameter of the cable sample to be measured according to image information transmitted by the optical imaging unit, wherein the parameter comprises a diameter parameter, a thickness parameter and the number of conductor cores; and
an illumination unit connected with the data processing unit and used for illuminating the cable sample to be measured placed on the position control unit according to a first instruction of the data processing unit, wherein the illumination unit comprises:
the annular light source is connected with the light source controller and used for illuminating a cable sample to be measured according to the instruction of the light source controller;
and one end of the light source controller is connected with the annular light source, and the other end of the light source controller is connected with the data processing unit and used for controlling the working state of the annular light source according to the first instruction of the data processing unit.
2. The system of claim 1, further comprising:
and the result output unit is used for generating a detection report of the structural dimension parameters of the cable sample to be measured according to the calculation result of the data processing unit.
3. The system of claim 2, wherein the optical imaging unit comprises:
one end of the telecentric lens is connected with the industrial camera, and the other end of the telecentric lens is connected with the position control unit and is used for amplifying the image of the cable sample to be measured;
and one end of the industrial camera is connected with the telecentric lens, and the other end of the industrial camera is connected with the data processing unit and is used for acquiring the image information of the cable sample image to be measured, which is amplified by the telecentric lens, and transmitting the image information to the data processing unit.
4. The system of claim 2, wherein the position control unit comprises:
the motion control unit is connected with the data processing unit at one end and connected with the object driving unit at the other end, and is used for receiving a second instruction of the data processing unit and outputting a signal to the object driving unit to enable the object driving unit to act;
the object driving unit is connected with the motion control unit at one end and connected with the position measuring unit at the other end, and is used for receiving the output signal of the motion control unit to move and driving the position measuring unit connected with the object driving unit to jump and rotate;
and one end of the position measuring unit is connected with the object driving unit, and the other end of the position measuring unit is connected with the optical imaging unit and is used for bearing the cable sample to be measured and driving the cable sample to be measured to bounce and rotate through the self-movement.
CN202011547475.4A 2020-12-24 2020-12-24 System for measuring cable structure size parameters based on machine vision algorithm Active CN112284258B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011547475.4A CN112284258B (en) 2020-12-24 2020-12-24 System for measuring cable structure size parameters based on machine vision algorithm

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011547475.4A CN112284258B (en) 2020-12-24 2020-12-24 System for measuring cable structure size parameters based on machine vision algorithm

Publications (2)

Publication Number Publication Date
CN112284258A true CN112284258A (en) 2021-01-29
CN112284258B CN112284258B (en) 2021-04-02

Family

ID=74426607

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011547475.4A Active CN112284258B (en) 2020-12-24 2020-12-24 System for measuring cable structure size parameters based on machine vision algorithm

Country Status (1)

Country Link
CN (1) CN112284258B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114216912A (en) * 2022-02-22 2022-03-22 常州海图电子科技有限公司 Machine vision-based traction steel wire rope defect detection method
CN115601315A (en) * 2022-10-09 2023-01-13 江阴市千里马电工材料有限公司(Cn) Shadow frame data processing device for wrapping silicon rubber cable
CN115854897A (en) * 2022-12-27 2023-03-28 东莞诺丹舜蒲胶辊有限公司 Rubber roller laser intelligent detection method, device, equipment and medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1385122A1 (en) * 2002-07-24 2004-01-28 Fanuc Ltd Object taking-out apparatus
CN101398291A (en) * 2007-09-25 2009-04-01 宝山钢铁股份有限公司 Band steel tracking imaging vision detection method
CN102353349A (en) * 2011-09-30 2012-02-15 广东工业大学 Machine vision based micro-sound film concentricity online testing system and testing method
CN102680849A (en) * 2012-05-29 2012-09-19 河海大学常州校区 Cable sequence identification method and equipment based on machine vision and fuzzy control

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1385122A1 (en) * 2002-07-24 2004-01-28 Fanuc Ltd Object taking-out apparatus
CN101398291A (en) * 2007-09-25 2009-04-01 宝山钢铁股份有限公司 Band steel tracking imaging vision detection method
CN102353349A (en) * 2011-09-30 2012-02-15 广东工业大学 Machine vision based micro-sound film concentricity online testing system and testing method
CN102680849A (en) * 2012-05-29 2012-09-19 河海大学常州校区 Cable sequence identification method and equipment based on machine vision and fuzzy control

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
CN114216912A (en) * 2022-02-22 2022-03-22 常州海图电子科技有限公司 Machine vision-based traction steel wire rope defect detection method
CN115601315A (en) * 2022-10-09 2023-01-13 江阴市千里马电工材料有限公司(Cn) Shadow frame data processing device for wrapping silicon rubber cable
CN115854897A (en) * 2022-12-27 2023-03-28 东莞诺丹舜蒲胶辊有限公司 Rubber roller laser intelligent detection method, device, equipment and medium

Also Published As

Publication number Publication date
CN112284258B (en) 2021-04-02

Similar Documents

Publication Publication Date Title
CN112284258B (en) System for measuring cable structure size parameters based on machine vision algorithm
CN108918539B (en) Apparent disease detection device and method for tunnel structure
CN103674839B (en) A kind of visual Sample location operating system based on spot detection and method
CN104112269B (en) A kind of solar battery laser groove parameter detection method and system based on machine vision
CN111062915A (en) A real-time steel pipe defect detection method based on improved YOLOv3 model
CN111583114B (en) Automatic measuring device and measuring method for pipeline thread
KR102084535B1 (en) Defect inspection device, defect inspection method
CN107230203A (en) Casting defect recognition methods based on human eye vision attention mechanism
CN114049356B (en) Method, device and system for detecting structure apparent crack
CN109767497B (en) Detection method for automatically detecting surface quality of aviation blade
CN109946304A (en) On-line detection system and detection method for surface defects of parts based on feature matching
CN110207951A (en) A kind of aircraft cable support assembled state detection method of view-based access control model
CN112446870A (en) Pipeline damage detection method, device, equipment and storage medium
CN116539619B (en) Product defect detection method, system, device and storage medium
CN113970560A (en) A three-dimensional defect detection method based on multi-sensor fusion
CN107891012A (en) Pearl size and circularity sorting equipment based on equivalent algorithm
CN115239661A (en) Mechanical part burr detection method and system based on image processing
CN110873718A (en) System and method for surface defect detection of steel plate based on machine vision
Bhamare et al. Quality inspection of tire using deep learning based computer vision
WO2023031622A1 (en) System and method for identifying and counting biological species
CN113763384B (en) Defect detection method and defect detection device in industrial quality inspection
Wang et al. An Attribute Extraction Algorithm based on Canny
CN100462672C (en) Image measuring system and method
Yu et al. Surface defect detection of hight-speed railway hub based on improved YOLOv3 algorithm
CN105043544A (en) Image spectrum tracking method and system

Legal Events

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