CN113129385A - Binocular camera internal and external parameter calibration method based on multi-coding plane target in space - Google Patents

Binocular camera internal and external parameter calibration method based on multi-coding plane target in space Download PDF

Info

Publication number
CN113129385A
CN113129385A CN202110391614.7A CN202110391614A CN113129385A CN 113129385 A CN113129385 A CN 113129385A CN 202110391614 A CN202110391614 A CN 202110391614A CN 113129385 A CN113129385 A CN 113129385A
Authority
CN
China
Prior art keywords
calibration
target
coding
camera
shot
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
CN202110391614.7A
Other languages
Chinese (zh)
Other versions
CN113129385B (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.)
Hefei University of Technology
Original Assignee
Hefei University of Technology
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 Hefei University of Technology filed Critical Hefei University of Technology
Publication of CN113129385A publication Critical patent/CN113129385A/en
Application granted granted Critical
Publication of CN113129385B publication Critical patent/CN113129385B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/80Analysis of captured images to determine intrinsic or extrinsic camera parameters, i.e. camera calibration
    • G06T7/85Stereo camera calibration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30244Camera pose

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Length Measuring Devices By Optical Means (AREA)

Abstract

The invention discloses a binocular camera internal and external parameter calibration method based on multiple coded plane targets in space, which utilizes two large-view-field cameras with a common view field to simultaneously shoot multiple coded plane targets with different postures in space, thereby obtaining a group of target images comprising the multiple coded plane targets; respectively obtaining the calibration angle point information of each coding plane target on the images of the left camera and the right camera by utilizing a decoding method and a calibration angle point classification method of the coding plane target, so that each coding plane target meets the calibration condition; and finally, solving the internal parameters of each camera and the rotation and translation relation between the left camera and the right camera by using a Zhang-Zhengyou calibration algorithm to finish the calibration of the internal and external parameters of the binocular camera. The invention ensures that each camera can finish the calibration of the binocular camera by only shooting one image, can simplify the calibration process on the basis of ensuring the calibration precision and improves the applicability of the calibration of the camera.

Description

Binocular camera internal and external parameter calibration method based on multi-coding plane target in space
Technical Field
The invention relates to the field of camera calibration methods in computer vision, in particular to a binocular camera calibration method based on multiple coding plane targets in space.
Background
The computer vision technology is widely applied in the fields of industrial control, measurement and the like, and mainly utilizes the imaging of a camera to acquire the three-dimensional information of a measured object in space through image information so as to reconstruct and identify the object. The basic problem of the computer vision technology is camera calibration, the mapping relation between a space three-dimensional coordinate and an image two-dimensional coordinate can be obtained through the camera calibration technology, the camera calibration technology is the research focus of the computer vision measurement technology, the camera calibration task is to solve internal and external parameters of a camera, and the camera calibration technology is paid more and more attention and developed.
Roger Tsai proposed a camera calibration algorithm based on radial constraint in 1986, which requires a 3D three-dimensional target, so that the calibration process is inflexible; around 1999, Zhangyou (Z.Y Zhang) proposed a camera calibration algorithm based on a planar target, which uses a planar target that does not contain direction information and coding information, and the rotation direction of the planar target without direction information cannot be determined in the calibration process, and Zhangyou (Z.Y Zhang) proposed a camera calibration algorithm based on a planar target that requires the camera to shoot a complete planar target, but the camera often can not shoot a complete planar target in the actual calibration process, and at this time, it is difficult to calibrate the camera, especially calibrate a binocular camera, using a traditional planar target that does not contain direction information and coding information, and at the same time, it is difficult to ensure the camera calibration accuracy.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provides a binocular camera internal and external parameter calibration method based on multiple coding plane targets in space, which utilizes the coding plane targets containing direction information and coding information arranged in the space to calibrate the binocular camera, can ensure the matching precision of sub-pixel coordinates of calibration angular points and target coordinates thereof when the binocular camera is calibrated and the matching precision of the same-name calibration angular points in a left camera image and a right camera image, thereby improving the calibration precision of the binocular camera; the calibration work of the binocular camera can be completed only by shooting one calibration image meeting the calibration condition, and the calibration complexity is simplified.
In order to realize the effect, the invention adopts the technical scheme that:
a binocular camera internal and external parameter calibration method based on multiple coding plane targets in space utilizes two large-view-field cameras with a common view field in space to shoot multiple coding plane targets placed in space at the same time, thereby obtaining a group of calibration images containing multiple coding plane targets; respectively obtaining the calibration angle point information of each coding plane target on the images of the left camera and the right camera by utilizing a decoding method of the coding plane target and a classification method of the calibration angle points, and screening out the coding plane targets which do not meet the calibration conditions; adjusting the spatial pose of the coding plane target which does not meet the calibration condition, and shooting and judging again; finally, each coding plane target on the left camera image and the right camera image meets the calibration condition; and finally, solving the internal parameters of each camera and the rotation and translation relation between the left camera and the right camera by using a Zhang-Zhengyou calibration algorithm to finish the calibration of the internal and external parameters of the binocular camera.
Two large-view-field cameras placed in the space have a common view field, and the absolute positions and the relative positions of the two cameras are fixed; the coding plane target consists of a coding checkerboard formed by alternating parallelogram coding units and parallelogram non-coding units, the coding plane target takes the intersection points of the parallelogram coding units connected with any opposite angle as the calibration angular points of the coding plane target, the coding plane target comprises M rows multiplied by N columns of calibration angular points in total, wherein M and N are positive integers; the interior of each parallelogram coding unit in the coding plane target is provided with a coding pattern, the coding pattern comprises a positioning pattern, an orientation pattern and a coding mark pattern, and the coding mark pattern consists of a plurality of coding unit patterns; the judgment of the rotation direction of the coding plane target can be realized by the orientation pattern and the positioning pattern; the coding mark pattern is used for coding each parallelogram coding unit and each calibration corner point in the coding plane target.
The coding numbers of all parallelogram coding units on all coding plane targets in the space are different from each other; the coding numbers of all the parallelogram coding units on the same coding plane target have continuity; the number of the calibration angular points of any two coding plane targets in the space can be the same or different; the size of any two encoding plane targets in space can be the same or different; the spatial poses of any two encoding plane targets in space have obvious differences.
The calibration method comprises the following specific steps:
step 1, defining a calibration angular point number threshold k1Public calibration angular point number threshold k2And a binocular calibration external parameter optimization target number threshold value G', wherein k1、k2And G' are each an integer, k2More than 1, G' is more than or equal to 1; placing G coding plane targets in a space according to a layout rule of a plurality of coding plane targets in the space, wherein G is an integer;
the layout rule of the multi-coding plane target in the space specifically includes:
(1) the postures of any two coding plane targets in the space have obvious difference;
(2) placing N in the left camera field of view1A coding plane target (where N1Is an integer);
(3) placing N in the right camera view field2A coding plane target (where N2Is an integer);
(4) placing N in a common field of view of a left camera and a right camera3A coding plane target (wherein is N)3Integer, N3≥G′);
(5) The coding plane targets can be mutually shielded, namely, a complete coding plane target can be arranged in the space, and a local coding plane target can also be arranged.
Step 2, arranging the initial code numbers of the G code plane targets from small to large, and respectively recording the initial code numbers as z1、z2、z3、…、zGSelecting proper calibration angular points as the origin of a target coordinate system of the plane target according to the number of calibration angular points in 4 vertexes of a 1 st line and a 1 st parallelogram coding unit on a coding plane target, and establishing the target coordinate system by using the origin, wherein z is1、z2、z3、…、zGAre all integers;
the specific steps for establishing the target coordinate system are as follows:
step 2.1, defining an integer variable i and assigning the value i to 1;
step 2.2, setting the initial code number as ziThe coding plane target is marked as a coding plane target with the number i;
step 2.3, recording the number of the last parallelogram coding unit of the coding plane target of the number i as z'i
Step 2.4, the number of calibration corner points in 4 vertexes of the 1 st parallelogram coding unit in the 1 st line on the i number coding plane target in the marking space is
Figure BDA0003016961760000031
Then can be based on
Figure BDA0003016961760000032
The numerical values are classified into the following two cases:
case 1 when
Figure BDA0003016961760000033
In time, the 1 st parallelogram coding unit gamma of the 1 st line on the coding plane target with the mark i1 (i)1The calibration angular point in the middle is taken as the origin calibration angular point
Figure BDA0003016961760000034
At the moment, an origin is selected to calibrate the angular point
Figure BDA0003016961760000035
As the origin of the i number target coordinate system
Figure BDA0003016961760000036
Encoding auxiliary vectors on planar targets by number i
Figure BDA0003016961760000037
As the target coordinate system of number i
Figure BDA0003016961760000038
The direction of the axis;
case 2 when
Figure BDA0003016961760000039
Then, respectively marking the 1 st parallelogram coding unit of the 1 st line on the i number coding plane target
Figure BDA00030169617600000310
Two calibration corner points in
Figure BDA00030169617600000311
And
Figure BDA00030169617600000312
according to calibration corner point epsilon'1 (i)And ε1 (i)The positional relationship of (c) can be further classified into the following cases:
(1) when vector
Figure BDA00030169617600000313
Direction of and auxiliary vector on the i-number encoding plane target
Figure BDA00030169617600000314
Is the same, the calibration corner point epsilon 'is selected at the moment'1 (i)As a target coordinate systemOrigin of (2)
Figure BDA00030169617600000315
Encoding auxiliary vectors on planar targets by number i
Figure BDA00030169617600000316
As a target coordinate system of number i
Figure BDA00030169617600000317
The direction of the axis;
(2) when vector
Figure BDA00030169617600000318
Direction of and auxiliary vector on the i-number encoding plane target
Figure BDA00030169617600000319
When the directions of the two points are different, the calibration corner point epsilon' is selected at the moment1 (i)As the origin of the target coordinate system
Figure BDA00030169617600000320
Encoding auxiliary vectors on planar targets by number i
Figure BDA00030169617600000321
As a target coordinate system of number i
Figure BDA00030169617600000322
The direction of the axis;
step 2.5, coding the forward vector on the plane target by the number i
Figure BDA00030169617600000323
As a target coordinate system of number i
Figure BDA00030169617600000324
Direction of axis, target coordinate system No. i
Figure BDA00030169617600000325
A shaft,
Figure BDA00030169617600000326
Shaft and
Figure BDA00030169617600000327
the axis meets the right-hand criterion, so as to establish a target coordinate system of No. i
Figure BDA00030169617600000328
Step 2.6, judging whether i is smaller than G, if i is smaller than G, assigning i +1 to i and returning to the step 2.2 for sequential execution; otherwise, executing step 3;
step 3, recording images obtained by a plurality of coding plane targets placed in the space shot by the left camera as left camera target images, and recording images obtained by a plurality of coding plane targets placed in the space shot by the right camera as right camera target images; taking the upper left corner of the target image of the left camera as the origin o of the pixel coordinate system of the calibration corner point of the target image of the left cameralAnd the x is taken as the x of a calibration corner point pixel coordinate system of the target image of the left camera from left to rightlThe y in the axis direction is used as the pixel coordinate system of the calibration corner point of the target image of the left camera from top to bottomlEstablishing a calibration corner point pixel coordinate system o of the target image of the left camera in the axial directionl-xlyl(ii) a The upper left corner of the right camera target image is used as the origin o of the calibration corner point pixel coordinate system of the right camera target imagerAnd the x is taken as the x of the calibration corner point pixel coordinate system of the target image of the right camera from left to rightrThe y in the axis direction is used as the pixel coordinate system of the calibration corner point of the target image of the right camera from top to bottomrEstablishing a calibration corner point pixel coordinate system o of the target image of the right camera in the axial directionr-xryr
Step 4, taking the optical center of the left camera as the origin O of the coordinate system of the left cameral,cX of the calibration corner point pixel coordinate system of the left camera target imagelAxial direction X of left camera coordinate systeml,cAxial direction, by the nominal angle of the left camera target imageY of the point pixel coordinate systemlY with axial direction as left camera coordinate systeml,cAxial direction and X of the left camera coordinate systeml,cAxis, Yl,cAxis and Zl,cEstablishing the left camera coordinate system O when the axis meets the right hand rulel,c-Xl,cYl,cZl,c
The optical center of the right camera is used as the origin O of the coordinate system of the right camerar,cX of the calibration corner point pixel coordinate system of the right camera target imagerThe axis direction being X of the coordinate system of the right camerar,cY of the calibration corner point pixel coordinate system of the right camera target image in the axial directionrY with axial direction as right camera coordinate systemr,cAxial direction, and X of the right camera coordinate systemr,cAxis, Yr,cAxis and Zr,cEstablishing the coordinate system O of the right camera when the axis meets the right-hand ruler,c-Xr,cYr,cZr,c
Defining an integer variable tau and assigning tau as 1;
step 5, simultaneously shooting G coded plane targets placed in a space by using two large-view-field cameras with fixed relative positions and absolute positions and common view fields to obtain a group of target images shot at the tau th time, wherein the group of target images comprise a left camera target image shot at the tau th time and a right camera target image shot at the tau th time, and the images are positive integers of tau;
step 6, taking the left camera target image shot at the Tth time as an input condition, and obtaining all calibration corner points extracted from the left camera target image shot at the Tth time in a calibration corner point pixel coordinate system o of the left camera target image by utilizing a decoding method of a coding plane targetl-xlylA sub-pixel coordinate set, a unique coding sequence number set of all calibration corner points extracted from a target image of the left camera shot at the Tth time (wherein the sub-pixel coordinate of each calibration corner point corresponds to the unique coding sequence number one by one);
step 7, calibrating all calibration angle points extracted from the tau-th shot left camera target image on the calibration angle of the left camera target imagePoint pixel coordinate system ol-xlylUsing sub-pixel coordinate set and unique code serial number set of all calibration angle points extracted from the left camera target image shot at the Tth time as input conditions, classifying all calibration angle points extracted from the left camera target image shot at the Tth time by using a calibration angle point classification method of a multi-coding plane target in space, finding a coding plane target to which each calibration angle point belongs, and simultaneously obtaining the number of calibration angle points on the coding plane target at No. 1 in the left camera target image shot at the Tth time
Figure BDA0003016961760000051
Number of calibration angular points on No. 2 coding plane target
Figure BDA0003016961760000052
… number of calibration corner points on G number coding plane target
Figure BDA0003016961760000053
(if the left camera target image shot at the t-th time does not contain a certain coding plane target, the number of the calibration angular points is output to be 0);
step 8, sequentially judging the number of calibration angular points on the ith coding plane target in the Tth shot left camera target image
Figure BDA0003016961760000054
Whether the threshold k of the number of the calibration angular points is met1And marking the coding plane target which does not meet the calibration condition, wherein i is a positive integer and i belongs to [1, G ]](ii) a The specific judging method comprises the following steps:
step 8.1, taking an integer variable i and assigning the value i to 1; defining an integer variable beta1And assign beta 10; definition integer array L [ N ]1]All elements in the array are assigned to be 0;
step 8.2, judging the number of calibration angular points on the ith coding plane target in the Tth shot left camera target image
Figure BDA0003016961760000055
Whether the number of the calibration angle points is larger than a threshold value k1
If it is
Figure BDA0003016961760000056
Then assign i to L [ beta ]1]Will beta1+1 value to β1And taking the i number coded plane target in the target image of the left camera shot at the tau time as the beta number shot at the tau time1Marking the target by a left camera, and marking all marking angular points extracted from the coding plane target of No. i in the left camera target image shot for the Tth time in a marking angular point pixel coordinate system o of the left camera target imagel-xlylTaking a lower sub-pixel coordinate set and a calibration corner point unique code serial number set as the beta-th shot for the tau-th time1Calibration corner points on a left camera calibration target are in a calibration corner point pixel coordinate system o of a left camera target imagel-xlylThen, executing the step 8.3 after the sub-pixel coordinate set and the calibration angular point unique coding sequence number set are obtained;
if it is
Figure BDA0003016961760000057
Marking the coding plane target of the number i in the target image of the left camera shot for the τ th time, and then executing the step 8.3; otherwise, directly executing the step 8.3;
step 8.3, judging whether i is smaller than G, if i is smaller than G, assigning i +1 to i, and returning to the step 8.2 to execute in sequence;
step 9, judging whether each coding plane target obtains the number of calibration angular points meeting the calibration condition, namely judging beta1Whether or not equal to N1If beta is1==N1Then, step 10 is executed; otherwise, if the position and the posture of the marked coding plane target which does not meet the calibration condition are not met, assigning tau +1 to tau, and then returning to the step 5 to the step 8 to be executed circularly until the number of calibration angular points meeting the calibration condition is obtained on each coding plane target;
when the marked coding plane target is adjusted, the following requirements are met:
(1) after the marked coding plane target is adjusted, the space posture of the marked coding plane target is still obviously different from that of any other coding plane target;
(2) when the marked coding plane target is adjusted, the extraction of calibration corner points on other coding plane targets is not influenced;
step 10, using the same processing method as the left camera in the steps 6 to 9, taking the right camera target image shot at the t-th time as an input condition until the number of calibration corner points meeting the calibration condition is obtained on each coding plane target in the target image obtained by the right camera; obtaining all calibration corner points extracted from the right camera target image shot at the Tth time and a calibration corner point pixel coordinate system o of the right camera target imager-xryrA sub-pixel coordinate set, a unique coding sequence number set of all calibration corner points extracted from the right camera target image shot at the Tth time (wherein the sub-pixel coordinate of each calibration corner point corresponds to the unique coding sequence number one by one); obtaining the number of calibration angular points on the No. 1 coding plane target in the Tth shot right camera target image
Figure BDA0003016961760000061
Number of calibration angular points on No. 2 coding plane target
Figure BDA0003016961760000062
… number of calibration corner points on G number coding plane target
Figure BDA0003016961760000063
(if the Tth shot right camera target image does not contain a certain coding plane target, the number of the calibration angular points is 0), and the Tth shot beta2Calibration corner points on calibration targets of right cameras and calibration corner point pixel coordinate system o of target images of right camerasr-xryrA lower sub-pixel coordinate set and a calibration angular point unique coding sequence number set;
step 11, sequentially carrying out the τ th timeNumber of calibration angular points on No. i coding plane target in shot left camera target image
Figure BDA0003016961760000064
And the number of calibration angular points on the i number coding plane target in the right camera target image shot at the t time
Figure BDA0003016961760000065
Judging, namely taking the i number coding plane target in the left camera target image shot at the tau th time meeting the conditions as a corresponding left camera external reference calibration target, and taking the i number coding plane target in the right camera target image shot at the tau th time meeting the conditions as a corresponding right camera external reference calibration target; the specific judging method comprises the following steps:
step 11.1, taking an integer variable i and assigning the value i to 1; defining an integer variable beta3And assign beta 30; definition integer array A1[N3]All elements in the array are assigned to be 0;
step 11.2, according to the number of calibration angular points on the coding plane target I in the target image of the left camera shot for the tau time
Figure BDA0003016961760000066
And the number of calibration angular points on the i number coding plane target in the right camera target image shot at the t time
Figure BDA0003016961760000067
The following judgment is made:
if it is
Figure BDA0003016961760000068
And is
Figure BDA0003016961760000069
Assign i to a13]Will beta3+1 value to β3Taking the i number coded plane target in the target image of the left camera shot at the tau time as the beta number shot at the tau time3A left camera external parameter calibration target, and the t-thThe i number coding plane target in the secondary shot right camera target image is taken as the beta3The external parameters of the right camera are calibrated to the target, and then the step 11.3 is executed; otherwise, directly executing the step 11.3;
step 11.3, judging whether i is smaller than G, if i is smaller than G, assigning i +1 to i, and returning to the step 11.2 for sequential execution; otherwise, executing step 11.4;
step 11.4, taking an integer variable i and assigning the value i to 1; definition of integer variable β'3And assigned value of beta'30; definition integer array A2[N3]All elements in the array are assigned to be 0;
step 11.5, comparing the unique coding sequence number set of the calibration corner points of the ith external reference calibration target in the tau-time shot left camera target image with the unique coding sequence number set of the calibration corner points of the ith external reference calibration target in the tau-time shot right camera target image, and counting the number of the common calibration corner points with the same unique coding sequence number of the calibration corner points
Figure BDA0003016961760000071
And judging:
if it is
Figure BDA0003016961760000072
Assign i to a2[β′3]Is beta'3+1 value to β'3And taking the ith left camera external reference calibration target shot at the tau time as the beta-th shot at the tau time3' A left camera external parameter optimization target takes the ith right camera external parameter calibration target shot at the tau time as the beta of the tau time3' the right camera externally participates in optimizing the target, and then step 11.6 is executed; otherwise, marking the ith left camera external reference calibration target shot at the tau time and the ith right camera external reference calibration target shot at the tau time, and executing the step 11.6;
step 11.6, judge whether i is less than N3If i < N3Assigning i +1 to i and then returning to the step 11.5 for sequential execution; otherwise, executing step 11.7;
step 11.7, judge beta3' if less than G ', if beta '3If < G', executing step 12;
step 11.8, assigning the tau +1 to the tau and then returning to the step 5 for sequential execution;
step 12, in the marked Tth shot left camera external reference calibration target and the Tth shot right camera external reference calibration target, respectively carrying out pose adjustment on the coding plane targets placed in the corresponding actual space, so that the number of common calibration angular points meets the threshold value of the number of common calibration angular points; in this step, the same requirements as in step 9 need to be satisfied when adjusting the marked encoding plane target.
Step 13, obtaining a left camera calibration matching group and a right camera calibration matching group, which comprises the following specific steps:
step 13.1, taking an integer i and assigning the value i to 1;
step 13.2, calculating a calibration corner pixel coordinate system o of the calibration corner on the ith left camera calibration target shot for the τ th time in the left camera target image by using a target coordinate calculation method of the calibration corner on the coding plane targetl-xlylThe lower sub-pixel coordinate and the L [ i-1 ] th coordinate in the space corresponding to one of the lower sub-pixel coordinates]The calibration corner point with the same unique code serial number on each code plane target is positioned at the L [ i-1 ]]Individual target coordinate system
Figure BDA0003016961760000073
Matching relation between the target coordinates, and marking the matching relation as the ith left camera calibration matching group shot at the tau time;
step 13.3, judging whether i is less than N1If i < N1Assigning i +1 to i and then returning to the step 13.2 for sequential execution; otherwise, N of the t-th shooting is obtained1Calibrating a matching group by using the left cameras;
step 13.4, define the integer variable i1、i2And assign value i1=0,i2=0;
Step 13.5, judge L [ i1]Whether or not it is equal to A1[i2]If L [ i ]1]==A1[i2]If the number is τ, the (i) th shot of the number τ is1+1) left camera calibration matching group as the (i) th shot of the τ th time2+1) left camera external parameter calibration matching group, and the (i) th shot from the tau-th time1+1) left camera calibration target as the (i) th shot of the τ th time2+1) external reference calibration targets of the left cameras, and executing the step 13.6; otherwise will be (i)1+1) assigning a value to i1Then, the step is executed again;
step 13.6, judge i2Whether or not less than (N)3-1) if i2<(N3-1), then (i) will be2+1) assigning a value to i2Re-supply to the i1Assignment i1And returning to the step 13.5 to execute the steps sequentially; otherwise, N of the tau-th shooting is found1N contained in calibration matching group of left camera3The external parameters of the left camera are calibrated to form a matching group;
step 13.7, taking an i integer variable and assigning i to be 0;
step 13.8, shoot A of the tau2[i]The left camera external parameter calibration matching group is used as an (i +1) th left camera external parameter optimization matching group shot at the tau time;
step 13.9, judging whether i is less than (beta'3-1), if i < (β'3-1), assigning i +1 to i, returning to the step 13.8 for sequential execution, otherwise obtaining the beta 'of the tau shooting'3And the external parameter optimization matching group of the left camera.
And obtaining the right camera calibration matching group by adopting the same method as the method for obtaining the left camera calibration matching group.
Step 14, according to the N of the Tth shooting1A left camera calibration matching group, which calculates the internal parameters and distortion coefficients of the left camera by using the monocular camera internal and external parameter calibration algorithm and respectively transforms the internal parameters and distortion coefficients from the left camera coordinate system to L [0 ] in the space]Number target coordinate system, L1]Number target coordinate System, …, L [ N ]1-1]Rotation matrix of number target coordinate system
Figure BDA0003016961760000081
Figure BDA0003016961760000082
And translation vector
Figure BDA0003016961760000083
According to N of the Tth shooting2The right camera calibration matching group uses monocular camera internal and external parameter calibration algorithm to calculate the internal parameter and distortion coefficient of right camera and respectively convert them into space R0]Number target coordinate system, R1]Number target coordinate System, …, RN2-1]Rotation matrix of number target coordinate system
Figure BDA0003016961760000084
Figure BDA0003016961760000085
And translation vector
Figure BDA0003016961760000086
Step 15, respectively transforming the obtained left camera coordinate systems to L [0 ]]Number target coordinate system, L1]Number target coordinate System, …, L [ N ]1-1]Rotation matrix of number target coordinate system
Figure BDA0003016961760000087
And translation vector
Figure BDA0003016961760000088
Figure BDA0003016961760000089
In the middle, the coordinate system of the left camera is respectively converted to A1[0]Number target coordinate System, A1[1]Number target coordinate System, …, A1[N3]Rotation matrix of number target coordinate system
Figure BDA00030169617600000810
And translation vector
Figure BDA00030169617600000811
Figure BDA00030169617600000812
Respectively transforming the obtained right camera coordinate system into space R0]Number target coordinate system, R1]Number target coordinate System, …, RN2-1]Rotation matrix of number target coordinate system
Figure BDA0003016961760000091
And translation vector
Figure BDA0003016961760000092
Figure BDA0003016961760000093
In the middle, the coordinate system of the right-looking camera is respectively converted to A1[0]Number target coordinate System, A1[1]Number target coordinate System, …, A1[N3]Rotation matrix of number target coordinate system
Figure BDA0003016961760000094
And translation vector
Figure BDA0003016961760000095
Figure BDA0003016961760000096
Step 16, transforming to A by using the left camera coordinate system1[i]No. target coordinate system rotation matrix R'l,i+1And translation vector T'l,i+1And transformation of the right camera coordinate system to A1[i]No. target coordinate system rotation matrix R'r,i+1And translation vector T'r,i+1The rotational and translational relationship between the left and right camera coordinate systems is solved according to equations (1) and (2):
Figure BDA0003016961760000097
Figure BDA0003016961760000098
judging whether i is less than N3If i < N3Assigning i +1 to i and then returning to the step 16 for sequential execution; otherwise, executing step 17;
step 17, calculating the initial values of a rotation matrix R and a translational vector T (external parameters of the binocular camera) transformed from the left camera coordinate system to the right camera coordinate system by formula (3):
Figure BDA0003016961760000099
and step 18, calculating accurate values R 'and T' of external parameters of the binocular camera by using an optimization method based on standard length after obtaining the internal parameters and distortion coefficients of the left camera, the internal parameters and distortion coefficients of the right camera and the initial external parameters between the left camera and the right camera, so as to finish calibration of the binocular camera.
All calibration corner points extracted from the Tth shot left camera target image are in the calibration corner point pixel coordinate system o of the left camera target imagel-xlylUsing the sub-pixel coordinate set and the unique code sequence number set of all the calibration angle points extracted from the tau-time shot left camera target image as input conditions, classifying all the calibration angle points extracted from the tau-time shot left camera target image by using a calibration angle point classification method of a multi-coding plane target in space, and obtaining the number of the calibration angle points on the No. 1 coding plane target in the tau-time shot left camera target image
Figure BDA00030169617600000910
Number of calibration angular points on No. 2 coding plane target
Figure BDA00030169617600000911
… number of calibration corner points on G number coding plane target
Figure BDA00030169617600000912
The method comprises the following steps:
step 1.1, counting the total number of calibration corner points extracted from the target image of the left camera shot at the tau time according to the unique code number set of all calibration corner points extracted from the target image of the left camera shot at the tau time
Figure BDA00030169617600001015
Step 1.2, defining the number of calibration angular points on No. 1 coding plane target in the Tth shot left camera target image
Figure BDA0003016961760000101
Number of calibration angular points on No. 2 coding plane target
Figure BDA0003016961760000102
… number of calibration corner points on G number coding plane target
Figure BDA0003016961760000103
And initialize
Figure BDA0003016961760000104
Step 2, defining integer variables j and k, and assigning j to 1 and k to 1;
step 3, according to the unique code serial number of the jth calibration angular point in the unique code serial number set of all calibration angular points extracted from the tau-time shot left camera target image
Figure BDA0003016961760000105
(wherein
Figure BDA0003016961760000106
And σ'j τAll are integers) are judged:
(1) if it is
Figure BDA0003016961760000107
Then all calibration corner points extracted from the Tth shot left camera target image are in the calibration corner point pixel coordinate system o of the left camera target imagel-xlylPlacing the jth calibration angular point sub-pixel coordinate in the sub-pixel coordinate set into the calibration angular point sub-pixel coordinate set of the k number coding plane target on the left camera target image shot for the tau time, and placing the sub-pixel coordinate set into the calibration angular point sub-pixel coordinate set of the k number coding plane target on the left camera target image shot for the tau time
Figure BDA0003016961760000108
Is assigned to
Figure BDA0003016961760000109
And executing the step 4;
(2) judging whether k is smaller than G, if k is smaller than G, assigning k +1 to k, and then executing the step 3 again; otherwise, executing step 4;
step 4, judging whether j is smaller than j
Figure BDA00030169617600001010
If it is
Figure BDA00030169617600001011
Assigning j +1 to j, assigning k to 1 again, and returning to the step 3 for sequential execution; otherwise, classifying all calibration corner points extracted from the Tth shot left camera target image to obtain the calibration corner point of each coding plane target on the Tth shot left camera target image in the calibration corner point pixel coordinate system o of the left camera imagel-xlylA lower sub-pixel coordinate set is obtained, and the number of calibration angular points on the No. 1 coding plane target on the Tth shot left camera target image is obtained simultaneously
Figure BDA00030169617600001012
Number of calibration angular points on No. 2 coding plane target
Figure BDA00030169617600001013
… number of calibration corner points on G number coding plane target
Figure BDA00030169617600001014
A computer-readable storage medium is also provided, comprising a computer program for use in conjunction with an electronic device having image processing capabilities, the computer program being executable by a processor to perform the parameter calibration method.
Compared with the prior art, the invention has the following beneficial effects:
(1) compared with the traditional checkerboard target, the coding plane target provided by the invention is provided with the coding pattern which comprises the direction information of the coding three-dimensional target and the coding information of the calibration angle point, so that the one-to-one corresponding relation among the sub-pixel coordinate of the calibration angle point, the unique coding serial number of the calibration angle point and the target coordinate of the calibration angle point can be accurately given during calibration, and the precision of the calibration result is ensured and improved;
(2) compared with the method for calibrating by using the traditional checkerboard target, the binocular camera calibration method based on the multi-coding plane target in the space can still complete calibration work even if the shot image contains the local coding plane target on the premise of meeting the calibration condition, thereby improving the robustness of calibration of the binocular camera;
(3) compared with the traditional binocular camera calibration method, the binocular camera calibration method based on the multi-coding plane target in the space can perform calibration work only by shooting a group of target images (a left camera image and a right camera image) meeting the calibration conditions, so that the complexity of the calibration work is greatly simplified;
(4) the binocular camera calibration method based on the multi-coding plane target in the space is suitable for calibrating the binocular camera under the complex background with a small view field or a large view field, and has extremely strong applicability especially under the condition of calibrating the binocular camera with the large view field;
(5) the calibration method provided by the invention can remove the complex background and eliminate the interference of the complex background on the coding pattern and the calibration angular point when the coding information of the calibration angular point in the image is obtained, so as to ensure the accuracy and reliability of the obtained calibration angular point data and the coding information;
(6) according to the binocular camera calibration method based on the multi-coding plane target in the space, calibration angle point classification and matching of the same-name calibration angle points in the images of the left camera and the right camera are carried out through the unique coding number of the calibration angle points, so that the binocular calibration process is more robust, and the precision of the calibration result of the binocular camera is greatly improved.
Drawings
FIG. 1 is a schematic diagram of calibration equipment for a binocular camera calibration method based on multiple coded planar targets in space according to the present invention;
FIG. 2 is a schematic structural diagram of No. 1 coded planar target in space;
FIG. 3 is a schematic structural diagram of the No. 2 coded planar target in space;
FIG. 4 is a schematic structural diagram of a No. 3 coded planar target in space;
FIG. 5 is a schematic structural diagram of the No. 4 coded planar target in space;
FIG. 6 is a schematic structural diagram of the No. 5 coded planar target in space;
FIG. 7 is a schematic diagram of the division of the coding region of the parallelogram coding unit in the coding plane target;
FIG. 8 is a schematic diagram showing the selection of the forward vector and the prescribed vector in the coding plane target No. 1 in space;
FIG. 9 is a schematic diagram showing the selection of the forward vector and the prescribed vector in the coding plane target No. 2 in space;
FIG. 10 is a schematic diagram showing the selection of the forward vector and the prescribed vector in the coding plane target No. 3 in space;
FIG. 11 is a schematic diagram showing the selection of the forward vector and the prescribed vector in the coding plane target No. 4 in space;
FIG. 12 is a schematic diagram showing the selection of the forward vector and the prescribed vector in the coded plane target No. 5 in space;
FIG. 13 is a schematic representation of the establishment of a target coordinate system for each encoding planar target in space;
FIG. 14 is a left camera target image taken at 1 st shot;
FIG. 15 is a right camera target image taken at the 1 st shot;
fig. 16 is a schematic diagram of the extraction result of the calibration corner point on the target image of the left camera shot at the 1 st time;
fig. 17 is a schematic diagram of an extraction result of the calibration corner point on the target image of the right camera shot at the 1 st time;
FIG. 18 is a left camera target image taken at 2 nd time;
FIG. 19 is a right camera target image taken at 2 nd time;
fig. 20 is a schematic diagram of the extraction result of the calibration corner point on the target image of the left camera shot at the 2 nd time;
fig. 21 is a schematic diagram of the extraction result of the calibration corner point on the right camera target image shot at the 2 nd time;
FIG. 22 is a left camera target image taken at the 3 rd shot;
FIG. 23 is a right camera target image taken at the 3 rd shot;
fig. 24 is a schematic diagram of an extraction result of the calibration corner point on the target image of the left camera shot at the 3 rd time;
fig. 25 is a schematic diagram of the extraction result of the calibration corner point on the target image of the right camera shot at the 3 rd time;
FIG. 26 is the 1 st no-complex background target image p'1
FIG. 27 is the 2 nd no complex background target image p'2
FIG. 28 is the 3 rd no complex background target image p'3
FIG. 29 is the 4 th no-complex background target image p'4
FIG. 30 is the 5 th no complex background target image p'5
FIG. 31 shows a 1 st target binary etching image p ″'1
FIG. 32 is the 1 st unit binary image E without complex background1
Fig. 33 is a schematic flow chart of the binocular camera calibration method based on the multi-coding plane target in the space according to the present invention.
Detailed Description
The following detailed description of the preferred embodiments of the present invention, taken in conjunction with the accompanying drawings, will make the advantages and features of the invention easier to understand by those skilled in the art, and thus will clearly and clearly define the scope of the invention.
A binocular camera internal and external parameter calibration method based on multiple coding plane targets in space utilizes two large-view-field cameras with a common view field in space to simultaneously shoot multiple coding plane targets placed in space, so as to obtain a group of calibration images containing the multiple coding plane targets; respectively obtaining the calibration angle point information of each coding plane target on the images of the left camera and the right camera by utilizing a decoding method of the coding plane target and a classification method of the calibration angle points, and screening out the coding plane targets which do not meet the calibration conditions; adjusting the spatial pose of the coding plane target which does not meet the calibration condition, and shooting and judging again; finally, each coding plane target on the left camera image and the right camera image meets the calibration condition; and finally, solving the internal parameters of each camera and the rotation and translation relation between the left camera and the right camera by using a Zhang-Zhengyou calibration algorithm to finish the calibration of the internal and external parameters of the binocular camera. In this example, a total of 5 encoding planar targets are placed in space, as shown in fig. 1; wherein the schematic structural diagrams of the 5 encoding planar targets are shown in figures 2 to 6;
the method for calibrating the internal and external parameters of the binocular camera based on the multi-coding plane target in the space comprises the following steps that two large-view-field cameras placed in the space have a common view field, and the absolute positions and the relative positions of the two cameras are fixed; as shown in fig. 1; the spatial poses of any two encoding plane targets in space have obvious differences.
The coding plane target consists of a coding checkerboard formed by alternating parallelogram coding units and parallelogram non-coding units, the coding plane target takes the intersection points of the parallelogram coding units connected with any opposite angle as the calibration angular points of the coding plane target, the coding plane target comprises M rows multiplied by N columns of calibration angular points in total, wherein M and N are positive integers; the interior of each parallelogram coding unit in the coding plane target is provided with a coding pattern, the coding pattern comprises a positioning pattern, an orientation pattern and a coding mark pattern, and the coding mark pattern consists of a plurality of coding unit patterns; the judgment of the rotation direction of the coding plane target can be realized by the orientation pattern and the positioning pattern; the coding mark pattern is used for coding each parallelogram coding unit and each calibration angular point in the coding plane target; in this embodiment, each coding plane target includes 5 rows × 5 columns of calibration corner points, the background color of the parallelogram coding units is black, the background color of the parallelogram non-coding units is white, the positioning patterns are white solid circles, the orientation patterns are white rings, and each coding unit pattern is a solid small circle.
As shown in fig. 7, each parallelogram coding unit in the coding plane target is divided into 6 coding regions, each coding region includes 2 coding unit patterns (i.e., coding flag circles), and 2 coding flag circles in each coding region are divided into a 1 st coding flag circle and a 2 nd coding flag circle, so that the coding values of the 2 coding flag circles in any one coding region can be respectively recorded as
Figure BDA0003016961760000131
And
Figure BDA0003016961760000132
(wherein g represents a coding region number, i.e., g 1,2,3,4,5, 6); when the color bit of the coding mark circle is black, the corresponding coding value is 0, and when the coding mark circle is white, the corresponding coding value is 1; the code number z ═ U of the parallelogram coding unit can be finally obtainedTV, where z is an integer, U ═ 20,21,...,211)T
Figure BDA0003016961760000133
The coding numbers of all parallelogram coding units on all coding plane targets in the space are different from each other; and coding of all parallelogram coding units on the same coding plane targetThe code numbers have continuity; in this embodiment, the initial code numbers of the 5 coding plane targets are z respectively1=0,z2=20,z3=60,z4=87,z5105; according to the size of the initial coding number, marking the 5 coding plane targets as a No. 1 coding plane target, a No. 2 coding plane target, … and a No. 5 coding plane target in sequence from small to large; and the number range of the parallelogram coding units of the No. 1 coding plane target is 0 to 17, the number range of the parallelogram coding units of the No. 2 coding plane target is 20 to 37, the number range of the parallelogram coding units of the No. 3 coding plane target is 60 to 77, the number range of the parallelogram coding units of the No. 4 coding plane target is 87 to 104, and the number range of the parallelogram coding units of the No. 5 coding plane target is 105 to 122.
The number of the calibration angular points of any two coding plane targets in the space can be the same or different; in the embodiment, the number of the calibration corner points of each encoding plane target is 25.
The size of any two encoding plane targets in space can be the same or different; in a specific embodiment, each parallelogram coding unit in the No. 1 coding plane target is a square with the side length of 82mm, each parallelogram coding unit in the No. 2 coding plane target is a square with the side length of 65mm, each parallelogram coding unit in the No. 3 coding plane target is a square with the side length of 65mm, each parallelogram coding unit in the No. 4 coding plane target is a square with the side length of 82mm, and each parallelogram coding unit in the No. 5 coding plane target is a square with the side length of 65 mm.
Taking the No. 1 coding plane target as an example, arbitrarily taking one parallelogram coding unit in the No. 1 coding plane target as the No. 1 coding plane target vector determination coding unit
Figure BDA0003016961760000141
Coding unit for determining No. 1 coding plane target vector
Figure BDA0003016961760000142
One vertex of the vector determination coding unit is marked as a first vertex o ″ of the vector determination coding unit1 (1)Determining coding units in coding plane target vector No. 1
Figure BDA0003016961760000143
Wherein the intersections form a vector defining a first vertex o ″' of the coding unit1 (1)Any one edge of the vector is taken as a vector to determine a first edge of the coding unit
Figure BDA0003016961760000144
Determining a coding unit first side in a vector
Figure BDA0003016961760000145
Upward orientation amount determination encoding unit
Figure BDA0003016961760000146
The vertex of (a) is marked as the first point o' on the first side of the vector-determined coding unit2 (1)Wherein the vector determines a first point o' on a first side of the coding unit2 (1)And vector determines the first vertex o ″ "of the coding unit1 (1)Are 2 points which are not coincident with each other, and the vector is recorded
Figure BDA0003016961760000147
Specifying vectors for coding planar targets for number 1
Figure BDA0003016961760000148
And the positional relationship of the positioning pattern and the orientation pattern in each parallelogram coding unit within the coding plane target is as follows: the direction pointing from the center of mass of the orientation pattern to the center of mass of the orientation pattern in the same parallelogram coding unit and the specified vector of the No. 1 coding plane target
Figure BDA0003016961760000149
Are in the same direction; prescribed vector of No. 1 coded planar target
Figure BDA00030169617600001410
As shown in fig. 8.
Marking the plane where the No. 1 coding plane target is as the No. 1 target plane
Figure BDA00030169617600001411
Determining the first vertex o' of the coding unit by the vector1 (1)Making a specified vector of the No. 1 coding plane target as a starting point
Figure BDA00030169617600001412
The unit vector in the same direction is marked as the 1 st specified unit vector of the No. 1 coding plane target
Figure BDA00030169617600001413
When a person looks at the coding plane target, a first vertex o' of the coding unit is determined by a vector1 (1)Is a rotation center and is arranged in a No. 1 target plane Pt (1)1 st prescribed unit vector of inner-to-1 coded plane target
Figure BDA00030169617600001414
Counterclockwise rotation by an angle beta '(0 DEG < beta' < 90 DEG) results in the 2 nd prescribed unit vector of the No. 1 coded planar target
Figure BDA00030169617600001415
Determining the first vertex o' of the coding unit in space as a vector1 (1)As a starting point, an
Figure BDA00030169617600001416
The unit vectors with the same direction of the obtained vectors are marked as the positive vectors of the No. 1 coding plane target
Figure BDA00030169617600001417
Determining a coding unit from the No. 1 coding plane target vector
Figure BDA00030169617600001418
Upper distance No. 1 coding plane target vector determination coding unit
Figure BDA00030169617600001419
The two nearest vertexes of the orientation pattern in (1) are respectively marked as the 1 st temporary vertex o ″3 1And the 2 nd temporary vertex o ″4 1(ii) a If vector
Figure BDA00030169617600001420
Specified vector of cross-product No. 1 coding plane target
Figure BDA0003016961760000151
The direction of the obtained vector and the positive vector of the specified vector of the No. 1 coding plane target
Figure BDA0003016961760000152
Are in the same direction, then vector will be generated
Figure BDA0003016961760000153
Auxiliary vector marked as No. 1 coding plane target
Figure BDA0003016961760000154
If vector
Figure BDA0003016961760000155
Specified vector of cross-product No. 1 coding plane target
Figure BDA0003016961760000156
The direction of the obtained vector and the positive vector of the No. 1 coding plane target
Figure BDA0003016961760000157
If the directions of the vectors are different, the vectors are calculated
Figure BDA0003016961760000158
Auxiliary vector marked as No. 1 coding plane target
Figure BDA0003016961760000159
Auxiliary vector of No. 1 coding plane target
Figure BDA00030169617600001510
And the forward vector of the No. 1 coded plane target
Figure BDA00030169617600001511
The selection is shown in fig. 8.
The selection of the auxiliary vector and the forward vector on the remaining encoding plane targets can refer to the encoding plane target No. 1, and the results are shown in fig. 9 to 12.
Referring to fig. 33, the calibration method for the internal and external parameters of the binocular camera based on the multiple encoded planar targets in the space includes the following steps:
step 1, defining a calibration angular point number threshold k 115, common calibration corner point number threshold k 23, setting the binocular calibration external parameter optimization target number threshold value G' as 1; placing G (wherein G is 5) coding plane targets in the space according to the layout rule of the multiple coding plane targets in the space; in this embodiment, N is placed in the field of view of the left camera1(N15) coding plane targets, and placing N in the right camera view field2(N25) coding plane targets, and placing N in the common view field of the left camera and the right camera3(N3==5,N3> G') encoding planar targets.
Step 2: arranging the initial code numbers of the 5 coding plane targets from small to large, and respectively marking as z1、z2、z3、…、z5In the specific embodiment, the number of the calibration corner points in the 4 vertices of the 1 st line of the 1 st parallelogram coding unit on each coding plane target in the space is
Figure BDA00030169617600001512
In this case, the target coordinate system for each encoding planar target is established as shown in fig. 13.
Step 3, recording images obtained by a plurality of coding plane targets placed in the space shot by the left camera as left camera target images, and recording images obtained by a plurality of coding plane targets placed in the space shot by the right camera as right camera target images;
taking the upper left corner of the target image of the left camera as the origin o of the pixel coordinate system of the calibration corner point of the target image of the left cameralAnd the x is taken as the x of a calibration corner point pixel coordinate system of the target image of the left camera from left to rightlThe y in the axis direction is used as the pixel coordinate system of the calibration corner point of the target image of the left camera from top to bottomlAxial direction, thereby establishing a calibration corner point pixel coordinate system o of the target image of the left cameral-xlyl
The upper left corner of the right camera target image is used as the origin o of the calibration corner point pixel coordinate system of the right camera target imagerAnd the x is taken as the x of the calibration corner point pixel coordinate system of the target image of the right camera from left to rightrThe y in the axis direction is used as the pixel coordinate system of the calibration corner point of the target image of the right camera from top to bottomrAxial direction, thereby establishing a calibration corner point pixel coordinate system o of the target image of the right camerar-xryr
Step 4, taking the optical center of the left camera as the origin O of the coordinate system of the left cameral,cX of the calibration corner point pixel coordinate system of the left camera target imagelAxial direction X of left camera coordinate systeml,cY of the pixel coordinate system of the calibration corner point of the left camera target image in the axial directionlY with axial direction as left camera coordinate systeml,cAxial direction and X of the left camera coordinate systeml,cAxis, Yl,cAxis and Zl,cThe axes meet the right hand rule, thereby establishing the left camera coordinate system Ol,c-Xl,cYl,cZl,c
The optical center of the right camera is used as the origin O of the coordinate system of the right camerar,cX of the calibration corner point pixel coordinate system of the right camera target imagerThe axis direction being X of the coordinate system of the right camerar,cY of the calibration corner point pixel coordinate system of the right camera target image in the axial directionrY with axial direction as right camera coordinate systemr,cAxial direction, and the right camera seatX of the systemr,cAxis, Yr,cAxis and Zr,cEstablishing the coordinate system O of the right camera when the axis meets the right-hand ruler,c-Xr,cYr,cZr,c
The following describes a specific application process of the calibration method of the present invention with a specific calibration process of 5 encoding planar targets of this embodiment.
An integer variable τ is defined and assigned τ to 1.
Shooting for the 1 st time:
step 5, two large-view-field cameras with fixed relative positions and absolute positions and common view fields are used for simultaneously shooting 5 coded plane targets placed in a space, and a group of target images shot at the 1 st time are obtained, wherein the group of target images include a left camera target image shot at the 1 st time (shown in fig. 14) and a right camera target image shot at the 1 st time (shown in fig. 15);
step 6, taking the left camera target image shot at the 1 st time as an input condition, and obtaining all calibration corner points extracted from the left camera target image shot at the 1 st time in a calibration corner point pixel coordinate system o of the left camera target image by utilizing a decoding method of a coding plane targetl-xlylThe sub-pixel coordinate set of the following, the unique code number set of all the calibration corner points extracted from the left camera target image shot at the 1 st time (wherein the sub-pixel coordinate of each calibration corner point corresponds to the unique code number one by one); the corner extraction result is shown in fig. 16;
step 7, all calibration corner points extracted from the 1 st shot left camera target image are positioned in the calibration corner point pixel coordinate system o of the left camera target imagel-xlylUsing the sub-pixel coordinate set and the unique code serial number set of all the calibration angle points extracted from the 1 st shot left camera target image as input conditions, classifying all the calibration angle points extracted from the 1 st shot left camera target image by using a calibration angle point classification method of a multi-coding plane target in space, finding the coding plane target to which each calibration angle point belongs, and simultaneously obtaining the 1 st shot left camera target imageNumber of calibration angular points on No. 1 coding plane target
Figure BDA0003016961760000161
Number of calibration angular points on No. 2 coding plane target
Figure BDA0003016961760000162
… and 5 number of calibration corner points on coding plane target
Figure BDA0003016961760000163
In a specific embodiment, the number of calibration angular points on the No. 1 coding plane target
Figure BDA0003016961760000171
Number of calibration angular points on No. 2 coding plane target
Figure BDA0003016961760000172
Number of calibration angular points on No. 3 coding plane target
Figure BDA0003016961760000173
Number of calibration angular points on No. 4 coding plane target
Figure BDA0003016961760000174
Number of calibration angular points on No. 5 coding plane target
Figure BDA0003016961760000175
Step 8.1, taking an integer variable i and assigning the value i to 1; defining an integer variable beta1And assign beta 10; definition integer array L [5 ]]All elements in the array are assigned to be 0;
step 8.2, judging the number of calibration angular points on the i number coding plane target in the 1 st shot left camera target image
Figure BDA0003016961760000176
Whether the number of the calibration corner points is larger than a threshold value 15: in the specific embodiment, only number 3 is codedThe number of the calibration angular points of the code plane target does not meet the threshold value of the number of the calibration angular points
Figure BDA0003016961760000177
Then the coded plane target No. 3 placed in the space is marked, beta1If yes, executing step 9;
and 9, in an actual space, carrying out pose adjustment on the coded plane target marked in the steps 8.1 to 8.3 (namely the No. 3 coded plane target), assigning tau +1 to the tau, and then returning to the step 5 for sequential execution.
Shooting for the 2 nd time:
step 5, simultaneously shooting 5 coded plane targets placed in a space by using two large-view-field cameras with fixed relative positions and absolute positions and a common view field to obtain a group of target images shot at the 2 nd time, wherein the group of target images comprises a left camera target image shot at the 2 nd time (shown in fig. 18) and a right camera target image shot at the 2 nd time (shown in fig. 19);
step 6, taking the left camera target image shot at the 2 nd time as an input condition, and obtaining all calibration corner points extracted from the left camera target image shot at the 2 nd time in a calibration corner point pixel coordinate system o of the left camera target image by utilizing a decoding method of a coding plane targetl-xlylThe sub-pixel coordinate set, the unique coding sequence number set of all the calibration corner points extracted from the left camera target image shot at the 2 nd time (wherein the sub-pixel coordinate of each calibration corner point corresponds to the unique coding sequence number one by one); the corner extraction result is shown in fig. 20;
step 7, all calibration corner points extracted from the 2 nd shot left camera target image are positioned in the calibration corner point pixel coordinate system o of the left camera target imagel-xlylUsing the sub-pixel coordinate set and the unique code sequence number set of all the calibration corner points extracted from the 2 nd shot left camera target image as input conditions, classifying all the calibration corner points extracted from the 2 nd shot left camera target image by using a calibration corner point classification method of a multi-code plane target in space, and finding out the calibration corner pointsThe number of the calibration angle points on the No. 1 coding plane target in the left camera target image shot at the 2 nd time can be obtained at the same time when the coding plane target to which each calibration angle point belongs
Figure BDA0003016961760000178
Number of calibration angular points on No. 2 coding plane target
Figure BDA0003016961760000179
… and 5 number of calibration corner points on coding plane target
Figure BDA00030169617600001710
In a specific embodiment, the number of calibration angular points on the No. 1 coding plane target
Figure BDA0003016961760000181
Number of calibration angular points on No. 2 coding plane target
Figure BDA0003016961760000182
Number of calibration angular points on No. 3 coding plane target
Figure BDA0003016961760000183
Number of calibration angular points on No. 4 coding plane target
Figure BDA0003016961760000184
Number of calibration angular points on No. 5 coding plane target
Figure BDA0003016961760000185
Step 8, in a specific embodiment, during the 2 nd shooting, the number of calibration corner points of all the coding plane targets in the left camera target image meets a threshold value, and β is1If 5, executing step 10;
step 10, using the right camera target image shot at the 2 nd time as an input condition, and obtaining all calibration angles extracted from the right camera target image shot at the 2 nd time by using a decoding method of a coding plane targetCalibration corner point pixel coordinate system o of right camera target imager-xryrThe sub-pixel coordinate set, the unique coding sequence number set of all the calibration corner points extracted from the right camera target image shot at the 2 nd time (wherein the sub-pixel coordinate of each calibration corner point corresponds to the unique coding sequence number one by one); the corner extraction result is shown in fig. 21.
All calibration corner points extracted from the right camera target image shot at the 2 nd time are in a calibration corner point pixel coordinate system o of the right camera target imager-xryrUsing the sub-pixel coordinate set and the unique code serial number set of all the calibration angle points extracted from the right camera target image shot at the 2 nd time as input conditions, classifying all the calibration angle points extracted from the right camera target image by using a calibration angle point classification method of a multi-coding plane target in space, finding the coding plane target to which each calibration angle point belongs, and simultaneously obtaining the number of the calibration angle points on the No. 1 coding plane target in the right camera target image shot at the 2 nd time
Figure BDA0003016961760000186
Number of calibration angular points on No. 2 coding plane target
Figure BDA0003016961760000187
… and 5 number of calibration corner points on coding plane target
Figure BDA0003016961760000188
In a specific embodiment, in the right camera target image shot at the 2 nd time, the number of calibration corner points on the No. 1 coding plane target
Figure BDA0003016961760000189
Number of calibration angular points on No. 2 coding plane target
Figure BDA00030169617600001810
Number of calibration angular points on No. 3 coding plane target
Figure BDA00030169617600001811
Number of calibration angular points on No. 4 coding plane target
Figure BDA00030169617600001812
Number of calibration angular points on No. 5 coding plane target
Figure BDA00030169617600001813
Taking an integer variable i and assigning the value i to 1; defining an integer variable beta2And assign beta 20; definition integer array R5]All elements in the array are assigned to be 0; in the embodiment, in the 2 nd shooting, the number of the calibration corner points of only the No. 2 coding plane target in the right camera target image does not meet the threshold value
Figure BDA00030169617600001814
Then the coded plane target No. 2 placed in space is marked, beta2And (4), performing pose adjustment on the marked coding plane target (namely the coding plane target No. 2) in the actual space, assigning tau +1 to tau, and returning to the step 5 for sequential execution.
Shooting for the 3 rd time:
step 5, two large-view-field cameras with fixed relative positions and absolute positions and common view fields are used for simultaneously shooting 5 coded plane targets placed in a space, and a group of target images shot at the 3 rd time are obtained, wherein the group of target images include a left camera target image shot at the 3 rd time (shown in fig. 22) and a right camera target image shot at the 3 rd time (shown in fig. 23);
step 6, taking the 3 rd shot left camera target image as an input condition, and obtaining all calibration corner points extracted from the 3 rd shot left camera target image in a calibration corner point pixel coordinate system o of the left camera target image by utilizing a decoding method of a coding plane targetl-xlylThe sub-pixel coordinate set of the lower, the unique code number set of all the calibration corner points extracted from the target image of the left camera shot at the 3 rd time (wherein each calibration corner isThe sub-pixel coordinates of the point correspond to the unique code serial number one by one); the corner extraction result is shown in fig. 24;
step 7, all calibration corner points extracted from the 3 rd shot left camera target image are located in the calibration corner point pixel coordinate system o of the left camera target imagel-xlylUsing the sub-pixel coordinate set and the unique code serial number set of all the calibration angle points extracted from the 3 rd shot left camera target image as input conditions, classifying all the calibration angle points extracted from the 3 rd shot left camera target image by using a calibration angle point classification method of a multi-coding plane target in space, finding the coding plane target to which each calibration angle point belongs, and simultaneously obtaining the number of the calibration angle points on the No. 1 coding plane target in the 3 rd shot left camera target image
Figure BDA0003016961760000191
Number of calibration angular points on No. 2 coding plane target
Figure BDA0003016961760000192
… and 5 number of calibration corner points on coding plane target
Figure BDA0003016961760000193
In a specific embodiment, in the 3 rd shot left camera target image, the number of calibration corner points on the No. 1 coding plane target
Figure BDA0003016961760000194
Number of calibration angular points on No. 2 coding plane target
Figure BDA0003016961760000195
Number of calibration angular points on No. 3 coding plane target
Figure BDA0003016961760000196
Number of calibration angular points on No. 4 coding plane target
Figure BDA0003016961760000197
Number of calibration angular points on No. 5 coding plane target
Figure BDA0003016961760000198
Step 8.1, taking an integer variable i and assigning the value i to 1; defining an integer variable beta1And assign beta 10; definition integer array L [5 ]]All elements in the array are assigned to be 0;
step 8.2, in a specific embodiment, when shooting for the 3 rd time, the number of calibration corner points of all the coding plane targets in the left camera target image all meets a threshold value, and β1If 5, executing step 10;
step 10, using the right camera target image shot at the 3 rd time as an input condition, and using a decoding method of a coding plane target to obtain all calibration corner points extracted from the right camera target image shot at the 3 rd time on a calibration corner point pixel coordinate system o of the right camera target imager-xryrThe sub-pixel coordinate set, the unique coding sequence number set of all the calibration corner points extracted from the right camera target image shot at the 3 rd time (wherein the sub-pixel coordinate of each calibration corner point corresponds to the unique coding sequence number one by one); the corner extraction result is shown in fig. 25;
all calibration corner points extracted from the right camera target image shot at the 3 rd time are calibrated in a calibration corner point pixel coordinate system o of the right camera target imager-xryrUsing the sub-pixel coordinate set and the unique code serial number set of all the calibration angle points extracted from the right camera target image shot at the 3 rd time as input conditions, classifying all the calibration angle points extracted from the right camera target image by using a calibration angle point classification method of a multi-coding plane target in space, finding the coding plane target to which each calibration angle point belongs, and simultaneously obtaining the number of the calibration angle points on the No. 1 coding plane target in the right camera target image shot at the 2 nd time
Figure BDA0003016961760000201
Number
2 coding planeNumber of calibration angular points on target
Figure BDA0003016961760000202
… and 5 number of calibration corner points on coding plane target
Figure BDA0003016961760000203
In a specific embodiment, in the right camera target image shot at the 3 rd time, the number of calibration corner points on the No. 1 coding plane target
Figure BDA0003016961760000204
Number of calibration angular points on No. 2 coding plane target
Figure BDA0003016961760000205
Number of calibration angular points on No. 3 coding plane target
Figure BDA0003016961760000206
Number of calibration angular points on No. 4 coding plane target
Figure BDA0003016961760000207
Number of calibration angular points on No. 5 coding plane target
Figure BDA0003016961760000208
Taking an integer variable i and assigning the value i to 1; defining an integer variable beta2And assign beta 20; definition integer array R5]All elements in the array are assigned to be 0;
in the embodiment, in the 3 rd shooting, the number of calibration corner points of each coding plane target in the right camera target image all meets the threshold value, and beta is2If 5, executing step 11;
step 11.1, taking an integer variable i and assigning the value i to 1; defining an integer variable beta3And assign beta 30; definition integer array A1[5]All elements in the array are assigned to be 0;
step 11.2, according to the 3 rd shooting left cameraNumber of calibration angular points on i number coding plane target in target image
Figure BDA0003016961760000209
And the number of calibration angular points on the No. i coding plane target in the right camera target image shot at the 3 rd time
Figure BDA00030169617600002010
And (4) judging:
in this embodiment, in the 3 rd shooting, the numbers of all the calibration corner points in the left and right camera target images all satisfy the threshold, so the No. 1, No. 2, …, and No. 5 coding plane targets in the 3 rd shooting left camera target image are respectively used as the 1 st left camera external reference calibration target, the 2 nd left camera external reference calibration target, …, and the 5 th left camera external reference calibration target; respectively taking the No. 1 coded plane target, the No. 2 coded plane target, … and the No. 5 coded plane target in the right camera target image shot at the 3 rd time as a No. 1 right camera external reference calibration target, a No. 2 right camera external reference calibration target, … and a No. 5 right camera external reference calibration target;
step 11.4, taking an integer variable i and assigning the value i to 1; defining an integer variable beta3' and assigns a value of beta3' -0; definition integer array A2[5]All elements in the array are assigned to be 0;
step 11.5, comparing the calibration corner point unique code serial number set of the ith external reference calibration target in the 3 rd shot left camera target image with the calibration corner point unique code serial number set of the ith external reference calibration target in the 3 rd shot right camera target image, and counting the number of the common calibration corner points with the same calibration corner point unique code serial number
Figure BDA0003016961760000211
And judging:
when shooting for the 3 rd time, the number of the common calibration angular points of the 1 st external reference calibration target in the target images of the left camera and the right camera
Figure BDA0003016961760000212
Number of common calibration angular points of No. 2 external reference calibration target
Figure BDA0003016961760000213
Number of common calibration angular points of 3 rd external reference calibration target
Figure BDA0003016961760000214
Number of common calibration angular points of 4 th external reference calibration target
Figure BDA0003016961760000215
Number of public calibration angular points of the 5 th external reference calibration target
Figure BDA0003016961760000216
β3If 5 > 1, executing step 13;
step 13.1, taking an integer i and assigning the value i to 1;
step 13.2, the calibration corner point on the ith left camera calibration target shot at the 3 rd time is positioned in the calibration corner point pixel coordinate system o of the left camera target imagel-xlylUsing the sub-pixel coordinate set and the unique coding serial number set of the calibration angular point as input conditions, and calculating the calibration angular point pixel coordinate system o of the calibration angular point on the calibration target of the ith left camera shot at the 3 rd time in the target image of the left camera by using a target coordinate calculation method of the calibration angular point on the coding plane targetl-xlylThe lower sub-pixel coordinate and the L [ i-1 ] th coordinate in the space corresponding to one of the lower sub-pixel coordinates]The calibration corner point with the same unique code serial number on each code plane target is positioned at the L [ i-1 ]]Individual target coordinate system
Figure BDA0003016961760000218
The matching relation between the target coordinates is recorded as the ith left camera calibration matching group shot at the 3 rd time;
step 13.3, judging whether i is smaller than 5, if i is smaller than 5, assigning i +1 to i, and returning to the step 8.2 to execute in sequence; otherwise, obtaining 5 left camera calibration matching groups shot at the 3 rd time;
in an example, the 1 st left camera target matching group from the 3 rd shot is shown in table 1.1 below:
TABLE 1.1
Figure BDA0003016961760000217
Figure BDA0003016961760000221
The 2 nd left camera target matched set for the 3 rd shot is shown in table 1.2 below:
TABLE 1.2
Serial number Calibrating sub-pixel coordinates of angular point Calibrating unique coding serial number of angular point Calibrating corner point target coordinates
1 (1565.95,593.658) 34_6 (260,260,0)
2 (1515.15,597.294) 33_1 (195,260,0)
3 (1463.81,600.978) 33_6 (130,260,0)
4 (1411.79,604.626) 32_1 (65,260,0)
5 (1359.26,608.39) 32_6 (0,260,0)
6 (1569.41,647.203) 31_1 (260,195,0)
7 (1518.63,651.051) 31_6 (195,195,0)
8 (1467.39,654.965) 30_1 (130,195,0)
9 (1415.41,658.847) 30_6 (65,195,0)
10 (1362.81,662.706) 29_1 (0,195,0)
11 (1572.67,700.67) 28_6 (260,130,0)
12 (1522.01,704.775) 27_1 (195,130,0)
13 (1470.74,708.871) 27_6 (130,130,0)
14 (1418.85,712.957) 26_1 (65,130,0)
15 (1366.3,717.055) 26_6 (0,130,0)
16 (1575.85,753.958) 25_1 (260,65,0)
17 (1525.21,758.159) 25_6 (195,65,0)
18 (1473.96,762.558) 24_1 (130,65,0)
19 (1422.01,766.885) 24_6 (65,65,0)
20 (1369.68,771.145) 23_1 (0,65,0)
21 (1578.66,807.115) 22_6 (260,0,0)
22 (1528.1,811.685) 21_1 (195,0,0)
23 (1476.89,816.128) 21_6 (130,0,0)
24 (1425.14,820.66) 20_1 (65,0,0)
25 (1372.72,825.194) 20_6 (0,0,0)
The 3 rd left camera target matched set for the 3 rd shot is shown in table 1.3 below:
TABLE 1.3
Serial number Calibrating sub-pixel coordinates of angular point Calibrating unique coding serial number of angular point Calibrating corner point target coordinates
1 (43.0295,213.566) 72_1 (65,260,0)
2 (40.3195,262.27) 70_6 (65,195,0)
3 (37.3387,312.53) 66_1 (65,130,0)
4 (34.7482,364.339) 64_6 (65,65,0)
5 (32.302,417.482) 60_1 (65,0,0)
6 (106.736,219.495) 73_6 (130,260,0)
7 (104.815,267.565) 70_1 (130,195,0)
8 (103.002,317.404) 67_6 (130,130,0)
9 (101.341,368.812) 64_1 (130,65,0)
10 (99.8036,421.57) 61_6 (130,0,0)
11 (169.235,225.168) 73_1 (195,260,0)
12 (168.514,272.809) 71_6 (195,195,0)
13 (167.585,322.438) 67_1 (195,130,0)
14 (166.952,373.072) 65_6 (195,65,0)
15 (166.57,425.488) 61_1 (195,0,0)
16 (230.967,230.616) 74_6 (260,260,0)
17 (231.051,277.897) 71_1 (260,195,0)
18 (231.147,326.904) 68_6 (260,130,0)
19 (231.542,377.322) 65_1 (260,65,0)
20 (232.113,429.225) 62_6 (260,0,0)
The 4 th left camera target matched set for the 3 rd shot is shown in table 1.4 below:
TABLE 1.4
Figure BDA0003016961760000231
Figure BDA0003016961760000241
The 5 th left camera target matched set from the 3 rd shot is shown in Table 1.5 below
TABLE 1.5
Serial number Calibrating sub-pixel coordinates of angular point Calibrating unique coding serial number of angular point Calibrating corner point target coordinates
1 (748.144,364.867) 117_6 (0,260,0)
2 (742.393,411.733) 114_1 (0,195,0)
3 (736.537,458.532) 111_6 (0,130,0)
4 (730.917,505.054) 108_1 (0,65,0)
5 (725.343,551.282) 105_6 (0,0,0)
6 (793.21,370.438) 117_1 (65,260,0)
7 (787.404,417.024) 115_6 (65,195,0)
8 (781.617,463.388) 111_1 (65,130,0)
9 (775.803,50***) 109_6 (65,65,0)
10 (770.292,555.5) 105_1 (65,0,0)
11 (837.653,376.085) 118_6 (130,260,0)
12 (831.768,422.207) 115_1 (130,195,0)
13 (826.005,468.337) 112_6 (130,130,0)
14 (820.195,514.124) 109_1 (130,65,0)
15 (814.503,559.708) 106_6 (130,0,0)
16 (881.286,381.725) 118_1 (195,260,0)
17 (875.429,427.436) 116_6 (195,195,0)
18 (869.561,473.221) 112_1 (195,130,0)
19 (863.789,518.6) 110_6 (195,65,0)
20 (858.074,563.866) 106_1 (195,0,0)
21 (924.214,387.092) 119_6 (260,260,0)
22 (918.42,432.487) 116_1 (260,195,0)
23 (912.524,477.886) 113_6 (260,130,0)
24 (906.76,522.956) 110_1 (260,65,0)
25 (901.026,567.834) 107_6 (260,0,0)
Step 13.4, define the integer variable i1、i2And assign value i1=0,i2=0;
Step 13.5, judge L [ i1]Whether or not it is equal to A1[i2]If L [ i ]1]==A1[i2]Then, the (i) th shot at the 3 rd time is performed1+1) left camera calibration matching group as the (i) th shot of the τ th time2+1) left camera external parameter calibration matching group, and the (i) rd shot at the 3 rd time1+1) left camera calibration target as the (i) th shot of the 3 rd time2+1) external reference calibration targets of the left cameras, and executing the step 13.6; otherwise will be (i)1+1) assigning a value to i1Then, the step is executed again;
step 13.6, judge i2Whether or not less than N 31, if i2N 31, then otherwise (i) will be2+1) assigning a value to i2Re-supply to the i1Assignment i1If not, returning to the step 8.5 to execute the steps sequentially; otherwise, finding 5 left camera external parameter calibration matching groups contained in the 5 left camera calibration matching groups shot at the 3 rd time;
through comparison, the 1 st left camera calibration matching group shot at the 3 rd time can be used as a 1 st left camera external reference calibration matching group, the 2 nd left camera calibration matching group is used as a 2 nd left camera external reference calibration matching group, the 3 rd left camera calibration matching group is used as a 3 rd left camera external reference calibration matching group, the 4 th left camera calibration matching group is used as a 4 th left camera external reference calibration matching group, and the 5 th left camera calibration matching group is used as a 5 th left camera external reference calibration matching group;
step 13.7, taking an i integer variable and assigning i to be 0;
step 13.8, shoot A of the tau2[i]The left camera external parameter calibration matching group is used as an (i +1) th left camera external parameter optimization matching group shot at the tau time;
step 13.9, judging whether i is less than beta'3-1, if i < β'3And-1, assigning i +1 to i, returning to the step 8.8 for sequential execution, and otherwise obtaining the beta 'of the tau shooting'3The external parameter optimization matching group of the left camera;
the 1 st left camera external parameter calibration matching group shot at the 3 rd time can be used as a 1 st left camera external parameter optimization matching group, the 2 nd left camera external parameter calibration matching group can be used as a 2 nd left camera external parameter optimization matching group, the 3 rd left camera external parameter calibration matching group can be used as a 3 rd left camera external parameter optimization matching group, the 4 th left camera external parameter calibration matching group can be used as a 4 th left camera external parameter optimization matching group, and the 5 th left camera external parameter calibration matching group can be used as a 5 th left camera external parameter optimization matching group;
through steps 13.1 to 13.9, 5 left camera calibration matching groups shot at the 3 rd time are obtained, wherein the 5 left camera calibration matching groups shot at the 3 rd time are also the 5 left camera external parameter calibration matching groups shot at the 3 rd time, and the 5 left camera external parameter calibration matching groups shot at the 3 rd time are also the 5 left camera external parameter optimization matching groups shot at the 3 rd time.
And obtaining the right camera calibration matching group by adopting the same method as the method for obtaining the left camera calibration matching group.
In this embodiment, the 1 st right camera target matching group shot at the 3 rd time is shown in the following table 2.1:
TABLE 2.1
Serial number Calibrating sub-pixel coordinates of angular point Calibrating unique coding serial number of angular point Calibrating corner point target coordinates
1 (715.358,731.569) 14_6 (328,328,0)
2 (691.878,776.753) 13_1 (246,328,0)
3 (667.72,823.381) 13_6 (164,328,0)
4 (642.61,871.737) 12_1 (82,328,0)
5 (616.712,921.885) 12_6 (0,328,0)
6 (768.652,761.59) 11_1 (328,246,0)
7 (746.432,807.149) 11_6 (246,246,0)
8 (723.217,854.153) 10_1 (164,246,0)
9 (699.152,903.021) 10_6 (82,246,0)
10 (674.441,953.499) 9_1 (0,246,0)
11 (821.98,791.476) 8_6 (328,164,0)
12 (800.682,837.323) 7_1 (246,164,0)
13 (778.585,884.752) 7_6 (164,164,0)
14 (755.725,933.895) 6_1 (82,164,0)
15 (732.103,984.895) 6_6 (0,164,0)
16 (874.587,820.93) 5_1 (328,82,0)
17 (854.49,867.128) 5_6 (246,82,0)
18 (833.376,914.889) 4_1 (164,82,0)
19 (811.665,964.463) 4_6 (82,82,0)
20 (789.134,1015.63) 3_1 (0,82,0)
21 (926.976,849.965) 2_6 (328,0,0)
22 (907.828,896.412) 1_1 (246,0,0)
23 (887.759,944.562) 1_6 (164,0,0)
24 (867.164,994.396) 0_1 (82,0,0)
25 (845.68,1046.04) 0_6 (0,0,0)
The 2 nd right camera target match set for the 3 rd shot is shown in table 2.2 below:
TABLE 2.2
Figure BDA0003016961760000261
Figure BDA0003016961760000271
The 3 rd right camera target matched set for the 3 rd shot is shown in table 2.3 below:
TABLE 2.3
Serial number Calibrating sub-pixel coordinates of angular point Calibrating unique coding serial number of angular point Calibrating corner point target coordinates
1 (395.911,273.272) 72_6 (0,260,0)
2 (388.755,318.026) 69_1 (0,195,0)
3 (381.666,364.229) 66_6 (0,130,0)
4 (374.213,411.522) 63_1 (0,65,0)
5 (366.753,460.387) 60_6 (0,0,0)
6 (452.381,274.184) 72_1 (65,260,0)
7 (446.089,318.827) 70_6 (65,195,0)
8 (439.753,364.932) 66_1 (65,130,0)
9 (433.272,412.603) 64_6 (65,65,0)
10 (426.794,461.259) 60_1 (65,0,0)
11 (509.217,275.65) 73_6 (130,260,0)
12 (503.758,320.331) 70_1 (130,195,0)
13 (498.167,366.492) 67_6 (130,130,0)
14 (492.665,413.994) 64_1 (130,65,0)
15 (486.924,462.692) 61_6 (130,0,0)
16 (566.16,277.061) 73_1 (195,260,0)
17 (561.459,321.534) 71_6 (195,195,0)
18 (556.873,367.937) 67_1 (195,130,0)
19 (552.044,415.063) 65_6 (195,65,0)
20 (547.24,464.099) 61_1 (195,0,0)
The 4 th right camera target matched set for the 3 rd shot is shown in table 2.4 below:
TABLE 2.4
Serial number Calibrating sub-pixel coordinates of angular point Calibrating unique coding serial number of angular point Calibrating corner point target coordinates
1 (1280.53,907.446) 99_6 (0,328,0)
2 (1220.96,925.79) 96_1 (0,246,0)
3 (1161.17,944.185) 93_6 (0,164,0)
4 (1101.19,962.458) 90_1 (0,82,0)
5 (1041.61,980.399) 87_6 (0,0,0)
6 (1300.16,965.798) 99_1 (82,328,0)
7 (1240.15,984.559) 97_6 (82,246,0)
8 (1179.79,1003.16) 93_1 (82,164,0)
9 (1119.44,1021.59) 91_6 (82,82,0)
10 (1059.21,1039.62) 87_1 (82,0,0)
11 (1320.02,1025.37) 100_6 (164,328,0)
12 (1259.57,1044.21) 97_1 (164,246,0)
13 (1198.76,1063.09) 94_6 (164,164,0)
14 (1137.99,1081.68) 91_1 (164,82,0)
15 (1077.24,1099.94) 88_6 (164,0,0)
16 (1340.21,1085.59) 100_1 (246,328,0)
17 (1279.25,1104.77) 98_6 (246,246,0)
18 (1217.9,1123.74) 94_1 (246,164,0)
19 (1156.59,1142.52) 92_6 (246,82,0)
20 (1095.36,1161.02) 88_1 (246,0,0)
The 5 th right camera target matched set for the 3 rd shot is shown in table 2.5 below:
TABLE 2.5
Figure BDA0003016961760000281
Figure BDA0003016961760000291
Through comparison, the 1 st right camera calibration matching group shot at the 3 rd time can be used as a 1 st right camera external reference calibration matching group, the 2 nd right camera calibration matching group is used as a 2 nd right camera external reference calibration matching group, the 3 rd right camera calibration matching group is used as a 3 rd right camera external reference calibration matching group, the 4 th right camera calibration matching group is used as a 4 th right camera external reference calibration matching group, and the 5 th right camera calibration matching group is used as a 5 th right camera external reference calibration matching group;
in this embodiment, the 1 st right-camera external-parameter calibration matching group shot at the 3 rd time may be used as the 1 st right-camera external-parameter optimization matching group, the 2 nd right-camera external-parameter calibration matching group may be used as the 2 nd right-camera external-parameter optimization matching group, the 3 rd right-camera external-parameter calibration matching group may be used as the 3 rd right-camera external-parameter optimization matching group, the 4 th right-camera external-parameter calibration matching group may be used as the 4 th right-camera external-parameter optimization matching group, and the 5 th right-camera external-parameter calibration matching group may be used as the 5 th right-camera external-parameter optimization matching group;
through the above process, 5 right camera calibration matching groups shot at the 3 rd time are obtained, wherein the 5 right camera calibration matching groups shot at the 3 rd time are also 5 right camera external parameter calibration matching groups shot at the 3 rd time, and the 5 right camera external parameter calibration matching groups shot at the 3 rd time are also 5 right camera external parameter optimization matching groups shot at the 3 rd time.
Step 14, according to the 5 left camera calibration matching groups shot at the 3 rd time, calculating the internal parameters and distortion coefficients of the left camera by using an internal and external parameter calibration algorithm of the monocular camera, and respectively converting the internal parameters and distortion coefficients of the left camera into the rotation matrixes R of the No. 1 target coordinate system, the No. 2 target coordinate system, … and the No. 5 target coordinate system in the space from the left camera coordinate systeml,1、Rl,2、Rl,3、…Rl,5And translation vector Tl,1、Tl,2、Tl,3、…Tl,5
In this embodiment, the calibration result of the left camera is as follows:
intrinsic parameters of the left camera:
Figure BDA0003016961760000301
distortion coefficient of left camera: (-0.1917020.160288-0.005140170.00600753);
rotation matrix of number 1 coded planar target:
Figure BDA0003016961760000302
translation vector for coding planar target No. 1: t isl,1=(-885.609 145.787 2569.82)T
Rotation matrix of number 2 coded planar target:
Figure BDA0003016961760000303
number 2 coded planar targetsTranslation vector: t isl,2=(491.602 270.343 2457.58)T
Rotation matrix of number 3 coded planar target:
Figure BDA0003016961760000304
translation vector of coding plane target No. 3: t isl,3=(-970.715 -178.611 1931.17)T
Rotation matrix of number 4 coded planar target:
Figure BDA0003016961760000305
translation vector of coding plane target No. 4: t isl,4=(-459.75 475.362 2653.55)T
Rotation matrix of No. 5 encoded planar target:
Figure BDA0003016961760000306
translation vector of coding plane target No. 5: t isl,5=(-324.872 -66.8535 2875.99)T
According to the 5 right camera calibration matching groups shot at the 3 rd time, the internal parameters and the distortion coefficients of the right camera are calculated by utilizing a monocular camera internal and external parameter calibration algorithm, and the rotation matrixes R of the No. 1 target coordinate system, the No. 2 target coordinate system, … and the No. 5 target coordinate system are respectively transformed into the space from the right camera coordinate systemr,1、Rr,2、Rr,3、…Rr,5And translation vector Tr,1、Tr,2、Tr,3、…Tr,5
In specific implementation, the calibration result of the right camera is as follows:
internal parameters of the right camera:
Figure BDA0003016961760000311
distortion coefficient of right camera: (-0.1832880.003051160.000170336-0.00281504);
rotation matrix of number 1 coded planar target:
Figure BDA0003016961760000312
translation vector for coding planar target No. 1: t isr,1=(-325.365 177.251 2855.17)T
Rotation matrix of number 2 coded planar target:
Figure BDA0003016961760000313
translation vector for coding planar target No. 2: t isr,2=(784.959 276.542 2280.85)T
Rotation matrix of number 3 coded planar target:
Figure BDA0003016961760000314
translation vector of coding plane target No. 3: t isr,3=(-638.01 -150.861 2281.31)T
Rotation matrix of number 4 coded planar target:
Figure BDA0003016961760000315
translation vector of coding plane target No. 4: t isr,4=(107.478 501.364 2791.31)T
Rotation matrix of No. 5 encoded planar target:
Figure BDA0003016961760000321
translation vector of coding plane target No. 5: t isr,5=(298.534 -42.8695 2943.63)T
Step 15, the left camera coordinate system obtained in the step 14 is respectively converted into the rotation matrixes R of the target coordinate system No. 1, the target coordinate system No. 2, … and the target coordinate system No. 5l,1、Rl,2、Rl,3、…Rl,5And translation vector Tl,1、Tl,2、Tl,3、…Tl,5In the method, rotation matrixes R 'of a left camera coordinate system transformed to a target coordinate system No. 1, a target coordinate system No. 2, … and a target coordinate system No. 5 are searched'l,1、R′l,2、R′l,3、…R′l,5And translation vector T'l,1、T′l,2、T′l,3、…T′l,5
The right camera coordinate system obtained in the step 14 is respectively transformed into the rotation matrixes R of the target coordinate system No. 1, the target coordinate system No. 2, … and the target coordinate system No. 5 in the spacer,1、Rr,2、Rr,3、…Rr,5And translation vector Tr,1、Tr,2、Tr,3、…Tr,5In the method, rotation matrixes R 'of a right camera coordinate system transformed to a target coordinate system No. 1, a target coordinate system No. 2, … and a target coordinate system No. 5 are searched'r,1、R′r,2、R′r,3、…R′r,5And translation vector T'r,1、T′r,2、T′r,3、…T′r,5
Step 16.1, making an integer variable i equal to 0;
step 16.2, transforming to A by using the left camera coordinate system1[i]No. target coordinate system rotation matrix R'l,i+1And translation vector T'l,i+1And transformation of the right camera coordinate system to A1[i]No. target coordinate system rotation matrix R'r,i+1And translation vector T'r,i+1Solving the rotation and translation relation between the left camera coordinate system and the right camera coordinate system;
step 16.3, judging whether i is smaller than 5, if 5, assigning i +1 to i, and returning to the step 16.2 for sequential execution; otherwise, executing step 17; in an embodiment, one can find:
Figure BDA0003016961760000322
T1=(-373.5987 5.7553 138.9618)T
Figure BDA0003016961760000323
T2=(-663.7853 18.9551 234.0859)T
Figure BDA0003016961760000324
T3=(-388.8298 22.05267 133.8416)T
Figure BDA0003016961760000325
T4=(-378.3818 18.4345 143.787)T
Figure BDA0003016961760000331
T5=(-342.6419 -24.343 120.5320)T
step 17, calculating the initial values of a rotation matrix R and a translational vector T (external parameters of the binocular camera) transformed from the left camera coordinate system to the right camera coordinate system by formula (3):
the following calculation results:
Figure BDA0003016961760000332
T=(-429.4475 8.17093 154.2417)T
and step 18, after obtaining the internal parameters and distortion coefficients of the left camera, the internal parameters and distortion coefficients of the right camera and the initial external parameters between the left camera and the right camera, calculating the accurate values R 'and T' of the external parameters of the binocular camera by using an optimization method based on standard length so as to finish calibration of the binocular camera. In this embodiment, the result of optimizing the external parameters of the binocular camera is as follows:
optimizing the average error: 0.093652 mm;
Figure BDA0003016961760000333
T′=(-445.375 20.703 89.175)T
in specific implementation, all calibration corner points extracted from an image are classified by using a calibration corner point classification method for a multi-coding planar target in space, and the method includes the following steps (because the method for processing the calibration corner points in the image by using the calibration corner point classification method for the multi-coding planar target in space is similar, the left camera target image shot at the 3 rd time is taken as an example for detailed explanation in this embodiment):
step 1.1, counting the total number of the calibration corner points extracted from the left camera target image shot at the 3 rd time according to the unique code number set of all the calibration corner points extracted from the left camera target image shot at the 3 rd time
Figure BDA0003016961760000334
Step 1.2, defining the number of calibration angular points on No. 1 coding plane target in the 3 rd shot left camera target image
Figure BDA0003016961760000335
Number of calibration angular points on No. 2 coding plane target
Figure BDA0003016961760000336
… and 5 number of calibration corner points on coding plane target
Figure BDA0003016961760000337
And initialize
Figure BDA0003016961760000338
Step 2, defining integer variables j and k, and assigning j to 1 and k to 1;
step 3, according to the unique code serial number of the jth calibration angular point in the unique code serial number set of all calibration angular points extracted from the target image of the left camera shot at the 3 rd time
Figure BDA0003016961760000339
(
Figure BDA00030169617600003310
And
Figure BDA00030169617600003311
all are integers) are judged:
(1) if it is
Figure BDA00030169617600003312
Then all the calibration corner points extracted from the 3 rd shot left camera target image are in the calibration corner point pixel coordinate system o of the left camera target imagel-xlylPlacing the jth calibration angular point sub-pixel coordinate in the sub-pixel coordinate set into the calibration angular point sub-pixel coordinate set of the k number coding plane target on the left camera target image shot at the 3 rd time, and placing the sub-pixel coordinate set into the calibration angular point sub-pixel coordinate set of the k number coding plane target on the left camera target image shot at the 3 rd time
Figure BDA0003016961760000341
Is assigned to
Figure BDA0003016961760000342
And executing the step 4;
(2) judging whether k is smaller than 5, if k is smaller than 5, assigning k +1 to k, and then executing the step 3 again; otherwise, executing step 4;
step 4, judging whether j is smaller than j
Figure BDA0003016961760000343
If it is
Figure BDA0003016961760000344
Assigning j +1 to j, assigning k to 1 again, and returning to the step 3 for sequential execution; otherwise, the 3 rd shot has been takenAll the calibration angle points extracted from the left camera target image are classified to obtain the calibration angle point pixel coordinate system o of each coding plane target on the 3 rd shot left camera target image in the left camera imagel-xlylA lower sub-pixel coordinate set is obtained, and the number of calibration corner points on the No. 1 coding plane target on the left camera target image shot at the 3 rd time is obtained simultaneously
Figure BDA0003016961760000345
Number of calibration angular points on No. 2 coding plane target
Figure BDA0003016961760000346
… and 5 number of calibration corner points on coding plane target
Figure BDA0003016961760000347
In this embodiment, the final classification result of the calibration corner points is shown in tables 1.1 to 1.5, and the number of calibration corner points on the number 1 coding plane target on the 3 rd shot left camera target image
Figure BDA0003016961760000348
Number of calibration angular points on No. 2 coding plane target
Figure BDA0003016961760000349
Number of calibration angular points on No. 3 coding plane target
Figure BDA00030169617600003410
Number of calibration angular points on No. 4 coding plane target
Figure BDA00030169617600003411
Number of calibration angular points on No. 5 coding plane target
Figure BDA00030169617600003412
In a specific embodiment, the method for obtaining the sub-pixel coordinates of all calibration corner points extracted from an image under the calibration corner point pixel coordinate system and the unique code numbers of all calibration corner points extracted from the image by using the decoding method of the coding plane target includes the following steps (since the method for obtaining the calibration corner point code information in the image by using the decoding method of the coding plane target is similar, the left camera target image shot at the 3 rd time is taken as an example for detailed explanation):
step 1, carrying out 8-bit gray level processing on the target image of the left camera shot at the 3 rd time, and recording the obtained image as a multi-coding plane target gray level image P1(ii) a Wherein, the planar target gray image P is coded1Is an 8-bit gray scale map; as shown in fig. 22;
step 2, in the above-mentioned many coded plane target gray level image P1In the method, gamma is identified in a multi-coding plane target gray image P by using a growth-based checkerboard corner point extraction algorithm proposed by Automatic Camera and Range Sensor Calibration using a single ShottComplete or partial coding plane targets, and respectively marked as the 1 st coding plane target, the 2 nd coding plane target, … and the gammatCoding plane targets and obtaining the pixel coordinate system o of all the calibration corner points on each coding plane target in the calibration corner point of the left cameral-xlylThe sub-pixel coordinates of the lower; in specific implementation, gamma is detected in the multi-coding plane target gray image PtThe coordinates of all the calibration corner point sub-pixels on the 1 st, 2 nd, … and 5 th encoding plane targets are shown in tables 3.1 to 3.5, respectively (as shown in fig. 24);
TABLE 3.1
Serial number Calibrating sub-pixel coordinates of angular point Serial number Calibrating sub-pixel coordinates of angular point
1 (262.379,712.833) 14 (320.828,924.864)
2 (243.133,760.545) 15 (302.467,978.998)
3 (223.107,810.086) 16 (425.669,805.175)
4 (202.202,861.848) 17 (410.541,853.209)
5 (180.759,915.859) 18 (394.71,903.058)
6 (317.694,744.323) 19 (378.389,955.04)
7 (299.887,792.099) 20 (361.517,1009.23)
8 (281.307,841.768) 21 (478.118,834.562)
9 (262.005,893.737) 22 (464.33,882.501)
10 (242.062,947.8) 23 (449.676,932.375)
11 (372.223,775.113) 24 (434.799,984.418)
12 (355.79,823.042) 25 (419.238,1038.53)
13 (338.595,872.829)
TABLE 3.2
Serial number Calibrating sub-pixel coordinates of angular point Serial number Calibrating sub-pixel coordinates of angular point
1 (1565.95,593.658) 14 (1418.85,712.957)
2 (1515.15,597.294) 15 (1366.3,717.055)
3 (1463.81,600.978) 16 (1575.85,753.958)
4 (1411.79,604.626) 17 (1525.21,758.159)
5 (1359.26,608.39) 18 (1473.96,762.558)
6 (1569.41,647.203) 19 (1422.01,766.885)
7 (1518.63,651.051) 20 (1369.68,771.145)
8 (1467.39,654.965) 21 (1578.66,807.115)
9 (1415.41,658.847) 22 (1528.1,811.685)
10 (1362.81,662.706) 23 (1476.89,816.128)
11 (1572.67,700.67) 24 (1425.14,820.66)
12 (1522.01,704.775) 25 (1372.72,825.194)
13 (1470.74,708.871)
TABLE 3.3
Figure BDA0003016961760000351
Figure BDA0003016961760000361
TABLE 3.4
Serial number Calibrating sub-pixel coordinates of angular point Serial number Calibrating sub-pixel coordinates of angular point
1 (837.76,886.718) 11 (881.645,1001.1)
2 (780.777,905.964) 12 (824.331,1021.51)
3 (723.065,925.463) 13 (766.24,1042.37)
4 (664.361,945.202) 14 (707.445,1063.08)
5 (605.502,964.834) 15 (647.891,1083.81)
6 (859.55,943.492) 16 (903.958,1059.06)
7 (802.386,963.445) 17 (846.605,1080.17)
8 (744.37,983.509) 18 (788.28,1101.42)
9 (685.753,1003.66) 19 (729.36,1122.83)
10 (626.421,1023.94) 20 (669.728,1144.25)
TABLE 3.5
Serial number Calibrating sub-pixel coordinates of angular point Serial number Calibrating sub-pixel coordinates of angular point
1 (748.144,364.867) 14 (820.195,514.124)
2 (742.393,411.733) 15 (814.503,559.708)
3 (736.537,458.532) 16 (881.286,381.725)
4 (730.917,505.054) 17 (875.429,427.436)
5 (725.343,551.282) 18 (869.561,473.221)
6 (793.21,370.438) 19 (863.789,518.6)
7 (787.404,417.024) 20 (858.074,563.866)
8 (781.617,463.388) 21 (924.214,387.092)
9 (775.803,50***) 22 (918.42,432.487)
10 (770.292,555.5) 23 (912.524,477.886)
11 (837.653,376.085) 24 (906.76,522.956)
12 (831.768,422.207) 25 (901.026,567.834)
13 (826.005,468.337)
Step 3.1, taking an integer variable k, and giving an initial value k which is 1; when k is 1, the decoding process is the decoding process of the 1 st encoding plane target in the multi-encoding plane target gray image P:
step 3.2, copying the multi-coding plane target gray level image P to obtain the 1 st target copy image P1
Step 4.1, copy image p at ith targetiSelecting the outermost calibration angular points on the ith coding plane target, namely a line 1 calibration angular point, a line 5 calibration angular point and a line 5 calibration angular point), and marking the polygon surrounded by the outermost angular points as a polygon L with the maximum number of the calibration angular points;
step 4.2, by using the digital image processing method, the gray values of all the pixel points in the maximum calibration corner number polygon L are kept unchanged, and the gray values outside the maximum calibration corner number polygon LThe gray values of all the pixel points are assigned to be 255, and the processed image is recorded as a 1 st non-complex background target image p'1
In a specific embodiment, the 1 st background-free target image p'12 nd no complex background target image p'23 rd no complex background target image p'34 th no complex background target image p'4And 5 th no-complex background target image p'5As shown in fig. 26-30, respectively;
step 5, aiming at the 1 st non-complex background target image p'1Performing binarization processing, and obtaining the 1 st target image p 'without complex background'1The image obtained by binarization processing is marked as the 1 st binaryzation image p' without complex background target1So that the No complex background target binaryzation image p' at the 1 st1The background color of the middle parallelogram coding unit is changed into black, the colors of the background color of the parallelogram non-coding unit, the positioning pattern and the orientation pattern are all changed into white, and the color of the coding mark pattern can be white or black according to the coding rule;
step 6, according to the number of the m rows × n columns of calibration corner points contained in the polygon L with the maximum number of calibration corner points, the step can be divided into the following conditions:
in case 1, when m and n are both odd numbers or m and n are odd-even numbers, the number μ (μ is an integer) of parallelogram coding units contained in the polygon L can be calculated by the formula (1-1);
μ=(m-1)(n-1)/2 (1-1)
then step 7.1.1 is performed;
case 2, if m and n are even numbers, the estimated number μ '(μ' is an integer) of parallelogram coding units contained in the polygon L can be calculated by the formula (1-2);
μ′=[(m-1)(n-1)+1]/2 (1-2)
at this time, the number mu of the parallelogram coding units actually contained in the polygon L satisfies mu ≦ mu';
setting a parallelogram coding unit number judgment threshold value L'; in the absence of complicated background targetLabeling binary image P2Etching the black connected domain to make the binary image P without the complex background target2All the parallelogram coding units are disconnected at the diagonal positions, and the complex background-free target binary image P is obtained2The image obtained by the processing is marked as a target binaryzation corrosion image P'2(ii) a Wherein, the binary image P of the target without complex background2When black connected domain corrosion treatment is carried out, the following conditions are satisfied:
(1) each parallelogram coding unit in the polygon L with the maximum number of the calibration angle points meets the requirement, and the white connected domain of the orientation circle, the white connected domain of the positioning ring, the black connected domain of the center of the positioning ring and the white connected domain of the coding mark pattern in the parallelogram coding unit are kept complete;
(2) each parallelogram coding unit in the maximum calibration large angle point number polygon L meets the requirement, and the communicating domains of the orientation pattern, the positioning pattern and the coding mark pattern in the parallelogram coding unit are not communicated with each other;
(3) each parallelogram coding unit in the polygon L with the maximum number of the calibration angle points meets the requirement, and the orientation pattern, the positioning pattern and the coding mark pattern in the parallelogram coding unit are all positioned in the background of the parallelogram coding unit;
binarizing corrosion image P 'at target'2Searching mu ' maximum black connected domains, and calculating the average value χ ' of pixel points contained in the first mu ' -1 maximum black connected domains;
marking the minimum black connected domain in the mu' maximum black connected domains in the polygon L as the tail end black connected domain, and calculating the pixel point chi contained in the tail end black connected domainmJudging according to the formula (1-3);
Figure BDA0003016961760000381
(1) if L ' is less than or equal to L ', the polygon L actually comprises mu ' parallelogram coding units, and the value of mu ' is assigned to mu, and the value of mu is equal to mu '; and step 7.1.2 is executed;
(2) if L ' > L ', the polygon L actually contains μ ' -1 parallelogram coding units, and a value of μ ' -1 is assigned to μ, where μ is μ ' -1; and step 7.1.2 is executed;
in a specific embodiment, m-5 and n-5, then: μ ═ (m-1) (n-1)/2 ═ 8; and step 7.1.1 is executed;
step 7.1.1, in the 1 st binaryzation image p' without complex background target1And performing black connected domain corrosion to ensure that the No. 1 complex background-free target binaryzation image p ″1In the method, all parallelogram coding units are disconnected at the diagonal angles, and the 1 st binaryzation image p' without complex background target is obtained1The image obtained through the processing is recorded as a 1 st target binaryzation corrosion image p'1(as shown in FIG. 31); wherein, the binary image P of the target without complex background2The black connected domain etching treatment is carried out to meet the conditions.
Step 7.1.2, finding binary corrosion image p 'in the 1 st target'1Wherein, mu is 8 maximum black connected domains and is respectively marked as grid connected domain omega1Grid connected domain omega2…, grid connected domain omega8(ii) a Taking an integer variable i, and giving an initial value i to 1;
step 7.2, binarizing the corrosion image p 'at the 1 st target'1In the above step, the square connected domain Ω in the above step 7.1.2 is calculatediPixel coordinate of centroid (x)i,yi)iAnd (5) reassigning i +1 to i, and continuing to execute the step until i is greater than 8, thereby obtaining a 1 st target binary corrosion image p ″'1Upper square connected domain omega1Grid connected domain omega2…, grid connected domain omega8Centroid pixel coordinate (302,884)1、(414,946)2、…、(220,904)8And will (302,884)1、(414,946)2、…、(220,904)8Sequentially serving as a 1 st element, a 2 nd element, … and an 8 th element in a parallelogram coding unit centroid pixel coordinate set A;
step 8.1, assigning an initial value i to the integer variable i again, wherein the initial value i is 1;
step 8.2, binarizing the corrosion image p 'in the 1 st target'1In (1), calculating the distance grid connected domain omegaiCentroid pixel coordinate value (x)i,yi)iThe nearest black connected domain is recorded as the 1 st target binaryzation corrosion image p'1Of (1) ring center connected region omega'i(ii) a Assigning i +1 to i again, and continuing to execute the step until i is greater than 8; thus obtaining 1 st target binaryzation corrosion images p'1Of (1) ring center connected region omega'1And omega 'of circular ring center connected region'2…, ring center connected region omega'8
Step 8.3, assigning the initial value i to the integer variable i again, wherein the initial value i is 1;
step 8.4, binarizing the corrosion image p 'in the 1 st target'1In (1), calculating the 1 st target binary corrosion image p'1Of (1) ring center connected region omega'iCentroid pixel coordinate o ″)d,i(x″d,i,y″d,i) Assigning i +1 to i again, and continuing to execute the step until i is greater than 8; obtaining a 1 st target binaryzation corrosion image p'1Of (1) ring center connected region omega'1And omega 'of circular ring center connected region'2…, ring center connected region omega'8Centroid pixel coordinate o ″)d,1(331,889)、o″d,2(424,950)、…、o″d,8(232,911), and mixing the obtained productd,1(331,889)、o″d,2(424,950)、…、o″d,8(232,911) sequentially as the 1 st element, the 2 nd element, the … th element and the 8 th element in the circular ring centroid pixel coordinate set B;
step 9.1, binarizing the corrosion image p 'in the 1 st target'1In, will remove square connected domain omega1Grid connected domain omega2…, grid connected domain omega8And a circular ring center connected region omega'1And omega 'of circular ring center connected region'2…, ring center connected region omega'8The gray values of the other black connected domains are all assigned to be 255, and the 1 st target is binarizedEtching image p'1The image obtained by the processing is marked as the 1 st decoded binary image P1
Step 9.2, taking an integer variable zeta, and giving an initial value zeta to 1;
step 10.1, the 1 st decoded binary image P1Copying and backing up, and recording the copied image as the zeta-th backup binary image P1,ζ(wherein ζ ═ 1);
step 10.2, in the 1 st backup binary image P1,1Taking the 1 st centroid pixel coordinate value in the parallelogram coding unit centroid pixel coordinate set A (302,884)1Finding the coordinates of distance centroid pixel in the set of calibration corner points Q (302,884)1Pixel coordinate values of the nearest 4 calibration corner points, and setting the pixel coordinate values of the 4 calibration corner points in the 1 st backup binary image P1,1The corresponding 4 pixel points are respectively marked as C ″)1,1(281.307,841.768)、C″1,2(338.595,872.829)、C″1,3(320.828,924.864)、C″1,4(262.005,893.737); and taking the 4 pixel points as the 1 st calibration angular point quadrangle S1And connecting the 4 vertexes to form a 1 st calibration corner point quadrangle S1
Step 11.1, finding out the 1 st barycenter pixel coordinate value in the barycenter pixel coordinate set A of the parallelogram coding unit from the ring barycenter pixel coordinate set B in step 8.2 (302,884)1A corresponding 1 st circular ring centroid pixel coordinate value (331,889);
step 11.2, backup binarization image P at 1 st1,1Searching a white connected domain closest to the coordinate value (331,889) of the centroid pixel of the circular ring, and assigning the gray value of the white connected domain as 0;
step 12, in the 1 st backup binary image P1,1In the above, the 1 st calibration corner point quadrangle S1Except that the gray values of all the pixel points are assigned to be 255, and the 1 st calibration corner point quadrangle S1Keeping the gray values of all internal pixel points unchanged, and marking the obtained image as the 1 st unit binary image without complex backgroundLike E1As shown in fig. 32;
step 13, binarizing the image E in the 1 st unit without complex background1In the method, a unit binary image E with the maximum black connected domain and marked as the 1 st no complex background is searched1Maximum black connected component Ω in1,E(ii) a Extracting the 1 st unit binary image E without complex background1Maximum black connected component Ω in1,EAnd is recorded as the centroid pixel coordinate value of (302,884)1Of a parallelogram-shaped coding unit D1
Step 14, taking the coordinates of the centroid pixel as the value (302,884)1Of a parallelogram-shaped coding unit D1In the method, the number of pixel points contained in each contour is counted, wherein the contour containing the second most pixel points is the 1 st unit binary image E without complex background1The upper centroid pixel coordinate value is (302,884)1In a parallelogram coding unit of (2) an outline G of a positioning circle1Calculating the positioning circle profile G1And recording as a unit binary image E of the 1 st non-complex background1The upper centroid pixel coordinate value is (302,884)1Locate circle centroid pixel coordinate o 'in parallelogram coding unit of (1)'l,1(291,878);
Step 15.1, in the above step 13, the centroid coordinate is (302,884)1Of a parallelogram-shaped coding unit D1In (1), the 2 contours with the largest number of pixels are removed, and the remaining k1(wherein κ 10,1,2, 3.) contours, classified as follows:
case 1, if κ1If 0, go to step 16.1;
case 2 if κ1Not equal to 0, then this κ1The individual contour is the unit binary image E without complex background in the 1 st1The upper centroid pixel coordinate value is (302,884)1The coded mark circle contour in the parallelogram coding unit is recorded as the coded mark circle contour
Figure BDA0003016961760000401
Coded marker circle profile
Figure BDA0003016961760000402
… coded marker circle outline
Figure BDA0003016961760000403
In the examples, κ1In case 2 in this step, the image E is binarized in the 1 st cell without complex background1In the above, the 2 contours including the largest number of pixel points are removed, and the remaining 2 contours are respectively recorded as the contour of the coding mark circle
Figure BDA0003016961760000404
Coded marker circle profile
Figure BDA0003016961760000405
Step 15.2, assigning an initial value i to the integer variable i again, wherein the initial value i is 1;
step 15.3, binarizing the image E in the 1 st unit without complex background1In, calculating the circular contour of the code mark
Figure BDA0003016961760000419
Of centroid pixel coordinate o'1 i(x′1 i,y′1 i) Assigning i +1 to i again and continuing to execute the step until i is greater than 2; from this, it can be found that the centroid pixel coordinate value is (302,884)1Coded flag circle contour in parallelogram coding unit of
Figure BDA00030169617600004110
Coding mark circle profile S1 2Of centroid pixel coordinate o'1 1(292,858)、o′1 2(303,864);
Step 16.1, binarizing the image E in the 1 st unit without complex background1Recording the pixel point with the pixel coordinate value of (331,889) as the centroid pixel coordinate value of (302,884)1Of a parallelogramOriented circular centroid o 'on coding unit'd,1(331,889); and binarizing the image E in the 1 st cell without complex background1In the above, 4 pixels having pixel coordinate values of (281.307,841.768), (338.595,872.829), (320.828,924.864) and (262.005,893.737) are denoted as C'1,1(281.307,841.768)、C′1,2(338.595,872.829)、C′1,3(320.828,924.864)、C′1,4(262.005,893.737);
Step 16.2, binarizing the image E in the 1 st unit without complex background1Upper, get C1,1(x1,1,y1,1)、C1,2(x1,2,y1,2)、C1,3(x1,3,y1,3)、C1,4(x1,4,y1,4) Respectively expressed at the coordinates of the center of mass of (302,884)1The pixel coordinates of the calibration corner points of the No. 1 coding region, the No. 3 coding region, the No. 4 coding region and the No. 6 coding region in the parallelogram coding unit; the centroid pixel coordinate value is (302,884)1In a parallelogram coding unit
Figure BDA0003016961760000411
Can be obtained from formulas (1-4) while recording through the centroid o 'of the positioning circle'l,1And a directional ring centroid o'd,1Is a straight line of1,3
Figure BDA0003016961760000412
Step 17, binarizing the image E in the 1 st unit without complex background1Last, 4 pixel points C'1,1(281.307,841.768)、C′1,2(338.595,872.829)、C′1,3(320.828,924.864)、C′1,4(262.005,893.737) center of mass o 'of the circle'l,1(291,878) the nearest 2 pixels are respectively marked as C1,1min(281.307,841.768) and C1,2min(262.005,893.737); the coordinate value of the centroid pixel is calculated to be (302,884) through the formulas (1-5) and (1-6)1In the parallelogram coding unit of1 judgment vector
Figure BDA0003016961760000413
And 2 nd decision vector
Figure BDA0003016961760000414
And calculating the area division sine value 1sin alpha by the formulas (1-7) and (1-8)1Sum region dividing sine value 2sin beta1
Figure BDA0003016961760000415
Figure BDA0003016961760000416
Figure BDA0003016961760000417
Figure BDA0003016961760000418
Case 1, if sin α1<0,sinβ1If greater than 0, then C1,1min(x1,1min,y1,1min) Is the centroid pixel coordinate value is (302,884)1C for the 1 st coding region in the parallelogram coding unit1,1min(x1,1min,y1,1min) Is assigned to C1,1(x1,1,y1,1);C1,2min(x1,2min,y1,2min) Is a centroid pixel coordinate value of (302,884)1C of the 6 th coding region in the parallelogram coding unit1,2min(x1,2min,y1,2min) Is assigned to C1,4(x1,4,y1,4);
Case 2, if sin α1>0,sinβ1If < 0, then C1,2min(x1,2min,y1,2min) Is a centroid pixel coordinate value of (302,884)1C for the 1 st coding region in the parallelogram coding unit1,2min(x1,2min,y1,2min) Is assigned to C1,1(x1,1,y1,1);C1,1min(x1,1min,y1,1min) Is a centroid pixel coordinate value of (302,884)1C of the 6 th coding region in the parallelogram coding unit1,1min(x1,1min,y1,1min) Is assigned to C1,4(x1,4,y1,4);
In the specific implementation, this step belongs to case 1, sin α1<0,sinβ1If > 0, then:
C1,1min(281.307,841.768) the centroid pixel coordinate value is (302,884)1C for the 1 st coding region in the parallelogram coding unit1,1min(281.307,841.768) assigning a pixel coordinate value to C1,1(281.307,841.768);C1,2min(262.005,893.737) the centroid pixel coordinate value is (302,884)1C of the 6 th coding region in the parallelogram coding unit1,2min(262.005,893.737) assigning a pixel coordinate value to C1,4(262.005,893.737);
Step 18, binarizing the image E in the 1 st unit without complex background1In step 17, the centroid pixel coordinate value is found to be (302,884)1The calibration corner points C of the 1 st coding region and the 6 th coding region in the parallelogram coding unit1,1(281.307,841.768) and C1,4(262.005,893.737), sub-pixel coordinates C 'of the 4 calibration corner points'1,1(281.307,841.768)、C′1,2(338.595,872.829)、C′1,3(320.828,924.864)、C′1,4(262.005,893.737) the sub-pixel coordinates of the remaining 2 pixels are assigned to the centroid pixel coordinate value of (302,884)1The 1 st temporary coordinate value of the parallelogram coding unit of (1) is denoted as C'1,5(338.595,872.829) and the 2 nd temporary coordinate value, noted as C'1,6(320.828,924.864); according to the formula(1-9) and (1-10) the pixel coordinate value at the centroid can be found to be (302,884)1Of the parallelogram coding unit of (3) th decision vector
Figure BDA0003016961760000421
And 4 th judgment vector
Figure BDA0003016961760000422
Figure BDA0003016961760000423
Figure BDA0003016961760000424
Step 19, according to the 3 rd judgment vector calculated in step 18
Figure BDA0003016961760000425
And 4 th judgment vector
Figure BDA0003016961760000426
The area division sine value 3sin omega can be obtained by the formulas (1-11) and (1-12)1Sum region dividing sine value 4sin xi1
Figure BDA0003016961760000427
Figure BDA0003016961760000428
Case 1, sin ω1<sinξ1And then C'1,5(338.595,872.829) the centroid pixel coordinate value is (302,884)1C 'to the index corner point of the 3 rd coding region in the parallelogram coding unit of (1)'1,5(338.595,872.829) to C1,2(x1,2,y1,2);C′1,6(320.828,924.864) is the centroid pixel coordinate value is (302,884)1C 'to the index corner point of the 4 th coding region in the parallelogram coding unit of'1,6(320.828,924.864) to C1,3(x1,3,y1,3);
Case 2, sin ω1>sinξ1And then C'1,6(320.828,924.864) the centroid pixel coordinate value is (302,884)1C 'to the index corner point of the 3 rd coding region in the parallelogram coding unit of (1)'1,6(320.828,924.864) to C1,2(x1,2,y1,2);C′1,5(338.595,872.829) the centroid pixel coordinate value is (302,884)1C 'of the index corner point of the 4 th coding region in the parallelogram coding unit of (1)'1,5(338.595,872.829) to C1,3(x1,3,y1,3);
In specific implementation, this step belongs to case 1, sin ω1<sinξ1And then:
C′1,5(338.595,872.829) the centroid pixel coordinate value is (302,884)1C 'to the index corner point of the 3 rd coding region in the parallelogram coding unit of (1)'1,5(338.595,872.829) to C1,2(338.595,872.829);C′1,6(320.828,924.864) the centroid pixel coordinate value is (302,884)1C 'to the index corner point of the 4 th coding region in the parallelogram coding unit of'1,6(320.828,924.864) to C1,3(320.828,924.864);
So far, the image E is binarized in the 1 st unit without complex background1In the above, the centroid pixel coordinate value is found to be (302,884)1Is marked with an angular point C of the 1 st coding region in the parallelogram coding unit1,1(281.307,841.768) and a 3 rd coding region calibration corner point C1,2(338.595,872.829) and a calibration corner point C of the 4 th encoding region1,3(320.828,924.864) and the calibration corner point C of the 6 th encoding region1,4(262.005,893.737);
Step 20, in the 1 st unit with no complex backgroundValued image EζThe coordinates of the centroid pixel obtained in step 17 are (302,884)1Is marked with an angular point C of the 1 st coding region in the parallelogram coding unit1,1(281.307,841.768), calibration corner point C of the 6 th encoding region1,4(262.005,893.737) the coordinate value of centroid pixel is (302,884) from formula (1-13)1The 5 th decision vector in the parallelogram coding unit of
Figure BDA0003016961760000431
Figure BDA0003016961760000432
Binarizing image E in 1 st unit without complex background1The coordinate value of the centroid pixel is (302,884)1Positioning circle center of mass o 'of parallelogram encoding unit'l,1(291,878) as a starting point with a 5 th decision vector
Figure BDA0003016961760000433
Parallel and co-directional unit vectors, denoted as
Figure BDA0003016961760000434
And recording unit vector
Figure BDA0003016961760000435
The straight line is l1,1(ii) a The coordinate value of the centroid pixel is (302,884)1Of parallelogram-shaped coding units of (1)'d1(331,889) as a starting point with a 5 th decision vector
Figure BDA0003016961760000436
Parallel and co-directional unit vectors, denoted as
Figure BDA0003016961760000437
And recording the straight line of the unit vector as l1,2(ii) a Re-assigning the integer variable i to 1;
step 21.1, defining 6 floating point type two-dimensional arrays
Figure BDA0003016961760000441
Figure BDA0003016961760000442
For storing the centroid pixel coordinate value is (302,884)1The coding mark circular contour centroid of the parallelogram coding unit respectively positioned in the 1 st coding region, the 2 nd coding region, the 3 rd coding region, the 4 th coding region, the 5 th coding region and the 6 th coding region in the 1 st unit binary image E without complex backgroundζInitializing all elements in the 6 two-dimensional arrays according to the pixel coordinates, and assigning the values to be-1; taking 6 integer variables
Figure BDA0003016961760000443
And it is initialized by the computer system to be initialized,
Figure BDA0003016961760000444
step 21.2, binarizing the image E in the 1 st unit without complex background1In step 15.2, the centroid pixel coordinate value is calculated as (302,884)1In a parallelogram coding unit of
Figure BDA00030169617600004431
Of centroid pixel coordinate o'1 i(x′1 i,y′1 i) Respectively with the center o 'of the positioning circle'l,1And a directional ring center o'd,1The formed ith group of 1 st quadrant vectors
Figure BDA0003016961760000445
And ith group of 2 nd quadrant vectors
Figure BDA0003016961760000446
Figure BDA0003016961760000447
Figure BDA0003016961760000448
According to the calculated 1 st quadrant vector of the ith group
Figure BDA0003016961760000449
And ith group of 2 nd quadrant vectors
Figure BDA00030169617600004410
Unit vector
Figure BDA00030169617600004411
And
Figure BDA00030169617600004412
and a direction vector
Figure BDA00030169617600004413
Calculated by the formulae (1-16), (1-17), (1-18) and (1-19)
Figure BDA00030169617600004414
Figure BDA00030169617600004415
Figure BDA00030169617600004416
Figure BDA00030169617600004417
Figure BDA00030169617600004418
To judge the qualityThe coordinate value of the heart pixel is (302,884)1In the parallelogram-shaped coding unit of (1), the manner of coding the coding region to which the flag circle belongs is as follows:
case 1 if
Figure BDA00030169617600004419
Coded marker circle profile
Figure BDA00030169617600004420
The coordinate value of the pixel falling on the centroid is (302,884)1The 1 st coding region of the parallelogram coding unit of (1); order to
Figure BDA00030169617600004421
Figure BDA00030169617600004422
Then hold
Figure BDA00030169617600004423
Is assigned to
Figure BDA00030169617600004424
Reassigning i +1 to i, restarting to execute the step 21.2 when i is less than or equal to 2, and executing the next step 22 when i is more than 2;
case 2 if
Figure BDA00030169617600004425
Coded marker circle profile
Figure BDA00030169617600004426
The coordinate value of the pixel falling on the centroid is (302,884)1The 2 nd coding region of the parallelogram coding unit of (1); order to
Figure BDA00030169617600004427
Figure BDA00030169617600004428
Then hold
Figure BDA00030169617600004429
Is assigned to
Figure BDA00030169617600004430
Reassigning i +1 to i, restarting to execute the step 21.2 when i is less than or equal to 2, and executing the next step 22 when i is more than 2;
case 3 if
Figure BDA0003016961760000451
Coded marker circle profile
Figure BDA0003016961760000452
The coordinate value of the pixel falling on the centroid is (302,884)1The 3 rd coding region of the parallelogram coding unit of (1); order to
Figure BDA0003016961760000453
Figure BDA0003016961760000454
Then hold
Figure BDA0003016961760000455
Is assigned to
Figure BDA0003016961760000456
Reassigning i +1 to i, restarting to execute the step 21.2 when i is less than or equal to 2, and executing the next step 22 when i is more than 2;
case 4, if
Figure BDA0003016961760000457
Coded marker circle profile
Figure BDA0003016961760000458
The coordinate value of the pixel falling on the centroid is (302,884)1The 4 th coding region of the parallelogram coding unit of (1); order to
Figure BDA0003016961760000459
Figure BDA00030169617600004510
Then hold
Figure BDA00030169617600004511
Is assigned to
Figure BDA00030169617600004512
Reassigning i +1 to i, restarting to execute the step 21.2 when i is less than or equal to 2, and executing the next step 22 when i is more than 2;
situation 5, if
Figure BDA00030169617600004513
Coded marker circle profile
Figure BDA00030169617600004514
The coordinate value of the pixel falling on the centroid is (302,884)1The 5 th coding region of the parallelogram coding unit of (1); order to
Figure BDA00030169617600004515
Figure BDA00030169617600004516
Then hold
Figure BDA00030169617600004517
Is assigned to
Figure BDA00030169617600004518
Reassigning i +1 to i, restarting to execute the step 21.2 when i is less than or equal to 2, and executing the next step 22 when i is more than 2;
case 6 if
Figure BDA00030169617600004519
Coded marker circle profile
Figure BDA00030169617600004520
The coordinate value of the pixel falling on the centroid is (302,884)1The 6 th coding region of the parallelogram coding unit of (1); order to
Figure BDA00030169617600004521
Figure BDA00030169617600004522
Then hold
Figure BDA00030169617600004523
Is assigned to
Figure BDA00030169617600004524
Reassigning i +1 to i, restarting to execute the step 21.2 when i is less than or equal to 2, and executing the next step 22 when i is more than 2;
in a particular embodiment of the present invention,
Figure BDA00030169617600004525
Figure BDA00030169617600004526
Figure BDA00030169617600004527
Figure BDA00030169617600004528
Figure BDA00030169617600004529
Figure BDA00030169617600004530
Figure BDA00030169617600004531
Figure BDA00030169617600004532
and the following results were obtained:
Figure BDA00030169617600004533
coded marker circle profile
Figure BDA00030169617600004534
The coordinate value of the pixel falling on the centroid is (302,884)1The 1 st coding region of the parallelogram coding unit of (1); order to
Figure BDA00030169617600004535
Figure BDA00030169617600004536
Coded marker circle profile
Figure BDA00030169617600004537
The coordinate value of the pixel falling on the centroid is (302,884)1The 2 nd coding region of the parallelogram coding unit of (1); let Cr be1 2[0][0]=303,Cr1 2[0][1]=864;
Step 22, define
Figure BDA0003016961760000461
The coordinate value of the representative centroid pixel is (302,884)1The code value of the w-th bit of the flag circle (where w is 1,2) in the λ -th code region (where λ is 1,2,3,4,5,6) in the parallelogram coding unit of (1),
Figure BDA0003016961760000462
taking 0 or 1; taking an integer variable i, and endowing the i with an initial value i which is 1 again;
step 23.1, the step is divided into the following conditions:
case 1 if Cr1 i[0][0]==-1,Cr1 i[0][1]==-1,Cr1 i[1][0]==-1,Cr1 i[1][1]When the value is-1, then
Figure BDA0003016961760000463
Assigning i +1 to i, and when i is more than 2, continuing to execute the next step 23.2; otherwise, returning to execute the step 23.1;
case 2 if Cr1 i[0][0]==-1,Cr1 i[0][1]==-1,Cr1 i[1][0]≠-1,Cr1 i[1][1]Not equal to-1, recording coordinate point (Cr)1 i[1][0],Cr1 i[1][1]) To a straight line l1,1A distance of
Figure BDA0003016961760000464
To a straight line l1,3A distance of
Figure BDA0003016961760000465
If it is
Figure BDA0003016961760000466
And order
Figure BDA0003016961760000467
If it is
Figure BDA0003016961760000468
Then order
Figure BDA0003016961760000469
Assigning i +1 to i, and when i is more than 2, continuing to execute the next step 23.2; otherwise, returning to execute the step 23.1;
case 3, if Cr1 i[0][0]≠-1,Cr1 i[0][1]≠-1,Cr1 i[1][0]==-1,Cr1 i[1][1]The coordinate point (Cr) is recorded as-11 i[0][0],Cr1 i[0][1]) To a straight line l1,1A distance of
Figure BDA00030169617600004610
To a straight line l1,3A distance of
Figure BDA00030169617600004611
If it is
Figure BDA00030169617600004612
Then order
Figure BDA00030169617600004613
If it is
Figure BDA00030169617600004614
Order to
Figure BDA00030169617600004615
Assigning i +1 to i, and when i is more than 2, continuing to execute the next step 23.2; otherwise, returning to execute the step 23.1; (ii) a
Case 4, if Cr1 i[0][0]≠-1,Cr1 i[0][1]≠-1,Cr1 i[1][0]≠-1,Cr1 i[1][1]Not equal to-1, then order
Figure BDA00030169617600004616
Assigning i +1 to i, and when i is more than 2, continuing to execute the next step 23.2; otherwise, returning to execute the step 23.1;
in a specific embodiment, according to this step:
(1)Cr1 1[0][0]≠-1,Cr1 1[0][1]≠-1,Cr1 1[1][0]==-1,Cr1 1[1][1]is ═ 1, and satisfies
Figure BDA00030169617600004617
Then
Figure BDA00030169617600004618
(2)Cr1 2[0][0]≠-1,Cr1 2[0][1]≠-1,Cr1 1[1][0]==-1,Cr1 1[1][1]Is ═ 1, and satisfies
Figure BDA00030169617600004619
Then
Figure BDA00030169617600004620
Step 23.2, the step is divided into the following conditions:
case 1 if Cr1 i[0][0]==-1,Cr1 i[0][1]==-1,Cr1 i[1][0]==-1,Cr1 i[1][1]When the value is-1, then
Figure BDA00030169617600004621
Assigning i +1 to i, and when i is more than 4, continuing to execute the next step 23.3; otherwise, returning to execute the step 23.2;
case 2 if Cr1 i[0][0]==-1,Cr1 i[0][1]==-1,Cr1 i[1][0]≠-1,Cr1 i[1][1]Not equal to-1, recording coordinate point (Cr)1 i[1][0],Cr1 i[1][1]) To a straight line l1,2A distance of
Figure BDA0003016961760000471
To a straight line l1,3A distance of
Figure BDA0003016961760000472
If it is
Figure BDA0003016961760000473
And order
Figure BDA0003016961760000474
If it is
Figure BDA0003016961760000475
Then order
Figure BDA0003016961760000476
Assigning i +1 to i, and when i is more than 4, continuing to execute the next step 23.3; otherwise, returning to execute the step 23.2;
case 3, if Cr1 i[0][0]≠-1,Cr1 i[0][1]≠-1,Cr1 i[1][0]==-1,Cr1 i[1][1]The coordinate point (Cr) is recorded as-11 i[0][0],Cr1 i[0][1]) To a straight line l1,2A distance of
Figure BDA0003016961760000477
To a straight line l1,3A distance of
Figure BDA0003016961760000478
If it is
Figure BDA0003016961760000479
Then order
Figure BDA00030169617600004710
If it is
Figure BDA00030169617600004711
Order to
Figure BDA00030169617600004712
Assigning i +1 to i, and when i is more than 4, continuing to execute the next step 23.3; otherwise, returning to execute the step 23.2;
case 4, if Cr1 i[0][0]≠-1,Cr1 i[0][1]≠-1,Cr1 i[1][0]≠-1,Cr1 i[1][1]Not equal to-1, then order
Figure BDA00030169617600004713
Assigning i +1 to i, and when i is more than 4, continuing to execute the next step 23.3; otherwise, returning to execute the step 23.2;
in the present embodiment, it is preferred that,
Cr1 3[0][0]==-1,Cr1 3[0][1]==-1,Cr1 3[1][0]==-1,Cr1 3[1][1]when the value is-1, then
Figure BDA00030169617600004714
Cr1 4[0][0]==-1,Cr1 4[0][1]==-1,Cr1 4[1][0]==-1,Cr1 4[1][1]When the value is-1, then
Figure BDA00030169617600004715
Step 23.3, the step is divided into the following conditions:
case 1 if Cr1 i[0][0]==-1,Cr1 i[0][1]==-1,Cr1 i[1][0]==-1,Cr1 i[1][1]When the value is-1, then
Figure BDA00030169617600004716
Assigning i +1 to i, and when i is more than 6, continuing to execute the next step 24; otherwise, returning to execute the step 23.3;
case 2 if Cr1 i[0][0]==-1,Cr1 i[0][1]==-1,Cr1 i[1][0]≠-1,Cr1 i[1][1]Not equal to-1, recording coordinate points
Figure BDA00030169617600004717
To a straight line l1,1A distance of
Figure BDA00030169617600004718
To a straight line l1,3A distance of
Figure BDA00030169617600004719
If it is
Figure BDA00030169617600004720
And order
Figure BDA00030169617600004721
If it is
Figure BDA00030169617600004722
Then order
Figure BDA00030169617600004723
Assigning i +1 to i, and when i is more than 6, continuing to execute the next step 24; otherwise, returning to execute the step 23.3;
case 3, if Cr1 i[0][0]≠-1,Cr1 i[0][1]≠-1,Cr1 i[1][0]==-1,Cr1 i[1][1]The coordinate point (Cr) is recorded as-11 i[0][0],Cr1 i[0][1]) To a straight line l1,1A distance of
Figure BDA00030169617600004724
To a straight line l1,3A distance of
Figure BDA00030169617600004725
If it is
Figure BDA00030169617600004726
Then order
Figure BDA00030169617600004727
If it is
Figure BDA00030169617600004728
Order to
Figure BDA00030169617600004729
Assigning i +1 to i, and when i is more than 6, continuing to execute the next step 24; otherwise, returning to execute the step 23.3;
case 4, if Cr1 i[0][0]≠-1,Cr1 i[0][1]≠-1,Cr1 i[1][0]≠-1,Cr1 i[1][1]Not equal to-1, then order
Figure BDA00030169617600004730
Assigning i +1 to i, and when i is more than 6, continuing to execute the next step 24; otherwise, returning to execute the step 23.3;
in a specific embodiment, the step can be as follows:
Cr1 5[0][0]==-1,Cr1 5[0][1]==-1,Cr1 5[1][0]==-1,Cr1 5[1][1]when the value is-1, then
Figure BDA0003016961760000481
Cr1 6[0][0]==-1,Cr1 6[0][1]==-1,Cr1 6[1][0]==-1,Cr1 6[1][1]When the value is-1, then
Figure BDA0003016961760000482
Step 24, the centroid pixel coordinate value obtained through the above steps 23.1, 23.2 and 23.3 is (302,884)1The coded values of all the coded mark circles in the parallelogram coding unit can be obtained from the formula (1-20) and the unit binary image E without complex background of the 1 st unit1The center of mass pixel coordinate is a value (302,884)1The coding number W of the parallelogram coding unit on the coding plane target placed in the actual space corresponding to the parallelogram coding unit1
W1=V1 T·U=10 (1-20)
Wherein, the column vector U is (2)0,21,22,...211)TColumn vector V1=(0,1,0,1,0,0,0,0,0,0,0,0)T
In the present embodiment, the centroid coordinate in the target image is calculated as (302,884)1The coding number W of the parallelogram coding unit on the coding plane target placed in the actual space corresponding to the parallelogram coding unit 110; and W1The position 10 is in the coding number range (0-17) of the parallelogram coding unit of the coding plane target No. 1, namely the 1 st coding plane target in the current decoding process is the coding plane target No. 1;
step 25, recording the unit binary image E of the 1 st non-complex background1The coordinate value of the upper centroid pixel is (302,884)1Parallel ofThe non-unique coding serial number of the calibration corner point belonging to the sigma-th coding region (wherein sigma is 1,3,4,6) in the polygon coding unit is
Figure BDA0003016961760000483
Wherein the lower foot mark W 110 is the calibration corner point
Figure BDA0003016961760000484
The coding number of the parallelogram coding unit, and the value of the upper corner mark sigma represents the calibration corner point
Figure BDA0003016961760000485
The sigma-th coding region; that is, the coordinates of the centroid pixel are obtained as (302,884)14 calibration angular points C on the parallelogram coding unit1,1(281.307,841.768)、C1,2(338.595,872.829)、C1,3(320.828,924.864)、C1,4(262.005,893.737) the non-unique code numbers are each
Figure BDA0003016961760000486
(where σ1,1=1,σ1,2=3,σ1,3=4,σ1,4=6);
In this embodiment, it is possible to obtain:
calibrating angular point C1,1(281.307,841.768) has a non-unique code number of
Figure BDA0003016961760000487
Calibrating angular point C1,2(338.595,872.829) has a non-unique code number of
Figure BDA0003016961760000488
Calibrating angular point C1,3(320.828,924.864) has a non-unique code number of
Figure BDA0003016961760000489
Calibrating angular point C1,4(262.005,893.737) has a non-unique code number of
Figure BDA00030169617600004810
Step 26.1, take Delta'1,1_σ′1,1、Δ′1,2_σ′1,2、Δ′1,3_σ′1,3、Δ′1,4_σ′1,4Respectively used for storing the coordinate value of the centroid pixel (302,884)14 calibration angular points C on the parallelogram coding unit1,1(281.307,841.768)、C1,2(338.595,872.829)、C1,3(320.828,924.864)、C1,4(262.005,893.737) a unique code number, wherein Δ'1,1、Δ′1,2、Δ′1,3、Δ′1,4、σ′1,1、σ′1,2、σ′1,3、σ′1,4Are all positive integers;
step 26.2, taking an integer variable i and reassigning the value i to 1;
step 26.3, judging whether N is an even number (wherein N is the column number of the calibration corner points on the No. 1 coding plane target in the actual space), and if N is an odd number, executing step 26.4; if N is an even number, taking an integer parameter delta and assigning the value delta to be N/2, and calibrating the corner point C1,i(x1,i,y1,i) Non-unique code number of
Figure BDA0003016961760000491
This step 26.3 can be divided into the following cases:
case 1, if σ 1,i1 or σ1,iWhen W is equal to 6, the product is put in1Value of to delta'1,iWill σ1,iValue of to σ'1,iThen calibrating the corner point C1,i(x1,i,y1,i) Is delta 'as the unique code number'1,i_σ′1,i
Case 2, if σ1,i(W) 3 ═ 31Value of- Δ) to Δ'1,iAssigning 6 to σ'1,iThen calibrating the corner point C1,i(x1,i,y1,i) Is delta 'as the unique code number'1,i_σ′1,i
Case 3, if σ1,i(W) is 4 ═ 41Value of-Delta-1) to Delta'1,iAssigning 1 to σ'1,iThen calibrating the corner point C1,i(x1,i,y1,i) Is delta 'as the unique code number'1,i_σ′1,i
Judging whether i is smaller than 4, if i is smaller than 4, assigning i +1 to i, and returning to the step 26.3 for sequential execution; otherwise, executing step 27;
step 26.4, taking the integer parameter delta, assigning the integer parameter delta to be (N +1)/2, and calibrating the corner point C1,i(x1,i,y1,i) Non-unique code number of
Figure BDA0003016961760000492
This step 26.4 can be divided into the following cases:
case 1, if σ 1,i1 or σ1,iWhen W is equal to 6, the product is put in1Value of to delta'1,iWill σ1,iValue of to σ'1,iThen calibrating the corner point C1,i(x1,i,y1,i) Is delta 'as the unique code number'1,i_σ′1,i
Case 2, if σ1,iWhen the value is 3, the following two cases are divided into:
(1) when phi ispWhen the value is 1, (W) is1Value of- Δ ') to Δ'1,iAssigning 6 to σ'1,iThen calibrating the corner point C1,i(x1,i,y1,i) Is delta 'as the unique code number'1,i_σ′1,i(ii) a Delta' can be derived from the formula (1-21),
Figure BDA0003016961760000493
wherein Δ ″ ═ 2 (W)1-z1) V (N +1) +1 (integers only retained);
(2) when phi ispWhen being equal to 2, (W) is1Value of- Δ '") to Δ'1,iAssigning 6 to σ'1,iThen calibrating the corner point C1,i(x1,i,y1,i) Is delta 'as the unique code number'1,i_σ′1,i(ii) a Delta' can be derived from the formulae (1-22),
Figure BDA0003016961760000494
wherein Δ ″ ═ 2 (W)1-z1+1)/(N +1) +1 (integers only retained);
case 3, if σ1,iThe following two cases are divided into two cases:
(1) when phi ispWhen the value is 1, (W) is1Value of- Δ ') to Δ'1,iAssigning 1 to σ'1,iThen calibrating the corner point C1,i(x1,i,y1,i) Is delta 'as the unique code number'1,i_σ′1,iWherein Δ' can be derived from formula (1-23);
Figure BDA0003016961760000501
wherein Δ ″ ═ 2 (W)1-z1) V (N +1) +1 (integers only retained);
(2) when phi ispWhen being equal to 2, (W) is1Value of- Δ '") to Δ'1,iAssigning 1 to σ'1,iThen calibrating the corner point C1,i(x1,i,y1,i) Is delta 'as the unique code number'1,i_σ′1,iΔ "", can be derived from the formulas (1-24),
Figure BDA0003016961760000502
wherein Δ ″ ═ 2 (W)1-z1+1)/(N +1) +1 (integers only retained);
judging whether i is smaller than 4, if i is smaller than 4, assigning i +1 to i, and returning to the step 26.4 for sequential execution; otherwise, executing step 27;
in this embodiment, N is an odd number, and can be calculated to obtain:
calibrating angular point C1,1(281.307,841.768) the unique code number is 10_ 1;
calibrating angular point C1,2(338.595,872.829) has a unique code number of 7_ 6;
calibrating angular point C1,3(320.828,924.864) has a unique code number of 6_ 1;
calibrating angular point C1,4(262.005,893.737) has a unique code number of 10_ 6;
step 27, assigning ζ +1 to ζ, and then returning to the step 10 sequence execution in claim 15; when zeta > mu is satisfied, the loop is ended, the decoding work of the 1 st coding plane target in the left camera target image shot at the 3 rd time is completed, and the step 28 is executed;
step 28, assigning k +1 to k, and then returning to the step 3.2 to execute in sequence; and ending the cycle until k is more than 5, and finishing the decoding work of all the coding plane targets in the target image of the left camera shot at the 3 rd time.
In a specific embodiment, the step of obtaining the target coordinates of the calibration corner points by using the target coordinate calculation method of the calibration corner points on the coding plane target comprises the following steps: (since the process of obtaining the target coordinates of the calibration corner points by using the target coordinate calculation method of the calibration corner points on the coding plane target is similar, the coding plane target No. 1 in the left camera target image shot at the 3 rd time is taken as an example for detailed description)
Step 1, the decoding result of the No. 1 coding plane target in the left camera target image shot at the 3 rd time is shown in the following table 4.1;
TABLE 4.1
Serial number Calibrating sub-pixel coordinates of angular point Unique code number Serial number Calibrating sub-pixel coordinates of angular point Unique code number
1 (262.379,712.833) 14_6 14 (320.828,924.864) 6_1
2 (243.133,760.545) 13_1 15 (302.467,978.998) 6_6
3 (223.107,810.086) 13_6 16 (425.669,805.175) 5_1
4 (202.202,861.848) 12_1 17 (410.541,853.209) 5_6
5 (180.759,915.859) 12_6 18 (394.71,903.058) 4_1
6 (317.694,744.323) 11_1 19 (378.389,955.04) 4_6
7 (299.887,792.099) 11_6 20 (361.517,1009.23) 3_1
8 (281.307,841.768) 10_1 21 (478.118,834.562) 2_6
9 (262.005,893.737) 10_6 22 (464.33,882.501) 1_1
10 (242.062,947.8) 9_1 23 (449.676,932.375) 1_6
11 (372.223,775.113) 8_6 24 (434.799,984.418) 0_1
12 (355.79,823.042) 7_1 25 (419.238,1038.53) 0_6
13 (338.595,872.829) 7_6
Step 2.1, taking an integer variable i and assigning the value i to 1;
step 2.2, recording the unique code number of the ith calibration corner point as delta'i_σ′i
Step 3.1, if N is an odd number, executing step 3.2; if N is an even number, the step is divided into the following cases:
case 1, if Δ'i_σ′iOf σ'i1 ═ 1; then the unique code number is delta'i_σ′iThe target coordinates corresponding to the calibration corner points are as follows:
Figure BDA0003016961760000511
wherein when
Figure BDA0003016961760000512
When taken, when
Figure BDA0003016961760000513
Taking-;
case 2, if Δ'i_σ′iOf σ'i6; then the unique code number is delta'i_σ′iThe target coordinates corresponding to the calibration corner points are as follows:
Figure BDA0003016961760000514
wherein when
Figure BDA0003016961760000515
When taken, when
Figure BDA0003016961760000516
Taking-;
in this step 3.1 of the process,
Figure BDA0003016961760000517
when deltaWiIn the case of an odd number of the groups,
Figure BDA0003016961760000518
when deltaiIn the case of an even number, the number of the first,
Figure BDA0003016961760000519
after the execution of the step is finished, directly executing the step 3.3;
step 3.2, the step is divided into the following two conditions:
case 1, if Δ'i_σ′iOf σ'i1 ═ 1; then the unique code number is delta'i_σ′iThe target coordinates corresponding to the calibration corner points are as follows:
Figure BDA00030169617600005110
wherein when
Figure BDA00030169617600005111
When taken, when
Figure BDA00030169617600005112
Taking-;
case 2, if Δ'i_σ′iOf σ'i6; then the unique code number is delta'i_σ′iThe target coordinates corresponding to the calibration corner points are as follows:
Figure BDA0003016961760000521
wherein when
Figure BDA0003016961760000522
When taken, when
Figure BDA0003016961760000523
Taking-;
in this step 3.2 δi=2(Δ′i-z1) V (N +1) (the result retains only integer bits);
when deltaiIn the case of an odd number of the groups,
Figure BDA0003016961760000524
when deltaiIn the case of an even number, the number of the first,
Figure BDA0003016961760000525
step 3.3, judging whether i is smaller than 25, if i is smaller than 25, assigning i +1 to i and returning to the step 3.1 for sequential execution; if i is more than or equal to 25, unique code numbers of all calibration corner points in the No. 1 code plane target on the left camera target image shot at the 3 rd time are obtained, as shown in a table 4.2;
TABLE 4.2
Serial number Calibrating sub-pixel coordinates of angular point Calibrating unique coding serial number of angular point Calibrating corner point target coordinates
1 (262.379,712.833) 14_6 (328,328,0)
2 (243.133,760.545) 13_1 (246,328,0)
3 (223.107,810.086) 13_6 (164,328,0)
4 (202.202,861.848) 12_1 (82,328,0)
5 (180.759,915.859) 12_6 (0,328,0)
6 (317.694,744.323) 11_1 (328,246,0)
7 (299.887,792.099) 11_6 (246,246,0)
8 (281.307,841.768) 10_1 (164,246,0)
9 (262.005,893.737) 10_6 (82,246,0)
10 (242.062,947.8) 9_1 (0,246,0)
11 (372.223,775.113) 8_6 (328,164,0)
12 (355.79,823.042) 7_1 (246,164,0)
13 (338.595,872.829) 7_6 (164,164,0)
14 (320.828,924.864) 6_1 (82,164,0)
15 (302.467,978.998) 6_6 (0,164,0)
16 (425.669,805.175) 5_1 (328,82,0)
17 (410.541,853.209) 5_6 (246,82,0)
18 (394.71,903.058) 4_1 (164,82,0)
19 (378.389,955.04) 4_6 (82,82,0)
20 (361.517,1009.23) 3_1 (0,82,0)
21 (478.118,834.562) 2_6 (328,0,0)
22 (464.33,882.501) 1_1 (246,0,0)
23 (449.676,932.375) 1_6 (164,0,0)
24 (434.799,984.418) 0_1 (82,0,0)
25 (419.238,1038.53) 0_6 (0,0,0)
The invention provides a binocular camera internal and external parameter calibration method based on multiple coding plane targets in space, which needs to compile corresponding computer programs and execute the programs on a computer to realize corresponding operation processing and logic control functions.
The above description is only an embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes performed by the present specification and drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A binocular camera internal and external parameter calibration method based on multiple coding plane targets in space is characterized in that: simultaneously shooting a plurality of coding plane targets placed in a space by using two large-view-field cameras with a common view field in the space, thereby obtaining a group of calibration images containing the plurality of coding plane targets; respectively obtaining the calibration angle point information of each coding plane target on the images of the left camera and the right camera by utilizing a decoding method of the coding plane target and a classification method of the calibration angle points, and screening out the coding plane targets which do not meet the calibration conditions; adjusting the spatial pose of the coding plane target which does not meet the calibration condition, and shooting and judging again; finally, each coding plane target on the left camera image and the right camera image meets the calibration condition; and finally, solving the internal parameters of each camera and the rotation and translation relation between the left camera and the right camera by using a Zhang-Zhengyou calibration algorithm to finish the calibration of the internal and external parameters of the binocular camera.
2. The binocular camera internal and external parameter calibration method based on the multi-coding plane target in the space according to claim 1, which is characterized in that: the calibration method comprises the following specific steps:
step 1Defining a calibration angular point number threshold k1Public calibration angular point number threshold k2And a binocular calibration external parameter optimization target number threshold value G', wherein k1、k2And G' are each an integer, k2More than 1, G' is more than or equal to 1; placing G coding plane targets in a space according to a layout rule of a plurality of coding plane targets in the space, wherein G is an integer;
step 2, arranging the initial code numbers of the G code plane targets from small to large, and respectively recording the initial code numbers as z1、z2、z3、…、zGSelecting proper calibration angular points as the origin of a target coordinate system of the plane target according to the number of calibration angular points in 4 vertexes of a 1 st line and a 1 st parallelogram coding unit on a coding plane target, and establishing the target coordinate system by using the origin, wherein z is1、z2、z3、…、zGAre all integers;
step 3, taking the upper left corner of the target image of the left camera as the origin o of the calibration corner point pixel coordinate system of the target image of the left cameralEstablishing a calibration corner point pixel coordinate system o of the target image of the left cameral-xlyl(ii) a The upper left corner of the right camera target image is used as the origin o of the calibration corner point pixel coordinate system of the right camera target imagerEstablishing a calibration corner point pixel coordinate system o of the target image of the right camerar-xryr
Step 4, taking the optical center of the left camera as the origin O of the coordinate system of the left cameral,cEstablishing said left camera coordinate system Ol,c-Xl,cYl,cZl,c(ii) a The optical center of the right camera is used as the origin O of the coordinate system of the right camerar,cEstablishing the right camera coordinate system Or,c-Xr,cYr,cZr,c
Step 5, simultaneously shooting G coded plane targets placed in a space by using two large-view-field cameras with fixed relative positions and absolute positions and common view fields to obtain a group of target images shot at the tau th time, wherein the group of target images comprise a left camera target image shot at the tau th time and a right camera target image shot at the tau th time, and the images are positive integers of tau;
step 6, taking the left camera target image shot at the Tth time as an input condition, and obtaining all calibration corner points extracted from the left camera target image shot at the Tth time in a calibration corner point pixel coordinate system o of the left camera target image by utilizing a decoding method of a coding plane targetl-xlylThe sub-pixel coordinate set, and the unique code sequence number set of all calibration corner points extracted from the tau-th shot left camera target image;
step 7, all calibration corner points extracted from the Tth shot left camera target image are located in the calibration corner point pixel coordinate system o of the left camera target imagel-xlylUsing sub-pixel coordinate set and unique code serial number set of all calibration angle points extracted from the left camera target image shot at the Tth time as input conditions, classifying all calibration angle points extracted from the left camera target image shot at the Tth time by using a calibration angle point classification method of a multi-coding plane target in space, finding a coding plane target to which each calibration angle point belongs, and simultaneously obtaining the number of calibration angle points on the coding plane target at No. 1 in the left camera target image shot at the Tth time
Figure FDA0003016961750000021
Number of calibration angular points on No. 2 coding plane target
Figure FDA0003016961750000022
… number of calibration corner points on G number coding plane target
Figure FDA0003016961750000023
Step 8, sequentially judging the number of calibration angular points on the ith coding plane target in the Tth shot left camera target image
Figure FDA0003016961750000024
Whether or not toSatisfy the threshold k of the number of the calibration angular points1And marking the coding plane target which does not meet the calibration condition, wherein i is a positive integer and i belongs to [1, G ]];
Step 9, judging whether each coding plane target obtains the number of calibration angle points meeting the calibration conditions, if not, adjusting the position and the posture of the marked coding plane target which does not meet the calibration conditions, and circularly executing the steps 5 to 8 until each coding plane target obtains the number of calibration angle points meeting the calibration conditions;
step 10, using the same processing method as the left camera in the steps 6 to 9, taking the right camera target image shot at the t-th time as an input condition until the number of calibration corner points meeting the calibration condition is obtained on each coding plane target in the target image obtained by the right camera;
step 11, sequentially counting the number of calibration angular points on the i number coding plane target in the tau-th shot left camera target image
Figure FDA0003016961750000025
And the number of calibration angular points on the i number coding plane target in the right camera target image shot at the t time
Figure FDA0003016961750000026
Judging, namely taking the i number coding plane target in the left camera target image shot at the tau th time meeting the conditions as a corresponding left camera external reference calibration target, and taking the i number coding plane target in the right camera target image shot at the tau th time meeting the conditions as a corresponding right camera external reference calibration target;
step 12, in the marked Tth shot left camera external reference calibration target and the Tth shot right camera external reference calibration target, respectively carrying out pose adjustment on the coding plane targets placed in the corresponding actual space, so that the number of common calibration angular points meets the threshold value of the number of common calibration angular points;
step 13, sequentially arranging the calibration corner point on the ith left camera calibration target shot for the tau time on the left camera target imageCalibration corner point pixel coordinate system ol-xlylTaking the sub-pixel coordinate set and the unique coding serial number set of the calibration angular points as input conditions, and obtaining the calibration matching group of the ith left camera shot at the tau time by using a target coordinate calculation method of the calibration angular points on the coding plane target;
calibrating the calibration corner point on the ith right camera calibration target shot for the τ time in the calibration corner point pixel coordinate system o of the right camera target imager-xryrTaking the sub-pixel coordinate set and the unique coding serial number set of the calibration corner points as input conditions, and obtaining the calibration matching group of the ith right camera shot at the tau time by using a target coordinate calculation method of the calibration corner points on the coding plane target;
step 14, according to the left camera calibration matching groups shot for the tau time, calculating internal parameters and distortion coefficients of the left camera and a rotation matrix and a translation vector which are respectively transformed from a left camera coordinate system to a corresponding numbered target coordinate system in a space by using a monocular camera internal and external parameter calibration algorithm;
according to a plurality of right camera calibration matching groups shot for the tau time, calculating internal parameters and distortion coefficients of a right camera and a rotation matrix and a translation vector which are respectively transformed from a right camera coordinate system to a corresponding numbered target coordinate system in a space by using a monocular camera internal and external parameter calibration algorithm;
step 15, searching a rotation matrix and a translation vector of a left camera external reference calibration target coordinate system, which are respectively transformed to a corresponding number in space, of the left camera coordinate system in the obtained rotation matrix and translation vector corresponding to the left camera coordinate system;
searching a rotation matrix and a translation vector of a right camera coordinate system which is respectively transformed to a right camera external reference calibration target coordinate system with a corresponding number in a space in the obtained corresponding rotation matrix and translation vector;
step 16, respectively transforming the left camera coordinate system to a rotation matrix and a translation vector of a left camera external reference calibration target coordinate system which is correspondingly numbered in the space, and respectively transforming the camera coordinate system to a rotation matrix and a translation vector of a right camera external reference calibration target coordinate system which is correspondingly numbered in the space, and solving the rotation and translation relation between the left camera coordinate system and the right camera coordinate system;
step 17, calculating initial values of a rotation matrix R and a translational vector T transformed from a left camera coordinate system to a right camera coordinate system;
and step 18, calculating accurate values R 'and T' of external parameters of the binocular camera by using an optimization method based on standard length after obtaining the internal parameters and distortion coefficients of the left camera, the internal parameters and distortion coefficients of the right camera and the initial external parameters between the left camera and the right camera, so as to finish calibration of the binocular camera.
3. The binocular camera internal and external parameter calibration method based on the multi-coding plane target in the space according to claim 2, characterized in that: in step 3, the target coordinate system is created by the following steps:
step 3.1, defining an integer variable i and assigning the value i to 1;
step 3.2, setting the initial code number as ziThe coding plane target is marked as a coding plane target with the number i;
step 3.2, recording the number of the last parallelogram coding unit of the coding plane target of the number i as z'i
Step 3.4, the number of calibration corner points in 4 vertexes of the 1 st parallelogram coding unit in the 1 st line on the i number coding plane target in the marking space is
Figure FDA0003016961750000041
According to
Figure FDA0003016961750000042
Selecting corresponding origin calibration angular points as the origin of the i-number target coordinate system under the numerical condition
Figure FDA0003016961750000043
Encoding auxiliary vectors on planar targets by number i
Figure FDA0003016961750000044
As the target coordinate system of number i
Figure FDA0003016961750000045
The direction of the axis;
step 3.5, coding the forward vector on the plane target by the number i
Figure FDA0003016961750000046
As a target coordinate system of number i
Figure FDA0003016961750000047
Direction of axis, target coordinate system No. i
Figure FDA0003016961750000048
A shaft,
Figure FDA0003016961750000049
Axis and Yt (i)The axis meets the right-hand criterion, so as to establish a target coordinate system of No. i
Figure FDA00030169617500000410
And 3.6, judging whether i is smaller than G, if i is smaller than G, assigning i +1 to i and returning to the step 3.2 for sequential execution.
4. The binocular camera internal and external parameter calibration method based on the multi-coding plane target in the space according to claim 2, characterized in that: in step 8, a specific method for determining whether the number of calibration corner points satisfying the calibration condition is obtained on each encoding plane target is as follows:
step 8.1, taking an integer variable i and assigning the value i to 1; defining an integer variable beta1And assign beta10; definition integer array L [ N ]1]All elements in the array are assigned to be 0;
step 8.2, judge the left camera shot of the Tth timeNumber of calibration angular points on ith coding plane target in machine target image
Figure FDA00030169617500000411
Whether the number of the calibration angle points is larger than a threshold value k1
If it is
Figure FDA00030169617500000412
Then assign i to L [ beta ]1]Will beta1+1 value to β1And taking the i number coded plane target in the target image of the left camera shot at the tau time as the beta number shot at the tau time1Marking the target by a left camera, and marking all marking angular points extracted from the coding plane target of No. i in the left camera target image shot for the Tth time in a marking angular point pixel coordinate system o of the left camera target imagel-xlylTaking a lower sub-pixel coordinate set and a calibration corner point unique code serial number set as the beta-th shot for the tau-th time1Calibration corner points on a left camera calibration target are in a calibration corner point pixel coordinate system o of a left camera target imagel-xlylThen, executing the step 8.3 after the sub-pixel coordinate set and the calibration angular point unique coding sequence number set are obtained;
if it is
Figure FDA00030169617500000413
Marking the coding plane target of the number i in the target image of the left camera shot for the τ th time, and then executing the step 8.3; otherwise, directly executing the step 8.3;
and 8.3, judging whether i is smaller than G, if i is smaller than G, assigning i +1 to i, and returning to the step 8.2 to execute in sequence.
5. The binocular camera internal and external parameter calibration method based on the multi-coding plane target in the space according to claim 2, characterized in that: in step 9 and step 12, the following requirements are satisfied when adjusting the marked encoding plane target: after the marked coding plane target is adjusted, the space posture of the marked coding plane target is still obviously different from that of any other coding plane target; when the marked coding plane target is adjusted, the extraction of the calibration corner points on other coding plane targets is not influenced.
6. The binocular camera internal and external parameter calibration method based on the multi-coding plane target in the space according to claim 2, characterized in that: in step 11, the step of determining the external reference calibration target of the left camera and the external reference calibration target of the right camera is as follows:
step 11.1, taking an integer variable i and assigning the value i to 1; defining an integer variable beta3And assign beta30; definition integer array A1[N3]All elements in the array are assigned to be 0;
step 11.2, according to the number of calibration angular points on the coding plane target I in the target image of the left camera shot for the tau time
Figure FDA0003016961750000051
And the number of calibration angular points on the i number coding plane target in the right camera target image shot at the t time
Figure FDA0003016961750000052
The following judgment is made:
if it is
Figure FDA0003016961750000053
And is
Figure FDA0003016961750000054
Assign i to a13]Will beta3+1 value to β3Taking the i number coded plane target in the target image of the left camera shot at the tau time as the beta number shot at the tau time3A left camera external parameter calibration target, taking the i number coding plane target in the Tth shot right camera target image as the beta number3The external parameters of the right camera are calibrated to the target, and then the step 11.3 is executed; otherwise, directly executing the step 11.3;
step 11.3, judging whether i is smaller than G, if i is smaller than G, assigning i +1 to i, and returning to the step 11.2 for sequential execution; otherwise, executing step 11.4;
step 11.4, taking an integer variable i and assigning the value i to 1; definition of integer variable β'3And assigned value of beta'30; definition integer array A2[N3]All elements in the array are assigned to be 0;
step 11.5, comparing the unique coding sequence number set of the calibration corner points of the ith external reference calibration target in the tau-time shot left camera target image with the unique coding sequence number set of the calibration corner points of the ith external reference calibration target in the tau-time shot right camera target image, and counting the number of the common calibration corner points with the same unique coding sequence number of the calibration corner points
Figure FDA0003016961750000055
And judging:
if it is
Figure FDA0003016961750000056
Assign i to a2[β′3]Is beta'3+1 value to β'3And taking the ith left camera external reference calibration target shot at the tau time as the beta 'shot at the tau time'3The ith right camera external reference calibration target shot at the tau time is used as the beta 'shot at the tau time'3The external parameter optimization target of the right camera is executed 11.6; otherwise, marking the ith left camera external reference calibration target shot at the tau time and the ith right camera external reference calibration target shot at the tau time, and executing the step 11.6;
step 11.6, judge whether i is less than N3If i < N3Assigning i +1 to i and then returning to the step 11.5 for sequential execution; otherwise, executing step 11.7;
step 11.7, judging beta'3If less than G ', if beta'3If < G', executing step 12;
and step 11.8, assigning the tau +1 to the tau, and then returning to the step 5 for sequential execution.
7. The binocular camera internal and external parameter calibration method based on the multi-coding plane target in the space according to claim 2, characterized in that: in step 13, the specific steps of obtaining the left camera calibration matching group and the right camera calibration matching group are as follows:
step 13.1, taking an integer i and assigning the value i to 1;
step 13.2, calculating a calibration corner pixel coordinate system o of the calibration corner on the ith left camera calibration target shot for the τ th time in the left camera target image by using a target coordinate calculation method of the calibration corner on the coding plane targetl-xlylThe lower sub-pixel coordinate and the L [ i-1 ] th coordinate in the space corresponding to one of the lower sub-pixel coordinates]The calibration corner point with the same unique code serial number on each code plane target is positioned at the L [ i-1 ]]Individual target coordinate system
Figure FDA0003016961750000061
Matching relation between the target coordinates, and marking the matching relation as the ith left camera calibration matching group shot at the tau time;
step 13.3, judging whether i is less than N1If i < N1Assigning i +1 to i and then returning to the step 13.2 for sequential execution; otherwise, N of the t-th shooting is obtained1Calibrating a matching group by using the left cameras;
step 13.4, define the integer variable i1、i2And assign value i1=0,i2=0;
Step 13.5, judge L [ i1]Whether or not it is equal to A1[i2]If L [ i ]1]==A1[i2]If the number is τ, the (i) th shot of the number τ is1+1) left camera calibration matching group as the (i) th shot of the τ th time2+1) left camera external parameter calibration matching group, and the (i) th shot from the tau-th time1+1) left camera calibration target as the (i) th shot of the τ th time2+1) external reference calibration targets of the left cameras, and executing the step 13.6; otherwise will be (i)1+1) assigning a value to i1Then, the step is executed again;
step 13.6, judge i2Whether or not less than (N)3-1) if i2<(N3-1), then (i) will be2+1) assigning a value to i2Re-supply to the i1Assignment i1And returning to the step 13.5 to execute the steps sequentially; otherwise, N of the tau-th shooting is found1N contained in calibration matching group of left camera3The external parameters of the left camera are calibrated to form a matching group;
step 13.7, taking an i integer variable and assigning i to be 0;
step 13.8, shoot A of the tau2[i]The left camera external parameter calibration matching group is used as an (i +1) th left camera external parameter optimization matching group shot at the tau time;
step 13.9, judging whether i is less than (beta'3-1), if i < (β'3-1), assigning i +1 to i, returning to the step 13.8 for sequential execution, otherwise obtaining the beta 'of the tau shooting'3And the external parameter optimization matching group of the left camera.
8. The binocular camera internal and external parameter calibration method based on the multi-coding plane target in the space according to claim 1, which is characterized in that: the coding plane target consists of a coding checkerboard formed by alternating parallelogram coding units and parallelogram non-coding units, the coding plane target takes the intersection points of the parallelogram coding units connected with any opposite angle as the calibration angular points of the coding plane target, the coding plane target comprises M rows multiplied by N columns of calibration angular points in total, wherein M and N are positive integers; the interior of each parallelogram coding unit in the coding plane target is provided with a coding pattern, the coding pattern comprises a positioning pattern, an orientation pattern and a coding mark pattern, and the coding mark pattern consists of a plurality of coding unit patterns; the judgment of the rotation direction of the coding plane target can be realized by the orientation pattern and the positioning pattern; the coding mark pattern is used for coding each parallelogram coding unit and each calibration corner point in the coding plane target.
9. The binocular camera internal and external parameter calibration method based on the multi-coding plane target in the space according to claim 1 or 8, which is characterized in that: the coding numbers of all parallelogram coding units on all coding plane targets in the space are different from each other; and the coding numbers of all the parallelogram coding units on the same coding plane target have continuity.
10. A computer-readable storage medium comprising a computer program for use in conjunction with an electronic device having image processing capabilities, the computer program being executable by a processor to perform the parameter calibration method of claim 1.
CN202110391614.7A 2020-12-23 2021-04-12 Binocular camera internal and external parameter calibration method based on multi-coding plane target in space Active CN113129385B (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN2020115409647 2020-12-23
CN202011540964 2020-12-23

Publications (2)

Publication Number Publication Date
CN113129385A true CN113129385A (en) 2021-07-16
CN113129385B CN113129385B (en) 2022-08-26

Family

ID=76775848

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110391614.7A Active CN113129385B (en) 2020-12-23 2021-04-12 Binocular camera internal and external parameter calibration method based on multi-coding plane target in space

Country Status (1)

Country Link
CN (1) CN113129385B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114299172A (en) * 2021-12-31 2022-04-08 广东工业大学 Planar coding target for visual system and real-time pose measurement method thereof
CN114302173A (en) * 2021-12-31 2022-04-08 广东工业大学 Planar coding target and image splicing system and method applying same
CN117036506A (en) * 2023-08-25 2023-11-10 浙江大学海南研究院 Binocular camera calibration method

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102506758A (en) * 2011-10-12 2012-06-20 北京航空航天大学 Object surface three-dimensional morphology multi-sensor flexible dynamic vision measurement system and method
CN104851104A (en) * 2015-05-29 2015-08-19 大连理工大学 Flexible-target-based close-range large-field-of-view calibrate method of high-speed camera
CN104933717A (en) * 2015-06-17 2015-09-23 合肥工业大学 Camera intrinsic and extrinsic parameter automatic calibration method based on directional calibration target
CN105157609A (en) * 2015-09-01 2015-12-16 大连理工大学 Two-sets-of-camera-based global morphology measurement method of large parts
CN105469418A (en) * 2016-01-04 2016-04-06 中车青岛四方机车车辆股份有限公司 Photogrammetry-based wide-field binocular vision calibration device and calibration method
US20170278270A1 (en) * 2016-03-24 2017-09-28 Magna Electronics Inc. Targetless vehicle camera calibration system
CN108182708A (en) * 2017-12-27 2018-06-19 深圳进化动力数码科技有限公司 A kind of scaling method of binocular camera, caliberating device and terminal device
CN109767474A (en) * 2018-12-31 2019-05-17 深圳积木易搭科技技术有限公司 A kind of more mesh camera calibration method, apparatus and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102506758A (en) * 2011-10-12 2012-06-20 北京航空航天大学 Object surface three-dimensional morphology multi-sensor flexible dynamic vision measurement system and method
CN104851104A (en) * 2015-05-29 2015-08-19 大连理工大学 Flexible-target-based close-range large-field-of-view calibrate method of high-speed camera
CN104933717A (en) * 2015-06-17 2015-09-23 合肥工业大学 Camera intrinsic and extrinsic parameter automatic calibration method based on directional calibration target
CN105157609A (en) * 2015-09-01 2015-12-16 大连理工大学 Two-sets-of-camera-based global morphology measurement method of large parts
CN105469418A (en) * 2016-01-04 2016-04-06 中车青岛四方机车车辆股份有限公司 Photogrammetry-based wide-field binocular vision calibration device and calibration method
US20170278270A1 (en) * 2016-03-24 2017-09-28 Magna Electronics Inc. Targetless vehicle camera calibration system
CN108182708A (en) * 2017-12-27 2018-06-19 深圳进化动力数码科技有限公司 A kind of scaling method of binocular camera, caliberating device and terminal device
CN109767474A (en) * 2018-12-31 2019-05-17 深圳积木易搭科技技术有限公司 A kind of more mesh camera calibration method, apparatus and storage medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
HONGYANG ZHAO 等: "The Calibration of Binocular Stereo Measurement System Based on a Coded Model", 《APPLIED MECHANICS AND MATERIALS》 *
乔晓勇等: "双目立体视觉中靶标的设计与识别", 《电子技术》 *
杨博文等: "面向大视场视觉测量的摄像机标定技术", 《光学学报》 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114299172A (en) * 2021-12-31 2022-04-08 广东工业大学 Planar coding target for visual system and real-time pose measurement method thereof
CN114302173A (en) * 2021-12-31 2022-04-08 广东工业大学 Planar coding target and image splicing system and method applying same
CN114299172B (en) * 2021-12-31 2022-07-08 广东工业大学 Planar coding target for visual system and real-time pose measurement method thereof
CN114302173B (en) * 2021-12-31 2022-07-15 广东工业大学 Two-dimensional image splicing system and method for planar coding target
US11689737B1 (en) 2021-12-31 2023-06-27 Guangdong University Of Technology Plane coding target and image splicing system and method applying the same
US11699244B2 (en) 2021-12-31 2023-07-11 Guangdong University Of Technology Planar coding target for vision system and real-time pose measurement method thereof
CN117036506A (en) * 2023-08-25 2023-11-10 浙江大学海南研究院 Binocular camera calibration method
CN117036506B (en) * 2023-08-25 2024-05-10 浙江大学海南研究院 Binocular camera calibration method

Also Published As

Publication number Publication date
CN113129385B (en) 2022-08-26

Similar Documents

Publication Publication Date Title
CN113129385B (en) Binocular camera internal and external parameter calibration method based on multi-coding plane target in space
CN112066879B (en) Air floatation motion simulator pose measuring device and method based on computer vision
CN110490912B (en) 3D-RGB point cloud registration method based on local gray level sequence model descriptor
CN104867160B (en) A kind of directionality demarcation target demarcated for camera interior and exterior parameter
CN104933717A (en) Camera intrinsic and extrinsic parameter automatic calibration method based on directional calibration target
CN111981982B (en) Multi-directional cooperative target optical measurement method based on weighted SFM algorithm
CN113920205B (en) Calibration method of non-coaxial camera
CN113129386B (en) Intelligent calibration method for internal and external parameters of binocular camera based on coding plane target
CN109191562B (en) Three-dimensional reconstruction method based on color pseudo-random coding structured light
CN113160329B (en) Coding plane target for camera calibration and decoding method thereof
CN112686950B (en) Pose estimation method, pose estimation device, terminal equipment and computer readable storage medium
CN113096191B (en) Intelligent calibration method for monocular camera based on coding plane target
CN113129397B (en) Decoding method of parallelogram coding mark based on graphic geometric relation
CN112929626A (en) Three-dimensional information extraction method based on smartphone image
CN113963067B (en) Calibration method for calibrating large-view-field visual sensor by using small target
CN105488535B (en) A kind of three-dimensional point cloud matching process
CN108898629B (en) Projection coding method for enhancing aerial luggage surface texture in three-dimensional modeling
CN112270716B (en) Decoding and positioning method for artificial visual landmarks
CN113112550B (en) Coding plane target for calibrating internal and external parameters of camera and coding method thereof
CN113112548B (en) Rapid calibration method for internal and external parameters of binocular camera based on coded three-dimensional target
CN113129396B (en) Decoding method of parallelogram coding mark based on region segmentation
CN109829951B (en) Parallel equipotential detection method and device and automatic driving system
CN115222828A (en) Regular hexagon coding mark decoding method for visual positioning
CN114299172B (en) Planar coding target for visual system and real-time pose measurement method thereof
CN113192143B (en) Coding stereo target for camera quick calibration and decoding method thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant