CN103399652A - 3D (three-dimensional) input method on basis of OpenCV (open source computer vision library) camera calibration - Google Patents

3D (three-dimensional) input method on basis of OpenCV (open source computer vision library) camera calibration Download PDF

Info

Publication number
CN103399652A
CN103399652A CN2013103033996A CN201310303399A CN103399652A CN 103399652 A CN103399652 A CN 103399652A CN 2013103033996 A CN2013103033996 A CN 2013103033996A CN 201310303399 A CN201310303399 A CN 201310303399A CN 103399652 A CN103399652 A CN 103399652A
Authority
CN
China
Prior art keywords
chessboard
camera
image
angle point
input
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
Application number
CN2013103033996A
Other languages
Chinese (zh)
Other versions
CN103399652B (en
Inventor
王平
薛开
何波贤
王跃午
杨恒
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Harbin Engineering University
Original Assignee
Harbin Engineering University
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 Harbin Engineering University filed Critical Harbin Engineering University
Priority to CN201310303399.6A priority Critical patent/CN103399652B/en
Publication of CN103399652A publication Critical patent/CN103399652A/en
Application granted granted Critical
Publication of CN103399652B publication Critical patent/CN103399652B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Processing (AREA)
  • Length Measuring Devices By Optical Means (AREA)

Abstract

本发明涉及一种3D输入方法,具体涉及一种具有6自由度的基于OpenCV摄像机标定技术的3D输入方法。本发明包括:输入棋盘方格大小、角点数目以及摄像机输出图像的大小参数;判断本次输入的参数是否与上一次保存的棋盘方格大小、角点数目,输出图像大小一致;对摄像头进行标定,求解摄像机的内部参数矩阵以及摄像机镜头引起的畸形系数;对摄像头采集棋盘的图像进行灰度处理;提取图像上棋盘的角点信息;判断输入图像的角点数目与棋盘的角点总数是否一致;提取棋盘所有角点的位置信息,根据摄像头的内参矩阵以及畸形系数,分别求出棋盘的6个自由度信息。本发明克服了传统3D输入设备的结构复杂、成本高、维护困难等缺点。

Figure 201310303399

The invention relates to a 3D input method, in particular to a 3D input method with 6 degrees of freedom based on OpenCV camera calibration technology. The present invention comprises: input the size parameter of checkerboard grid size, the number of corner points and the camera output image; Judging whether the parameters input this time are consistent with the checkerboard grid size, the number of corner points and the size of the output image saved last time; Calibration, solving the internal parameter matrix of the camera and the distortion coefficient caused by the camera lens; performing grayscale processing on the image of the chessboard collected by the camera; extracting the corner information of the chessboard on the image; judging whether the number of corner points of the input image and the total number of corner points of the Consistent; extract the position information of all corner points of the chessboard, and calculate the six degrees of freedom information of the chessboard according to the internal reference matrix of the camera and the deformity coefficient. The invention overcomes the disadvantages of complex structure, high cost, difficult maintenance and the like of the traditional 3D input device.

Figure 201310303399

Description

A kind of input method of 3D based on the OpenCV camera calibration
Technical field
The present invention relates to a kind of 3D input method, be specifically related to a kind of 3D input method based on OpenCV camera calibration technology with 6DOF.
Background technology
Traditional 2D input equipment,, as trace ball, mouse and plotting apparatus etc., only provide plane (two dimension) positional information, and its three-dimensional position and directional information in space coordinates can not be provided.In order to make up the deficiency of 2D input equipment, a lot of three-dimensional input equipments have appearred in recent years, they are widely applied to the numerous areas such as amusement, robot simulation, medical science, industry, input equipment as three-dimensional operating system, the multidimensional of various game class, simulation class virtual scene is controlled, the principal and subordinate of robot control system, aerial vehicle simulation, operation control etc.
Current main-stream 3D input equipment can be divided into mechanical type, electromagnetic type, optical profile type, acoustics formula and inertia-type etc. according to principle of work, and these device structures are complicated, and line is many, and cost is high, and Maintenance Difficulty should use very inconvenient.The present invention is based on cross-platform computer vision storehouse OpenCV camera calibration technology, utilize general network video camera and PC (perhaps flush bonding processor) to realize chessboard spatial pose accurate Calculation, then with the input message of chessboard posture information as system, for new field has been opened up in the application of 3D input equipment.
Summary of the invention
Order of the present invention be to provide a kind of simple in structure, line is few, easy for installation, cost is low, the technology based on the OpenCV camera calibration of easy realization, has three-dimensional (3D) input method of 6DOF.
The object of the present invention is achieved like this:
(1) size parameter of input checker size, angle point number and video camera output image;
Checker size, angle point number that whether the parameter that (2) judges this input preserves with the last time, the output image in the same size, if consistent, program execution step (3), otherwise program execution step (4);
(3) camera is demarcated, is solved the inner parameter matrix of video camera and the lopsided coefficient that camera lens causes:
1) input need to be carried out the amount of images of camera calibration;
2) mobile or rotation chessboard arrives different positions, and the image by the camera acquisition chessboard, be numbered in order and preserve;
3) image that gathers is carried out gray scale and process, extract the angle point information of checkerboard image;
4) whether the angle point quantity of the checkerboard image that extracts of judgement is consistent with the angle point sum of chessboard, if unanimously, carry out 5), if inconsistent, step 2 again), gather next pictures;
5) extract the information of all angle points of chessboard, and interim the preservation;
6) judge whether the amount of images that video camera demarcates is identical with the number of setting, and, if different, returns to step 2) continue to gather picture, if identical, execution step 7);
7) collect the chessboard angle point information of every different angles, calculate internal reference matrix and the lopsided coefficient of camera;
The internal reference matrix that 8) will calculate and lopsided coefficient, preserve into the XML file, and releasing memory, execution step 4);
(4) image of camera collection chessboard carried out the gray scale processing;
(5) extract the angle point information of chessboard on image;
(6) judge whether the angle point number of input picture is consistent with the angle point sum of chessboard,, if inconsistent, extracts new image, re-executes step (4), if consistent, execution step (7);
(7) extract the positional information of all angle points of chessboard, according to internal reference matrix and the lopsided coefficient of camera, solve the pose of current chessboard, pass through space analysis, obtain respectively 6 degree of freedom information of chessboard, be position (x, y, z) and attitude (γ, β, α), return to finally step (4) and carry out new round cycle calculations, until extracted all images.
Beneficial effect of the present invention is:
The present invention uses chessboard in the movement in space or the rotation amount input message as the 3D input equipment, has overcome the shortcomings such as complex structure, the cost of traditional 3D input equipment be high, difficult in maintenance.Through experiment test, this 3D input equipment can obtain and effectively process the pose of chessboard more accurately, realizes operator's control intention.
Description of drawings
Figure 13 D input equipment schematic diagram;
Figure 23 D input equipment process flow diagram;
Fig. 3 camera calibration process flow diagram.
Embodiment
Below in conjunction with accompanying drawing, the present invention is described further.
The present invention is with a regular black and white chessboard, a Daepori open network video camera and a PC (or embedded microprocessor), camera calibration technology based on OpenCV visual processes storehouse, picture by camera acquisition, and carry out image and process, calculate in real time the chessboard spatial pose, use the 3D input equipment of chessboard pose as input message.
At first the present invention uses the chessboard picture of camera acquisition diverse location, utilize the camera calibration technology of OpenCV, extract the corner location information in chessboard, utilize the corresponding point of angle point on chessboard and its image to carry out direct linear transformation's (DLT conversion) and least square method is determined the inner parameter of camera and, by the lopsided coefficient that camera lens causes, generated and preserve the XML file of video camera internal reference matrix and lopsided coefficient; Then take in real time the chessboard picture by video camera, and picture is carried out gray scale process; Identify and extract the angle point of chessboard, whether judgement is consistent with the real angle point number of chessboard by the chessboard angle point number of identification; , if the number of angle point is consistent, calculate the positional information of chessboard angle point; In conjunction with the corner location information of the internal reference that has solved, lopsided coefficient and chessboard, solve the chessboard volume coordinate information take video camera as initial point, this chessboard volume coordinate is just as the real-time input message of 3D input equipment.
As shown in Figure 1: this equipment is by a regular black and white chessboard (1), general network camera (2), PC or embedded microprocessor (3), form (5) based on function library (4) and the data output unit of OpenCV camera calibration technology.
At first, prepare a black and white chessboard, the checker size is s, and the angle point number is that the parameter of a * b(chessboard can design according to real needs); Then by USB interface, camera is connected with PC, starts video camera, set corresponding initiation parameter, last artificial mobile or rotation chessboard, allow video camera capture in real time the picture frame that comprises chessboard and to process.Idiographic flow as shown in Figure 2, carry out according to the following steps by specific algorithm and operation:
Steps A: at first checker size and chessboard angle point total number, and the size parameter input of video camera output picture;
Step B: according to grid size and angle point number that whether the parameter of this input preserves with the last time, the image in the same size, judge whether system needs video camera is demarcated again, if consistent, program judgement Yes, program enters step C, otherwise program enters step D;
Step C: video camera is demarcated, solved the inner parameter matrix of video camera and the lopsided coefficient that camera lens causes, for solving the chessboard pose, get ready, idiographic flow as shown in Figure 3.
Step C-1: input need to be carried out the number of pictures of camera calibration;
Step C-2: mobile or rotation chessboard arrives different positions, and passes through the image of camera acquisition chessboard, is numbered in order and preserves;
Step C-3: the picture of above-mentioned collection is carried out gray scale process, call cvFindChessboardCorners() function extracts the angle point information of chessboard picture;
Step C-4: whether the angle point number of judgement input picture is consistent with the angle point sum of chessboard,, if consistent, carries out C-5,, if inconsistent, returns to step C-2, next pictures of Resurvey;
Step C-5: after the success of picture Corner Detection, call cvFind Corner SubPix () and extract the information of all angle points of chessboard, and interim the preservation;
Step C-6: whether the number of pictures that camera calibration is carried out in judgement is identical with the number of setting,, if different, return to step C-2 and continues to gather picture;
Step C-7: collect the chessboard angle point information of every different angles, call cvCalibrateCamera2 () function and calculate internal reference matrix and the lopsided coefficient of camera;
Step C-8:, calculating internal reference matrix and lopsided coefficient, preserve into the XML file, and releasing memory, and recall to master routine step D.
Step D:, by the picture of camera collection chessboard, then carry out gray scale and process;
Step e: call cvFind Chessboard Corners() function extracts the angle point information of chessboard on picture;
Step F: whether the angle point number of judgement input picture is consistent with the angle point sum of chessboard,, if inconsistent, returns to step D, new chessboard picture of Resurvey;
Step I: call cvFind Corner SubPix () and extract the positional information of all angle points of chessboard, and in conjunction with internal reference matrix and the lopsided coefficient of the above-mentioned video camera of having preserved, call the pose that cvFind Extrinsic Camera Params2 () function solves current chessboard,, finally by space analysis, obtain respectively 6 degree of freedom information of chessboard, be position (x, y, z) and attitude (γ, β, α), return to finally step D and carry out new round cycle calculations.
So far, by the agency of is complete based on the method for the 3D input equipment of camera calibration technology, in every case any simple modification, equivalent variations is carried out in above enforcement, all belongs in the scope of technical solution of the present invention.

Claims (1)

1. input method of the 3D based on the OpenCV camera calibration is characterized in that:
(1) size parameter of input checker size, angle point number and video camera output image;
Checker size, angle point number that whether the parameter that (2) judges this input preserves with the last time, the output image in the same size, if consistent, program execution step (3), otherwise program execution step (4);
(3) camera is demarcated, is solved the inner parameter matrix of video camera and the lopsided coefficient that camera lens causes:
1) input need to be carried out the amount of images of camera calibration;
2) mobile or rotation chessboard arrives different positions, and the image by the camera acquisition chessboard, be numbered in order and preserve;
3) image that gathers is carried out gray scale and process, extract the angle point information of checkerboard image;
4) whether the angle point quantity of the checkerboard image that extracts of judgement is consistent with the angle point sum of chessboard, if unanimously, carry out 5), if inconsistent, step 2 again), gather next pictures;
5) extract the information of all angle points of chessboard, and interim the preservation;
6) judge whether the amount of images that video camera demarcates is identical with the number of setting, and, if different, returns to step 2) continue to gather picture, if identical, execution step 7);
7) collect the chessboard angle point information of every different angles, calculate internal reference matrix and the lopsided coefficient of camera;
The internal reference matrix that 8) will calculate and lopsided coefficient, preserve into the XML file, and releasing memory, execution step 4);
(4) image of camera collection chessboard carried out the gray scale processing;
(5) extract the angle point information of chessboard on image;
(6) judge whether the angle point number of input picture is consistent with the angle point sum of chessboard,, if inconsistent, extracts new image, re-executes step (4), if consistent, execution step (7);
(7) extract the positional information of all angle points of chessboard, according to internal reference matrix and the lopsided coefficient of camera, solve the pose of current chessboard, pass through space analysis, obtain respectively 6 degree of freedom information of chessboard, be position (x, y, z) and attitude (γ, β, α), return to finally step (4) and carry out new round cycle calculations, until extracted all images.
CN201310303399.6A 2013-07-19 2013-07-19 3D (three-dimensional) input method on basis of OpenCV (open source computer vision library) camera calibration Expired - Fee Related CN103399652B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310303399.6A CN103399652B (en) 2013-07-19 2013-07-19 3D (three-dimensional) input method on basis of OpenCV (open source computer vision library) camera calibration

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310303399.6A CN103399652B (en) 2013-07-19 2013-07-19 3D (three-dimensional) input method on basis of OpenCV (open source computer vision library) camera calibration

Publications (2)

Publication Number Publication Date
CN103399652A true CN103399652A (en) 2013-11-20
CN103399652B CN103399652B (en) 2017-02-22

Family

ID=49563292

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310303399.6A Expired - Fee Related CN103399652B (en) 2013-07-19 2013-07-19 3D (three-dimensional) input method on basis of OpenCV (open source computer vision library) camera calibration

Country Status (1)

Country Link
CN (1) CN103399652B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105791655A (en) * 2014-12-19 2016-07-20 宁波舜宇光电信息有限公司 Method for computing lens distortion of photographing module
CN106708256A (en) * 2016-11-14 2017-05-24 北京视据科技有限公司 Opencv and easyar based virtual key trigger method
CN110363821A (en) * 2019-07-12 2019-10-22 顺丰科技有限公司 Acquisition methods, device, camera and the storage medium at monocular camera installation deviation angle
CN111540028A (en) * 2020-07-07 2020-08-14 昆山丘钛微电子科技有限公司 Method, device, equipment and medium for drawing checkerboard test chart

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100201809A1 (en) * 2008-05-19 2010-08-12 Panasonic Corporation Calibration method, calibration device, and calibration system including the device
CN101901485A (en) * 2010-08-11 2010-12-01 华中科技大学 3D free head moving type gaze tracking system
CN101980299A (en) * 2010-11-24 2011-02-23 河海大学 Camera Mapping Method Based on Chessboard Calibration
JP2012058188A (en) * 2010-09-13 2012-03-22 Ricoh Co Ltd Calibration device, distance measurement system, calibration method, and calibration program
CN102521816A (en) * 2011-11-25 2012-06-27 浪潮电子信息产业股份有限公司 Real-time wide-scene monitoring synthesis method for cloud data center room

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100201809A1 (en) * 2008-05-19 2010-08-12 Panasonic Corporation Calibration method, calibration device, and calibration system including the device
CN101901485A (en) * 2010-08-11 2010-12-01 华中科技大学 3D free head moving type gaze tracking system
JP2012058188A (en) * 2010-09-13 2012-03-22 Ricoh Co Ltd Calibration device, distance measurement system, calibration method, and calibration program
CN101980299A (en) * 2010-11-24 2011-02-23 河海大学 Camera Mapping Method Based on Chessboard Calibration
CN102521816A (en) * 2011-11-25 2012-06-27 浪潮电子信息产业股份有限公司 Real-time wide-scene monitoring synthesis method for cloud data center room

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
杨幸芳等: "用于摄像机标定的棋盘图像角点检测新算法", 《仪器仪表学报》, vol. 32, no. 5, 31 May 2011 (2011-05-31) *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105791655A (en) * 2014-12-19 2016-07-20 宁波舜宇光电信息有限公司 Method for computing lens distortion of photographing module
CN106708256A (en) * 2016-11-14 2017-05-24 北京视据科技有限公司 Opencv and easyar based virtual key trigger method
CN106708256B (en) * 2016-11-14 2018-05-25 北京视据科技有限公司 virtual key triggering method based on opencv and easyar
CN110363821A (en) * 2019-07-12 2019-10-22 顺丰科技有限公司 Acquisition methods, device, camera and the storage medium at monocular camera installation deviation angle
CN111540028A (en) * 2020-07-07 2020-08-14 昆山丘钛微电子科技有限公司 Method, device, equipment and medium for drawing checkerboard test chart

Also Published As

Publication number Publication date
CN103399652B (en) 2017-02-22

Similar Documents

Publication Publication Date Title
CN110599540B (en) Real-time three-dimensional human body shape and posture reconstruction method and device under multi-viewpoint camera
CN112686877B (en) Construction and measurement method and system of 3D house damage model based on binocular camera
CN104851104B (en) Using the flexible big view calibration method of target high speed camera close shot
CN104992441B (en) A kind of real human body three-dimensional modeling method towards individualized virtual fitting
CN102638653B (en) Automatic face tracing method on basis of Kinect
CN102982341B (en) Self-intended crowd density estimation method for camera capable of straddling
CN104036488B (en) Binocular vision-based human body posture and action research method
KR20220160066A (en) Image processing method and apparatus
CN105957090B (en) A kind of monocular vision pose measuring method and system based on Davinci technology
CN103607584B (en) Real-time registration method for depth maps shot by kinect and video shot by color camera
CN105069751B (en) A kind of interpolation method of depth image missing data
CN104050859A (en) Interactive digital stereoscopic sand table system
CN109920000B (en) A dead-end augmented reality method based on multi-camera collaboration
CN103839277A (en) Mobile augmented reality registration method of outdoor wide-range natural scene
CN104700385B (en) Binocular vision positioning device based on FPGA
CN110706291A (en) A visual measurement method suitable for the three-dimensional trajectory of moving objects in pool experiments
CN111399634B (en) Method and device for gesture-guided object recognition
TWI550555B (en) Method for three-dimensional geometric measurement
CN105987685A (en) An assistant system for insect behavior research based on binocular vision
CN107977996A (en) Space target positioning method based on target calibrating and positioning model
CN108492017A (en) A kind of product quality information transmission method based on augmented reality
CN103399652A (en) 3D (three-dimensional) input method on basis of OpenCV (open source computer vision library) camera calibration
CN109961471A (en) A kind of mask method, device and the electronic equipment of objects in images position
CN107146223A (en) An analysis system and method for displacement coupling of transmission towers and transmission lines
Nguyen et al. A comprehensive RGB-D dataset for 6D pose estimation for industrial robots pick and place: Creation and real-world validation

Legal Events

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

Granted publication date: 20170222