CN103337067B - The visible detection method of single needle scan-type screw measurement instrument probe X-axis rotating deviation - Google Patents

The visible detection method of single needle scan-type screw measurement instrument probe X-axis rotating deviation Download PDF

Info

Publication number
CN103337067B
CN103337067B CN201310217418.3A CN201310217418A CN103337067B CN 103337067 B CN103337067 B CN 103337067B CN 201310217418 A CN201310217418 A CN 201310217418A CN 103337067 B CN103337067 B CN 103337067B
Authority
CN
China
Prior art keywords
probe
cusp
image
frame
distance
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.)
Expired - Fee Related
Application number
CN201310217418.3A
Other languages
Chinese (zh)
Other versions
CN103337067A (en
Inventor
赵东标
陈盛
陆永华
刘凯
王扬威
章永年
贡国云
沈建清
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanjing University of Aeronautics and Astronautics
Original Assignee
Nanjing University of Aeronautics and Astronautics
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nanjing University of Aeronautics and Astronautics filed Critical Nanjing University of Aeronautics and Astronautics
Priority to CN201310217418.3A priority Critical patent/CN103337067B/en
Publication of CN103337067A publication Critical patent/CN103337067A/en
Application granted granted Critical
Publication of CN103337067B publication Critical patent/CN103337067B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Image Analysis (AREA)

Abstract

本发明提供了一种单针扫描式螺纹测量仪探针X轴旋转偏差的视觉检测方法,涉及图像处理技术领域。包括以下过程:步骤1、初始化标定:步骤2、实时检测探针尖点:步骤3、计算旋转偏差角度。本发明能够通过图像处理手段测量、调节探针的X轴旋转定位偏差大小,实现自动化测量,在保证安装精度的前提下,提高效率。

The invention provides a visual detection method for the X-axis rotation deviation of a probe of a single-needle scanning thread measuring instrument, and relates to the technical field of image processing. The following process is included: Step 1, initialization calibration; Step 2, real-time detection of the sharp point of the probe; Step 3, calculation of the rotation deviation angle. The invention can measure and adjust the X-axis rotation positioning deviation of the probe through image processing means, realize automatic measurement, and improve efficiency under the premise of ensuring installation accuracy.

Description

单针扫描式螺纹测量仪探针X轴旋转偏差的视觉检测方法Visual inspection method for X-axis rotation deviation of probe of single-needle scanning thread measuring instrument

技术领域technical field

本发明提供了一种单针扫描式螺纹测量仪探针X轴旋转偏差的视觉检测方法,涉及图像处理技术领域。The invention provides a visual detection method for the X-axis rotation deviation of a probe of a single-needle scanning thread measuring instrument, and relates to the technical field of image processing.

背景技术Background technique

螺纹连接件是机械工业广泛应用的机械零件,它的制造精度直接影响着机件连接的可靠性、装配精度和互换性,特别是在航天飞行器的设计制造中,大量采用螺纹连接,大约有50%以上的零件间的联接要靠螺纹配合来实现,联接质量决定了飞行器等工业产品的可靠性和寿命。Threaded connectors are mechanical parts widely used in the machinery industry. Its manufacturing accuracy directly affects the reliability, assembly accuracy and interchangeability of machine parts. Especially in the design and manufacture of aerospace vehicles, a large number of threaded connections are used. More than 50% of the connection between parts is realized by thread fit, and the quality of the connection determines the reliability and life of industrial products such as aircraft.

对于普通螺纹,常采用标准环规(塞规)来进行旋合判别,然而对于精度要求较高的螺纹,如环规(塞规)本身的测量,就需要更为精准的仪器来检测。目前,在高精度螺纹测量仪器设备上,国内外成熟的产品不是很多。国外有荷兰IAC公司生产的MSXP螺纹测量仪,采用的触针式扫描轮廓方法。国内还没有专门的厂家生产接触式螺纹测量仪。哈量集团有触针式的表面轮廓仪器,但不是专门针对螺纹检测,螺纹综合参数的计算和误差补偿还不完善。哈尔滨工业大学、长春理工大学、浙江大学等利用激光扫描技术获得螺纹轮廓数据进行测量,但从目前公布的数据上看,其测量精度尚不及接触式扫描。天津大学,南京航空航天大学等对基于图像视觉的螺纹参数检测做过研究,其方法对检测效率有大幅提高,但图像视觉测量精度也不及触针式扫描,并且很难解决对内螺纹的准确测量。For ordinary threads, standard ring gauges (plug gauges) are often used to judge the screw-in. However, for threads with high precision requirements, such as the measurement of ring gauges (plug gauges), more accurate instruments are needed for detection. At present, there are not many mature products at home and abroad in terms of high-precision thread measuring instruments and equipment. Abroad, there is the MSXP thread measuring instrument produced by the Dutch IAC company, which adopts the stylus scanning contour method. There is no special manufacturer producing contact thread measuring instruments in China. Haliang Group has a stylus-type surface profile instrument, but it is not specifically for thread detection, and the calculation and error compensation of thread comprehensive parameters are not yet perfect. Harbin Institute of Technology, Changchun University of Science and Technology, Zhejiang University, etc. use laser scanning technology to obtain thread profile data for measurement, but from the currently published data, the measurement accuracy is not as good as contact scanning. Tianjin University, Nanjing University of Aeronautics and Astronautics, etc. have done research on thread parameter detection based on image vision. The method has greatly improved the detection efficiency, but the image vision measurement accuracy is not as good as stylus scanning, and it is difficult to solve the problem of accurate internal thread detection. Measurement.

触针扫描式螺纹测量中,为了克服探针磨损和其他一些环境变化引起的测量误差,通常采用相对测量方法。即先用标准螺纹进行标定测量,再对待测螺纹工件进行测量。而这就要求仪器有着极高的定位精度,否则当标准螺纹与待测螺纹尺寸相差较大时,测量结果的误差将被放大。In the stylus scanning thread measurement, in order to overcome the measurement errors caused by probe wear and other environmental changes, the relative measurement method is usually used. That is, the standard thread is used for calibration measurement first, and then the threaded workpiece to be measured is measured. And this requires the instrument to have extremely high positioning accuracy, otherwise, when the size difference between the standard thread and the thread to be measured is large, the error of the measurement result will be magnified.

利用空间坐标的齐次变换方法,可以判断出来,对中径参数测量结果影响最大的定位误差主要有Y轴方向的偏差和探针的上、下针尖连线与X轴的旋转偏差(图1所示坐标系下)。然而实际加工误差和装配误差的存在,使得这两项偏差很难控制在允许范围内。Y轴的轴向偏差可以通过补偿计算得出,而X轴的旋转偏差则需要通过有效的检测方法来进行控制。目前尚未发现相关资料显示能够对该项偏差进行自动检测控制。Using the homogeneous transformation method of spatial coordinates, it can be judged that the positioning errors that have the greatest impact on the measurement results of pitch diameter parameters mainly include the deviation in the Y-axis direction and the rotation deviation between the upper and lower needle points of the probe and the X-axis (Fig. 1 in the coordinate system shown). However, the existence of actual processing errors and assembly errors makes it difficult to control these two deviations within the allowable range. The axial deviation of the Y-axis can be calculated through compensation, while the rotational deviation of the X-axis needs to be controlled through an effective detection method. At present, no relevant information has been found to show that the deviation can be automatically detected and controlled.

发明内容Contents of the invention

本发明的目的在于提供一种能够实现自动化检测控制的单针扫描式螺纹测量仪探针探针X轴旋转偏差的视觉检测方法。The object of the present invention is to provide a visual detection method for X-axis rotation deviation of a probe probe of a single-needle scanning thread measuring instrument capable of automatic detection and control.

步骤1、初始化标定:Step 1. Initialize calibration:

步骤1-1、采集第1帧包括探针运动区域的RGB图像,根据以下公式将RGB图像转化为灰度图像;Step 1-1, collect the RGB image of the first frame including the probe motion area, and convert the RGB image into a grayscale image according to the following formula;

Gray=(R*19595+G*38469+B*7472)>>16Gray=(R*19595+G*38469+B*7472)>>16

其中,R、G、B分别表示RGB图像中的对应的红、绿、蓝三个颜色分量,Gray表示灰度值;Among them, R, G, and B respectively represent the corresponding red, green, and blue color components in the RGB image, and Gray represents the gray value;

步骤1-2、利用SUSAN角点检测算法,对灰度图像进行角点检测,得到包括上、下探针尖点在内的所有角点信息;Step 1-2, using the SUSAN corner detection algorithm to detect the corners of the gray image to obtain all corner information including the sharp points of the upper and lower probes;

步骤1-3、人工操作,选中上、下探针尖点对应的两个角点;Step 1-3, manual operation, select the two corner points corresponding to the sharp points of the upper and lower probes;

步骤2、实时检测探针尖点:Step 2. Real-time detection of the sharp point of the probe:

步骤2-1、采集第i+1帧包括探针运动区域的RGB图像,将其转化为灰度图像,其中i≥1;Step 2-1, collect the RGB image of the i+1th frame including the probe motion area, and convert it into a grayscale image, where i≥1;

步骤2-2、当i=1时,以前一帧图像中探针尖点的位置为预测尖点,即P′i+1=Pi;当i≥2时,根据第i-1帧和i帧的灰度图像中探针尖点的位置,通过以下预测公式预测i+1帧图像中的探针尖点位置;Step 2-2. When i=1, the position of the sharp point of the probe in the previous frame image is the predicted sharp point, that is, P′ i+1 =P i ; when i≥2, according to the i-1th frame and The position of the sharp point of the probe in the grayscale image of the i frame, the position of the sharp point of the probe in the image of the i+1 frame is predicted by the following prediction formula;

P′i+1=Pi+(Pi-Pi-1)=2Pi-Pi-1P' i+1 =P i +(P i -P i-1 )=2P i -P i-1 ;

其中,P为探针尖点的坐标向量,P’为探针尖点的预测坐标向量,i为图像的帧数;Wherein, P is the coordinate vector of the tip of the probe, P' is the predicted coordinate vector of the tip of the probe, and i is the frame number of the image;

步骤2-3、以探针尖点预测坐标向量P’为基础,在第i+1帧灰度图像上构建局部感兴趣区域;Step 2-3, based on the predicted coordinate vector P' of the probe cusp, constructing a local region of interest on the grayscale image of the i+1th frame;

步骤2-4、通过对局部感兴趣区域进行SUSAN角点检测,过滤出上、下探针尖点位置;Step 2-4, by performing SUSAN corner point detection on the local region of interest, filter out the sharp point positions of the upper and lower probes;

步骤2-5、对过滤出的上、下探针尖点进行距离校验;Step 2-5, performing distance verification on the filtered upper and lower probe sharp points;

距离校验条件1为The distance check condition 1 is

|d(Pup,Pdown)-d0(Pup,Pdown)|<ε1 |d(P up ,P down )-d 0 (P up ,P down )|<ε 1

其中,d(Pup,Pdown)表示k+1帧图像中的上、下探针尖点之间的距离;d0(Pup,Pdown)表示k帧图像中的上、下探针尖点之间的距离;ε1为误差阈值;Among them, d(P up , P down ) represents the distance between the tip points of the upper and lower probes in k+1 frame images; d 0 (P up , P down ) represents the upper and lower probe points in k frames of images The distance between sharp points; ε 1 is the error threshold;

步骤2-6、判断步骤2-5校验结果,如满足条件1,则转入步骤2-10,否则转步骤2-7;Step 2-6, judging the verification result of step 2-5, if condition 1 is met, then go to step 2-10, otherwise go to step 2-7;

步骤2-7、以Canny算子检测局部感兴趣区域中图像边缘信息,利用Hough变换提取直线轮廓,进一步根据以下规则分别得到上尖点和下尖点对应的圆锥母线:Steps 2-7: Use the Canny operator to detect the edge information of the image in the local region of interest, use the Hough transform to extract the straight line contour, and further obtain the corresponding conic generatrices of the upper and lower cusps according to the following rules:

a)在所提取的直线中,两条探针圆锥母线与图像中X轴夹角大小在60°~80°之间;a) In the extracted straight line, the included angle between the two probe conical generatrices and the X-axis in the image is between 60° and 80°;

b)两条圆锥母线之间的夹角满足θ12分别是两b) The angle between two conical generatrices satisfies θ 1 , θ 2 are two

条探针圆锥母线与图像X轴夹角;The angle between the conical generatrix of the strip probe and the X-axis of the image;

c)圆锥母线交点Q为所有配对成功直线交点的最高点,并且在图像内;c) The intersection point Q of the conical generatrices is the highest point of the intersection points of all successfully paired straight lines, and it is within the image;

步骤2-8、根据所得上尖点和下尖点对应的圆锥母线,计算上、下轮廓交点,并进行距离校验;Step 2-8, calculate the intersection point of the upper and lower contours according to the conical generatrices corresponding to the obtained upper and lower cusps, and perform distance verification;

距离校验条件2为The distance check condition 2 is

|d(Qup,Qdown)-d0(Qup,Qdown)|<ε2 |d(Q up ,Q down )-d 0 (Q up ,Q down )|<ε 2

其中,d(Qup,Qdown)表示当前帧图像中的上、下探针尖点之间的距离;d0(Qup,Qdown)表示前一帧图像中的上、下探针尖点之间的距离;ε2为误差阈值;Among them, d(Q up , Q down ) represents the distance between the upper and lower probe tip in the current frame image; d 0 (Q up , Q down ) represents the upper and lower probe tip in the previous frame image The distance between points; ε 2 is the error threshold;

步骤2-9、判断步骤2-8校验结果,如满足条件2,则根据上一帧图像中理想探针尖点Q0与P0的距离以及当前帧图像中理想探针尖点Q,按下式计算当前帧中实际探针尖点P。Step 2-9, judging the verification result of step 2-8, if condition 2 is satisfied, according to the distance between the ideal probe point Q0 and P0 in the previous frame image and the ideal probe point Q in the current frame image, Calculate the actual tip point P of the probe in the current frame according to the formula.

P=Q+P0-Q0,转入步骤2-10;P=Q+P 0 -Q 0 , turn to step 2-10;

若条件2亦不满足,则认为当前帧图像检测失败,测量数据点不存入数据库中,转步骤2-1;If condition 2 is not satisfied, it is considered that the current frame image detection fails, and the measurement data points are not stored in the database, and go to step 2-1;

步骤2-10记录上、下探针尖点的位置及其连线斜率k;Step 2-10 records the positions of the sharp points of the upper and lower probes and the slope k of the connecting line;

步骤3、计算旋转偏差角度Step 3. Calculate the rotation deviation angle

步骤3-1、分别拟合探针上、下尖点位置,求出探针运动直线,具体过程如下;Step 3-1. Fit the positions of the upper and lower sharp points of the probe respectively, and obtain the motion straight line of the probe. The specific process is as follows;

探针一次上、下运动捕获的视频序列中,若检测出的有效探针尖点图像数为N,利用线性回归方程In the video sequence captured by the probe’s up and down motion, if the number of effective probe tip images detected is N, the linear regression equation

kk Mm == ΣΣ ii == 11 NN (( xx ii -- xx ‾‾ )) (( ythe y ii -- ythe y ‾‾ )) ΣΣ ii == 11 NN (( xx ii -- xx ‾‾ )) 22 == ΣΣ ii == 11 NN xx ii ythe y ii -- NN xx ythe y ‾‾ ΣΣ ii == 11 NN xx ii 22 -- NN xx ‾‾ 22

求出探针运动直线;其中,kM为运动直线的斜率;xi,yi分别为第i帧图像中探针尖点的横、纵坐标; Find the straight line of the probe motion; where, k M is the slope of the straight line of motion; x i , y i are the abscissa and ordinate of the tip point of the probe in the i-th frame image respectively;

步骤3-2、根据每帧图像中的上、下探针尖点位置,求出各帧图像中探针所在直线方向;即Step 3-2, according to the positions of the sharp points of the upper and lower probes in each frame of image, find the straight line direction of the probe in each frame of image; that is

kk ii == ythe y uu pp -- ythe y dd oo ww nno xx uu pp -- xx dd oo ww nno ,, (( ii == 11 ,, 2...2... ,, NN ))

其中,ki为第i帧图像中,探针上、下尖点的连线斜率;(xup,yup)为上探针尖点坐标,(xdown,ydown)为下探针尖点坐标;Among them, k i is the slope of the line connecting the upper and lower sharp points of the probe in the i-th frame image; (x up , y up ) is the coordinates of the upper probe sharp point, (x down , y down ) is the lower probe tip point coordinates;

探针上、下尖点连线斜率k的均值为The average slope k of the line connecting the upper and lower sharp points of the probe is

kk LL == ΣΣ ii == 11 NN kk ii NN

利用探针上、下尖点连线平均斜率kL得到一条上、下尖点的拟合直线;Utilize the average slope k L of the line connecting the upper and lower sharp points of the probe to obtain a fitting straight line of the upper and lower sharp points;

步骤3-3、计算探针运动直线与上、下尖点拟合直线的夹角θStep 3-3. Calculate the angle θ between the straight line of the probe motion and the fitting line of the upper and lower sharp points

θθ == aa tanthe tan || kk LL -- kk Mm 11 ++ kk LL kk Mm ||

θ即为旋转偏差角度。θ is the rotation deviation angle.

本发明能够通过图像处理手段测量、调节探针的X轴旋转定位偏差大小,实现自动化测量,在保证安装精度的前提下,提高效率。The invention can measure and adjust the X-axis rotation positioning deviation of the probe through image processing means, realize automatic measurement, and improve efficiency under the premise of ensuring installation accuracy.

附图说明Description of drawings

图1是工件坐标系的定义;Figure 1 is the definition of the workpiece coordinate system;

图2是摄像头与探针相对位置关系;Figure 2 is the relative positional relationship between the camera and the probe;

图3是整幅图像的角点检测结果;Figure 3 is the corner detection result of the entire image;

图4是局部感兴趣区域角点检测结果;Figure 4 is the corner detection result of the local region of interest;

图5是三种角点检测算法在有背景阴影干扰时对探针尖点附近的感兴趣区域的角点检测结果。其中,(a)是Harris角点检测算法的结果;(b)是SUSAN角点检测算法的结果;(c)是FAST角点检测算法的结果;Figure 5 shows the corner detection results of the three corner detection algorithms for the region of interest near the tip of the probe when there is background shadow interference. Among them, (a) is the result of Harris corner detection algorithm; (b) is the result of SUSAN corner detection algorithm; (c) is the result of FAST corner detection algorithm;

图6是理想探针尖点与实际探针尖点的位置关系示意图。其中Q表示理想探针尖点,P为实际探针尖点;FIG. 6 is a schematic diagram of the positional relationship between the ideal probe tip and the actual probe tip. Where Q represents the ideal probe tip, and P is the actual probe tip;

图7是三种边缘检测算法对探针局部图像的边缘检测结果。其中,(a)为Sobel算子的检测结果,(b)为Prewitt算子的检测结果,(c)为Canny算子的检测结果;Fig. 7 is the edge detection results of the probe partial image by three edge detection algorithms. Among them, (a) is the detection result of Sobel operator, (b) is the detection result of Prewitt operator, (c) is the detection result of Canny operator;

图8是非极大值抑制方法的示意图;Fig. 8 is a schematic diagram of a non-maximum suppression method;

图9是Hough直线检测效果图;Figure 9 is a Hough line detection effect diagram;

图10是探针圆锥母线检测结果;Figure 10 is the detection result of the probe conical busbar;

图11是探针尖点溢出感兴趣区域时的示意图;Fig. 11 is a schematic diagram when the tip of the probe overflows the region of interest;

图12是针尖点跟踪的视频序列截图;Figure 12 is a video sequence screenshot of needle point tracking;

图中标号名称:1、工件的假象圆柱,2、探针,3、挂接面板,4摄像头Label names in the figure: 1. Imaginary cylinder of the workpiece, 2. Probe, 3. Mounting panel, 4. Camera

具体实施方式detailed description

为了保证探针尖点识别的准确率,本发明采用角点检测、轮廓识别以及运动预测三个方面进行综合识别,很大程度上提高了探针尖点的准确性,有效抑制了背景干扰导致的探针尖点误检。然后通过对尖点位置的直线拟合,计算运动直线(测量仪Z轴)与上、下尖点连线的夹角。In order to ensure the accuracy of the sharp point recognition of the probe, the present invention adopts three aspects of corner detection, contour recognition and motion prediction for comprehensive recognition, which greatly improves the accuracy of the sharp point of the probe and effectively suppresses the background interference caused by false detection of the tip of the probe. Then, calculate the included angle between the motion line (Z-axis of the measuring instrument) and the line connecting the upper and lower sharp points by fitting the straight line to the position of the sharp point.

图2所示,将摄像头安置在探针的X轴正方向,与探针在Z轴方向平行。通过摄像头采集探针的上、下运动,通过图像识别自动捕捉探针上、下尖点的连线和运动,计算出旋转偏差角度。再通过后置装置调节探针旋转,控制旋转偏差。由于图像是二维数据,故在后面图像处理的公式推导中,以y轴代替z轴进行表述。软件程序步骤如下:As shown in Figure 2, the camera is placed in the positive direction of the X-axis of the probe, parallel to the direction of the Z-axis of the probe. The up and down movement of the probe is collected by the camera, and the connection and movement of the upper and lower sharp points of the probe are automatically captured through image recognition, and the rotation deviation angle is calculated. Then adjust the probe rotation through the rear device to control the rotation deviation. Since the image is two-dimensional data, in the following formula derivation of image processing, the y-axis is used instead of the z-axis for expression. The software program steps are as follows:

步骤1、初始化标定:Step 1. Initialize calibration:

步骤1-1、采集一幅包括探针运动区域的RGB图像,根据以下公式将RGB图像转化为灰度图像;Step 1-1, collect an RGB image including the probe motion area, and convert the RGB image into a grayscale image according to the following formula;

Gray=(R*19595+G*38469+B*7472)>>16Gray=(R*19595+G*38469+B*7472)>>16

其中,R、G、B分别表示RGB图像中的对应的红、绿、蓝三个颜色分量,Gray表示灰度值;Among them, R, G, and B respectively represent the corresponding red, green, and blue color components in the RGB image, and Gray represents the gray value;

步骤1-2、利用SUSAN角点检测算法,对灰度图像进行角点检测,得到包括上、下探针尖点在内的所有角点信息;Step 1-2, using the SUSAN corner detection algorithm to detect the corners of the gray image to obtain all corner information including the sharp points of the upper and lower probes;

角点没有明确的数学定义,但人们普遍认为角点是二维图像亮度变化剧烈的点或图像边缘曲线上曲率极大值的点。探针尖点的检测可以借用图像角点检测的方法,而图像角点的检测方法目前主要有三大类:①基于边界曲线的角点检测方法。此类方法主要是找出图像边缘曲线上的曲率局部极大值点。边缘检测算法的性能将直接影响检测角点的质量,如边缘检测时发生边缘线中断的情况将导致检测出虚假角点。②基于模板的角点检测方法。首先建立一系列具有不同角度的角点模板,然后在一定的窗口内比较待测图像与标准模板之间的相似程度,以此来检测图像中的角点。由于角点结构的复杂性,不可能设计覆盖所有方向和角点的模板,这一类角点检测方法计算量大且比较复杂。③基于图像灰度的角点检测方法,主要是通过计算像素的微分几何特征来进行角点检测,如Harris算法、SUSAN算法、FAST角点检测算法等。There is no clear mathematical definition of the corner point, but it is generally believed that the corner point is the point where the brightness of the two-dimensional image changes sharply or the point where the curvature is the maximum value on the edge curve of the image. The detection of the sharp point of the probe can be borrowed from the image corner detection method, and there are three main types of image corner detection methods: ①The corner detection method based on the boundary curve. This type of method is mainly to find out the local maximum point of curvature on the edge curve of the image. The performance of the edge detection algorithm will directly affect the quality of the detected corners, for example, when the edge line breaks in the edge detection, it will lead to the detection of false corners. ②Template-based corner detection method. Firstly, a series of corner templates with different angles are established, and then the similarity between the image to be tested and the standard template is compared within a certain window to detect the corners in the image. Due to the complexity of the corner structure, it is impossible to design a template covering all directions and corners. This kind of corner detection method is computationally intensive and complicated. ③Corner detection methods based on image grayscale mainly perform corner detection by calculating differential geometric features of pixels, such as Harris algorithm, SUSAN algorithm, FAST corner detection algorithm, etc.

步骤1-3、人工操作,选中上、下探针尖点对应的两个角点;Step 1-3, manual operation, select the two corner points corresponding to the sharp points of the upper and lower probes;

步骤2、实时检测探针尖点:Step 2. Real-time detection of the sharp point of the probe:

步骤2-1、采集第i+1帧包括探针运动区域的RGB图像,将其转化为灰度图像,其中i≥1;Step 2-1, collect the RGB image of the i+1th frame including the probe motion area, and convert it into a grayscale image, where i≥1;

步骤2-2、构建局部感兴趣区域时,仅以上一帧图像中探针尖点的位置为中心,构建一矩形区域作为感兴趣区域。在构建的局部图像中,由于不同图像检测所需的时间不一致,会使得探针的位置会忽高忽低,在探针运动速度较快时,有可能使得探针尖点溢出感兴趣区域,如图11所示。Step 2-2. When constructing a local region of interest, only the position of the tip of the probe in the previous image frame is taken as the center, and a rectangular region is constructed as the region of interest. In the constructed local image, due to the inconsistency of the time required for different image detection, the position of the probe will fluctuate. When the probe moves faster, the tip of the probe may overflow the area of interest. As shown in Figure 11.

然而,若增大感兴趣局域的设置,又会使得计算量增大,不利于图像的实时处理。因此,需要可以根据探针的直线运动和已检测到的探针尖点信息,对下一帧图像中探针尖点的位置,做一个简单的预测,基本保证探针的尖点一直处于感兴趣区域的中心。However, if the setting of the region of interest is increased, the calculation amount will increase, which is not conducive to the real-time processing of the image. Therefore, it is necessary to make a simple prediction of the position of the tip of the probe in the next frame of image based on the linear motion of the probe and the information of the tip of the probe that has been detected, so as to basically ensure that the tip of the probe is always in the sense Center of the region of interest.

虽然探针的运动速度是变化的,但在很短的连续图像时间里,可以进行匀速运动处理。则下一帧的尖点位置可以下式计算Although the moving speed of the probe is variable, it can be processed at a uniform speed in a very short continuous image time. Then the cusp position of the next frame can be calculated by the following formula

当i=1时,以前一帧图像中探针尖点的位置为预测尖点,即P′i+1=Pi;当i≥2时,根据第i-1帧和i帧的灰度图像中探针尖点的位置,通过以下预测公式预测i+1帧图像中的探针尖点位置When i=1, the position of the sharp point of the probe in the previous frame image is the predicted sharp point, that is, P′ i+1 =P i ; when i≥2, according to the grayscale of the i-1th frame and the i frame The position of the tip of the probe in the image, the position of the tip of the probe in the i+1 frame image is predicted by the following prediction formula

P′i+1=Pi(Pi-Pi-1=2Pi-Pi-1P' i+1 =P i (P i -P i-1 =2P i -P i-1 ;

其中,P为探针尖点的坐标向量,P’为探针尖点的预测坐标向量,i为图像的帧数;Wherein, P is the coordinate vector of the tip of the probe, P' is the predicted coordinate vector of the tip of the probe, and i is the frame number of the image;

步骤2-3、以探针尖点预测坐标向量P’为基础,在第i+1帧灰度图像上构建局部感兴趣区域;Step 2-3, based on the predicted coordinate vector P' of the probe cusp, constructing a local region of interest on the grayscale image of the i+1th frame;

步骤2-4、通过对局部感兴趣区域进行SUSAN角点检测,过滤出上、下探针尖点位置;Step 2-4, by performing SUSAN corner point detection on the local region of interest, filter out the sharp point positions of the upper and lower probes;

对整幅图像进行角点检测,如图3所示,由于背景并不是单一颜色,会产生很多检测角点,这对探针尖点P的搜素和筛选带来了困难。考虑到图像中探针尖点仅有两个,构建局部感兴趣区域,如附图4所示。Corner detection is performed on the entire image, as shown in Figure 3, because the background is not a single color, there will be many detection corners, which brings difficulties to the search and screening of the sharp point P of the probe. Considering that there are only two probe sharp points in the image, a local region of interest is constructed, as shown in Figure 4.

图4通过人为指定正确探针尖点P,并在其临域内进行角点检测,可以有效减少背景颜色的干扰。但是在探针的上下运动过程中,由于材料的反光特性以及背景有明显变化,使得常规的角点检测算法时常不能找到探针的尖点P。Figure 4 can effectively reduce the interference of the background color by artificially specifying the correct sharp point P of the probe and performing corner detection in its adjacent area. However, during the up-and-down movement of the probe, due to the significant changes in the reflective properties of the material and the background, the conventional corner detection algorithm often cannot find the sharp point P of the probe.

图5的三个图像分别是Harris、SUSAN和FAST三种角点检测算法对某时刻探针图像的处理结果。The three images in Figure 5 are the processing results of the probe image at a certain moment by three corner detection algorithms, Harris, SUSAN and FAST.

可以看出,三种算法均没有将真正的探针尖点P检测出来。分析图像发现,背景物体存在颜色突变,恰与探针尖点P附近有重合,因此,对于探针尖点的检测,基于图像灰度的角点检测方法就无法得到正确结果。为此,我们再考虑轮廓信息。It can be seen that none of the three algorithms detects the real probe cusp P. Analysis of the image reveals that there is a sudden change in the color of the background object, which coincides with the sharp point P of the probe. Therefore, for the detection of the sharp point of the probe, the corner detection method based on the gray scale of the image cannot obtain correct results. For this, we consider contour information again.

步骤2-5、对过滤出的上、下探针尖点进行距离校验;Step 2-5, performing distance verification on the filtered upper and lower probe sharp points;

距离校验条件1为The distance check condition 1 is

|d(Pup,Pdown)-d0(Pup,Pdown)|<ε1 |d(P up ,P down )-d 0 (P up ,P down )|<ε 1

其中,d(Pup,Pdown)表示i+1帧图像中的上、下探针尖点之间的距离;d0(Pup,Pdown)表示i帧图像中的上、下探针尖点之间的距离;ε1为误差阈值;Among them, d(P up , P down ) represents the distance between the tip points of the upper and lower probes in the i+1 frame image; d 0 (P up , P down ) represents the upper and lower probe points in the i frame image The distance between sharp points; ε 1 is the error threshold;

步骤2-6、判断步骤2-5校验结果,如满足条件1,则转入步骤2-10,否则转步骤2-7;Step 2-6, judging the verification result of step 2-5, if condition 1 is met, then go to step 2-10, otherwise go to step 2-7;

步骤2-7、以Canny算子检测局部感兴趣区域中图像边缘信息,利用Hough变换提取直线轮廓,进一步根据以下规则分别得到上尖点和下尖点对应的圆锥母线:Steps 2-7: Use the Canny operator to detect the edge information of the image in the local region of interest, use the Hough transform to extract the straight line contour, and further obtain the corresponding conic generatrices of the upper and lower cusps according to the following rules:

a)在所提取的直线中,两条探针圆锥母线与图像中X轴夹角大小在60°~80°之间;a) In the extracted straight line, the included angle between the two probe conical generatrices and the X-axis in the image is between 60° and 80°;

b)两条圆锥母线之间的夹角满足θ12分别是两b) The angle between two conical generatrices satisfies θ 1 , θ 2 are two

条探针圆锥母线与图像X轴夹角;The angle between the conical generatrix of the strip probe and the X-axis of the image;

c)圆锥母线交点Q为所有配对成功直线交点的最高点,并且在图像内;c) The intersection point Q of the conical generatrices is the highest point of the intersection points of all successfully paired straight lines, and it is within the image;

探针头部的理想模型是一个圆锥结构(实际头部尖点是一个半径为50um的球状),而视觉图像的拍摄方向与其中心线平行。如果能够检测出两条圆锥母线,计算其相交点,即可认为理想探针尖点Q。在探针运动过程中,理想尖点Q与实际尖点P之间的距离保持不变。图6可以看出P、Q点之间的区别。The ideal model of the probe head is a conical structure (the actual tip of the head is a sphere with a radius of 50um), and the shooting direction of the visual image is parallel to its centerline. If two conical generatrixes can be detected and their intersection point can be calculated, it can be regarded as the ideal probe point Q. During the movement of the probe, the distance between the ideal sharp point Q and the actual sharp point P remains constant. Figure 6 shows the difference between P and Q points.

为了提取探针轮廓线,首先需要对图像进行边缘检测。灰度图像边缘检测的方法主要分为两大类:一阶微分图像边缘检测算子和二阶微分图像边缘检测算子。其中一阶微分边缘检测算子包括:Roberts算子、Sobel算子、Krisch算子、Prewitt算子等,二阶微分边缘检测算子主要有:Laplacian算子、LOG算子;除此之外还有Canny、SUSAN、统计判别等检测方法。In order to extract the contour of the probe, it is first necessary to perform edge detection on the image. The methods of gray image edge detection are mainly divided into two categories: the first-order differential image edge detection operator and the second-order differential image edge detection operator. The first-order differential edge detection operators include: Roberts operator, Sobel operator, Krisch operator, Prewitt operator, etc. The second-order differential edge detection operators mainly include: Laplacian operator, LOG operator; There are detection methods such as Canny, SUSAN, and statistical discrimination.

图7是几种方法对探针局部图像边缘检测的结果。Figure 7 shows the results of several methods for detecting the edge of the local image of the probe.

效果上来看,三个算子的效果都不错,但Sobel算子和Prewitt算子检测出的边缘会出现多像素宽度,对与后面的轮廓检测求圆锥母线交点会产生一定误差。而Canny算子的边缘较清晰,能够精确定位探针轮廓。Canny算子的基本思想是:首先对图像选择一定的Gauss滤波器进行平滑滤波,然后采用非极值抑制技术进行处理得到最后的边缘图像。其步骤为;From the effect point of view, the effects of the three operators are all good, but the edges detected by the Sobel operator and the Prewitt operator will have a multi-pixel width, and there will be a certain error in finding the intersection point of the conic generatrix with the subsequent contour detection. The edge of the Canny operator is clearer, which can precisely locate the outline of the probe. The basic idea of Canny operator is: first select a certain Gauss filter to smooth the image, and then use non-extreme value suppression technology to process to obtain the final edge image. The steps are;

a)用Gauss滤波器平滑图像。a) Smooth the image with a Gauss filter.

这里用一个省略系数的高斯函数H(x,y):Here a Gaussian function H(x,y) with omitted coefficients is used:

Hh (( xx ,, ythe y )) == expexp (( -- xx 22 ++ ythe y 22 22 σσ 22 ))

G(x,y)=f(x,y)*H(x,y)G(x,y)=f(x,y)*H(x,y)

其中f(x,y)是图像数据。where f(x,y) is the image data.

b)用一阶偏导的有限差分来计算梯度的幅值和方向。b) Calculate the magnitude and direction of the gradient using finite differences of the first order partial derivatives.

利用一阶差分卷积模版:Use the first-order difference convolution template:

Hh 11 == -- 11 -- 11 11 11

Hh 22 == 11 -- 11 11 -- 11

可以得到:can get:

幅值: Amplitude:

方向: direction:

c)对梯度幅值进行非极大值抑制。c) Perform non-maximum suppression on the gradient magnitude.

仅仅得到全局的梯度并不足以确定边缘。为确定边缘,必须保留局部梯度最大的点,而抑制非极大值,即将非局部极大值点置零以得到细化的边缘。Just getting the global gradient is not enough to identify edges. In order to determine the edge, the point with the largest local gradient must be retained, and the non-maximum value must be suppressed, that is, the non-local maximum value point is set to zero to obtain a refined edge.

如图8所示,4个扇区的标号为0到3,对应3×3邻域的4种可能组合。在每一点上,邻域的中心像素M与沿着梯度线的两个像素相比。如果M的梯度值不比沿梯度线的两个相邻像素梯度值大,则令M=0。As shown in Fig. 8, the 4 sectors are numbered from 0 to 3, corresponding to 4 possible combinations of 3×3 neighborhoods. At each point, the central pixel M of the neighborhood is compared to the two pixels along the gradient line. If the gradient value of M is not greater than the gradient values of two adjacent pixels along the gradient line, let M=0.

d)用双阈值算法检测和连接边缘。d) Detect and connect edges with a dual-threshold algorithm.

使用两个阈值T1和T2(T1<T2),从而可以得到两个阈值边缘图像N1[i,j]和N2[i,j]。由于N2[i,j]使用高阈值得到,因而含有很少的假边缘,但有间断(不闭合)。双阈值法要在N2[i,j]中把边缘连接成轮廓,当到达轮廓的端点时,该算法就在N1[i,j]的8个邻点位置寻找可以连接到轮廓上的边缘,这样,算法不断在N1[i,j]中收集边缘,直到将N2[i,j]连接起来为止。T2用来找到每条线段,T1用来在这些线段的两个方向上延伸寻找边缘的断裂处,并连接这些边缘。Using two thresholds T 1 and T 2 (T 1 <T 2 ), two threshold edge images N 1 [i,j] and N 2 [i,j] can be obtained. Since N 2 [i,j] is obtained with a high threshold, it contains few false edges, but there are discontinuities (not closed). The double-threshold method needs to connect the edges into a contour in N 2 [i, j]. When the end point of the contour is reached, the algorithm searches for edges that can be connected to the contour at the 8 adjacent points of N 1 [i, j]. , so that the algorithm keeps collecting edges in N 1 [i, j] until N 2 [i, j] is connected. T 2 is used to find each line segment, and T 1 is used to extend in both directions of these line segments to find edge breaks and connect these edges.

在利用Canny算子得到图像的边缘后,需要提取我们所关心的探针轮廓,即两条圆锥母线。一般直线轮廓提取的方法,以Hough变换为主。直线Hough变换采用“投票”的思想来检测数字图像中的直线或线段,它是一个图像处理和直线检测的经典算法。平面中的任意一条直线都可以用ρ和θ两个参数来确定。其中ρ确定了直线到原点的距离,θ确定了直线的方位。其函数关系为After using the Canny operator to get the edge of the image, we need to extract the probe outline we care about, that is, the two conic generatrices. Generally, the method of linear contour extraction is mainly based on Hough transform. Straight line Hough transform uses the idea of "voting" to detect straight lines or line segments in digital images. It is a classic algorithm for image processing and line detection. Any straight line in the plane can be determined by two parameters ρ and θ. Among them, ρ determines the distance from the line to the origin, and θ determines the orientation of the line. Its functional relationship is

ρ=xcosθ+ysinθx∈[0,π]ρ=xcosθ+ysinθx∈[0,π]

图像空间中的每一点(xi,yi)映射到Hough空间中的一组累加器C(ρ,θ),即所谓的投票过程,C(ρ,θ)表示图像空间中符合式(2)的像素数。投票结束后,C(ρ,θ)的每一个局部最大值就对应一直线段,即对应的ρ和θ可以唯一地确定这条直线。图9是Hough变换后的结果。Each point ( xi , y ) in the image space is mapped to a set of accumulators C(ρ, θ) in the Hough space, which is the so-called voting process. ) of pixels. After the voting is over, each local maximum of C(ρ, θ) corresponds to a straight line segment, that is, the corresponding ρ and θ can uniquely determine this straight line. Figure 9 is the result after Hough transformation.

分析该局部图像特点:a)在所提取的直线中,两条探针圆锥母线与图像中X轴夹角基本一致,且大小在60°~80°之间,这就意味着θ12∈[π/3,4π/9];b)两条圆锥母线之间的夹角根据出厂报告可知在45°左右,即其斜率近似为1。根据夹角公式设定检测条件:Analyze the characteristics of the local image: a) In the extracted straight line, the angle between the two probe conical generatrices and the X-axis in the image is basically the same, and the size is between 60° and 80°, which means that θ 1 , θ 2 ∈ [π/3,4π/9]; b) The angle between the two conical bus bars is about 45° according to the factory report, that is, the slope is approximately 1. Set the detection conditions according to the angle formula:

0.90.9 << || tan&theta;tan&theta; 11 -- tan&theta;tan&theta; 22 11 ++ tan&theta;tan&theta; 11 tan&theta;tan&theta; 22 || << 1.51.5

可以过滤得到两条所求的圆锥母线。再对提取出来的圆锥母线,进行延伸,找到理想探针尖点Q,如图10所示。当然还需要加上一条校验条件c)圆锥母线交点Q为所有配对成功直线交点的最高点,并且在图像内。It can be filtered to obtain the two conical generatrixes sought. Then extend the extracted conical generatrix to find the ideal probe point Q, as shown in Figure 10. Of course, a verification condition needs to be added c) The intersection point Q of the conical generatrices is the highest point of the intersection points of all paired successful straight lines, and it is within the image.

至此,就检测出了理想探针尖点Q。理想情况下,探针的上、下针尖连线,既可以用L(Pup,Pdown)表示,也可以用L(Qup,Qdown)表示,两条直线是重合的。但是由于实际的加工误差,两条直线不可能完全重合。而在测量过程,接触点为实际尖点,这就使得P点的可靠性要高于Q点。因此,在尖点检测时,也采取L(Pup,Pdown)为主,L(Qup,Qdown)为辅的策略。So far, the ideal probe tip Q has been detected. Ideally, the line connecting the upper and lower needle points of the probe can be represented by L(P up , P down ) or L(Q up , Q down ), and the two straight lines are coincident. However, due to actual processing errors, the two straight lines cannot be completely coincident. In the measurement process, the contact point is the actual sharp point, which makes the reliability of the P point higher than that of the Q point. Therefore, in the cusp detection, the strategy of L(P up , P down ) as the main and L(Q up , Q down ) as the auxiliary is also adopted.

步骤2-8、根据所得上尖点和下尖点对应的圆锥母线,计算上、下轮廓交点,并进行距离校验;Step 2-8, calculate the intersection point of the upper and lower contours according to the conical generatrices corresponding to the obtained upper and lower cusps, and perform distance verification;

距离校验条件2为The distance check condition 2 is

|d(Qup,Qdown)-d0(Qup,Qdown)|<ε2 |d(Q up ,Q down )-d 0 (Q up ,Q down )|<ε 2

其中,d(Qup,Qdown)表示当前帧图像中的上、下探针尖点之间的距离;d0(Qup,Qdown)表示前一帧图像中的上、下探针尖点之间的距离;ε2为误差阈值;Among them, d(Q up , Q down ) represents the distance between the upper and lower probe tip in the current frame image; d 0 (Q up , Q down ) represents the upper and lower probe tip in the previous frame image The distance between points; ε 2 is the error threshold;

步骤2-9、判断步骤2-8校验结果,如满足条件2,则根据上一帧图像中理想探针尖点Q0与P0的距离以及当前帧图像中理想探针尖点Q,按下式计算当前帧中实际探针尖点P。Step 2-9, judging the verification result of step 2-8, if condition 2 is satisfied, according to the distance between the ideal probe point Q0 and P0 in the previous frame image and the ideal probe point Q in the current frame image, Calculate the actual tip point P of the probe in the current frame according to the formula.

P=Q+P0-Q0,转入步骤2-10;P=Q+P 0 -Q 0 , turn to step 2-10;

转入步骤2-10;Go to steps 2-10;

若条件2亦不满足,则认为当前帧图像检测失败,测量数据点不存入数据库中,转步骤2-1;If condition 2 is not satisfied, it is considered that the current frame image detection fails, and the measurement data points are not stored in the database, and go to step 2-1;

步骤2-10记录上、下探针尖点的位置及其连线斜率k;Step 2-10 records the positions of the sharp points of the upper and lower probes and the slope k of the connecting line;

步骤3、计算旋转偏差角度Step 3. Calculate the rotation deviation angle

步骤3-1、分别拟合探针上、下尖点位置,求出探针运动直线,具体过程如下;Step 3-1. Fit the positions of the upper and lower sharp points of the probe respectively, and obtain the motion straight line of the probe. The specific process is as follows;

探针一次上、下运动捕获的视频序列中,若检测出的有效探针尖点数为N,利用线性回归方程In the video sequence captured by the probe's up and down motion, if the number of effective probe points detected is N, use the linear regression equation

kk Mm == &Sigma;&Sigma; ii == 11 NN (( xx ii -- xx &OverBar;&OverBar; )) (( ythe y ii -- ythe y &OverBar;&OverBar; )) &Sigma;&Sigma; ii == 11 NN (( xx ii -- xx &OverBar;&OverBar; )) 22 == &Sigma;&Sigma; ii == 11 NN xx ii ythe y ii -- NN xx ythe y &OverBar;&OverBar; &Sigma;&Sigma; ii == 11 NN xx ii 22 -- NN xx &OverBar;&OverBar; 22

求出探针运动直线;其中,kM为运动直线的斜率;xi,yi分别为第i帧图像中探针尖点的横、纵坐标; Find the straight line of the probe motion; where, k M is the slope of the straight line of motion; x i , y i are the abscissa and ordinate of the tip point of the probe in the i-th frame image respectively;

步骤3-2、根据每帧图像中的上、下探针尖点位置,求出各帧图像中探针所在直线方向;即Step 3-2, according to the positions of the sharp points of the upper and lower probes in each frame of image, the direction of the straight line where the probe is located in each frame of image is obtained; that is

kk ii == ythe y uu pp -- ythe y dd oo ww nno xx uu pp -- xx dd oo ww nno ,, (( ii == 11 ,, 2...2... ,, NN ))

其中,ki为第i帧图像中,探针上、下尖点的连线斜率;(xup,yup)为上探针尖点坐标,(xdown,ydown)为下探针尖点坐标;Among them, k i is the slope of the line connecting the upper and lower sharp points of the probe in the i-th frame image; (x up , y up ) is the coordinates of the upper probe sharp point, (x down , y down ) is the lower probe tip point coordinates;

探针上、下尖点连线斜率k的均值为The average slope k of the line connecting the upper and lower sharp points of the probe is

kk LL == &Sigma;&Sigma; ii == 11 NN kk ii NN

利用探针上、下尖点连线平均斜率kL得到一条上、下尖点的拟合直线;Utilize the average slope k L of the line connecting the upper and lower sharp points of the probe to obtain a fitting straight line of the upper and lower sharp points;

步骤3-3、计算探针运动直线与上、下尖点拟合直线的夹角θStep 3-3. Calculate the angle θ between the straight line of the probe motion and the fitting line of the upper and lower sharp points

&theta;&theta; == aa tt aa nno || kk LL -- kk Mm 11 ++ kk LL kk Mm ||

θ即为旋转偏差角度。θ is the rotation deviation angle.

Claims (1)

1., to a visible detection method for the X-axis rotating deviation of single needle scan-type screw measurement instrument measuring probe, it is characterized in that, comprise following process:
Step 1, initialization are demarcated:
Step 1-1, collection the 1st frame comprise the RGB image in probe motion region, according to following formula, RGB image are converted into gray level image;
Gray=(R*19595+G*38469+B*7472)>>16
Wherein, R, G, B represent red, green, blue three color components of the correspondence in RGB image respectively, and Gray represents gray-scale value;
Step 1-2, utilize SUSAN Corner Detection Algorithm, Corner Detection is carried out to gray level image, obtains all angle point informations comprising upper and lower probe cusp;
Step 1-3, manual operation, choose two angle points that upper and lower probe cusp is corresponding;
Step 2, in real time detector probe cusp:
Step 2-1, collection the i-th+1 frame comprise the RGB image in probe motion region, are translated into gray level image, wherein i >=1;
Step 2-2, as i=1, with the position of previous frame image middle probe cusp for prediction cusp, i.e. P ' i+1=P i; When i>=2, according to the position of the gray level image middle probe cusp of the i-th-1 frame and i frame, by the probe position of cusp in following predictor formula prediction i+1 two field picture;
P′ i+1=P i+(P i-P i-1)=2P i-P i-1
Wherein, P is the coordinate vector of probe cusp, the prediction coordinate vector that P ' is probe cusp, and i is the frame number of image;
Step 2-3, based on probe pinpoint point prediction coordinate vector P ', the i-th+1 frame gray level image builds local region of interest;
Step 2-4, by carrying out SUSAN Corner Detection to local region of interest, filter out upper and lower probe position of cusp;
Step 2-5, the upper and lower probe cusp filtered out carried out to distance verification;
Distance verification condition 1 is
|d(P up,P down)-d 0(P up,P down)|<ε 1
Wherein, d (P up, P down) represent in i+1 two field picture between upper and lower probe cusp distance; d 0(P up, P down) represent in i two field picture between upper and lower probe cusp distance; ε 1for error threshold;
Step 2-6, determining step 2-5 check results, as satisfied condition 1, then proceed to step 2-10, otherwise go to step 2-7;
Step 2-7, detect image edge information in local region of interest with Canny operator, utilize Hough transform to extract outline of straight line, obtain upper cusp and element of cone corresponding to lower cusp respectively according to following rule further:
A) in extracted straight line, in two probe element of cones and image, X-axis corner dimension is between 60 ° ~ 80 °;
B) angle between two element of cones meets θ 1, θ 2two probe element of cones and image X-axis angle respectively;
C) element of cone intersection point Q is the peak of all successful matching straight-line intersections, and in image;
Step 2-8, according to cusp on gained and element of cone corresponding to lower cusp, calculate upper and lower profile intersection point, row distance of going forward side by side verifies;
Distance verification condition 2 is
|d(Q up,Q down)-d 0(Q up,Q down)|<ε 2
Wherein, d (Q up, Q down) represent in current frame image between upper and lower probe cusp distance; d 0(Q up, Q down) represent in previous frame image between upper and lower probe cusp distance; ε 2for error threshold;
Step 2-9, determining step 2-8 check results, as satisfied condition 2, then according to previous frame image middle ideal probe cusp Q 0with P 0distance and current frame image middle ideal probe cusp Q, be calculated as follows actual probes cusp P in present frame;
P=Q+P 0-Q 0, proceed to step 2-10;
If condition 2 does not also meet, then think that current frame image detects unsuccessfully, measurement data points stored in database, does not go to step 2-1;
Step 2-10 records position and the line slope k thereof of upper and lower probe cusp;
Step 3, calculating deviation angle
Step 3-1, the respectively upper and lower position of cusp of sniffing probe, obtain probe motion straight line, detailed process is as follows:
In the video sequence of probe once upper and lower capturing movement, if the effective probe pinpoint dot image number detected is N, utilize equation of linear regression
k M = &Sigma; i = 1 N ( x i - x &OverBar; ) ( y i - y &OverBar; ) &Sigma; i = 1 N ( x i - x &OverBar; ) 2 = &Sigma; i = 1 N x i y i - N x y &OverBar; &Sigma; i = 1 N x i 2 - N x &OverBar; 2
Obtain probe motion straight line; Wherein, k mfor the slope of line of motion; x i, y ibe respectively horizontal stroke, the ordinate of the i-th two field picture middle probe cusp; x &OverBar; = &Sigma; i = 1 N x i N , y &OverBar; = &Sigma; i = 1 N y i N ,
Step 3-2, according to the upper and lower probe position of cusp in every two field picture, obtain each two field picture middle probe place rectilinear direction; Namely
k i = y u p - y d o w n x u p - x d o w n , i = 1 , 2 ... , N
Wherein, k ibe in the i-th two field picture, the line slope of the upper and lower cusp of probe; (x up, y up) be upper probe pinpoint point coordinate, (x down, y down) be lower probe pinpoint point coordinate;
The average of probe upper and lower cusp line slope k is
k L = &Sigma; i = 1 N k i N
Utilize probe upper and lower cusp line average gradient k lobtain the fitting a straight line of a upper and lower cusp;
The angle theta of step 3-3, calculating probe motion straight line and upper and lower cusp fitting a straight line
&theta; = a t a n | k L - k M 1 + k L k M |
θ is deviation angle.
CN201310217418.3A 2013-06-03 2013-06-03 The visible detection method of single needle scan-type screw measurement instrument probe X-axis rotating deviation Expired - Fee Related CN103337067B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310217418.3A CN103337067B (en) 2013-06-03 2013-06-03 The visible detection method of single needle scan-type screw measurement instrument probe X-axis rotating deviation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310217418.3A CN103337067B (en) 2013-06-03 2013-06-03 The visible detection method of single needle scan-type screw measurement instrument probe X-axis rotating deviation

Publications (2)

Publication Number Publication Date
CN103337067A CN103337067A (en) 2013-10-02
CN103337067B true CN103337067B (en) 2016-03-02

Family

ID=49245215

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310217418.3A Expired - Fee Related CN103337067B (en) 2013-06-03 2013-06-03 The visible detection method of single needle scan-type screw measurement instrument probe X-axis rotating deviation

Country Status (1)

Country Link
CN (1) CN103337067B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109102507A (en) * 2018-08-28 2018-12-28 珠海格力智能装备有限公司 Screw thread detection method and device
CN109785338A (en) * 2018-12-26 2019-05-21 汕头大学 The online visible sensation method of screw thread critical size parameter under a kind of movement background
CN110243297B (en) * 2019-06-13 2020-08-04 上海交通大学 Pipe thread pitch diameter measurement correction method, system and medium based on image measurement
CN110849287B (en) * 2019-11-27 2021-05-25 陕西理工大学 A machine vision thread profile angle compensation method
CN114820620B (en) * 2022-06-29 2022-09-13 中冶建筑研究总院(深圳)有限公司 Bolt loosening defect detection method, system and device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0932017A1 (en) * 1998-01-22 1999-07-28 Reginald Galestien Method and device for measuring workpieces having internal and/or external screw thread or similar grooves
CN101126619A (en) * 2006-08-17 2008-02-20 汉中万目仪电有限责任公司 Oil pipe thread, internal thread, pitch diameter measuring device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0932017A1 (en) * 1998-01-22 1999-07-28 Reginald Galestien Method and device for measuring workpieces having internal and/or external screw thread or similar grooves
CN101126619A (en) * 2006-08-17 2008-02-20 汉中万目仪电有限责任公司 Oil pipe thread, internal thread, pitch diameter measuring device

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
Development of an Algorithm to Detect Screw Threads in Planar Point Clouds;Sergey Kosarevsky等;《MEASUREMENT SCIENCE REVIEW》;20101231;第10卷(第4期);第136-141页 *
Yong Zhao等.Single-mode ?ber-based re¯ex sensor for internal surface in-line measurement of small products.《Sensors and Actuators A》.2002,第30-36页. *
基于动态线性 回归的一阶导数分段法在螺纹检测数据处理中的应用;周强等;《北京工业大学学报》;20001231;第26卷(第4期);第20-23页 *
高精度接触式螺纹测量仪软件系统的设计与开发;范一保;《万方学位论文》;20120302;第25-46页 *

Also Published As

Publication number Publication date
CN103337067A (en) 2013-10-02

Similar Documents

Publication Publication Date Title
CN108921176B (en) Pointer instrument positioning and identifying method based on machine vision
CN109612390B (en) Large-size workpiece automatic measuring system based on machine vision
CN109060836B (en) Machine vision-based high-pressure oil pipe joint external thread detection method
CN102496161B (en) Method for extracting contour of image of printed circuit board (PCB)
CN109900711A (en) Workpiece defect detection method based on machine vision
CN106824806B (en) The detection method of low module plastic gear based on machine vision
CN106546263B (en) A laser level detection method based on machine vision
CN110119680A (en) A kind of electrical cabinet wiring automatic errordetecting system based on image recognition
CN103337067B (en) The visible detection method of single needle scan-type screw measurement instrument probe X-axis rotating deviation
CN102901444B (en) Method for detecting component size based on matching pursuit (MP) wavelet filtering and detecting system thereof
CN106197612B (en) A liquid level detection method for transparent bottles based on machine vision
CN105865344A (en) Workpiece dimension measuring method and device based on machine vision
CN107014819A (en) A kind of solar panel surface defects detection system and method
CN103454285A (en) Transmission chain quality detection system based on machine vision
CN106651828A (en) Product dimension sub-pixel measurement method under industrial microscale motion blurred imaging condition
CN102441581A (en) Device and method for online detection of section size of profile steel based on machine vision
CN113340909B (en) Glue line defect detection method based on machine vision
CN108257171A (en) Car radar assembling aperture detection method based on light vision
WO2021179400A1 (en) Computer vision-based adaptive measurement system and method for geometric parameters in assembly process
CN110473184A (en) A kind of pcb board defect inspection method
CN105184792B (en) A kind of saw blade wear extent On-line Measuring Method
CN113705564A (en) Pointer type instrument identification reading method
CN107388991A (en) A kind of more fillet axial workpiece radius of corner measuring methods in end face
CN106815830A (en) The defect inspection method of image
CN218504096U (en) Constant force control polishing tool with intelligent recognition and weld joint detection functions

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20160302