CN105004274A - A method of measuring the radius of cylindrical surface based on 3D vision - Google Patents
A method of measuring the radius of cylindrical surface based on 3D vision Download PDFInfo
- Publication number
- CN105004274A CN105004274A CN201510395713.7A CN201510395713A CN105004274A CN 105004274 A CN105004274 A CN 105004274A CN 201510395713 A CN201510395713 A CN 201510395713A CN 105004274 A CN105004274 A CN 105004274A
- Authority
- CN
- China
- Prior art keywords
- point
- dimensional
- cylindrical surface
- sequence
- radius
- 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
- 238000000034 method Methods 0.000 title claims abstract description 25
- 238000005259 measurement Methods 0.000 claims abstract description 38
- 239000013598 vector Substances 0.000 claims description 29
- 238000001914 filtration Methods 0.000 claims description 28
- 230000000007 visual effect Effects 0.000 claims description 18
- 238000005516 engineering process Methods 0.000 claims description 5
- 238000001514 detection method Methods 0.000 abstract description 7
- 229910001172 neodymium magnet Inorganic materials 0.000 description 9
- 238000007689 inspection Methods 0.000 description 4
- 238000010586 diagram Methods 0.000 description 3
- 230000011218 segmentation Effects 0.000 description 3
- 238000004458 analytical method Methods 0.000 description 2
- 238000004364 calculation method Methods 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000002474 experimental method Methods 0.000 description 1
- 238000003760 magnetic stirring Methods 0.000 description 1
- 239000000463 material Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000000717 retained effect Effects 0.000 description 1
- 238000007789 sealing Methods 0.000 description 1
- 239000004753 textile Substances 0.000 description 1
Landscapes
- Length Measuring Devices By Optical Means (AREA)
- Image Processing (AREA)
Abstract
本发明公开了一种基于三维视觉的圆柱面半径测量方法,包括:通过三维视觉测量系统获取圆柱面的三维点云数据,所述三维视觉测量系统由投影仪和摄像机组成;采用平行平面将圆柱面的三维点云数据分割成二维平面数据;采用基于角度的排序算法将二维平面数据展开为一维点序列;对一维点序列进行超限中值滤波和二次滤波,从而得到去除噪声后的一维点序列;根据得到的一维点序列进行椭圆拟合和圆拟合,从而得到圆柱面不同位置截面的半径大小。本发明能计算出圆柱形零件不同位置截面的半径大小,且可根据计算出的不同位置截面的半径大小直接进行位置误差的测量和分析,具有准确、全面、抗噪声能力强和测量精度高的优点,可广泛应用于计算机视觉检测领域。
The invention discloses a method for measuring the radius of a cylindrical surface based on three-dimensional vision. The 3D point cloud data of the surface is divided into 2D plane data; the 2D plane data is expanded into a 1D point sequence by using an angle-based sorting algorithm; One-dimensional point sequence after noise; according to the obtained one-dimensional point sequence, ellipse fitting and circle fitting are performed, so as to obtain the radius of the cross-section at different positions of the cylindrical surface. The invention can calculate the radii of different sections of cylindrical parts, and can directly measure and analyze the position error according to the calculated radii of different sections, and has the advantages of accuracy, comprehensiveness, strong anti-noise ability and high measurement accuracy. Advantages, can be widely used in the field of computer vision detection.
Description
技术领域 technical field
本发明涉及计算机视觉检测领域,尤其是一种基于三维视觉的圆柱面半径测量方法。 The invention relates to the field of computer vision detection, in particular to a method for measuring the radius of a cylindrical surface based on three-dimensional vision.
背景技术 Background technique
工业检测中,计算机视觉检测技术以其非接触、高精度和高效率等优点,在机械零件的检测中越来越受到重视。圆柱形零件是机械零件中较为常见的零件,如轴承、电机转子中使用的磁性瓦片及圆柱形磁力搅棒等。据统计在传统的机械零件中,作为机械零件构成中的一种基本形状,圆柱面的出现频率达到了73.5%。对这些圆柱面的半径进行检测是圆柱形机械零件质量检测中的一个重要组成部分,目前基于计算机视觉的圆柱形机械零件半径检测方法往往通过测量圆柱面的一个外端面来检测其半径,而无法检测其他位置的截面半径。这样做存在着以下两个问题:一是只能完成形状测量及其误差分析,且是仅限于外端面的形状检测,无法完成其它位置截面的形状检测,不够准确;二是无法实现位置误差的测量和分析,不够全面。而形位误差对各种机械零件的工作精度、连接强度、密封性、运动平稳性、耐磨性以及寿命、噪音等都具有很大的影响。因此,业内亟需一种能对圆柱形零件不同截面位置的半径进行检测(以给出更准确的形状),并能利用多个位置的数据进行位置误差的测量和分析的方法。 In industrial inspection, computer vision inspection technology has been paid more and more attention in the inspection of mechanical parts due to its advantages of non-contact, high precision and high efficiency. Cylindrical parts are relatively common parts in mechanical parts, such as bearings, magnetic tiles used in motor rotors, and cylindrical magnetic stirring rods. According to statistics, in traditional mechanical parts, as a basic shape in the composition of mechanical parts, the frequency of cylindrical surfaces has reached 73.5%. Detecting the radius of these cylindrical surfaces is an important part of the quality inspection of cylindrical mechanical parts. At present, the radius detection method of cylindrical mechanical parts based on computer vision often detects the radius by measuring an outer end surface of the cylindrical surface, but cannot Detect section radii at other locations. There are two problems in this way: first, it can only complete the shape measurement and its error analysis, and it is limited to the shape detection of the outer end face, and cannot complete the shape detection of other sections, which is not accurate enough; second, it cannot realize the position error. Measurement and analysis are not comprehensive enough. The shape and position error has a great influence on the working accuracy, connection strength, sealing, motion stability, wear resistance, life and noise of various mechanical parts. Therefore, there is an urgent need in the industry for a method that can detect the radii of different cross-sectional positions of cylindrical parts (to give a more accurate shape), and can use data from multiple positions to measure and analyze position errors.
发明内容 Contents of the invention
为了解决上述技术问题,本发明的目的是:提供一种准确和全面的,基于三维视觉的圆柱面半径测量方法。 In order to solve the above technical problems, the object of the present invention is to provide an accurate and comprehensive method for measuring the radius of a cylindrical surface based on three-dimensional vision.
本发明解决其技术问题所采用的技术方案是: The technical solution adopted by the present invention to solve its technical problems is:
一种基于三维视觉的圆柱面半径测量方法,包括: A method for measuring the radius of a cylindrical surface based on three-dimensional vision, comprising:
S1、通过三维视觉测量系统获取圆柱面的三维点云数据,所述三维视觉测量系统由投影仪和摄像机组成; S1. Acquiring the three-dimensional point cloud data of the cylindrical surface through the three-dimensional visual measurement system, the three-dimensional visual measurement system is composed of a projector and a camera;
S2、采用平行平面将圆柱面的三维点云数据分割成二维平面数据; S2. Using parallel planes to divide the three-dimensional point cloud data of the cylindrical surface into two-dimensional plane data;
S3、采用基于角度的排序算法将二维平面数据展开为一维点序列; S3. Using an angle-based sorting algorithm to expand the two-dimensional plane data into a one-dimensional point sequence;
S4、对一维点序列进行超限中值滤波和二次滤波,从而得到去除噪声后的一维点序列; S4. Perform over-limit median filtering and secondary filtering on the one-dimensional point sequence, so as to obtain the one-dimensional point sequence after noise removal;
S5、根据得到的一维点序列进行椭圆拟合和圆拟合,从而得到圆柱面不同位置截面的半径大小。 S5. Perform ellipse fitting and circle fitting according to the obtained one-dimensional point sequence, so as to obtain the radii of cross-sections at different positions on the cylindrical surface.
进一步,所述步骤S1,其具体为: Further, the step S1 is specifically:
采用摄像机和投影仪搭建基于条纹结构光和主动立体视觉技术的三维视觉测量系统,然后通过三维视觉测量系统依次进行系统标定、条纹投影与采集、绝对相位获取和对应点匹配,最终获取圆柱面的三维点云数据。 Cameras and projectors are used to build a 3D visual measurement system based on stripe structured light and active stereo vision technology, and then through the 3D visual measurement system, system calibration, fringe projection and acquisition, absolute phase acquisition and corresponding point matching are performed in sequence, and finally the cylindrical surface is obtained. 3D point cloud data.
进一步,所述步骤S2,其具体为: Further, the step S2 is specifically:
采用一组平行平面将三维点云数据分割成多组二维平面数据,所述平行平面垂直于X轴,其中,X轴为圆柱面的中心轴。 The three-dimensional point cloud data is divided into multiple sets of two-dimensional plane data by using a set of parallel planes perpendicular to the X axis, wherein the X axis is the central axis of the cylindrical surface.
进一步,所述步骤S3,其包括: Further, said step S3, which includes:
S31、根据步骤S2所获得的数据进行圆拟合,得到圆中心点,并将该圆中心点定义为基点o,然后构造一个过基点o且方向沿X轴正向的基向量并将从二维平面数据提取出的边缘数据点mn与基点o一一构成边缘向量其中,n=1,2,3,…; S31. Carry out circle fitting according to the data obtained in step S2 to obtain the center point of the circle, and define the center point of the circle as the base point o, and then construct a base vector passing through the base point o and whose direction is along the positive direction of the X-axis And the edge data point m n extracted from the two-dimensional plane data and the base point o constitute an edge vector Among them, n=1,2,3,...;
S32、计算边缘向量与基向量的夹角θn, S32. Calculate the edge vector with basis vectors The included angle θ n ,
S33、根据边缘向量与基向量夹角θn的大小对从二维平面数据提取出的边缘数据点mn重新进行排序,得到重新排序后的点序列Mi,其中,i=1,2,3,…,n; S33, according to the edge vector with basis vectors The size of the included angle θ n reorders the edge data points m n extracted from the two-dimensional plane data to obtain the reordered point sequence M i , where i=1,2,3,...,n;
S34、计算重新排序后的点序列Mi到基点的距离di,并以计算出的距离构成展开后的一维点序列di。 S34. Calculate the distance d i from the reordered point sequence M i to the base point, and use the calculated distance to form an expanded one-dimensional point sequence d i .
进一步,所述步骤S4,其包括: Further, said step S4, which includes:
S41、采用超限中值滤波器对展开后的一维点序列di进行一次滤波,得到一次滤波后的序列点,所述一次滤波后的序列点di'的表达式为: S41. Using an over-limit median filter to perform a filter on the expanded one-dimensional point sequence d i to obtain a filtered sequence point, the expression of the once-filtered sequence point d i ' is:
其中,template为超限中值滤波器的模板大小,median为求中值,x0为设定的距离阈值; Among them, template is the template size of the over-limit median filter, median is the median value, and x 0 is the set distance threshold;
S42、根据一次滤波后的序列点di'到基点的距离大小以及序列点di'两侧相邻点到基点的距离大小,对一次滤波后的序列点di'进行二次滤波,得到去除噪声后的一维点序列。 S42. According to the distance from the sequence point d i ' to the base point after the primary filtering and the distance from the adjacent points on both sides of the sequence point d i ' to the base point, perform secondary filtering on the sequence point d i ' after the primary filtering to obtain A sequence of 1D points after noise removal.
进一步,所述步骤S5,其具体为: Further, the step S5 is specifically:
S51、对去除噪声后的一维点序列进行椭圆拟合,得到椭圆中心点,然后对椭圆中心点进行空间直线拟合,求出圆柱面的第一中心轴; S51. Perform ellipse fitting on the one-dimensional point sequence after noise removal to obtain the center point of the ellipse, and then perform spatial straight line fitting on the center point of the ellipse to obtain the first central axis of the cylindrical surface;
S52、将圆柱面的第一中心轴以及圆柱面的三维点云数据旋转至与X轴平行; S52. Rotate the first central axis of the cylindrical surface and the three-dimensional point cloud data of the cylindrical surface to be parallel to the X axis;
S53、对旋转后圆柱面的三维点云数据重新执行步骤S2~S4,得到去除噪声后与X轴平行的一维点序列; S53. Re-execute steps S2-S4 on the three-dimensional point cloud data of the rotated cylindrical surface to obtain a one-dimensional point sequence parallel to the X axis after the noise is removed;
S54、对去除噪声后与X轴平行的一维点序列进行圆拟合,得到圆中心点,然后对圆中心点进行空间直线拟合,求出圆柱面的第二中心轴及相应的圆半径; S54. Carry out circle fitting to the one-dimensional point sequence parallel to the X axis after the noise is removed to obtain the center point of the circle, and then perform space straight line fitting to the center point of the circle to obtain the second central axis of the cylindrical surface and the corresponding circle radius ;
S55、判断圆柱面的第二中心轴与X轴的夹角是否小于设定的判断阈值,若是,则以求出的圆半径作为圆柱面不同位置的半径大小,反之,则在将圆柱面的第二中心轴以及圆柱面的三维点云数据旋转至与X轴平行之后返回步骤S2。 S55. Determine whether the included angle between the second central axis of the cylindrical surface and the X-axis is less than the set judgment threshold, if so, use the obtained circle radius as the radius of the different positions of the cylindrical surface, otherwise, calculate the radius of the cylindrical surface Return to step S2 after the second central axis and the 3D point cloud data of the cylindrical surface are rotated to be parallel to the X axis.
本发明的有益效果是:先通过三维视觉测量系统获取圆柱面的点云数据;然后使用平行平面将三维点云数据分割成多组二维平面数据,并对每一位置的二维数据,采用基于角度的排序算法和超限中值滤波器进行滤波去噪后,再结合椭圆拟合和圆拟合,最终计算出圆柱形零件不同位置截面的半径大小,不再局限于外端面的形状检测,且可以根据计算出的不同位置截面的半径大小直接进行位置误 差的测量和分析,具有准确、全面、抗噪声能力强和测量精度高的优点。 The beneficial effect of the present invention is: first obtain the point cloud data of the cylindrical surface through the three-dimensional visual measurement system; then use parallel planes to divide the three-dimensional point cloud data into multiple groups of two-dimensional plane data, and for the two-dimensional data of each position, use After filtering and denoising based on the angle-based sorting algorithm and the over-limit median filter, combined with ellipse fitting and circle fitting, the radius of the cross-section at different positions of the cylindrical part is finally calculated, which is no longer limited to the shape detection of the outer end surface , and can directly measure and analyze the position error according to the calculated radii of different position sections, which has the advantages of accuracy, comprehensiveness, strong anti-noise ability and high measurement accuracy.
附图说明 Description of drawings
下面结合附图和实施例对本发明作进一步说明。 The present invention will be further described below in conjunction with drawings and embodiments.
图1为本发明一种基于三维视觉的圆柱面半径测量方法的整体流程图; Fig. 1 is the overall flowchart of a kind of cylindrical surface radius measuring method based on three-dimensional vision of the present invention;
图2为本发明步骤S3的流程图; Fig. 2 is the flowchart of step S3 of the present invention;
图3为本发明步骤S4的流程图; Fig. 3 is the flowchart of step S4 of the present invention;
图4为本发明步骤S5的流程图; Fig. 4 is the flowchart of step S5 of the present invention;
图5-1为本发明三维视觉测量系统的结构示意图; Figure 5-1 is a schematic structural view of a three-dimensional vision measurement system of the present invention;
图5-2为本发明三维视觉测量系统获取三维点云数据的流程图; Fig. 5-2 is a flow chart of obtaining three-dimensional point cloud data by the three-dimensional visual measurement system of the present invention;
图6为带噪声干扰半圆柱面分割后的一组二维平面数据; Fig. 6 is a group of two-dimensional plane data after the semi-cylindrical surface segmentation with noise interference;
图7为图6进行重新排序后得到的一维序列点; Fig. 7 is the one-dimensional sequence point obtained after reordering in Fig. 6;
图8为图7采用超限中值滤波器进行去噪后的结果图; Fig. 8 is the result figure of Fig. 7 adopting overlimit median filter after denoising;
图9为图8椭圆部分的局部放大图; Fig. 9 is a partially enlarged view of the ellipse in Fig. 8;
图10为采用与基点间的距离进行二次滤波后的结果图; Fig. 10 is the result figure after secondary filtering using the distance between the base point;
图11为本发明最终的滤波结果图; Fig. 11 is the final filtering result figure of the present invention;
图12为本发明圆柱面半径测量算法的流程图; Fig. 12 is the flow chart of cylindrical surface radius measurement algorithm of the present invention;
图13为钕铁硼瓦片外表面不同位置的半径测量值示意图。 Figure 13 is a schematic diagram of the radius measurement values at different positions on the outer surface of the NdFeB tile.
附图标记:1、摄像机;2、投影仪。 Reference signs: 1, video camera; 2, projector. the
具体实施方式 Detailed ways
参照图1,一种基于三维视觉的圆柱面半径测量方法,包括: Referring to Fig. 1, a method for measuring the radius of a cylindrical surface based on three-dimensional vision includes:
S1、通过三维视觉测量系统获取圆柱面的三维点云数据,所述三维视觉测量系统由投影仪和摄像机组成; S1. Acquiring the three-dimensional point cloud data of the cylindrical surface through the three-dimensional visual measurement system, the three-dimensional visual measurement system is composed of a projector and a camera;
S2、采用平行平面将圆柱面的三维点云数据分割成二维平面数据; S2. Using parallel planes to divide the three-dimensional point cloud data of the cylindrical surface into two-dimensional plane data;
S3、采用基于角度的排序算法将二维平面数据展开为一维点序列; S3. Using an angle-based sorting algorithm to expand the two-dimensional plane data into a one-dimensional point sequence;
S4、对一维点序列进行超限中值滤波和二次滤波,从而得到去除噪声后的一维点序列; S4. Perform over-limit median filtering and secondary filtering on the one-dimensional point sequence, so as to obtain the one-dimensional point sequence after noise removal;
S5、根据得到的一维点序列进行椭圆拟合和圆拟合,从而得到圆柱面不同位置截面的半径大小。 S5. Perform ellipse fitting and circle fitting according to the obtained one-dimensional point sequence, so as to obtain the radii of cross-sections at different positions on the cylindrical surface.
进一步作为优选的实施方式,所述步骤S1,其具体为: Further as a preferred embodiment, the step S1 is specifically:
采用摄像机和投影仪搭建基于条纹结构光和主动立体视觉技术的三维视觉测量系统,然后通过三维视觉测量系统依次进行系统标定、条纹投影与采集、绝对相位获取和对应点匹配,最终获取圆柱面的三维点云数据。 Cameras and projectors are used to build a 3D visual measurement system based on stripe structured light and active stereo vision technology, and then through the 3D visual measurement system, system calibration, fringe projection and acquisition, absolute phase acquisition and corresponding point matching are performed in sequence, and finally the cylindrical surface is obtained. 3D point cloud data.
进一步作为优选的实施方式,所述步骤S2,其具体为: Further as a preferred embodiment, the step S2 is specifically:
采用一组平行平面将三维点云数据分割成多组二维平面数据,所述平行平面垂直于X轴,其中,X轴为圆柱面的中心轴。 The three-dimensional point cloud data is divided into multiple sets of two-dimensional plane data by using a set of parallel planes perpendicular to the X axis, wherein the X axis is the central axis of the cylindrical surface.
参照图2,进一步作为优选的实施方式,所述步骤S3,其包括: Referring to Fig. 2, further as a preferred embodiment, said step S3, it comprises:
S31、根据步骤S2所获得的数据进行圆拟合,得到圆中心点,并将该圆中心点定义为基点o,然后构造一个过基点o且方向沿X轴正向的基向量并将从二维平面数据提取出的边缘数据点mn与基点o一一构成边缘向量其中,n=1,2,3,…; S31. Carry out circle fitting according to the data obtained in step S2 to obtain the center point of the circle, and define the center point of the circle as the base point o, and then construct a base vector passing through the base point o and whose direction is along the positive direction of the X-axis And the edge data point m n extracted from the two-dimensional plane data and the base point o constitute an edge vector Among them, n=1,2,3,...;
S32、计算边缘向量与基向量的夹角θn, S32. Calculate the edge vector with basis vectors The included angle θ n ,
S33、根据边缘向量与基向量夹角θn的大小对从二维平面数据提取出的边缘数据点mn重新进行排序,得到重新排序后的点序列Mi,其中,i=1,2,3,…,n; S33, according to the edge vector with basis vectors The size of the included angle θ n reorders the edge data points m n extracted from the two-dimensional plane data to obtain the reordered point sequence M i , where i=1,2,3,...,n;
S34、计算重新排序后的点序列Mi到基点的距离di,并以计算出的距离构成展开后的一维点序列di。 S34. Calculate the distance d i from the reordered point sequence M i to the base point, and use the calculated distance to form an expanded one-dimensional point sequence d i .
其中,基点一般选择二维平面数据的质心(即经圆拟合后得到的圆中心点)为基点。以基点为端点,x轴正方向为方向的射线为基向量,并将边缘数据点跟基点组成边缘向量,边缘向量方向沿基点指向边缘数据点。从二维平面数据提取出的边缘数据点mn为位于圆柱面上表面上的某一个数据点。 Among them, the base point generally selects the centroid of the two-dimensional plane data (that is, the center point of the circle obtained after the circle fitting) as the base point. With the base point as the endpoint and the ray in the positive direction of the x-axis as the base vector, the edge data point and the base point form an edge vector, and the direction of the edge vector points to the edge data point along the base point. The edge data point m n extracted from the two-dimensional plane data is a certain data point located on the surface of the cylinder.
按逆时针方向,计算边缘数据点跟基点组成的边缘向量与基向量的夹角,然后根据夹角的大小,即可将二维数据点展开为一维点序列。 In the counterclockwise direction, calculate the angle between the edge vector and the base vector formed by the edge data point and the base point, and then expand the two-dimensional data point into a one-dimensional point sequence according to the size of the angle.
参照图3,进一步作为优选的实施方式,所述步骤S4,其包括: Referring to Fig. 3, further as a preferred embodiment, said step S4, it comprises:
S41、采用超限中值滤波器对展开后的一维点序列di进行一次滤波,得到一 次滤波后的序列点,所述一次滤波后的序列点di'的表达式为: S41, using the over-limit median filter to perform a filter on the expanded one-dimensional point sequence d i to obtain a sequence point after the primary filter, the expression of the sequence point d i ' after the primary filter is:
其中,template为超限中值滤波器的模板大小,median为求中值,x0为设定的距离阈值; Among them, template is the template size of the over-limit median filter, median is the median value, and x 0 is the set distance threshold;
S42、根据一次滤波后的序列点di'到基点的距离大小以及序列点di'两侧相邻点到基点的距离大小,对一次滤波后的序列点di'进行二次滤波,得到去除噪声后的一维点序列。 S42. According to the distance from the sequence point d i ' to the base point after the primary filtering and the distance from the adjacent points on both sides of the sequence point d i ' to the base point, perform secondary filtering on the sequence point d i ' after the primary filtering to obtain A sequence of 1D points after noise removal.
参照图4,进一步作为优选的实施方式,所述步骤S5,其具体为: Referring to Fig. 4, further as a preferred embodiment, the step S5 is specifically:
S51、对去除噪声后的一维点序列进行椭圆拟合,得到椭圆中心点,然后对椭圆中心点进行空间直线拟合,求出圆柱面的第一中心轴; S51. Perform ellipse fitting on the one-dimensional point sequence after noise removal to obtain the center point of the ellipse, and then perform spatial straight line fitting on the center point of the ellipse to obtain the first central axis of the cylindrical surface;
S52、将圆柱面的第一中心轴以及圆柱面的三维点云数据旋转至与X轴平行; S52. Rotate the first central axis of the cylindrical surface and the three-dimensional point cloud data of the cylindrical surface to be parallel to the X axis;
S53、对旋转后圆柱面的三维点云数据重新执行步骤S2~S4,得到去除噪声后与X轴平行的一维点序列; S53. Re-execute steps S2-S4 on the three-dimensional point cloud data of the rotated cylindrical surface to obtain a one-dimensional point sequence parallel to the X axis after the noise is removed;
S54、对去除噪声后与X轴平行的一维点序列进行圆拟合,得到圆中心点,然后对圆中心点进行空间直线拟合,求出圆柱面的第二中心轴及相应的圆半径; S54. Carry out circle fitting to the one-dimensional point sequence parallel to the X axis after the noise is removed to obtain the center point of the circle, and then perform space straight line fitting to the center point of the circle to obtain the second central axis of the cylindrical surface and the corresponding circle radius ;
S55、判断圆柱面的第二中心轴与X轴的夹角是否小于设定的判断阈值,若是,则以求出的圆半径作为圆柱面不同位置的半径大小,反之,则在将圆柱面的第二中心轴以及圆柱面的三维点云数据旋转至与X轴平行之后返回步骤S2。 S55. Determine whether the included angle between the second central axis of the cylindrical surface and the X-axis is less than the set judgment threshold, if so, use the obtained circle radius as the radius of the different positions of the cylindrical surface, otherwise, calculate the radius of the cylindrical surface Return to step S2 after the second central axis and the 3D point cloud data of the cylindrical surface are rotated to be parallel to the X axis.
下面结合说明书附图和具体实施例对本发明作进一步详细说明。 The present invention will be described in further detail below in conjunction with the accompanying drawings and specific embodiments.
实施例一 Embodiment one
本实施例基于三维视觉的圆柱面半径测量方法所涉及的主要实现过程包括以下几个方面: The main implementation process involved in the method for measuring the radius of a cylindrical surface based on three-dimensional vision in this embodiment includes the following aspects:
(1).获取三维点云数据。 (1). Acquire 3D point cloud data.
本实施例采用摄像机和投影仪搭建了基于条纹结构光和主动立体视觉技术的三维视觉测量系统,搭建好的系统示意图及获取三维点云数据的流程如图5-1及图5-2所示。系统标定完成后,计算机控制摄像机先采集并解码变形条纹图,然后根据解码后的变形条纹图可得到每一点处的绝对相位值,最后以绝对相位值作为特征进行对应点匹配,即可获取被测物体的三维点云数据。 In this embodiment, cameras and projectors are used to build a 3D visual measurement system based on stripe structured light and active stereo vision technology. The schematic diagram of the built system and the process of obtaining 3D point cloud data are shown in Figure 5-1 and Figure 5-2 . After the system calibration is completed, the computer controls the camera to collect and decode the deformed fringe pattern first, then the absolute phase value at each point can be obtained according to the decoded deformed 3D point cloud data of the measured object.
(2).数据分割。 (2). Data segmentation. the
为降低计算复杂度,获取三维点云数据后,本实施例需对三维数据进行分割。而为了获得更多的数据点以提高测量精度,本实施例采用了具有一定厚度的立方体进行分割,只要在这个立方体内的点,本实施例就会将它近似为在同一个平行平面来计算。本实施例通过一组这样由设定厚度立方体组成的平行平面就可以将三维点云数据分割成一组组二维平面数据,从而降低计算的复杂度。 In order to reduce computational complexity, after obtaining the 3D point cloud data, this embodiment needs to segment the 3D data. In order to obtain more data points to improve the measurement accuracy, this embodiment uses a cube with a certain thickness for segmentation. As long as the point is in this cube, this embodiment will approximate it as being on the same parallel plane to calculate . In this embodiment, the three-dimensional point cloud data can be divided into groups of two-dimensional plane data through a set of such parallel planes composed of cubes with a set thickness, thereby reducing the complexity of calculation.
(3).噪声滤除 (3). Noise filtering
由于实际测量的三维点云数据不可避免地存在噪声,故在二维平面数据的周围会出现众多孤立点,因此在进行椭圆和圆拟合前必须先进行预滤波处理。图6为一个模拟的受到噪声干扰的半圆柱面在某一个位置上的切面图,该切面图表征了圆柱面上每个位置的半径大小,但它是一组一维的半径大小的序列,并不能直接采用二维滤波器进行滤波。所以在滤波前,本实施例设计了一种基于角度的排序算法,先将二维平面数据变为一维点序列,再进行滤波处理,这样能将数据中的噪声进行有效的滤除,保证了圆柱面半径测量的精度。 Since the actual measured 3D point cloud data inevitably has noise, there will be many isolated points around the 2D plane data, so pre-filtering must be performed before ellipse and circle fitting. Fig. 6 is a sectional view of a simulated semi-cylindrical surface disturbed by noise at a certain position, the sectional view characterizes the radius of each position on the cylindrical surface, but it is a set of one-dimensional radius sequence, The two-dimensional filter cannot be directly used for filtering. Therefore, before filtering, this embodiment designs an angle-based sorting algorithm, which first converts two-dimensional plane data into a one-dimensional point sequence, and then performs filtering processing, so that the noise in the data can be effectively filtered out to ensure The accuracy of the radius measurement of the cylindrical surface is improved.
本实施例基于角度的排序算法的具体实现过程如下:首先在二维平面上选定一个基点o;然后构造一个过基点o且方向沿X轴正向的基向量并将从二维平面数据提取出的边缘数据点mn与基点o一一构成边缘向量再接着求解出边缘向量与基向量的夹角θn,若边缘数据点mn的纵坐标小于中心点的纵坐标,则θn的值为反之,θn的值为其中,
从图6和图7可以看出,数据的周围出现了很多孤立点噪声,所以在进行拟合计算之前必须先将这些孤立点滤除。本实施例根据一维数据噪声的特点,采用了超限中值滤波器进行滤波,超限中值滤波器的构造方法如下:先选定超限中值滤波器的一个模板大小,然后令mdi=median(di,…,di+template),一般选择5点求出相邻5点的中值,即template取5,此时超限中值滤波器可设计为如下形式: It can be seen from Figure 6 and Figure 7 that there are many isolated point noises around the data, so these isolated points must be filtered out before the fitting calculation. In this embodiment, according to the characteristics of one-dimensional data noise, an over-limit median filter is used for filtering. The construction method of the over-limit median filter is as follows: first select a template size of the over-limit median filter, and then set md i =median(d i ,…,d i+template ), generally choose 5 points to find the median value of 5 adjacent points, that is, the template takes 5, at this time, the over-limit median filter can be designed as the following form:
设序列点di用此滤波器进行滤波后序列点变为di',则di'的表达式为: Suppose the sequence point d i is filtered by this filter and the sequence point becomes d i ', then the expression of d i ' is:
di'=di*h(i) (2) d i '=d i *h(i) (2)
经过式(1)和(2)处理后,大部分的孤立点已经被去除,如图8所示。但从图8可以看出,此时还是存在一些噪声点,如椭圆区域的点。从图9这一图8椭圆区域的局部放大图可以很明显看出还图8存在少数孤立点。为了将噪声点完全去除,此时还需进行二次滤波处理。从图9可以看出,剩下的噪声点到基点的距离都大于(或都小于)其两侧相邻点到基点的距离。据此,可以设定条件,当序列点di'的某点到基点的距离都大于(或都小于)其两侧相邻点到基点的距离时,就将此点剔除,反之,则保留该点,从而可得如图10所示的二次滤波效果图。最终可得图11所示的最终滤波结果。从图10和图11中可以看出,此时孤立点噪声完全被滤除,确保了后续椭圆和圆的拟合精度。 After processing by formulas (1) and (2), most of the isolated points have been removed, as shown in Figure 8. However, it can be seen from Figure 8 that there are still some noise points at this time, such as points in the ellipse area. From Figure 9, which is a partially enlarged view of the ellipse area in Figure 8, it can be clearly seen that there are a few isolated points in Figure 8. In order to completely remove the noise points, a secondary filtering process is required at this time. It can be seen from Fig. 9 that the distances from the remaining noise points to the base point are greater (or smaller) than the distances from the adjacent points on both sides to the base point. Accordingly, conditions can be set, when the distance from a certain point of the sequence point d i ' to the base point is greater (or smaller) than the distance from the adjacent points on both sides to the base point, this point will be removed, otherwise, it will be retained At this point, the secondary filtering effect diagram shown in Figure 10 can be obtained. Finally, the final filtering result shown in Figure 11 can be obtained. It can be seen from Figure 10 and Figure 11 that the isolated point noise is completely filtered out at this time, ensuring the fitting accuracy of subsequent ellipses and circles.
实施例二 Embodiment two
通过三维视觉测量系统获取的圆柱面点云数据的中心轴方向是随机的,本实施例假设圆柱面半径测量算法的具体流程如图12所示:首先,利用三维视觉测 量系统获取圆柱面的点云数据;接着,用一组平行平面将点云数据分割成多组二维平面数据,并利用基于角度的排序算法和超限中值滤波器进行噪声滤除,再接着进行椭圆拟合。但由于圆柱面的中心轴仍跟X轴有一定的夹角,所以得到的平面数据的精度并不高。为了得到更高精度的二维平面数据,本实施例将椭圆拟合出来的中心点进行空间直线拟合,然后将此拟合直线及三维点云数据旋转至与X轴平行的位置。此外,为保证中心轴尽可能的跟X轴平行,本实施例还设定了一个判断阈值,使中心轴与X轴的夹角经过不断的旋转操作后,小于该判断阈值,此时可认为中心轴与X已经平行。最后,再进行圆拟合操作,这样得到的测量结果精度更高。 The direction of the central axis of the point cloud data of the cylindrical surface obtained by the three-dimensional visual measurement system is random. In this embodiment, it is assumed that the specific flow of the cylindrical surface radius measurement algorithm is shown in Figure 12: First, the three-dimensional visual measurement system is used to obtain the cylindrical surface. Point cloud data; then, use a set of parallel planes to divide the point cloud data into multiple sets of two-dimensional plane data, and use an angle-based sorting algorithm and an over-limit median filter for noise filtering, and then perform ellipse fitting. However, since the central axis of the cylindrical surface still has a certain angle with the X axis, the accuracy of the obtained plane data is not high. In order to obtain higher-precision two-dimensional plane data, in this embodiment, the center point fitted by the ellipse is fitted with a straight line in space, and then the fitted straight line and the three-dimensional point cloud data are rotated to a position parallel to the X axis. In addition, in order to ensure that the central axis is parallel to the X-axis as much as possible, this embodiment also sets a judgment threshold, so that the angle between the central axis and the X-axis is less than the judgment threshold after continuous rotation operations. At this time, it can be considered The central axis is already parallel to X. Finally, the circle fitting operation is performed, so that the measurement results obtained are more accurate.
为说明本发明方法的稳定性和精度,本实施例结合一个电机转子用的钕铁硼瓦片磁铁来进行说明。采用钕铁硼永磁材料的电机应用越来越广泛,如纺织专用电机、航空发电机、力矩电机、汽车和摩托车用电机、永磁外转子电机等。在这些电机中电机转子的优劣,直接影响电机性能的好坏,而半径大小是电机转子的一个重要检测参数,具有重要的实用价值。 In order to illustrate the stability and precision of the method of the present invention, this embodiment is described in conjunction with an NdFeB tile magnet for a motor rotor. Motors using NdFeB permanent magnet materials are more and more widely used, such as special textile motors, aviation generators, torque motors, motors for automobiles and motorcycles, permanent magnet external rotor motors, etc. In these motors, the quality of the motor rotor directly affects the performance of the motor, and the radius is an important detection parameter of the motor rotor, which has important practical value.
本实施例首先利用三维视觉测量系统获取钕铁硼瓦片的外表面点云数据,共获取的数据点共2.31万,然后采用本发明的方法计算出圆柱面20个等间距位置上的半径值,测量结果如表1所示,而该钕铁硼瓦片零件标称的半径值为13.76mm。 In this embodiment, first, the point cloud data of the outer surface of the NdFeB tile is obtained by using the three-dimensional visual measurement system, and a total of 23,100 data points are obtained, and then the radius values at 20 equidistant positions on the cylindrical surface are calculated by using the method of the present invention , the measurement results are shown in Table 1, and the nominal radius of the NdFeB tile part is 13.76mm.
表1 钕铁硼瓦片外表面不同位置的半径测量值(单位:mm) Table 1 Radius measurements at different positions on the outer surface of NdFeB tiles (unit: mm)
为直观显示表1数据变化,可将表1中数据绘制成曲线图,如附图13所示。从表1和附图13可知,钕铁硼瓦片电机转子不同位置的半径值是不一样的,总体从一侧向另外一侧呈现增大的趋势,两端约有0.18mm的偏差。如果仅检测一个端面来表征测量此圆柱面的半径,肯定是不准确的,也不能进行形位误差分析。 In order to visually display the data changes in Table 1, the data in Table 1 can be drawn into a graph, as shown in Figure 13. It can be seen from Table 1 and Figure 13 that the radius values of the rotors of NdFeB tile motors are different at different positions, and generally show an increasing trend from one side to the other, with a deviation of about 0.18mm at both ends. If only one end face is detected to characterize and measure the radius of the cylindrical surface, it is definitely inaccurate, and it is impossible to analyze the shape and position error.
为进一步验证本发明的方法,本实施例对该钕铁硼瓦片电机转子共采集了8组数据,每组数据点均为2.3万左右,则计算出各组的半径测量值如表2所示。 In order to further verify the method of the present invention, the present embodiment has collected 8 sets of data on the NdFeB tile motor rotor, and each set of data points is about 23,000, and the radius measurement values of each set are calculated as shown in Table 2. Show.
表2 钕铁硼瓦片外表面半径测量结果 Table 2 Measurement results of the outer surface radius of NdFeB tiles
从表2的数据可以看出,采用本发明的方法对同一个圆柱面进行多次测量时, 各组中的测量偏差值最大不超过0.008mm,各组测量值的方差为0.004mm。从以上实验可以表明,本发明的方法具有测量精度高和抗噪声能力强,适合于工业中的圆柱面高精度半径测量要求的优点。 As can be seen from the data in Table 2, when adopting the method of the present invention to carry out multiple measurements on the same cylindrical surface, the maximum measurement deviation in each group is no more than 0.008mm, and the variance of each group of measured values is 0.004mm. It can be shown from the above experiments that the method of the present invention has the advantages of high measurement accuracy and strong anti-noise ability, and is suitable for the requirements of high-precision radius measurement of cylindrical surfaces in industry.
以上是对本发明的较佳实施进行了具体说明,但本发明创造并不限于所述实施例,熟悉本领域的技术人员在不违背本发明精神的前提下还可做作出种种的等同变形或替换,这些等同的变形或替换均包含在本申请权利要求所限定的范围内。 The above is a specific description of the preferred implementation of the present invention, but the invention is not limited to the described embodiments, and those skilled in the art can also make various equivalent deformations or replacements without violating the spirit of the present invention. , these equivalent modifications or replacements are all within the scope defined by the claims of the present application.
Claims (6)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510395713.7A CN105004274B (en) | 2015-07-07 | 2015-07-07 | A kind of face of cylinder radius measurement method based on 3D vision |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510395713.7A CN105004274B (en) | 2015-07-07 | 2015-07-07 | A kind of face of cylinder radius measurement method based on 3D vision |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105004274A true CN105004274A (en) | 2015-10-28 |
CN105004274B CN105004274B (en) | 2017-06-30 |
Family
ID=54377040
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510395713.7A Active CN105004274B (en) | 2015-07-07 | 2015-07-07 | A kind of face of cylinder radius measurement method based on 3D vision |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105004274B (en) |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106197266A (en) * | 2016-07-01 | 2016-12-07 | 北京航空航天大学 | For the method measuring the pose of the columnar object with circular cambered surface |
CN106875439A (en) * | 2017-02-20 | 2017-06-20 | 天津大学 | Silicon single crystal rod shape dimension measurement method based on three-dimensional point cloud model |
CN107248163A (en) * | 2017-06-12 | 2017-10-13 | 天津大学 | A kind of automatic generation method of decorative pattern expanded view towards rotationally symmetrical porcelain |
CN109000572A (en) * | 2018-09-17 | 2018-12-14 | 四川大学 | A kind of body diameter detection method |
CN109741386A (en) * | 2018-12-26 | 2019-05-10 | 豪威科技(武汉)有限公司 | The Enhancement Method and stereo visual system of stereo visual system |
CN112284696A (en) * | 2019-07-11 | 2021-01-29 | 中国科学院半导体研究所 | Gas cylinder volume detection method and system based on 3D vision technology |
CN112508803A (en) * | 2020-11-03 | 2021-03-16 | 中山大学 | Denoising method and device for three-dimensional point cloud data and storage medium |
CN112977535A (en) * | 2021-05-11 | 2021-06-18 | 领视科技成都有限公司 | Electrified railway clearance detection method and system based on laser scanning |
CN116336953A (en) * | 2023-05-30 | 2023-06-27 | 武汉工程大学 | System and method for measuring radius and depth of perforation model |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060291716A1 (en) * | 2005-06-28 | 2006-12-28 | Janakiraman Vaidyanathan | Thermal imaging and laser scanning systems and methods for determining the location and angular orientation of a hole with an obstructed opening residing on a surface of an article |
CN101135550A (en) * | 2007-10-08 | 2008-03-05 | 天津大学 | Measuring method of spatial circular hole geometric parameters based on line structured light vision sensor |
CN101419063A (en) * | 2008-10-30 | 2009-04-29 | 上海大学 | Cylindricity non-contact measurement method and system based on multi-diameter splicing technology |
CN102506704A (en) * | 2011-10-14 | 2012-06-20 | 天津大学 | geometric parameter online measurement method of compression spring |
CN103322916A (en) * | 2013-06-28 | 2013-09-25 | 中国计量学院 | Large-scale vertical tank volume measurement system and method based on three-dimensional laser scanning method |
CN103852032A (en) * | 2012-12-07 | 2014-06-11 | 上海汽车集团股份有限公司 | Characteristic parameter extraction method for cylindrical axis parts |
CN104457562A (en) * | 2013-09-13 | 2015-03-25 | 武汉惟景三维科技有限公司 | Adapter on-line detection system based on surface structured light |
-
2015
- 2015-07-07 CN CN201510395713.7A patent/CN105004274B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060291716A1 (en) * | 2005-06-28 | 2006-12-28 | Janakiraman Vaidyanathan | Thermal imaging and laser scanning systems and methods for determining the location and angular orientation of a hole with an obstructed opening residing on a surface of an article |
CN101135550A (en) * | 2007-10-08 | 2008-03-05 | 天津大学 | Measuring method of spatial circular hole geometric parameters based on line structured light vision sensor |
CN101419063A (en) * | 2008-10-30 | 2009-04-29 | 上海大学 | Cylindricity non-contact measurement method and system based on multi-diameter splicing technology |
CN102506704A (en) * | 2011-10-14 | 2012-06-20 | 天津大学 | geometric parameter online measurement method of compression spring |
CN103852032A (en) * | 2012-12-07 | 2014-06-11 | 上海汽车集团股份有限公司 | Characteristic parameter extraction method for cylindrical axis parts |
CN103322916A (en) * | 2013-06-28 | 2013-09-25 | 中国计量学院 | Large-scale vertical tank volume measurement system and method based on three-dimensional laser scanning method |
CN104457562A (en) * | 2013-09-13 | 2015-03-25 | 武汉惟景三维科技有限公司 | Adapter on-line detection system based on surface structured light |
Non-Patent Citations (2)
Title |
---|
宋振等: "基于三维激光扫描仪法的大型立式罐容量的计量", 《计量技术》 * |
宋振等: "立式罐容量计量中三维激光扫描法研究", 《中国测试》 * |
Cited By (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106197266B (en) * | 2016-07-01 | 2018-10-02 | 北京航空航天大学 | Method for the pose for measuring the columnar object with round cambered surface |
CN106197266A (en) * | 2016-07-01 | 2016-12-07 | 北京航空航天大学 | For the method measuring the pose of the columnar object with circular cambered surface |
CN106875439B (en) * | 2017-02-20 | 2019-06-07 | 天津大学 | Dimensional measurement method of single crystal silicon rod based on 3D point cloud model |
CN106875439A (en) * | 2017-02-20 | 2017-06-20 | 天津大学 | Silicon single crystal rod shape dimension measurement method based on three-dimensional point cloud model |
CN107248163A (en) * | 2017-06-12 | 2017-10-13 | 天津大学 | A kind of automatic generation method of decorative pattern expanded view towards rotationally symmetrical porcelain |
CN107248163B (en) * | 2017-06-12 | 2020-11-10 | 天津大学 | A method for automatic generation of decorative pattern for rotationally symmetric porcelain |
CN109000572A (en) * | 2018-09-17 | 2018-12-14 | 四川大学 | A kind of body diameter detection method |
CN109741386A (en) * | 2018-12-26 | 2019-05-10 | 豪威科技(武汉)有限公司 | The Enhancement Method and stereo visual system of stereo visual system |
CN112284696A (en) * | 2019-07-11 | 2021-01-29 | 中国科学院半导体研究所 | Gas cylinder volume detection method and system based on 3D vision technology |
CN112508803A (en) * | 2020-11-03 | 2021-03-16 | 中山大学 | Denoising method and device for three-dimensional point cloud data and storage medium |
CN112508803B (en) * | 2020-11-03 | 2023-10-03 | 中山大学 | Denoising method and device for three-dimensional point cloud data and storage medium |
CN112977535A (en) * | 2021-05-11 | 2021-06-18 | 领视科技成都有限公司 | Electrified railway clearance detection method and system based on laser scanning |
CN116336953A (en) * | 2023-05-30 | 2023-06-27 | 武汉工程大学 | System and method for measuring radius and depth of perforation model |
CN116336953B (en) * | 2023-05-30 | 2023-08-11 | 武汉工程大学 | A system and method for measuring the radius and depth of a perforated model |
Also Published As
Publication number | Publication date |
---|---|
CN105004274B (en) | 2017-06-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105004274B (en) | A kind of face of cylinder radius measurement method based on 3D vision | |
CN105300316B (en) | Optical losses rapid extracting method based on grey scale centre of gravity method | |
CN101692257B (en) | Method for registering complex curved surface | |
CN107123161A (en) | A kind of the whole network three-dimensional rebuilding method of contact net zero based on NARF and FPFH | |
CN106651828B (en) | Method for measuring sub-pixel of product size under industrial small-scale motion blur imaging condition | |
CN105913489A (en) | Indoor three-dimensional scene reconstruction method employing plane characteristics | |
CN107516098A (en) | A Method of Extracting 3D Information of Object Outline Based on Edge Curvature Angle | |
CN109060836A (en) | High-pressure oil pipe joint external screw thread detection method based on machine vision | |
CN108830868A (en) | It is a kind of that the circular fitting method combined is returned based on Snake model and iteration dipole inversion | |
CN106340010B (en) | A Corner Detection Method Based on Second-Order Contour Difference | |
CN103679193A (en) | FREAK-based high-speed high-density packaging component rapid location method | |
CN107274422A (en) | A kind of point cloud edge extracting method combined based on normal information and K neighborhood search | |
CN109285210B (en) | Pipeline three-dimensional reconstruction method combining topological relation and epipolar constraint | |
CN103914837B (en) | A kind of cylindrical neighborhood being applicable to various visual angles points cloud processing and searching method thereof | |
CN101586943A (en) | Method for calibrating structure light vision transducer based on one-dimensional target drone | |
CN102506704A (en) | geometric parameter online measurement method of compression spring | |
CN106813569B (en) | A three-dimensional positioning method of automobile tires based on linear structured light | |
CN109272542A (en) | Method for determining volume of three-dimensional object | |
CN111947599A (en) | Learning-based fringe phase recovery and speckle correlation 3D measurement method | |
CN105115441A (en) | Feature point extraction automatic segmenting method for profile of revolution solid part | |
CN106845535B (en) | Typical Components recognition methods based on cloud | |
Wu et al. | An accurate novel circular hole inspection method for sheet metal parts using edge-guided robust multi-view stereo | |
CN104680016A (en) | Geometric optimization approximation based minimum region fitting method for profiles of parabolas | |
CN112561936A (en) | Image processing technology for measuring bubble volume in liquid-gas phase change process | |
CN111445480A (en) | A new template-based image rotation angle and scaling factor measurement method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |