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 PDFInfo
- 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
Links
- 238000004422 calculation algorithm Methods 0.000 title claims abstract description 18
- 238000012545 processing Methods 0.000 claims abstract description 59
- 238000012634 optical imaging Methods 0.000 claims abstract description 25
- 239000004020 conductor Substances 0.000 claims abstract description 17
- 238000005286 illumination Methods 0.000 claims abstract description 10
- 230000033001 locomotion Effects 0.000 claims description 15
- 238000004364 calculation method Methods 0.000 claims description 13
- 230000009191 jumping Effects 0.000 claims description 4
- 238000001514 detection method Methods 0.000 claims description 3
- 238000005259 measurement Methods 0.000 abstract description 38
- 238000000034 method Methods 0.000 abstract description 31
- 238000000605 extraction Methods 0.000 abstract description 7
- 239000011159 matrix material Substances 0.000 description 24
- 238000010586 diagram Methods 0.000 description 12
- 238000001914 filtration Methods 0.000 description 11
- 230000006870 function Effects 0.000 description 10
- 230000009466 transformation Effects 0.000 description 10
- 238000004590 computer program Methods 0.000 description 7
- 238000003708 edge detection Methods 0.000 description 5
- 238000004519 manufacturing process Methods 0.000 description 5
- 230000008569 process Effects 0.000 description 5
- 238000005516 engineering process Methods 0.000 description 4
- 239000000284 extract Substances 0.000 description 4
- 238000007689 inspection Methods 0.000 description 4
- 239000002184 metal Substances 0.000 description 3
- 238000012360 testing method Methods 0.000 description 3
- 238000010009 beating Methods 0.000 description 2
- 230000007547 defect Effects 0.000 description 2
- 230000001419 dependent effect Effects 0.000 description 2
- 230000004927 fusion Effects 0.000 description 2
- 230000006872 improvement Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000000717 retained effect Effects 0.000 description 2
- 238000013142 basic testing Methods 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 230000007123 defense Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000003709 image segmentation Methods 0.000 description 1
- 238000003384 imaging method Methods 0.000 description 1
- 238000009413 insulation Methods 0.000 description 1
- 230000007774 longterm Effects 0.000 description 1
- 238000000691 measurement method Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000005070 sampling Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01B—MEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
- G01B11/00—Measuring arrangements characterised by the use of optical techniques
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01B—MEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
- G01B11/00—Measuring arrangements characterised by the use of optical techniques
- G01B11/02—Measuring arrangements characterised by the use of optical techniques for measuring length, width or thickness
- G01B11/06—Measuring arrangements characterised by the use of optical techniques for measuring length, width or thickness for measuring thickness ; e.g. of sheet material
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01B—MEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
- G01B11/00—Measuring arrangements characterised by the use of optical techniques
- G01B11/08—Measuring arrangements characterised by the use of optical techniques for measuring diameters
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/70—Denoising; Smoothing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
- G06T7/0004—Industrial image inspection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/13—Edge detection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/136—Segmentation; Edge detection involving thresholding
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/60—Analysis of geometric attributes
- G06T7/62—Analysis of geometric attributes of area, perimeter, diameter or volume
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10004—Still image; Photographic image
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30108—Industrial 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
Description
技术领域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:
式中,表示图像函数,、、为图像函数关于、方向的二阶导数;In the formula, represents the image function, , , is the image function about , 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:
其中,为Hessian矩阵的两个特征值,为Hessian矩阵的行列式,为Hessian矩阵经行列变化为对角矩阵M的行列式;in, are the two eigenvalues of the Hessian matrix, is the determinant of the Hessian matrix, 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算法求解待配对特征点的透视变换矩阵,将每一个待拼接图像通过透视变换矩阵转换至基准图像的坐标系中实现图像配准,其中,每一个待拼接图像坐标系下特征点像素坐标与基准图像坐标系下对应特征点像素坐标有如下对应关系: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 The pixel coordinates of the corresponding feature points in the reference image coordinate system There are the following correspondences:
式中,为所求透视变换矩阵;In the formula, 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:
式中,为拼接后图像的像素值,为基准图像的像素值,为待拼接图像的像素值,和为对应的权值,所述权值可根据像素点距离两幅图像边界的距离进行分配。In the formula, is the pixel value of the stitched image, is the pixel value of the reference image, is the pixel value of the image to be stitched, and 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:
对所述第一电缆截面轮廓图像采用引导滤波方法进行滤波,并在进行滤波时保留所述第一电缆截面轮廓图像的边缘细节,其中,采用最小二乘法拟合确定引导图像与滤波输出之间的局部线性模型,其代价函数为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 with filtered output The local linear model between , whose cost function is
式中分别是引导图像和输入图像,是像素索引,是正则化参数,和分别是引导图像在窗口内的均值和方差,是窗口内元素总数,为输入图像在窗口内的均值;in the formula are the guide image and the input image, respectively, is the pixel index, is the regularization parameter, and bootstrap images in the window mean and variance within , is the window the total number of inner elements, for the input image in the window 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:
式中为图像局部区域按照从左到右、从上到下依次递增编号的9个点像素值;in the formula local to the image The area is incremented by 9 pixel values of 9 points from left to right and from top to bottom;
采用Zernike矩亚像素边缘检测法确定所述梯度图像中每个边缘像素点的亚像素位置,以生成第三电缆截面轮廓图像,其中,对每个边缘像素点,利用图像的Zernike矩旋转不变性,计算灰度阶跃高度、背景灰度级和圆心到边缘的垂直距离,并将所述参数和的计算结果分别与设定的阈值和进行比较以生成比较结果,当所述比较结果满足时,根据所述参数和的值确定每个边缘点的精确亚像素位置。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 , background grayscale and the vertical distance from the center to the edge , and set the parameter and The calculation results are respectively related to the set threshold and make a comparison to generate a comparison result, when the comparison result satisfies , according to the parameter and 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、基于所述第三电缆截面轮廓图像的个边缘点计算得到粗糙轮廓拟合圆的圆心和直径,其中,,,为自然数,和的初始值均为1;Step 1. Based on the third cable cross-sectional profile image The center of the rough contour fitting circle is obtained by calculating the edge points and diameter ,in, , , is a natural number, and The initial value of is 1;
步骤2、计算所述第三电缆截面轮廓图像中所有边缘点到所述粗糙轮廓的拟合圆心的距离,确定与的差值,并生成差值集;Step 2. Calculate all edge points in the third cable cross-sectional profile image to the fitted center of the rough contour the distance ,Sure difference with , and generate a difference set ;
步骤3、滤除差值集中差值元素大于设定的距离差阈值的点,生成差值集,并根据所述差值集计算轮廓算数平均偏差,,为自然数;Step 3. Filter out the difference set The point whose difference element is greater than the set distance difference threshold will generate a difference set , and according to the difference set Calculate the arithmetic mean deviation of contours , , is a natural number;
步骤4、根据所述平均偏差对圆心坐标、和直径的偏导函数确定新的圆心和直径;Step 4. According to the average deviation coordinates of the center of the circle , and diameter The partial derivative of , determines the new center of the circle and diameter ;
步骤5、根据圆心坐标和计算,根据圆心坐标和计算,根据直径和计算,其计算公式为:Step 5. According to the coordinates of the center of the circle and calculate , according to the coordinates of the center of the circle and calculation , according to the diameter and calculate , its calculation formula is:
步骤6、当、和均小于设定的误差阈值时,所述直径为待测量的电缆样品直径参数;当、和中任意一个大于设定的误差阈值,且时,令,返回步骤2;当、和中任意一个大于设定的误差阈值,且时,令,,返回步骤1,其中,所述第三电缆截面轮廓图像的个边缘点包括上一次迭代时选择的第三电缆截面轮廓图像的边缘点;Step 6, when , and are less than the set error threshold, the diameter is the diameter parameter of the cable sample to be measured; when , and Any one of them is greater than the set error threshold, and season , return to step 2; when , and Any one of them is greater than the set error threshold, and season , , return to step 1, where the third cable cross-sectional profile image is 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;
对集合中匹配成功的点对,分别计算每个匹配点对之间的距离,保存至集合中;For the successfully matched point pairs in the set, calculate the distance between each matching point pair and save it to the set middle;
计算集合中所有匹配点对间距离的最大值、最小值以及平均值作为厚度的最大值、最小值和平均值;Computational Collection 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:
式中,为待测量的电缆样品的金属导体线芯概数,为所述第三电缆截面轮廓图像中的导体区域的像素总面积,为所述第三电缆截面轮廓图像中单根导体对应的像素面积。In the formula, is the approximate number of metal conductor cores of the cable sample to be measured, is the total pixel area of the conductor region in the third cable cross-sectional profile image, 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
光学成像单元101,其一端与数据处理单元104连接,另一端与位置控制单元103连接,用于在照明单元102为待测量的电缆样品进行照明时,采集所述放置于位置控制单元103的待测量的电缆样品的图像信息,并将图像信息传输至数据处理单元104。One end of the optical imaging unit 101 is connected to the
优选地,所述光学成像单元101包括:Preferably, the optical imaging unit 101 includes:
远心镜头111,其一端与工业相机112相连,另一端与位置控制单元103连接,用于对待测量的电缆样品的图像进行放大;A
工业相机112,其一端与远心镜头111连接,另一端与数据处理单元104连接,用于采集经远心镜头放大后的待测量的电缆样品图像的图像信息,并传输至数据处理单104元。The
光学成像单元采用远心镜头可对待测量的电缆样品进行放大和提供优越的影像质素,而工业相机则可以稳定高效地采集图像信息,提高了待测量的电缆样品图像信息来源的精确度,为进行电缆结构尺寸参数计算提供了准确的图像信息。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
优选地,所述照明单元102包括:Preferably, the lighting unit 102 includes:
环形光源121,其与光源控制器122连接,用于根据光源控制器122的指令为待测量的电缆样品进行照明;The
光源控制器122,其一端与环形光源121连接,另一端与数据处理单元104连接,用于根据数据处理单元的第一指令控制环形光源的工作状态。The
采用环形光源能够提供高亮度和高指向性的照明,而通过光源控制器控制环形光源的工作状态进一步提高了环形光源对待测量的电缆样品进行照明的精确度。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
优选地,所述位置控制单元103包括:Preferably, the position control unit 103 includes:
运动控制单元131,其一端与数据处理单元104连接,另一端与对象驱动单元132连接,用于接收数据处理单元104的第二指令并输出信号至对象驱动单元132,使对象驱动单元132动作;The
对象驱动单元132,其一端与运动控制单元131连接,另一端与位置测量单元133连接,用于接收运动控制单元132的输出信号进行运动,并带动与其连接的位置测量单元133进行跳动和旋转;The
位置测量单元133,其一端与对象驱动单元132连接,另一端与光学成像单元101连接,用于承载待测量的电缆样品,并通过自身运动带动待测量的电缆样品跳动和旋转。The
对象驱动单元由电机及驱动器组成,当驱动器接收运动控制单元的控制信号后,控制电机运动,从而带动与其连接的位置测量单元运动。所述位置测量单元为一个工作平台,用于承载待测量的电缆样品,并通过自身运动带动待测量的电缆样品跳动和旋转,其台面标有刻度尺寸,能大致估算电缆结构尺寸。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
结果输出单元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
在步骤201,待测量的电缆样品在照明单元的照射下,在位置控制单元带动所述待测量的电缆样品运动时,由光学成像单元对待测量的电缆样品进行放大并生成图像信息,以及根据所述图像信息获取待测量的电缆样品的截面小视场图像,传输所述截面小视场图像至数据处理单元。In
图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
优选地,所述数据处理单元从所述截面小视场图像中选择任意一张作为基准图像,提取基准图像与待拼接图像的特征点,对基准图像与待拼接图像的特征点进行匹配,实现对所述截面小视场图像的拼接,获得第一电缆截面轮廓图像包括: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:
式中,表示图像函数,、、为图像函数关于、方向的二阶导数;In the formula, represents the image function, , , is the image function about , 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:
其中,为Hessian矩阵的两个特征值,为Hessian矩阵的行列式,为Hessian矩阵经行列变化为对角矩阵M的行列式;in, are the two eigenvalues of the Hessian matrix, is the determinant of the Hessian matrix, 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算法求解待配对特征点的透视变换矩阵,将每一个待拼接图像通过透视变换矩阵转换至基准图像的坐标系中实现图像配准,其中,每一个待拼接图像坐标系下特征点像素坐标与基准图像坐标系下对应特征点像素坐标有如下对应关系: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 The pixel coordinates of the corresponding feature points in the reference image coordinate system There are the following correspondences:
式中,为所求透视变换矩阵;In the formula, 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:
式中,为拼接后图像的像素值,为基准图像的像素值,为待拼接图像的像素值,和为对应的权值,所述权值可根据像素点距离两幅图像边界的距离进行分配。In the formula, is the pixel value of the stitched image, is the pixel value of the reference image, is the pixel value of the image to be stitched, and 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
优选地,对所述第一电缆截面轮廓图像进行滤波的同时保留轮廓边缘细节,并对滤波后的图像进行二值化处理以生成第二电缆截面轮廓图像包括: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:
对所述第一电缆截面轮廓图像采用引导滤波方法进行滤波,并在进行滤波时保留所述第一电缆截面轮廓图像的边缘细节,其中,采用最小二乘法拟合确定引导图像与滤波输出之间的局部线性模型,其代价函数为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 with filtered output The local linear model between , whose cost function is
式中分别是引导图像和输入图像,是像素索引,是正则化参数,和分别是引导图像在窗口内的均值和方差,是窗口内元素总数,为输入图像在窗口内的均值;in the formula are the guide image and the input image, respectively, is the pixel index, is the regularization parameter, and bootstrap images in the window mean and variance within , is the window the total number of inner elements, for the input image in the window 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
优选地,对所述第二电缆截面轮廓图像进行亚像素边缘提取,以生成第三电缆截面轮廓图像包括: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:
式中为图像局部区域按照从左到右、从上到下依次递增编号的9个点像素值;in the formula local to the image The area is incremented by 9 pixel values of 9 points from left to right and from top to bottom;
采用Zernike矩亚像素边缘检测法确定所述梯度图像中每个边缘像素点的亚像素位置,以生成第三电缆截面轮廓图像,其中,对每个边缘像素点,利用图像的Zernike矩旋转不变性,计算灰度阶跃高度、背景灰度级和圆心到边缘的垂直距离,并将所述参数和的计算结果分别与设定的阈值和进行比较以生成比较结果,当所述比较结果满足时,根据所述参数和的值确定每个边缘点的精确亚像素位置。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 , background grayscale and the vertical distance from the center to the edge , and set the parameter and The calculation results are respectively related to the set threshold and make a comparison to generate a comparison result, when the comparison result satisfies , according to the parameter and The value of determines the exact subpixel location of each edge point.
在步骤205,根据所述第三电缆截面轮廓图像的数据计算所述待测量的电缆样品的结构尺寸参数,所述结构尺寸参数包括直径参数、厚度参数和导体线芯根数。In
优选地,根据所述第三电缆截面轮廓图像的数据计算所述待测量的电缆样品的结构尺寸参数包括: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、基于所述第三电缆截面轮廓图像的个边缘点计算得到粗糙轮廓拟合圆的圆心和直径,其中,,,为自然数,和的初始值均为1;Step 1. Based on the third cable cross-sectional profile image The center of the rough contour fitting circle is obtained by calculating the edge points and diameter ,in, , , is a natural number, and The initial value of is 1;
步骤2、计算所述第三电缆截面轮廓图像中所有边缘点到所述粗糙轮廓的拟合圆心的距离,确定与的差值,并生成差值集;Step 2. Calculate all edge points in the third cable cross-sectional profile image to the fitted center of the rough contour the distance ,Sure difference with , and generate a difference set ;
步骤3、滤除差值集中差值元素大于设定的距离差阈值的点,生成差值集,并根据所述差值集计算轮廓算数平均偏差,,为自然数;Step 3. Filter out the difference set The point whose difference element is greater than the set distance difference threshold will generate a difference set , and according to the difference set Calculate the arithmetic mean deviation of contours , , is a natural number;
步骤4、根据所述平均偏差对圆心坐标、和直径的偏导函数确定新的圆心和直径;Step 4. According to the average deviation coordinates of the center of the circle , and diameter The partial derivative of , determines the new center of the circle and diameter ;
步骤5、根据圆心坐标和计算,根据圆心坐标和计算,根据直径和计算,其计算公式为:Step 5. According to the coordinates of the center of the circle and calculate , according to the coordinates of the center of the circle and calculation , according to the diameter and calculate , its calculation formula is:
步骤6、当、和均小于设定的误差阈值时,所述直径为待测量的电缆样品直径参数;当、和中任意一个大于设定的误差阈值,且时,令,返回步骤2;当、和中任意一个大于设定的误差阈值,且时,令,,返回步骤1,其中,所述第三电缆截面轮廓图像的个边缘点包括上一次迭代时选择的第三电缆截面轮廓图像的边缘点;Step 6, when , and are less than the set error threshold, the diameter is the diameter parameter of the cable sample to be measured; when , and Any one of them is greater than the set error threshold, and season , return to step 2; when , and Any one of them is greater than the set error threshold, and season , , return to step 1, where the third cable cross-sectional profile image is 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;
对集合中匹配成功的点对,分别计算每个匹配点对之间的距离,保存至集合中;For the successfully matched point pairs in the set, calculate the distance between each matching point pair and save it to the set middle;
计算集合中所有匹配点对间距离的最大值、最小值以及平均值作为厚度的最大值、最小值和平均值;Computational Collection 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:
式中,为待测量的电缆样品的金属导体线芯概数,为所述第三电缆截面轮廓图像中的导体区域的像素总面积,为所述第三电缆截面轮廓图像中单根导体对应的像素面积。In the formula, is the approximate number of metal conductor cores of the cable sample to be measured, is the total pixel area of the conductor region in the third cable cross-sectional profile image, 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)
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)
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)
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 |
-
2020
- 2020-12-24 CN CN202011547475.4A patent/CN112284258B/en active Active
Patent Citations (4)
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)
Title |
---|
代娜: "基于机器视觉的小型规则零件二维尺寸测量研究", 《中国优秀硕士学位论文全文数据库 信息科技辑》 * |
Cited By (3)
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 |