CN209231985U - A kind of camera parameters automatic calibration device based on virtual Binocular Vision Principle - Google Patents
A kind of camera parameters automatic calibration device based on virtual Binocular Vision Principle Download PDFInfo
- Publication number
- CN209231985U CN209231985U CN201820827846.6U CN201820827846U CN209231985U CN 209231985 U CN209231985 U CN 209231985U CN 201820827846 U CN201820827846 U CN 201820827846U CN 209231985 U CN209231985 U CN 209231985U
- Authority
- CN
- China
- Prior art keywords
- camera
- calibration
- pan
- tilt
- calibration board
- 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
Links
- 230000003111 delayed effect Effects 0.000 claims description 6
- 238000000034 method Methods 0.000 abstract description 46
- 238000012545 processing Methods 0.000 description 24
- 238000004364 calculation method Methods 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 239000011159 matrix material Substances 0.000 description 2
- 238000013519 translation Methods 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 1
- 238000005314 correlation function Methods 0.000 description 1
- 238000003384 imaging method Methods 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
Landscapes
- Image Analysis (AREA)
Abstract
本实用新型提出一种基于虚拟双目视觉原理的摄像机参数自动标定装置,采用装置包括云台旋转支架、摄像机、外部触发电路、PC、绘有黑白格棋盘图案的标定板和两面成夹角设置的平面镜;两面平面镜设于云台旋转支架后方;标定板置于云台旋转支架处;摄像机设于云台旋转支架前方且摄像方面朝向两平面镜;当摄像机对标定板摄像时,其摄取的标定板图像包括标定板在两平面镜内形成的左右两个虚像;当标定板每转动一个角度时,外部触发电路控制摄像机对标定板摄像;PC对摄像机拍摄的标定板图像进行处理,以获取并标定摄像机的内部参数、畸变参数以及在世界坐标系下的外部参数;本产品解决了传统的人工寻找标定板角点的繁琐过程,简化了实验流程,便于操作。
The utility model proposes an automatic camera parameter calibration device based on the principle of virtual binocular vision. The device includes a pan-tilt rotating bracket, a camera, an external trigger circuit, a PC, a calibration board with a black and white checkerboard pattern, and an angle setting on both sides. The two plane mirrors are set behind the swivel bracket of the pan/tilt; the calibration plate is placed at the swivel bracket of the pan/tilt; the camera is set in front of the swivel bracket of the pan/tilt and the camera faces the two plane mirrors; The board image includes two left and right virtual images formed by the calibration board in the two plane mirrors; when the calibration board rotates an angle, the external trigger circuit controls the camera to take pictures of the calibration board; the PC processes the calibration board image captured by the camera to obtain and calibrate The camera's internal parameters, distortion parameters and external parameters in the world coordinate system; this product solves the traditional tedious process of manually finding the corner points of the calibration board, simplifies the experimental process, and is easy to operate.
Description
技术领域technical field
本实用新型涉及图像处理技术领域,尤其是一种基于虚拟双目视觉原理的摄像机参数自动标定装置。The utility model relates to the technical field of image processing, in particular to an automatic camera parameter calibration device based on the principle of virtual binocular vision.
背景技术Background technique
摄像机参数标定的目的是确定摄像机的位置、属性参数和建立成像几何模型,以便确定空间坐标系中物体点与它在图像平面上像点之间的对应关系。摄像机标定结果的准确性直接影响三维重建的精度,因此摄像机的标定在三维测试过程中占有十分重要的地位。The purpose of camera parameter calibration is to determine the camera's position, attribute parameters and establish an imaging geometric model in order to determine the correspondence between the object point in the space coordinate system and its image point on the image plane. The accuracy of camera calibration results directly affects the accuracy of 3D reconstruction, so camera calibration plays a very important role in the process of 3D testing.
张正友法是广泛应用于计算机视觉领域的一种标定方法,利用黑白相间的棋盘格作为标定物,在摄像机前任意摆放,通过对采集到的不同角度的多张标定板图像进行处理来确定摄像机的内外部参数,具有标定精度高的优点,但在实际操作过程中存在标定板需要人工转动、图像处理过程人工干预多、工作量大、相关参数的处理和分析不方便等问题。基于此,许会等提出专利“一种鱼眼相机快速标定装置及标定方法”,通过控制鱼眼相机水平旋转和垂直旋转以自动采集不同视角的标定板图像,但未涉及标定板图像自动处理以及相机参数的自动计算过程。王平等提出专利“一种基于OpenCV摄像头标定的3D输入方法”,通过拍摄不同位置的标定板,利用OpenCV对图像进行自动处理,但只计算了摄像机的内部参数,适用于单目测量时单相机的标定。Zhang Zhengyou's method is a calibration method widely used in the field of computer vision. It uses black and white checkerboards as calibration objects and places them arbitrarily in front of the camera. The camera is determined by processing multiple calibration board images collected from different angles. It has the advantages of high calibration accuracy, but in the actual operation process, there are problems such as manual rotation of the calibration plate, more manual intervention in the image processing process, heavy workload, and inconvenient processing and analysis of related parameters. Based on this, Xu Hui et al. proposed the patent "A Quick Calibration Device and Calibration Method for Fisheye Camera", which automatically collects calibration plate images from different viewing angles by controlling the horizontal rotation and vertical rotation of the fisheye camera, but does not involve automatic processing of calibration plate images and Automatic calculation process of camera parameters. Wang Pingping proposed a patent "a 3D input method based on OpenCV camera calibration". By shooting calibration boards at different positions, OpenCV is used to automatically process the image, but only the internal parameters of the camera are calculated, which is suitable for single camera in monocular measurement. calibration.
本实用新型提出的基于虚拟双目视觉原理的摄像机参数自动标定方法是在双目立体视觉原理和张正友标定方法的基础上,仅使用一台摄像机和两面平面镜便能够实现双目视觉三维重建,解决了传统的双目视觉技术存在的同步性差和成本高的问题。同时利用外部触发电路控制标定板的自动转动,并控制摄像机延时拍摄,减少了人工干预带来的不确定性。在图像处理方面,本实用新型利用OpenCV计算机视觉库中的相关函数处理得到摄像机的内部参数,畸变参数和对应于世界坐标系的外部参数,解决了传统的人工寻找标定板角点的繁琐过程,简化了实验流程,便于操作,为被测物体三维重建奠定基础。The automatic calibration method of camera parameters based on the principle of virtual binocular vision proposed by the utility model is based on the principle of binocular stereo vision and the calibration method of Zhang Zhengyou. Only one camera and two plane mirrors can be used to realize the three-dimensional reconstruction of binocular vision. It solves the problems of poor synchronization and high cost in traditional binocular vision technology. At the same time, the external trigger circuit is used to control the automatic rotation of the calibration plate, and the camera is controlled to take time-lapse shots, which reduces the uncertainty caused by manual intervention. In terms of image processing, the utility model utilizes the correlation function processing in the OpenCV computer vision library to obtain the internal parameters of the camera, the distortion parameters and the external parameters corresponding to the world coordinate system, which solves the traditional cumbersome process of manually finding the corner points of the calibration board. It simplifies the experimental process, is easy to operate, and lays the foundation for the three-dimensional reconstruction of the measured object.
发明内容Contents of the invention
本实用新型提出一种基于虚拟双目视觉原理的摄像机参数自动标定装置,解决了传统的人工寻找标定板角点的繁琐过程,简化了实验流程,便于操作。The utility model proposes an automatic camera parameter calibration device based on the principle of virtual binocular vision, which solves the traditional cumbersome process of manually finding the corner points of the calibration board, simplifies the experimental process, and is easy to operate.
本实用新型采用以下技术方案。The utility model adopts the following technical solutions.
一种基于虚拟双目视觉原理的摄像机参数自动标定装置,所述标定方法采用自动标定装置对摄像机参数进行标定,所述标定装置包括云台旋转支架、摄像机、外部触发电路、PC、绘有黑白格棋盘图案的标定板和两面成夹角设置的平面镜;所述外部触发电路与PC、云台旋转支架和摄像机相连;所述两面平面镜设于云台旋转支架后方;所述标定板置于云台旋转支架处;摄像机设于云台旋转支架前方且摄像方面朝向两平面镜;当摄像机对标定板摄像时,其摄取的标定板图像包括标定板在两平面镜内形成的左右两个虚像;PC经外部触发电路控制云台旋转支架使标定板多角度转动;当标定板每转动一个角度时,外部触发电路控制摄像机对标定板摄像;所述PC与摄像机相连并以OpenCV计算机视觉库对摄像机拍摄的标定板图像进行处理,以获取并标定摄像机的内部参数、畸变参数以及在世界坐标系下的外部参数。An automatic calibration device for camera parameters based on the principle of virtual binocular vision. The calibration method uses an automatic calibration device to calibrate the camera parameters. The calibration device includes a pan-tilt rotating bracket, a camera, an external trigger circuit, a PC, A calibration plate with a checkerboard pattern and two plane mirrors arranged at an angle; the external trigger circuit is connected to the PC, the pan-tilt rotating bracket and the camera; the two plane mirrors are arranged behind the pan-tilt rotating bracket; The camera is set at the front of the swivel bracket of the pan-tilt and the camera faces the two plane mirrors; when the camera takes pictures of the calibration board, the image of the calibration board it captures includes the left and right virtual images formed by the calibration board in the two plane mirrors; The external trigger circuit controls the pan-tilt rotation bracket to rotate the calibration board at multiple angles; when the calibration board rotates an angle, the external trigger circuit controls the camera to take pictures of the calibration board; the PC is connected to the camera and uses the OpenCV computer vision library to shoot the camera. The image of the calibration board is processed to obtain and calibrate the internal parameters of the camera, the distortion parameters and the external parameters in the world coordinate system.
所述标定板、摄像机均设于两面平面镜夹角的角平分线上。Both the calibration board and the camera are arranged on the bisector of the angle between the two plane mirrors.
所述标定板上的方格数量在阈值以上。The number of squares on the calibration board is above a threshold.
所述标定方法包括图像采集环节和图像处理环节;所述图像采集环节包括以下步骤;The calibration method includes an image acquisition link and an image processing link; the image acquisition link includes the following steps;
A1、先将两面呈一定角度的平面镜放置在标定板后方,摄像机放置在标定板前方,标定板固定在云台旋转支架上,摄像机、标定板、平面镜的中线位置应保证左右两个镜面的图像能够清晰并尽量居中,以便标定板转动时仍能在镜面中完整成像;A1. First place the plane mirror with a certain angle on both sides behind the calibration board, the camera is placed in front of the calibration board, and the calibration board is fixed on the pan/tilt rotating bracket. The midline positions of the camera, calibration board and plane mirror should ensure the images of the left and right mirrors It can be clear and centered as much as possible, so that the calibration plate can still be completely imaged in the mirror when it is rotated;
A2、拍摄时,先将标定板竖直放置,拍摄一张图像作为世界坐标系,然后通过PC控制外部触发电路使云台旋转支架自动转动不同角度,并通过外部触发电路触发摄像机经对标定板在平面镜中的虚像进行拍摄;A2. When shooting, first place the calibration board vertically, take an image as the world coordinate system, and then control the external trigger circuit through the PC to automatically rotate the pan/tilt rotation bracket to different angles, and trigger the camera through the external trigger circuit to align the calibration board The virtual image in the plane mirror is photographed;
A3、云台每转动一个角度,摄像机拍摄一张标定板图像,在摄像机的拍摄过程中,PC端鼠标光标会实时显示当前坐标点的位置,通过定义一个坐标范围,记录下标定板转动过程中标定板的坐标范围变化,将拍摄到的所有图像统一存储在图像处理的文件夹内。A3. Every time the gimbal rotates an angle, the camera shoots an image of the calibration board. During the shooting process of the camera, the mouse cursor on the PC side will display the position of the current coordinate point in real time. By defining a coordinate range, record the rotation process of the calibration board The coordinate range of the calibration plate changes, and all the captured images are uniformly stored in the image processing folder.
所述图像处理环节把拍摄到的平面镜中标定板的左、右虚像视为两平面镜内的左、右虚拟摄像机拍摄的标定板图像;通过对转动不同角度获得的多张标定板图像进行处理和计算,得到摄像机的内部参数和畸变参数;通过对世界坐标系下的标定板图像进行处理,得到摄像机的外部参数以及左虚拟摄像机和右虚拟摄像机的相对位姿参数;The image processing link regards the left and right virtual images of the calibration board in the captured plane mirrors as the calibration board images taken by the left and right virtual cameras in the two plane mirrors; process and process the multiple calibration board images obtained by rotating at different angles Calculate to obtain the internal parameters and distortion parameters of the camera; process the calibration plate image in the world coordinate system to obtain the external parameters of the camera and the relative pose parameters of the left virtual camera and the right virtual camera;
在图像处理环节中,为避免检测标定板的黑白格棋盘图案角点时左右两个图像相互影响,对左右两个镜像进行分别处理;In the image processing link, in order to avoid the mutual influence of the left and right images when detecting the corner points of the black and white checkerboard pattern of the calibration board, the left and right mirror images are processed separately;
首先处理左镜面图像,依次读入多张标定板的图像,设置标定板的角点数量和尺寸大小;依照记录下的标定板转动过程中的坐标范围变化,使用表示矩形区域的Rect命令,指定矩形的左上角坐标和矩形的长宽,即利用记录下的标定板转动的坐标范围变化来定义一个矩形区域从而截取出感兴趣区域,使得在该区域内左镜面的标定板处于中央位置并能够容纳标定板的转动范围;First, process the left mirror image, read in multiple images of the calibration board in sequence, and set the number and size of the corner points of the calibration board; according to the recorded coordinate range changes during the rotation of the calibration board, use the Rect command representing the rectangular area to specify The coordinates of the upper left corner of the rectangle and the length and width of the rectangle, that is, use the recorded changes in the coordinate range of the calibration plate rotation to define a rectangular area to intercept the region of interest, so that the calibration plate on the left mirror in this area is in the center and can be Accommodate the rotation range of the calibration plate;
在获取摄像机内部参数时和畸变参数时,先进行图像灰度化处理,接着利用OpenCV视觉库中的findChessboardCorners函数初步检测标定板上的角点信息,自动检索标定板内角点的像素坐标,按从左往右,从上至下的顺序一一排列,此时若有一些图片不能准确找到角点,则需重新设定感兴趣区域范围或者将这些图片删去;为了使提取到的角点坐标更加精确,利用find4QuadCornerSubpix函数精确提取亚像素角点并记录下提取的角点坐标信息,在此处理中,旋转的标定板图像应多于十张以保证准确率,若标定的图像数量少于所规定的数量,则需重新划定感兴趣区域;以标定板左上角第一个角点为原点,获取内角点的三维空间点坐标,也就是摄像机坐标系下的点坐标,令摄像机坐标系的xy平面位于标定板平面位置,即摄像机坐标系的z轴为零,按照标定板每个方格的大小按从左往右,从上至下的顺序一一初始化三维空间点的坐标;为了增加标定结果的准确性,需要拍摄大于十张的标定板图像联立多个方程进行求解;连续标定处理多张标定板转动的图像以得到精度更高的内部参数;利用calibrateCamera函数进行计算,可以得到左虚拟摄像机的内部参数、畸变参数;When obtaining the internal parameters of the camera and the distortion parameters, first perform image grayscale processing, and then use the findChessboardCorners function in the OpenCV vision library to initially detect the corner point information on the calibration board, and automatically retrieve the pixel coordinates of the inner corner points of the calibration board. From left to right, from top to bottom, if there are some pictures that cannot accurately find the corner points, you need to reset the scope of the area of interest or delete these pictures; in order to make the extracted corner point coordinates To be more precise, use the find4QuadCornerSubpix function to accurately extract sub-pixel corner points and record the extracted corner point coordinate information. In this process, more than ten images of the calibration plate should be rotated to ensure accuracy. If the number of calibrated images is less than the specified If the specified number is required, the region of interest needs to be redefined; take the first corner point in the upper left corner of the calibration board as the origin, and obtain the three-dimensional space point coordinates of the inner corner point, that is, the point coordinates in the camera coordinate system, so that the camera coordinate system The xy plane is located at the plane position of the calibration board, that is, the z-axis of the camera coordinate system is zero, and the coordinates of the three-dimensional space points are initialized one by one according to the size of each square of the calibration board in order from left to right and from top to bottom; in order to increase The accuracy of the calibration results requires taking more than ten images of the calibration board to solve multiple equations; continuous calibration processes multiple rotating images of the calibration board to obtain internal parameters with higher precision; use the calibrateCamera function to calculate, you can get Internal parameters and distortion parameters of the left virtual camera;
在获取左虚拟摄像机在世界坐标系下的外部参数时,读入已求得的左虚拟摄像机内部参数、畸变参数和拍摄到的处于世界坐标系下的单张图像,截取左感兴趣区域,利用cvFindExtrinsicCameraParams2函数按上述标定方法对处于世界坐标系下的图像进行处理,得到左虚拟摄像机在世界坐标系下的外部参数;When obtaining the external parameters of the left virtual camera in the world coordinate system, read in the obtained internal parameters of the left virtual camera, distortion parameters and the captured single image in the world coordinate system, intercept the left region of interest, and use The cvFindExtrinsicCameraParams2 function processes the image in the world coordinate system according to the above calibration method, and obtains the external parameters of the left virtual camera in the world coordinate system;
右镜面图像处理过程与左镜面相同,得到右虚拟摄像机内部参数和在世界坐标系下的外部参数;The image processing process of the right mirror is the same as that of the left mirror, and the internal parameters of the right virtual camera and the external parameters in the world coordinate system are obtained;
标定完成后,根据计算所得的角点图像坐标重投影至标定板上,与实际已知的图像坐标相对比,计算出每一张图像的标定误差以及总体的平均误差;在得出左右两台虚拟摄像机外部参数的基础上,利用StereoCalibrate函数计算得到左右两虚拟摄像机的相对旋转矩阵和平移向量,从而得到两个虚拟摄像机的相对位置关系。After the calibration is completed, the calculated corner image coordinates are re-projected to the calibration board, and compared with the actual known image coordinates, the calibration error of each image and the overall average error are calculated; On the basis of the external parameters of the virtual camera, use the StereoCalibrate function to calculate the relative rotation matrix and translation vector of the left and right virtual cameras, so as to obtain the relative position relationship of the two virtual cameras.
当涉及到截取左右两镜面图像单独处理的步骤时,由于截取感兴趣区域时坐标位置会发生改变,因而在提取角点的坐标值时要叠加上截取的感兴趣区域的长宽数值。When it comes to the step of intercepting the left and right mirror images for separate processing, since the coordinate position will change when intercepting the region of interest, the length and width values of the intercepted region of interest should be superimposed when extracting the coordinate values of the corner points.
所述标定板在云台旋转支架驱动下旋转,所述云台旋转支架可由PC控制或是由遥控器控制。The calibration plate rotates under the drive of the pan-tilt rotating bracket, and the pan-tilt rotating bracket can be controlled by a PC or a remote controller.
所述外部触发电路可控制摄像机进行延时拍摄而延时时间可以自定义。The external trigger circuit can control the camera to perform delayed shooting, and the delayed time can be customized.
本实用新型提出的基于OpenCV的图像处理方法,省去了人工寻找角点以及计算的过程,只需利用VC++为编程开发环境,通过编程实现对图像的处理,有利于后期三维重建工作的进一步开展。The image processing method based on OpenCV proposed by the utility model saves the process of manually looking for corner points and calculation, and only needs to use VC++ as the programming development environment to realize image processing through programming, which is conducive to the further development of the later three-dimensional reconstruction work .
本实用新型仅使用一台摄像机和两面平面镜便能够实现双目视觉三维重建,解决了传统的双目视觉技术存在的同步性差和成本高的问题;同时本实用新型利用外部触发电路控制标定板的自动转动,并控制摄像机延时拍摄,减少了人工干预带来的不确定性。The utility model can realize the three-dimensional reconstruction of binocular vision only by using one camera and two plane mirrors, which solves the problems of poor synchronization and high cost in the traditional binocular vision technology; at the same time, the utility model uses an external trigger circuit to control the calibration board. Automatically rotate and control the time-lapse shooting of the camera, reducing the uncertainty caused by manual intervention.
附图说明Description of drawings
下面结合附图和具体实施方式对本实用新型进一步详细的说明:Below in conjunction with accompanying drawing and specific embodiment the utility model is described in further detail:
附图1是本实用新型的流程示意图;Accompanying drawing 1 is the schematic flow sheet of the utility model;
附图2是本实用新型所用装置的示意图;Accompanying drawing 2 is the schematic diagram of the used device of the utility model;
附图3是本实用新型在图像处理中的流程示意图;Accompanying drawing 3 is the schematic flow chart of the utility model in image processing;
附图4是标定板的棋盘图案示意图;Accompanying drawing 4 is the checkerboard pattern schematic diagram of calibration plate;
图中:1-PC;2-外部触发电路;3-摄像机;4-云台旋转支架;5-标定板;6-左平面镜;7-右平面镜;8-左虚拟摄像机;9-右虚拟摄像机。In the figure: 1-PC; 2-external trigger circuit; 3-camera; 4-pan/tilt rotating bracket; 5-calibration board; 6-left plane mirror; 7-right plane mirror; .
具体实施方式Detailed ways
如图1-4所示,一种基于虚拟双目视觉原理的摄像机参数自动标定装置,所述标定方法采用自动标定装置对摄像机参数进行标定,所述标定装置包括云台旋转支架4、摄像机3、外部触发电路2、PC1、绘有黑白格棋盘图案的标定板5和两面成夹角设置的平面镜6和7;所述外部触发电路与PC、云台旋转支架和摄像机相连;所述两面平面镜设于云台旋转支架后方;所述标定板置于云台旋转支架处;摄像机设于云台旋转支架前方且摄像方面朝向两平面镜;当摄像机对标定板摄像时,其摄取的标定板图像包括标定板在两平面镜内形成的左右两个虚像;PC经外部触发电路控制云台旋转支架使标定板多角度转动;当标定板每转动一个角度时,外部触发电路控制摄像机对标定板摄像;所述PC与摄像机相连并以OpenCV计算机视觉库对摄像机拍摄的标定板图像进行处理,以获取并标定摄像机的内部参数、畸变参数以及在世界坐标系下的外部参数。As shown in Figures 1-4, a camera parameter automatic calibration device based on the principle of virtual binocular vision, the calibration method uses an automatic calibration device to calibrate the camera parameters, and the calibration device includes a pan/tilt rotating bracket 4, a camera 3 , external trigger circuit 2, PC1, the calibration plate 5 that is painted with black and white checkerboard pattern and the plane mirror 6 and 7 that two sides form an included angle and arrange; Described external trigger circuit links to each other with PC, pan tilt rotating support and video camera; Described two plane mirrors Be located at the rear of the pan-tilt rotating bracket; Described calibration plate is placed at the pan-tilt rotating bracket place; Video camera is located at the front of the pan-tilt rotating bracket and photographing aspect towards two plane mirrors; The left and right virtual images of the calibration board formed in the two plane mirrors; the PC controls the pan-tilt rotation bracket through the external trigger circuit to make the calibration board rotate at multiple angles; when the calibration board rotates an angle, the external trigger circuit controls the camera to take pictures of the calibration board; The above PC is connected to the camera and the calibration board image taken by the camera is processed with the OpenCV computer vision library to obtain and calibrate the camera's internal parameters, distortion parameters and external parameters in the world coordinate system.
所述标定板、摄像机均设于两面平面镜夹角的角平分线上。Both the calibration board and the camera are arranged on the bisector of the angle between the two plane mirrors.
所述标定板上的方格数量在阈值以上。The number of squares on the calibration board is above a threshold.
所述标定方法包括图像采集环节和图像处理环节;所述图像采集环节包括以下步骤;The calibration method includes an image acquisition link and an image processing link; the image acquisition link includes the following steps;
A1、先将两面呈一定角度的平面镜放置在标定板后方,摄像机放置在标定板前方,标定板固定在云台旋转支架上,摄像机、标定板、平面镜的中线位置应保证左右两个镜面的图像能够清晰并尽量居中,以便标定板转动时仍能在镜面中完整成像;A1. First place the plane mirror with a certain angle on both sides behind the calibration board, the camera is placed in front of the calibration board, and the calibration board is fixed on the pan/tilt rotating bracket. The midline positions of the camera, calibration board and plane mirror should ensure the images of the left and right mirrors It can be clear and centered as much as possible, so that the calibration plate can still be completely imaged in the mirror when it is rotated;
A2、拍摄时,先将标定板竖直放置,拍摄一张图像作为世界坐标系,然后通过PC控制外部触发电路使云台旋转支架自动转动不同角度,并通过外部触发电路触发摄像机经对标定板在平面镜中的虚像进行拍摄;A2. When shooting, first place the calibration board vertically, take an image as the world coordinate system, and then control the external trigger circuit through the PC to automatically rotate the pan/tilt rotation bracket to different angles, and trigger the camera through the external trigger circuit to align the calibration board The virtual image in the plane mirror is photographed;
A3、云台每转动一个角度,摄像机拍摄一张标定板图像,在摄像机的拍摄过程中,PC端鼠标光标会实时显示当前坐标点的位置,通过定义一个坐标范围,记录下标定板转动过程中标定板的坐标范围变化,将拍摄到的所有图像统一存储在图像处理的文件夹内。A3. Every time the gimbal rotates an angle, the camera shoots an image of the calibration board. During the shooting process of the camera, the mouse cursor on the PC side will display the position of the current coordinate point in real time. By defining a coordinate range, record the rotation process of the calibration board The coordinate range of the calibration plate changes, and all the captured images are uniformly stored in the image processing folder.
所述图像处理环节把拍摄到的平面镜中标定板的左、右虚像视为两平面镜内的左、右虚拟摄像机拍摄的标定板图像;通过对转动不同角度获得的多张标定板图像进行处理和计算,得到摄像机的内部参数和畸变参数;通过对世界坐标系下的标定板图像进行处理,得到摄像机的外部参数以及左虚拟摄像机8和右虚拟摄像机9的相对位姿参数;The image processing link regards the left and right virtual images of the calibration board in the captured plane mirrors as the calibration board images taken by the left and right virtual cameras in the two plane mirrors; process and process the multiple calibration board images obtained by rotating at different angles Calculate to obtain the internal parameters and distortion parameters of the camera; by processing the calibration plate image under the world coordinate system, obtain the external parameters of the camera and the relative pose parameters of the left virtual camera 8 and the right virtual camera 9;
在图像处理环节中,为避免检测标定板的黑白格棋盘图案角点时左右两个图像相互影响,对左右两个镜像进行分别处理;In the image processing link, in order to avoid the mutual influence of the left and right images when detecting the corner points of the black and white checkerboard pattern of the calibration board, the left and right mirror images are processed separately;
首先处理左镜面图像,依次读入多张标定板的图像,设置标定板的角点数量和尺寸大小;依照记录下的标定板转动过程中的坐标范围变化,使用表示矩形区域的Rect命令,指定矩形的左上角坐标和矩形的长宽,即利用记录下的标定板转动的坐标范围变化来定义一个矩形区域从而截取出感兴趣区域,使得在该区域内左镜面的标定板处于中央位置并能够容纳标定板的转动范围;First, process the left mirror image, read in multiple images of the calibration board in sequence, and set the number and size of the corner points of the calibration board; according to the recorded coordinate range changes during the rotation of the calibration board, use the Rect command representing the rectangular area to specify The coordinates of the upper left corner of the rectangle and the length and width of the rectangle, that is, use the recorded changes in the coordinate range of the calibration plate rotation to define a rectangular area to intercept the region of interest, so that the calibration plate on the left mirror in this area is in the center and can be Accommodate the rotation range of the calibration plate;
在获取摄像机内部参数时和畸变参数时,先进行图像灰度化处理,接着利用OpenCV视觉库中的findChessboardCorners函数初步检测标定板上的角点信息,自动检索标定板内角点的像素坐标,按从左往右,从上至下的顺序一一排列,此时若有一些图片不能准确找到角点,则需重新设定感兴趣区域范围或者将这些图片删去;为了使提取到的角点坐标更加精确,利用find4QuadCornerSubpix函数精确提取亚像素角点并记录下提取的角点坐标信息,在此处理中,旋转的标定板图像应多于十张以保证准确率,若标定的图像数量少于所规定的数量,则需重新划定感兴趣区域;以标定板左上角第一个角点为原点,获取内角点的三维空间点坐标,也就是摄像机坐标系下的点坐标,令摄像机坐标系的xy平面位于标定板平面位置,即摄像机坐标系的z轴为零,按照标定板每个方格的大小按从左往右,从上至下的顺序一一初始化三维空间点的坐标;为了增加标定结果的准确性,需要拍摄大于十张的标定板图像联立多个方程进行求解;连续标定处理多张标定板转动的图像以得到精度更高的内部参数;利用calibrateCamera函数进行计算,可以得到左虚拟摄像机的内部参数、畸变参数;When obtaining the internal parameters of the camera and the distortion parameters, first perform image grayscale processing, and then use the findChessboardCorners function in the OpenCV vision library to initially detect the corner point information on the calibration board, and automatically retrieve the pixel coordinates of the inner corner points of the calibration board. From left to right, from top to bottom, if there are some pictures that cannot accurately find the corner points, you need to reset the scope of the area of interest or delete these pictures; in order to make the extracted corner point coordinates To be more precise, use the find4QuadCornerSubpix function to accurately extract sub-pixel corner points and record the extracted corner point coordinate information. In this process, more than ten images of the calibration plate should be rotated to ensure accuracy. If the number of calibrated images is less than the specified If the specified number is required, the region of interest needs to be redefined; take the first corner point in the upper left corner of the calibration board as the origin, and obtain the three-dimensional space point coordinates of the inner corner point, that is, the point coordinates in the camera coordinate system, so that the camera coordinate system The xy plane is located at the plane position of the calibration board, that is, the z-axis of the camera coordinate system is zero, and the coordinates of the three-dimensional space points are initialized one by one according to the size of each square of the calibration board in order from left to right and from top to bottom; in order to increase The accuracy of the calibration results requires shooting more than ten images of the calibration board to solve multiple equations; continuous calibration processes multiple images of the calibration board to obtain internal parameters with higher precision; use the calibrateCamera function to calculate, you can get Internal parameters and distortion parameters of the left virtual camera;
在获取左虚拟摄像机在世界坐标系下的外部参数时,读入已求得的左虚拟摄像机内部参数、畸变参数和拍摄到的处于世界坐标系下的单张图像,截取左感兴趣区域,利用cvFindExtrinsicCameraParams2函数按上述标定方法对处于世界坐标系下的图像进行处理,得到左虚拟摄像机在世界坐标系下的外部参数;When obtaining the external parameters of the left virtual camera in the world coordinate system, read in the obtained internal parameters of the left virtual camera, distortion parameters and the captured single image in the world coordinate system, intercept the left region of interest, and use The cvFindExtrinsicCameraParams2 function processes the image in the world coordinate system according to the above calibration method, and obtains the external parameters of the left virtual camera in the world coordinate system;
右镜面图像处理过程与左镜面相同,得到右虚拟摄像机内部参数和在世界坐标系下的外部参数;The image processing process of the right mirror is the same as that of the left mirror, and the internal parameters of the right virtual camera and the external parameters in the world coordinate system are obtained;
标定完成后,根据计算所得的角点图像坐标重投影至标定板上,与实际已知的图像坐标相对比,计算出每一张图像的标定误差以及总体的平均误差;在得出左右两台虚拟摄像机外部参数的基础上,利用StereoCalibrate函数计算得到左右两虚拟摄像机的相对旋转矩阵和平移向量,从而得到两个虚拟摄像机的相对位置关系。After the calibration is completed, the calculated corner image coordinates are re-projected to the calibration board, and compared with the actual known image coordinates, the calibration error of each image and the overall average error are calculated; On the basis of the external parameters of the virtual camera, use the StereoCalibrate function to calculate the relative rotation matrix and translation vector of the left and right virtual cameras, so as to obtain the relative position relationship of the two virtual cameras.
当涉及到截取左右两镜面图像单独处理的步骤时,由于截取感兴趣区域时坐标位置会发生改变,因而在提取角点的坐标值时要叠加上截取的感兴趣区域的长宽数值。When it comes to the step of intercepting the left and right mirror images for separate processing, since the coordinate position will change when intercepting the region of interest, the length and width values of the intercepted region of interest should be superimposed when extracting the coordinate values of the corner points.
所述标定板在云台旋转支架驱动下旋转,所述云台旋转支架可由PC控制或是由遥控器控制。The calibration plate rotates under the drive of the pan-tilt rotating bracket, and the pan-tilt rotating bracket can be controlled by a PC or a remote controller.
所述外部触发电路可控制摄像机进行延时拍摄而延时时间可以自定义。The external trigger circuit can control the camera to perform delayed shooting, and the delayed time can be customized.
本标定方法同样适用于摄像机或普通相机的单目标定和基于双目视觉原理的两台摄像机或普通相机的标定。This calibration method is also applicable to single-target calibration of video cameras or ordinary cameras and calibration of two cameras or ordinary cameras based on the principle of binocular vision.
最后应当说明的是:以上实施例仅用以说明本实用新型的技术方案而非对其限制;尽管参照较佳实施例对本实用新型进行了详细的说明,所属领域的普通技术人员应当理解:依然可以对本实用新型的具体实施方式进行修改或者对部分技术特征进行等同替换;而不脱离本实用新型技术方案的精神,其均应涵盖在本实用新型请求保护的技术方案范围当中。Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present utility model and not to limit it; although the utility model has been described in detail with reference to the preferred embodiment, those of ordinary skill in the art should understand that: still The specific implementation of the utility model can be modified or some technical features can be equivalently replaced; without departing from the spirit of the technical solution of the utility model, all of them should be included in the scope of the technical solution claimed by the utility model.
Claims (4)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201820827846.6U CN209231985U (en) | 2018-05-31 | 2018-05-31 | A kind of camera parameters automatic calibration device based on virtual Binocular Vision Principle |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201820827846.6U CN209231985U (en) | 2018-05-31 | 2018-05-31 | A kind of camera parameters automatic calibration device based on virtual Binocular Vision Principle |
Publications (1)
Publication Number | Publication Date |
---|---|
CN209231985U true CN209231985U (en) | 2019-08-09 |
Family
ID=67496550
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201820827846.6U Expired - Fee Related CN209231985U (en) | 2018-05-31 | 2018-05-31 | A kind of camera parameters automatic calibration device based on virtual Binocular Vision Principle |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN209231985U (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110779933A (en) * | 2019-11-12 | 2020-02-11 | 广东省智能机器人研究院 | Surface point cloud data acquisition method and system based on 3D visual sensing array |
CN110874854A (en) * | 2020-01-19 | 2020-03-10 | 立得空间信息技术股份有限公司 | Large-distortion wide-angle camera binocular photogrammetry method based on small baseline condition |
CN111627048A (en) * | 2020-05-19 | 2020-09-04 | 浙江大学 | A Multi-Camera Collaborative Target Search Method |
-
2018
- 2018-05-31 CN CN201820827846.6U patent/CN209231985U/en not_active Expired - Fee Related
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110779933A (en) * | 2019-11-12 | 2020-02-11 | 广东省智能机器人研究院 | Surface point cloud data acquisition method and system based on 3D visual sensing array |
CN110874854A (en) * | 2020-01-19 | 2020-03-10 | 立得空间信息技术股份有限公司 | Large-distortion wide-angle camera binocular photogrammetry method based on small baseline condition |
CN111627048A (en) * | 2020-05-19 | 2020-09-04 | 浙江大学 | A Multi-Camera Collaborative Target Search Method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108830906B (en) | Automatic calibration method for camera parameters based on virtual binocular vision principle | |
CN106441138B (en) | Deformation monitoring method based on visual measurement | |
CN111345029B (en) | A target tracking method, device, movable platform and storage medium | |
CN106887023A (en) | For scaling board and its scaling method and calibration system that binocular camera is demarcated | |
CN113252309B (en) | Testing method, testing device and storage medium for near-eye display equipment | |
TWI530909B (en) | System and method for image composition | |
CN101630406B (en) | Camera calibration method and camera calibration device | |
CN107358577B (en) | Rapid splicing method of cubic panoramic image | |
CN110827392B (en) | Monocular image three-dimensional reconstruction method, system and device | |
CN112132906A (en) | A method and system for calibrating external parameters between a depth camera and a visible light camera | |
CN109920004B (en) | Image processing method, device, calibration object combination, terminal equipment and calibration system | |
CN209231985U (en) | A kind of camera parameters automatic calibration device based on virtual Binocular Vision Principle | |
CN103337094A (en) | Method for realizing three-dimensional reconstruction of movement by using binocular camera | |
JP2015203652A (en) | Information processing unit and information processing method | |
JP2016527478A (en) | 3D imaging device, 3D image creation method, and 3D imaging device setting method | |
CN108574825A (en) | Method and device for adjusting a pan-tilt camera | |
CN110602376B (en) | Snapshot method and device and camera | |
CN110456829A (en) | Positioning and tracing method, device and computer readable storage medium | |
CN115063455A (en) | Method and device for calibrating imaging of double-optical camera and double-optical camera | |
CN106447735A (en) | Panoramic camera geometric calibration processing method | |
TW201703506A (en) | Automatic calibration system and related automatic calibration method applied to a camera | |
CN112907647B (en) | A three-dimensional spatial dimension measurement method based on a fixed monocular camera | |
CN113763544B (en) | Image determination method, device, electronic device and computer readable storage medium | |
JP6483661B2 (en) | Imaging control apparatus, imaging control method, and program | |
CN106846284A (en) | Active-mode intelligent sensing device and method based on cell |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20190809 |
|
CF01 | Termination of patent right due to non-payment of annual fee |