CN110288651A - Tolerance visual inspection method, device and computing device for large-size workpieces - Google Patents
Tolerance visual inspection method, device and computing device for large-size workpieces Download PDFInfo
- Publication number
- CN110288651A CN110288651A CN201910542808.5A CN201910542808A CN110288651A CN 110288651 A CN110288651 A CN 110288651A CN 201910542808 A CN201910542808 A CN 201910542808A CN 110288651 A CN110288651 A CN 110288651A
- Authority
- CN
- China
- Prior art keywords
- image
- workpiece
- tolerance
- feature
- target
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 94
- 238000011179 visual inspection Methods 0.000 title claims abstract description 40
- 239000000284 extract Substances 0.000 claims abstract description 14
- 238000012545 processing Methods 0.000 claims description 41
- 238000000605 extraction Methods 0.000 claims description 21
- 238000004364 calculation method Methods 0.000 claims description 12
- 238000001914 filtration Methods 0.000 claims description 11
- 238000012937 correction Methods 0.000 claims description 9
- 230000000877 morphologic effect Effects 0.000 claims description 9
- 230000003044 adaptive effect Effects 0.000 claims description 8
- 230000011218 segmentation Effects 0.000 claims description 7
- 230000002194 synthesizing effect Effects 0.000 claims description 5
- 238000009434 installation Methods 0.000 claims description 4
- 238000001514 detection method Methods 0.000 description 17
- 238000004891 communication Methods 0.000 description 16
- 238000006243 chemical reaction Methods 0.000 description 12
- 239000011159 matrix material Substances 0.000 description 9
- 238000005259 measurement Methods 0.000 description 8
- 238000010586 diagram Methods 0.000 description 6
- 238000007689 inspection Methods 0.000 description 6
- 230000008569 process Effects 0.000 description 6
- 230000000007 visual effect Effects 0.000 description 6
- 238000003384 imaging method Methods 0.000 description 5
- 230000008901 benefit Effects 0.000 description 4
- 238000013519 translation Methods 0.000 description 4
- 230000006870 function Effects 0.000 description 3
- 230000002093 peripheral effect Effects 0.000 description 3
- 238000003672 processing method Methods 0.000 description 3
- 238000012360 testing method Methods 0.000 description 3
- 239000011800 void material Substances 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 2
- 238000004519 manufacturing process Methods 0.000 description 2
- 230000007723 transport mechanism Effects 0.000 description 2
- 230000004075 alteration Effects 0.000 description 1
- 238000000429 assembly Methods 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 230000001186 cumulative effect Effects 0.000 description 1
- 238000003708 edge detection Methods 0.000 description 1
- 238000007667 floating Methods 0.000 description 1
- 238000003709 image segmentation Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 239000000523 sample Substances 0.000 description 1
- 230000007704 transition Effects 0.000 description 1
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
- G01B11/002—Measuring arrangements characterised by the use of optical techniques for measuring two or more coordinates
-
- 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
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/70—Determining position or orientation of objects or cameras
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Theoretical Computer Science (AREA)
- Geometry (AREA)
- Image Analysis (AREA)
- Image Processing (AREA)
- Length Measuring Devices By Optical Means (AREA)
Abstract
本发明公开了一种大尺寸工件的公差视觉检测方法,适于在计算设备中执行,所述方法包括步骤:获取大尺寸工件中某目标部位的图像,并从该图像中提取包含安装孔的感兴趣目标区域;分别提取目标部位和目标区域的亚像素边缘,并对提取到的亚像素边缘进行轮廓跟踪,得到多个特征轮廓;对多个特征轮廓进行直线型边缘和/或椭圆弧型边缘拟合,得到线段集合和/或椭圆弧集合;提取线段集合和/或椭圆弧集合的至少一个特征点,并计算各特征点的工件坐标;以及根据各特征点的工件坐标计算目标部位及其中各安装孔的形位尺寸和公差。
The invention discloses a tolerance visual inspection method for large-size workpieces, which is suitable for execution in computing equipment. The method includes the steps of: acquiring an image of a target part in the large-size workpiece, and extracting a picture including mounting holes from the image. The target area of interest; extract the sub-pixel edges of the target part and the target area respectively, and perform contour tracking on the extracted sub-pixel edges to obtain multiple feature contours; perform linear edge and/or elliptical arc shape on multiple feature contours Edge fitting, obtains line segment set and/or elliptical arc set; Extracts at least one feature point of line segment set and/or elliptical arc set, and calculates the workpiece coordinates of each feature point; And calculate the target position and The geometrical dimensions and tolerances of each mounting hole.
Description
技术领域technical field
本发明涉及视觉检测技术领域,尤其涉及一种大尺寸工件的公差视觉检测方法、装置和计算设备。The invention relates to the technical field of visual inspection, in particular to a tolerance visual inspection method, device and computing device for large-sized workpieces.
背景技术Background technique
大尺寸工件的尺寸与形位公差检测在机械制造领域有着越来越高的需求。特别是对工件表面安装孔的位置检测尤其重要。目前主流的检测方法包括人工和三坐标测量仪。人工方法需要采用专用的检测器具进行测量,存在成本高、效率低下、检测结果不准确、无法实现全检等诸多问题。而测量精度高的三坐标测量仪价格又非常昂贵,维护麻烦,应用有限。The dimensional and geometrical tolerance detection of large-sized workpieces has a higher and higher demand in the field of machinery manufacturing. It is especially important for the position detection of the mounting holes on the workpiece surface. The current mainstream detection methods include manual and three-coordinate measuring instruments. The manual method requires the use of special detection equipment for measurement, which has many problems such as high cost, low efficiency, inaccurate detection results, and inability to achieve full inspection. The CMM with high measurement accuracy is very expensive, troublesome to maintain, and limited in application.
由于机器视觉技术具有非接触、获取信息量大、性价比高、操作简便等优点被很多学者应用到尺寸检测领域,然而目前将及其视觉技术应用到大尺寸检测的领域研究却很少。大尺寸工件的尺寸测量主流方法为基于相机拍摄大尺寸件的序列图像,其采用图像拼接的方法获得大尺寸零件的全景图,最后根据该全景图标定的每个项目所对应的结果和标定的每像素所对应实际尺寸的大小,得出待测大尺寸零件的尺寸。但该方法的检测精度存在累计误差,检测精度不够,影响检测结果的准确性。Because machine vision technology has the advantages of non-contact, large amount of information, high cost performance, and easy operation, it has been applied by many scholars to the field of size detection. The mainstream method for the size measurement of large-sized workpieces is to capture a sequence of images of large-sized workpieces based on a camera, which adopts the method of image stitching to obtain a panorama of large-sized workpieces, and finally determines the corresponding results and calibration values of each item according to the panorama. The actual size of each pixel corresponds to the size of the large-sized part to be measured. However, the detection accuracy of this method has accumulated errors, and the detection accuracy is not enough, which affects the accuracy of the detection results.
因此,需要提供一种检测精度更高的待测件尺寸检测方法。Therefore, it is necessary to provide a DUT size detection method with higher detection accuracy.
发明内容SUMMARY OF THE INVENTION
为此,本发明提供了一种大尺寸工件的公差视觉检测方法、装置和计算设备,以解决或至少缓解上面存在的问题。To this end, the present invention provides a tolerance visual inspection method, device and computing device for large-sized workpieces to solve or at least alleviate the above problems.
根据本发明的一个方面,提供了一种大尺寸工件的公差视觉检测方法,适于在计算设备中执行,该方法包括步骤:获取大尺寸工件中某目标部位的图像,并从该图像中提取包含安装孔的感兴趣目标区域;分别提取目标部位和目标区域的亚像素边缘,并对提取到的亚像素边缘进行轮廓跟踪,得到多个特征轮廓;对多个特征轮廓进行直线型边缘和/或椭圆弧型边缘拟合,得到线段集合和/或椭圆弧集合;提取线段集合和/或椭圆弧集合的至少一个特征点,并计算各特征点的工件坐标;以及根据各特征点的工件坐标计算目标部位及其中各安装孔的形位尺寸和公差。According to an aspect of the present invention, there is provided a tolerance visual inspection method for a large-sized workpiece, suitable for execution in a computing device, the method comprising the steps of: acquiring an image of a target portion in the large-sized workpiece, and extracting an image from the image The target area of interest including the mounting hole; extract the sub-pixel edges of the target part and the target area respectively, and perform contour tracking on the extracted sub-pixel edges to obtain multiple feature contours; Or elliptical arc edge fitting, obtain line segment set and/or elliptical arc set; extract at least one feature point of line segment set and/or elliptical arc set, and calculate the workpiece coordinates of each feature point; and according to the workpiece coordinates of each feature point Calculate the geometric dimensions and tolerances of the target site and each mounting hole in it.
可选地,在根据本发明的公差视觉检测方法中,还包括步骤:综合大尺寸工件的不同目标部位及其中各安装孔的形位尺寸和公差,计算大尺寸工件的形位尺寸和公差。Optionally, in the tolerance visual inspection method according to the present invention, the method further includes the step of calculating the geometric dimensions and tolerances of the large-sized workpiece by synthesizing different target parts of the large-sized workpiece and the geometrical dimensions and tolerances of the mounting holes therein.
可选地,在根据本发明的公差视觉检测方法中,从该图像中提取包含安装孔的目标区域的步骤包括:将目标部位的图像转换为灰度图像,对该灰度图像进行自适应阈值分割,并从分割后图像中提取目标区域。Optionally, in the tolerance visual inspection method according to the present invention, the step of extracting the target area including the mounting hole from the image includes: converting the image of the target part into a grayscale image, and performing adaptive thresholding on the grayscale image. Segment and extract target regions from the segmented image.
可选地,在根据本发明的公差视觉检测方法中,还包括步骤:对目标部位的图像进行畸变校正,以及对灰度图像进行滤波处理和形态学处理。Optionally, in the tolerance visual detection method according to the present invention, the method further includes the steps of: performing distortion correction on the image of the target part, and performing filtering processing and morphological processing on the grayscale image.
可选地,在根据本发明的公差视觉检测方法中,对提取到的亚像素边缘进行轮廓跟踪的步骤包括:对所提取到的亚像素边缘进行Freenman链码跟踪,并过滤噪声边缘,得到多个特征轮廓。Optionally, in the tolerance visual detection method according to the present invention, the step of performing contour tracking on the extracted sub-pixel edges includes: performing Freenman chain code tracking on the extracted sub-pixel edges, and filtering noise edges to obtain multiple feature outline.
可选地,在根据本发明的公差视觉检测方法中,过滤噪声边缘的步骤包括:分别设定面积阈值和长度阈值,并将实际面积小于该面积阈值、或者实际长度小于该长度阈值的特征轮廓设定为噪声边缘。Optionally, in the tolerance visual detection method according to the present invention, the step of filtering noise edges includes: respectively setting an area threshold and a length threshold, and determining the feature contours whose actual area is less than the area threshold or whose actual length is less than the length threshold. Set to Noise Edge.
可选地,在根据本发明的公差视觉检测方法中,还包括步骤:设定外接矩形长宽比的第一阈值和第二阈值,并将实际长宽比大于第二阈值的特征轮廓设定为直线型边缘,以及将实际长宽比小于第一阈值的特征轮廓设定为椭圆弧型边缘。Optionally, in the tolerance visual inspection method according to the present invention, it further comprises the steps of: setting a first threshold and a second threshold of the aspect ratio of the circumscribed rectangle, and setting the feature contour whose actual aspect ratio is greater than the second threshold. It is a straight edge, and the feature contour whose actual aspect ratio is less than the first threshold is set as an elliptical arc edge.
可选地,在根据本发明的公差视觉检测方法中,对多个特征轮廓进行直线型边缘/或圆弧形线段拟合的步骤包括:对属于直线型边缘的特征轮廓进行直线型边缘剔除粗大误差点的最小二乘法拟合,得到线段集合;和/或对属于椭圆弧型边缘的特征轮廓进行椭圆弧型边缘剔除粗大误差点的最小二乘法拟合,得到椭圆弧集合。Optionally, in the tolerance visual inspection method according to the present invention, the step of performing linear edge/or circular arc line segment fitting on the plurality of feature contours includes: performing linear edge culling on the feature contours belonging to the linear edge. The least squares fitting of error points is performed to obtain a line segment set; and/or the elliptical arc edge is subjected to the least squares fitting of excluding coarse error points for the feature contour belonging to the elliptical arc edge to obtain an elliptical arc set.
可选地,在根据本发明的公差视觉检测方法中,椭圆弧集合的特征点包括椭圆的中心点和各顶点,线段集合的特征点包括该线段集合中各线段的两个端点和中点。Optionally, in the tolerance visual inspection method according to the present invention, the feature points of the elliptical arc set include the center point and each vertex of the ellipse, and the feature points of the line segment set include two end points and midpoints of each line segment in the line segment set.
可选地,在根据本发明的公差视觉检测方法中,获取大尺寸工件的某目标部位的图像的步骤包括:从相机中获取得到目标部位的图像,并获取相机在拍摄该图像时定位机器人测量头的工具坐标系;其中,相机在拍摄该图像时,由定位机器人根据测距传感器测得的距离信息来调整工业相机的工作距离,以保证相机的成像平面与大尺寸工件的待检测面平行。Optionally, in the tolerance visual inspection method according to the present invention, the step of acquiring an image of a certain target part of a large-sized workpiece includes: acquiring an image of the target part from a camera, and acquiring the camera to position the robot to measure the image when the image is captured. The tool coordinate system of the head; when the camera takes the image, the positioning robot adjusts the working distance of the industrial camera according to the distance information measured by the ranging sensor to ensure that the imaging plane of the camera is parallel to the surface to be detected of the large-size workpiece .
可选地,在根据本发明的公差视觉检测方法中,计算设备中存储有工具坐标和工件坐标的转换关系,计算各特征点的工件坐标的步骤包括:根据各特征点的图像坐标来确定其工具坐标,并根据该转换关系计算各特征点的工件坐标。Optionally, in the tolerance visual inspection method according to the present invention, the conversion relationship between the tool coordinates and the workpiece coordinates is stored in the computing device, and the step of calculating the workpiece coordinates of each feature point includes: determining the image coordinates of each feature point. The tool coordinates are calculated, and the workpiece coordinates of each feature point are calculated according to the conversion relationship.
可选地,在根据本发明的公差视觉检测方法中,工具坐标系的原点与图像坐标系的原点重合,且工具坐标系的xOy平面与图像坐标系所在的平面重合;该转换关系为:Optionally, in the tolerance visual inspection method according to the present invention, the origin of the tool coordinate system coincides with the origin of the image coordinate system, and the xOy plane of the tool coordinate system coincides with the plane where the image coordinate system is located; the conversion relationship is:
Ci=R1·(Q·Vi)+T1 C i =R 1 ·(Q·V i )+T 1
其中,Ci和Vi分别是第i个特征点的工件坐标和工具坐标,T1和R1分别是拍摄该目标部位的图像时工具坐标系到工件坐标系的平移矩阵和旋转矩阵,Q是像素当量矩阵,Rh和Rv分别是相机的横向与纵向像素当量。Among them, C i and V i are the workpiece coordinates and tool coordinates of the ith feature point, respectively, T 1 and R 1 are the translation matrix and rotation matrix from the tool coordinate system to the workpiece coordinate system when the image of the target part is captured, Q is the pixel equivalent matrix, R h and R v are the horizontal and vertical pixel equivalents of the camera, respectively.
可选地,在根据本发明的公差视觉检测装置中,目标部位及其中各安装孔的尺寸形位和公差包括目标部位的外形尺寸、目标部位中各安装孔的定位尺寸和外形尺寸、以及各尺寸的偏差。Optionally, in the tolerance visual inspection device according to the present invention, the size, shape, position and tolerance of the target portion and each mounting hole therein include the external dimension of the target portion, the positioning size and external size of each mounting hole in the target portion, and the Dimensional deviation.
可选地,在根据本发明的公差视觉检测装置中,目标部位的外形尺寸结合工件外轮廓线段的中心点计算得到;安装孔的外形尺寸结合安装孔的各顶点计算得到;安装孔的定位尺寸结合参考基准线段轮廓的中心点坐标和椭圆中心点坐标计算得到。Optionally, in the tolerance visual inspection device according to the present invention, the external dimension of the target part is calculated by combining with the center point of the outer contour line segment of the workpiece; the external dimension of the mounting hole is calculated by combining with each vertex of the mounting hole; the positioning size of the mounting hole is calculated. It is calculated by combining the coordinates of the center point of the reference datum line segment and the center point of the ellipse.
可选地,在根据本发明的公差视觉检测方法中,还包括步骤:设定尺寸测量参数的标识,该标识包括工件外形尺寸标识、各安装孔的定位尺寸标识和外形尺寸标识,并将各尺寸标识与计算得到的对应尺寸值进行关联存储。Optionally, in the tolerance visual inspection method according to the present invention, it also includes the step of: setting the identification of the dimension measurement parameters, the identification including the workpiece outer dimension identification, the positioning dimension identification and the outer dimension identification of each mounting hole, and the identification of each dimension. The size identifier is stored in association with the calculated corresponding size value.
根据本发明的又一方面,提供另一种大尺寸工件的公差视觉检测方法,适于在计算设备中执行,该方法包括步骤:获取大尺寸工件的序列图像,该序列图像包括大尺寸工件的不同部位的图像;分别采用如上所述的大尺寸工件的公差视觉检测方法对每帧序列图像进行公差视觉检测,得到不同部位的形位尺寸和公差;以及综合所有部位的形位尺寸和公差,计算大尺寸工件的形位尺寸和公差。According to yet another aspect of the present invention, there is provided another method for visual inspection of tolerances of large-sized workpieces, suitable for execution in a computing device, the method comprising the step of: acquiring a sequence of images of the large-sized workpieces, the sequence images including the large-sized workpieces. Images of different parts; using the above-mentioned tolerance visual inspection method for large-size workpieces to visually inspect each frame of sequence images to obtain the shape and position dimensions and tolerances of different parts; and synthesizing the shape and position dimensions and tolerances of all parts, Calculate the geometric dimensions and tolerances of large workpieces.
根据本发明的又一方面,提供一种大尺寸工件的公差视觉检测装置,适于驻留在计算设备中,该装置包括:目标区域提取模块,适于获取大尺寸工件中某目标部位的图像,并从该图像中提取包含安装孔的感兴趣目标区域;特征轮廓提取模块,适于分别提取目标部位和目标区域的亚像素边缘,并对提取到的亚像素边缘进行轮廓跟踪,得到多个特征轮廓;特征轮廓拟合模块,适于对多个特征轮廓进行直线型边缘/或圆弧形线段拟合,得到线段集合和/或椭圆弧集合;特征点提取模块,适于提取线段集合和/或椭圆弧集合的至少一个特征点,并计算各特征点的工件坐标;以及形位尺寸计算模块,适于根据各特征点的工件坐标计算目标部位及其中各安装孔的形位尺寸和公差。According to yet another aspect of the present invention, there is provided a tolerance visual inspection device for a large-sized workpiece, suitable for resident in a computing device, the device comprising: a target area extraction module, suitable for acquiring an image of a certain target part in the large-sized workpiece , and extract the target area of interest including the mounting hole from the image; the feature contour extraction module is suitable for extracting the sub-pixel edges of the target part and the target area respectively, and performs contour tracking on the extracted sub-pixel edges to obtain multiple Feature contour; Feature contour fitting module, suitable for fitting multiple feature contours with linear edge/or circular arc line segment to obtain line segment set and/or elliptical arc set; Feature point extraction module, suitable for extracting line segment set and /or at least one feature point of the elliptical arc set, and calculate the workpiece coordinates of each feature point; and a shape and size calculation module, suitable for calculating the shape size and tolerance of the target part and each mounting hole according to the workpiece coordinates of each feature point .
可选地,在根据本发明的公差视觉检测装置中,形位尺寸计算模块还适于综合大尺寸工件的不同目标部位及其中各安装孔的形位尺寸和公差,来计算大尺寸工件的形位尺寸和公差。Optionally, in the tolerance visual inspection device according to the present invention, the shape, position and size calculation module is also suitable for synthesizing different target parts of the large-size workpiece and the shape and position dimensions and tolerances of each mounting hole therein to calculate the shape of the large-size workpiece. Bit dimensions and tolerances.
可选地,在根据本发明的公差视觉检测装置中,目标区域提取模块适于将目标部位的图像转换为灰度图像,对该灰度图像进行自适应阈值分割,并从分割后图像中提取该目标区域。Optionally, in the tolerance visual inspection device according to the present invention, the target area extraction module is adapted to convert the image of the target part into a grayscale image, perform adaptive threshold segmentation on the grayscale image, and extract the image from the segmented image. the target area.
可选地,在根据本发明的公差视觉检测装置中,目标区域提取模块还适于对目标部位的图像进行畸变校正,以及对灰度图像进行滤波处理和形态学处理。Optionally, in the tolerance visual inspection apparatus according to the present invention, the target area extraction module is further adapted to perform distortion correction on the image of the target portion, and perform filtering processing and morphological processing on the grayscale image.
根据本发明的又一方面,提供一种计算设备,包括:一个或多个处理器;存储器;以及一个或多个程序,其中一个或多个程序存储在存储器中并被配置为由一个或多个处理器执行,一个或多个程序被处理器执行时实现如上所述的大尺寸工件的公差视觉检测方法的步骤。According to yet another aspect of the present invention, there is provided a computing device comprising: one or more processors; a memory; and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by one or more When executed by a processor, one or more programs are executed by the processor to implement the steps of the above-mentioned method for tolerance visual inspection of large-sized workpieces.
根据本发明的又一方面,提供一种存储一个或多个程序的计算机可读存储介质,一个或多个程序包括指令,该指令当由计算设备执行时实现如上所述的大尺寸工件的公差视觉检测方法的步骤。According to yet another aspect of the present invention, there is provided a computer-readable storage medium storing one or more programs including instructions that, when executed by a computing device, implement the tolerances for large-sized workpieces as described above Steps of a visual inspection method.
根据本发明的技术方案,从大尺寸工件目标部位的图像中提取包含安装孔的感兴趣目标区域,并通过对目标部位和目标区域的多个特征轮廓进行边缘拟合得到线段集合和/或椭圆弧集合。之后,根据该线段集合和/或椭圆弧集合中各特征点的工件坐标来计算目标部位及各安装孔的尺寸形位和公差。这种方法通过图像处理来精确计算每个目标部位的形位尺寸和公差。According to the technical solution of the present invention, the target area of interest including the mounting hole is extracted from the image of the target part of the large-sized workpiece, and the line segment set and/or ellipse are obtained by performing edge fitting on multiple feature contours of the target part and the target area Arc collection. Then, according to the workpiece coordinates of each feature point in the line segment set and/or the elliptical arc set, the size, shape, position and tolerance of the target part and each mounting hole are calculated. This method accurately calculates the geometric dimensions and tolerances of each target part through image processing.
而且,本发明还可以获取该工件所有目标部位的图像生成序列图像,并对每帧序列图像进行处理,得到每帧图像中对应目标部位的形位尺寸和公差。之后综合所有序列图像的结果得到该大尺寸工件的形位尺寸和公差。这种方法避免了基于拼接后的全景图来标定各项目方法的累计精度问题,能够得到工件及其各部位的准确形位尺寸,且图像处理方法提高了工件尺寸检测效率。Moreover, the present invention can also acquire images of all target parts of the workpiece to generate sequence images, and process each frame of sequence images to obtain the shape, position, size and tolerance of the corresponding target parts in each frame of images. Then, the results of all the sequence images are combined to obtain the shape, position and tolerance of the large-sized workpiece. This method avoids the cumulative accuracy problem of calibrating each item method based on the spliced panorama, and can obtain the accurate shape and size of the workpiece and its various parts, and the image processing method improves the detection efficiency of the workpiece size.
上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。The above description is only an overview of the technical solutions of the present invention, in order to be able to understand the technical means of the present invention more clearly, it can be implemented according to the content of the description, and in order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand , the following specific embodiments of the present invention are given.
附图说明Description of drawings
为了实现上述以及相关目的,本文结合下面的描述和附图来描述某些说明性方面,这些方面指示了可以实践本文所公开的原理的各种方式,并且所有方面及其等效方面旨在落入所要求保护的主题的范围内。通过结合附图阅读下面的详细描述,本公开的上述以及其它目的、特征和优势将变得更加明显。遍及本公开,相同的附图标记通常指代相同的部件或元素。To achieve the above and related objects, certain illustrative aspects are described herein in conjunction with the following description and drawings, which are indicative of the various ways in which the principles disclosed herein may be practiced, and all aspects and their equivalents are intended to be within the scope of the claimed subject matter. The above and other objects, features and advantages of the present disclosure will become more apparent by reading the following detailed description in conjunction with the accompanying drawings. Throughout this disclosure, the same reference numbers generally refer to the same parts or elements.
图1示出了根据本发明一个实施例的公差视觉检测系统100的结构图;FIG. 1 shows a structural diagram of a tolerance visual inspection system 100 according to an embodiment of the present invention;
图2示出了根据本发明一个实施例的计算设备200的结构图;FIG. 2 shows a structural diagram of a computing device 200 according to an embodiment of the present invention;
图3示出了根据本发明一个实施例中的大尺寸工件的公差视觉检测方法300的流程图;FIG. 3 shows a flowchart of a method 300 for visual tolerance inspection of large-sized workpieces according to an embodiment of the present invention;
图4a至图4d分别示出了某大尺寸工件多个目标部位的序列图像;Figures 4a to 4d respectively show sequence images of multiple target parts of a large-sized workpiece;
图5a至图5e分别示出了对图5c中目标部位的安装孔进行定位的示意图;Figures 5a to 5e respectively show schematic diagrams of positioning the mounting holes of the target site in Figure 5c;
图6和图7分别示出了根据本发明另一个实施例中的大尺寸工件的公差视觉检测方法600和700的流程图;以及FIG. 6 and FIG. 7 respectively show flowcharts of tolerance visual inspection methods 600 and 700 for large-sized workpieces according to another embodiment of the present invention; and
图8示出了根据本发明一个实施例的大尺寸工件的公差视觉检测装置800的结构图。FIG. 8 shows a structural diagram of a tolerance visual inspection device 800 for large-sized workpieces according to an embodiment of the present invention.
具体实施方式Detailed ways
下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided so that the present disclosure will be more thoroughly understood, and will fully convey the scope of the present disclosure to those skilled in the art.
图1示出了本发明的公差视觉检测系统100的结构图。如图1所示,系统100包括定位机器人110、采集模块和计算设备。采集模块安装在定位机器人110上,采集模块包括相机120和测距传感器,且相机120和测距传感器均与计算设备相连。FIG. 1 shows a structural diagram of a tolerance visual inspection system 100 of the present invention. As shown in FIG. 1, the system 100 includes a positioning robot 110, a collection module and a computing device. The acquisition module is installed on the positioning robot 110, and the acquisition module includes a camera 120 and a ranging sensor, and both the camera 120 and the ranging sensor are connected to the computing device.
定位机器人110带动采集模块运动至待检测面的预定位置,以便相机120在预定位置上大尺寸工件上的待检测面进行拍摄,得到待检测面的图像。根据一个实施例,定位机器人110可以为机械臂,该机械臂的末端固定安装该采集模块。机械臂的臂展可以为1420mm,当然不限于此,也可以为其他数值。The positioning robot 110 drives the acquisition module to move to a predetermined position of the surface to be inspected, so that the camera 120 can photograph the surface to be inspected on the large-sized workpiece at the predetermined position to obtain an image of the surface to be inspected. According to one embodiment, the positioning robot 110 may be a robotic arm, and the end of the robotic arm is fixedly installed with the acquisition module. The arm span of the robotic arm may be 1420mm, which is of course not limited to this, and may also be other values.
相机120可以为工业相机,如CCD相机、CMOS相机等,当然不限于此。相机120在进行图像采集之前可进行张正友标定法的相机畸变矫正,以避免镜头透镜因制造精度和组装工艺的偏差所引入的透镜畸变。测距传感器可以为激光测距传感器,其在定位机器人110带动下沿待检测面的边缘运动,并记录相机到待检测面的距离数据。定位机器人110根据该距离数据对相机120到待检测面的距离进行调整,使相机120的成像平面与大尺寸工件的待测面平行,保证能够采集到待检测面的清晰图像。这种配合激光测距的图像采集方式还可避免因成像平面与待测面不平行而造成“近大远小”的透视畸变问题,提高图像采集的质量。The camera 120 may be an industrial camera, such as a CCD camera, a CMOS camera, etc., of course, it is not limited thereto. The camera 120 may perform camera distortion correction using Zhang Zhengyou's calibration method before image acquisition, so as to avoid lens distortion caused by deviations in manufacturing precision and assembly process of the lens. The ranging sensor may be a laser ranging sensor, which moves along the edge of the surface to be detected under the driving of the positioning robot 110 and records the distance data from the camera to the surface to be detected. The positioning robot 110 adjusts the distance between the camera 120 and the surface to be inspected according to the distance data, so that the imaging plane of the camera 120 is parallel to the surface to be inspected of the large-sized workpiece, so as to ensure that a clear image of the surface to be inspected can be collected. This image acquisition method combined with laser ranging can also avoid the perspective distortion problem of "near large and far small" caused by the non-parallel imaging plane and the surface to be measured, and improve the quality of image acquisition.
计算设备可获取相机120采集到的图像和相机120在采集该图像时的工具坐标系,并根据采集到的图像和工具坐标系来确定待测件的尺寸形位和公差。计算设备还可根据测距传感器测得的距离数据来确定待测面的平行度或垂直度。待测件通常包括多个待检测面,每个待测面上分布有若干个安装孔,该安装孔可以为圆孔、方孔、螺纹孔、装配孔等,本发明对孔的形状和结构不做限制。待测件的结构尺寸可包括外形尺寸和定位尺寸。定位尺寸是指待待测件上的两个结构之间的尺寸,例如两个孔之间的尺寸,从而根据定位尺寸确定待测件上的孔的相对位置。外形尺寸是指待测件上结构的本身尺寸,例如工件整体尺寸、孔的直径、半径等自身尺寸。形位公差通常包括直线度、平行度、垂直度、倾斜度等特征。The computing device may acquire the image captured by the camera 120 and the tool coordinate system of the camera 120 when capturing the image, and determine the size, shape, position and tolerance of the DUT according to the captured image and the tool coordinate system. The computing device can also determine the parallelism or perpendicularity of the surface to be measured according to the distance data measured by the distance measuring sensor. The test piece usually includes a plurality of surfaces to be tested, and each surface to be tested is distributed with several mounting holes. The mounting holes can be round holes, square holes, threaded holes, assembly holes, etc. No restrictions. The structural dimensions of the DUT may include external dimensions and positioning dimensions. The positioning size refers to the size between two structures on the DUT, such as the size between two holes, so that the relative positions of the holes on the DUT are determined according to the positioning size. The external dimension refers to the size of the structure on the test piece, such as the overall size of the workpiece, the diameter of the hole, the radius and so on. Geometric tolerances usually include features such as straightness, parallelism, perpendicularity, and inclination.
图2示出了根据本发明一个实施例的计算设备200的结构框图。在基本的配置202中,计算设备200典型地包括系统存储器206和一个或者多个处理器204。存储器总线208可以用于在处理器204和系统存储器206之间的通信。FIG. 2 shows a structural block diagram of a computing device 200 according to an embodiment of the present invention. In basic configuration 202 , computing device 200 typically includes system memory 206 and one or more processors 204 . Memory bus 208 may be used for communication between processor 204 and system memory 206 .
取决于期望的配置,处理器204可以是任何类型的处理,包括但不限于:微处理器(μP)、微控制器(μC)、数字信息处理器(DSP)或者它们的任何组合。处理器204可以包括诸如一级高速缓存210和二级高速缓存212之类的一个或者多个级别的高速缓存、处理器核心214和寄存器216。示例的处理器核心214可以包括运算逻辑单元(ALU)、浮点数单元(FPU)、数字信号处理核心(DSP核心)或者它们的任何组合。示例的存储器控制器218可以与处理器204一起使用,或者在一些实现中,存储器控制器218可以是处理器204的一个内部部分。Depending on the desired configuration, the processor 204 may be any type of process including, but not limited to, a microprocessor (μP), a microcontroller (μC), a digital information processor (DSP), or any combination thereof. Processor 204 may include one or more levels of cache, such as L1 cache 210 and L2 cache 212 , processor core 214 , and registers 216 . Exemplary processor cores 214 may include arithmetic logic units (ALUs), floating point units (FPUs), digital signal processing cores (DSP cores), or any combination thereof. The exemplary memory controller 218 may be used with the processor 204 , or in some implementations, the memory controller 218 may be an internal part of the processor 204 .
取决于期望的配置,系统存储器206可以是任意类型的存储器,包括但不限于:易失性存储器(诸如RAM)、非易失性存储器(诸如ROM、闪存等)或者它们的任何组合。系统存储器206可以包括操作系统220、一个或者多个应用222以及程序数据224。在一些实施方式中,应用222可以布置为在操作系统上利用程序数据224进行操作。程序数据224包括指令,在根据本发明的计算设备200中,程序数据224包含用于执行大尺寸工件的公差视觉检测方法300、600和/或700的指令。Depending on the desired configuration, system memory 206 may be any type of memory including, but not limited to, volatile memory (such as RAM), non-volatile memory (such as ROM, flash memory, etc.), or any combination thereof. System memory 206 may include operating system 220 , one or more applications 222 , and program data 224 . In some embodiments, application 222 may be arranged to operate with program data 224 on an operating system. The program data 224 includes instructions, in the computing device 200 according to the present invention, the program data 224 includes instructions for performing the tolerance vision inspection methods 300, 600 and/or 700 for large-sized workpieces.
计算设备200还可以包括有助于从各种接口设备(例如,输出设备242、外设接口244和通信设备246)到基本配置102经由总线/接口控制器230的通信的接口总线240。示例的输出设备242包括图形处理单元248和音频处理单元250。它们可以被配置为有助于经由一个或者多个A/V端口252与诸如显示器或者扬声器之类的各种外部设备进行通信。示例外设接口244可以包括串行接口控制器254和并行接口控制器256,它们可以被配置为有助于经由一个或者多个I/O端口258和诸如输入设备(例如,键盘、鼠标、笔、语音输入设备、触摸输入设备)或者其他外设(例如打印机、扫描仪等)之类的外部设备进行通信。示例的通信设备246可以包括网络控制器160,其可以被布置为便于经由一个或者多个通信端口264与一个或者多个其他计算设备262通过网络通信链路的通信。Computing device 200 may also include an interface bus 240 that facilitates communication from various interface devices (eg, output device 242 , peripheral interface 244 , and communication device 246 ) to base configuration 102 via bus/interface controller 230 . Example output devices 242 include graphics processing unit 248 and audio processing unit 250 . They may be configured to facilitate communication via one or more A/V ports 252 with various external devices such as displays or speakers. Example peripheral interfaces 244 may include serial interface controller 254 and parallel interface controller 256, which may be configured to facilitate communication via one or more I/O ports 258 and input devices such as keyboard, mouse, pen, etc. , voice input devices, touch input devices) or other peripherals (eg printers, scanners, etc.) The example communication device 246 may include a network controller 160 that may be arranged to facilitate communication via one or more communication ports 264 with one or more other computing devices 262 over a network communication link.
网络通信链路可以是通信介质的一个示例。通信介质通常可以体现为在诸如载波或者其他传输机制之类的调制数据信号中的计算机可读指令、数据结构、程序模块,并且可以包括任何信息递送介质。“调制数据信号”可以这样的信号,它的数据集中的一个或者多个或者它的改变可以在信号中编码信息的方式进行。作为非限制性的示例,通信介质可以包括诸如有线网络或者专线网络之类的有线介质,以及诸如声音、射频(RF)、微波、红外(IR)或者其它无线介质在内的各种无线介质。这里使用的术语计算机可读介质可以包括存储介质和通信介质二者。A network communication link may be one example of a communication medium. Communication media may typically embody computer readable instructions, data structures, program modules in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media. A "modulated data signal" can be a signal of which one or more of its data sets or whose alterations can be made in such a way as to encode information in the signal. By way of non-limiting example, communication media may include wired media, such as wired or leased line networks, and various wireless media, such as acoustic, radio frequency (RF), microwave, infrared (IR), or other wireless media. The term computer readable medium as used herein may include both storage media and communication media.
计算设备200可以实现为服务器,例如文件服务器、数据库服务器、应用程序服务器和WEB服务器等,也可以实现为小尺寸便携(或者移动)电子设备的一部分,这些电子设备可以是诸如蜂窝电话、个人数字助理(PDA)、个人媒体播放器设备、无线网络浏览设备、个人头戴设备、应用专用设备、或者可以包括上面任何功能的混合设备。计算设备200还可以实现为包括桌面计算机和笔记本计算机配置的个人计算机。在一些实施例中,计算设备200被配置为执行大尺寸工件的公差视觉检测方法300、600和/或700。Computing device 200 can be implemented as a server, such as a file server, database server, application server, and WEB server, etc., or as part of a small-sized portable (or mobile) electronic device such as a cellular phone, a personal digital Assistants (PDAs), personal media player devices, wireless web browsing devices, personal headsets, application specific devices, or hybrid devices that may include any of the above. Computing device 200 may also be implemented as a personal computer including desktop computer and notebook computer configurations. In some embodiments, computing device 200 is configured to perform methods 300, 600, and/or 700 for tolerance visual inspection of large-sized workpieces.
图3示出了根据本发明一个实施例的大尺寸工件的公差视觉检测方法300的流程示意图。方法300在计算设备中执行,如在计算设备200中执行,以对大尺寸工件的形位尺寸和公差进行检测。FIG. 3 shows a schematic flowchart of a method 300 for visual tolerance inspection of large-sized workpieces according to an embodiment of the present invention. The method 300 is performed in a computing device, such as in the computing device 200, to detect the geometric dimensions and tolerances of large-sized workpieces.
如图3所示,方法300始于步骤S310。在步骤S310中,获取大尺寸工件中某目标部位的图像,并从该图像中提取包含安装孔的感兴趣目标区域。安装孔例如可以是螺纹孔和装配孔等。As shown in FIG. 3, the method 300 begins at step S310. In step S310, an image of a certain target part in the large-sized workpiece is acquired, and a target area of interest including a mounting hole is extracted from the image. The mounting holes may be, for example, threaded holes, mounting holes, or the like.
在实际应用中,可将大尺寸工件划分为多个目标部位,得到每个目标部位的图像构成序列图像,每个目标部位可能会有安装孔。分别对每帧图像进行图像处理,可得到每个目标部位和其中安装孔的尺寸形位和公差,并综合所有目标部位及其中各安装孔的尺寸形位和公差,来计算该大尺寸工件的尺寸形位和公差。如4a至4d分别示出了某地铁屏蔽门左侧支柱的序列图像,分别对应从上到下的四个目标部位。In practical applications, the large-sized workpiece can be divided into multiple target parts, and the images of each target part can be obtained to form a sequence image, and each target part may have mounting holes. Image processing is performed on each frame of image separately, and the size, shape, position and tolerance of each target part and its mounting holes can be obtained. Dimensions and tolerances. As shown in 4a to 4d, the sequence images of the left pillar of a subway screen door are respectively shown, corresponding to the four target parts from top to bottom.
通常,相机在进行图像采集时,可按顺序位置依次采集该工件多个部位的图像,这多个部位的上下边缘位置可恰好连接,也可重合一定距离,本发明对此不作限制。另外,待测件通常包括多个待测面,在对该多个待测面进行图像采集时,尽量保证定位机器人110行走的路径尽量不重复(时间最短原则),提高图像采集效率。具体可从所有待检测面中选定一个基准面,先对该基准面进行检测后,再来检测其余待检测面的结构尺寸及其相对于基准面的垂直度。Usually, when the camera captures images, it can capture images of multiple parts of the workpiece in sequence, and the upper and lower edges of the multiple parts can be just connected or overlapped by a certain distance, which is not limited in the present invention. In addition, the DUT usually includes a plurality of surfaces to be measured. When collecting images of the multiple surfaces to be measured, try to ensure that the path of the positioning robot 110 does not repeat as much as possible (the principle of the shortest time), so as to improve the efficiency of image collection. Specifically, a reference surface can be selected from all the surfaces to be detected, and after the reference surface is detected, the structural dimensions of the remaining surfaces to be detected and their perpendicularity relative to the reference surface are detected.
根据一个实施例,可以将该目标部位的图像转换为灰度图像,并对该灰度图像进行自适应阈值分割后,从该分割后图像中提取该目标区域。进一步地,还可以先对该目标部位的图像进行畸变校正,再对畸变校正后的图像进行灰度转换。此外,还可以对转换后的灰度图像进行滤波处理和形态学处理。滤波处理如中值滤波处理、高斯滤波处理等。形态学处理例如开运算处理和闭运算处理等。开运算用于消除工件表面的深色污点,并增强待测量螺纹孔和装配孔区域的纹理特征。空洞特征灰度值偏大,开运算可以进一步增加空洞区域的灰度值,并增大空洞区域。闭运算用于消除工件表面的浅色的油渍以及亮光斑。通过开闭运算处理后可明显增强图像的明暗对比度,之后对图像进行OSTO大津分割等自适应阈值分割,可得到螺纹孔和装配孔的大致区域,进而计算得到该区域的最小外接矩形作为该包含该安装孔的ROI目标区域。According to one embodiment, the image of the target part can be converted into a grayscale image, and after adaptive threshold segmentation is performed on the grayscale image, the target region is extracted from the segmented image. Further, it is also possible to perform distortion correction on the image of the target portion first, and then perform grayscale conversion on the image after distortion correction. In addition, filtering processing and morphological processing can also be performed on the converted grayscale image. Filter processing such as median filter processing, Gaussian filter processing, etc. Morphological processing such as opening operation processing and closing operation processing and the like. The open operation is used to remove dark stains on the surface of the workpiece and to enhance the texture characteristics of the threaded and assembly hole areas to be measured. The gray value of the void feature is too large, and the open operation can further increase the gray value of the void area and increase the void area. The closed operation is used to eliminate light-colored oil stains and bright spots on the surface of the workpiece. The light and dark contrast of the image can be significantly enhanced after the opening and closing operation processing, and then adaptive threshold segmentation such as OSTO Otsu segmentation is performed on the image to obtain the approximate area of the threaded hole and the assembly hole, and then the minimum circumscribed rectangle of the area can be calculated as the inclusion. The ROI target area for this mounting hole.
存在多种图像畸变校正、灰度转换、滤波处理、形态学处理、自适应阈值分割和ROI感兴趣目标区域的提取方法,本发明不受限于此,所有可以实现对应图像处理功能的图像处理方法均在本发明的保护范围之内。There are various methods for image distortion correction, grayscale conversion, filtering processing, morphological processing, adaptive threshold segmentation and ROI extraction of the target region of interest. The present invention is not limited to this, and all image processing methods that can realize the corresponding image processing function The methods are all within the protection scope of the present invention.
随后,在步骤S320中,分别提取目标部位和目标区域的亚像素边缘,并对提取到的亚像素边缘进行轮廓跟踪,得到多个特征轮廓。Subsequently, in step S320, the sub-pixel edges of the target part and the target area are respectively extracted, and contour tracking is performed on the extracted sub-pixel edges to obtain multiple feature contours.
这里,主要是为了获取工件的边缘轮廓和多个安装孔的轮廓。亚像素边缘提取可以采用任一现有技术实现,例如采用插值法来提取亚像素边缘,本发明对此不作限制。Here, the main purpose is to obtain the edge contour of the workpiece and the contours of multiple mounting holes. The sub-pixel edge extraction can be implemented using any existing technology, for example, an interpolation method is used to extract the sub-pixel edge, which is not limited in the present invention.
根据一个实施例,在进行轮廓跟踪时,可对所提取到的亚像素边缘进行Freenman链码跟踪,并过滤噪声边缘,从而得到多个特征轮廓。其中,Freeman链码是用曲线起始点的坐标和边界点方向代码来描述曲线或边界的方法,常用的链码按照中心像素点邻接方向个数的不同,分为4连通链码和8连通链码。另外,在过滤噪声边缘时,可分别设定面积阈值和长度阈值,并将实际面积小于该面积阈值、或者实际长度小于该长度阈值的特征轮廓设定为噪声边缘。According to one embodiment, when performing contour tracking, Freenman chain code tracking may be performed on the extracted sub-pixel edges, and noise edges are filtered to obtain multiple feature contours. Among them, the Freeman chain code is a method of describing the curve or boundary by the coordinates of the starting point of the curve and the direction code of the boundary point. The commonly used chain codes are divided into 4-connected chain codes and 8-connected chains according to the number of adjacent directions of the central pixel point. code. In addition, when filtering noise edges, an area threshold and a length threshold can be set respectively, and feature contours whose actual area is less than the area threshold or whose actual length is less than the length threshold are set as noise edges.
根据另一个实施例,还可以设定外接矩形长宽比的第一阈值和第二阈值(第一阈值小于第二阈值),并将实际长宽比大于第二阈值的特征轮廓设定为直线型边缘,以及将实际长宽比小于第一阈值的特征轮廓设定为椭圆弧型边缘。其中,直线型边缘例如工件的最外边缘和方形孔边缘等(如要测侧横梁的宽度时需要得到测横梁边缘),椭圆弧型边缘例如椭圆形或圆形孔边缘等、(此外屏蔽门底面会存在一些由两条直道加上两条半圆形弯道组成的装配孔)。According to another embodiment, a first threshold value and a second threshold value of the aspect ratio of the circumscribed rectangle may also be set (the first threshold value is smaller than the second threshold value), and the feature contour whose actual aspect ratio is greater than the second threshold value is set as a straight line shape edge, and set the feature contour whose actual aspect ratio is less than the first threshold as elliptical arc edge. Among them, the straight edge such as the outermost edge of the workpiece and the edge of the square hole, etc. (if the width of the side beam needs to be measured, the edge of the beam needs to be measured), the elliptical arc edge such as the edge of the oval or circular hole, etc. (in addition to the screen door There will be some mounting holes on the bottom surface consisting of two straights and two semi-circular bends).
随后,在步骤S330中,对多个特征轮廓进行直线型边缘和/或椭圆弧型边缘拟合,得到线段集合和/或椭圆弧集合。Subsequently, in step S330, linear edge and/or elliptical arc edge fitting is performed on the plurality of feature contours to obtain a line segment set and/or an elliptical arc set.
具体的,对于属于直线型边缘的特征轮廓,可以对其进行直线型边缘剔除粗大误差点的最小二乘法拟合,得到线段集合。对于属于椭圆弧型边缘的特征轮廓,可以对其进行椭圆弧型边缘剔除粗大误差点的最小二乘法拟合,得到椭圆弧集合。也就是在进行最小二乘法的直线拟合和椭圆弧拟合时都剔除了较大的误差点,提高线条拟合的准确度。Specifically, for the feature contour belonging to the linear edge, the least squares fitting method in which the linear edge is eliminated and the coarse error point is eliminated may be performed to obtain a line segment set. For the feature contours belonging to the elliptical arc edge, the least squares fitting can be performed on the elliptical arc edge to remove the coarse error points, and the elliptical arc set can be obtained. That is to say, large error points are eliminated when the straight line fitting and elliptic arc fitting of the least square method are performed, and the accuracy of the line fitting is improved.
随后,在步骤S340中,提取线段集合和/或椭圆弧集合的至少一个特征点,并计算各特征点的工件坐标。Subsequently, in step S340, at least one feature point of the line segment set and/or the elliptical arc set is extracted, and the workpiece coordinates of each feature point are calculated.
其中,椭圆弧集合的特征点例如可以包括椭圆的中心点和各顶点(如上下左右四个方向上的最边缘点),以便于确定椭圆的位置和尺寸大小。椭圆弧集合可以是独立的单段椭圆弧(如工件顶角的半圆过渡弧),也可以是一个完整的椭圆(如安装孔对应的完整椭圆)。椭圆弧集合还可以是同属同一椭圆的若干个分散的椭圆弧(如安装孔对应的多个分散椭圆弧),通过对这些分散的椭圆弧进行拟合可以得到对应的椭圆。线段集合的特征点例如可以包括该线段集合中各线段的两个端点和中点,根据该特征点可以确定各线段的位置和长度、以及工件的宽度、高度等。The feature points of the elliptical arc set may include, for example, the center point and each vertex of the ellipse (eg, the most edge points in four directions, up, down, left, and right), so as to determine the position and size of the ellipse. The set of elliptical arcs can be an independent single-segment elliptical arc (such as a semicircular transition arc at the top corner of the workpiece), or a complete ellipse (such as a complete ellipse corresponding to a mounting hole). The set of elliptical arcs may also be several scattered elliptical arcs that belong to the same ellipse (eg, multiple scattered elliptical arcs corresponding to the mounting holes), and corresponding ellipses can be obtained by fitting these scattered elliptical arcs. The feature points of the line segment set may include, for example, two end points and midpoints of each line segment in the line segment set, and the position and length of each line segment, as well as the width and height of the workpiece can be determined according to the feature points.
根据一个实施例,计算设备中存储有工具坐标和工件坐标的转换关系,这样确定各特征点的图像坐标Vi(x,y,0)后,就可根据该图像坐标来确定其工具坐标Bi(x,y,z),进而可根据该工具坐标和工件坐标的转换关系计算各特征点的工件坐标。According to one embodiment, the conversion relationship between tool coordinates and workpiece coordinates is stored in the computing device, so that after the image coordinates V i (x, y, 0) of each feature point are determined, the tool coordinates B can be determined according to the image coordinates. i (x, y, z), and then the workpiece coordinates of each feature point can be calculated according to the conversion relationship between the tool coordinates and the workpiece coordinates.
图1标注有工具坐标系Tool和工件坐标系Base的具体位置关系。若工件有多个待测面,则为每个待测面都设置一次工件坐标系和工具坐标系。工具坐标系Base可根据工件人为定义,用于确定工件上的各点坐标。工具坐标系Tool是指定位机器人测量头(即采集模块,包括工业相机和测距传感器)的坐标系,初始位置通常与工具坐标系重合或者平移得到,具体可设定工具坐标系由工件坐标系沿x轴平移h个单位得到。工具坐标系Tool随测量头移动而移动。另外,工具坐标系的原点与图像坐标系的原点重合,且工具坐标系的xOy平面与图像坐标系所在的平面重合。图1中的大尺寸工件为地铁屏蔽门,其中Base坐标系原点位于工件左下角,初始状态下Tool坐标系原点位于工件左上角,两个原点在x轴上相差h个单位,Tool坐标系随测量头的移动而移动,当测量头移动至图1中的检测位置时,Tool坐标系原点随之移动至工件右上角。Figure 1 is marked with the specific positional relationship between the tool coordinate system Tool and the workpiece coordinate system Base. If the workpiece has multiple surfaces to be measured, set the workpiece coordinate system and tool coordinate system once for each surface to be measured. The tool coordinate system Base can be manually defined according to the workpiece and used to determine the coordinates of each point on the workpiece. Tool coordinate system Tool is the coordinate system of the positioning robot measuring head (ie acquisition module, including industrial cameras and ranging sensors). The initial position is usually obtained by coincidence or translation with the tool coordinate system. Specifically, the tool coordinate system can be set from the workpiece coordinate system. Translated by h units along the x-axis. The tool coordinate system Tool moves with the movement of the probe. In addition, the origin of the tool coordinate system coincides with the origin of the image coordinate system, and the xOy plane of the tool coordinate system coincides with the plane where the image coordinate system is located. The large-sized workpiece in Figure 1 is a subway screen door. The origin of the Base coordinate system is located in the lower left corner of the workpiece. In the initial state, the origin of the Tool coordinate system is located in the upper left corner of the workpiece. The difference between the two origins is h units on the x-axis. When the measuring head moves to the detection position in Figure 1, the origin of the Tool coordinate system moves to the upper right corner of the workpiece.
根据一个实施例,工具坐标和工件坐标的转换关系为:According to one embodiment, the conversion relationship between tool coordinates and workpiece coordinates is:
Ci=R1·(Q·Vi)+T1 C i =R 1 ·(Q·V i )+T 1
其中,Ci和Vi分别是第i个特征点的工件坐标和工具坐标,T1和R1分别是拍摄该目标部位的图像时工具坐标系到工件坐标系的平移矩阵和旋转矩阵,Q是像素当量矩阵,Rh和Rv分别是相机的横向与纵向像素当量。这里,像素当量即是图像上的一个像素所对应的实际尺寸,可通过在检测现场对标准件进行尺寸标定的方法获取图像对应的像素当量。举例而言,在相机120的成像视野内放置一个1*1mm的正方形标准件,并对该正方形标准件拍摄为图像,对图像处理后计算出图像上1*1mm区域内的像素个数,这样,尺寸(1mm)与像素个数的比值即是像素当量。Among them, C i and V i are the workpiece coordinates and tool coordinates of the ith feature point, respectively, T 1 and R 1 are the translation matrix and rotation matrix from the tool coordinate system to the workpiece coordinate system when the image of the target part is captured, Q is the pixel equivalent matrix, R h and R v are the horizontal and vertical pixel equivalents of the camera, respectively. Here, the pixel equivalent is the actual size corresponding to a pixel on the image, and the pixel equivalent corresponding to the image can be obtained by calibrating the size of the standard part at the inspection site. For example, a 1*1mm square standard part is placed in the imaging field of view of the camera 120, and the square standard part is photographed as an image, and the number of pixels in the 1*1mm area on the image is calculated after image processing, so that , the ratio of the size (1mm) to the number of pixels is the pixel equivalent.
接着,在步骤S350中,根据各特征点的工件坐标计算目标部位及其中各安装孔的形位尺寸和公差。Next, in step S350, according to the workpiece coordinates of each feature point, the target position and the geometrical dimension and tolerance of each mounting hole therein are calculated.
其中,目标部位及其中各安装孔的尺寸形位和公差包括目标部位的外形尺寸、目标部位中各安装孔的定位尺寸和外形尺寸、以及各尺寸的偏差。具体地,目标部位的外形尺寸结合工件外轮廓线段的中心点计算得到,例如根据左右两条线段的中点计算宽度。安装孔的外形尺寸结合安装孔的各顶点计算得到,例如根据圆的左右两顶点和中心点计算直径或半径。安装孔的定位尺寸结合参考基准线段轮廓的中心点坐标和椭圆中心点坐标计算得到。各尺寸的偏差可以根据测得的实际尺寸值与预设的标准值进行对比计算。Wherein, the size, shape, position and tolerance of the target part and each installation hole therein include the outer dimension of the target part, the positioning dimension and outer dimension of each installation hole in the target part, and the deviation of each dimension. Specifically, the outer dimension of the target portion is calculated in combination with the center point of the outer contour line segment of the workpiece, for example, the width is calculated according to the center point of the left and right line segments. The outer dimension of the mounting hole is calculated by combining the vertices of the mounting hole, for example, the diameter or radius is calculated according to the left and right vertices and the center point of the circle. The positioning size of the mounting hole is calculated by combining the coordinates of the center point of the reference datum line segment outline and the center point of the ellipse. The deviation of each dimension can be calculated by comparing the measured actual dimension value with the preset standard value.
图5a至5e分别示出了通过图像处理对螺纹孔进行定位的基本流程,其中图5a为原始图像,图5b为基于形态学处理后的图像提取螺纹孔ROI区域,其中包括三个ROI目标区域。图5c为针对所提取的ROI区域进行图像分割,图5d是针对所提取的亚像素边缘进行圆弧型边缘剔除粗大误差点的最小二乘法拟合,得到三个拟合的椭圆。图5e是螺纹孔圆心像素坐标的计算结果,其中三个螺纹孔的圆心坐标分别为A(x1,y1)、B(x2,y2)、C(x3,y3)。应当理解的是,图像中每个点的z轴坐标均可认为是0。另外,还可以根据图像中该段侧柱的左右两条线段的特征点坐标(如两条线段的中点)来计算得到该段侧柱的宽度为D。Figures 5a to 5e respectively show the basic process of locating the threaded hole through image processing, in which Figure 5a is the original image, and Figure 5b is the extraction of the ROI region of the threaded hole based on the morphologically processed image, including three ROI target regions . Figure 5c shows the image segmentation for the extracted ROI area, and Figure 5d shows the least squares fitting of the extracted sub-pixel edges to remove the coarse error points from the arc edge to obtain three fitted ellipses. Fig. 5e is the calculation result of the pixel coordinates of the center of the threaded hole, wherein the coordinates of the center of the three threaded holes are A(x1, y1), B(x2, y2), and C(x3, y3). It should be understood that the z-axis coordinate of each point in the image can be considered to be 0. In addition, the width of the section of the jamb can also be calculated as D according to the feature point coordinates of the two left and right line segments of the section of the jamb in the image (eg, the midpoint of the two line segments).
此外,本发明还可以设定尺寸测量参数的标识,该标识可以包括工件外形尺寸标识、各安装孔的定位尺寸标识和外形尺寸标识,并将各尺寸标识与计算得到的对应尺寸值进行关联存储。例如,可以定义工件外形尺寸标识M_type=0、螺纹孔定位尺寸标识M_type=1、装配孔定位及外形尺寸标识M_type=2。根据尺寸测量种类可确定M_type值,并与对应的工件外形尺寸(E_flag=0)、螺纹孔的定位尺寸(E_flag=1)、装配孔定位及外形尺寸(E_flag=2)关联存储。In addition, the present invention can also set the identification of the size measurement parameters, the identification can include the workpiece outer dimension identification, the positioning dimension identification of each mounting hole and the outer dimension identification, and each size identification and the calculated corresponding size value are stored in association with each other. . For example, it can be defined that the workpiece outer dimension identification M_type=0, the threaded hole positioning dimension identification M_type=1, the assembly hole positioning and the outer dimension identification M_type=2. The M_type value can be determined according to the size measurement type, and is stored in association with the corresponding workpiece outer dimension (E_flag=0), threaded hole positioning dimension (E_flag=1), assembly hole positioning and outer dimension (E_flag=2).
图6示出了根据本发明另一个实施例的大尺寸工件的公差视觉检测方法600的流程示意图。方法600在计算设备中执行,如在计算设备200中执行,以对待测件的形位尺寸和公差进行检测。FIG. 6 shows a schematic flowchart of a method 600 for visual tolerance inspection of large-size workpieces according to another embodiment of the present invention. The method 600 is performed in a computing device, such as the computing device 200, to detect the geometrical dimensions and tolerances of the part under test.
如图6所示,方法600始于步骤S610。在步骤S610中,获取大尺寸工件的序列图像,该序列图像包括该大尺寸工件的不同部位的图像。As shown in FIG. 6, the method 600 begins at step S610. In step S610, a sequence of images of the large-size workpiece is acquired, and the sequence of images includes images of different parts of the large-size workpiece.
随后,在步骤S620中,分别采用如方法300中的大尺寸工件的公差视觉检测方法对每帧序列图像进行公差视觉检测,得到不同部位的尺寸形位和公差。例如,分别对图4a至4d这四张屏蔽门左侧支柱的序列图像进行公差视觉检测,得到每张图像中对应结构部位的外形尺寸和定位尺寸,如左右两条线段的端点和中点、每段支柱的宽度等、以及每个安装孔的中心点和半径等。Subsequently, in step S620 , the tolerance visual inspection method for large-sized workpieces as in the method 300 is respectively used to perform tolerance visual inspection on each frame of sequence images to obtain the size, shape, position and tolerance of different parts. For example, the tolerance visual inspection is performed on the sequence images of the left pillars of the four screen doors shown in Figures 4a to 4d, respectively, to obtain the external dimensions and positioning dimensions of the corresponding structural parts in each image, such as the endpoints and midpoints of the left and right line segments, The width of each pillar, etc., and the center point and radius of each mounting hole, etc.
接着,在步骤S630中,综合所有部位的尺寸形位和公差,计算该大尺寸工件的尺寸形位和公差。也就是将图4a至4d每张图像中的线段结构、孔结构、椭圆弧结构等的尺寸形位和公差进行合并,得到屏蔽门左侧支柱的尺寸形位和公差。Next, in step S630, the dimensions, shape, position and tolerance of all parts are integrated, and the size, shape, position and tolerance of the large-sized workpiece are calculated. That is, the size, shape, position and tolerance of the line segment structure, hole structure, elliptical arc structure, etc. in each image in Figures 4a to 4d are combined to obtain the size, shape, position and tolerance of the left pillar of the screen door.
图7示出了根据本发明另一个实施例大尺寸工件的公差视觉检测方法700的详细流程图,在计算设备中执行,如在计算设备200中执行。FIG. 7 shows a detailed flowchart of a method 700 for tolerance visual inspection of large-sized workpieces according to another embodiment of the present invention, which is executed in a computing device, such as the computing device 200 .
如图7所示,方法700始于步骤S710。在步骤S710中,采集序列图像I0-N,并记录每次图像采集时对应的工具坐标系Ri,i=0-N。其中,这N张序列图像对应待测件的N个部位,这N个部位共同构成该待测件。As shown in FIG. 7, the method 700 begins at step S710. In step S710, a sequence of images I 0-N is acquired, and the corresponding tool coordinate system R i in each image acquisition is recorded, i=0-N. The N sequence images correspond to N parts of the DUT, and the N parts together constitute the DUT.
随后,在步骤S720中,对于任一帧图像,依次对该图像进行畸变校正、灰度转换和形态学处理,创建该图像的至少一个矩形ROI目标区域。Subsequently, in step S720, for any frame of image, distortion correction, grayscale conversion and morphological processing are sequentially performed on the image to create at least one rectangular ROI target area of the image.
随后,在步骤S730中,对该图像中的每个目标区域进行亚边缘像素检测和基于Freenman链码的轮廓跟踪,得到每个目标区域所对应的多个特征轮廓。Subsequently, in step S730, sub-edge pixel detection and Freenman chain code-based contour tracking are performed on each target area in the image to obtain multiple feature contours corresponding to each target area.
随后,在步骤S740中,对该图像中每个目标区域的多个特征轮廓进行直线型边缘和/或椭圆弧型边缘判断,并对直线型边缘和/或椭圆弧型边缘进行拟合,得到该图像中每个目标区域的线段集合和/或椭圆弧集合。Subsequently, in step S740, the linear edge and/or the elliptical arc edge is judged on the multiple feature contours of each target area in the image, and the linear edge and/or the elliptical arc edge are fitted to obtain Sets of line segments and/or elliptical arcs for each target region in this image.
随后,在步骤S750中,确定该图像中线段集合和/或椭圆弧集合的特征点,计算各特征点的图像坐标,并将该图像坐标转换为工件坐标。Then, in step S750, the feature points of the line segment set and/or the elliptical arc set in the image are determined, the image coordinates of each feature point are calculated, and the image coordinates are converted into workpiece coordinates.
随后,在步骤S760中,对于其他帧图像,依次对其进行步骤S720-步骤S750中的操作,分别得到其他帧图像中各特征点的工件坐标。Subsequently, in step S760, for other frame images, the operations in steps S720 to S750 are sequentially performed on them to obtain the workpiece coordinates of each feature point in the other frame images respectively.
接着,在步骤S770中,根据所有序列图像中各特征点的工件坐标计算该待测件的尺寸形位和公差。Next, in step S770, the size, shape, position and tolerance of the DUT are calculated according to the workpiece coordinates of each feature point in all the sequence images.
也就是方法700中是得到了所有序列图像中的特征点工件坐标后再统一进行尺寸形位和公差计算,其中具体的各图像处理和计算的操作细节已在基于其他附图的描述中详细公开,这里不再展开赘述。That is, in the method 700, the workpiece coordinates of the feature points in all the sequence images are obtained, and then the size, shape, position and tolerance calculation are carried out uniformly. The specific operation details of each image processing and calculation have been disclosed in detail in the description based on other drawings. , which will not be repeated here.
图8示出了根据本发明一个实施例的大尺寸工件的公差视觉检测装置800,该装置800可以包含在如图2所示的计算设备200中。如图8所示,装置800包括目标区域提取模块810、特征轮廓提取模块820、特征轮廓拟合模块830、特征点提取模块840和形位尺寸计算模块850。FIG. 8 shows a tolerance visual inspection apparatus 800 for large-size workpieces according to an embodiment of the present invention, and the apparatus 800 may be included in the computing device 200 shown in FIG. 2 . As shown in FIG. 8 , the apparatus 800 includes a target region extraction module 810 , a feature contour extraction module 820 , a feature contour fitting module 830 , a feature point extraction module 840 and a shape and size calculation module 850 .
目标区域提取模块810获取大尺寸工件中某目标部位的图像,并从该图像中提取包含安装孔的感兴趣目标区域。目标区域提取模块810可以进行与上面在步骤S310中描述的处理相对应的处理,这里不再展开赘述。The target area extraction module 810 acquires an image of a certain target part in the large-sized workpiece, and extracts a target area of interest including mounting holes from the image. The target area extraction module 810 may perform processing corresponding to the processing described in step S310 above, which will not be repeated here.
特征轮廓提取模块820分别提取目标部位和目标区域的亚像素边缘,并对提取到的亚像素边缘进行轮廓跟踪,得到多个特征轮廓。特征轮廓提取模块820可以进行与上面在步骤S320中描述的处理相对应的处理,这里不再展开赘述。The feature contour extraction module 820 extracts the sub-pixel edges of the target part and the target area respectively, and performs contour tracking on the extracted sub-pixel edges to obtain multiple feature contours. The feature contour extraction module 820 may perform processing corresponding to the processing described in step S320 above, which will not be repeated here.
特征轮廓拟合模块830对多个特征轮廓进行直线型边缘/或圆弧形线段拟合,得到线段集合和/或椭圆弧集合。特征轮廓拟合模块830可以进行与上面在步骤S330中描述的处理相对应的处理,这里不再展开赘述。The feature contour fitting module 830 performs linear edge/or circular arc line segment fitting on the plurality of feature contours to obtain a line segment set and/or an elliptical arc set. The feature contour fitting module 830 may perform processing corresponding to the processing described in step S330 above, which will not be repeated here.
特征点提取模块840提取线段集合和/或椭圆弧集合的至少一个特征点,并计算各特征点的工件坐标。特征点提取模块840可以进行与上面在步骤S340中描述的处理相对应的处理,这里不再展开赘述。The feature point extraction module 840 extracts at least one feature point of the line segment set and/or the elliptical arc set, and calculates the workpiece coordinates of each feature point. The feature point extracting module 840 may perform processing corresponding to the processing described in step S340 above, which will not be repeated here.
形位尺寸计算模块850根据各特征点的工件坐标计算目标部位及其中各安装孔的尺寸形位和公差。形位尺寸计算模块850还可以综合该大尺寸工件的不同目标部位及其中各安装孔的尺寸形位和公差,来计算该大尺寸工件的尺寸形位和公差。形位尺寸计算模块850可以进行与上面在步骤S350中描述的处理相对应的处理,这里不再展开赘述。The shape, position and dimension calculation module 850 calculates the size, shape, position and tolerance of the target part and each installation hole in the target part according to the workpiece coordinates of each feature point. The shape, position and dimension calculation module 850 can also calculate the size, shape, position and tolerance of the large-size workpiece by integrating different target parts of the large-size workpiece and the size, shape, position and tolerance of each mounting hole therein. The shape, position and size calculation module 850 may perform processing corresponding to the processing described in step S350 above, which will not be repeated here.
根据本发明的技术方案,通过采用机器人配合机器视觉以及激光测距仪进行大尺寸测量,建立了以自适应阈值处理、中值滤波、形态学处理、亚像素边缘检测算法为基础的图像处理方法,对大尺寸工件的图像进行处理,并结合剔除粗大误差点的直线型边缘、椭圆形边缘两种边缘拟合算法提取并辨识大尺寸工件的特征信息,最终获取工件各项尺寸,计算精度远远达到测量需求。According to the technical solution of the present invention, an image processing method based on adaptive threshold processing, median filtering, morphological processing, and sub-pixel edge detection algorithms is established by using robots to cooperate with machine vision and laser rangefinders to measure large dimensions. , process the image of the large-sized workpiece, and extract and identify the feature information of the large-sized workpiece by combining the linear edge and elliptical edge fitting algorithms that remove the coarse error points, and finally obtain the various dimensions of the workpiece. The calculation accuracy is far far to meet the measurement needs.
A7、如A1-A6中任一项所述的方法,还包括步骤:设定外接矩形长宽比的第一阈值和第二阈值,并将实际长宽比大于第二阈值的特征轮廓设定为直线型边缘,以及将实际长宽比小于第一阈值的特征轮廓设定为椭圆弧型边缘。A8、如A7所述的方法,其中,对所述多个特征轮廓进行直线型边缘/或圆弧形线段拟合的步骤包括:对属于直线型边缘的特征轮廓进行直线型边缘剔除粗大误差点的最小二乘法拟合,得到线段集合;和/或对属于椭圆弧型边缘的特征轮廓进行椭圆弧型边缘剔除粗大误差点的最小二乘法拟合,得到椭圆弧集合。A9、如A1-A8中任一项所述的方法,其中,所述椭圆弧集合的特征点包括椭圆的中心点和各顶点,所述线段集合的特征点包括该线段集合中各线段的两个端点和中点。A7. The method according to any one of A1-A6, further comprising the steps of: setting a first threshold value and a second threshold value of the aspect ratio of the circumscribed rectangle, and setting a feature contour whose actual aspect ratio is greater than the second threshold value It is a straight edge, and the feature contour whose actual aspect ratio is less than the first threshold is set as an elliptical arc edge. A8. The method according to A7, wherein the step of performing linear edge/or arc-shaped line segment fitting on the plurality of feature contours includes: performing linear edge culling on the feature contours belonging to the linear edge to remove coarse error points The least squares fitting is performed to obtain a line segment set; and/or the feature contour belonging to the elliptical arc edge is subjected to the least squares fitting of the elliptical arc edge excluding coarse error points to obtain an elliptical arc set. A9. The method according to any one of A1-A8, wherein the feature points of the elliptical arc set include the center point and each vertex of the ellipse, and the feature points of the line segment set include two points of each line segment in the line segment set endpoints and midpoints.
A10、如A1-A9中任一项所述的方法,其中,所述获取所述大尺寸工件的某目标部位的图像的步骤包括:从相机中获取目标部位的图像,并获取该相机在拍摄该图像时定位机器人测量头的工具坐标系;其中,所述相机在拍摄该图像时,由定位机器人根据测距传感器测得的距离信息来调整相机的工作距离,以保证相机的成像平面与所述大尺寸工件的待检测面平行。A11、如A1-A10中任一项所述的方法,其中,所述计算设备中存储有工具坐标和工件坐标的转换关系,所述计算各特征点的工件坐标的步骤包括:根据各特征点的图像坐标来确定其工具坐标,并根据所述转换关系计算各特征点的工件坐标。A12、如A11所述的方法,其中,工具坐标系的原点与图像坐标系的原点重合,且工具坐标系的xOy平面与图像坐标系所在的平面重合;所述转换关系为:A10. The method according to any one of A1-A9, wherein the step of acquiring an image of a certain target part of the large-size workpiece includes: acquiring an image of the target part from a camera, and acquiring the image of the target part when the camera is shooting The tool coordinate system of the robot's measuring head is positioned during the image; wherein, when the camera captures the image, the positioning robot adjusts the working distance of the camera according to the distance information measured by the ranging sensor, so as to ensure that the imaging plane of the camera is the same as that of the camera. The surfaces to be detected of the large-sized workpiece are parallel. A11. The method according to any one of A1-A10, wherein a conversion relationship between tool coordinates and workpiece coordinates is stored in the computing device, and the step of calculating the workpiece coordinates of each feature point includes: according to each feature point The tool coordinates are determined by the image coordinates, and the workpiece coordinates of each feature point are calculated according to the conversion relationship. A12. The method of A11, wherein the origin of the tool coordinate system coincides with the origin of the image coordinate system, and the xOy plane of the tool coordinate system coincides with the plane where the image coordinate system is located; the conversion relationship is:
Ci=R1·(Q·Vi)+T1 C i =R 1 ·(Q·V i )+T 1
其中,Ci和Vi分别是第i个特征点的工件坐标和工具坐标,T1和R1分别是拍摄该目标部位的图像时工具坐标系到工件坐标系的平移矩阵和旋转矩阵,Q是像素当量矩阵,Rh和Rv分别是相机的横向与纵向像素当量。Among them, C i and V i are the workpiece coordinates and tool coordinates of the ith feature point, respectively, T 1 and R 1 are the translation matrix and rotation matrix from the tool coordinate system to the workpiece coordinate system when the image of the target part is captured, Q is the pixel equivalent matrix, R h and R v are the horizontal and vertical pixel equivalents of the camera, respectively.
A13、如A1-A12中任一项所述的方法,其中,所述目标部位及其中各安装孔的形位尺寸和公差包括目标部位的外形尺寸、目标部位中各安装孔的定位尺寸和外形尺寸、以及各尺寸的偏差。A14、如A13所述的方法,其中,所述目标部位的外形尺寸结合工件外轮廓线段的中心点计算得到;所述安装孔的外形尺寸结合安装孔的各顶点计算得到;所述安装孔的定位尺寸结合参考基准线段轮廓的中心点坐标和椭圆中心点坐标计算得到。A15、如A13所述的方法,还包括步骤:设定尺寸测量参数的标识,所述标识包括工件外形尺寸标识、各安装孔的定位尺寸标识和外形尺寸标识,并将各尺寸标识与计算得到的对应尺寸值进行关联存储。A13. The method according to any one of A1-A12, wherein the shape and position dimensions and tolerances of the target part and each mounting hole therein include the external dimension of the target part, the positioning dimension and the external shape of each mounting hole in the target part size, and the deviation of each size. A14. The method according to A13, wherein the outer dimension of the target part is calculated by combining with the center point of the outer contour line segment of the workpiece; the outer dimension of the mounting hole is calculated by combining with the vertices of the mounting hole; The positioning dimension is calculated by combining the center point coordinates of the reference datum line segment outline and the center point coordinates of the ellipse. A15. The method according to A13, further comprising the step of: setting the identification of the dimension measurement parameters, the identification includes the identification of the outer dimension of the workpiece, the identification of the positioning dimension of each mounting hole and the identification of the outer dimension, and calculating the identification of each dimension with the calculated The corresponding size value of , is stored associatively.
B18、如B17所述的装置,所述形位尺寸计算模块还适于综合所述大尺寸工件的不同目标部位及其中各安装孔的形位尺寸和公差,来计算所述大尺寸工件的形位尺寸和公差。B19、如B17所述的装置,其中,所述目标区域提取模块适于将所述目标部位的图像转换为灰度图像,对该灰度图像进行自适应阈值分割,并从分割后图像中提取所述目标区域。B20、如B19所述的装置,所述目标区域提取模块还适于对所述目标部位的图像进行畸变校正,以及对所述灰度图像进行滤波处理和形态学处理。B18. The device according to B17, wherein the shape, position and size calculation module is further adapted to calculate the shape, position and size of the large-size workpiece by synthesizing different target parts of the large-size workpiece and the shape, position, size and tolerance of each mounting hole therein. Bit dimensions and tolerances. B19. The device according to B17, wherein the target region extraction module is adapted to convert the image of the target portion into a grayscale image, perform adaptive threshold segmentation on the grayscale image, and extract the image from the segmented image the target area. B20. The device according to B19, wherein the target region extraction module is further adapted to perform distortion correction on the image of the target portion, and perform filtering processing and morphological processing on the grayscale image.
这里描述的各种技术可结合硬件或软件,或者它们的组合一起实现。从而,本发明的方法和设备,或者本发明的方法和设备的某些方面或部分可采取嵌入有形媒介,例如可移动硬盘、U盘、软盘、CD-ROM或者其它任意机器可读的存储介质中的程序代码(即指令)的形式,其中当程序被载入诸如计算机之类的机器,并被所述机器执行时,所述机器变成实践本发明的设备。The various techniques described herein can be implemented in conjunction with hardware or software, or a combination thereof. Thus, the method and apparatus of the present invention, or certain aspects or portions of the method and apparatus of the present invention, may take the form of an embedded tangible medium, such as a removable hard disk, a USB stick, a floppy disk, a CD-ROM, or any other machine-readable storage medium. in the form of program code (ie, instructions) that, when the program is loaded into a machine, such as a computer, and executed by the machine, the machine becomes an apparatus for practicing the invention.
在程序代码在可编程计算机上执行的情况下,计算设备一般包括处理器、处理器可读的存储介质(包括易失性和非易失性存储器和/或存储元件),至少一个输入装置,和至少一个输出装置。其中,存储器被配置用于存储程序代码;处理器被配置用于根据该存储器中存储的所述程序代码中的指令,执行本发明的大尺寸工件的公差视觉检测方法。Where the program code is executed on a programmable computer, the computing device typically includes a processor, a storage medium readable by the processor (including volatile and nonvolatile memory and/or storage elements), at least one input device, and at least one output device. Wherein, the memory is configured to store program codes; the processor is configured to execute the tolerance visual inspection method for large-size workpieces of the present invention according to the instructions in the program codes stored in the memory.
以示例而非限制的方式,可读介质包括可读存储介质和通信介质。可读存储介质存储诸如计算机可读指令、数据结构、程序模块或其它数据等信息。通信介质一般以诸如载波或其它传输机制等已调制数据信号来体现计算机可读指令、数据结构、程序模块或其它数据,并且包括任何信息传递介质。以上的任一种的组合也包括在可读介质的范围之内。By way of example and not limitation, readable media include readable storage media and communication media. Readable storage media store information such as computer readable instructions, data structures, program modules or other data. Communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media. Combinations of any of the above are also included within the scope of readable media.
在此处所提供的说明书中,算法和显示不与任何特定计算机、虚拟系统或者其它设备固有相关。各种通用系统也可以与本发明的示例一起使用。根据上面的描述,构造这类系统所要求的结构是显而易见的。此外,本发明也不针对任何特定编程语言。应当明白,可以利用各种编程语言实现在此描述的本发明的内容,并且上面对特定语言所做的描述是为了披露本发明的最佳实施方式。In the specification provided herein, the algorithms and displays are not inherently related to any particular computer, virtual system, or other device. Various general purpose systems may also be used with examples of the present invention. The structure required to construct such a system is apparent from the above description. Furthermore, the present invention is not directed to any particular programming language. It should be understood that various programming languages may be used to implement the inventions described herein, and that the descriptions of specific languages above are intended to disclose the best mode for carrying out the invention.
在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发明的实施例可以在没有这些具体细节的情况下被实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。In the description provided herein, numerous specific details are set forth. It will be understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
类似地,应当理解,为了精简本公开并帮助理解各个发明方面中的一个或多个,在上面对本发明的示例性实施例的描述中,本发明的各个特征有时被一起分组到单个实施例、图、或者对其的描述中。然而,并不应将该公开的方法解释成反映如下意图:即所要求保护的本发明要求比在每个权利要求中所明确记载的特征更多特征。更确切地说,如下面的权利要求书所反映的那样,发明方面在于少于前面公开的单个实施例的所有特征。因此,遵循具体实施方式的权利要求书由此明确地并入该具体实施方式,其中每个权利要求本身都作为本发明的单独实施例。Similarly, it is to be understood that in the above description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together into a single embodiment, figure, or its description. This disclosure, however, should not be interpreted as reflecting an intention that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the Detailed Description are hereby expressly incorporated into this Detailed Description, with each claim standing on its own as a separate embodiment of this invention.
本领域那些技术人员应当理解在本文所公开的示例中的设备的模块或单元或组件可以布置在如该实施例中所描述的设备中,或者可替换地可以定位在与该示例中的设备不同的一个或多个设备中。前述示例中的模块可以组合为一个模块或者此外可以分成多个子模块。Those skilled in the art will appreciate that the modules or units or components of the apparatus in the examples disclosed herein may be arranged in the apparatus as described in this embodiment, or alternatively may be positioned differently from the apparatus in this example in one or more devices. The modules in the preceding examples may be combined into one module or further divided into sub-modules.
本领域那些技术人员可以理解,可以对实施例中的设备中的模块进行自适应性地改变并且把它们设置在与该实施例不同的一个或多个设备中。可以把实施例中的模块或单元或组件组合成一个模块或单元或组件,以及此外可以把它们分成多个子模块或子单元或子组件。除了这样的特征和/或过程或者单元中的至少一些是相互排斥之外,可以采用任何组合对本说明书(包括伴随的权利要求、摘要和附图)中公开的所有特征以及如此公开的任何方法或者设备的所有过程或单元进行组合。除非另外明确陈述,本说明书(包括伴随的权利要求、摘要和附图)中公开的每个特征可以由提供相同、等同或相似目的的替代特征来代替。Those skilled in the art will appreciate that the modules in the device in the embodiment can be adaptively changed and arranged in one or more devices different from the embodiment. The modules or units or components in the embodiments may be combined into one module or unit or component, and further they may be divided into multiple sub-modules or sub-units or sub-assemblies. All features disclosed in this specification (including accompanying claims, abstract and drawings) and any method so disclosed may be employed in any combination unless at least some of such features and/or procedures or elements are mutually exclusive. All processes or units of equipment are combined. Each feature disclosed in this specification (including accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
此外,本领域的技术人员能够理解,尽管在此所述的一些实施例包括其它实施例中所包括的某些特征而不是其它特征,但是不同实施例的特征的组合意味着处于本发明的范围之内并且形成不同的实施例。例如,在下面的权利要求书中,所要求保护的实施例的任意之一都可以以任意的组合方式来使用。Furthermore, those skilled in the art will appreciate that although some of the embodiments described herein include certain features, but not others, included in other embodiments, that combinations of features of different embodiments are intended to be within the scope of the invention within and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
此外,所述实施例中的一些在此被描述成可以由计算机系统的处理器或者由执行所述功能的其它装置实施的方法或方法元素的组合。因此,具有用于实施所述方法或方法元素的必要指令的处理器形成用于实施该方法或方法元素的装置。此外,装置实施例的在此所述的元素是如下装置的例子:该装置用于实施由为了实施该发明的目的的元素所执行的功能。Furthermore, some of the described embodiments are described herein as methods or combinations of method elements that can be implemented by a processor of a computer system or by other means for performing the described functions. Thus, a processor having the necessary instructions for implementing the method or method element forms means for implementing the method or method element. Furthermore, an element of an apparatus embodiment described herein is an example of a means for carrying out the function performed by the element for the purpose of carrying out the invention.
如在此所使用的那样,除非另行规定,使用序数词“第一”、“第二”、“第三”等等来描述普通对象仅仅表示涉及类似对象的不同实例,并且并不意图暗示这样被描述的对象必须具有时间上、空间上、排序方面或者以任意其它方式的给定顺序。As used herein, unless otherwise specified, the use of the ordinal numbers "first," "second," "third," etc. to describe common objects merely refers to different instances of similar objects, and is not intended to imply such The objects being described must have a given order in time, space, ordinal, or in any other way.
尽管根据有限数量的实施例描述了本发明,但是受益于上面的描述,本技术领域内的技术人员明白,在由此描述的本发明的范围内,可以设想其它实施例。此外,应当注意,本说明书中使用的语言主要是为了可读性和教导的目的而选择的,而不是为了解释或者限定本发明的主题而选择的。因此,在不偏离所附权利要求书的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。对于本发明的范围,对本发明所做的公开是说明性的而非限制性的,本发明的范围由所附权利要求书限定。While the invention has been described in terms of a limited number of embodiments, those skilled in the art will appreciate, having the benefit of the above description, that other embodiments are conceivable within the scope of the invention thus described. Furthermore, it should be noted that the language used in this specification has been principally selected for readability and teaching purposes, rather than to explain or define the subject matter of the invention. Accordingly, many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the appended claims. This disclosure is intended to be illustrative and not restrictive with regard to the scope of the present invention, which is defined by the appended claims.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910542808.5A CN110288651A (en) | 2019-06-21 | 2019-06-21 | Tolerance visual inspection method, device and computing device for large-size workpieces |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910542808.5A CN110288651A (en) | 2019-06-21 | 2019-06-21 | Tolerance visual inspection method, device and computing device for large-size workpieces |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110288651A true CN110288651A (en) | 2019-09-27 |
Family
ID=68004482
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910542808.5A Pending CN110288651A (en) | 2019-06-21 | 2019-06-21 | Tolerance visual inspection method, device and computing device for large-size workpieces |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110288651A (en) |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111415378A (en) * | 2020-02-27 | 2020-07-14 | 湖南大学 | Image registration method for automobile glass detection and automobile glass detection method |
CN111539951A (en) * | 2020-05-13 | 2020-08-14 | 西安交通大学 | A kind of visual detection method of ceramic grinding wheel head profile size |
CN112132927A (en) * | 2020-09-15 | 2020-12-25 | 成都工具研究所有限公司 | Drawing system and method for generating two-dimensional and three-dimensional models on webpage interface |
CN112419398A (en) * | 2020-11-25 | 2021-02-26 | 创新奇智(西安)科技有限公司 | Rectangular workpiece dimension measuring method, device, equipment and storage medium |
CN113267143A (en) * | 2021-06-30 | 2021-08-17 | 三一建筑机器人(西安)研究院有限公司 | Side die identification method |
CN113643225A (en) * | 2020-04-26 | 2021-11-12 | 北京配天技术有限公司 | Arc detection method and arc detection device |
CN113932730A (en) * | 2021-09-07 | 2022-01-14 | 华中科技大学 | A detection device for the shape of a curved plate |
CN113963362A (en) * | 2021-10-12 | 2022-01-21 | 深圳康佳电子科技有限公司 | Pattern recognition method, device, storage medium and terminal device |
CN114463302A (en) * | 2022-01-28 | 2022-05-10 | 智鉴科技有限公司 | Processing method and processing device for assembly |
CN119478537A (en) * | 2024-11-18 | 2025-02-18 | 南京凯视迈科技有限公司 | Method, device and storage medium for automatic recognition of image primitives |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101387501A (en) * | 2008-10-06 | 2009-03-18 | 天津大学 | Apparatus and method for measuring circular cross-sectional shape and orientation of ultra-large workpiece |
CN103499302A (en) * | 2013-09-27 | 2014-01-08 | 吉林大学 | Camshaft diameter online measuring method based on structured light visual imaging system |
CN109612390A (en) * | 2018-12-17 | 2019-04-12 | 江南大学 | Large-size workpiece automatic measuring system based on machine vision |
-
2019
- 2019-06-21 CN CN201910542808.5A patent/CN110288651A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101387501A (en) * | 2008-10-06 | 2009-03-18 | 天津大学 | Apparatus and method for measuring circular cross-sectional shape and orientation of ultra-large workpiece |
CN103499302A (en) * | 2013-09-27 | 2014-01-08 | 吉林大学 | Camshaft diameter online measuring method based on structured light visual imaging system |
CN109612390A (en) * | 2018-12-17 | 2019-04-12 | 江南大学 | Large-size workpiece automatic measuring system based on machine vision |
Non-Patent Citations (3)
Title |
---|
何博侠等: "基于序列局部图像的高精度测量", 《光学精密工程》 * |
梁晋等: "《3D反求技术》", 31 January 2019, 华中科技大学出版社 * |
程敏: "工件圆弧尺寸检测方法研究", 《中国优秀硕士学位论文全文数据库信息科技辑》 * |
Cited By (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111415378A (en) * | 2020-02-27 | 2020-07-14 | 湖南大学 | Image registration method for automobile glass detection and automobile glass detection method |
CN111415378B (en) * | 2020-02-27 | 2023-11-24 | 湖南大学 | Image registration method for automobile glass detection and automobile glass detection method |
CN113643225A (en) * | 2020-04-26 | 2021-11-12 | 北京配天技术有限公司 | Arc detection method and arc detection device |
CN111539951B (en) * | 2020-05-13 | 2022-12-09 | 西安交通大学 | A visual detection method for the contour size of ceramic grinding wheel head |
CN111539951A (en) * | 2020-05-13 | 2020-08-14 | 西安交通大学 | A kind of visual detection method of ceramic grinding wheel head profile size |
CN112132927A (en) * | 2020-09-15 | 2020-12-25 | 成都工具研究所有限公司 | Drawing system and method for generating two-dimensional and three-dimensional models on webpage interface |
CN112132927B (en) * | 2020-09-15 | 2023-10-20 | 成都工具研究所有限公司 | Drawing system and method for generating two-dimensional and three-dimensional models on webpage interface |
CN112419398A (en) * | 2020-11-25 | 2021-02-26 | 创新奇智(西安)科技有限公司 | Rectangular workpiece dimension measuring method, device, equipment and storage medium |
CN113267143A (en) * | 2021-06-30 | 2021-08-17 | 三一建筑机器人(西安)研究院有限公司 | Side die identification method |
CN113267143B (en) * | 2021-06-30 | 2023-08-29 | 三一建筑机器人(西安)研究院有限公司 | Side mold identification method |
CN113932730A (en) * | 2021-09-07 | 2022-01-14 | 华中科技大学 | A detection device for the shape of a curved plate |
CN113932730B (en) * | 2021-09-07 | 2022-08-02 | 华中科技大学 | A detection device for the shape of a curved plate |
CN113963362A (en) * | 2021-10-12 | 2022-01-21 | 深圳康佳电子科技有限公司 | Pattern recognition method, device, storage medium and terminal device |
CN114463302A (en) * | 2022-01-28 | 2022-05-10 | 智鉴科技有限公司 | Processing method and processing device for assembly |
CN119478537A (en) * | 2024-11-18 | 2025-02-18 | 南京凯视迈科技有限公司 | Method, device and storage medium for automatic recognition of image primitives |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110288651A (en) | Tolerance visual inspection method, device and computing device for large-size workpieces | |
CN109801333B (en) | Volume measurement method, device and system and computing equipment | |
CN104981105B (en) | A kind of quickly accurate detection and method for correcting error for obtaining element central and deflection angle | |
CN106408609B (en) | A kind of parallel institution end movement position and posture detection method based on binocular vision | |
CN106824806B (en) | The detection method of low module plastic gear based on machine vision | |
CN112686920A (en) | Visual measurement method and system for geometric dimension parameters of circular part | |
CN1975323A (en) | Method for making three-dimensional measurement of objects utilizing single digital camera to freely shoot | |
CN105160652A (en) | Handset casing testing apparatus and method based on computer vision | |
CN105809705A (en) | Patch element positioning identification method based on minimum enclosing rectangle | |
CN102032875A (en) | A Method for Measuring the Thickness of Cable Sheath Based on Image Processing | |
CN115018735B (en) | Crack width identification method and system based on Hough transformation correction two-dimensional code image | |
CN116309589B (en) | Surface defect detection method, device, electronic equipment and storage medium of sheet metal parts | |
CN109986172A (en) | A welding seam positioning method, equipment and system | |
CN116148277B (en) | Three-dimensional detection method, device and equipment for defects of transparent body and storage medium | |
CN114964007A (en) | Visual measurement and surface defect detection method for weld size | |
JP2012203612A (en) | Image processing method and image processing device | |
CN116908185B (en) | Method, device, electronic device and storage medium for detecting appearance defects of articles | |
CN114330407A (en) | Method, device, equipment and storage medium for detecting and identifying bar code | |
CN115375610A (en) | Detection method and device, detection equipment and storage medium | |
WO2007125981A1 (en) | Boundary position decision device, boundary position decision method, program for functioning computer as the device, and recording medium | |
CN101685000B (en) | Computer system and method for image boundary scan | |
CN109671084A (en) | A kind of measurement method of workpiece shapes | |
CN114485433B (en) | Three-dimensional measurement system, method and device based on pseudo-random speckle | |
CN109521022A (en) | Touch screen defect detecting device based on the confocal camera of line | |
CN114061480B (en) | Method for detecting appearance of workpiece |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190927 |