CN103399652B - 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 PDFInfo
- Publication number
- CN103399652B CN103399652B CN201310303399.6A CN201310303399A CN103399652B CN 103399652 B CN103399652 B CN 103399652B CN 201310303399 A CN201310303399 A CN 201310303399A CN 103399652 B CN103399652 B CN 103399652B
- Authority
- CN
- China
- Prior art keywords
- chessboard
- camera
- angle point
- input
- image
- 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
- 238000000034 method Methods 0.000 title claims abstract description 15
- 239000011159 matrix material Substances 0.000 claims abstract description 15
- 239000000284 extract Substances 0.000 claims description 13
- 238000004458 analytical method Methods 0.000 claims description 3
- 238000004364 calculation method Methods 0.000 claims description 3
- 230000002159 abnormal effect Effects 0.000 abstract description 3
- 238000012423 maintenance Methods 0.000 abstract description 3
- 238000012545 processing Methods 0.000 abstract description 3
- 241001270131 Agaricus moelleri Species 0.000 abstract 1
- 238000005516 engineering process Methods 0.000 description 7
- 230000006870 function Effects 0.000 description 3
- 238000004088 simulation Methods 0.000 description 2
- 241000208340 Araliaceae Species 0.000 description 1
- 235000005035 Panax pseudoginseng ssp. pseudoginseng Nutrition 0.000 description 1
- 235000003140 Panax quinquefolius Nutrition 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 230000007812 deficiency Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 238000002474 experimental method Methods 0.000 description 1
- 235000008434 ginseng Nutrition 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 239000000203 mixture Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Landscapes
- Image Processing (AREA)
- Length Measuring Devices By Optical Means (AREA)
Abstract
The invention relates to a 3D (three-dimensional) input method, in particular to a 3D input method on the basis of OpenCV (open source computer vision library) camera calibration with six degrees of freedom. The 3D input method includes inputting parameters of sizes of squares of a chessboard, the quantity of corners and sizes of outputted images of a camera; judging whether the currently inputted parameters are consistent with previously stored parameters of sizes of the squares of the chessboard, the quantity of the corners and sizes of outputted images or not; calibrating the camera and solving an internal parameter matrix of the camera and abnormal coefficients caused by a lens of the camera; processing gray scales of images, which are acquired by the camera, of the chessboard; extracting chessboard corner information in the images; judging whether the quantity of corners of inputted images is consistent with the total quantity of the corners of the chessboard or not; extracting position information of all the corners of the chessboard, and respectively solving information of the six degrees of freedom of the chessboard according to the internal parameter matrix of the camera and the abnormal coefficients. The 3D input method has the advantage that shortcomings of complicated structure, high cost, difficulty in maintenance and the like of the traditional 3D input equipment are overcome.
Description
Technical field
The present invention relates to a kind of 3D input method and in particular to a kind of have 6DOF based on OpenCV video camera mark
Determine the 3D input method of technology.
Background technology
Traditional 2D input equipment, such as trace ball, mouse and plotter etc., provide only plane (two-dimentional) positional information, no
It is provided that its three-dimensional position in space coordinates and directional information.In order to make up the deficiency of 2D input equipment, go out in recent years
A lot of three-dimensional input equipments are showed, they are widely applied to the numerous areas such as amusement, robot simulation, medical science, industry, such as three-dimensional
The input equipment of operating system, various game class, the multidimensional of simulation class virtual scene control, and robot master & slave control system flies
Row device emulates, and operation controls etc..
Current main-stream 3D input equipment according to operation principle can be divided into mechanically, electromagnetic type, optical profile type, acoustics formula and inertia
Formula etc., these device structures are complicated, and line is many, high cost, Maintenance Difficulty, and application is inconvenient.The present invention is based on across flat
Platform computer vision storehouse OpenCV camera calibration technology, using ordinary network camera and PC (or embedded processing
Device) realize chessboard spatial pose is accurately calculated, then using chessboard posture information as system input information, be 3D input set
New field has been opened up in standby application.
Content of the invention
The mesh of the present invention be provide that a kind of structure is simple, line is few, easy for installation, low cost, easily realize based on
The technology of OpenCV camera calibration, 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 camera output;
(2) judge the parameter of this input whether with the last checker size preserving, angle point number, output image
In the same size, if unanimously, routine executing step (3), otherwise routine executing step (4);
(3) camera is demarcated, solve the deformity that the inner parameter matrix of video camera and camera lens cause
Coefficient:
1) input needs to carry out the amount of images of camera calibration;
2) move or rotation chessboard is to different positions, by the image of camera acquisition chessboard, be numbered in order
And preserve;
3) gray proces are carried out to the image of collection, extract the angle point information of checkerboard image;
4) judge whether the angle point quantity of checkerboard image extracted is consistent with the angle point sum of chessboard, if unanimously, executes
5), if inconsistent, step 2 again), gather next pictures;
5) extract the information of all angle points of chessboard, and preserve temporarily;
6) judge whether the amount of images that video camera is demarcated is identical with the number setting, if it is different, return to step 2)
Continue collection picture, if identical, execution step 7);
7) collect the chessboard angle point information of every different angles, calculate the internal reference matrix of camera and lopsided coefficient;
8) by calculated internal reference matrix and lopsided coefficient, preserve into XML file, and releasing memory, execution step
4);
(4) image gathering chessboard to camera carries out gray proces;
(5) extract the angle point information of chessboard on image;
(6) judge whether the angle point number of input picture is consistent with real chessboard angle point sum, if inconsistent, extract new
Image, re-execute step (4), if unanimously, execution step (7);
(7) extract the positional information of all angle points of chessboard, the internal reference matrix according to camera and lopsided coefficient, solve
The pose of current chessboard, by space analysis, obtains 6 free degree information of chessboard, i.e. position (x, y, z) and attitude respectively
(γ, β, α), finally returns to step (4) and carries out new round cycle calculations, until having extracted all images.
The beneficial effects of the present invention is:
The present invention is used the movement in space for the chessboard or rotation amount as the input information of 3D input equipment, overcomes tradition
The complex structure of 3D input equipment, high cost, difficult in maintenance the shortcomings of.Through experiment test, this 3D input equipment can be more accurate
Really obtain the pose of simultaneously effective process chessboard, the control realizing operator is intended to.
Brief description
Fig. 1 3D input equipment schematic diagram;
Fig. 2 3D input equipment flow chart;
Fig. 3 camera calibration flow chart.
Specific embodiment
Below in conjunction with the accompanying drawings the present invention is described further.
The present invention is (or embedded with a regular black and white chessboard, an ordinary network camera and PC
Microprocessor), based on the camera calibration technology in OpenCV visual processes storehouse, by the picture of camera acquisition, and carry out figure
As processing, calculate chessboard spatial pose in real time, using chessboard pose as the 3D input equipment of input information.
The present invention first by the chessboard picture of camera acquisition diverse location, using the camera calibration skill of OpenCV
Art, extracts the corner location information in chessboard, and the corresponding points using the angle point on chessboard and its image carry out direct linear transformation
(DLT conversion) and least square method come the inner parameter to determine camera and the lopsided coefficient being caused by camera lens,
Generate and preserve video camera internal reference matrix and the XML file of lopsided coefficient;Then pass through video camera captured in real-time chessboard picture, and
Gray proces are carried out to picture;Identify and extract the angle point of chessboard, judge that the chessboard angle point number by identification is true with chessboard
Angle point number whether consistent;If the number of angle point is consistent, then carry out calculating the positional information of chessboard angle point;In conjunction with
The corner location information of the internal reference, lopsided coefficient and chessboard that solve, solves the chessboard space coordinates with video camera as initial point
Information, this chessboard space coordinates just real-time input information as 3D input equipment.
As shown in Figure 1:This equipment is by regular black and white chessboard (1), general network camera (2), a PC or embedding
Enter microsever (3), the function library (4) based on OpenCV camera calibration technology and data outputting unit composition (5).
First, prepare a black and white chessboard, checker size is s, angle point number is that (parameter of chessboard can root for a × b
According to real needs design);Then by USB interface, camera is connected with PC, starts video camera, set corresponding initialization
Parameter, finally artificially moves or rotates chessboard, allows video camera real-time capture to the picture frame comprising chessboard and to be processed.Specifically
Flow process is as shown in Fig. 2 specific algorithm and operation are carried out according to the following steps:
Step A:First checker size and chessboard angle point total number, and video camera exports the size ginseng of picture
Number input;
Step B:The grid size whether being preserved with the last time according to the parameter that this inputs and angle point number, image is big
Little consistent, judgement system re-scales the need of to video camera, if unanimously, program judges Yes, then program enters step
Rapid C, otherwise program entrance step D;
Step C:Video camera is demarcated, solves the inner parameter matrix of video camera and that camera lens cause is abnormal
Shape coefficient, gets ready for solving chessboard pose, idiographic flow is as shown in Figure 3.
Step C-1:Input needs to carry 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, in order
It is numbered and preserve;
Step C-3:Gray proces are carried out to the picture of above-mentioned collection, calls cvFindChessboardCorners () letter
Number extracts the angle point information of chessboard picture;
Step C-4:Judge the angle point number of input picture with whether consistent with the angle point sum of real chessboard, if one
Cause, then execute C-5, if inconsistent, return to step C-2, next pictures of Resurvey;
Step C-5:After picture Corner Detection success, cvFindCornerSubPix () is called to extract all angle points of chessboard
Information, and preserve temporarily;
Step C-6:Judge whether the number of pictures carrying out camera calibration is identical with the number setting, if it is different, returning
Step C-2 continues collection picture;
Step C-7:Collect the chessboard angle point information of every different angles, call cvCalibrateCamera2 () function meter
Calculate the internal reference matrix of camera and lopsided coefficient;
Step C-8:Being calculated internal reference matrix and lopsided coefficient, preserve into XML file, and releasing memory, and adjust
Return main program step D.
Step D:Gather the picture of chessboard by camera, then carry out gray proces;
Step E:CvFindChessboardCorners () function is called to extract the angle point information of chessboard on picture;
Step F:Judge whether the angle point number inputting picture is consistent with the angle point sum of real chessboard, if inconsistent,
Return to step D, the new chessboard picture of Resurvey one;
Step I:Call cvFindCornerSubPix () extract all angle points of chessboard positional information, and combine above-mentioned
The internal reference matrix of saved video camera and lopsided coefficient, call cvFindExtrinsicCameraParams2 () function to ask
Solve the pose of current chessboard, finally by space analysis, obtain 6 free degree information of chessboard, i.e. position (x, y, z) respectively
With attitude (γ, β, α), finally return to step D and carry out new round cycle calculations.
So far, the method by the agency of of the 3D input equipment based on camera calibration technology finishes, as long as implementing to above
Carry out any simple modification, equivalent variations, belong in the range of technical solution of the present invention.
Claims (1)
1. a kind of 3D input method based on OpenCV camera calibration it is characterised in that:
(1) size parameter of input checker size, chessboard angle point total number and camera output;
(2) judge the parameter of this input whether with the last checker size preserving, chessboard angle point total number, video camera
Output image in the same size, if unanimously, routine executing step (3), otherwise routine executing step (4);
(3) camera is demarcated, solve the lopsided coefficient that the inner parameter matrix of video camera and camera lens cause:
1) input needs to carry out the amount of images of camera calibration;
2) move or rotation chessboard is to different positions, by the image of camera acquisition chessboard, be numbered in order and protect
Deposit;
3) gray proces are carried out to the image of collection, extract the angle point information of checkerboard image;
4) judge whether the angle point quantity of checkerboard image extracted is consistent with the chessboard angle point total number of input, if unanimously, holds
Row 5), if inconsistent, step 2 again), gather next pictures;
5) extract the information of all angle points of chessboard, and preserve temporarily;
6) judge whether the amount of images that video camera is demarcated is identical with the number setting, if it is different, return to step 2) continue
Collection picture, if identical, execution step 7);
7) collect the chessboard angle point information of every different angles, calculate the internal reference matrix of camera and lopsided coefficient;
8) by calculated internal reference matrix and lopsided coefficient, preserve into XML file, and releasing memory, execution step (4);
(4) image gathering chessboard to camera carries out gray proces;
(5) extract the angle point information of chessboard on image;
(6) judge whether the angle point number of input picture is consistent with real chessboard angle point total number, if inconsistent, extract new
Image, re-executes step (4), if unanimously, execution step (7);
(7) positional information of all angle points of chessboard, the internal reference matrix according to saved video camera and lopsided coefficient are extracted,
Solve the pose of current chessboard, by space analysis, obtain 6 free degree information of chessboard respectively, that is, position (x, y, z) and
Attitude (γ, β, α), finally returns to step (4) and carries out new round cycle calculations, until having extracted all images.
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 CN103399652A (en) | 2013-11-20 |
CN103399652B true 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) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105791655A (en) * | 2014-12-19 | 2016-07-20 | 宁波舜宇光电信息有限公司 | Method for computing lens distortion of photographing module |
CN106708256B (en) * | 2016-11-14 | 2018-05-25 | 北京视据科技有限公司 | virtual key triggering method based on opencv and easyar |
CN110363821B (en) * | 2019-07-12 | 2021-09-28 | 顺丰科技有限公司 | Monocular camera installation deviation angle acquisition method and device, camera and storage medium |
CN111540028B (en) * | 2020-07-07 | 2020-10-16 | 昆山丘钛微电子科技有限公司 | Method, device, equipment and medium for drawing checkerboard test chart |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101901485A (en) * | 2010-08-11 | 2010-12-01 | 华中科技大学 | 3D free head moving type gaze tracking system |
CN101980299A (en) * | 2010-11-24 | 2011-02-23 | 河海大学 | Chessboard calibration-based camera mapping method |
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 |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101755190B (en) * | 2008-05-19 | 2012-02-22 | 松下电器产业株式会社 | Calibration method, calibration device, and calibration system having the device |
-
2013
- 2013-07-19 CN CN201310303399.6A patent/CN103399652B/en not_active Expired - Fee Related
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
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 | 河海大学 | Chessboard calibration-based camera mapping method |
CN102521816A (en) * | 2011-11-25 | 2012-06-27 | 浪潮电子信息产业股份有限公司 | Real-time wide-scene monitoring synthesis method for cloud data center room |
Non-Patent Citations (1)
Title |
---|
用于摄像机标定的棋盘图像角点检测新算法;杨幸芳等;《仪器仪表学报》;20110531;第32卷(第5期);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN103399652A (en) | 2013-11-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111738261B (en) | Single-image robot unordered target grabbing method based on pose estimation and correction | |
US11049280B2 (en) | System and method for tying together machine vision coordinate spaces in a guided assembly environment | |
CN110599541B (en) | Method and device for calibrating multiple sensors and storage medium | |
CN105225269B (en) | Object modelling system based on motion | |
CN104463108B (en) | A kind of monocular real time target recognitio and pose measuring method | |
CN104574267B (en) | Bootstrap technique and information processing equipment | |
KR102110123B1 (en) | Automated frame of reference calibration for augmented reality | |
CN105094335B (en) | Situation extracting method, object positioning method and its system | |
CN110400315A (en) | A kind of defect inspection method, apparatus and system | |
CN106600627A (en) | Rigid body motion capturing method and system based on mark point | |
CN103399652B (en) | 3D (three-dimensional) input method on basis of OpenCV (open source computer vision library) camera calibration | |
CN109559341B (en) | Method and device for generating mechanical arm grabbing scheme | |
CN109978949B (en) | Crop identification and feature point three-dimensional coordinate extraction method based on computer vision | |
EP3114647A2 (en) | Method and system for 3d capture based on structure from motion with simplified pose detection | |
WO2016042926A1 (en) | Image processing device, image processing method, and program | |
KR20220160066A (en) | Image processing method and apparatus | |
CN108830906A (en) | A kind of camera parameters automatic calibration method based on virtual Binocular Vision Principle | |
CN103017676B (en) | Three-dimensional scanner and 3-D scanning method | |
CN113902812A (en) | Laser radar and camera external parameter automatic calibration method based on multiple calibration plates | |
JP7005622B2 (en) | Recognition processing device, recognition processing method and program | |
CN110706291A (en) | Visual measurement method suitable for three-dimensional trajectory of moving object in pool experiment | |
CN109961471A (en) | A kind of mask method, device and the electronic equipment of objects in images position | |
CN209231985U (en) | A kind of camera parameters automatic calibration device based on virtual Binocular Vision Principle | |
KR102610900B1 (en) | Golf ball overhead detection method, system and storage medium | |
US20210012529A1 (en) | Information processing apparatus |
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 |
Granted publication date: 20170222 |
|
CF01 | Termination of patent right due to non-payment of annual fee |