Movatterモバイル変換


[0]ホーム

URL:


CN114862759A - A high-precision corner detection method and system for telephoto camera calibration - Google Patents

A high-precision corner detection method and system for telephoto camera calibration
Download PDF

Info

Publication number
CN114862759A
CN114862759ACN202210318214.8ACN202210318214ACN114862759ACN 114862759 ACN114862759 ACN 114862759ACN 202210318214 ACN202210318214 ACN 202210318214ACN 114862759 ACN114862759 ACN 114862759A
Authority
CN
China
Prior art keywords
corner
roi
coordinates
interest
pixel
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210318214.8A
Other languages
Chinese (zh)
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.)
Yangzhou Rui Kong Automotive Electronics Co ltd
Original Assignee
Yangzhou Rui Kong Automotive Electronics Co ltd
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 Yangzhou Rui Kong Automotive Electronics Co ltdfiledCriticalYangzhou Rui Kong Automotive Electronics Co ltd
Priority to CN202210318214.8ApriorityCriticalpatent/CN114862759A/en
Publication of CN114862759ApublicationCriticalpatent/CN114862759A/en
Pendinglegal-statusCriticalCurrent

Links

Images

Classifications

Landscapes

Abstract

Translated fromChinese

本发明公开了一种长焦相机标定的高精度角点检测方法,包括:基于长焦相机采集的棋盘格图像,进行感兴趣区域ROI选择处理,对所有感兴趣区域ROI进行Harris角点检测,进行随机抽样一致算法RANSAC处理,再进行亚像素级角点定位处理,得到棋盘格图像的角点坐标。本发明中,根据长焦相机采集的棋盘格图像,利用感兴趣区域ROI选择,Harris角点检测,RANSAC算法处理,亚像素精确化等步骤,使得棋盘格图像的角点检测更加方便快捷,精度高的同时耗时也更少,通过自动化程序也使得角点检测及相机参数的提取操作步骤更加简单。

Figure 202210318214

The invention discloses a high-precision corner detection method calibrated by a telephoto camera. Perform random sampling consensus algorithm RANSAC processing, and then perform sub-pixel corner positioning processing to obtain the corner coordinates of the checkerboard image. In the present invention, according to the checkerboard image collected by the telephoto camera, using the steps of ROI selection of the region of interest, Harris corner detection, RANSAC algorithm processing, sub-pixel precision and other steps, the corner point detection of the checkerboard image is more convenient, fast and accurate. At the same time, it is more time-consuming and less time-consuming. The automated procedures also make the operation steps of corner detection and camera parameter extraction simpler.

Figure 202210318214

Description

Translated fromChinese
一种长焦相机标定的高精度角点检测方法和系统A high-precision corner detection method and system for telephoto camera calibration

技术领域technical field

本发明涉及计算机视觉技术领域,尤其涉及一种长焦相机标定的高精度角点检测方法和系统。The invention relates to the technical field of computer vision, in particular to a high-precision corner detection method and system calibrated by a telephoto camera.

背景技术Background technique

随着人工智能的不断发展,研究如何使机器“看”的科学显得十分重要。计算机视觉是使用计算机及相关设备对生物视觉的一种模拟。它的主要任务就是通过对采集的图片或视频进行处理以获得相应场景的三维信息,它可以使得机器“看”得见,而相机标定技术更是计算机视觉领域里重要的一部分,它能够使得机器“看”得准。As artificial intelligence continues to develop, the science of how to make machines "see" is important. Computer vision is a simulation of biological vision using computers and related equipment. Its main task is to obtain the three-dimensional information of the corresponding scene by processing the collected pictures or videos, which can make the machine "see", and the camera calibration technology is an important part in the field of computer vision, which can make the machine "see". "Look" is right.

长焦工业相机因其拍摄远距离景物时景深较小,拍摄远距离景物时主题更加突出等种种优势,被广泛应用于机器视觉领域。在相机标定过程中,最重要的是棋盘格角点检测,基本上以Harris角点检测为主。但是,长焦镜头在采集近处棋盘格图像时会因窄景深出现散焦模糊现象,因此在长焦相机标定时会出现角点检测精度不够的问题,这在很大程度上影响标定的结果。Telephoto industrial cameras are widely used in the field of machine vision due to their advantages of small depth of field when shooting long-distance scenes and more prominent subjects when shooting long-distance scenes. In the camera calibration process, the most important thing is the checkerboard corner detection, which is basically dominated by Harris corner detection. However, when a telephoto lens collects a close checkerboard image, defocusing and blurring will occur due to a narrow depth of field. Therefore, when the telephoto camera is calibrated, the problem of insufficient corner detection accuracy will occur, which greatly affects the calibration results. .

发明内容SUMMARY OF THE INVENTION

为解决背景技术中存在的技术问题,本发明提出一种长焦相机标定的高精度角点检测方法和系统。In order to solve the technical problems existing in the background art, the present invention proposes a high-precision corner detection method and system calibrated by a telephoto camera.

本发明提出一种长焦相机标定的高精度角点检测方法,包括:基于长焦相机采集的棋盘格图像,进行感兴趣区域ROI选择处理,对所有感兴趣区域ROI进行Harris角点检测,进行随机抽样一致算法RANSAC处理,再进行亚像素级角点定位处理,得到棋盘格图像的角点坐标。The invention provides a high-precision corner detection method calibrated by a telephoto camera, which includes: based on a checkerboard image collected by the telephoto camera, performing a selection process of a region of interest ROI, performing Harris corner detection on all the ROIs of the region of interest, and performing The random sampling consensus algorithm RANSAC is processed, and then the sub-pixel-level corner point location processing is performed to obtain the corner coordinates of the checkerboard image.

优选地,所述进行感兴趣区域ROI选择处理,具体包括:提取棋盘格总体轮廓以及中心区域轮廓的像素坐标,通过像素坐标的变化提取需要的感兴趣区域ROI。Preferably, the ROI selection process of the region of interest specifically includes: extracting the overall outline of the checkerboard and the pixel coordinates of the outline of the central region, and extracting the required ROI of the region of interest by changing the pixel coordinates.

优选地,在任意位姿摆放的棋盘格中,每格都可以近似成一个边长为2a×2b的平行四边形,定义棋盘格中心区域的平行四边形ABCD的点集合为ROI0,0(x,y),所有的感兴趣区域RIO都可以通过对ROI0,0(x,y)沿着向量

Figure BDA0003570520300000021
Figure BDA0003570520300000022
正反方向平移得到;Preferably, in a checkerboard placed in any pose, each checker can be approximated as a parallelogram with a side length of 2a×2b, and the point set of the parallelogram ABCD that defines the central area of the checkerboard is ROI0,0 (x ,y), all regions of interest RIOs can be obtained by aligning the ROI0,0 (x,y) along the vector
Figure BDA0003570520300000021
or
Figure BDA0003570520300000022
It is obtained by translation in forward and reverse directions;

在内角点个数为2m×2n的棋盘格中,通过像素坐标的变化,提取得到所有感兴趣区域的集合ROInum(x,y),其表达为:In a checkerboard with 2m×2n inner corner points, through the change of pixel coordinates, the set ROInum (x, y) of all regions of interest is extracted, which is expressed as:

Figure BDA0003570520300000023
Figure BDA0003570520300000023

其中,ROI±(2i+1)a,±(2j+1)b(x,y)代表棋盘格区域内每一个包含角点区域的感兴趣区域。Among them, ROI±(2i+1)a, ±(2j+1)b (x, y) represents each region of interest that includes a corner region in the checkerboard area.

优选地,所述对所有感兴趣区域ROI进行Harris角点检测,具体包括:Preferably, the Harris corner detection is performed on all regions of interest ROI, including:

遍历棋盘格图像的所有感兴趣区域ROI进行Harris角点检测,得到所有感兴趣区域ROI及其感兴趣区域ROI以内的检测角点坐标。Traverse all the ROIs of the checkerboard image to perform Harris corner detection, and obtain all the ROIs of the ROI and the coordinates of the detected corners within the ROI.

优选地,Harris角点检测的遍历Sobel算子的大小为7pixel×7pixel,角点响应阈值TH=10-2Preferably, the size of the traversal Sobel operator for Harris corner detection is 7pixel×7pixel, and the corner response thresholdTH =10−2 .

优选地,所述进行随机抽样一致算法RANSAC处理,具体包括:Preferably, the performing random sampling consensus algorithm RANSAC processing specifically includes:

根据所有感兴趣区域ROI及其感兴趣区域ROI以内的检测角点坐标,通过RANSAC算法进行处理并通过灰度梯度对比,选取拟合线段上灰度值最大的整像素点作为候选角点,得到所有感兴趣区域ROI及其感兴趣区域ROI以内的候选角点的坐标。According to the coordinates of all the ROIs and the detected corner points within the ROI, the RANSAC algorithm is used to process and compare the gray gradient, and the integer pixel with the largest gray value on the fitted line segment is selected as the candidate corner point. The coordinates of all ROIs and their candidate corners within the ROI.

优选地,所述进行亚像素级角点定位处理,具体包括:Preferably, performing sub-pixel-level corner point positioning processing specifically includes:

根据所有感兴趣区域ROI内得到的多个候选角点,进行亚像素级角点定位,得到亚像素精确化的角点坐标。According to multiple candidate corner points obtained in all regions of interest ROI, sub-pixel-level corner point positioning is performed to obtain sub-pixel accurate corner point coordinates.

优选地,所述亚像素级角点定位,具体包括:Preferably, the sub-pixel-level corner point positioning specifically includes:

通过构造响应函数A,By constructing the response function A,

Figure BDA0003570520300000031
其中,Ix,Iy是图像I(x,y)的偏导数;
Figure BDA0003570520300000031
Among them, Ix , Iy are the partial derivatives of the image I(x, y);

通过坐标加权平均法,以A为权处理选取的角点来完成亚像素定位:Through the coordinate weighted average method, the selected corner points are processed with A as the weight to complete the sub-pixel positioning:

Figure BDA0003570520300000032
其中,E表示某一个感兴趣区域ROI内角点距离的平方和,ki和si分别表示某一个ROI内角点权值和区域内角点与准确角点距离的平方,
Figure BDA0003570520300000032
Among them, E represents the sum of the squares of the distances of the inner corners of a ROI in a certain region of interest,ki and si respectively represent the weights of the inner corners of a certain ROI and the squares of the distances between the inner corners of the region and the accurate corners,

其中,

Figure BDA0003570520300000033
si=|x*-xi|2+|y*-yi|2,x*,y*和xi,yi分别表示准确角点的坐标和某一个ROI内角点的坐标;in,
Figure BDA0003570520300000033
si =|x* -xi |2 +|y* -yi |2 , x* , y* and xi , yi represent the coordinates of the exact corner point and the coordinates of the inner corner point of a certain ROI respectively;

根据最小二乘法,使得E最小值的坐标(x*,y*)应与准确角点的坐标一致,即E分别对x*,y*求偏导数有:According to the least squares method, the coordinates (x* , y* ) of the minimum value of E should be consistent with the coordinates of the exact corner point, that is, the partial derivatives of E with respect to x* , y* respectively are:

Figure BDA0003570520300000034
Figure BDA0003570520300000034

Figure BDA0003570520300000035
Figure BDA0003570520300000035

对该公式求解得到:Solving this formula yields:

Figure BDA0003570520300000036
Figure BDA0003570520300000036

Figure BDA0003570520300000037
Figure BDA0003570520300000037

通过计算得到c*(x*,y*)即为亚像素精确化的角点坐标。By calculation, c* (x* , y* ) is the sub-pixel precise corner coordinates.

本发明还提出了一种长焦相机标定的高精度角点检测系统,包括:The present invention also proposes a high-precision corner detection system calibrated by a telephoto camera, comprising:

ROI选择模块,基于长焦相机采集的棋盘格图像,对进行感兴趣区域ROI选择处理;The ROI selection module, based on the checkerboard image collected by the telephoto camera, selects and processes the ROI of the region of interest;

角点检测模块,用于对所有感兴趣区域ROI进行Harris角点检测;Corner detection module for Harris corner detection for all regions of interest ROI;

RANSAC处理模块,用于进行随机抽样一致算法RANSAC处理;RANSAC processing module, used for random sampling consensus algorithm RANSAC processing;

角点定位模块,用于进行亚像素级角点定位处理,得到棋盘格图像的角点坐标。The corner point location module is used to perform sub-pixel level corner point location processing to obtain the corner point coordinates of the checkerboard image.

本发明还提出了一种长焦相机的高精度标定方法,应用上述长焦相机标定的高精度角点检测方法。The present invention also proposes a high-precision calibration method for a telephoto camera, using the above-mentioned high-precision corner detection method for telephoto camera calibration.

本发明中,根据长焦相机采集的棋盘格图像,利用感兴趣区域ROI选择,Harris角点检测,RANSAC算法处理,亚像素精确化等步骤,使得棋盘格图像的角点检测更加方便快捷,精度高的同时耗时也更少,通过自动化程序也使得角点检测及相机参数的提取操作步骤更加简单。In the present invention, according to the checkerboard image collected by the telephoto camera, using the steps of ROI selection of the region of interest, Harris corner detection, RANSAC algorithm processing, sub-pixel precision and other steps, the corner point detection of the checkerboard image is more convenient, fast and accurate. At the same time, it is more time-consuming and less time-consuming. The automated procedures also make the operation steps of corner detection and camera parameter extraction simpler.

附图说明Description of drawings

图1为本发明实施例提出的一种长焦相机标定的高精度角点检测方法的流程示意图。FIG. 1 is a schematic flowchart of a high-precision corner detection method calibrated by a telephoto camera according to an embodiment of the present invention.

图2为本发明实施例中棋盘格轮廓区域及中心感兴趣区域的提取结果示意图。FIG. 2 is a schematic diagram of an extraction result of a checkerboard outline region and a central region of interest in an embodiment of the present invention.

图3为任意位姿棋盘格的感兴趣区域及其对感兴趣区域进行位置变化示意图。FIG. 3 is a schematic diagram of the region of interest of an arbitrary pose checkerboard and the position change of the region of interest.

图4为传统Harris角点检测过程中角点聚簇、背景点及外角点干扰的现象示意图。FIG. 4 is a schematic diagram of the phenomenon of corner clustering, background points and outer corner interference in the traditional Harris corner detection process.

具体实施方式Detailed ways

如图1所示,图1为本发明实施例提出的一种长焦相机标定的高精度角点检测方法的流程示意图。As shown in FIG. 1 , FIG. 1 is a schematic flowchart of a high-precision corner point detection method calibrated by a telephoto camera according to an embodiment of the present invention.

参照图1,本发明提出实施例提成的一种长焦相机标定的高精度角点检测方法,包括:Referring to FIG. 1, the present invention proposes a high-precision corner detection method calibrated by a telephoto camera according to an embodiment, including:

S1,感兴趣区域ROI选择。S1, region of interest ROI selection.

在相机标定过程中,因工作环境的特殊性,采集图片的背景比较复杂。如果直接进行Harris角点检测,不仅非常耗时,还会提取出很多错误的角点,而真正需要进行角点检测的只是棋盘格的区域。为此,在进行Harris角点检测之前,如果能够只对需要检测的区域进行检测,可以很大程度上减少算法检测的耗时,同时避免提出更多错误的角点。In the process of camera calibration, due to the particularity of the working environment, the background of the collected pictures is more complicated. If Harris corner detection is performed directly, it is not only very time-consuming, but also extracts a lot of wrong corners, and only the checkerboard area is really needed for corner detection. For this reason, before Harris corner detection, if only the areas that need to be detected can be detected, the time-consuming algorithm detection can be greatly reduced, and more wrong corners can be avoided at the same time.

在本申请实施例中,基于长焦相机采集的棋盘格图像,在执行Harris角点检测之前,对棋盘格图像进行ROI(Region Of Interest,感兴趣区域)选择。In the embodiment of the present application, based on the checkerboard image collected by the telephoto camera, before Harris corner detection is performed, ROI (Region Of Interest, region of interest) is selected on the checkerboard image.

参照图2,为了避免图像背景的干扰,可以通过OpenCV findContours函数,提取棋盘格总体轮廓和中心区域轮廓的像素坐标,得到棋盘格部分轮廓的提取效果,从而将检测区域缩小到了棋盘格部分。Referring to Figure 2, in order to avoid the interference of the image background, the pixel coordinates of the overall outline of the checkerboard and the outline of the central area can be extracted through the OpenCV findContours function to obtain the extraction effect of the outline of the checkerboard, thereby reducing the detection area to the checkerboard.

假定图像为I(x,y),其中x,y代表图像的像素坐标,通过提取得到的棋盘格部分轮廓的像素坐标,可以通过像素坐标的变化提取需要的感兴趣区域ROI,这样的感兴趣区域ROI包含了棋盘格黑白交错的角点区域。Assume that the image is I(x,y), where x,y represent the pixel coordinates of the image. By extracting the pixel coordinates of the outline of the checkerboard part, the desired region of interest ROI can be extracted by changing the pixel coordinates. The regional ROI contains the corner regions where the black and white of the checkerboard are interleaved.

参照图3,任意位姿摆放的棋盘格中,每个格子都可以近似成一个边长为2a×2b的平行四边形。通过图像像素坐标系可以得到,棋盘格中心白色区域的平行四边形ABCD的各个顶点坐标和质心坐标M,分别进行标记:A(x1,y1),B(x2,y2),C(x3,y3),D(x4,y4),M(x0,y0)。Referring to FIG. 3 , in a checkerboard placed in any pose, each checker can be approximated as a parallelogram with a side length of 2a×2b. It can be obtained from the image pixel coordinate system that the coordinates of each vertex and the center of mass coordinate M of the parallelogram ABCD in the white area in the center of the checkerboard are marked respectively: A(x1 , y1 ), B(x2 , y2 ), C( x3 , y3 ), D(x4 , y4 ), M(x0 , y0 ).

定义整个棋盘格区域点集合为U(x,y),棋盘格中心白色区域的平行四边形的点集合为R0,0(x,y),则所有的感兴趣区域ROI都可以通过对R0,0(x,y)沿着向量

Figure BDA0003570520300000061
Figure BDA0003570520300000062
正反方向平移得到,定义
Figure BDA0003570520300000063
方向为正方向。Define the point set of the entire checkerboard area as U(x, y), and the point set of the parallelogram in the white area in the center of the checkerboard as R0 , 0 (x, y), then all the ROIs of the region of interest can pass the R0 , 0 (x, y) along the vector
Figure BDA0003570520300000061
or
Figure BDA0003570520300000062
The forward and reverse direction translation is obtained, the definition
Figure BDA0003570520300000063
The direction is the positive direction.

在图3中,左侧下方的平行四边形所示的感兴趣区域ROI,其是由R0,0(x,y)沿着

Figure BDA0003570520300000064
方向平移5a再向
Figure BDA0003570520300000065
方向平移3b得到,将其定义为:In Figure 3, the lower left parallelogram shows the region of interest ROI, which is formed byR0,0 (x,y) along the
Figure BDA0003570520300000064
Direction translation 5a and then
Figure BDA0003570520300000065
The direction translation is obtained by 3b, which is defined as:

ROI-5a,3b(x,y)=R-5a,3b(x,y)∩U(x,y)。ROI-5a,3b (x,y)=R-5a,3b (x,y)∩U(x,y).

在图3中,基于用于标定的棋盘格4个顶角都为黑色格子,所以其内角点个数必是偶数,棋盘格的内角点个数用2m×2n表示,例如本发明中使用的棋盘格内角点个数为6×4。在内角点个数为2m×2n的棋盘格中,提取得到所有感兴趣区域ROI的集合ROInum(x,y)为:In Fig. 3, based on the 4 top corners of the checkerboard used for calibration are all black lattices, so the number of its inner corner points must be an even number, and the number of inner corner points of the checkerboard is represented by 2m × 2n, such as the one used in the present invention. The number of corners in the checkerboard is 6×4. In a checkerboard with 2m×2n inner corner points, the set ROInum (x, y) of all ROIs in the region of interest is extracted as:

Figure BDA0003570520300000066
Figure BDA0003570520300000066

其中,ROI±(2i+1)a,±(2j+1)b(x,y)代表棋盘格区域内每一个包含角点区域的感兴趣区域。Among them, ROI±(2i+1)a, ±(2j+1)b (x, y) represent each region of interest including corner regions in the checkerboard area.

通过上述计算,得到的ROInum(x,y)即为感兴趣区域处理之后的结果。Through the above calculation, the obtained ROInum (x, y) is the result after processing the region of interest.

经过感兴趣区域ROI选择,能够缩短角点检测的时间,同时也在很大程度上降低了外角点以及边缘点对检测结果造成的干扰。After selecting the ROI of the region of interest, the time for corner detection can be shortened, and the interference caused by outer corners and edge points to the detection results can be greatly reduced.

S2,Harris角点检测。S2, Harris corner detection.

在感兴趣区域选择之后,再对每一个感兴趣区域进行Harris角点检测,将传统的Harris角点检测算法遍历整幅图像的做法改为遍历每一个感兴趣区域,这样既能减少Harris角点检测的耗时,又能避免棋盘格以外区域的干扰。After the region of interest is selected, Harris corner detection is performed on each region of interest, and the traditional Harris corner detection algorithm that traverses the entire image is changed to traverse each region of interest, which can reduce Harris corners. The detection is time-consuming, and the interference of areas outside the checkerboard can be avoided.

在本发明实施例中,针对传统Harris角点检测算法的固有缺陷以及应用于模糊图像角点检测方面的不足,对于Harris角点检测算法的参数设定如下:In the embodiment of the present invention, in view of the inherent defects of the traditional Harris corner detection algorithm and the deficiencies applied to the corner detection of blurred images, the parameters of the Harris corner detection algorithm are set as follows:

将遍历Sobel算子的大小由3pixel×3pixel调整为7pixel×7pixel,该算子由高斯函数得出,适当增大Sobel算子大小能保证感兴趣区域内的候选角点不丢失,对模糊图像进行检测时宜适当增大Sobel算子宽度。Adjust the size of the traversing Sobel operator from 3pixel×3pixel to 7pixel×7pixel. The operator is derived from the Gaussian function. Properly increasing the size of the Sobel operator can ensure that the candidate corners in the area of interest are not lost. The Sobel operator width should be appropriately increased during detection.

在进行角点响应阈值检测时,因模糊图像的角点相应值R较小,同时要保证角点不丢失,设置一个很小的阈值是必要的,设置角点响应阈值TH=10-2In the detection of the corner response threshold, since the corresponding value R of the corner of the blurred image is small, and at the same time to ensure that the corner is not lost, it is necessary to set a small threshold, and set the corner response threshold TH =10-2 .

经过Harris角点检测之后,输出结果为每一个感兴趣区域ROI及其感兴趣区域ROI以内的检测角点坐标。After Harris corner detection, the output result is each region of interest ROI and the detected corner coordinates within the region of interest ROI.

S3,RANSAC算法角点定位S3, RANSAC algorithm corner location

在对感兴趣区域进行Harris角点检测过程中,得到感兴趣区域ROI及其感兴趣区域ROI以内的检测角点坐标。在该过程中,很难通过阈值的选取来确定准确的角点位置,通过设置一个较小的阈值,虽然能保证特征点不丢失,但是也避免不了角点聚簇的现象。During the Harris corner detection process for the region of interest, the region of interest ROI and the coordinates of the detected corner points within the region of interest ROI are obtained. In this process, it is difficult to determine the exact corner position through the selection of the threshold. By setting a smaller threshold, although the feature points can be guaranteed not to be lost, the phenomenon of corner clustering cannot be avoided.

参照图4,在角点检测过程中出现了角点聚簇的现象,通过观察聚簇角点的分布特征,在每一个感兴趣区域ROI内分布呈现线性,因此,本申请实施例采用随机抽样一致算法RANSAC取代传统的非极大值抑制方法进行处理。Referring to FIG. 4 , the phenomenon of corner clustering occurs during the corner detection process. By observing the distribution characteristics of the clustered corners, the distribution in each region of interest ROI is linear. Therefore, the embodiment of the present application adopts random sampling. The consensus algorithm RANSAC replaces the traditional non-maximum suppression method for processing.

RANSAC算法即随机抽样一致算法,可以理解为假定模型,例如直线方程。通过随机抽取2个样本点,对模型进行拟合,由于不是严格线性,数据点都有一定波动,假设容差范围为sigma,找出距离拟合曲线容差范围内的点,并统计点的个数;重新随机选取2个样本点,重复前面两步的操作,直到结束迭代。每一次拟合后,容差范围内都有对应的数据点数,找出数据点个数最多的情况,就是最终的拟合结果。The RANSAC algorithm is a random sampling consensus algorithm, which can be understood as a hypothetical model, such as a straight line equation. By randomly sampling 2 sample points, the model is fitted. Since it is not strictly linear, the data points have certain fluctuations. Assuming that the tolerance range is sigma, find the points within the tolerance range of the distance fitting curve, and count the points. Number of samples; re-select 2 sample points at random, and repeat the operations of the previous two steps until the iteration ends. After each fitting, there are corresponding data points within the tolerance range, and finding the case with the largest number of data points is the final fitting result.

RANSAC算法可以获得穿过聚簇角点群的拟合度最高的直线方程,在理想情况下,RANSAC算法拟合出来的直线方程将会穿过角点所在的位置。模糊的棋盘格图像角点处因离黑色区域的距离较远,角点应位于某一个ROI区域内RANSAC算法拟合出的线段上的灰度值最大的点。通过对比RANSAC算法拟合出的线段附近的灰度梯度,可得到灰度值最大的整像素点坐标ci(xi,yi),也即候选角点坐标。The RANSAC algorithm can obtain the straight line equation with the highest fitting degree through the clustered corner point group. In an ideal situation, the straight line equation fitted by the RANSAC algorithm will pass through the position of the corner point. Since the corners of the blurred checkerboard image are far from the black area, the corners should be located in a certain ROI area on the line segment fitted by the RANSAC algorithm with the largest gray value. By comparing the gray gradient near the line segment fitted by the RANSAC algorithm, the coordinates ci (xi , yi ) of the integer pixel with the largest gray value can be obtained, that is, the coordinates of the candidate corner points.

在本实施例中,根据感兴趣区域ROI及其感兴趣区域ROI以内的检测角点坐标,经过RANSAC算法处理以及灰度梯度对比之后,输出结果为所有感兴趣区域ROI及其感兴趣区域ROI以内几个整像素点,即候选角点的坐标。In this embodiment, according to the region of interest ROI and the detected corner coordinates within the region of interest ROI, after RANSAC algorithm processing and gray gradient comparison, the output results are all regions of interest ROI and within the region of interest ROI. Several integer pixels, that is, the coordinates of the candidate corners.

将在每一个感兴趣区域ROI内得到的多个候选角点定义为:The multiple candidate corner points obtained in each region of interest ROI are defined as:

c1(x1,y1),c2(x2,y2),c3(x3,y3),...,cn(xn,yn),n∈Z*c1 (x1 , y1 ), c2 (x2 , y2 ), c3 (x3 , y3 ), ..., cn (xn , yn ), n∈Z* .

S4,亚像素级角点定位。S4, sub-pixel corner positioning.

根据所有感兴趣区域ROI内得到的多个候选角点,进行亚像素级角点定位。According to multiple candidate corner points obtained in all regions of interest ROI, sub-pixel-level corner point positioning is performed.

基于模糊图像角点处相应较弱,构造响应函数A,公式表达为:Based on the weak response at the corners of the blurred image, the response function A is constructed, and the formula is expressed as:

Figure BDA0003570520300000081
其中,Ix,Iy是图像I(x,y)的偏导数,即图像I(x,y)在x和y方向上的灰度梯度。
Figure BDA0003570520300000081
Among them, Ix , Iy are the partial derivatives of the image I(x, y), that is, the grayscale gradients of the image I(x, y) in the x and y directions.

通过坐标加权平均法,以A为权处理选取的角点来完成亚像素定位,公式表达为:Through the coordinate weighted average method, the selected corner points are processed with A as the weight to complete the sub-pixel positioning. The formula is expressed as:

Figure BDA0003570520300000082
其中,E表示某一个感兴趣区域ROI内角点距离的平方和,ki和si分别表示某一个ROI内角点权值和区域内角点与准确角点距离的平方,
Figure BDA0003570520300000082
Among them, E represents the sum of the squares of the distances of the inner corners of a ROI in a certain region of interest,ki and si respectively represent the weights of the inner corners of a certain ROI and the squares of the distances between the inner corners of the region and the accurate corners,

其中,

Figure BDA0003570520300000083
si=|x*-xi|2+|y*-yi|2,x*,y*和xi,yi分别表示准确角点的坐标和某一个ROI内角点的坐标。in,
Figure BDA0003570520300000083
si =|x* -xi |2 +|y* -yi|2 , x* , y* and xi , yi represent the coordinates of the exact corner and the coordinates of the inner corner of a certain ROI, respectively.

根据最小二乘法,使得E最小值的坐标(x*,y*)应与准确角点的坐标一致,即E分别对x*,y*求偏导数有:According to the least squares method, the coordinates (x* , y* ) of the minimum value of E should be consistent with the coordinates of the exact corner point, that is, the partial derivatives of E with respect to x* and y* respectively are:

Figure BDA0003570520300000091
Figure BDA0003570520300000091

Figure BDA0003570520300000092
Figure BDA0003570520300000092

对该公式求解得到:Solving this formula yields:

Figure BDA0003570520300000093
Figure BDA0003570520300000093

Figure BDA0003570520300000094
Figure BDA0003570520300000094

通过计算得到c*(x*,y*)即为亚像素精确化的角点坐标。By calculation, c* (x* , y* ) is the sub-pixel precise corner coordinates.

本发明提出的长焦相机标定的高精度角点检测方法,利用感兴趣区域ROI选择,Harris角点检测,RANSAC算法处理,亚像素精确化等步骤,使得对长焦相机采集的棋盘格图像进行角点检测时更加方便快捷,精度高的同时耗时也更少,通过自动化程序也使得角点检测及相机参数的提取操作步骤更加简单。The high-precision corner detection method for telephoto camera calibration proposed by the present invention utilizes the steps of ROI selection in the region of interest, Harris corner detection, RANSAC algorithm processing, sub-pixel precision and other steps, so that the checkerboard image collected by the telephoto camera can be processed. Corner detection is more convenient and faster, with high accuracy and less time-consuming, and automated procedures also make corner detection and camera parameter extraction simpler.

本发明实施例还提出了一种长焦相机标定的高精度角点检测系统,包括:The embodiment of the present invention also proposes a high-precision corner detection system calibrated by a telephoto camera, including:

ROI选择模块,基于长焦相机采集的棋盘格图像,对进行感兴趣区域ROI选择处理;The ROI selection module, based on the checkerboard image collected by the telephoto camera, selects and processes the ROI of the region of interest;

角点检测模块,用于对所有感兴趣区域ROI进行Harris角点检测;Corner detection module for Harris corner detection for all regions of interest ROI;

RANSAC处理模块,用于进行随机抽样一致算法RANSAC处理;RANSAC processing module, used for random sampling consensus algorithm RANSAC processing;

角点定位模块,用于进行亚像素级角点定位处理,得到棋盘格图像的角点坐标。The corner point location module is used to perform sub-pixel level corner point location processing to obtain the corner point coordinates of the checkerboard image.

基于本发明实施例提出的长焦相机标定的高精度角点检测方法,本发明实施例还提出了一种长焦相机的高精度标定方法,应用该长焦相机标定的高精度角点检测方法。相应的,该长焦相机的高精度标定方法同样具有上述高精度角点检测方法的技术效果。Based on the high-precision corner detection method calibrated by the telephoto camera proposed in the embodiment of the present invention, the embodiment of the present invention also proposes a high-precision calibration method of the telephoto camera, and the high-precision corner detection method calibrated by the telephoto camera is applied . Correspondingly, the high-precision calibration method of the telephoto camera also has the technical effect of the above-mentioned high-precision corner detection method.

以上所述,仅为本发明较佳的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,根据本发明的技术方案及其发明构思加以等同替换或改变,都应涵盖在本发明的保护范围之内。The above description is only a preferred embodiment of the present invention, but the protection scope of the present invention is not limited to this. The equivalent replacement or change of the inventive concept thereof shall be included within the protection scope of the present invention.

Claims (10)

Translated fromChinese
1.一种长焦相机标定的高精度角点检测方法,其特征在于,包括:基于长焦相机采集的棋盘格图像,进行感兴趣区域ROI选择处理,对所有感兴趣区域ROI进行Harris角点检测,进行随机抽样一致算法RANSAC处理,再进行亚像素级角点定位处理,得到棋盘格图像的角点坐标。1. a high-precision corner detection method calibrated by a telephoto camera, is characterized in that, comprising: based on the checkerboard image collected by the telephoto camera, carry out a region of interest ROI selection process, and carry out Harris corners to all regions of interest ROIs. Detect, perform random sampling consensus algorithm RANSAC processing, and then perform sub-pixel-level corner location processing to obtain the corner coordinates of the checkerboard image.2.根据权利要求1所述的长焦相机标定的高精度角点检测方法,其特征在于,所述进行感兴趣区域ROI选择处理,具体包括:提取棋盘格总体轮廓和中心区域轮廓的像素坐标,通过像素坐标的变化提取需要的感兴趣区域ROI。2. The high-precision corner detection method calibrated by a telephoto camera according to claim 1, characterized in that, said performing a region of interest ROI selection process, specifically comprising: extracting the pixel coordinates of the overall outline of the checkerboard and the outline of the central area , and extract the desired region of interest ROI through the change of pixel coordinates.3.根据权利要求2所述的长焦相机标定的高精度角点检测方法,其特征在于,在任意位姿摆放的棋盘格中,每格都可以近似成一个边长为2a×2b的平行四边形,定义棋盘格中心区域的平行四边形ABCD的点集合为ROI0,0(x,y),所有的感兴趣区域RIO都可以通过对ROI0,0(x,y)沿着向量
Figure FDA0003570520290000011
Figure FDA0003570520290000012
正反方向平移得到;3. The high-precision corner detection method calibrated by a telephoto camera according to claim 2, characterized in that, in a checkerboard placed in any pose, each grid can be approximated as a side length of 2a×2b Parallelogram, the point set of the parallelogram ABCD that defines the central area of the checkerboard is ROI0,0 (x,y), and all regions of interest RIO can be determined by ROI0,0 (x,y) along the vector
Figure FDA0003570520290000011
or
Figure FDA0003570520290000012
It is obtained by translation in forward and reverse directions;在内角点个数为2m×2n的棋盘格中,通过像素坐标的变化,提取得到所有感兴趣区域的集合ROInum(x,y),其表达为:In a checkerboard with 2m×2n inner corner points, through the change of pixel coordinates, the set ROInum (x, y) of all regions of interest is extracted, which is expressed as:
Figure FDA0003570520290000013
Figure FDA0003570520290000013
其中,ROI±(2i+1)a,±(2j+1)b(x,y)代表棋盘格区域内每一个包含角点区域的感兴趣区域。Among them, ROI±(2i+1)a, ±(2j+1)b (x, y) represents each region of interest that includes a corner region in the checkerboard area.4.根据权利要求1所述的长焦相机标定的高精度角点检测方法,其特征在于,所述对所有感兴趣区域ROI进行Harris角点检测,具体包括:4. The high-precision corner detection method calibrated by a telephoto camera according to claim 1, wherein the Harris corner detection is carried out to all regions of interest ROI, specifically comprising:遍历棋盘格图像的所有感兴趣区域ROI进行Harris角点检测,得到所有感兴趣区域ROI及其感兴趣区域ROI以内的检测角点坐标。Traverse all the ROIs of the checkerboard image to perform Harris corner detection, and obtain all the ROIs of the ROI and the coordinates of the detected corners within the ROI.5.根据权利要求4所述的长焦相机标定的高精度角点检测方法,其特征在于,Harris角点检测的遍历Sobel算子的大小为7×7像素,角点响应阈值为TH=10-25. the high-precision corner detection method of telephoto camera calibration according to claim 4 is characterized in that, the size of the traversal Sobel operator of Harris corner detection is 7 × 7 pixels, and the corner response threshold isTH =10-2 .6.根据权利要求1所述的长焦相机标定的高精度角点检测方法,其特征在于,所述进行随机抽样一致算法RANSAC处理,具体包括:6. The high-precision corner detection method calibrated by a telephoto camera according to claim 1, wherein the performing random sampling consensus algorithm RANSAC processing specifically comprises:根据所有感兴趣区域ROI及其感兴趣区域ROI以内的检测角点坐标,通过RANSAC算法进行处理并通过灰度梯度对比,选取拟合线段上灰度值最大的整像素点作为候选角点,得到所有感兴趣区域ROI及其感兴趣区域ROI以内的候选角点坐标。According to the coordinates of all the ROIs and the detected corner points within the ROI, the RANSAC algorithm is used to process and compare the gray gradient, and the integer pixel with the largest gray value on the fitted line segment is selected as the candidate corner point. All ROIs and the candidate corner coordinates within the ROI of the ROI.7.根据权利要求1所述的长焦相机标定的高精度角点检测方法,其特征在于,所述进行亚像素级角点定位处理,具体包括:7. The high-precision corner detection method calibrated by a telephoto camera according to claim 1, wherein the performing sub-pixel-level corner positioning processing specifically comprises:根据所有感兴趣区域ROI内得到的多个候选角点,进行亚像素级角点定位,得到亚像素精确化的角点坐标。According to multiple candidate corner points obtained in all regions of interest ROI, sub-pixel-level corner point positioning is performed to obtain sub-pixel accurate corner point coordinates.8.根据权利要求7所述的长焦相机标定的高精度角点检测方法,其特征在于,所述亚像素级角点定位,具体包括:8. The high-precision corner detection method calibrated by a telephoto camera according to claim 7, wherein the sub-pixel-level corner positioning specifically comprises:通过构造响应函数A,By constructing the response function A,
Figure FDA0003570520290000021
其中,Ix,Iy是图像I(x,y)的偏导数;
Figure FDA0003570520290000021
Among them, Ix , Iy are the partial derivatives of the image I(x, y);
通过坐标加权平均法,以A为权处理选取的角点来完成亚像素定位:Through the coordinate weighted average method, the selected corner points are processed with A as the weight to complete the sub-pixel positioning:
Figure FDA0003570520290000022
其中,E表示某一个感兴趣区域ROI内角点距离的平方和,ki和si分别表示某一个ROI内角点权值和区域内角点与准确角点距离的平方,
Figure FDA0003570520290000022
Among them, E represents the sum of the squares of the distances of the inner corners of a ROI in a certain region of interest,ki and si respectively represent the weights of the inner corners of a certain ROI and the squares of the distances between the inner corners of the region and the accurate corners,
其中,
Figure FDA0003570520290000023
si=|x*-xi|2+|y*-yi|2,x*,y*和xi,yi分别表示准确角点的坐标和某一个ROI内角点的坐标;
in,
Figure FDA0003570520290000023
si =|x* -xi |2 +|y* -yi |2 , x* , y* and xi , yi represent the coordinates of the exact corner point and the coordinates of the inner corner point of a certain ROI respectively;
根据最小二乘法,使得E最小值的坐标(x*,y*)应与准确角点的坐标一致,即E分别对x*,y*求偏导数有:According to the least squares method, the coordinates (x* , y* ) of the minimum value of E should be consistent with the coordinates of the exact corner point, that is, the partial derivatives of E with respect to x* , y* respectively are:
Figure FDA0003570520290000031
Figure FDA0003570520290000031
Figure FDA0003570520290000032
Figure FDA0003570520290000032
对该公式求解得到:Solving this formula yields:
Figure FDA0003570520290000033
Figure FDA0003570520290000033
Figure FDA0003570520290000034
Figure FDA0003570520290000034
通过计算得到c*(x*,y*)即为亚像素精确化的角点坐标。By calculation, c* (x* , y* ) is the sub-pixel precise corner coordinates.
9.一种长焦相机标定的高精度角点检测系统,其特征在于,包括:9. A high-precision corner detection system calibrated by a telephoto camera, characterized in that, comprising:ROI选择模块,基于长焦相机采集的棋盘格图像,对进行感兴趣区域ROI选择处理;The ROI selection module, based on the checkerboard image collected by the telephoto camera, selects and processes the ROI of the region of interest;角点检测模块,用于对所有感兴趣区域ROI进行Harris角点检测;Corner detection module for Harris corner detection for all regions of interest ROI;RANSAC处理模块,用于进行随机抽样一致算法RANSAC处理;RANSAC processing module, used for random sampling consensus algorithm RANSAC processing;角点定位模块,用于进行亚像素级角点定位处理,得到棋盘格图像的角点坐标。The corner point location module is used to perform sub-pixel level corner point location processing to obtain the corner point coordinates of the checkerboard image.10.一种长焦相机的高精度标定方法,其特征在于,应用权利要求1-8任一项所述的长焦相机标定的高精度角点检测方法。10. A high-precision calibration method for a telephoto camera, characterized in that the high-precision corner detection method for telephoto camera calibration according to any one of claims 1-8 is applied.
CN202210318214.8A2022-03-292022-03-29 A high-precision corner detection method and system for telephoto camera calibrationPendingCN114862759A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202210318214.8ACN114862759A (en)2022-03-292022-03-29 A high-precision corner detection method and system for telephoto camera calibration

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202210318214.8ACN114862759A (en)2022-03-292022-03-29 A high-precision corner detection method and system for telephoto camera calibration

Publications (1)

Publication NumberPublication Date
CN114862759Atrue CN114862759A (en)2022-08-05

Family

ID=82629193

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202210318214.8APendingCN114862759A (en)2022-03-292022-03-29 A high-precision corner detection method and system for telephoto camera calibration

Country Status (1)

CountryLink
CN (1)CN114862759A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN118967830A (en)*2024-07-302024-11-15苏州英维特精密机械有限公司 An adaptive fuzzy calibration algorithm for over-the-horizon cameras
CN119295562A (en)*2024-12-122025-01-10苏州镁伽科技有限公司 Camera calibration method, device, electronic device and storage medium

Citations (10)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN102622744A (en)*2012-01-172012-08-01浙江大学Telephoto camera calibration method based on polynomial projection model
CN103345755A (en)*2013-07-112013-10-09北京理工大学Chessboard angular point sub-pixel extraction method based on Harris operator
CN105096317A (en)*2015-07-032015-11-25吴晓军Fully automatic calibration method for high performance camera under complicated background
CN110910456A (en)*2019-11-222020-03-24大连理工大学 Dynamic Calibration Algorithm of Stereo Camera Based on Harris Corner Mutual Information Matching
CN110969668A (en)*2019-11-222020-04-07大连理工大学 A Stereo Calibration Algorithm for Telephoto Binocular Camera
CN111047649A (en)*2018-10-152020-04-21华东交通大学 A high-precision camera calibration method based on optimal polarization angle
CN111243032A (en)*2020-01-102020-06-05大连理工大学 An automatic detection method for checkerboard corner points
CN111260731A (en)*2020-01-102020-06-09大连理工大学Checkerboard sub-pixel level corner point self-adaptive detection method
WO2021147755A1 (en)*2020-01-202021-07-29北京芯海视界三维科技有限公司Checkerboard corner detection method and device
CN113516721A (en)*2021-09-132021-10-19中科慧远视觉技术(北京)有限公司Multi-camera-based measurement method and device and storage medium

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN102622744A (en)*2012-01-172012-08-01浙江大学Telephoto camera calibration method based on polynomial projection model
CN103345755A (en)*2013-07-112013-10-09北京理工大学Chessboard angular point sub-pixel extraction method based on Harris operator
CN105096317A (en)*2015-07-032015-11-25吴晓军Fully automatic calibration method for high performance camera under complicated background
CN111047649A (en)*2018-10-152020-04-21华东交通大学 A high-precision camera calibration method based on optimal polarization angle
CN110910456A (en)*2019-11-222020-03-24大连理工大学 Dynamic Calibration Algorithm of Stereo Camera Based on Harris Corner Mutual Information Matching
CN110969668A (en)*2019-11-222020-04-07大连理工大学 A Stereo Calibration Algorithm for Telephoto Binocular Camera
CN111243032A (en)*2020-01-102020-06-05大连理工大学 An automatic detection method for checkerboard corner points
CN111260731A (en)*2020-01-102020-06-09大连理工大学Checkerboard sub-pixel level corner point self-adaptive detection method
WO2021147755A1 (en)*2020-01-202021-07-29北京芯海视界三维科技有限公司Checkerboard corner detection method and device
CN113516721A (en)*2021-09-132021-10-19中科慧远视觉技术(北京)有限公司Multi-camera-based measurement method and device and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN118967830A (en)*2024-07-302024-11-15苏州英维特精密机械有限公司 An adaptive fuzzy calibration algorithm for over-the-horizon cameras
CN119295562A (en)*2024-12-122025-01-10苏州镁伽科技有限公司 Camera calibration method, device, electronic device and storage medium

Similar Documents

PublicationPublication DateTitle
CN111640157B (en)Checkerboard corner detection method based on neural network and application thereof
CN109859226B (en)Detection method of checkerboard corner sub-pixels for graph segmentation
JP6899189B2 (en) Systems and methods for efficiently scoring probes in images with a vision system
CN104091324B (en)Quick checkerboard image feature matching algorithm based on connected domain segmentation
CN109000557B (en) A method for automatic recognition of nuclear fuel rod pose
CN114820817B (en)Calibration method and three-dimensional reconstruction method based on high-precision line laser 3D camera
CN110246168A (en)A kind of feature matching method of mobile crusing robot binocular image splicing
CN103902953B (en)A kind of screen detecting system and method
CN109523551B (en) A method and system for obtaining the walking posture of a robot
CN114511894B (en) Pupil center coordinate acquisition system and acquisition method
JP7312026B2 (en) Image processing device, image processing method and program
CN110222661B (en)Feature extraction method for moving target identification and tracking
CN114862759A (en) A high-precision corner detection method and system for telephoto camera calibration
CN113409334A (en)Centroid-based structured light angle point detection method
CN111402330A (en)Laser line key point extraction method based on plane target
CN116912333B (en)Camera attitude self-calibration method based on operation fence calibration rod
JP2022173970A (en)Detection method and device for assembly body muti-view change based on feature matching
CN117576219A (en)Camera calibration equipment and calibration method for single shot image of large wide-angle fish-eye lens
CN111160362B (en) A FAST feature homogeneous extraction and inter-frame feature mismatch removal method
CN114963981A (en)Monocular vision-based cylindrical part butt joint non-contact measurement method
CN113920065A (en)Imaging quality evaluation method for visual inspection system in industrial field
CN118138900A (en)Endoscope imaging method, image acquisition terminal and storage medium
CN115841668A (en)Binocular vision apple identification and accurate positioning method
CN114885095A (en)Image acquisition control method and device, image acquisition system and readable storage medium
CN116206301A (en) Recognition Method of Flexible and Deformable Objects in Complex Background Based on Convolutional Neural Network

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination

[8]ページ先頭

©2009-2025 Movatter.jp