CN101033958A - Mechanical vision locating method - Google Patents
Mechanical vision locating method Download PDFInfo
- Publication number
- CN101033958A CN101033958A CN 200710051446 CN200710051446A CN101033958A CN 101033958 A CN101033958 A CN 101033958A CN 200710051446 CN200710051446 CN 200710051446 CN 200710051446 A CN200710051446 A CN 200710051446A CN 101033958 A CN101033958 A CN 101033958A
- Authority
- CN
- China
- Prior art keywords
- image
- distance
- camera
- coordinates
- actual
- 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 32
- 238000003384 imaging method Methods 0.000 claims abstract description 33
- 238000001514 detection method Methods 0.000 claims abstract description 9
- 230000009466 transformation Effects 0.000 claims description 11
- 229910000679 solder Inorganic materials 0.000 description 12
- 238000000605 extraction Methods 0.000 description 4
- 238000007689 inspection Methods 0.000 description 4
- 238000003466 welding Methods 0.000 description 4
- 230000011218 segmentation Effects 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 238000010147 laser engraving Methods 0.000 description 2
- 238000004519 manufacturing process Methods 0.000 description 2
- 238000005259 measurement Methods 0.000 description 2
- 238000000691 measurement method Methods 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 230000005856 abnormality Effects 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 238000005520 cutting process Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 238000005553 drilling Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000009776 industrial production Methods 0.000 description 1
- 238000003698 laser cutting Methods 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
- 230000003252 repetitive effect Effects 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 238000005476 soldering Methods 0.000 description 1
- 238000002187 spin decoupling employing ultra-broadband-inversion sequences generated via simulated annealing Methods 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
Images
Landscapes
- Length Measuring Devices By Optical Means (AREA)
- Image Analysis (AREA)
Abstract
本发明公开了一种机器视觉定位方法,采用两个普通摄像头共同完成检测任务,包括用于摄取目标物体的全局图像的远距离摄像头和用于摄取感兴趣部位的近距离图像的近距离摄像头。先对远距离摄像头标定,并确定近距离摄像头成像平面上的像素距离与实际物理距离之间的比例关系;利用远距离摄像头拍摄目标物体图像,并确定感兴趣部位中心的图像坐标和实际坐标;利用机械手移动近距离摄像头到感兴趣部位中心位置,获取图像并确定其图像坐标和实际坐标,得到该部位的实际精确位置、形状、大小等信息。本发明利用两个普通摄像头高精度地获得目标物体局部感兴趣部位的细节信息,以很低的成本来实现机器视觉工业应用的高精度要求。
The invention discloses a machine vision positioning method, which adopts two ordinary cameras to jointly complete the detection task, including a long-distance camera for taking a global image of a target object and a short-distance camera for taking a short-distance image of an interested part. First calibrate the long-distance camera, and determine the proportional relationship between the pixel distance on the imaging plane of the short-distance camera and the actual physical distance; use the long-distance camera to capture the image of the target object, and determine the image coordinates and actual coordinates of the center of the interested part; Use the manipulator to move the close-range camera to the center of the part of interest, acquire the image and determine its image coordinates and actual coordinates, and obtain the actual precise position, shape, size and other information of the part. The invention utilizes two ordinary cameras to obtain the detailed information of the local interested part of the target object with high precision, and realizes the high-precision requirement of the industrial application of machine vision at a very low cost.
Description
技术领域technical field
本发明属于机器视觉在工业上的应用领域,具体涉及一种机器视觉定位方法,该方法利用两个普通摄像头高精度地获得较大场景内的目标物体局部感兴趣部位的细节信息,如线段精确长度、焊点具体位置等。The invention belongs to the application field of machine vision in industry, and specifically relates to a machine vision positioning method, which utilizes two ordinary cameras to obtain detailed information of local interest parts of a target object in a large scene with high precision, such as accurate line segment Length, specific location of solder joints, etc.
背景技术Background technique
在现代工业自动化生产中,越来越多地应用到机器视觉技术,涉及到各种各样的检查、测量和加工,例如激光雕刻、印刷电路板管脚焊接、激光打孔、商标裁剪等。这类应用的共同点是需要连续大批量生产,对产品的质量有很高的要求。这种工作带有高度的重复性,通常由人工检测来完成。In modern industrial automation production, more and more machine vision technology is applied, involving various inspection, measurement and processing, such as laser engraving, printed circuit board pin welding, laser drilling, trademark cutting, etc. What these applications have in common is the need for continuous mass production and high requirements for product quality. This kind of work is highly repetitive and is usually done by manual inspection.
如果单纯地靠增加检测工人数目来完成这道工序,势必会给工厂增加巨大的人工成本和管理成本,并且,由于人眼长时间做同一件事情会出现疲劳,增加检错的概率,故而仍然不能保证100%的检测合格率。因此,把机器视觉技术引入到工业生产中存在巨大的价值。If this process is completed simply by increasing the number of testing workers, it will inevitably increase the factory's huge labor and management costs. Moreover, because the human eye will be fatigued after doing the same thing for a long time, the probability of error detection will increase, so it is still A 100% inspection pass rate cannot be guaranteed. Therefore, there is great value in introducing machine vision technology into industrial production.
目前,针对平面物体的测量或者检测的研究基本都采用一个摄像头,如中国专利文献基于单幅图像的平面测量方法(其公开号为CN1427245,公开日为2003.07.02)和基于平行线的单视平面测量方法(其公开号为CN1427246,公开日为2003.07.02),但由于摄像头需要检测一个较大的区域,当同时需要对整个区域的某些局部感兴趣部位进行精确观察并实时对这些部分进行必要处理时,比如对电路板焊点进行较细致的检测并焊接时,那么就需要一个高质量的摄像头,否则就无法对局部感兴趣部位进行精确分析,这样必然会使设备成本偏高。At present, research on the measurement or detection of planar objects basically uses a camera, such as the planar measurement method based on a single image in Chinese patent documents (its publication number is CN1427245, and the publication date is 2003.07.02) and the single-view method based on parallel lines Plane measurement method (its public number is CN1427246, and the public date is 2003.07.02), but because the camera needs to detect a larger area, when it is necessary to accurately observe some local interested parts of the entire area and real-time monitor these parts When performing necessary processing, such as more detailed detection and soldering of circuit board solder joints, a high-quality camera is required, otherwise it will not be possible to accurately analyze local parts of interest, which will inevitably increase the cost of the equipment.
现有的工业界的机器视觉应用,要么检测精度不够高,要么为了达到高精度而增加设备的成本。目前,工业界主要采用一个高质量的摄像头来对流水线上的产品进行检测,这样整套设备就较昂贵。本发明可以在保证同等高精度的同时,降低摄像头部分的设备成本,尤其适用于需要使用机械手在被测目标平面上运动的应用系统,如激光雕刻、激光切割、机械焊接等系统。Existing machine vision applications in the industry, either the detection accuracy is not high enough, or the cost of equipment is increased in order to achieve high accuracy. At present, the industry mainly uses a high-quality camera to detect products on the assembly line, so the whole set of equipment is relatively expensive. The invention can reduce the equipment cost of the camera part while ensuring the same high precision, and is especially suitable for application systems that need to use a manipulator to move on the measured target plane, such as laser engraving, laser cutting, mechanical welding and other systems.
发明内容Contents of the invention
本发明的目的在于提供一种机器视觉定位方法,该方法可以以低廉的设备成本,来获取目标物体局部感兴趣位置的高精度信息。The purpose of the present invention is to provide a machine vision positioning method, which can obtain high-precision information of the local interest position of the target object with low equipment cost.
本发明提供的机器视觉定位方法,采用两个普通摄像头共同完成检测任务,其中,一个为位置固定的摄像头,离被测目标平面距离较远,用于摄取目标物体的全局图像,称为远距离摄像头;另一个固定在机械手上,离被测目标平面距离较近,可以在被测目标平面上运动,用于摄取目标物体感兴趣部位的近距离图像,称为近距离摄像头。其步骤包括:The machine vision positioning method provided by the present invention uses two ordinary cameras to jointly complete the detection task, one of which is a camera with a fixed position, which is far away from the measured target plane, and is used to capture the global image of the target object, which is called long-distance Camera; the other is fixed on the manipulator, which is closer to the measured target plane and can move on the measured target plane to capture close-range images of the interested parts of the target object, called a close-range camera. Its steps include:
(1)对远距离摄像头进行标定,确定其成像平面与被测目标平面之间的对应坐标转换关系,并确定近距离摄像头成像平面上的像素距离与实际物理距离之间的比例关系;(1) Calibrate the long-distance camera, determine the corresponding coordinate transformation relationship between its imaging plane and the measured target plane, and determine the proportional relationship between the pixel distance on the imaging plane of the short-distance camera and the actual physical distance;
(2)将待检测的目标物体放置在被测目标平面上,用远距离摄像头拍摄一张包含该目标物体的全局图像;(2) Place the target object to be detected on the measured target plane, and take a global image containing the target object with a long-distance camera;
(3)在所拍摄的全局图像上确定目标物体上的感兴趣部位,并记下感兴趣部位中心的图像坐标(ui1,vi1),i=1,...,m,共m个感兴趣部位,其中,m≥1;(3) Determine the part of interest on the target object on the captured global image, and record the image coordinates (u i1 , v i1 ) of the center of the part of interest, i=1,..., m, a total of m Part of interest, where m≥1;
(4)根据步骤(1)得到的远距离摄像头成像平面与被测目标平面之间的对应坐标转换关系,将步骤(3)记下的感兴趣部位中心的图像坐标转换为实际坐标(xi1,yi1),i=1,...,m;(4) According to the corresponding coordinate transformation relationship between the long-distance camera imaging plane and the measured target plane obtained in step (1), convert the image coordinates of the center of the part of interest recorded in step (3) into actual coordinates (x i1 , y i1 ), i=1,..., m;
(5)利用机械手移动近距离摄像头到感兴趣部位中心的实际坐标处,感兴趣部位的中心位置与近距离摄像头成像平面中心相重合,拍摄该部位的近距离图像;(5) Utilize the manipulator to move the close-range camera to the actual coordinates of the center of the part of interest, the center of the part of interest coincides with the center of the imaging plane of the close-range camera, and take a close-range image of the part;
(6)在上述感兴趣部位的近距离图像中确定感兴趣部位的图像坐标,利用步骤(1)得到的近距离摄像头成像平面上的像素距离与实际物理距离之间的比例关系,将上述感兴趣部位的近距离图像的图像坐标转化为实际坐标,得到该感兴趣部位的实际信息。(6) Determine the image coordinates of the interested part in the short-range image of the above-mentioned interested part, and use the proportional relationship between the pixel distance on the close-range camera imaging plane obtained in step (1) and the actual physical distance to convert the above sense The image coordinates of the close-range image of the part of interest are converted into actual coordinates, and the actual information of the part of interest is obtained.
本发明利用多项式标定方法对远距离摄像头进行标定,消除了摄像头的径向畸变、切向畸变等畸变影响,能够比较准确地确定成像平面与被测目标平面之间的对应坐标转换关系;然后利用机械手移动近距离摄像头到感兴趣部位中心进一步精确确定目标物体的感兴趣部位的细节信息,可以根据实际应用需要对获得的细节信息作进一步处理。由于普通摄像头价格低廉,使用两个摄像头,与使用一个摄像头相比,成本相似,检测的精度却大大提高;并且,与使用高精度昂贵的单摄像头机器视觉系统相比,成本要低很多。The present invention uses the polynomial calibration method to calibrate the long-distance camera, which eliminates the distortion effects of the camera such as radial distortion and tangential distortion, and can accurately determine the corresponding coordinate transformation relationship between the imaging plane and the measured target plane; then use The manipulator moves the close-range camera to the center of the part of interest to further accurately determine the detailed information of the part of interest of the target object, and further process the obtained detailed information according to the needs of practical applications. Due to the low price of ordinary cameras, the cost of using two cameras is similar to that of using one camera, but the detection accuracy is greatly improved; and, compared with the use of high-precision and expensive single-camera machine vision systems, the cost is much lower.
附图说明Description of drawings
图1为本发明机器视觉定位方法的流程图;Fig. 1 is the flowchart of machine vision positioning method of the present invention;
图2为本发明远距离摄像头所使用的平面标定板图像;Fig. 2 is the image of the plane calibration plate used by the long-distance camera of the present invention;
图3为本发明近距离摄像头所使用的模板图像;Fig. 3 is the template image used by the close-range camera of the present invention;
图4为本发明实施例标定板图像特征提取结果图。Fig. 4 is a diagram of the image feature extraction results of the calibration plate according to the embodiment of the present invention.
具体实施方式Detailed ways
本发明的基本原理为:利用两个摄像头,其中,远距离摄像头针对目标物体整体进行处理,拍摄目标物体的全局图像,在拍摄的全局图像上检测出感兴趣的部位(随应用场合需要而定);然后控制机械手移动近距离摄像头到这些感兴趣部位,拍摄高精度的图像做进一步细致的检测分析。The basic principle of the present invention is: use two cameras, wherein, the long-distance camera processes the target object as a whole, shoots the global image of the target object, and detects the interesting part on the captured global image (depending on the needs of the application) ); and then control the manipulator to move the close-range camera to these parts of interest, and take high-precision images for further detailed detection and analysis.
下面结合附图和实例对本发明的技术方案作进一步的详细说明。The technical solutions of the present invention will be further described in detail below in conjunction with the accompanying drawings and examples.
如图1所示,本发明机器视觉定位方法包括以下步骤:As shown in Figure 1, the machine vision positioning method of the present invention comprises the following steps:
(1)对远距离摄像头进行标定,确定其成像平面与被测目标平面之间的对应坐标转换关系;并确定近距离摄像头成像平面上的像素距离与实际物理距离之间的比例关系;(1) Calibrate the long-distance camera, determine the corresponding coordinate transformation relationship between its imaging plane and the measured target plane; and determine the proportional relationship between the pixel distance on the imaging plane of the short-distance camera and the actual physical distance;
(A)对远距离摄像头进行标定的过程为:(A) The process of calibrating the long-distance camera is:
(A1)获取标定板图像:将制作好的标定板图像放置在被测目标物体所在平面中,尽量让标定板充满整个远距离摄像头取景区域,利用远距离摄像头拍摄一张标定板图像;标定板可以采用类似于国际象棋棋盘的图像、圆阵列等特征明显并已知实际尺寸的图像;(A1) Obtain the calibration board image: place the prepared calibration board image in the plane where the target object is located, try to make the calibration board fill the entire long-distance camera viewing area, and use the long-distance camera to take a calibration board image; calibration board Images similar to chess boards, circle arrays and other images with obvious features and known actual dimensions can be used;
(A2)提取标定板图像中的特征点(如角点或圆心),并确定所有提取出来的特征点的图像坐标;(A2) Extracting feature points (such as corner points or circle centers) in the calibration plate image, and determining the image coordinates of all extracted feature points;
有些类型的标定板,其获取的标定板图像中可能存在一些杂点或者含有一些背景导致提取的角点有偏移或者非标定板的角点,所以并不是所有的特征点都是有用的,应该剔除无用的特征点。如国际象棋棋盘的图像就应先剔除无用的特征点,而圆阵列则不需要。For some types of calibration boards, there may be some noise points or some background in the obtained calibration board images, which may cause the extracted corner points to be offset or non-calibration board corners, so not all feature points are useful. Useless feature points should be removed. For example, the image of a chess board should first eliminate useless feature points, but the circle array does not need it.
(A3)根据标定板的图像,确定步骤(A2)中提取的特征点的对应实际坐标;(A3) according to the image of the calibration plate, determine the corresponding actual coordinates of the feature points extracted in the step (A2);
(A4)利用多项式标定方法和上述特征点的图像坐标和实际坐标,确定成像平面与被测平面之间的对应坐标转换关系。记特征点的图像坐标为(ui,vi),实际坐标为(xi,yi),i=1,2,...,m。多项式标定方法的公式为:(A4) Using the polynomial calibration method and the image coordinates and actual coordinates of the above-mentioned feature points to determine the corresponding coordinate transformation relationship between the imaging plane and the measured plane. Note that the image coordinates of the feature points are (u i , v i ), the actual coordinates are (xi , y i ), i=1, 2, . . . , m. The formula for the polynomial calibration method is:
xi=a1ui k+a2vi k+a3ui k-1vi+a4uivi k-1+a5ui k-1+...+a(4*k-4)ui+a(4*k-3)vi+a(4*k-2) x i =a 1 u i k +a 2 v i k +a 3 u i k-1 v i +a 4 u i v i k-1 +a 5 u i k-1 +...+a (4 *k-4) u i +a (4*k-3) v i +a (4*k-2)
yi=b1ui k+b2vi k+b3ui k-1vi+b4uivi k-1+b5ui k-1+...+b(4*k-4)ui+b(4*k-3)vi+b(4*k-2) y i =b 1 u i k +b 2 v i k +b 3 u i k-1 v i +b 4 u i v i k-1 +b 5 u i k-1 +...+b (4 *k-4) u i +b (4*k-3) v i +b (4*k-2)
其中,a1,a2,...,a(4*k-2)和b1,b2,...,b(4*k-2)为待定参数,利用最小二乘法即可求出待定参数。Among them, a 1 , a 2 , ..., a (4*k-2) and b 1 , b 2 , ..., b (4*k-2) are undetermined parameters, and the least square method can be used to find Parameters to be determined.
(B)按照下述步骤确定近距离摄像头成像平面上的像素距离与实际物理距离之间的比例关系:(B) Determine the proportional relationship between the pixel distance on the imaging plane of the close-range camera and the actual physical distance according to the following steps:
(B1)在被测目标平面上放置含有一段或者几段已知长度的线段的模板;(B1) Place a template containing one or several line segments of known length on the measured target plane;
(B2)拍摄一张或者摆放位置不同的几张含有上述模板的图像;(B2) Take one or several images containing the above-mentioned template in different positions;
(B3)提取模板图像上已知长度的线段,记录该线段两端点之间的像素长度,即组成这条线段的像素的个数;(B3) extracting a line segment of known length on the template image, recording the pixel length between the two ends of the line segment, that is, the number of pixels forming this line segment;
(B4)计算像素距离与实际物理距离之间的比例关系。(B4) Calculate the proportional relationship between the pixel distance and the actual physical distance.
(2)将待检测的目标物体放置在被测目标平面上,用远距离摄像头拍摄一张包含该目标物体的全局图像;(2) Place the target object to be detected on the measured target plane, and take a global image containing the target object with a long-distance camera;
(3)在所拍摄的全局图像上确定目标物体上的感兴趣部位,并记下感兴趣部位中心的图像坐标(ui1,vi1),i=1,...,m,共m个感兴趣部位,其中,m≥1;(3) Determine the part of interest on the target object on the captured global image, and record the image coordinates (u i1 , v i1 ) of the center of the part of interest, i=1,..., m, a total of m Part of interest, where m≥1;
(4)根据步骤(1)得到的远距离摄像头其成像平面与被测目标平面之间的对应坐标转换关系,将步骤(3)记下的感兴趣部位中心的图像坐标转换为实际坐标(xi1,yi1),其中,i=1,...,m;(4) According to the corresponding coordinate transformation relationship between the imaging plane of the long-distance camera obtained in step (1) and the measured target plane, the image coordinates of the center of the part of interest recorded in step (3) are converted into actual coordinates (x i1 , y i1 ), where i=1,...,m;
(5)利用机械手移动近距离摄像头到感兴趣部位中心的实际坐标处,感兴趣部位的中心位置与近距离摄像头成像平面中心相重合,拍摄该部位的近距离图像;因为这个摄像头离被测目标平面很近,取景范围小,成像清晰,因此可以得到该感兴趣部位的精密的细节信息;(5) Use the manipulator to move the close-range camera to the actual coordinates of the center of the interested part, the center of the interested part coincides with the center of the imaging plane of the close-range camera, and take a close-range image of the part; because the camera is far from the measured object The plane is very close, the viewing range is small, and the imaging is clear, so the precise details of the interested part can be obtained;
(6)在上述感兴趣部位的近距离图像中确定感兴趣部位的图像坐标,根据其图像坐标与近距离摄像头成像平面中心的相对位置关系,并利用步骤(1)得到的近距离摄像头成像平面上的像素距离与实际物理距离之间的比例关系,将上述感兴趣部位的近距离图像的图像坐标转化为实际坐标,得到该感兴趣部位的实际信息,包括位置、大小、形状等信息。再对照实际标准确定该部位是否存在破损、断裂等异常情况,如若存在,可根据需要对之做进一步处理。(6) Determine the image coordinates of the part of interest in the close-range image of the above-mentioned part of interest, according to the relative positional relationship between its image coordinates and the center of the imaging plane of the close-range camera, and use the imaging plane of the close-range camera obtained in step (1) The proportional relationship between the pixel distance on the image and the actual physical distance, the image coordinates of the close-range image of the above-mentioned interested part are converted into actual coordinates, and the actual information of the interested part is obtained, including position, size, shape and other information. Then compare the actual standard to determine whether there is any abnormality such as damage or fracture in this part. If there is, it can be further processed as needed.
电路板焊点检测实例:Example of circuit board solder joint inspection:
(1)对远距离摄像头进行标定,确定其成像平面与被测目标平面之间的对应坐标转换关系,并确定近距离摄像头成像平面上的像素距离与实际物理距离之间的比例关系。具体步骤说明如下:(1) Calibrate the long-distance camera, determine the corresponding coordinate transformation relationship between its imaging plane and the measured target plane, and determine the proportional relationship between the pixel distance on the imaging plane of the short-distance camera and the actual physical distance. The specific steps are as follows:
(A)对远距离摄像头进行标定的过程为:(A) The process of calibrating the long-distance camera is:
(A1)获取标定板图像:以如图2所示的国际象棋棋盘图像作为标定板,将标定板图像放置在目标物体所在平面中,尽量让标定板充满整个远距离摄像头取景区域,用远距离摄像头拍摄一张标定板图像,标定板的每个格子的边长的物理长度已知;(A1) Obtain the calibration board image: take the chess board image shown in Figure 2 as the calibration board, place the calibration board image on the plane where the target object is located, try to make the calibration board fill the entire long-distance camera viewing area, and use the long-distance The camera shoots an image of the calibration board, and the physical length of the side length of each grid of the calibration board is known;
(A2)提取标定板图像的特征,确定特征点的图像坐标:因为本发明中采用的是国际象棋棋盘图像,所以可以提取角点作为标定板的特征点。提取角点的方法有SUSAN、Harris等,在这里采用Harris角点提取算法,结果见图4,图中白色十字中心即为角点;(A2) extract the feature of calibration board image, determine the image coordinate of feature point: because what adopt among the present invention is chess board image, so can extract corner point as the feature point of calibration board. Corner extraction methods include SUSAN, Harris, etc. Here, the Harris corner extraction algorithm is used, and the results are shown in Figure 4. The center of the white cross in the figure is the corner point;
(A3)确定(A2)中所提取出来的特征点的实际坐标;(A3) determining the actual coordinates of the feature points extracted in (A2);
根据选定的标定板图像,其获取的图像可能存在一些杂点或者含有一些背景导致提取的角点有偏移或者非标定板的角点,因此并不是所有的特征点都是有用的,需要根据剔出无用的特征点并确定有效的特征点的实际坐标,步骤如下:According to the selected calibration plate image, the acquired image may have some noise points or some backgrounds that cause the extracted corner points to be offset or not the corner points of the calibration plate, so not all feature points are useful, need According to removing useless feature points and determining the actual coordinates of valid feature points, the steps are as follows:
(a)在标定板图像上选取一个坐标系,确定坐标原点O和X、Y轴方向及标定板的有效区域;(a) Select a coordinate system on the calibration plate image, determine the effective area of the coordinate origin O and the X, Y axis directions and the calibration plate;
(b)对有效区域进行分割、提取边缘,并提取出标定板上相互垂直的直线:可以采用最大熵法、OTSU算法等方法对有效区域进行二值分割,在本发明中,采用OTSU算法。分割之后,提取图像的轮廓,然后利用Hough变换算法提取各条直线;(b) Segment the effective area, extract the edge, and extract the straight lines perpendicular to each other on the calibration plate: methods such as maximum entropy method and OTSU algorithm can be used to carry out binary segmentation of the effective area, and in the present invention, the OTSU algorithm is adopted. After segmentation, extract the contour of the image, and then use the Hough transform algorithm to extract each straight line;
(c)对直线进行排序,求出各条相互垂直的直线的交点:首先将所有直线分为两类,这两类直线之间相互垂直,同一类直线之间相互平行;然后,根据坐标原点到直线的距离对同一类的直线顺序进行判断;最后,求出各条相互垂直的直线的交点的实际坐标;(c) Sort the straight lines and find the intersection points of the perpendicular straight lines: first, divide all the straight lines into two types, the two types of lines are perpendicular to each other, and the lines of the same type are parallel to each other; then, according to the coordinate origin The distance to the straight line is used to judge the order of straight lines of the same type; finally, the actual coordinates of the intersection points of each perpendicular straight line are obtained;
(d)用求出来的交点与(A2)求出的角点进行比较,进而确定各个有效角点的实际坐标信息:这里采用最近邻方法。比如,两条相交直线的交点的实际坐标是(20,30)(mm),其图像坐标是(151,124),如果有角点的坐标与此交点的图像坐标的欧式距离小于3,且图像坐标两分量之间的距离差的绝对值小于2,那么就认定这个角点是有效的特征点,其实际坐标就是(20,30)(mm);(d) Compare the calculated intersection point with the corner point calculated in (A2), and then determine the actual coordinate information of each effective corner point: the nearest neighbor method is used here. For example, the actual coordinates of the intersection of two intersecting straight lines are (20, 30) (mm), and their image coordinates are (151, 124), if the Euclidean distance between the coordinates of the corner point and the image coordinates of the intersection is less than 3, and If the absolute value of the distance difference between the two components of the image coordinates is less than 2, then this corner point is considered to be a valid feature point, and its actual coordinates are (20, 30) (mm);
(A4)在本发明中,采用3次多项式标定方法确定成像平面与被测目标平面之间的坐标转换关系:记每个特征点的图像坐标为(ui,vi),实际坐标为(xi,yi),i=1,2,...(因为3次多项式标定方法含有20个待定参数,因而需要至少20个方程才能求出,所以必须有:i>=10),那么存在下列关系:(A4) In the present invention, the coordinate conversion relationship between the imaging plane and the measured target plane is determined by a third-degree polynomial calibration method: the image coordinates of each feature point are (u i , v i ), and the actual coordinates are ( x i , y i ), i=1, 2, ... (because the 3rd degree polynomial calibration method contains 20 undetermined parameters, so at least 20 equations are needed to obtain it, so there must be: i>=10), then The following relationships exist:
xi=a1ui 3+a2vi 3+a3ui 2vi+a4uivi 2+a5ui 2+a6vi 2+a7uivi+a8ui+a9vi+a10 x i =a 1 u i 3 +a 2 v i 3 +a 3 u i 2 v i +a 4 u i v i 2 +a 5 u i 2 +a 6 v i 2 +a 7 u i v i + a 8 u i +a 9 v i +a 10
yi=b1ui 3+b2vi 3+b3ui 2vi+b4uivi 2+b5ui 2+b6vi 2+b7uivi+b8ui+b9vi+b10 y i =b 1 u i 3 +b 2 v i 3 +b 3 u i 2 v i +b 4 u i v i 2 +b 5 u i 2 +b 6 v i 2 +b 7 u i v i + b 8 u i +b 9 v i +b 10
其中,a1,a2,...,a10和b1,b2,...,b10为待定参数。Wherein, a 1 , a 2 , ..., a 10 and b 1 , b 2 , ..., b 10 are undetermined parameters.
利用最小二乘法求出参数aj,bj,j=1,...,10。The parameters a j , b j , j=1, . . . , 10 are calculated by the least square method.
(B)按照下述步骤确定近距离摄像头成像平面上的像素距离与实际距离之间的比例关系:(B) Determine the proportional relationship between the pixel distance on the imaging plane of the close-range camera and the actual distance according to the following steps:
(B1)在被测目标平面上放置如图3所示的模板图像;其中,a,b两点之间的物理距离已知;(B1) Place the template image as shown in Figure 3 on the measured target plane; wherein, the physical distance between the two points a and b is known;
(B2)用近距离摄像头拍摄一张或者几张(摆放位置可以不同)上述模板图像;(B2) Take one or several (positions can be different) of the above-mentioned template images with a close-range camera;
(B3)提取模板上已知长度的线段,记录线段的像素长度:利用自动或者人机交互的方法得到a,b两点的图像坐标,得到像素长度D。线段跨度越大,计算的结果越准确;(B3) Extract a line segment with a known length on the template, and record the pixel length of the line segment: use an automatic or human-computer interaction method to obtain the image coordinates of two points a and b, and obtain the pixel length D. The larger the span of the line segment, the more accurate the calculation result;
(B4)计算像素距离与实际物理距离之间的比例关系:对提取出来的n条线段,分别求出像素距离与实际物理距离之间的比例关系,然后对求出的n个结果求取平均值作为最后的结果。(B4) Calculate the proportional relationship between the pixel distance and the actual physical distance: for the extracted n line segments, calculate the proportional relationship between the pixel distance and the actual physical distance, and then calculate the average of the obtained n results value as the final result.
(2)将电路板放置在被测目标平面上,用远距离摄像头拍摄一张包含电路板的全局图像;(2) Place the circuit board on the measured target plane, and take a global image including the circuit board with a long-distance camera;
(3)运用人工交互或者某些图像处理方法,比如阈值分割、特征提取、模板匹配等一系列的方法,找出电路板上的所有焊点在全局图像上的大致的图像坐标(ui1,vi1),i=1,...,m,其中,m>=1,记录下来;(3) Use human interaction or some image processing methods, such as threshold segmentation, feature extraction, template matching and a series of methods to find out the approximate image coordinates of all solder joints on the circuit board on the global image (u i1 , v i1 ), i=1,..., m, wherein, m>=1, record it;
(4)根据步骤(1)得到的远距离摄像头其成像平面与被测目标平面之间的对应坐标转换关系,将步骤(3)标记的所有焊点的图像坐标利用下面的公式转换为各个焊点的实际坐标(xi1,yi1);(4) According to the corresponding coordinate transformation relationship between the imaging plane of the long-distance camera obtained in step (1) and the measured target plane, the image coordinates of all solder joints marked in step (3) are converted into each solder joint using the following formula The actual coordinates of the point (x i1 , y i1 );
xi1=a1ui1 3+a2vi1 3+a3ui1 2vi1+a4ui1vi1 2+a5ui1 2+a6vi1 2+a7ui1vi1+a8ui1+a9vi1+a10 x i1 =a 1 u i1 3 +a 2 v i1 3 +a 3 u i1 2 v i1 +a 4 u i1 v i1 2 +a 5 u i1 2 +a 6 v i1 2 +a 7 u i1 v i1 + a 8 u i1 +a 9 v i1 +a 10
yi1=b1ui1 3+b2vi1 3+b3ui1 2vi1+b4ui1vi1 2+b5ui1 2+b6vi1 2+b7ui1vi1+b8ui1+b9vi1+b10 y i1 =b 1 u i1 3 +b 2 v i1 3 +b 3 u i1 2 v i1 +b 4 u i1 v i1 2 +b 5 u i1 2 +b 6 v i1 2 +b 7 u i1 v i1 + b 8 u i1 +b 9 v i1 +b 10
其中,a1,a2,...,a10和b1,b2,...,b10在步骤(1)中已经求得。Wherein, a 1 , a 2 , ..., a 10 and b 1 , b 2 , ..., b 10 have been obtained in step (1).
(5)根据各焊点的实际坐标,利用机械手移动近距离摄像头到焊点的实际位置(xi1,yi1),该位置处于近距离摄像头成像平面中心,即中心的图像坐标为(u2,v2),实际坐标为(xi1,yi1),拍摄该焊点的近距离图像;(5) According to the actual coordinates of each solder joint, use the manipulator to move the close-range camera to the actual position (x i1 , y i1 ) of the solder joint, which is in the center of the imaging plane of the close-range camera, that is, the image coordinate of the center is (u 2 , v 2 ), the actual coordinates are (x i1 , y i1 ), take a close-up image of the solder joint;
(6)在上述焊点的近距离图像中确定焊点的图像坐标(ui2,vi2),得到其图像坐标与近距离摄像头成像平面中心的相对位置关系(ui2-u2,vi2-v2),并根据步骤(1)得到的近距离摄像头成像平面上的像素距离与实际物理距离之间的比例关系,将上述相对位置关系转化为实际坐标中的相对关系(xi2′,yi2′),然后,再根据近距离摄像头成像平面中心的实际坐标(xi1,yi1),得到该焊点的实际精确坐标(xi2,yi2)为(xi1+xi2′,yi1+yi2′),即可控制激光焊接器移动到焊点的实际位置进行焊接。(6) Determine the image coordinates (u i2 , v i2 ) of the solder joints in the close-range image of the above-mentioned solder joints, and obtain the relative positional relationship between the image coordinates and the center of the imaging plane of the close-range camera (u i2 -u 2 , v i2 -v 2 ), and according to the proportional relationship between the pixel distance on the imaging plane of the close-range camera obtained in step (1) and the actual physical distance, the above relative positional relationship is transformed into the relative relationship in the actual coordinates (x i2 ′, y i2 ′), and then, according to the actual coordinates (x i1 , y i1 ) of the center of the imaging plane of the close-range camera, the actual precise coordinates (x i2 , y i2 ) of the solder joint are obtained as (x i1 +x i2 ′, y i1 +y i2 ′), the laser welder can be controlled to move to the actual position of the welding spot for welding.
Claims (3)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB2007100514467A CN100547351C (en) | 2007-02-01 | 2007-02-01 | A method of machine vision positioning |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB2007100514467A CN100547351C (en) | 2007-02-01 | 2007-02-01 | A method of machine vision positioning |
Publications (2)
Publication Number | Publication Date |
---|---|
CN101033958A true CN101033958A (en) | 2007-09-12 |
CN100547351C CN100547351C (en) | 2009-10-07 |
Family
ID=38730618
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CNB2007100514467A Expired - Fee Related CN100547351C (en) | 2007-02-01 | 2007-02-01 | A method of machine vision positioning |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN100547351C (en) |
Cited By (26)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101840736A (en) * | 2010-05-07 | 2010-09-22 | 中国科学院自动化研究所 | Device and method for mounting optical glass under vision guide |
CN101876535A (en) * | 2009-12-02 | 2010-11-03 | 北京中星微电子有限公司 | Method, device and monitoring system for height measurement |
CN101699223B (en) * | 2009-10-27 | 2011-06-15 | 北京控制工程研究所 | Calibration device of binocular vision navigation system of lunar surface vehicle |
CN102152033A (en) * | 2011-02-14 | 2011-08-17 | 苏州工业园区华焊科技有限公司 | Image centralizing location method for automatic tube plate welding |
CN102506705A (en) * | 2011-10-17 | 2012-06-20 | 罗艺 | Method and device for obtaining coordinates of positioning mark on PCB (Printed Circuit Board) and patch device |
CN103548341A (en) * | 2011-06-08 | 2014-01-29 | 欧姆龙株式会社 | Distributed image processing system |
CN104217439A (en) * | 2014-09-26 | 2014-12-17 | 南京工程学院 | Indoor visual positioning system and method |
CN104280755A (en) * | 2014-09-29 | 2015-01-14 | 南京航空航天大学 | Relative navigation method based on Beidou reflected signals and vision measurement |
CN105279775A (en) * | 2014-07-23 | 2016-01-27 | 广明光电股份有限公司 | Calibration device and method for robotic arm |
CN106092058A (en) * | 2016-08-25 | 2016-11-09 | 广东欧珀移动通信有限公司 | The processing method of information data, device and terminal |
CN106204560A (en) * | 2016-07-02 | 2016-12-07 | 上海大学 | Automatic Calibration Method of Colony Picker |
CN106998463A (en) * | 2016-01-26 | 2017-08-01 | 宁波舜宇光电信息有限公司 | The method of testing of camera module based on latticed mark version |
CN108181323A (en) * | 2017-12-15 | 2018-06-19 | 河南飞优驰网络科技有限公司 | Integrated circuit plate fault detection method and system based on electromagnetic signature |
CN108646727A (en) * | 2018-05-14 | 2018-10-12 | 珠海市微半导体有限公司 | A kind of vision cradle and its localization method and recharging method |
CN108876850A (en) * | 2018-06-29 | 2018-11-23 | 闽江学院 | A kind of pcb board punching localization method |
CN108972562A (en) * | 2018-09-13 | 2018-12-11 | 河南机电职业学院 | A method of calibration sorting machine people work station carrier chain CountsPerMeter parameter |
CN109801300A (en) * | 2017-11-16 | 2019-05-24 | 北京百度网讯科技有限公司 | Coordinate extraction method, device, equipment and the computer readable storage medium of X-comers |
CN110893269A (en) * | 2019-11-26 | 2020-03-20 | 北京新松融通机器人科技有限公司 | Fire-fighting robot water-supply hose joint butt joint method and system based on visual measurement |
CN111310712A (en) * | 2020-03-04 | 2020-06-19 | 杭州晟元数据安全技术股份有限公司 | Fast searching method based on fingerprint bag-of-words features |
CN111425183A (en) * | 2020-02-24 | 2020-07-17 | 中铁第四勘察设计院集团有限公司 | Geological exploration hole site positioning method and positioning robot |
CN111486802A (en) * | 2020-04-07 | 2020-08-04 | 东南大学 | Rotating shaft calibration method based on self-adaptive distance weighting |
CN112518323A (en) * | 2020-11-25 | 2021-03-19 | 武汉耀皮康桥汽车玻璃有限公司 | Automobile rear windshield processing device |
CN112669382A (en) * | 2020-12-30 | 2021-04-16 | 联想未来通信科技(重庆)有限公司 | Image-based distance determination method and device |
CN113400196A (en) * | 2021-06-18 | 2021-09-17 | 西安奕斯伟硅片技术有限公司 | Cleaning method, device and equipment for grinding fixed disc groove and computer storage medium |
CN114585875A (en) * | 2019-10-11 | 2022-06-03 | 莱卡地球系统公开股份有限公司 | Metering system |
CN117871406A (en) * | 2023-12-25 | 2024-04-12 | 中船重工鹏力(南京)智能装备系统有限公司 | Automatic optical detection method and system |
-
2007
- 2007-02-01 CN CNB2007100514467A patent/CN100547351C/en not_active Expired - Fee Related
Cited By (36)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101699223B (en) * | 2009-10-27 | 2011-06-15 | 北京控制工程研究所 | Calibration device of binocular vision navigation system of lunar surface vehicle |
CN101876535A (en) * | 2009-12-02 | 2010-11-03 | 北京中星微电子有限公司 | Method, device and monitoring system for height measurement |
CN101876535B (en) * | 2009-12-02 | 2015-11-25 | 北京中星微电子有限公司 | A kind of height measurement method, device and supervisory system |
CN101840736A (en) * | 2010-05-07 | 2010-09-22 | 中国科学院自动化研究所 | Device and method for mounting optical glass under vision guide |
CN102152033B (en) * | 2011-02-14 | 2014-02-05 | 苏州工业园区华焊科技有限公司 | Image centralizing location method for automatic tube plate welding |
CN102152033A (en) * | 2011-02-14 | 2011-08-17 | 苏州工业园区华焊科技有限公司 | Image centralizing location method for automatic tube plate welding |
CN103548341A (en) * | 2011-06-08 | 2014-01-29 | 欧姆龙株式会社 | Distributed image processing system |
CN102506705A (en) * | 2011-10-17 | 2012-06-20 | 罗艺 | Method and device for obtaining coordinates of positioning mark on PCB (Printed Circuit Board) and patch device |
CN102506705B (en) * | 2011-10-17 | 2014-04-09 | 罗艺 | Method and device for obtaining coordinates of positioning mark on PCB (Printed Circuit Board) and patch device |
CN105279775A (en) * | 2014-07-23 | 2016-01-27 | 广明光电股份有限公司 | Calibration device and method for robotic arm |
CN105279775B (en) * | 2014-07-23 | 2019-09-17 | 广明光电股份有限公司 | Calibration device and method for robotic arm |
CN104217439A (en) * | 2014-09-26 | 2014-12-17 | 南京工程学院 | Indoor visual positioning system and method |
CN104217439B (en) * | 2014-09-26 | 2017-04-19 | 南京工程学院 | Indoor visual positioning system and method |
CN104280755A (en) * | 2014-09-29 | 2015-01-14 | 南京航空航天大学 | Relative navigation method based on Beidou reflected signals and vision measurement |
CN106998463A (en) * | 2016-01-26 | 2017-08-01 | 宁波舜宇光电信息有限公司 | The method of testing of camera module based on latticed mark version |
CN106204560A (en) * | 2016-07-02 | 2016-12-07 | 上海大学 | Automatic Calibration Method of Colony Picker |
CN106204560B (en) * | 2016-07-02 | 2019-04-16 | 上海大学 | Automatic calibration method of colony picking instrument |
CN106092058A (en) * | 2016-08-25 | 2016-11-09 | 广东欧珀移动通信有限公司 | The processing method of information data, device and terminal |
CN109801300A (en) * | 2017-11-16 | 2019-05-24 | 北京百度网讯科技有限公司 | Coordinate extraction method, device, equipment and the computer readable storage medium of X-comers |
CN108181323A (en) * | 2017-12-15 | 2018-06-19 | 河南飞优驰网络科技有限公司 | Integrated circuit plate fault detection method and system based on electromagnetic signature |
CN108646727A (en) * | 2018-05-14 | 2018-10-12 | 珠海市微半导体有限公司 | A kind of vision cradle and its localization method and recharging method |
CN108876850A (en) * | 2018-06-29 | 2018-11-23 | 闽江学院 | A kind of pcb board punching localization method |
CN108972562A (en) * | 2018-09-13 | 2018-12-11 | 河南机电职业学院 | A method of calibration sorting machine people work station carrier chain CountsPerMeter parameter |
CN114585875A (en) * | 2019-10-11 | 2022-06-03 | 莱卡地球系统公开股份有限公司 | Metering system |
CN110893269A (en) * | 2019-11-26 | 2020-03-20 | 北京新松融通机器人科技有限公司 | Fire-fighting robot water-supply hose joint butt joint method and system based on visual measurement |
CN111425183A (en) * | 2020-02-24 | 2020-07-17 | 中铁第四勘察设计院集团有限公司 | Geological exploration hole site positioning method and positioning robot |
CN111425183B (en) * | 2020-02-24 | 2023-12-08 | 中铁第四勘察设计院集团有限公司 | Geological exploration hole site positioning method and positioning robot |
CN111310712A (en) * | 2020-03-04 | 2020-06-19 | 杭州晟元数据安全技术股份有限公司 | Fast searching method based on fingerprint bag-of-words features |
CN111310712B (en) * | 2020-03-04 | 2024-02-13 | 杭州晟元数据安全技术股份有限公司 | Quick searching method based on fingerprint word bag characteristics |
CN111486802A (en) * | 2020-04-07 | 2020-08-04 | 东南大学 | Rotating shaft calibration method based on self-adaptive distance weighting |
CN111486802B (en) * | 2020-04-07 | 2021-04-06 | 东南大学 | Rotation axis calibration method based on adaptive distance weighting |
CN112518323A (en) * | 2020-11-25 | 2021-03-19 | 武汉耀皮康桥汽车玻璃有限公司 | Automobile rear windshield processing device |
CN112669382A (en) * | 2020-12-30 | 2021-04-16 | 联想未来通信科技(重庆)有限公司 | Image-based distance determination method and device |
CN113400196A (en) * | 2021-06-18 | 2021-09-17 | 西安奕斯伟硅片技术有限公司 | Cleaning method, device and equipment for grinding fixed disc groove and computer storage medium |
CN117871406A (en) * | 2023-12-25 | 2024-04-12 | 中船重工鹏力(南京)智能装备系统有限公司 | Automatic optical detection method and system |
CN117871406B (en) * | 2023-12-25 | 2024-12-24 | 中船鹏力(南京)智能装备系统有限公司 | Automatic optical detection method and system |
Also Published As
Publication number | Publication date |
---|---|
CN100547351C (en) | 2009-10-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101033958A (en) | Mechanical vision locating method | |
CN110555889B (en) | A depth camera hand-eye calibration method based on CALTag and point cloud information | |
CN105894499B (en) | A kind of space object three-dimensional information rapid detection method based on binocular vision | |
CN105345254B (en) | Calibration method for positional relation between paraxial type visual system and laser vibrating mirror machining system | |
CN103235939A (en) | Datum point positioning method based on machine vision | |
CN106123772B (en) | A kind of nuclear fuel rod pose automatic identification equipment and method | |
CN105261022B (en) | PCB board matching method and device based on outer contour | |
CN106824806B (en) | The detection method of low module plastic gear based on machine vision | |
CN103617611B (en) | A kind of automatic threshold segmentation spot center and size detecting method | |
CN1801896A (en) | Video camera rating data collecting method and its rating plate | |
CN102589516B (en) | Dynamic distance measuring system based on binocular line scan cameras | |
CN103902953B (en) | A kind of screen detecting system and method | |
CN112833784B (en) | Steel rail positioning method combining monocular camera with laser scanning | |
CN105563481B (en) | A kind of robot vision bootstrap technique for peg-in-hole assembly | |
CN106780623A (en) | A kind of robotic vision system quick calibrating method | |
CN104760812B (en) | Product real-time positioning system and method on conveyer belt based on monocular vision | |
CN111251336A (en) | A dual-arm collaborative intelligent assembly system based on visual positioning | |
CN109406527B (en) | System and method for detecting fine appearance defects of micro camera module lens | |
CN106441087A (en) | Workpiece multi-size multi-parameter measuring method based on image processing | |
WO2022126870A1 (en) | Three-dimensional imaging method and method based on light field camera and three-dimensional imaging measuring production line | |
CN107133983A (en) | Bundled round steel end face binocular vision system and space orientation and method of counting | |
Wang et al. | Error analysis and improved calibration algorithm for LED chip localization system based on visual feedback | |
CN113843797B (en) | Automatic disassembly method for part hexagonal bolt under non-structural environment based on single-binocular hybrid vision | |
CN110599404A (en) | Circuit board microscopic image splicing method and device and information data processing terminal | |
CN107202555A (en) | A kind of Machining of Connecting Rod rotating disc fixture vision inspection apparatus and detection 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 | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
C17 | Cessation of patent right | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20091007 Termination date: 20100201 |