CN113112548B - Rapid calibration method for internal and external parameters of binocular camera based on coded three-dimensional target - Google Patents

Rapid calibration method for internal and external parameters of binocular camera based on coded three-dimensional target Download PDF

Info

Publication number
CN113112548B
CN113112548B CN202110386595.9A CN202110386595A CN113112548B CN 113112548 B CN113112548 B CN 113112548B CN 202110386595 A CN202110386595 A CN 202110386595A CN 113112548 B CN113112548 B CN 113112548B
Authority
CN
China
Prior art keywords
target
coding
calibration
camera
beta
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.)
Active
Application number
CN202110386595.9A
Other languages
Chinese (zh)
Other versions
CN113112548A (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 CN113112548A publication Critical patent/CN113112548A/en
Application granted granted Critical
Publication of CN113112548B publication Critical patent/CN113112548B/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/60Analysis of geometric attributes
    • G06T7/66Analysis of geometric attributes of image moments or centre of gravity
    • 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
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics

Abstract

The invention discloses a rapid calibration method of internal and external parameters of a binocular camera based on a coded three-dimensional target, which comprises the steps of shooting the coded three-dimensional target in a space by utilizing two cameras to obtain a group of target images; respectively acquiring the sub-pixel coordinates of the calibration corner point of each coding plane target on the coding three-dimensional target, the unique coding serial number of the calibration corner point and the world coordinates in the target images shot by the left camera and the right camera in the target image group by a decoding method of the coding three-dimensional target, and taking the target images as calibration images if the calibration conditions are met; and solving the internal and external parameters of the left camera and the right camera and the rotation and translation relation between the two cameras by using a Zhang-Yongyou calibration algorithm. The invention can realize the automatic calibration of the internal and external parameters of the binocular camera, the left camera and the right camera only need to respectively shoot one target image, and the calibration work is completed by utilizing a plurality of complete or local coding plane target images contained in the target images, thereby reducing the complexity of camera calibration and improving the efficiency of camera calibration.

Description

Quick calibration method for internal and external parameters of binocular camera based on coded three-dimensional target
Technical Field
The invention relates to the field of camera calibration methods in computer vision, in particular to a method for quickly calibrating internal and external parameters of a binocular camera based on a coded three-dimensional target.
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.
In 1986, Roger Tsai proposes a camera calibration algorithm based on radial constraint, and the calibration algorithm needs 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 cannot shoot a complete planar target in the actual calibration process, and at this time, it is difficult to calibrate the camera and ensure the camera calibration accuracy by using a traditional planar target that does not contain direction information and coding information.
Disclosure of Invention
The invention provides a coded three-dimensional target and a method for quickly calibrating internal and external parameters of a binocular camera based on the coded three-dimensional target, which are used for calibrating the camera by using the coded three-dimensional target containing direction information and coding information so as to ensure the matching precision of sub-pixel coordinates of calibration corner points and target coordinates of the camera during calibration; meanwhile, the local target image without the directional pattern can still be used for calibrating the camera, and the calibration work of the binocular camera can be completed only by shooting one calibration image meeting the calibration condition, so that the calibration complexity is greatly simplified.
In order to solve the technical problems, the invention adopts a technical scheme that: the coding stereo target is arranged opposite to two cameras in space, the positions of the two cameras are fixed, the coding stereo target consists of a reference plate and a plurality of coding plane targets connected on the reference plate, the spatial positions and postures of the reference plate and the coding plane targets can be independently adjusted, the reference plate of the coding stereo target is divided into S areas, each area is provided with one coding plane target, S is an integer and is more than 3, all the coding plane targets are provided with numbers, the numbers of the coding plane targets are different, the spatial postures of any two coding plane targets have obvious difference, and each coding plane target is provided with a plurality of parallelogram coding units, the coding numbers of the parallelogram coding units are different from each other, and the coding numbers of all the parallelogram coding units on the same coding plane target have continuity, and the method is characterized in that: the binocular camera calibration method for coding the three-dimensional target mainly comprises the following steps:
step 1, defining a left camera calibration target number threshold G 1 Right camera calibration target number threshold G 2 Calibrating the angular point number threshold k 1 Coding the planar target number threshold k 2 External reference calibration target number threshold G 3 Public calibration angular point number threshold k 4 Number threshold G of external reference optimization targets 4 Wherein G is 1 、G 2 、G 3 、G 4 、k 1 、k 2 、k 4 Are all integers and G 1 >3,G 2 >3,G 3 >1,1≤G 4 ≤G 3 ,k 1 >4,k 2 >3,k 4 >1;
Step 2, recording images obtained by simultaneously shooting the coding three-dimensional target in the primary space by the left camera and the right camera as a left camera target image and a right camera target image respectively, and establishing a left camera targetMarking image calibration angular point pixel coordinate system o l -x l y l Calibrating a corner pixel coordinate system o with a right camera target image r -x r y r
Specifically, the upper left corner of the target image shot by the left camera is used as the origin o of coordinates of a pixel coordinate system of the calibration corner point of the target image of the left camera l Calibrating x of angular point pixel coordinate system for left camera target image from left to right l Y in axis direction and from top to bottom as calibration corner pixel coordinate system of left camera target image l The axis direction, thereby establishing a pixel coordinate system o of a calibration corner point of a target image of the left camera l -x l y l
Similarly, the upper left corner of the target image shot by the right camera is taken as the origin o of coordinates of the pixel coordinate system of the calibration corner point of the target image of the right camera r Calibrating x of angular point pixel coordinate system for right camera target image from left to right r Y as the calibration corner point pixel coordinate system of the right camera target image from top to bottom in the axial direction r The axis direction, thereby establishing a pixel coordinate system o of the calibration corner point of the target image of the right camera r -x r y r
Step 3, establishing a camera coordinate system of the left camera and a camera coordinate system of the right camera;
step 4, defining an integer variable tau and assigning the tau to be 1, simultaneously shooting a coded stereo target placed in a primary space by utilizing two cameras with fixed relative positions and absolute positions in the space and a common view field, and respectively obtaining a left camera target image shot at the tau time and a right camera target image shot at the tau time;
step 5, defining an integer variable alpha τ And assigns a value of alpha τ =1;
Alpha on coding stereo target at the Tth movement position in recording space τ The number of calibration corner points in 4 vertexes of the 1 st parallelogram coding unit on the 1 st line on the number coding plane target is
Figure BDA0003015293220000021
According to
Figure BDA0003015293220000022
Magnitude of the value, establishing a corresponding alpha τ Number target coordinate system
Figure BDA0003015293220000023
α τ Is an integer and alpha τ ∈[1,S];
Specifically, α τ The establishment of the number target coordinate system is divided into the following two cases:
(1) when in use
Figure BDA0003015293220000031
When, remember alpha τ No. 1 line 1 parallelogram coding unit on number coding plane target
Figure BDA0003015293220000032
The calibration angular point in (1) is the calibration angular point of the original point
Figure BDA0003015293220000033
At the moment, an origin is selected to calibrate the angular point
Figure BDA0003015293220000034
As the alpha th τ Origin of individual target coordinate system
Figure BDA0003015293220000035
At alpha τ Auxiliary vectors on number-coded planar targets
Figure BDA0003015293220000036
Is taken as alpha at the τ th shift position τ Number target coordinate system
Figure BDA0003015293220000037
The direction of the axis;
(2) when in use
Figure BDA0003015293220000038
When, respectively, record alpha τ No. 1 line 1 parallelogram coding unit on number coding plane target
Figure BDA0003015293220000039
Two calibration corner points in
Figure BDA00030152932200000310
And
Figure BDA00030152932200000311
according to the calibrated corner point
Figure BDA00030152932200000312
And
Figure BDA00030152932200000313
the positional relationship of (c) can be further classified into the following cases:
(1) when vector
Figure BDA00030152932200000314
Direction of (a) and τ auxiliary vectors on number-coded planar targets
Figure BDA00030152932200000315
When the directions of the two are the same, the calibration angular point is selected
Figure BDA00030152932200000316
As α τ Origin of number target coordinate system
Figure BDA00030152932200000317
At alpha τ Auxiliary vectors on number-coded planar targets
Figure BDA00030152932200000318
Is taken as alpha at the τ th shift position τ Of number target coordinate system
Figure BDA00030152932200000319
The direction of the axis;
(2) when vector
Figure BDA00030152932200000320
Direction of (a) and τ auxiliary vectors on number-coded planar targets
Figure BDA00030152932200000321
When the directions of the two points are different, the calibration angular point is selected
Figure BDA00030152932200000322
As alpha τ Origin of number target coordinate system
Figure BDA00030152932200000323
At alpha τ Auxiliary vectors on number-coded planar targets
Figure BDA00030152932200000324
Is taken as alpha at the τ th shift position τ Number target coordinate system
Figure BDA00030152932200000325
The direction of the axis;
Figure BDA00030152932200000326
after the direction of the axis is determined, the angle is alpha τ Forward vector on number-coded planar target
Figure BDA00030152932200000327
Is taken as alpha at the τ -th movement position τ Of number target coordinate system
Figure BDA00030152932200000328
Direction of axis, α τ Of number target coordinate system
Figure BDA00030152932200000329
A shaft,
Figure BDA00030152932200000330
Shaft and
Figure BDA00030152932200000331
the axes satisfy the right-hand criterion, thereby establishing alpha at the τ -th shift position τ Number target coordinate system
Figure BDA00030152932200000332
If α is τ If < S, then alpha will be τ +1 to α τ Then returning to the step 5 for circular execution until alpha τ ==S;
Step 6, using the tau-time shot left/right camera target image as an input condition, and obtaining the number of the coding plane targets in the tau-time shot left/right camera target image by using a coding stereo target decoding method
Figure BDA00030152932200000333
The serial number of each coding plane target in the left and right camera target images shot at the tau time, the number of calibration angular points extracted from each coding plane target in the left and right camera target images shot at the tau time and the pixel coordinate system o of each calibration angular point in the calibration angular point pixel coordinate systems of the left and right camera target images l -x l y l The sub-pixel coordinates, the unique code serial number of the calibration corner point extracted from each code plane target in the Tth shot left/right camera target image, and the calibration corner point extracted from each code plane target in the Tth shot left/right camera target image in the left/right camera target image calibration corner point pixel coordinate system o l -x l y l /o r -x r y r The matching relation between the sub-pixel coordinates and the target coordinates of the calibration corner points which correspond to one of the sub-pixel coordinates and have the same unique code serial number on the spatial coding three-dimensional target in the corresponding target coordinate system, wherein
Figure BDA00030152932200000334
Is an integer and
Figure BDA00030152932200000335
step 7, if
Figure BDA00030152932200000336
And is
Figure BDA00030152932200000337
The obtained tau-th shot left camera target image is
Figure BDA00030152932200000338
The numbers of the coding plane targets are arranged from small to big and respectively marked as
Figure BDA0003015293220000041
Wherein
Figure BDA0003015293220000042
Are all integers; and numbering the tau-th shot left camera target image as
Figure BDA0003015293220000043
The coding plane targets are respectively marked as the 1 st, 2 nd, 3 rd coding plane targets, … and the third coding plane target in the left camera target image shot at the Tth time
Figure BDA0003015293220000044
A coded planar target;
the obtained right camera target image shot at the Tth time is
Figure BDA0003015293220000045
The numbers of the coding plane targets are arranged from small to big and respectively marked as
Figure BDA0003015293220000046
Wherein
Figure BDA0003015293220000047
Are all integers; and numbering the tau-th shot right camera target image as
Figure BDA0003015293220000048
The coding plane targets are respectively marked as the 1 st, 2 nd, 3 rd, … th and third coding plane targets in the right camera target image shot at the Tth time
Figure BDA0003015293220000049
A coded planar target;
in this step, if
Figure BDA00030152932200000410
Or
Figure BDA00030152932200000411
Executing the coded stereo target adjusting step until
Figure BDA00030152932200000412
And is
Figure BDA00030152932200000413
Adjusting the coding stereo target: adjusting the spatial pose of a reference plate of the coding stereo target to enable the visual field of the left camera, the visual field of the right camera and the common visual field of the left camera and the right camera to contain more coding plane targets and calibration angular points, assigning tau +1 to tau, and then returning to the step 4 to execute the sequence;
step 8, counting the number beta of the coding planes meeting the calibration corner point threshold in the left camera target image and the right camera target image τ,1 And beta τ,2 The method comprises the following specific steps:
step 8.1, define integer variable i τ 、β τ,1 、β τ,2 And assign value i τ =1、β τ,1 =0、β τ,2 =0;
Step 8.2, if
Figure BDA00030152932200000414
Then step 8.4 is executed; otherwise, executing step 8.3;
step 8.3, the τ th timeShooting ith in left camera target image τ The number of the calibration angular points extracted from the target of each coding plane is recorded as
Figure BDA00030152932200000415
And judging:
if it is
Figure BDA00030152932200000416
Then beta will be τ,1 +1 value to β τ,1 The ith in the left camera target image shot at the Tth time τ Marking the coded plane target as the beta-th image in the left camera target image shot for the tau time τ,1 Marking the target, and shooting the ith time in the target image of the left camera shot for the Tth time τ Numbering of individual coded planar targets
Figure BDA00030152932200000417
Assigning to the beta-th image of the target of the left camera shot at the tau-th time τ,1 Number of individual calibration targets
Figure BDA00030152932200000418
The ith in the target image of the left camera τ Calibration corner points extracted from a coding plane target are in a left camera target image calibration corner point pixel coordinate system o l -x l y l The lower sub-pixel coordinate and the calibration corner point which corresponds to one sub-pixel coordinate and has the same unique code serial number on the spatial coding three-dimensional target are arranged on
Figure BDA00030152932200000419
The matching relation between the target coordinates in the number target coordinate system is recorded as the beta-th shooting of the tau-th time τ,1 Calibrating a matching group by using the left cameras; if it is
Figure BDA00030152932200000420
Step 8.4 is directly executed;
step 8.4, if
Figure BDA0003015293220000051
Step 8.6 is executed; otherwise, executing step 8.5;
step 8.5, the ith camera target image in the right camera target image is processed τ The number of the calibration angular points extracted from the target of each coding plane is recorded as
Figure BDA0003015293220000052
And judging:
if it is
Figure BDA0003015293220000053
Then beta will be τ,2 +1 value to β τ,2 The ith in the right camera target image shot at the Tth time τ Marking the coded plane target as the beta th time in the target image of the right camera shot for the tau time τ,2 Calibrating the target, and shooting the ith time in the target image of the right camera shot at the Tth time τ Numbering of individual coded planar targets
Figure BDA0003015293220000054
Assigning to the beta-th image of the target image of the right camera shot at the tau-th time τ,2 Number of individual calibration targets
Figure BDA0003015293220000055
The ith time in the Tth shot right camera target image τ Calibration corner points extracted from coding plane target on right camera target image calibration corner point pixel coordinate system o r -x r y r The lower sub-pixel coordinate and the calibration corner point which corresponds to one sub-pixel coordinate and has the same unique code serial number on the spatial coding three-dimensional target in mu r,i The matching relation between the target coordinates in the number target coordinate system is recorded as the beta-th shooting of the tau-th time τ,2 Calibrating a matching group by the right cameras; if it is
Figure BDA0003015293220000056
Step 8.6 is directly executed;
step 8.6, if
Figure BDA0003015293220000057
Or
Figure BDA0003015293220000058
Then i will be τ +1 value to i τ And (5) performing the steps 8.2 to 8.5 in a post-circulation manner until
Figure BDA0003015293220000059
And is
Figure BDA00030152932200000510
Step 9, if beta τ,1 ≥G 1 And beta is τ,2 ≥G 2 Beta is obtained on the left camera target image shot at the Tth time τ,1 A calibration target meeting the calibration condition obtains beta on the Tth shot right camera target image τ,2 A calibration target satisfying a calibration condition, and beta τ,1 Left camera calibration matching set and beta τ,2 Calibrating a matching group by the right cameras;
if beta is τ,1 <G 1 Or beta τ,2 <G 2 Then executing the coding stereo target regulation step until beta τ,1 ≥G 1 And beta is τ,2 ≥G 2
Step 10, searching the number beta of the coding flat plane targets with the same target labels in the left camera calibration target set and the right camera calibration target set τ,3 The method comprises the following steps:
step 10.1, let integer variable i τ And assign value i τ 1 is ═ 1; defining an integer variable j τ Defining an integer variable beta τ,3 And assign beta τ,3 =0;
Step 10.2, let integer variable j τ And assign a value j τ =1;
Step 10.3, judging the ith in the Tth shot left camera target image τ Number of individual calibration targets
Figure BDA00030152932200000511
Whether it is equal to j in the Tth shot right camera target image τ Number of individual calibration targets
Figure BDA00030152932200000512
If it is
Figure BDA00030152932200000513
Then beta will be τ,3 +1 value to β τ,3 The ith in the left camera target image shot at the Tth time τ The beta th calibration target is taken as the beta th image in the target image of the left camera shot for the tau th time τ,3 Calibrating a target by an external parameter, and shooting the ith time in the target image of the left camera shot by the Tth time τ Number of individual calibration targets
Figure BDA00030152932200000514
Assigning to the beta th image in the target image of the left camera shot at the tau th time τ,3 Numbering of individual external parameter calibration targets
Figure BDA00030152932200000515
I-th shot of the t-th time τ A left camera calibration matching group is used as the beta-th shot of the tau τ,3 The external parameter calibration matching group of the left camera; j in the Tth shot right camera target image τ Taking a calibration target as the beta-th time in the target image of the right camera shot at the tau-th time τ,3 Calibrating a target by an external parameter, and shooting the jth shot right camera target image for the jth time τ Number of individual calibration targets
Figure BDA0003015293220000061
Assigning to the beta th image in the target image of the right camera shot at the tau th time τ,3 Numbering of individual external parameter calibration targets
Figure BDA0003015293220000062
J of the t-th shot τ The right camera calibration matching group is used as the beta-th shot of the tau-th time τ,3 Calibrating the matching group by external parameters of the right camera, and then executing the step 10.5; otherwise, directly executing step 10.4;
step 10.4, judge j τ Whether or not less than beta τ,2 If j is τ <β τ,2 Then j will be τ +1 assignment to j τ Post loop execution of step 10.3 until j τ ≥β τ,2 (ii) a Otherwise, executing step 10.5;
step 10.5, judge i τ Whether or not less than beta τ,1 If i is τ <β τ,1 Then i will be τ +1 value to i τ The step 10.2 to the step 10.4 are executed in a post-loop until i τ ≥β τ,1
If i τ ≥β τ,1 Then, β is obtained in the left camera target image shot at the τ th time τ,3 External reference calibration target and beta τ,3 A matching group for calibrating external parameters of the left camera is obtained by sharing beta in the target image of the right camera shot at the Tth time τ,3 Individual external reference calibration target and beta τ,3 The external parameters of the right cameras are calibrated and matched with the right cameras;
step 11, if beta τ,3 ≥G 3 Defining an integer variable beta τ,4 And assign beta τ,4 0, taking an integer variable i τ And assign value i τ =1;
If beta is τ,3 <G 3 Then executing the coding stereo target regulation step until beta τ,3 ≥G 3
Step 12, according to the ith shot of the Tth time τ Matching group for calibrating external parameters of left camera and ith shooting τ The matching group is calibrated by external parameters of the right camera, and the ith camera target image shot at the Tth time is counted τ The ith parameter is marked on the target and the Tth shot right camera target image is marked on the ith parameter τ The number of the homonymous calibration angular points with the same unique coding serial number of the calibration angular points on the external reference calibration target
Figure BDA0003015293220000063
Step 13, if
Figure BDA0003015293220000064
Will beta τ,4 +1 value to β τ,4 A first step ofIth in left camera target image shot for tau times τ Taking the external reference calibration target as the beta-th image in the target image of the left camera shot at the tau-th time τ,4 The external parameters are optimized to the target, and the ith shot at the Tth time is τ The matching group for calibrating the external parameters of the left camera is taken as the beta-th shooting τ,4 The ith camera target image shot for the Tth time is subjected to the ith camera target image shooting by the left camera external parameter optimization matching group τ Taking the individual external reference calibration target as the beta-th image in the target image of the right camera shot at the tau-th time τ,4 Optimizing the target by the external parameters, and shooting the ith shot in the Tth time τ The matching group for calibrating external parameters of the right camera is used as the beta-th shot for the tau time τ,4 The external parameter optimization matching group of the right camera;
if it is
Figure BDA0003015293220000065
Then judge i τ Whether or not less than beta τ,3 If i is τ <β τ,3 Then i will be τ +1 value to i τ Then returns to the step 12 to be executed in sequence until
Figure BDA0003015293220000066
Step 14, if beta τ,4 ≥k 3 Then, beta in the target image of the left camera shot at the Tth time is obtained τ,4 Beta of Tth shooting of individual external parameter optimization target τ,4 Matching group for external parameter optimization of left camera and beta in target image of right camera shot at Tth time τ,4 Beta of Tth shooting of individual external parameter optimization target τ,4 The external parameter optimizing matching group of the right camera;
if beta is τ,4 <k 3 Then executing the coding stereo target regulation step until beta τ,4 ≥k 3
As a result of the above steps 8 to 14, the left camera target image taken at the τ th time contains β in common τ,1 A calibration target (containing beta) τ,3 Individual external reference calibration target, beta τ,3 The external reference calibration target also comprises beta τ,4 Individual parameter optimization target), the τ th beatIngested beta τ,1 A left camera calibration matching group (containing beta) τ,3 Matching set, beta, for calibrating external parameters of a left camera τ,3 The matching set for calibrating the external parameters of the left camera also comprises beta τ,4 The external parameter optimization matching group of the left camera); the right camera target image shot at the time of the Tth time contains beta in the right camera target image τ,2 A calibration target (wherein beta is contained) τ,3 External reference calibration target of right camera, beta τ,3 The external reference calibration target of the right camera also comprises beta τ,4 External parameter optimization target of right camera), beta shot at the tau th time τ,2 A right camera calibration matching group (containing beta) τ,3 Matching set, beta, for calibrating external parameters of right camera τ,3 The external parameter calibration matching group of the right camera also comprises beta τ,4 The external parameter optimization matching group of the right camera);
step 15, according to the acquired beta of the Tth shooting τ,1 The left camera calibration matching group calculates the internal parameters and distortion coefficients of the left and right cameras by using the monocular camera internal and external parameter calibration algorithm, and respectively converts the left camera coordinate system to the rotation matrix R of each numbered target coordinate system on the coding stereo target in the space l,1 、R l,2 、R l,3 、…
Figure BDA0003015293220000071
And translation vector T l,1 、T l,2 、T l,3 、…
Figure BDA0003015293220000072
Respectively transforming the coordinate system of the right camera to the rotation matrix R of each numbered target coordinate system on the coded three-dimensional target in the space r,1 、R r,2 、R r,3 、…
Figure BDA0003015293220000073
And translation vector T r,1 、T r,2 、T r,3 、…
Figure BDA0003015293220000074
Step 16, rotating the matrix R l,1 、R l,2 、R l,3 、…
Figure BDA0003015293220000075
And translation vector T l,1 、T l,2 、T l,3 、…
Figure BDA0003015293220000076
In the method, a rotation matrix R of a left camera coordinate system transformed to each numbered target coordinate system of an external reference calibration target is searched l,1 、R′ l,2 、R′ l,3 、…
Figure BDA0003015293220000077
And translation vector T' l,1 、T′ l,2 、T′ l,3 、…
Figure BDA0003015293220000078
In the rotation matrix R r,1 、R r,2 、R r,3 、…
Figure BDA0003015293220000079
And translation vector T r,1 、T r,2 、T r,3 、…
Figure BDA00030152932200000710
In the method, a rotation matrix R 'of which the coordinate system of the right camera is respectively converted to the target coordinate systems of the numbers of the external reference calibration targets is searched' r,1 、R′ r,2 、…
Figure BDA00030152932200000711
And translation vector T' r,1 、T′ r,2 、…
Figure BDA00030152932200000712
Step 17, utilizing the rotation matrix
Figure BDA00030152932200000713
And translation vector
Figure BDA00030152932200000714
And a rotation matrix
Figure BDA00030152932200000715
And translation vector
Figure BDA00030152932200000716
Solving the rotation and translation relation between the left camera coordinate system and the right camera coordinate system according to the equations (1) and (2):
Figure BDA00030152932200000717
Figure BDA00030152932200000718
wherein i τ =1,2...,β τ,3
Judgment of i τ Whether or not less than beta τ,3 If i is τ <β τ,3 Then i will τ +1 to i τ Then returning to step 17 for sequential execution until i τ ≥β τ,3
Step 18, 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 BDA0003015293220000081
wherein i τ =1,2...,β τ,3
And step 19, calculating accurate values R 'and T' of external parameters of the binocular camera by using an optimization method based on standard length according to 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.
Meanwhile, there is also provided a computer-readable storage medium including a computer program for use in conjunction with an electronic device having an image processing function, the computer program being executable by a processor to perform the binocular camera calibration method of claim 1.
Compared with the prior art, the invention has the following beneficial effects:
(1) compared with the traditional three-dimensional target, the coding three-dimensional target provided by the invention is provided with the coding pattern, comprises the direction information of the coding three-dimensional target and the coding information of the calibration corner point, can accurately give the one-to-one corresponding relation among the sub-pixel coordinate of the calibration corner point, the unique coding serial number of the calibration corner point and the target coordinate of the calibration corner point during calibration, and ensures and improves the precision of the calibration result;
(2) compared with the traditional method for calibrating by utilizing the three-dimensional target, the method for quickly calibrating the internal and external parameters of the binocular camera based on the coding three-dimensional target can still complete calibration work even if a shot image only contains a local coding three-dimensional target on the premise of meeting the calibration condition, so that the calibration robustness of the binocular camera is improved;
(3) compared with the traditional binocular camera calibration method, the rapid calibration method of the internal and external parameters of the binocular camera based on the coded three-dimensional target can perform calibration work only by respectively shooting a target image meeting the calibration condition by the left camera and the right camera, so that the complexity of the calibration work of the two cameras is greatly simplified;
(4) the rapid calibration method of the binocular camera internal and external parameters based on the coded three-dimensional target can realize intelligent calibration, real-time calibration and on-line calibration;
(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.
Drawings
FIG. 1 is a pictorial view of a camera and associated equipment used in the embodiment;
FIG. 2 is a pictorial representation of the encoded solid target used;
FIG. 3 is a numbered display of each encoded planar target on an encoded volumetric target;
FIG. 4 is a schematic structural diagram of the No. 1 coded planar target on the coded stereo target;
FIG. 5 is a schematic structural diagram of the No. 2 coded planar target on the coded stereo target;
FIG. 6 is a schematic structural diagram of a No. 3 coded planar target on a coded stereo target;
FIG. 7 is a schematic structural diagram of the No. 4 coded planar target on the coded stereo target;
FIG. 8 is a schematic structural diagram of the No. 5 coded planar target on the coded stereo target;
FIG. 9 is a schematic structural diagram of the No. 6 coded planar target on the coded stereo target;
FIG. 10 is a schematic diagram showing the selection of the forward vector and the prescribed vector in the No. 1 coded planar target on the coded three-dimensional target;
FIG. 11 is a schematic diagram showing the selection of the forward vector and the prescribed vector in the No. 2 coded planar target on the coded three-dimensional target;
FIG. 12 is a schematic diagram showing the selection of the forward vector and the prescribed vector in the No. 3 coded planar target on the coded three-dimensional target;
FIG. 13 is a schematic diagram showing the selection of the forward vector and the prescribed vector in the No. 4 coded planar target on the coded three-dimensional target;
FIG. 14 is a schematic diagram showing the selection of the forward vector and the prescribed vector in the coding planar target No. 5 on the coding stereo target;
FIG. 15 is a schematic diagram showing the selection of the forward vector and the prescribed vector in the No. 6 coded planar target on the coded solid target;
FIG. 16 is a left camera target image from the left camera shooting the coded stereo target at shot 1;
FIG. 17 is a right camera target image of the coded stereoscopic target captured by the right camera at the 1 st capture;
FIG. 18 is a schematic view of the target coordinate system for each encoded planar target established in the encoded volumetric target at the 1 st mobile position in space;
FIG. 19 is a left camera target image of the encoded stereo target taken by the left camera at shot 2;
FIG. 20 is a right camera target image of the encoded stereo target taken by the right camera at shot 2;
FIG. 21 is a schematic view of the target coordinate system for each encoded planar target established in the encoded volumetric target at the 2 nd mobile position in space;
FIG. 22 is a left camera target image of the encoded stereo target taken by the left camera at shot 3;
FIG. 23 is a right camera target image of the encoded stereo target taken by the right camera at the 3 rd shot;
FIG. 24 is a schematic diagram of the establishment of the target coordinate system for each encoded planar target in the encoded volumetric target at the 3 rd shift position in space;
FIG. 25 shows sub-pixel coordinates of all calibration corner points on each coding plane target shot at the 3 rd time in a target image calibration corner point pixel coordinate system o-xy;
FIG. 26 is a three-dimensional image p encoded without complex background according to this embodiment 1 ′;
FIG. 27 is a block diagram of a three-dimensional image p encoded without a complex background according to this embodiment 2 ′;
FIG. 28 is a three-dimensional image p encoded without complex background according to this embodiment 3 ′;
FIG. 29 is a schematic diagram of the three-dimensional image p encoded without complex background according to the embodiment 4 ′;
FIG. 30 is a schematic diagram of a three-dimensional image p encoded without a complex background according to this embodiment 5 ′;
FIG. 31 is a block diagram illustrating a three-dimensional image p encoded without a complex background according to the present embodiment 6 ′;
FIG. 32 is a binarized image P without complex background target in this embodiment 2 The image P obtained by the processing 2 ′;
FIG. 33 is a binarized erosion image P of the target in the present embodiment 2 ' decoded binary image P obtained by processing 3
FIG. 34 is a diagram of the 1 st unit binarized image E without complex background obtained in this embodiment 1
Fig. 35 is a flowchart of a method for rapidly calibrating internal and external parameters of a binocular camera based on a coded stereo target.
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.
Referring to fig. 1 and 2, a method for rapidly calibrating internal and external parameters of a binocular camera based on a coded stereo target includes using two cameras placed in a space to shoot the coded stereo target in the space to obtain a set of target images (including a left camera target image and a right camera target image), and respectively judging whether the left camera target image and the right camera target image meet calibration requirements, if one of the target images does not meet the calibration conditions, re-shooting and judging after adjusting the spatial relative position of the camera and the coded stereo target, if both the left camera target image and the right camera target image meet the calibration conditions, using the former as a left camera calibration image and the latter as a right camera calibration image; and finally, calculating internal and external parameters of the camera by using a calibration algorithm.
Two cameras and a coding three-dimensional target are placed in the space, wherein the absolute positions and the relative positions of the two cameras are fixed, and the spatial positions and the postures of the coding three-dimensional target can be adjusted. The two cameras used in the embodiment are color industrial cameras of MER-231-41U3C model, the highest frame rate of the camera acquisition is 40 frames, the pixel size is multiplied by 5.86 micrometers, and the image resolution is 1920 multiplied by 1200; the camera lens adopts the model number HN-1216-5M-C2/3X, and the focal length of the lens is 12 mm, as shown in figure 1. A physical map of the coded solid target used in the example is shown in fig. 2.
The coding stereo target consists of a reference plate and a plurality of coding plane targets connected with the reference plate. The reference plate for encoding the stereo target is divided into S (wherein S is an integer and S > 3) areas, wherein each area is placed with one encoding plane target. In this embodiment, the reference plate of the coding stereo target is divided into 6 regions, and each region is provided with one coding plane target. All the coding plane targets on the coding stereo target have numbers, and the numbers of each coding plane target are different from each other, as shown in fig. 3. The spatial postures of any two coding plane targets positioned on the coding stereo target have obvious difference.
Each coding plane target adopted in the embodiment is composed 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 angles as the calibration angular points of the coding plane target, and the coding plane target totally comprises 5 lines multiplied by 5 columns of calibration angular points; 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 (white solid circle), an orientation pattern (white circular ring) and a coding mark pattern, and the coding mark pattern is composed of a plurality of coding unit patterns (a plurality of white small solid circles); 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 patterns are used for coding each calibration corner point in the coding plane target, and the number and the distribution of the coding unit patterns are determined by the serial number of the parallelogram coding unit where the coding unit patterns are located.
In the embodiment, all the parallelogram coding units and parallelogram non-coding units of each coding plane target are parallelograms with the length of 13.5mm and the width of 13.5mm, and the parallelogram coding units are rectangles, namely, adjacent side included angles λ are 90 °.
In the coding three-dimensional target, the coding numbers of all parallelogram coding units on all coding plane targets are different from each other; and the coding numbers of all the parallelogram coding units on the same coding plane target have continuity; in this embodiment, the number ranges of all parallelogram coding units on the coding plane target No. 1 on the coding stereo target are 80-97, the number ranges of all parallelogram coding units on the coding plane target No. 2 are 98-115, the number ranges of all parallelogram coding units on the coding plane target No. 3 are 20-37, the number ranges of all parallelogram coding units on the coding plane target No. 4 are 57-74, the number ranges of all parallelogram coding units on the coding plane target No. 5 are 0-17, and the number ranges of all parallelogram coding units on the coding plane target No. 6 are 39-56; the schematic structural diagrams of the coding plane target No. 1, the coding plane target No. 2, the coding plane target No. 3, the coding plane target No. 4, the coding plane target No. 5 and the coding plane target No. 6 are shown in FIGS. 4 to 9;
taking the coding plane target No. 1 as an example, arbitrarily taking one parallelogram coding unit in the coding plane target No. 1 as a coding plane target vector determination coding unit No. 1
Figure BDA0003015293220000111
Coding unit for determining No. 1 coding plane target vector
Figure BDA0003015293220000112
One vertex of (2) is marked as a first vertex of the vector determination coding unit
Figure BDA0003015293220000113
Determining coding unit in No. 1 coding plane target vector
Figure BDA0003015293220000114
Wherein the intersection is formed into a vector to determine the first vertex of the coding unit
Figure BDA0003015293220000115
Any one edge of the vector is taken as a vector to determine a first edge of the coding unit
Figure BDA0003015293220000116
Determining a coding unit first side in a vector
Figure BDA0003015293220000117
Upward orientation amount determination encoding unit
Figure BDA0003015293220000118
Is recorded as a first point on a first side of the vector determination coding unit
Figure BDA0003015293220000121
Wherein the vector determines a first point on a first side of the coding unit
Figure BDA0003015293220000122
Determining a first vertex of a coding unit by using the vector
Figure BDA0003015293220000123
Are 2 points which are not coincident with each other, and the vector is recorded
Figure BDA0003015293220000124
Prescribed vector for coding plane target No. 1
Figure BDA0003015293220000125
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 prescribed vector of the No. 1 coding plane target
Figure BDA0003015293220000126
Are in the same direction; prescribed vector of No. 1 coded planar target
Figure BDA0003015293220000127
As shown in fig. 10.
Marking the plane where the No. 1 coding plane target is as the No. 1 target plane
Figure BDA0003015293220000128
Determining a first vertex of a coding unit by a vector
Figure BDA0003015293220000129
Making a specified vector of the No. 1 coding plane target as a starting point
Figure BDA00030152932200001210
The unit vectors in the same direction are marked as the 1 st specified unit vector of the No. 1 coding plane target
Figure BDA00030152932200001211
When the person looks at the coding plane target, the first vertex of the coding unit is determined by the vector
Figure BDA00030152932200001212
Is a rotation center and is arranged in a No. 1 target plane P t (1) 1 st prescribed unit vector of internal coded plane target No. 1
Figure BDA00030152932200001213
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 BDA00030152932200001214
Determining a first vertex of a coding unit in space as a vector
Figure BDA00030152932200001215
As a starting point, an
Figure BDA00030152932200001216
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 BDA00030152932200001217
Determining a coding unit from the No. 1 coding plane target vector
Figure BDA00030152932200001218
Upper distance No. 1 coding plane target vector determination coding unit
Figure BDA00030152932200001219
The two nearest vertexes of the directional pattern in (1) are respectively marked as the 1 st temporary vertexes
Figure BDA00030152932200001220
And 2 nd temporary vertex
Figure BDA00030152932200001221
If vector
Figure BDA00030152932200001222
Specified vector of cross-product No. 1 coding plane target
Figure BDA00030152932200001223
The direction of the obtained vector and the positive vector of the specified vector of the No. 1 coding plane target
Figure BDA00030152932200001224
Are in the same direction, then vector is set
Figure BDA00030152932200001225
Auxiliary vector marked as No. 1 coding plane target
Figure BDA00030152932200001226
If vector
Figure BDA00030152932200001227
Specified vector of cross-product No. 1 coding plane target
Figure BDA00030152932200001228
The direction of the obtained vector and the positive vector of the No. 1 coding plane target
Figure BDA00030152932200001229
If the directions of the vectors are different, the vectors are calculated
Figure BDA00030152932200001230
Auxiliary vector marked as No. 1 coding plane target
Figure BDA00030152932200001231
Auxiliary vector of No. 1 coding plane target
Figure BDA00030152932200001232
And the forward vector of the No. 1 coded plane target
Figure BDA00030152932200001233
The selection is shown in fig. 10.
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. 11 to fig. 15.
Referring to fig. 35, the calibration method of the binocular camera based on the coded stereo target is as follows:
step 1, defining a left camera calibration target number threshold G 1 The right camera marks a target number threshold G which is 5 ═ 5 2 Calibrating the threshold value k of the number of angular points as 5 1 15, code plane target number threshold k 2 The external parameter is marked with a target number threshold G of 5 3 3, the common calibration angular point number threshold k 3 3, externally parameter optimizing target number threshold G 4 ==1;
Step 2, recording images obtained by simultaneously shooting a coding three-dimensional target in a primary space by a left camera and a right camera as a left camera target image and a right camera target image respectively, and establishing a left camera target image calibration corner point pixel coordinate system o l -x l y l Calibrating a corner pixel coordinate system o with a right camera target image r -x r y r
Specifically, the upper left corner of a target image shot by a left camera is used as the origin o of coordinates of a pixel coordinate system of a calibration corner point of the target image of the left camera l Calibrating x of corner point pixel coordinate system for left camera target image from left to right l Y in axis direction and from top to bottom as calibration corner pixel coordinate system of left camera target image l Axial direction, thereby establishing a calibration corner point of a target image of the left cameraPixel coordinate system o l -x l y l
Similarly, the upper left corner of the target image shot by the right camera is used as the origin o of coordinates of the pixel coordinate system of the calibration corner point of the target image of the right camera r Calibrating x of corner point pixel coordinate system for right camera target image from left to right r Y as the calibration corner point pixel coordinate system of the right camera target image from top to bottom in the axial direction r The axis direction, thereby establishing a pixel coordinate system o of the calibration corner point of the target image of the right camera r -x r y r
And 3, establishing a camera coordinate system of the left camera and a camera coordinate system of the right camera, and establishing the camera coordinate systems according to the self positions of the left camera and the right camera. An integer variable τ is defined and assigned τ to 1.
And 4, simultaneously shooting the coded three-dimensional target placed in the primary space by using two cameras with fixed relative positions and absolute positions in the space and a public view field, and respectively obtaining a target image of the left camera shot at the tau th time and a target image of the right camera shot at the tau th time.
Shooting for the 1 st time:
simultaneously shooting a coded three-dimensional target placed in a primary space by using two cameras with fixed relative positions and absolute positions in the space and a common view field, and respectively obtaining a left camera target image shot at the 1 st time (as shown in figure 16) and a right camera target image shot at the 1 st time (as shown in figure 17);
step 5, defining an integer variable alpha τ And assigns a value of alpha τ =1;
Alpha in coded stereo target at 1 st movement position in memory space 1 The number of calibration corner points in 4 vertexes of the 1 st line and 1 st parallelogram coding unit on the number coding plane target is phi 1,p (ii) a Judgment of alpha 1 Whether or not less than 6, if α 1 If < 6, then alpha will be 1 +1 to α 1 And then returning to the step 5 for sequential execution.
In this embodiment, the target coordinate system of 6 coded planar targets at the 1 st movement position is established as shown in fig. 18.
Step 6, taking the 1 st shot left/right camera target image as an input condition, and obtaining the number of the coding plane targets in the 1 st shot left/right camera target image by using a decoding method of the coding stereo target
Figure BDA0003015293220000131
The number of each coding plane target in the left/right camera target image shot at the 1 st time, the number of calibration angle points extracted from each coding plane target in the left/right camera target image shot at the 1 st time and the pixel coordinate system o of each calibration angle point in the left/right camera target image l -x l y l /o r -x r y r The sub-pixel coordinates, the unique code serial number of the calibration corner point extracted from each code plane target in the 1 st shot left/right camera target image, and the calibration corner point extracted from each code plane target in the 1 st shot left/right camera target image in the calibration corner point pixel coordinate system o of the left/right camera target image l -x l y l o l -x l y l /o r -x r y r And matching relation between the sub-pixel coordinates and target coordinates of calibration corner points which correspond to one of the sub-pixel coordinates and have the same unique coding serial number on the spatial coding three-dimensional target in a corresponding target coordinate system.
In a specific embodiment, the number of the coded planar targets in the left camera target image of the 1 st shot
Figure BDA0003015293220000141
The left camera target image shot at the 1 st time comprises a No. 1 coding plane target, a No. 2 coding plane target, a No. 3 coding plane target, a No. 4 coding plane target, a No. 5 coding plane target and a No. 6 coding plane target; number of coded plane targets in right camera target image shot at 1 st time
Figure BDA0003015293220000142
Right camera target image shot at 1 st timeThe system comprises a No. 2 coding plane target, a No. 3 coding plane target, a No. 5 coding plane target and a No. 6 coding plane target.
Step 7, in the embodiment, the number of the coding plane targets in the left and right camera target images shot at the 1 st time is respectively
Figure BDA0003015293220000143
And k is 2 When equal to 5, i.e.
Figure BDA0003015293220000144
Or
Figure BDA0003015293220000145
Executing the encoding stereo target adjusting step until
Figure BDA0003015293220000146
And is
Figure BDA0003015293220000147
Adjusting the coding stereo target: and (4) adjusting the space pose of the reference plate of the coding stereo target to ensure that the visual field of the left camera, the visual field of the right camera and the common visual field of the left camera and the right camera comprise more coding plane targets and calibration angular points, assigning tau +1 to tau, and then returning to the step 4 to execute the sequence.
Shooting for the 2 nd time:
step 4, two cameras with fixed relative positions and absolute positions in space and a common view field are used for simultaneously shooting a coded three-dimensional target placed in a primary space, and a left camera target image shot at the 2 nd time (as shown in fig. 19) and a right camera target image shot at the 2 nd time (as shown in fig. 20) are respectively obtained;
the process of establishing the target coordinate system of each encoding plane target in step 5 may refer to the establishment process in the 1 st shooting, and the coordinate system establishment result is shown in fig. 21;
step 6, using the 2 nd shot left/right camera target image as an input condition, and obtaining the 2 nd shot left camera target image by using a decoding method of a coded three-dimensional targetNumber of medium-coded planar targets
Figure BDA0003015293220000148
The left camera target image shot at the 2 nd time comprises a No. 1 coding plane target, a No. 2 coding plane target, a No. 3 coding plane target, a No. 4 coding plane target, a No. 5 coding plane target and a No. 6 coding plane target; number of coded plane targets in right camera target image shot at 2 nd time
Figure BDA0003015293220000149
The right camera target image shot at the 2 nd time comprises a No. 1 coding plane target, a No. 2 coding plane target, a No. 3 coding plane target, a No. 4 coding plane target, a No. 5 coding plane target and a No. 6 coding plane target.
In the embodiment, the number of the coded plane targets in the left and right camera target images shot at the 2 nd time is respectively
Figure BDA0003015293220000151
And k is 2 When equal to 5, i.e.
Figure BDA0003015293220000152
And is
Figure BDA0003015293220000153
The subsequent step 7 is continued.
Step 7, the 2 nd shot left camera target image obtained in the step 6 is added
Figure BDA0003015293220000154
The numbers of the coding plane targets are arranged from small to big and respectively marked as
Figure BDA0003015293220000155
Namely, it is
Figure BDA0003015293220000156
Figure BDA0003015293220000157
Respectively recording the coding plane targets numbered as 1,2,3, … and 6 in the left camera target image shot at the 2 nd time as the 1 st coding plane target, the 2 nd coding plane target, the 3 rd coding plane target, … and the 6 th coding plane target in the left camera target image shot at the 2 nd time;
arranging the numbers of the 6 coding plane targets on the right camera target image shot at the 2 nd time obtained in the step 6 from small to large, and respectively recording the numbers as
Figure BDA0003015293220000158
Namely that
Figure BDA0003015293220000159
Figure BDA00030152932200001510
Respectively recording the coding plane targets numbered as 1,2,3, … and 6 in the right camera target image shot at the 2 nd time as the 1 st coding plane target, the 2 nd coding plane target, the 3 rd coding plane target, … and the 6 th coding plane target in the right camera target image shot at the 2 nd time;
step 8, counting the number beta of the coding planes meeting the calibration corner point threshold in the left camera target image and the right camera target image 2,1 And beta 2,2 . In this embodiment, an integer variable i is defined 2 、β 2,1 、β 2,2 And assign value i 2 =1、β 2,1 =0、β 2,2 =0;
Through the steps 8.2 to 8.6, it can be obtained that the number beta of the coding plane targets meeting the calibration corner number threshold value in the target image of the left camera shot at the 2 nd time 2,1 6, the number beta of the coding plane targets meeting the calibration corner number threshold value in the right camera target image shot at the 2 nd time 2,2 ==4;
Step 9, in this embodiment, the number of the coding plane targets meeting the calibration corner number threshold in the left and right camera target images shot at the 2 nd time is β respectively 2,1 ==6、β 2,2 4, is beta τ,1 <G 1 Or beta τ,2 <G 2 In the case of (3), the step of adjusting the coded three-dimensional target needs to be executed, that is, the reference plate of the coded three-dimensional target is adjusted, so that the field of view of the left camera, the field of view of the right camera and the common field of view of the left camera and the right camera contain more coded planar targets and calibration angular points, and τ +1 is assigned to τ and then the step 4 is returned to for execution sequentially.
Shooting for the 3 rd time:
step 4, shooting the coded stereo target placed in the space once by using two cameras with fixed relative positions and absolute positions in the space and a common view field, and respectively obtaining a left camera target image shot at the 3 rd time (as shown in fig. 22) and a right camera target image shot at the 3 rd time (as shown in fig. 23);
the process of establishing the target coordinate system of each encoding plane target in step 5 can refer to the establishment process in the 1 st shooting, and the coordinate system establishment result is shown in fig. 24.
Step 6, taking the 3 rd shot left/right camera target image as an input condition, and obtaining the number of the coding plane targets in the 3 rd shot left camera target image by using a decoding method of the coding three-dimensional target
Figure BDA00030152932200001511
The left camera target image shot at the 3 rd time comprises a No. 1 coding plane target, a No. 2 coding plane target, a No. 3 coding plane target, a No. 4 coding plane target, a No. 5 coding plane target and a No. 6 coding plane target; number of coded plane targets in right camera target image shot at 3 rd time
Figure BDA0003015293220000161
The right camera target image shot at the 3 rd time comprises a No. 1 coded plane target, a No. 2 coded plane target, a No. 3 coded plane target, a No. 4 coded plane target, a No. 5 coded plane target and a No. 6 coded plane target;
in the embodiment, the number of the coded plane targets in the left and right camera target images shot at the 3 rd time is respectively
Figure BDA0003015293220000162
And k is 2 Is equal to 5, i.e.
Figure BDA0003015293220000163
And is
Figure BDA0003015293220000164
The subsequent step 7 is continued.
7, the 3 rd shot left camera target image obtained in the step 6 is added
Figure BDA0003015293220000165
The numbers of the coding plane targets are arranged from small to big and respectively marked as
Figure BDA0003015293220000166
Namely, it is
Figure BDA0003015293220000167
Figure BDA0003015293220000168
Respectively recording the coding plane targets numbered as 1,2,3, … and 6 in the left camera target image shot at the 3 rd time as the 1 st coding plane target, the 2 nd coding plane target, the 3 rd coding plane target, … and the 6 th coding plane target in the left camera target image shot at the 3 rd time;
arranging the numbers of the 6 coding plane targets on the right camera target image shot at the 3 rd time obtained in the step 5.2 from small to big, and respectively recording the numbers as
Figure BDA0003015293220000169
Namely, it is
Figure BDA00030152932200001610
Figure BDA00030152932200001611
And will be firstThe coding plane targets numbered 1,2,3, … and 6 in the right camera target image shot at 3 times are respectively marked as the 1 st coding plane target, the 2 nd coding plane target, the 3 rd coding plane target, … and the 6 th coding plane target in the right camera target image shot at 3 times;
step 8, counting the number beta of the coding planes meeting the calibration corner threshold in the left camera target image and the right camera target image 3,1 And beta 3,2 . Defining an integer variable i 3 、β 3,1 、β 3,2 And assign value i 3 =1、β 3,1 =0、β 3,2 =0;
Through steps 8.2 to 8.6, the number beta of the coding plane targets meeting the calibration corner number threshold in the 3 rd shot left camera target image can be obtained 3,1 6, the number beta of the coding plane targets meeting the calibration corner number threshold value in the right camera target image shot at the 3 rd time 3,2 ==6。
Step 9, in this embodiment, the number β of the coding plane targets meeting the calibration corner number threshold in the left camera target image shot at the 3 rd time 3,1 6, the number beta of the coding plane targets meeting the calibration corner number threshold value in the right camera target image shot at the 3 rd time 3,2 6; is in accordance with beta τ,1 ≥G 1 And beta is τ,2 ≥G 2 In the case of (1), β is obtained on the left camera target image taken at the 3 rd time 3,1 A calibration target satisfying the calibration condition and beta 3,1 A left camera calibration matching group obtains beta on the target image of the right camera shot at the 3 rd time 3,2 A calibration target satisfying the calibration condition and beta 3,2 The right cameras calibrate the matched set and step 10 is performed.
The 1 st left camera calibration matching group is shown in table 1.1 below:
TABLE 1.1
Serial number Calibrating sub-pixel coordinates of angular point Calibrating unique coding serial number of angular point Calibrating corner point target coordinates
1 (600.055,790.594) 92_6 (0,54,0)
2 (597.766,849.439) 89_1 (0,40.5,0)
3 (595.367,909.194) 86_6 (0,27,0)
4 (593.144,969.974) 83_1 (0,13.5,0)
5 (591.037,1031.91) 80_6 (0,0,0)
6 (655.637,799.361) 92_1 (13.5,54,0)
7 (653.902,857.566) 90_6 (13.5,40.5,0)
8 (652.166,916.599) 86_1 (13.5,27,0)
9 (650.404,976.619) 84_6 (13.5,13.5,0)
10 (648.95,1037.85) 80_1 (13.5,0,0)
11 (710.338,807.922) 93_6 (27,54,0)
12 (709.128,865.397) 90_1 (27,40.5,0)
13 (707.939,923.744) 87_6 (27,27,0)
14 (706.832,983.152) 84_1 (27,13.5,0)
15 (705.719,1043.56) 81_6 (27,0,0)
16 (763.61,816.135) 93_1 (40.5,54,0)
17 (762.907,872.901) 91_6 (40.5,40.5,0)
18 (762.284,930.68) 87_1 (40.5,27,0)
19 (761.547,989.268) 85_6 (40.5,13.5,0)
20 (761.098,1048.9) 81_1 (40.5,0,0)
21 (815.497,824.026) 94_6 (54,54,0)
22 (815.368,880.19) 91_1 (54,40.5,0)
23 (815.147,937.171) 88_6 (54,27,0)
24 (814.992,995.126) 85_1 (54,13.5,0)
25 (814.905,1054.01) 82_6 (54,0,0)
The 2 nd left camera calibration matching set is shown in table 1.2 below:
TABLE 1.2
Figure BDA0003015293220000171
Figure BDA0003015293220000181
The 3 rd left camera calibration matching group is shown in the following table 1.3:
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 (1712.53,813.943) 34_6 (54,54,0)
2 (1657.76,814.728) 33_1 (40.5,54,0)
3 (1602.79,815.633) 33_6 (27,54,0)
4 (1548.12,816.296) 32_1 (13.5,54,0)
5 (1493.12,817.017) 32_6 (0,54,0)
6 (1712.69,868.134) 31_1 (54,40.5,0)
7 (1658.04,868.848) 31_6 (40.5,40.5,0)
8 (1603.09,869.784) 30_1 (27,40.5,0)
9 (1548.25,870.262) 30_6 (13.5,40.5,0)
10 (1494.03,870.857) 29_1 (0,40.5,0)
11 (1712.83,922.045) 28_6 (54,27,0)
12 (1658.15,922.523) 27_1 (40.5,27,0)
13 (1603.53,923.012) 27_6 (27,27,0)
14 (1548.74,923.896) 26_1 (13.5,27,0)
15 (1494.21,924.168) 26_6 (0,27,0)
16 (1712.62,975.416) 25_1 (54,13.5,0)
17 (1658.13,976.105) 25_6 (40.5,13.5,0)
18 (1603.65,976.416) 24_1 (27,13.5,0)
19 (1549,976.86) 24_6 (13.5,13.5,0)
20 (1494.61,977.111) 23_1 (0,13.5,0)
21 (1712.46,1028.81) 22_6 (54,0,0)
22 (1658.07,1029.1) 21_1 (40.5,0,0)
23 (1603.6,1029.57) 21_6 (27,0,0)
24 (1549.06,1029.91) 20_1 (13.5,0,0)
25 (1494.88,1030.09) 20_6 (0,0,0)
The 4 th left camera calibration matching set is shown in table 1.4 below:
TABLE 1.4
Serial number Calibrating sub-pixel coordinates of angular point Calibrating unique coding serial number of angular point Calibrating corner point target coordinates
1 (575.58,127.115) 69_6 (0,54,0)
2 (573.842,191.337) 66_1 (0,40.5,0)
3 (572.391,255.417) 63_6 (0,27,0)
4 (570.897,319.163) 60_1 (0,13.5,0)
5 (569.394,382.966) 57_6 (0,0,0)
6 (639.064,129.834) 69_1 (13.5,54,0)
7 (637.3,193.751) 67_6 (13.5,40.5,0)
8 (635.612,257.237) 63_1 (13.5,27,0)
9 (634.028,320.862) 61_6 (13.5,13.5,0)
10 (632.572,384.111) 57_1 (13.5,0,0)
11 (702.037,132.841) 70_6 (27,54,0)
12 (700.188,196.336) 67_1 (27,40.5,0)
13 (698.367,259.464) 64_6 (27,27,0)
14 (696.594,322.496) 61_1 (27,13.5,0)
15 (694.844,385.293) 58_1 (27,0,0)
16 (763.885,135.836) 70_1 (40.5,54,0)
17 (761.97,198.954) 68_6 (40.5,40.5,0)
18 (759.975,261.608) 64_1 (40.5,27,0)
19 (758.132,324.158) 62_6 (40.5,13.5,0)
20 (756.24,386.754) 58_1 (40.5,0,0)
21 (824.884,139.113) 71_6 (54,54,0)
22 (822.859,201.667) 68_1 (54,40.5,0)
23 (820.886,263.875) 65_6 (54,27,0)
24 (818.869,325.908) 62_1 (54,13.5,0)
25 (816.792,388.028) 59_6 (54,0,0)
The 5 th left camera calibration matching set is shown in table 1.5 below:
TABLE 1.5
Figure BDA0003015293220000191
Figure BDA0003015293220000201
The 6 th left camera calibration matching group is shown in the following table 1.6;
TABLE 1.6
Serial number Calibrating sub-pixel coordinates of angular point Calibrating unique coding serial number of angular point Calibrating angular point target coordinates
1 (1546.45,234.069) 51_6 (0,54,0)
2 (1555.38,282.267) 48_1 (0,40.5,0)
3 (1564.76,331.272) 45_6 (0,27,0)
4 (1573.77,381.441) 42_1 (0,13.5,0)
5 (1583.32,433.21) 39_6 (0,0,0)
6 (1594.95,239.307) 51_1 (13.5,54,0)
7 (1604.45,287.041) 49_6 (13.5,40.5,0)
8 (1613.85,335.773) 45_1 (13.5,27,0)
9 (1623.51,385.518) 43_6 (13.5,13.5,0)
10 (1633.33,436.856) 39_1 (13.5,0,0)
11 (1642.52,244.57) 52_6 (27,54,0)
12 (1652.4,291.922) 49_1 (27,40.5,0)
13 (1662.36,340.486) 46_6 (27,27,0)
14 (1672.32,389.616) 43_1 (27,13.5,0)
15 (1682.54,440.651) 40_6 (27,0,0)
16 (1689.04,249.519) 52_1 (40.5,54,0)
17 (1699.2,296.632) 50_6 (40.5,40.5,0)
18 (1709.47,344.634) 46_1 (40.5,27,0)
19 (1719.69,393.688) 44_6 (40.5,13.5,0)
20 (1730.34,444.325) 40_1 (40.5,0,0)
21 (1734.78,254.61) 53_6 (54,54,0)
22 (1745.37,301.452) 50_1 (54,40.5,0)
23 (1755.94,349.054) 47_6 (54,27,0)
24 (1766.6,397.65) 44_1 (54,13.5,0)
25 (1777.32,447.743) 41_6 (54,0,0)
The 1 st right camera calibration matching group is shown in table 2.1 below:
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 (264.728,781.126) 92_6 (0,54,0)
2 (254.735,839.98) 89_1 (0,40.5,0)
3 (244.416,899.822) 86_6 (0,27,0)
4 (234.321,960.634) 83_1 (0,13.5,0)
5 (224.225,1022.38) 80_6 (0,0,0)
6 (325.337,790.84) 92_1 (13.5,54,0)
7 (315.899,849.425) 90_6 (13.5,40.5,0)
8 (306.378,908.929) 86_1 (13.5,27,0)
9 (296.674,969.525) 84_6 (13.5,13.5,0)
10 (287.347,1031.09) 80_1 (13.5,0,0)
11 (385.863,800.215) 93_6 (27,54,0)
12 (377.005,858.855) 90_1 (27,40.5,0)
13 (368.087,918.002) 81_6 (27,27,0)
14 (359.198,978.358) 84_1 (27,13.5,0)
15 (350.221,1039.72) 81_6 (27,0,0)
16 (445.756,809.461) 93_1 (40.5,54,0)
17 (437.652,867.832) 91_6 (40.5,40.5,0)
18 (429.222,926.941) 81_1 (40.5,27,0)
19 (420.881,986.838) 85_6 (40.5,13.5,0)
20 (412.799,1047.93) 81_1 (40.5,0,0)
21 (505.266,818.66) 94_6 (54,54,0)
22 (497.472,876.826) 91_1 (54,40.5,0)
23 (489.854,935.513) 88_6 (54,27,0)
24 (482.111,995.256) 85_1 (54,13.5,0)
25 (474.328,1056.04) 82_6 (54,0,0)
The 2 nd right camera calibration matching group is shown in the following table 2.2:
TABLE 2.2
Figure BDA0003015293220000211
Figure BDA0003015293220000221
The 3 rd right camera calibration matching group 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 (1288.92,824.6) 32_6 (0,54,0)
2 (1291.46,885.744) 29_1 (0,40.5,0)
3 (1293.86,946.104) 26_6 (0,27,0)
4 (1296.02,1006.02) 23_1 (0,13.5,0)
5 (1298.1,1065.76) 20_6 (0,0,0)
6 (1348.73,824.929) 32_1 (13.5,54,0)
7 (1351,886.452) 30_6 (13.5,40.5,0)
8 (1353.18,947.637) 26_1 (13.5,27,0)
9 (1355.25,1008.15) 24_6 (13.5,13.5,0)
10 (1357.06,1068.37) 20_1 (13.5,0,0)
11 (1409.97,825.075) 33_6 (27,54,0)
12 (1412.05,887.522) 30_1 (27,40.5,0)
13 (1414.09,949.028) 27_6 (27,27,0)
14 (1415.91,1010.28) 24_1 (27,13.5,0)
15 (1417.34,1071.18) 21_6 (27,0,0)
16 (1471.75,825.312) 33_1 (40.5,54,0)
17 (1473.6,888.175) 31_6 (40.5,40.5,0)
18 (1475.48,950.389) 27_1 (40.5,27,0)
19 (1477.05,1012.21) 25_6 (40.5,13.5,0)
20 (1478.26,1073.91) 21_1 (40.5,0,0)
21 (1534.34,825.381) 34_6 (54,54,0)
22 (1536.2,888.94) 31_1 (54,40.5,0)
23 (1538.15,952.083) 28_6 (54,27,0)
24 (1539.71,1014.24) 25_1 (54,13.5,0)
25 (1540.58,1076.41) 22_6 (54,0,0)
The 4 th right camera calibration matching group 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 (441.018,111.57) 71_6 (54,54,0)
2 (377.533,113.12) 70_1 (40.5,54,0)
3 (314.425,114.952) 70_6 (27,54,0)
4 (251.025,116.856) 69_1 (13.5,54,0)
5 (188.539,118.828) 69_6 (0,54,0)
6 (442.674,176.429) 68_1 (54,40.5,0)
7 (379.096,177.963) 68_6 (40.5,40.5,0)
8 (316.044,179.577) 67_1 (27,40.5,0)
9 (252.975,181.29) 67_6 (13.5,40.5,0)
10 (190.625,183.05) 66_1 (0,40.5,0)
11 (444.099,240.704) 65_6 (54,27,0)
12 (380.873,242.159) 64_1 (40.5,27,0)
13 (317.886,243.731) 64_6 (27,27,0)
14 (254.998,245.306) 63_1 (13.5,27,0)
15 (192.759,247.032) 63_6 (0,27,0)
16 (445.659,304.785) 62_1 (54,13.5,0)
17 (382.784,306.324) 62_6 (40.5,13.5,0)
18 (319.905,307.759) 61_1 (27,13.5,0)
19 (257.082,309.283) 61_6 (13.5,13.5,0)
20 (194.976,310.884) 60_1 (0,13.5,0)
21 (447.233,368.884) 59_6 (54,0,0)
22 (384.663,370.246) 58_1 (40.5,0,0)
23 (321.97,371.538) 58_6 (27,0,0)
24 (259.441,372.908) 57_1 (13.5,0,0)
25 (197.48,374.591) 57_6 (0,0,0)
The 5 th right camera calibration matching group is shown in the following table 2.5:
TABLE 2.5
Figure BDA0003015293220000231
Figure BDA0003015293220000241
The 6 th right camera calibration matching group is shown in the following table 2.6:
TABLE 2.6
Serial number Calibrating sub-pixel coordinates of angular point Marking unique coding serial number of corner point Calibrating corner point target coordinates
1 (1322.22,158.441) 51_6 (0,54,0)
2 (1325.44,212.577) 48_1 (0,40.5,0)
3 (1328.35,267.896) 45_6 (0,27,0)
4 (1331.67,324.942) 42_1 (0,13.5,0)
5 (1334.61,384.077) 39_6 (0,0,0)
6 (1384.79,160.81) 51_1 (13.5,54,0)
7 (1388.68,214.911) 49_6 (13.5,40.5,0)
8 (1392.53,270.493) 45_1 (13.5,27,0)
9 (1396.43,327.121) 43_6 (13.5,13.5,0)
10 (1400.4,386.349) 39_1 (13.5,0,0)
11 (1447.13,163.506) 52_6 (27,54,0)
12 (1451.9,217.548) 49_1 (27,40.5,0)
13 (1456.39,272.873) 46_6 (27,27,0)
14 (1461.23,329.764) 43_1 (27,13.5,0)
15 (1465.92,388.672) 40_6 (27,0,0)
16 (1508.62,166.495) 52_1 (40.5,54,0)
17 (1514.08,220.386) 50_6 (40.5,40.5,0)
18 (1519.65,275.448) 46_1 (40.5,27,0)
19 (1524.83,332.261) 44_6 (40.5,13.5,0)
20 (1530.3,390.853) 40_1 (40.5,0,0)
21 (1569.86,169.088) 53_6 (54,54,0)
22 (1576.08,223) 50_1 (54,40.5,0)
23 (1582.22,278.257) 47_6 (54,27,0)
24 (1588.31,334.814) 44_1 (54,13.5,0)
25 (1594.41,393.083) 41_6 (54,0,0)
Step 10, searching the number beta of the coding flat plane targets with the same target labels in the left camera calibration target set and the right camera calibration target set 3,3
Step 10.1, let integer variable i 3 And assign value i 3 1; defining an integer variable j 3 Defining an integer variable beta 3,3 And assign a value of beta 3,3 =0;
Step 10.2, let integer variable j 3 And assign j 3 =1。
Step 10.3, judging the ith in the target image of the left camera shot at the 3 rd time 3 Number of individual calibration targets
Figure BDA0003015293220000251
Whether the number is equal to the jth number in the target image of the right camera shot at the 3 rd time 3 Number of individual calibration targets
Figure BDA0003015293220000252
If it is
Figure BDA0003015293220000253
Then beta will be 3,3 +1 value to β 3,3 The ith camera target image shot at the 3 rd time is compared with the target image shot at the 3 rd time 3 The calibrated target is taken as the beta-th image in the target image of the left camera shot at the 3 rd time 3,3 Calibrating the target with the external reference, and shooting the ith in the target image of the left camera shot at the 3 rd time 3 Number of individual calibration targets
Figure BDA0003015293220000254
Assigning to beta in the target image of the left camera shot at the 3 rd time 3,3 Numbering of individual external reference calibration targets
Figure BDA0003015293220000255
The ith shot of the 3 rd time 3 A left camera calibration matching group is used as the beta-th shot of the 3 rd time 3,3 The external parameters of the left camera are calibrated to form a matching group; the jth camera target image shot at the 3 rd time is subjected to the jth shooting 3 The calibration target is taken as the beta-th image in the right camera target image shot at the 3 rd time 3,3 The external parameters are used for calibrating the target, and the jth image in the right camera target image shot at the 3 rd time is used for 3 Number of individual calibration targets
Figure BDA0003015293220000256
Assigning to the beta-th image in the right camera target image shot at the 3 rd time 3,3 Numbering of individual external reference calibration targets
Figure BDA0003015293220000257
(wherein
Figure BDA0003015293220000258
) The 3 rd shotj 3 The right camera calibration matching group is used as the beta-th shooting of the 3 rd time 3,3 Calibrating the matching group by external parameters of the right camera, and then executing the step 10.5; otherwise, directly executing step 10.4;
step 10.4, judge j 3 Whether or not less than beta 3,2 If j is 3 <β 3,2 Then j will be 3 +1 assignment to j 3 Step 10.3 is executed in a post-loop until j 3 ≥β 3,2 (ii) a Otherwise, executing step 10.5;
step 10.5, judge i 3 Whether or not less than beta 3,1 If i is 3 <β 3,1 Then i will 3 +1 value to i 3 The step 10.2 to the step 10.4 are executed in a post-loop until i 3 ≥β 3,1
In the present embodiment, through steps 10.3 to 10.5, 6 coded planar targets, i.e., β, having the same number are found on the 3 rd captured left camera target image and the 3 rd captured right camera target image 3,3 6; taking the No. 1 to No. 6 coding plane targets and the corresponding matching groups thereof on the 3 rd shot left camera target image as the 1 st to 6 th external reference calibration targets and the external reference calibration matching groups on the 3 rd shot left camera target image; taking the No. 1 to No. 6 coding plane targets and the corresponding matching groups thereof on the right camera target image shot at the 3 rd time as the 1 st to 6 th external reference calibration targets and the external reference calibration matching groups on the right camera target image shot at the 3 rd time;
step 11, determining beta 3,3 Whether or not less than 3, in the examples, beta 3,3 6, i.e. beta 3,3 Not less than 3, defining an integer variable beta 3,4 And assign beta 3,4 0, taking an integer variable i 3 And assign value i 3 If 1, go to step 12;
step 12, according to the ith shooting of the 3 rd time 3 Matching group for calibrating external parameters of left camera and ith shooting for 3 rd time 3 The external parameter calibration matching group of the right camera counts the ith camera target image shot at the 3 rd time 3 The ith on the individual external reference calibration target and the 3 rd shot right camera target image 3 The number of the same-name calibration angular points with the same unique coding serial number of the calibration angular points on the external reference calibration target
Figure BDA0003015293220000261
In this embodiment, the number of the calibration angle points with the same name and the same unique code number of the calibration angle point on each pair of external reference calibration targets (e.g. the 1 st external reference calibration target on the 3 rd captured left camera target image and the 1 st external reference calibration target on the 3 rd captured right camera target image) is 25, i.e. the number of the calibration angle points is 25
Figure BDA0003015293220000262
Step 13, judgment
Figure BDA0003015293220000263
Whether or not it is less than 3, in the present embodiment,
Figure BDA0003015293220000264
then beta will be 3,4 +1 value to β 3,4 The ith camera target image shot at the 3 rd time is compared with the target image shot at the 3 rd time 3 The individual external reference calibration target is taken as the beta-th image in the target image of the left camera shot at the 3 rd time 3,4 The individual parameters optimize the target, and the ith shot at the 3 rd time 3 The matching group for calibrating the external parameters of the left camera is taken as the beta-th shooting of the 3 rd time 3,4 The left camera external parameter optimization matching group takes the ith camera target image shot at the 3 rd time 3 Taking the individual external reference calibration target as the beta-th image in the right camera target image shot at the 3 rd time 3,4 The individual external parameters optimize the target, i, the 3 rd shot 3 The external parameter calibration matching group of the right camera is taken as the beta-th shooting of the 3 rd time 3,4 The external parameter optimization matching group of the right camera;
judgment of i 3 Whether or not less than beta 3,3 If i is 3 <β 3,3 Then i will 3 +1 to i 3 Then returning to the step 12 for sequential execution; to obtain beta 3,4 ==6;
Step 14, determining beta 3,4 Whether or not toLess than 1, if beta τ,4 If the number is less than 1, executing a coding stereo target adjusting step. In a specific embodiment, β 3,4 6, satisfies beta 3,4 ≥k 3 Namely, the 6 external reference calibration targets and the 6 external reference calibration matching groups on the left camera target image shot at the 3 rd time can be both used as the external reference optimization matching groups of the left camera, and the 6 external reference calibration targets and the 6 external reference calibration matching groups on the right camera target image shot at the 3 rd time can be both used as the external reference optimization matching groups of the right camera;
as can be obtained by the steps 8 to 14, the 3 rd shot left camera target image contains 6 left camera calibration targets (wherein, the 6 left camera calibration targets can be used as the left camera external reference calibration targets, and the 6 left camera external reference calibration targets can be used as the left camera external reference optimization targets), and the 3 rd shot 6 left camera calibration matching groups (wherein, the 6 left camera calibration matching groups can be used as the left camera external reference calibration matching groups, and the 6 left camera external reference calibration matching groups can be used as the left camera external reference optimization matching groups); meanwhile, the right camera target image shot at the 3 rd time comprises 6 right camera calibration targets (wherein the 6 right camera calibration targets can be used as the right camera external reference calibration targets, and the 6 right camera external reference calibration targets can be used as the right camera external reference optimization targets), and the 6 right camera calibration matching groups shot at the 3 rd time (wherein the 6 right camera calibration matching groups can be used as the right camera external reference calibration matching groups, and the 6 right camera external reference calibration matching groups can be used as the right camera external reference optimization matching groups).
Step 15, according to the obtained 6 left camera calibration matching groups shot at the 3 rd time, calculating the internal parameters and distortion coefficients of the left camera by using a monocular camera internal and external parameter calibration algorithm, and respectively converting the left camera coordinate system into the rotation matrixes R of the No. 1, No. 2, No. … and No. 6 target coordinate systems of the coded three-dimensional target in the space l,1 、R l,2 、R l,3 、…R l,6 And translation vector T l,1 、T l,2 、T l,3 、…T l,6
In an embodiment, the calibration results for the left camera are as follows:
global average calibration error of left camera target image: 0.0274039 pixels;
left camera internal reference matrix:
Figure BDA0003015293220000271
left camera distortion coefficient:
(-0.214228 0.130994 -0.000202357 5.63×10 -5 );
rotation matrix of No. 1 coded planar target on left camera target image:
Figure BDA0003015293220000272
translation vector of No. 1 coded planar target on left camera target image:
T l,1 =(-78.5127 92.2415 448.423) T
rotation matrix of No. 2 coded planar target on left camera target image:
Figure BDA0003015293220000273
translation vector of No. 2 coded planar target on left camera target image:
T l,2 =(21.9493 98.7451 497.135) T
rotation matrix of No. 3 coded planar target on left camera target image:
Figure BDA0003015293220000281
translation vector of No. 3 coded planar target on left camera target image:
T l,3 =(134.264 108.108 524.332) T
rotation matrix of No. 4 coded planar target on left camera target image:
Figure BDA0003015293220000282
translation vector of No. 4 coded planar target on left camera target image:
T l,4 =(-82.6357 -45.9222 448.679) T
rotation matrix of No. 5 coded planar target on left camera target image:
Figure BDA0003015293220000283
translation vector of the No. 5 coded planar target on the left camera target image:
T l,5 =(36.8107 -43.1279 503.72) T
rotation matrix of No. 6 coded planar target on left camera target image:
Figure BDA0003015293220000284
translation vector of the coded planar target No. 6 on the left camera target image:
T l,6 =(145.535 -38.8748 489.166) T
according to the obtained 6 right camera calibration matching groups shot at the 3 rd time, calculating the internal parameters and distortion coefficients of the right camera by using a monocular camera internal and external parameter calibration algorithm, and respectively converting the coordinate system of the right camera into the rotation matrix R of the No. 1, No. 2, No. … and No. 6 target coordinate systems of the coding three-dimensional target in space r,1 、R r,2 、R r,3 、…R r,6 And translation vector T r,1 、T r,2 、T r,3 、…T r,6
In this embodiment, the calibration result of the right camera is as follows:
and (3) overall average calibration error of the target image of the right camera: 0.0338604 pixels;
right camera intrinsic parameter matrix:
Figure BDA0003015293220000291
distortion coefficient of right camera:
(-0.232714 0.196554 -7.719×10 -5 -0.00221); and (3) a rotation matrix of the No. 1 coded plane target on the right camera target image:
Figure BDA0003015293220000292
translation vector of No. 1 coded plane target on right camera target image:
T r,1 =(-156.689 90.0871 439.808) T
rotation matrix of No. 2 coded plane target on right camera target image:
Figure BDA0003015293220000293
the translation vector of the No. 2 coded plane target on the right camera target image:
T r,2 =(-47.4902 95.287 464.166) T
and (3) the rotation vector of the No. 3 coded plane target on the right camera target image:
Figure BDA0003015293220000294
translation vector of No. 3 coded plane target on right camera target image:
T r,3 =(74.9578 102.942 463.052) T
rotation matrix of No. 4 coded plane target on right camera target image:
Figure BDA0003015293220000295
translation vector of No. 4 coded planar target on right camera target image:
T r,4 =(-162.096 -47.8374 440.853) T
and (3) a rotation matrix of the No. 5 coded plane target on the right camera target image:
Figure BDA0003015293220000301
translation vector of No. 5 coded planar target on right camera target image:
T r,5 =(-34.5229 -46.6275 465.354) T
rotation matrix of No. 6 coded plane target on right camera target image:
Figure BDA0003015293220000302
translation vector of No. 6 coded planar target on right camera target image:
T r,6 =(75.6522 -43.397 425.103) T
step 16, the rotation matrix R of the left camera coordinate system obtained in the step 15 is respectively converted into the target coordinate systems No. 1, No. 2, No. … and No. 6 l,1 、R l,2 、R l,3 、…R l,6 And translation vector T l,1 、T l,2 、T l,3 、…T l,6 In which the left-camera coordinate system is respectively converted to
Figure BDA0003015293220000303
No. target coordinate system rotation matrix R' l,1 、R′ l,2 、R′ l,3 、…R′ l,6 And translation vector T' l,1 、T′ l,2 、T′ l,3 、…T′ l,6
In the specific embodiment, since the 6 coded plane targets on the left camera target image can be used as the external reference calibration target of the left camera, R l,1 、R l,2 、R l,3 、…R l,6 Are each independently of R l,1 、R l,2 、R l,3 、…R l,6 Equal, T l,1 、T l,2 、T l,3 、…T l,6 Are respectively equal to T' l,1 、T′ l,2 、T′ l,3 、…T′ l,6
The rotation matrix R of the right camera coordinate system obtained in the above step 15 transformed to the target coordinate systems No. 1, No. 2, …, No. 6 r,1 、R r,2 、R r,3 、…R r,6 And translation vector T r,1 、T r,2 、T r,3 、…T r,6 In, respectively transforming the coordinate systems of the right-looking cameras to
Figure BDA0003015293220000304
Rotation matrix R of number target coordinate system r,1 、R r,2 、…R r,6 And translation vector T r,1 、T r,2 、…T r,6
In a specific embodiment, since the 6 coded planar targets on the right camera target image can be used as the external reference calibration targets of the right camera, R r,1 、R r,2 、R r,3 、…R r,6 Are each independently of R r,1 、R r,2 、…R r,6 Equal, T r,1 、T r,2 、T r,3 、…T r,6 Are respectively equal to T r,1 、T r,2 、…T r,6
Step 17, transformation to the left Camera coordinate System
Figure BDA0003015293220000305
Rotation matrix of number target coordinate system
Figure BDA0003015293220000306
And translation vector
Figure BDA0003015293220000307
And right camera coordinate system transformation to
Figure BDA0003015293220000308
Rotation matrix of number target coordinate system
Figure BDA0003015293220000309
And translation vector
Figure BDA00030152932200003010
Solving the rotation and translation relation between the left camera coordinate system and the right camera coordinate system according to the equations (1) and (2):
Figure BDA00030152932200003011
Figure BDA0003015293220000311
wherein i 3 =1,2...,β 3,3
In a specific embodiment, the above calculation can result in:
Figure BDA0003015293220000312
T 1 =(-187.8069-1.5984-14.4842) T
Figure BDA0003015293220000313
T 2 =(-183.3164 2.4243 -15.7334) T
Figure BDA0003015293220000314
T 3 =(-179.772 8.93499 -17.48285) T
Figure BDA0003015293220000315
T 4 =(-189.752 -3.1040 -14.6515) T
Figure BDA0003015293220000316
T 5 =(-185.924 4.2161 -15.7297) T
Figure BDA0003015293220000317
T 6 =(-182.450 -1.7488 -14.924) T
step 18, 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 BDA0003015293220000318
wherein i τ =1,2...,β 3,3 And calculating to obtain:
Figure BDA0003015293220000319
T=(-184.837 1.5207 -15.501) T
and step 19, 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 in the steps, calculating accurate values R 'and T' of external parameters of the binocular camera by using an optimization method based on standard length, and completing calibration of the binocular camera. The optimization result of the external parameters of the binocular camera in the embodiment is as follows:
optimizing the average error: 0.0515424 mm;
Figure BDA0003015293220000321
T′=(-220.849 266.76 353.931) T
in a specific embodiment, the steps of the decoding method for encoding a stereoscopic target are as follows (since the process of decoding a target image captured each time by using the decoding method for encoding a stereoscopic target and obtaining the calibration corner point encoding information is similar, the following description will be given in detail by taking a right camera target image captured at the 3 rd time as an example in this embodiment):
step a1, using the checkerboard detection algorithm proposed by Automatic Camera and Range Sensor Calibration using a single Shot, identifying the right Camera target image taken at the 3 rd time
Figure BDA0003015293220000322
The complete or partial coding plane targets are marked as coding plane targets respectively
Figure BDA0003015293220000323
And obtaining sub-pixel coordinates of all calibration corner points on each coding plane target under a target image calibration corner point pixel coordinate system o-xy, as shown in FIG. 25, the coding plane target
Figure BDA0003015293220000324
The sub-pixel coordinates of the upper calibration corner point are shown in tables 2.1 to 2.6:
TABLE 2.1
(441.018,111.57) (442.674,176.429) (444.099,240.704) (445.659,304.785) (447.233,368.884)
(377.533,113.12) (379.096,177.963) (380.873,242.159) (382.784,306.324) (384.663,370.246)
(314.425,114.952) (316.044,179.577) (317.886,243.731) (319.905,307.759) (321.97,371.538)
(251.025,116.856) (252.975,181.29) (254.998,245.306) (257.082,309.283) (259.441,372.908)
(188.539,118.828) (190.625,183.05) (192.759,247.032) (194.976,310.884) (197.48,374.591)
TABLE 2.2
(264.728,781.126) (325.337,790.84) (385.863,800.215) (445.756,809.461) (505.266,818.66)
(254.735,839.98) (315.899,849.425) (377.005,858.855) (437.652,867.832) (497.472,876.826)
(244.416,899.822) (306.378,908.929) (368.087,918.002) (429.222,926.941) (489.854,935.513)
(234.321,960.634) (296.674,969.525) (359.198,978.358) (420.881,986.838) (482.111,995.256)
(224.225,1022.38) (287.347,1031.09) (350.221,1039.72) (412.799,1047.93) (474.328,1056.04)
TABLE 2.3
(976.673,779.02) (976.045,840.675) (975.01,903.327) (974.44,966.484) (973.608,1030.17)
(918.781,782.414) (917.743,843.626) (916.558,905.506) (915.462,968.096) (914.376,1031.15)
(862.02,785.851) (860.515,846.168) (858.917,907.304) (857.584,969.434) (856.2,1031.83)
(806.383,788.648) (804.554,848.463) (802.728,909.15) (800.932,970.367) (799.06,1032.12)
(752.014,792.034) (749.827,850.835) (747.873,910.768) (745.78,971.507) (743.87,1032.21)
TABLE 2.4
(808.781,148.931) (873.543,153.238) (938.027,157.749) (1002.74,162.398) (1067.44,167.215)
(806.872,210.461) (870.828,214.848) (934.609,219.271) (998.423,223.927) (1062.34,228.73)
(805.027,270.345) (868.262,274.754) (931.217,279.145) (994.224,283.819) (1057.41,288.741)
(803.26,329.229) (865.643,333.556) (927.946,338.083) (990.201,342.772) (1052.52,347.522)
(801.844,386.368) (863.434,390.774) (924.774,395.13) (986.314,399.786) (1047.82,404.63)
TABLE 2.5
(1322.22,158.441) (1384.79,160.81) (1447.13,163.506) (1508.62,166.495) (1569.86,169.088)
(1325.44,212.577) (1388.68,214.911) (1451.9,217.548) (1514.08,220.386) (1576.08,223)
(1328.35,267.896) (1392.53,270.493) (1456.39,272.873) (1519.65,275.448) (1582.22,278.257)
(1331.67,324.942) (1396.43,327.121) (1461.23,329.764) (1524.83,332.261) (1588.31,334.814)
(1334.61,384.077) (1400.4,386.349) (1465.92,388.672) (1530.3,390.853) (1594.41,393.083)
TABLE 2.6
(1288.92,824.6) (1348.73,824.929) (1409.97,825.075) (1471.75,825.312) (1534.34,825.381)
(1291.46,885.744) (1351,886.452) (1412.05,887.522) (1473.6,888.175) (1536.2,888.94)
(1293.86,946.104) (1353.18,947.637) (1414.09,949.028) (1475.48,950.389) (1538.15,952.083)
(1296.02,1006.02) (1355.25,1008.15) (1415.91,1010.28) (1477.05,1012.21) (1539.71,1014.24)
(1298.1,1065.76) (1357.06,1068.37) (1417.34,1071.18) (1478.26,1073.91) (1540.58,1076.41)
Step a2.1, taking an integer variable i, and giving an initial value i equal to 1;
step a2.2, copying the right camera target image shot at the 3 rd time to the coded stereo target image p i Performing the following steps;
step a3, encoding a stereo target image p i In which the coding plane target is selected
Figure BDA0003015293220000331
Method for processing digital image and encoding plane target
Figure BDA0003015293220000332
The gray values of all internal pixel points are kept unchanged, and the planar target is coded
Figure BDA0003015293220000333
All gray values of all other pixel points are assigned to be 255, and the processed image is recorded as a three-dimensional target image p without complex background coding i ′;
In a specific embodiment, the three-dimensional target image p is coded without complex background 1 ' As shown in FIG. 26, the stereo target image p is encoded without complex background 2 ' As shown in FIG. 27, the stereo target image p is encoded without complex background 3 ' As shown in FIG. 28, the stereo target image p is encoded without complex background 4 ' As shown in FIG. 29, the stereo target image p is encoded without complex background 5 ' As shown in FIG. 30, the stereo target image p is encoded without complex background 6 ' as shown in FIG. 31;
step a4, encoding a stereo target image p without complex background i ' in (1), the encoding plane target is decoded by using a decoding method of the encoding plane target
Figure BDA0003015293220000334
The coding numbers of all the calibration angular points in the target are matched with the sub-pixel coordinates of all the calibration angular points one by one, namely, a coding plane target is found
Figure BDA0003015293220000335
The coding numbers of all the calibration angular points in the plane target and the sub-pixel coordinates of all the calibration angular points are in one-to-one correspondence relationship, and the plane target is coded
Figure BDA0003015293220000336
And all the calibration angular points in the coding three-dimensional target are matched with the corresponding coding plane targets and calibration angular points in the coding three-dimensional target one by one, namely the coding plane target is found
Figure BDA0003015293220000337
And the one-to-one correspondence between the pixel coordinates of all the calibration corner points in the target, and the coding plane target is also found
Figure BDA0003015293220000338
Coding plane target numbers of each inner calibration angular point, unique coding serial numbers corresponding to each calibration angular point, pixel coordinate values under a unique pixel coordinate system and target coordinate values under a unique target coordinate system, and skipping to the step 5;
step a5, according to whether i is equal to
Figure BDA0003015293220000341
The following two cases can be distinguished:
case 1: when i is not equal to 6, let i be i +1, and jump to step 4.2;
case 2: when i is 6, this loop is ended, thereby ending the decoding process of the entire encoded stereoscopic target.
By the above steps, in the right camera target image shot at the 3 rd time, the one-to-one correspondence relationship between all identified coding plane targets and the coding plane targets in the coding three-dimensional targets in the shot space, the one-to-one correspondence relationship between the pixel coordinates of all calibration corner points in all identified coding plane targets and the target coordinates, and the coding plane target number where each calibration corner point in all identified coding plane targets is located, the unique coding serial number corresponding to each calibration corner point, the pixel coordinate value in the unique pixel coordinate system and the target coordinate value in the unique target coordinate system are also found.
In a specific embodiment, the unique code number corresponding to the calibration corner point of each code plane target in the target image shot at the 3 rd time, the pixel coordinate value in the unique pixel coordinate system, and the target coordinate value in the unique target coordinate system are shown in tables 2.1 to 2.6.
In an embodiment, when the 3 rd captured right camera target image is processed by the decoding method for encoding the three-dimensional target, the steps of the decoding method for encoding the planar target used are as follows (since the process of processing each encoded planar target in the 3 rd captured right camera target image by the decoding method for encoding the planar target is similar, the three-dimensional target image p is encoded without complex background in this embodiment 5 ' detailed description for example):
step b1, encoding the stereo target image p without complex background 5 ' and encoding the stereoscopic target image p without complex background 5 ' all the extracted calibration corner points are used as input conditions of a decoding method of the coding three-dimensional target;
step b2, coding the stereo target image p without the complex background 5 ' carry out binarization processing and encode the three-dimensional target image p without complex background 5 ' the image obtained by binarization processing is marked as a binarized image P without a complex background target 2 So that the image P is binarized on the target without complex background 2 The 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 either white or black according to the coding rule;
step b3, encoding the stereo target image p based on the non-complex background 5 ' number of calibration corner points extracted internally in m rows x n columnsFor purposes (where m and n are integers), this step can be divided into the following cases:
in case 1, when m and n are both odd numbers, or m and n are odd, even, the number μ (μ is an integer) of parallelogram coding units contained in the polygon L can be calculated by formula (4);
μ=(m-1)(n-1)/2 (4)
then step 4.1.1 is executed;
case 2, if m and n are both even numbers, the estimated number μ '(μ' is an integer) of parallelogram coding units contained in the polygon L can be calculated by formula (5);
μ′=[(m-1)(n-1)+1]/2 (5)
at this time, the number mu of the parallelogram coding units actually contained in the polygon L satisfies mu ≦ mu';
setting a number judgment threshold value L' of parallelogram coding units; target binary image P without complex background 2 Etching the black connected domain to make the binary image P without the complex background target 2 All parallelogram coding units are disconnected at diagonal angles, and a complex background-free target binary image P is obtained 2 The image obtained by the processing is marked as a target binaryzation corrosion image P 2 '; wherein, the binary image P of the target without complex background 2 When 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 polygon L with the maximum calibrated large angle points meets the requirement, and the connected 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 angle points satisfies the following conditions: 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;
binaryzation corrosion image P on target 2 Searching mu ' maximum black connected domains, and calculating the average value χ ' of the first mu ' -1 maximum black connected domains containing pixel points;
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 domain m Judging according to the following;
Figure BDA0003015293220000351
(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 mu is equal to mu'; and executing step 7.1.2;
(2) if L ' > L ', the polygon L actually comprises mu ' -1 parallelogram coding units, and the value of mu ' -1 is assigned to mu, and mu is equal to mu ' -1; and executing step b4.1.2;
in a particular embodiment, the stereo target image p is encoded without a complex background 5 If 5 rows × 5 columns of calibration corner points are extracted (i.e., m-5 and n-5) in step 3, which is case 1, then μ ═ m-1 (n-1)/2 ═ 8;
step b4.1.1, binarizing the image P on the target without the complex background 2 In the method, black connected domain corrosion is carried out, so that a complex background-free target binary image P is obtained 2 All the parallelogram coding units are disconnected at the diagonal positions, and the complex background-free target binary image P is obtained 2 The image obtained by the processing is marked as a target binary corrosion image P 2 ' (where there is no complex background target binarized image P 2 When carrying out corrosion treatment of black connected domain, the coding plane target is ensured
Figure BDA0003015293220000361
All of the encoding patterns are not destroyed), as shown in fig. 32;
step b4.1.2, searching for targetBinary corrosion image P 2 'the 8 largest black connected domains in the' are respectively marked as grid connected domains omega 1 Grid connected domain omega 2 …, grid connected domain omega 8 (ii) a Taking an integer variable i, and giving an initial value i to 1;
step b4.2, binarizing the corrosion image P on the target 2 ' above, calculate the square connected component Ω in step b7.1.2 above i Pixel coordinate of centroid (x) i ,y i ) i And (3) reassigning i +1 to i, and then continuing to execute the step until i is more than 8, thereby obtaining a target binary corrosion image P 2 ' Upper square connected domain omega 1 Grid connected domain omega 2 …, grid connected domain omega 8 Centroid pixel coordinates (900,246) 1 、…、(838,180) 8 And will (900,246) 1 、…、(838,180) 8 Sequentially serving as the 1 st element, the 2 nd element, … and the 8 th element in a parallelogram coding unit centroid pixel coordinate set A;
step b5.1, giving the initial value i to the integer variable i again, wherein the initial value i is 1;
step b5.2, binarizing the corrosion image P on the target 2 ' in, calculate the distance grid connected domain omega i Centroid pixel coordinate (x) i ,y i ) i The nearest black connected domain is respectively marked as a target binary corrosion image P 2 'Ring center connected region Ω' i (ii) a Assigning i +1 to i again, and continuing to execute the step until i is greater than 8; finally, target binaryzation corrosion images P are respectively obtained 2 'Ring center connected region omega' 1 And omega 'of circular ring center connected region' 2 …, ring center connected region omega' 8
Step b5.3, assigning an initial value i to the integer variable i again, wherein the initial value i is 1;
step b5.4, binarizing the corrosion image P on the target 2 In' calculating the target binary corrosion image P 2 'Ring center connected region omega' i Centroid pixel coordinate o ″) d,i (x″ d,i ,y″ d,i ) The step is continuously executed after i +1 is reassigned to i untilEnding when i is greater than 8; thereby respectively obtaining target binaryzation corrosion images P 2 'Ring center connected region omega' 1 And omega 'of circular ring center connected region' 2 …, ring center connected region omega' 8 Centroid pixel coordinate o ″) d1 (900,256)、…、o″ d8 (838,190) sequentially as the 1 st, 2 nd, …, 8 th elements in the set B of coordinates of centroid pixels of the circular ring;
step b6.1, binarizing the corrosion image P on the target 2 ' in, will divide square connected domain omega 1 Grid connected region omega 2 …, grid connected domain omega 8 And a circular ring center connected region omega' 1 And a circular ring center connected region omega' 2 …, ring center connected region omega' 8 The gray values of the other black connected domains are all assigned to be 255, and the target binary corrosion image P is 2 ' the image obtained by this processing is recorded as a decoded binary image P 3 As shown in fig. 33;
step b6.2, taking an integer variable zeta, and giving an initial value zeta equal to 1;
step b7.1, decoding the binary image P 3 Copying and backing up, and recording the copied image as a1 st backup binary image P 1,4
Step b7.2, in the 1 st backup binary image P 1,4 Taking the 1 st centroid coordinate value in the parallelogram coding unit centroid pixel coordinate set A (900,246) 1 Finding the coordinate value of distance centroid in the set of calibration corner points Q (900,246) 1 Pixel coordinate values of the nearest 4 calibration corner points, and the binarization image P at the 1 st backup 1,4 Respectively marking 4 pixel points corresponding to the pixel coordinate values of the 4 calibration corner points as C ″ 1,1 (868.3,274.8)、C″ 1,2 (870.8,214.8)、C″ 1,3 (934.6,219.3)、C″ 1,4 (931.2,279.1); and taking the 4 pixel points as the 1 st calibration angular point quadrangle S 1 4 and connecting the 4 vertexes to form a1 st calibration corner point quadrangle S 1
Step B8.1, in the coordinates B of the centroid pixels of the rings in step 5.4,finding the 1 st centroid pixel coordinate value in the parallelogram coding unit centroid pixel coordinate set A (900,246) 1 A corresponding circle centroid pixel coordinate of circle 1 (900,256);
step b8.2, in the 1 st backup binaryzation image P 1,4 Searching a white connected domain closest to the coordinate value (900,256) of the centroid of the circular ring, and assigning the gray value of the white connected domain as 0;
step b9, backup binary image P at 1 st 1,4 In the above, the 1 st calibration corner point quadrangle S 1 Except that the gray values of all the pixel points are assigned to be 255, and the 1 st calibration corner point quadrangle S 1 Keeping the gray values of all internal pixel points unchanged, and marking the obtained image as the 1 st unit binary image E without complex background 1 As shown in fig. 34;
step b10, binarizing image E on the 1 st cell without complex background 1 In the method, a unit binary image E with the maximum black connected domain and marked as the 1 st no complex background is searched 1 Maximum black connected component Ω in (c) 1,E (ii) a Extracting the 1 st unit binary image E without complex background 1 Maximum black connected component Ω in 1,E And is recorded as the centroid pixel coordinate value of (900,246) 1 Of parallelogram coding units D 1
Step b11, the coordinate value of the centroid pixel is (900,246) 1 Of parallelogram coding units D 1 In 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 background 1 The pixel coordinate value of the middle mass center is (900,246) 1 In a parallelogram coding unit of (2) an outline G of a positioning circle 1 Calculating the positioning circle profile G 1 And marked as the 1 st unit binary image without complex background 1 The coordinate value of the upper centroid pixel is (900,246) 1 Positioning circular centroid pixel coordinate o 'in parallelogram coding unit of (1)' l,1 (900,236);
Step b12.1 atThe centroid pixel coordinate value in the above step 10 is (900,246) 1 Of a parallelogram-shaped coding unit D 1 In (1), the 2 contours with the largest number of pixels are removed, and the remaining k 1 (wherein κ 1 0,1,2, 3.) contours, and is classified into the following cases:
case 1, if κ 1 If 0, go to step 13.1;
case 2 if κ 1 Not equal to 0, then this κ 1 The individual contour is the unit binary image E without complex background in the 1 st 1 The upper centroid pixel coordinate value is (900,246) 1 The coded mark circle contour in the parallelogram coding unit is recorded as the coded mark circle contour
Figure BDA0003015293220000381
Coded marker circle profile
Figure BDA0003015293220000382
… coded marker circle outline
Figure BDA0003015293220000383
In the examples kappa 1 If 2, the 2 contours are the 1 st unit binarized image E without complex background 1 The coordinates of the upper center of mass are (900,246) 1 The coding mark circle contour in the parallelogram coding unit is respectively marked as the coding mark circle contour
Figure BDA0003015293220000384
Coded marker circle profile
Figure BDA0003015293220000385
Step b12.2, assigning an initial value i to the integer variable i again, wherein the initial value i is 1;
step b12.3, binarizing the image E in the 1 st unit without complex background 1 Calculating the contour of the coding mark circle
Figure BDA0003015293220000386
Centroid pixel coordinates of
Figure BDA0003015293220000387
Assigning i +1 to i again and continuing to execute the step until i is greater than 2; can obtain the corresponding coding mark circle outline
Figure BDA0003015293220000388
Coded marker circle profile
Figure BDA0003015293220000389
Centroid pixel coordinates of
Figure BDA00030152932200003810
Figure BDA00030152932200003811
Step b13.1, binarizing the image E in the 1 st unit without complex background 1 In the above, the pixel with the pixel coordinate value of (900,256) is recorded as the centroid coordinate value of (900,246) 1 Of parallelogram-shaped coding units of (2) oriented circular ring centroid o' d,1 (900,256); and binarizing the image E in the 1 st cell without complex background 1 In the above, 4 pixels with pixel coordinate values of (868.3,274.8), (870.8,214.8), (934.6,219.3) and (931.2,279.1) are marked as C ″ 1,1 (868.3,274.8)、C″ 1,2 (870.8,214.8)、C″ 1,3 (934.6,219.3)、C″ 1,4 (931.2,279.1);
Step b13.2, binarizing the image E in the 1 st unit without complex background 1 Upper, get C 1,1 (x 1,1 ,y 1,1 )、C 1,2 (x 1,2 ,y 1,2 )、C 1,3 (x 1,3 ,y 1,3 )、C 1,4 (x 1,4 ,y 1,4 ) Respectively representing a centroid pixel coordinate value of (900,246) 1 The 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 (900,246) 1 In a parallelogram coding unit ofDirection vector
Figure BDA00030152932200003812
Can be derived from equation (6) while noting through the location of the centroid o 'of the circle' l,1 And a directional circular centroid o' d,1 Is a straight line of 1,3
Figure BDA00030152932200003813
Step b14, binarizing image E in the 1 st unit without complex background 1 In the above, 4 pixel points C ″) 1,1 (868.3,274.8)、C″ 1,2 (870.8,214.8)、C″ 1,3 (934.6,219.3)、C″ 1,4 (931.2,279.1) distance-located circular centroid pixel coordinate o' l,1 (900,236) the nearest 2 pixels are marked as C 1,1min (x 1,1min ,y 1,1min ) And C 1,2min (x 1,2min ,y 1,2min ) (ii) a In this embodiment, C 1,1min (x 1,1min ,y 1,1min ) Is C' 1,1 (934.6,219.3),C 1,2min (x 1,2min ,y 1,2min ) Is C' 1,4 (870.8,214.8) the centroid pixel coordinate value is (900,246) calculated by the formulas (7) and (8) 1 Of the parallelogram coding unit of (1) a decision vector
Figure BDA0003015293220000391
And 2 nd decision vector
Figure BDA0003015293220000392
And calculating the area division sine value 1sin alpha by the formula (9) and the formula (10) 1 Sum region dividing sine value 2sin beta 1
Figure BDA0003015293220000393
Figure BDA0003015293220000394
Figure BDA0003015293220000395
Figure BDA0003015293220000396
And judging:
case 1, if sin α 1 <0,sinβ 1 Greater than 0, then C 1,1min (x 1,1min ,y 1,1min ) Is the centroid pixel coordinate value is (900,246) 1 C is the nominal corner point of the 1 st coding region in the parallelogram coding unit 1,1min (x 1,1min ,y 1,1min ) Is assigned to C 1,1 (x 1,1 ,y 1,1 );C 1,2min (x 1,2min ,y 1,2min ) Is a centroid pixel coordinate value of (900,246) 1 C of the 6 th coding region in the parallelogram coding unit 1,2min (x 1,2min ,y 1,2min ) Is assigned to C 1,4 (x 1,4 ,y 1,4 );
Case 2, if sin α 1 >0,sinβ 1 Less than 0, then C 1,2min (x 1,2min ,y 1,2min ) Is a centroid pixel coordinate value of (900,246) 1 C for the 1 st coding region in the parallelogram coding unit 1,2min (x 1,2min ,y 1,2min ) Is assigned to C 1,1 (x 1,1 ,y 1,1 );C 1,1min (x 1,1min ,y 1,1min ) Is a centroid pixel coordinate value of (900,246) 1 C of the 6 th coding region in the parallelogram coding unit 1,1min (x 1,1min ,y 1,1min ) Is assigned to C 1,4 (x 1,4 ,y 1,4 );
In this embodiment, sin α 1 <0,sinβ 1 Greater than 0, then C 1,1min (9346,219.3) centroid pixel coordinate value (900,246) 1 C for the 1 st coding region in the parallelogram coding unit 1,1min (934.6,219.3) the pixel coordinate value is assigned to C 1,1 (x 1,1 ,y 1,1 );C 1,2min (870.8,214.8) the centroid pixel coordinate value is (900,246) 1 C is the nominal corner point of the 6 th coding region in the parallelogram coding unit 1,2min (870.8,214.8) the pixel coordinate value is assigned to C 1,4 (x 1,4 ,y 1,4 );
Step b15, binarizing image E in the 1 st unit without complex background 1 Above, the centroid pixel coordinate value found by the above step b14 is (900,246) 1 The calibration corner points C of the 1 st coding region and the 6 th coding region in the parallelogram coding unit 1,1 (934.6,219.3) and C 1,4 (870.8,214.8); 4 pixel points C ″) 1,1 (868.3,274.8)、C″ 1,2 (870.8,214.8)、C″ 1,3 (934.6,219.3)、C″ 1,4 (931.2,279.1) the remaining 2 pixels (in this embodiment, C ″) 1,2 (868.3,274.8) and C' 1,3 (931.2,279.1)) are assigned to the centroid pixel coordinate values, respectively, (900,246) 1 The 1 st temporary coordinate value of the parallelogram encoding unit of (1) is marked as C' 1,5 (931.2,279.1), and the 2 nd temporary coordinate value is marked as C' 1,6 (868.3,274.8); the pixel coordinate value at the centroid can be found as (900,246) from equations (11) and (12) 1 Of the parallelogram coding unit of (3) th decision vector
Figure BDA0003015293220000401
And 4 th judgment vector
Figure BDA0003015293220000402
Figure BDA0003015293220000403
Figure BDA0003015293220000404
Step b16, determining the vector according to the 3 rd judgment vector calculated in the step b15
Figure BDA0003015293220000405
And 4 th judgment vector
Figure BDA0003015293220000406
The area division sine value 3sin omega can be obtained by the formula (13) and the formula (14) 1 Sum region dividing sine value 4sin xi 1
Figure BDA0003015293220000407
Figure BDA0003015293220000408
And judging:
case 1, sin ω 1 ==0,sinξ 1 Not equal to 0, then C' 1,5 (x′ 1,5 ,y′ 1,5 ) I.e. the centroid pixel coordinate value is (900,246) 1 C 'of the 3 rd coding region in the parallelogram coding unit of (1)' 1,5 (x′ 1,5 ,y′ 1,5 ) Is assigned to C 1,2 (x 1,2 ,y 1,2 );C′ 1,6 (x′ 1,6 ,y′ 1,6 ) Is a centroid pixel coordinate value of (900,246) 1 C 'of the calibration corner point of the 4 th coding region in the parallelogram coding unit of (1)' 1,6 (x′ 1,6 ,y′ 1,6 ) Is assigned to C 1,3 (x 1,3 ,y 1,3 );
Case 2, sin ω 1 ≠0,sinξ 1 0 to C' 1,6 (x′ 1,6 ,y′ 1,6 ) I.e. the centroid pixel coordinate value is (900,246) 1 C 'to the index corner point of the 3 rd coding region in the parallelogram coding unit of (1)' 1,6 (x′ 1,6 ,y′ 1,6 ) Is assigned to C 1,2 (x 1,2 ,y 1,2 );C′ 1,5 (x′ 1,5 ,y′ 1,5 ) Is a centroid pixel coordinate value of (900,246) 1 C 'of the index corner point of the 4 th coding region in the parallelogram coding unit of (1)' 1,5 (x′ 1,5 ,y′ 1,5 ) Is assigned to C 1,3 (x 1,3 ,y 1,3 );
In this example sin ω 1 0.06, below the parallelism threshold of 0.1, so it can be considered that: sin omega 1 ==0,sinξ 1 Not equal to 0, then C' 1,5 (931.2,279.1) the centroid pixel coordinate value is (900,246) 1 C 'of the 3 rd coding region in the parallelogram coding unit of (1)' 1,5 (931.2,279.1) the coordinate value is assigned to C 1,2 (x 1,2 ,y 1,2 );C′ 1,6 (868.3,274.8) the centroid pixel coordinate value is (900,246) 1 C 'to the index corner point of the 4 th coding region in the parallelogram coding unit of' 1,6 (868.3,274.8) to C 1,3 (x 1,3 ,y 1,3 );
So far, the image E is binarized in the 1 st unit without complex background 1 In the above, the centroid pixel coordinate value is found to be (900,246) 1 Is marked with an angular point C of the 1 st coding region in the parallelogram coding unit 1,1 (934.6,219.3), and a calibration corner point C of the 3 rd encoding region 1,2 (931.2,279.1) and a calibration corner point C of the 4 th encoding region 1,3 (868.3,274.8) and the calibration corner point C of the 6 th encoding region 1,4 (870.8,214.8);
Step b17, binarizing image E on the 1 st cell without complex background 1 The coordinates of the centroid pixel obtained in step 14 are (900,246) 1 Is marked with an angular point C of the 1 st coding region in the parallelogram coding unit 1,1 (934.6,219.3), calibration corner point C of the 6 th encoding region 1,4 (870.8,214.8), the centroid pixel coordinate value is (900,246) from equation (15) 1 Of the parallelogram coding unit of (4)
Figure BDA0003015293220000411
Figure BDA0003015293220000412
Binarizing image E in 1 st unit without complex background 1 The coordinate value of the centroid pixel is (900,246) 1 Positioning circular mass center o of parallelogram coding unit l,1 (900,236) as a starting point with a5 th decision vector
Figure BDA0003015293220000413
Parallel and co-directional unit vectors, denoted as
Figure BDA0003015293220000414
And memorize unit vector
Figure BDA0003015293220000415
The straight line is l 1,1 (ii) a The coordinate value of the centroid pixel is (900,246) 1 Of parallelogram-shaped coding units of (1)' d,1 (900,256) as a starting point with a5 th decision vector
Figure BDA0003015293220000416
Parallel and co-directional unit vectors, denoted as
Figure BDA0003015293220000417
And recording the straight line of the unit vector as l 1,2 (ii) a Re-assigning the integer variable i to 1;
step b18.1, defining 6 floating point type two-dimensional arrays Cr 1 1 [2][2]、Cr 1 2 [2][2]、Cr 1 3 [2][2]、Cr 1 4 [2][2]、Cr 1 5 [2][2]、Cr 1 6 [2][2]For storing the centroid pixel coordinate value is (900,246) 1 Are 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 regionThe 1 st unit binary image E without complex background of the circular outline centroid of the coding mark 1 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 BDA0003015293220000418
And it is initialized by the user terminal,
Figure BDA0003015293220000419
re-assigning the integer variable i to be 1;
step b18.2, binarizing the image E on the 1 st unit without complex background 1 In the calculation step 15.2, the centroid pixel coordinate value is (900,246) 1 In a parallelogram coding unit of (1) code the marker circle profile
Figure BDA00030152932200004110
Centroid pixel coordinates of
Figure BDA00030152932200004111
And
Figure BDA00030152932200004112
respectively with the location circle center of mass o' l,1 Oriented ring centroid o' d,1 Formed group 1, quadrant 1 vector
Figure BDA00030152932200004113
And group 1,2 nd quadrant vector
Figure BDA00030152932200004114
And group 2 quadrant 1 vectors
Figure BDA00030152932200004115
And group 2 quadrant 2 vectors
Figure BDA00030152932200004116
Figure BDA00030152932200004117
Figure BDA00030152932200004118
According to the calculated 1 st group of 1 st quadrant vectors
Figure BDA00030152932200004119
And group 1,2 nd quadrant vector
Figure BDA00030152932200004120
Group
2, 1 st quadrant vector
Figure BDA00030152932200004121
And group 2 quadrant 2 vectors
Figure BDA00030152932200004122
Unit vector
Figure BDA00030152932200004123
And with
Figure BDA00030152932200004124
And a direction vector
Figure BDA00030152932200004125
Is calculated by the following formula (18), formula (19), formula (20), formula (21), formula (22), formula (23), formula (24) or formula (25)
Figure BDA0003015293220000421
And
Figure BDA00030152932200004225
Figure BDA0003015293220000422
Figure BDA0003015293220000423
Figure BDA0003015293220000424
Figure BDA0003015293220000425
Figure BDA0003015293220000426
Figure BDA0003015293220000427
Figure BDA0003015293220000428
Figure BDA0003015293220000429
and the following results were obtained:
Figure BDA00030152932200004210
coded marker circle profile
Figure BDA00030152932200004211
The coordinate value of the pixel falling on the centroid is (900,246) 1 The 1 st coding region of the parallelogram coding unit of (1); let Cr be 1 1 [0][0]=922,Cr 1 1 [0][1]=232;
Figure BDA00030152932200004212
Coded marker circle profile
Figure BDA00030152932200004213
The pixel coordinate value falling on the centroid is (1154,696) 1 The 2 nd coding region of the parallelogram coding unit of (1); let Cr be 1 2 [0][0]=922,Cr 1 2 [0][1]=244;
Step b19, definition
Figure BDA00030152932200004214
The coordinate value of the representative centroid pixel is (900,246) 1 The 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 BDA00030152932200004215
taking 0 or 1; taking an integer variable i, and endowing the i with an initial value i which is 1 again;
step b20.1, the step is divided into the following conditions:
case 1, if Cr 1 i [0][0]==-1,Cr 1 i [0][1]==-1,Cr 1 i [1][0]==-1,Cr 1 i [1][1]When the value is-1, then
Figure BDA00030152932200004216
Assigning i +1 to i, and when i is more than 2, continuing to execute the next step b 20.2; otherwise, returning to execute the step b 20.1;
case 2 if Cr 1 i [0][0]==-1,Cr 1 i [0][1]==-1,Cr 1 i [1][0]≠-1,Cr 1 i [1][1]Not equal to-1, recording coordinate point (Cr) 1 i [1][0],Cr 1 i [1][1]) To a straight line l 1,1 A distance of
Figure BDA00030152932200004217
To a straight line l 1,3 A distance of
Figure BDA00030152932200004218
If it is
Figure BDA00030152932200004219
And make an order
Figure BDA00030152932200004220
If it is
Figure BDA00030152932200004221
Then make it give
Figure BDA00030152932200004222
Assigning i +1 to i, and when i is more than 2, continuing to execute the next step b 20.2; otherwise, returning to execute the step b 20.1;
case 3, if Cr 1 i [0][0]≠-1,Cr 1 i [0][1]≠-1,Cr 1 i [1][0]==-1,Cr 1 i [1][1]1, note coordinate point (Cr) 1 i [0][0],Cr 1 i [0][1]) To a straight line l 1,1 Is a distance of
Figure BDA00030152932200004226
To a straight line l 1,3 A distance of
Figure BDA00030152932200004223
If it is
Figure BDA00030152932200004224
Then order
Figure BDA0003015293220000431
If it is
Figure BDA0003015293220000432
Order to
Figure BDA0003015293220000433
Assigning i +1 to i, and when i is more than 2, continuing to execute the next step b 20.2; otherwise, returning to execute the step b 20.1; (ii) a
Case 4, if Cr 1 i [0][0]≠-1,Cr 1 i [0][1]≠-1,Cr 1 i [1][0]≠-1,Cr 1 i [1][1]Not equal to-1, then order
Figure BDA0003015293220000434
Assigning i +1 to i, and when i is more than 2, continuing to execute the next step b 20.2; otherwise, returning to execute the step b 20.1;
in a specific embodiment, according to this step:
(1)Cr 1 1 [0][0]≠-1,Cr 1 1 [0][1]≠-1,Cr 1 1 [1][0]==-1,Cr 1 1 [1][1]is ═ 1, and satisfies
Figure BDA0003015293220000435
Figure BDA0003015293220000436
Then
Figure BDA0003015293220000437
(2)Cr 1 2 [0][0]≠-1,Cr 1 2 [0][1]≠-1,Cr 1 1 [1][0]==-1,Cr 1 1 [1][1]Is ═ 1, and satisfies
Figure BDA0003015293220000438
Figure BDA0003015293220000439
Then
Figure BDA00030152932200004310
Step b20.2, the step is divided into the following conditions:
case 1, if Cr 1 i [0][0]==-1,Cr 1 i [0][1]==-1,Cr 1 i [1][0]==-1,Cr 1 i [1][1]When the value is-1, then
Figure BDA00030152932200004311
Assigning i +1 to i, and when i > 4 is satisfied, thenThe next step b20.3 is executed; otherwise, returning to execute the step b 20.2;
case 2 if Cr 1 i [0][0]==-1,Cr 1 i [0][1]==-1,Cr 1 i [1][0]≠-1,Cr 1 i [1][1]Not equal to-1, recording coordinate point (Cr) 1 i [1][0],Cr 1 i [1][1]) To a straight line l 1,2 Is a distance of
Figure BDA00030152932200004312
To a straight line l 1,3 A distance of
Figure BDA00030152932200004313
If it is
Figure BDA00030152932200004314
And order
Figure BDA00030152932200004315
If it is
Figure BDA00030152932200004316
Then order
Figure BDA00030152932200004317
Assigning i +1 to i, and when i is more than 4, continuing to execute the next step b 20.3; otherwise, returning to execute the step b 20.2;
case 3, if Cr 1 i [0][0]≠-1,Cr 1 i [0][1]≠-1,Cr 1 i [1][0]==-1,Cr 1 i [1][1]The coordinate point (Cr) is recorded as-1 1 i [0][0],Cr 1 i [0][1]) To a straight line l 1,2 Is a distance of
Figure BDA00030152932200004318
To a straight line l 1,3 A distance of
Figure BDA00030152932200004319
If it is
Figure BDA00030152932200004320
Then order
Figure BDA00030152932200004321
If it is
Figure BDA00030152932200004322
Order to
Figure BDA00030152932200004323
Assigning i +1 to i, and when i is more than 4, continuing to execute the next step b 20.3; otherwise, returning to execute the step b 20.2;
case 4, if Cr 1 i [0][0]≠-1,Cr 1 i [0][1]≠-1,Cr 1 i [1][0]≠-1,Cr 1 i [1][1]Not equal to-1, then order
Figure BDA00030152932200004324
Assigning i +1 to i, and when i is more than 4, continuing to execute the next step b 20.3; otherwise, returning to execute the step b 20.2;
in the present embodiment of the present invention,
Cr 1 3 [0][0]==-1,Cr 1 3 [0][1]==-1,Cr 1 3 [1][0]==-1,Cr 1 3 [1][1]when the value is-1, then
Figure BDA00030152932200004325
Cr 1 4 [0][0]==-1,Cr 1 4 [0][1]==-1,Cr1 4 [1][0]==-1,Cr 1 4 [1][1]When the value is-1, then
Figure BDA00030152932200004326
Step b20.3, the step is divided into the following conditions:
case 1 if Cr 1 i [0][0]==-1,Cr 1 i [0][1]==-1,Cr 1 i [1][0]==-1,Cr 1 i [1][1]When the value is-1, then
Figure BDA0003015293220000441
Assigning i +1 to i, and when i is more than 6, continuing to execute the next step 21; otherwise, returning to execute the step b 20.3;
case 2 if Cr 1 i [0][0]==-1,Cr 1 i [0][1]==-1,Cr 1 i [1][0]≠-1,Cr 1 i [1][1]Not equal to-1, recording coordinate point (Cr) 1 i [1][0],Cr 1 i [1][1]) To a straight line l 1,1 A distance of
Figure BDA0003015293220000442
To a straight line l 1,3 A distance of
Figure BDA0003015293220000443
If it is
Figure BDA0003015293220000444
And order
Figure BDA0003015293220000445
If it is
Figure BDA0003015293220000446
Then order
Figure BDA0003015293220000447
Assigning i +1 to i, and when i is more than 6, continuing to execute the next step 21; otherwise, returning to execute the step b 20.3;
case 3, if Cr 1 i [0][0]≠-1,Cr 1 i [0][1]≠-1,Cr 1 i [1][0]==-1,Cr 1 i [1][1]1, note coordinate point (Cr) 1 i [0][0],Cr 1 i [0][1]) To a straight line l 1,1 A distance of
Figure BDA0003015293220000448
To a straight line l 1,3 A distance of
Figure BDA0003015293220000449
If it is
Figure BDA00030152932200004410
Then order
Figure BDA00030152932200004411
If it is
Figure BDA00030152932200004412
Order to
Figure BDA00030152932200004413
Assigning i +1 to i, and when i > 6 is satisfied, continuing to execute the next step b 21; otherwise, returning to execute the step b 20.3;
case 4, if Cr 1 i [0][0]≠-1,Cr 1 i [0][1]≠-1,Cr 1 i [1][0]≠-1,Cr 1 i [1][1]Not equal to-1, then order
Figure BDA00030152932200004414
Assigning i +1 to i, and when i > 6 is satisfied, continuing to execute the next step b 21; otherwise, returning to execute the step b 20.3;
in a specific embodiment, the step can comprise:
(1)Cr 1 5 [0][0]==-1,Cr 1 5 [0][1]==-1,Cr 1 5 [1][0]==-1,Cr 1 5 [1][1]when being equal to-1, then
Figure BDA00030152932200004415
(2)Cr 1 6 [0][0]==-1,Cr 1 6 [0][1]==-1,Cr 1 6 [1][0]==-1,Cr 1 6 [1][1]When the value is-1, then
Figure BDA00030152932200004416
Step b21.1, the centroid pixel coordinate value obtained by the above steps b20.1, b20.2 and b20.3 is (900,246) 1 The coded values of all the coded mark circles in the parallelogram coding unit can be obtained by the formula (26) according to the unit binary image E without complex background of the 1 st unit 1 The center of mass pixel coordinate is a value (900,246) 1 The coding number W of the parallelogram coding unit on the coding plane target placed in the actual space corresponding to the parallelogram coding unit 1
W 1 =V 1 T ·U=10 (26)
Wherein, the column vector U is (2) 0 ,2 1 ,2 2 ,...2 11 ) T Column vector V 1 =(0,1,0,1,0,0,0,0,0,0,0,0) T
In this embodiment, the centroid coordinate of the target image can be calculated as (900,246) 1 The coding number W of the parallelogram coding unit on the coding plane target placed in the actual space corresponding to the parallelogram coding unit 1 =10;
Step b21.2, according to the obtained barycentric coordinates (900,246) 1 Code number W of parallelogram coding unit 1 10, the matching method of the coding plane target and the calibration corner point is utilized to judge the coordinates of the mass center as (900,246) 1 The number of the coding plane target to which the parallelogram coding unit belongs in the actual space corresponding to the parallelogram coding unit is as follows:
W 1 =10∈[0,17]i.e. W 1 Falling within the parallelogram coding unit number range of the No. 5 coding plane target, namely the centroid coordinate is (900,246) 1 The parallelogram coding unit in the practical space corresponding to the parallelogram coding unit belongs to No. 5 coding plane target, and the barycentric coordinate is (900,246) 1 The calibration corner points on the parallelogram coding unit also belong to a No. 5 coding plane target;
step b22, recording the 1 st unit binary image E without complex background 1 The upper centroid pixel coordinate value is (900,246) 1 The non-unique code number of the calibration corner point belonging to the sigma-th coding region (where sigma is 1,3,4,6) in the parallelogram coding unit of (a) is L 10 σ Wherein the lower foot mark 10 is a calibration corner point L 10 σ The coding number of the parallelogram coding unit, the value of the upper corner mark sigma represents the calibration corner point L 10 σ The sigma-th coding region; that is, the coordinates of the centroid pixel are obtained (900,246) 1 4 calibration angular points C on the parallelogram coding unit 1,1 (934.6,219.3)、C 1,2 (931.2,249.1)、C 1,3 (868.3,274.8)、C 1,4 (870.8,214.8) the non-unique code numbers are each
Figure BDA0003015293220000451
Figure BDA0003015293220000452
(where σ 1,1 =1,σ 1,2 =3,σ 1,3 =4,σ 1,4 =6);
Obtaining the 1 st unit binary image E without complex background 1 The coordinate value of the upper centroid pixel is (900,246) 1 On the basis of the non-unique code serial numbers of the 4 calibration angular points of the parallelogram coding unit, the unique code serial numbers of the 4 calibration angular points can be calculated through the steps b23.1 to b 23.4;
step b23.1, taking delta' ζ,1 _σ′ ζ,1 、Δ′ ζ,2 _σ′ ζ,2 、Δ′ ζ,3 _σ′ ζ,3 、Δ′ ζ,4 _σ′ ζ,4 Respectively used for storing the coordinate value of the centroid pixel as (x) ζ ,y ζ ) ζ 4 calibration angular points C on the parallelogram coding unit ζ,1 (x ζ,1 ,y ζ,1 )、C ζ,2 (x ζ,2 ,y ζ,2 )、C ζ,3 (x ζ,3 ,y ζ,3 )、C ζ,4 (x ζ,4 ,y ζ,4 ) Is unique code number of, wherein' ζ,1 、Δ′ ζ,2 、Δ′ ζ,3 、Δ′ ζ,4 、σ′ ζ,1 、σ′ ζ,2 、σ′ ζ,3 、σ′ ζ,4 Are all positive integers;
step b23.2, taking an integer variable i and re-assigning the value of i to 1;
step b23.3, judging whether N is an even number, if N is an odd number, executing step b 23.4; if N is an even number, taking an integer parameter delta and assigning the integer parameter delta to be N/2, and calibrating the angular point C 1,i (x 1,i ,y 1,i ) Non-unique coded serial number of
Figure BDA0003015293220000453
This step b23.3 can be divided into the following cases:
case 1, if σ 1,i 1 or σ 1,i When W is equal to 6, the product is put in 1 Value of to delta' 1,i Will σ 1,i Value of to σ' 1,i Then calibrating the corner point C 1,i (x 1,i ,y 1,i ) Is delta 'as the unique code number' 1,i _σ′ 1,i
Case 2, if σ 1,i (W) 3 ═ 3 1 Value of- Δ) to Δ' 1,i Assigning 6 to σ' 1,i Then calibrating the corner point C 1,i (x 1,i ,y 1,i ) Is delta 'as the unique code number' 1,i _6;
Case 3, if σ 1,i (W) is 4 ═ 4 1 Value of-Delta-1) to Delta' 1,i Assigning 1 to σ' 1,i Then calibrating the corner point C 1,i (x 1,i ,y 1,i ) Is delta 'as the unique code number' 1,i _1;
Judging whether i is less than 4, if i is less than 4, assigning i +1 to i, and returning to the step b23.3 for sequential execution; otherwise, executing step b 24.1;
step b23.4, taking the integer parameter delta, assigning the value delta to be (N +1)/2, and calibrating the corner point C 1,i (x 1,i ,y 1,i ) Non-unique code number of
Figure BDA0003015293220000465
This step b23.4 can be divided into the following cases:
case 1, if σ 1,i 1 or σ 1,i When the sum is 6, W ζ Value of to' ζ,i Will σ ζ,i Value of to σ' ζ,i Then demarcateCorner point C 1,i (x 1,i ,y 1,i ) Is delta 'as the unique code number' 1,i _σ′ 1,i
Case 2, if σ 1,i When the value is 3, the following two cases are divided into:
(1) when phi is p When the value is 1, (W) is 1 Value of- Δ) to Δ' 1,i Assigning 6 to σ' 1,i Then calibrating the corner point C 1,i (x 1,i ,y 1,i ) Is delta 'as the unique code number' 1,i A _6; delta' can be derived from the formula (27),
Figure BDA0003015293220000461
wherein Δ ″ ═ 2 (W) 1 -z v ) V (N +1) +1 (integers only retained);
(2) when phi is p When being equal to 2, (W) is 1 Value of- Δ '") to Δ' 1,i Assigning 6 to σ' 1,i Then calibrating the corner point C 1,i (x 1,i ,y 1,i ) Is delta 'as the unique code number' 1,i _σ′ 1,i (ii) a Δ' "can be derived from equation (28),
Figure BDA0003015293220000462
wherein Δ ″ -2 (W) ζ -z v +1)/(N +1) +1 (integers only retained);
case 3, if σ ζ,i The following two cases are divided into two cases:
(1) when phi is p When equal to 1, (W) is 1 Value of- Δ) to Δ' 1,i Assigning 1 to σ' 1,i Then calibrating the corner point C 1,i (x 1,i ,y 1,i ) Is delta 'as the unique code number' 1,i _σ′ 1,i Wherein Δ' can be derived from formula (29);
Figure BDA0003015293220000463
wherein Δ ″ ═ 2 (W) 1 -z v ) V (N +1) +1 (integers only retained);
(2) when phi is p When being equal to 2, (W) is 1 Value of- Δ '") to Δ' 1,i Assigning 1 to σ' 1,i Then calibrating the corner point C 1,i (x 1,i ,y 1,i ) Is delta 'as the unique code number' 1,i _σ′ 1,i The Δ' "can be derived from equation (30),
Figure BDA0003015293220000464
wherein Δ ″ -2 (W) 1 -z v +1)/(N +1) +1 (integers only retained);
judging whether i is less than 4, if i is less than 4, assigning i +1 to i, and returning to the step b23.4 for sequential execution; otherwise, executing step b 24.1;
in this embodiment, if N is an odd number, then the integer parameter Δ is taken and assigned with Δ (N +1)/2 is 3, and the corner point C is calibrated 1,i (x 1,i ,y 1,i ) Non-unique code number of
Figure BDA0003015293220000471
This step b23.3 can be classified as follows:
case 1, if σ 1,i 1 or σ 1,i To 6, assign 10 to Δ' 1,i Will σ 1,i Value of to σ' 1,i Then calibrating the corner point C 1,i (x 1,i ,y 1,i ) Is 10_ σ' 1,i
Case 2, if σ 1,i To 3,4 is assigned to Δ' 1,i Assigning 6 to σ' 1,i Then calibrating the corner point C 1,i (x 1,i ,y 1,i ) The unique code number of (2) is 7_ 6;
case 3, if σ 1,i 4, assign 3 to Δ' 1,i Assigning 1 to σ' 1,i Then calibrating the corner point C 1,i (x 1,i ,y 1,i ) Is/are as followsThe unique code serial number is 6_ 1;
and finally, the conclusion is drawn that: calibrating angular point C 1,1 (934.6,219.3) the corresponding unique code serial number is 10_1, and the corner point C is calibrated 1,2 (931.2,249.1) the corresponding unique code serial number is 7_6, and the corner point C is calibrated 1,3 (868.3,274.8) the corresponding unique code serial number is 6_1, and the corner point C is calibrated 1,4 (870.8,214.8) the corresponding unique code number is 10_ 6;
step b24.1, taking an integer variable i and reassigning i to 1;
step b24.2, judging whether N is an even number, if N is an odd number, executing step b 24.3; if N is an even number, the procedure is divided into the following cases:
case 1, if Δ' 1,i _σ′ 1,i Of σ' 1,i 1 ═ 1; then the unique code number is delta' 1,i _σ′ 1,i The target coordinates corresponding to the calibration corner points are as follows:
Figure BDA0003015293220000472
wherein when
Figure BDA0003015293220000473
When taken from + when
Figure BDA0003015293220000474
Taking-;
case 2, if Δ' 1,i _σ′ 1,i Sigma 'of (1)' 1,i 6; then the unique code number is delta' 1,i _σ′ 1,i The target coordinates corresponding to the calibration corner points are as follows:
Figure BDA0003015293220000475
wherein when
Figure BDA0003015293220000476
When taken from + when
Figure BDA0003015293220000477
Taking-;
in the present step b24.2,
Figure BDA0003015293220000478
(the result retains only integer bits);
when the temperature is higher than the set temperature
Figure BDA0003015293220000479
In the case of an odd number of the groups,
Figure BDA00030152932200004710
when in use
Figure BDA00030152932200004711
In the case of an even number, the number of the first,
Figure BDA00030152932200004712
after the execution of the step is finished, directly executing a step b 24.4;
step b24.3, the step is divided into the following two cases:
case 1, if Δ' 1,i _σ′ 1,i Sigma 'of (1)' 1,i 1 ═ 1; then the unique code number is delta' 1,i _σ′ 1,i The target coordinates corresponding to the calibration corner points are as follows:
Figure BDA0003015293220000481
wherein when
Figure BDA0003015293220000482
When taken, when
Figure BDA0003015293220000483
Taking-;
case 2, if Δ' 1,i _σ′ 1,i Of σ' 1,i 6; then the unique code number is delta' 1,i _σ′ 1,i The calibration corner points of (a) are corresponding to the target coordinates as follows:
Figure BDA0003015293220000484
wherein when
Figure BDA0003015293220000485
When taken, when
Figure BDA0003015293220000486
Taking-;
in this step 24.3
Figure BDA0003015293220000487
(the result retains only integer bits);
when in use
Figure BDA0003015293220000488
In the case of an odd number of the groups,
Figure BDA0003015293220000489
when the temperature is higher than the set temperature
Figure BDA00030152932200004810
In the case of an even number, the number of the bits is,
Figure BDA00030152932200004811
the basic information for coding the coding plane target No. 5 on the stereo target in this embodiment is: n ═ 5 is an odd number, λ ═ 90 °, and the present step is classified as follows:
case 1, if Δ' 1,i _σ′ 1,i Sigma 'of (1)' 1,i 1 ═ 1; then the unique code number is delta' 1,i _σ′ 1,i The target coordinates corresponding to the calibration corner points are as follows: (13.5. rho.) 10 ,13.5δ 10 ,0);
Case 2, if Δ' 1,i _σ′ 1,i Of σ' 1,i 6; then the unique code number is delta' 1,i _σ′ 1,i The target coordinates corresponding to the calibration corner points are as follows: (13.5 (. rho.)) 10 -1),13.5δ 10 ,0);
δ 10 =2(Δ′ ζ,i -0)/(5+1) (as a result only integer bits are retained);
when delta 10 When it is odd, ρ 10 =[Δ′ 1,i -0-δ 10 ·(5+1)/2]·2Φ p When ═ 2;
when delta 10 When it is even, ρ 10 =[Δ′ ζ,i -0-δ 10 ·(5+1)/2]·2+1Φ p When ═ 2;
step b24.4, judging whether i is smaller than 4, if i is smaller than 4, assigning i +1 to i and returning to the step b24.2 for sequential execution; if i is not less than 4, a < delta > is obtained' 1,1 _σ′ 1,1 Number calibrating corner point, delta' 1,2 _σ′ 1,2 Number calibrating corner point, delta' 1,3 _σ′ 1,3 Number calibrating corner point and delta' 1,4 _σ′ 1,4 The numbers mark the target coordinates of the corner points and are respectively marked as (X) 1,1 ,Y 1,1 ,0)、(X 1,2 ,Y 1,2 ,0)、(X 1,3 ,Y 1,3 ,0)、(X 1,4 ,Y 1,4 ,0);
In this embodiment:
Figure BDA0003015293220000491
that is, in the right camera target image shot at the 3 rd time, the one-to-one correspondence relationship between the sub-pixel coordinates of the 4 calibration corner points of the parallelogram coding unit with the coding number of 10 on the No. 5 coding plane target, the unique coding serial number of the calibration focus and the target coordinates in the No. 5 target coordinate system is finally obtained:
calibrating angular point C 1,1 (934.6,219.3) the corresponding unique code number is 10_1, and the target coordinate is (27,40.5, 0);
calibrating angular point C 1,2 (931.2,249.1) the corresponding unique code number is 7_6, and the target coordinate is (27,27, 0);
calibrating angular point C 1,3 (868.3,274.8) the corresponding unique code number is 6_1, and the target coordinate is (13.5,27, 0);
calibrating angular point C 1,4 (870.8,214.8) the corresponding unique code number is 10_6, and the target coordinate is (13.5,40.5, 0);
step b25, assign ζ +1 to ζ, and then return to step b7.1 to execute the sequence.
The invention provides a method for quickly calibrating internal and external parameters of a binocular camera based on a coded three-dimensional target, which needs to compile a corresponding computer program and execute the program 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 rapid calibration method based on coding stereo targets is used for collecting calibration images of a binocular camera, the coding stereo targets and two cameras are oppositely arranged in space, the positions of the two cameras are fixed, the coding stereo targets are composed of a reference plate and a plurality of coding plane targets connected on the reference plate, the spatial positions and postures of the reference plate and the coding plane targets can be independently adjusted, the reference plate of the coding stereo targets is divided into S areas, each area is provided with one coding plane target, S is an integer and is more than 3, all the coding plane targets are provided with numbers, the numbers of the coding plane targets are different, the spatial postures of any two coding plane targets have obvious difference, and each coding plane target is provided with a plurality of parallelogram coding units, the coding numbers of the parallelogram coding units are different from each other, the coding numbers of all the parallelogram coding units on the same coding plane target have continuity, a coding pattern is arranged in each parallelogram coding unit in the coding plane target, 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 patterns are used for coding each calibration corner point in the coding plane target, and the number and the distribution of the coding unit patterns are determined by the number of the parallelogram coding unit where the coding unit patterns are located;
at any one number as alpha τ On the coding plane target, arbitrarily taking a parallelogram coding unit in the coding plane target to be marked as the coding plane target vector determination coding unit
Figure RE-FDA0003739852930000011
Determining coding unit by taking the coding plane target vector
Figure RE-FDA0003739852930000012
One vertex of (2) is marked as a first vertex of the vector determination coding unit
Figure RE-FDA0003739852930000013
Determining a coding unit in the coding plane target vector
Figure RE-FDA0003739852930000014
Wherein the intersection is formed into a vector to determine the first vertex of the coding unit
Figure RE-FDA0003739852930000015
Any one edge of the vector determination coding unit is taken as a first edge of the vector determination coding unit
Figure RE-FDA0003739852930000016
Determining a first edge of a coding unit in a vector
Figure RE-FDA0003739852930000017
Upward orientation amount determination encoding unit
Figure RE-FDA0003739852930000018
Is recorded as a first point on a first side of the vector determination coding unit
Figure RE-FDA0003739852930000019
Wherein the vector determines a first point on a first edge of the coding unit
Figure RE-FDA00037398529300000110
Determining a first vertex of a coding unit by using the vector
Figure RE-FDA00037398529300000111
Are 2 points which are not overlapped with each other, and the vector is recorded
Figure RE-FDA00037398529300000112
Specifying vectors for the encoded planar target
Figure RE-FDA00037398529300000113
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 prescribed vector of the coding plane target
Figure RE-FDA00037398529300000114
Is in the same direction, and is characterized in that: the binocular camera calibration method for coding the three-dimensional target mainly comprises the following steps:
step 1, defining a left camera calibration target number threshold G 1 Right camera calibrating target number threshold G 2 Calibrating the angular point number threshold k 1 Coding plane target number threshold k 2 Outside, inParameter calibration target number threshold G 3 Public calibration angular point number threshold k 3 Number threshold G of external parameter optimization targets 4 Wherein, G 1 、G 2 、G 3 、G 4 、k 1 、k 2 、k 3 Are all integers and G 1 >3,G 2 >3,G 3 >1,1≤G 4 ≤G 3 ,k 1 >4,k 2 >3,k 3 >1;
Step 2, recording images obtained by simultaneously shooting the coding three-dimensional target in primary space by the left camera and the right camera as a left camera target image and a right camera target image respectively, and establishing a left camera target image calibration corner point pixel coordinate system o l -x l y l And the right camera target image calibration corner point pixel coordinate system o r -x r y r
Step 3, establishing a camera coordinate system of the left camera and a camera coordinate system of the right camera;
step 4, simultaneously shooting a coded three-dimensional target placed in a primary space by using two cameras with fixed relative positions and absolute positions in the space and a public view field, and respectively obtaining a left camera target image shot for the tau time and a right camera target image shot for the tau time;
step 5, recording alpha on the coded stereo target at the tau-th movement position in the space τ The number of calibration corner points in 4 vertexes of the 1 st line of the 1 st parallelogram coding unit on the number coding plane target is
Figure RE-FDA0003739852930000021
According to
Figure RE-FDA0003739852930000022
Magnitude of the value, establishing a corresponding alpha τ Number target coordinate system
Figure RE-FDA0003739852930000023
α τ Is an integer and alpha τ ∈[1,S];
Step 6, using the tau-time shot left/right camera target image as an input condition, and obtaining the number of the coding plane targets in the tau-time shot left/right camera target image by using a coding stereo target decoding method
Figure RE-FDA0003739852930000024
The number of each coding plane target in the left and right camera target images shot at the Tth time, the number of calibration corner points extracted from each coding plane target in the left and right camera target images shot at the Tth time and the pixel coordinate system o of each calibration corner point in the calibration corner points of the left and right camera target images l -x l y l /o r -x r y r The sub-pixel coordinates of the target image, the unique code serial number of the calibration corner point extracted from each code plane target in the Tth shot left/right camera target image, and the calibration corner point extracted from each code plane target in the Tth shot left/right camera target image in the left/right camera target image calibration corner point pixel coordinate system o l -x l y l /o r -x r y r The matching relation between the sub-pixel coordinates and the target coordinates of the calibration corner points which correspond to one of the sub-pixel coordinates and have the same unique code serial number on the spatial coding three-dimensional target in the corresponding target coordinate system, wherein
Figure RE-FDA0003739852930000025
Is an integer and
Figure RE-FDA0003739852930000026
step 7, if
Figure RE-FDA0003739852930000027
And is provided with
Figure RE-FDA0003739852930000028
The obtained left camera target image shot for the Tth time is displayed
Figure RE-FDA0003739852930000029
The numbers of the coding plane targets are arranged from small to big and respectively marked as
Figure RE-FDA00037398529300000210
Wherein
Figure RE-FDA00037398529300000211
Are all integers; and numbering the tau-th shot left camera target image as
Figure RE-FDA00037398529300000212
The coding plane targets are respectively marked as the 1 st, 2 nd, 3 rd coding plane targets, … and the third coding plane target in the left camera target image shot at the Tth time
Figure RE-FDA00037398529300000213
A coded planar target;
the obtained right camera target image shot at the Tth time is
Figure RE-FDA00037398529300000214
The numbers of the coding plane targets are arranged from small to big and respectively marked as
Figure RE-FDA00037398529300000215
Wherein
Figure RE-FDA00037398529300000216
Are all integers; and numbering the tau-th shot right camera target image as
Figure RE-FDA00037398529300000217
Respectively recording the coding plane target as the 1 st coding plane target and the 2 nd coding plane target in the right camera target image shot for the Tth timeCode plane target, 3 rd encoding plane target, … th
Figure RE-FDA0003739852930000031
A coded planar target;
step 8, counting the number beta of the coding planes meeting the calibration corner point threshold in the left camera target image and the right camera target image τ,1 And beta τ,2
Step 9, if beta τ,1 ≥G 1 And beta is τ,2 ≥G 2 Beta is obtained on the left camera target image shot at the tau time τ,1 The calibration targets meeting the calibration conditions are obtained on the Tth right camera target image τ,2 A calibration target satisfying the calibration condition, and beta τ,1 Left camera calibration matching set and beta τ,2 Calibrating a matching group by the right cameras;
step 10, searching the number beta of the coding plane targets with the same target labels in the left camera calibration target set and the right camera calibration target set τ,3 In the left camera target image shot at the t-th time, beta is obtained in total τ,3 Individual external reference calibration target and beta τ,3 A matching group for calibrating external parameters of the left camera is obtained by sharing beta in the target image of the right camera shot at the Tth time τ,3 External reference calibration target and beta τ,3 The external parameters of the right cameras are calibrated and matched with the right cameras;
step 11, if beta τ,3 ≥G 3 Defining an integer variable beta τ,4 And assign a value of beta τ,4 0, taking an integer variable i τ And assign value i τ =1;
Step 12, according to the ith shot of the Tth time τ Matching group for calibrating external parameters of left camera and ith shooting τ The matching group is calibrated by external parameters of the right camera, and the ith camera target image shot at the Tth time is counted τ The ith parameter is marked on the target and the Tth shot right camera target image is marked on the ith parameter τ The number of the homonymous calibration angular points with the same unique coding serial number of the calibration angular points on the external reference calibration target
Figure RE-FDA0003739852930000032
Step 13, if
Figure RE-FDA0003739852930000033
Will beta τ,4 +1 value to β τ,4 The ith in the left camera target image shot at the Tth time τ The beta th in the left camera target image shot by the tau th external reference calibration target τ,4 Optimizing the target by the external parameters, and shooting the ith shot in the Tth time τ A left camera external parameter calibration matching group is used as the beta-th shooting time τ,4 The ith camera target image shot for the Tth time is subjected to the ith camera target image shooting by the left camera external parameter optimization matching group τ Taking the individual external reference calibration target as the beta-th image in the target image of the right camera shot at the tau-th time τ,4 Optimizing the target by the external parameters, and shooting the ith shot in the Tth time τ The matching group for calibrating external parameters of the right camera is taken as the beta-th shot τ,4 The external parameter optimizing matching group of the right camera;
step 14, if beta τ,4 ≥G 4 Then, beta in the target image of the left camera shot at the Tth time is obtained τ,4 Beta of Tth shooting of individual external parameter optimization target τ,4 Matching group for external parameter optimization of left camera and beta in Tth shot right camera target image τ,4 Beta of Tth shooting of individual external parameter optimization target τ,4 The external parameter optimization matching group of the right camera;
step 15, according to the acquired beta of the Tth shooting τ,1 Left camera calibration matching set and beta τ,2 The right camera calibration matching group calculates the internal parameters and distortion coefficients of the left and right cameras by using the monocular camera internal and external parameter calibration algorithm, and respectively converts the left camera coordinate system to the rotation matrix of each numbered target coordinate system on the coding stereo target in the space
Figure RE-FDA0003739852930000034
And translation vector
Figure RE-FDA0003739852930000035
Rotation matrix for respectively transforming coordinate system of right camera to coordinate system of each numbered target on coded three-dimensional target in space
Figure RE-FDA0003739852930000036
Figure RE-FDA0003739852930000041
And translation vector
Figure RE-FDA0003739852930000042
Step 16, rotating the matrix
Figure RE-FDA0003739852930000043
And translation vector
Figure RE-FDA0003739852930000044
In the method, a rotation matrix of a left camera coordinate system transformed to each numbered target coordinate system of an external reference calibration target is searched
Figure RE-FDA0003739852930000045
Figure RE-FDA0003739852930000046
And translation vector
Figure RE-FDA0003739852930000047
In a rotation matrix
Figure RE-FDA0003739852930000048
And translation vector
Figure RE-FDA0003739852930000049
In the middle, the coordinate system of the right camera is searched and respectively transformed to each numbered target of the external reference calibration targetRotation matrix of coordinate system
Figure RE-FDA00037398529300000410
Figure RE-FDA00037398529300000411
And translation vector
Figure RE-FDA00037398529300000412
Step 17, utilizing the rotation matrix
Figure RE-FDA00037398529300000413
And translation vector
Figure RE-FDA00037398529300000414
And a rotation matrix
Figure RE-FDA00037398529300000415
And translation vector
Figure RE-FDA00037398529300000416
Solving the rotation and translation relation between the left camera coordinate system and the right camera coordinate system according to the equations (1) and (2):
Figure RE-FDA00037398529300000417
Figure RE-FDA00037398529300000418
wherein i τ =1,2...,β τ,3
Step 18, calculating the initial values of the rotation matrix R and the translation vector T transformed from the left camera coordinate system to the right camera coordinate system by formula (3):
Figure RE-FDA00037398529300000419
wherein i τ =1,2...,β τ,3
And step 19, calculating accurate values R 'and T' of external parameters of the binocular camera by using an optimization method based on standard length according to 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.
2. The method for rapidly calibrating the internal and external parameters of the binocular camera based on the coded stereo target according to claim 1, wherein the method comprises the following steps: the method also comprises a coding stereo target adjusting step: and (4) adjusting the space pose of the reference plate of the coding stereo target to ensure that the visual field of the left camera, the visual field of the right camera and the common visual field of the left camera and the right camera comprise more coding plane targets and calibration angular points, assigning tau +1 to tau, and then returning to the step 4 to execute the sequence.
3. The method for rapidly calibrating the internal and external parameters of the binocular camera based on the coded stereo target according to claim 1, wherein the method comprises the following steps: in step 8, the number beta of the coding planes meeting the calibration corner point threshold in the left and right camera target images τ,1 And beta τ,2 The method comprises the following specific steps:
step 8.1, define integer variable i τ 、β τ,1 、β τ,2 And assign value i τ =1、β τ,1 =0、β τ,2 =0;
Step 8.2, if
Figure RE-FDA0003739852930000051
Then step 8.4 is executed; otherwise, executing step 8.3;
step 8.3, the ith camera target image shot for the Tth time is subjected to the shooting τ The number of the calibration angular points extracted from the target of each coding plane is recorded as
Figure RE-FDA0003739852930000052
And judging:
if it is
Figure RE-FDA0003739852930000053
Then beta will be τ,1 +1 value to β τ,1 The ith time in the target image of the left camera shot at the Tth time τ Marking the coded plane target as the beta-th image in the left camera target image shot for the tau time τ,1 Marking the target, and shooting the ith time in the target image of the left camera shot for the Tth time τ Numbering of individual coded planar targets
Figure RE-FDA0003739852930000054
Assigning to the beta th image in the target image of the left camera shot at the tau th time τ,1 Number of individual calibration targets
Figure RE-FDA0003739852930000055
The ith in the target image of the left camera τ Calibration corner points extracted from a coding plane target are in a left camera target image calibration corner point pixel coordinate system o l -x l y l The lower sub-pixel coordinate and the calibration corner point which is corresponding to one sub-pixel coordinate and has the same unique coding serial number on the spatial coding stereo target are arranged on
Figure RE-FDA0003739852930000056
The matching relation between the target coordinates in the number target coordinate system is recorded as the beta-th shooting of the tau-th time τ,1 Calibrating a matching group by using the left cameras; if it is
Figure RE-FDA0003739852930000057
Step 8.4 is directly executed;
step 8.4, if
Figure RE-FDA0003739852930000058
Step 8.6 is executed; otherwise, executing step 8.5;
step 8.5, the ith camera target image in the right camera target image is processed τ The number of the calibration angular points extracted from the target of the coding plane is recorded as
Figure RE-FDA0003739852930000059
And judging:
if it is
Figure RE-FDA00037398529300000510
Then beta will be τ,2 +1 to β τ,2 The ith in the Tth shot right camera target image τ Marking the coded plane target as the beta th time in the target image of the right camera shot for the tau time τ,2 Marking the target, and shooting the ith in the target image of the right camera shot for the Tth time τ Numbering of individual coded planar targets
Figure RE-FDA00037398529300000511
Assigning to the beta-th image of the target image of the right camera shot at the tau-th time τ,2 Number of individual calibration targets
Figure RE-FDA00037398529300000512
The ith camera target image shot at the Tth time is subjected to the motion estimation τ Calibration corner points extracted from coding plane target on right camera target image calibration corner point pixel coordinate system o r -x r y r The lower sub-pixel coordinate and the calibration corner point which is corresponding to one sub-pixel coordinate and has the same unique coding serial number on the spatial coding stereo target are positioned in mu r,i The matching relation between the target coordinates in the number target coordinate system is recorded as the beta-th shooting of the tau-th time τ,2 Calibrating a matching group by the right cameras; if it is
Figure RE-FDA00037398529300000513
Step 8.6 is directly executed;
step 8.6, if
Figure RE-FDA00037398529300000514
Or
Figure RE-FDA00037398529300000515
Then i will be τ +1 to i τ And step 8.2 to step 8.5 are executed in a post-circulation mode until
Figure RE-FDA00037398529300000516
And is provided with
Figure RE-FDA00037398529300000517
4. The method for rapidly calibrating the internal and external parameters of the binocular camera based on the coded stereo target according to claim 1, wherein the method comprises the following steps: step 10, searching the number beta of the coding plane targets with the same target labels in the left camera calibration target set and the right camera calibration target set τ,3 The specific method comprises the following steps:
step 10.1, let integer variable i τ And assign value i τ 1; defining an integer variable j τ Defining an integer variable beta τ,3 And assign beta τ,3 =0;
Step 10.2, let integer variable j τ And assign a value j τ =1;
Step 10.3, judging the ith in the Tth shot left camera target image τ Number of individual calibration targets
Figure RE-FDA0003739852930000061
Whether it is equal to jth in the right camera target image shot at the Tth time τ Number of individual calibration targets
Figure RE-FDA0003739852930000062
If it is
Figure RE-FDA0003739852930000063
Then beta will be τ,3 +1 value to β τ,3 Will beIth in Tth shot left camera target image τ The beta th calibration target is taken as the beta th image in the target image of the left camera shot for the tau th time τ,3 Calibrating the target with the external reference, and shooting the ith time in the target image of the left camera shot for the τ time τ Number of individual calibration targets
Figure RE-FDA0003739852930000064
Assigning to the beta th image in the target image of the left camera shot at the tau th time τ,3 Numbering of individual external reference calibration targets
Figure RE-FDA0003739852930000065
I-th shot of the t-th time τ A left camera calibration matching group is used as the beta th shot of the tau τ,3 The external parameters of the left camera are calibrated to form a matching group; j in the right camera target image shot at the tau time τ Taking a calibration target as the beta-th time in the target image of the right camera shot at the tau-th time τ,3 Calibrating targets with external parameters, and shooting the jth image of the right camera target for the jth time τ Number of individual calibration targets
Figure RE-FDA0003739852930000066
Assigning to the beta th image in the target image of the right camera shot at the tau th time τ,3 Numbering of individual external reference calibration targets
Figure RE-FDA0003739852930000067
J of the t-th shot τ The right camera calibration matching group is used as the beta-th shot of the tau-th time τ,3 The external parameters of the right camera are calibrated to form a matching group, and then the step 10.5 is executed; otherwise, directly executing the step 10.4;
step 10.4, judge j τ Whether or not less than beta τ,2 If j is τ <β τ,2 Then j will be τ +1 assignment to j τ Step 10.3 is executed in a post-loop until j τ ≥β τ,2 (ii) a Otherwise, executing step 10.5;
step 10.5, judge i τ Whether or not less than beta τ,1 If i τ <β τ,1 Then i will be τ +1 value to i τ And step 10.2 to step 10.4 are executed in a post-loop manner until i τ ≥β τ,1
5. The method for rapidly calibrating the internal and external parameters of the binocular camera based on the coded stereo target according to claim 1, wherein the method comprises the following steps: in step 5, if α is τ If < S, then alpha will be τ +1 to α τ Then returning to the step 5 for cyclic execution until alpha τ =S;
6. The method for rapidly calibrating the internal and external parameters of the binocular camera based on the coded stereo target according to claim 2, wherein the method comprises the following steps: in step 7, if
Figure RE-FDA0003739852930000068
Or
Figure RE-FDA0003739852930000069
Executing the encoding stereo target adjusting step until
Figure RE-FDA00037398529300000610
And is
Figure RE-FDA00037398529300000611
7. The method for rapidly calibrating the internal and external parameters of the binocular camera based on the coded stereo target according to claim 2, wherein the method comprises the following steps: in step 9, if is τ,1 <G 1 Or beta τ,2 <G 2 Then executing the coding stereo target regulation step until beta τ,1 ≥G 1 And beta is τ,2 ≥G 2
8. The method for rapidly calibrating the internal and external parameters of a binocular camera based on coded stereo targets of claim 2, wherein the method is characterized in thatThe method comprises the following steps: in step 11, if beta τ,3 <G 3 Then executing the coding stereo target regulation step until beta τ,3 ≥G 3
9. The method for rapidly calibrating the internal and external parameters of a binocular camera based on a coded stereo target according to claim 2, wherein the method comprises the following steps: in step 14, if beta τ,4 <G 4 Then executing the coding stereo target regulation step until beta τ,4 ≥G 4
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 executable by a processor to perform the method for fast calibration of the intra-ocular parameters of a binocular camera based on encoded stereoscopic targets of claim 1.
CN202110386595.9A 2020-12-23 2021-04-12 Rapid calibration method for internal and external parameters of binocular camera based on coded three-dimensional target Active CN113112548B (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011540944X 2020-12-23
CN202011540944 2020-12-23

Publications (2)

Publication Number Publication Date
CN113112548A CN113112548A (en) 2021-07-13
CN113112548B true CN113112548B (en) 2022-08-19

Family

ID=76715491

Family Applications (2)

Application Number Title Priority Date Filing Date
CN202110386671.6A Active CN113112549B (en) 2020-12-23 2021-04-12 Monocular camera rapid calibration method based on coding stereo target
CN202110386595.9A Active CN113112548B (en) 2020-12-23 2021-04-12 Rapid calibration method for internal and external parameters of binocular camera based on coded three-dimensional target

Family Applications Before (1)

Application Number Title Priority Date Filing Date
CN202110386671.6A Active CN113112549B (en) 2020-12-23 2021-04-12 Monocular camera rapid calibration method based on coding stereo target

Country Status (1)

Country Link
CN (2) CN113112549B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103247053A (en) * 2013-05-16 2013-08-14 大连理工大学 Accurate part positioning method based on binocular microscopy stereo vision
CN104867160A (en) * 2015-06-17 2015-08-26 合肥工业大学 Directional calibration target for camera inner and outer parameter calibration
CN104933717A (en) * 2015-06-17 2015-09-23 合肥工业大学 Camera intrinsic and extrinsic parameter automatic calibration method based on directional calibration target
CN106548477A (en) * 2017-01-24 2017-03-29 长沙全度影像科技有限公司 A kind of multichannel fisheye camera caliberating device and method based on stereo calibration target
CN106600648A (en) * 2016-12-06 2017-04-26 合肥工业大学 Stereo coding target for calibrating internal parameter and distortion coefficient of camera and calibration method thereof
CN106846415A (en) * 2017-01-24 2017-06-13 长沙全度影像科技有限公司 A kind of multichannel fisheye camera binocular calibration device and method
CN109598762A (en) * 2018-11-26 2019-04-09 江苏科技大学 A kind of high-precision binocular camera scaling method

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009042162A (en) * 2007-08-10 2009-02-26 Toshiba Corp Calibration device and method therefor
CN101699223B (en) * 2009-10-27 2011-06-15 北京控制工程研究所 Calibration device of binocular vision navigation system of lunar surface vehicle
FR3051591B1 (en) * 2016-05-17 2020-06-19 Horiba Jobin Yvon Sas MICRO-LOCATION DEVICE AND METHOD FOR IMAGING INSTRUMENT AND MEASURING APPARATUS
CN109215082B (en) * 2017-06-30 2021-06-22 杭州海康威视数字技术股份有限公司 Camera parameter calibration method, device, equipment and system
CN111562791A (en) * 2019-03-22 2020-08-21 沈阳上博智像科技有限公司 System and method for identifying visual auxiliary landing of unmanned aerial vehicle cooperative target
CN111709999A (en) * 2020-05-13 2020-09-25 深圳奥比中光科技有限公司 Calibration plate, camera calibration method and device, electronic equipment and camera system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103247053A (en) * 2013-05-16 2013-08-14 大连理工大学 Accurate part positioning method based on binocular microscopy stereo vision
CN104867160A (en) * 2015-06-17 2015-08-26 合肥工业大学 Directional calibration target for camera inner and outer parameter calibration
CN104933717A (en) * 2015-06-17 2015-09-23 合肥工业大学 Camera intrinsic and extrinsic parameter automatic calibration method based on directional calibration target
CN106600648A (en) * 2016-12-06 2017-04-26 合肥工业大学 Stereo coding target for calibrating internal parameter and distortion coefficient of camera and calibration method thereof
CN106548477A (en) * 2017-01-24 2017-03-29 长沙全度影像科技有限公司 A kind of multichannel fisheye camera caliberating device and method based on stereo calibration target
CN106846415A (en) * 2017-01-24 2017-06-13 长沙全度影像科技有限公司 A kind of multichannel fisheye camera binocular calibration device and method
CN109598762A (en) * 2018-11-26 2019-04-09 江苏科技大学 A kind of high-precision binocular camera scaling method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Deltille Grids for Geometric Camera Calibration;Hyowon Ha等;《2017 IEEE International Conference on Computer Vision》;20171225;第5354-5362页 *
双目立体视觉自定位线扫描三维测量技术;殷玉龙;《中国优秀硕士学位论文全文数据库信息科技辑》;20160615;第I138-1260页 *

Also Published As

Publication number Publication date
CN113112548A (en) 2021-07-13
CN113112549B (en) 2022-08-23
CN113112549A (en) 2021-07-13

Similar Documents

Publication Publication Date Title
CN113129385B (en) Binocular camera internal and external parameter calibration method based on multi-coding plane target in space
JP4785880B2 (en) System and method for 3D object recognition
CN109859226B (en) Detection method of checkerboard corner sub-pixels for graph segmentation
CN111981982B (en) Multi-directional cooperative target optical measurement method based on weighted SFM algorithm
CN112465912B (en) Stereo camera calibration method and device
CN112132907B (en) Camera calibration method and device, electronic equipment and storage medium
CN113129386B (en) Intelligent calibration method for internal and external parameters of binocular camera based on coding plane target
CN109373912A (en) A kind of non-contact six-freedom displacement measurement method based on binocular vision
CN113096191B (en) Intelligent calibration method for monocular camera based on coding plane target
CN116129037B (en) Visual touch sensor, three-dimensional reconstruction method, system, equipment and storage medium thereof
CN113160329B (en) Coding plane target for camera calibration and decoding method thereof
CN113129397B (en) Decoding method of parallelogram coding mark based on graphic geometric relation
CN112929626A (en) Three-dimensional information extraction method based on smartphone image
CN115147499A (en) Calibration parameter determination method, hybrid calibration plate, device, equipment and medium
CN113963067B (en) Calibration method for calibrating large-view-field visual sensor by using small target
CN112270716B (en) Decoding and positioning method for artificial visual landmarks
CN113112548B (en) Rapid calibration method for internal and external parameters of binocular camera based on coded three-dimensional target
CN109064536A (en) A kind of page three-dimensional rebuilding method based on binocular structure light
CN113012271A (en) Finger three-dimensional model texture mapping method based on UV (ultraviolet) mapping
CN109829951B (en) Parallel equipotential detection method and device and automatic driving system
CN113112550B (en) Coding plane target for calibrating internal and external parameters of camera and coding method thereof
CN113129396B (en) Decoding method of parallelogram coding mark based on region segmentation
CN114299172B (en) Planar coding target for visual system and real-time pose measurement method thereof
Ni et al. A fully automatic registration approach based on contour and SIFT for HJ-1 images
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
CB03 Change of inventor or designer information

Inventor after: Yin Yulong

Inventor after: Zhu Huabing

Inventor after: Yang Pei

Inventor after: Yang Zhaohui

Inventor before: Zhu Huabing

Inventor before: Yin Yulong

Inventor before: Yang Pei

Inventor before: Yang Zhaohui

CB03 Change of inventor or designer information
GR01 Patent grant
GR01 Patent grant