# US 2022/0046218 A1 · Disparity image stitching and visualization method based on multiple pairs of binocular cameras

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2022/0046218 A1
- Document ID: US20220046218A1
- Status: Published application
- Kind: A1
- Application number: 17/283,119
- Filed: 2020-03-05
- Published: 2022-02-10
- Earliest claimed: 2019-12-17
- Assignees: Dalian University of Technology
- Applicants: Dalian University of Technology
- Inventors: Xin FAN; Risheng LIU; Zhuoxiao LI; Wei ZHONG; Zhongxuan LUO
- Web page: https://patentgrep.com/patent/US20220046218A1

## CPC

- G06T 7/593: from stereo images
- H04N 13/156: Mixing image signals
- G06T 7/11: Region-based segmentation
- G06T 7/85: {Stereo camera calibration}
- H04N 13/15: for colour aspects of image signals
- H04N 13/239: using two two-dimensional [2D] image sensors having a relative position equal to or related to the interocular distance (H04N13/243 takes precedence)
- H04N 13/243: using three or more two-dimensional [2D] image sensors
- H04N 13/246: Calibration of cameras
- G06T 2200/32: involving image mosaicing
- G06T 2207/10012: Stereo images
- G06T 2207/10024: Color image
- G06T 2207/20021: Dividing image into blocks, subimages or windows
- G06T 2207/20221: Image fusion; Image merging
- G06T: IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- H04N: PICTORIAL COMMUNICATION, e.g. TELEVISION

## Abstract

The present invention discloses a disparity image stitching and visualization method based on multiple pairs of binocular cameras. A calibration algorithm is used to solve the positional relationship between binocular cameras, and the prior information is used to solve a homography matrix between images; internal parameters and external parameters of the cameras are used to perform camera coordinate system transformation of depth images; the graph cut algorithm has high time complexity and depends on the number of nodes in a graph; the present invention divides the images into layers, and solutions are obtained layer by layer and iterated; then the homography matrix is used to perform image coordinate system transformation of the depth images, and a stitching seam is synthesized to realize seamless panoramic depth image stitching; and finally, depth information of a disparity image is superimposed on a visible light image.

## Claims

### Claim 1

A disparity image stitching and visualization method based on multiple pairs of binocular cameras, comprising the following steps:
step 1): calibrating internal parameters and external parameters of each binocular camera; the internal parameters K include a focal length focus and optical center coordinates Cx, Cy; the external parameters include a rotation matrix R and a translation vector T; obtaining a baseline length baseline of each binocular camera by calibration; and obtaining visible light images and disparity images of two binocular cameras;
step 2): calculating homography matrix: calculating a homography matrix H according to the internal parameters and external parameters of each binocular camera, the placement angle between the cameras, and a scene plane distance d; and the value range of d is 8-15 m;
step 3): using the internal parameters of the binocular cameras and the external parameters between the binocular cameras obtained in step 1) and step 2) to perform camera coordinate system transformation of the disparity images;
step 4): building overlapping area model: using the homography matrix H between images obtained in step 2) to calculate an overlapping area ROI of images, and modeling the overlapping area;
step 5): dividing each image into blocks with a size of B1*B2, taking the divided blocks as nodes of a graph, performing graph cut to find a local optimal solution, then continuing to divide each node corresponding to an optimal stitching line corresponding to B1*B2 until a final block size is equal to a pixel value, and finally and approximately finding a global optimal solution by finding the local optimal solution each time;
step 6): using the homography matrix H to perform image coordinate system transformation of the disparity images; seamlessly stitching the optimal stitching line in step 5); when the number of binocular cameras is greater than two, repeating steps 3)-6) to obtain disparity images with a larger field angle; and
step 7): adding the stitched disparity information to the visible light images.

### Claim 2 (depends on 1)

The disparity image stitching and visualization method based on multiple pairs of binocular cameras according to claim 1, wherein the specific steps of calculating homography matrix described in step 2) are as follows:
2-1) imaging a plane in a scene by two binocular cameras, and assuming that the unit normal vector of the plane in the coordinate system of the first binocular camera is N, and the distance from the plane to the center of the first binocular camera (i.e., the scene plane distance) is d, then the plane π is expressed as:
NT=C1=d (1)
wherein C1 is the three-dimensional coordinate of a three-dimensional point P in the coordinate system of the first binocular camera, and the coordinate of the three-dimensional point P in the coordinate system of the second binocular camera is C2, then the relationship between C1 and C2 is:
C2=RC1+T (2)
formula (2) is further expressed as:
C
2
=
RC
1
+
T
⁢
1
d
⁢
N
T
⁢
C
1
=
(
R
+
T
⁢
1
d
⁢
N
T
)
⁢
C
1
=
H
′
⁢
C
1
(
3
)
wherein R and T are respectively a rotation vector and a translation vector from the first binocular camera to the second binocular camera;
2-2) transforming C1 and C2 in step 2-1) from the internal parameters of the cameras into the image coordinate system:
c1=K1C1 (4)
c2=K2C2 (5)
it can be obtained from formulas (3), (4) and (5) that:
c
2
=
K
1
⁡
(
R
+
T
⁢
1
d
⁢
N
T
)
⁢
K
2
-
1
⁢
c
1
=
K
1
⁢
H
′
⁢
K
2
-
1
⁢
c
1
(
6
)
finally, a calculation formula of the homography matrix calculated by the internal parameters and the external parameters is obtained:
H
=
K
1
⁢
H
′
⁢
K
2
-
1
=
K
1
⁡
(
R
+
T
⁢
1
d
⁢
N
T
)
⁢
K
2
-
1
(
7
)
H
=
[
a
1
⁢
1
a
1
⁢
2
a
1
⁢
3
a
2
⁢
1
a
2
⁢
2
a
2
⁢
3
a
31
a
3
⁢
2
a
3
⁢
3
]
(
8
)
wherein c1 is a corresponding coordinate of C1 in the coordinate system of an imaging plane, and c2 is a corresponding coordinate of C2 in the coordinate system of the imaging plane; K1 is the internal parameters of the first binocular camera; K2 is the internal parameters of the second binocular camera; and the finally obtained transformation matrix H is a 3*3 matrix, and a11-a33 represent specific values.

### Claim 3 (depends on 1)

A disparity image stitching and visualization method based on multiple pairs of binocular cameras according to claim 1, wherein the specific steps of step 3) are as follows:
3-1) using the internal parameters K1 (i.e., the baseline length baseline1 and the focal length focus1) of the first binocular camera to restore the disparity images to a point cloud in the coordinate system of the first binocular camera, and the calculation formulas of the three-dimensional coordinates C1 (X1, Y1, Z1) of the point cloud are as follows:
Z
1
=
baseline
1
*
focus
1
disparity
1
(
9
)
X
1
=
(
x
1
-
C
x
)
*
baseline
1
disparity
1
(
10
)
Y
1
=
(
y
1
-
C
y
)
*
focus
1
disparity
1
(
11
)
wherein x1 and y1 are the pixel coordinates of the first binocular camera; disparity is a disparity value;
3-2) using the external parameters R and T from the first binocular camera to the second binocular camera to transform the camera coordinate system of the point cloud and obtain the three-dimensional coordinates of the point cloud in the coordinate system of the second binocular camera; and the coordinate transformation formula is as follows:
(
X
2
Y
2
Z
2
)
=
R
⁡
(
X
1
Y
1
Z
1
)
+
T
(
12
)
3-3) using the internal parameters K2 (i.e., the baseline length baseline2 and the focal length focus2) of the second binocular camera to restore the point cloud to the disparity images, at this time, only Z2 is needed to calculate the disparity value in the coordinate system of the second binocular camera, and the calculation formula is as follows:
disparity
2
=
baseline
2
*
focus
2
Z
2
.
(
13
)

### Claim 4 (depends on 1)

The disparity image stitching and visualization method based on multiple pairs of binocular cameras according to claim 1, wherein the specific steps of building overlapping area model described in step 4) are as follows:
4-1) for the pixels of two images in the overlapping area, calculating the second norm of the RGB pixels corresponding to the overlapping area of the two images, and building t-links; the calculation formulas of the second norm are as follows:
e(p,q)=∥p—p′∥+∥q−q′∥ (14)
∥p−p′∥=(Rp−Rp′)2+(Gp−Gp′)2+(Bp−Bp′)2 (15)
∥q−q′∥=(Rq−Rq′)2+(Gq−Gq′)2+(Bq−Bq′)2 (16)
wherein e(⋅) is a weight function, p is a source image, q is a target image, p is the pixel value of one point in the image p, p′ is the pixel value of a p adjacent point, q is the pixel value of one point in the target image, q′ is the pixel value of a q adjacent point, Rp is the value of R channel at p point, Rp′ is the value of R channel at p′ point, Gp is the value of G channel at p point, Gp′ is the value of G channel at p′ point,; is the value of B channel at p point, Bp′ is the value of B channel at p′ point, Rq is the value of R channel at q point, Rq′ is the value of R channel at q′ point, Gq is the value of G channel at q point, Gq′ is the value of G channel at q′ point, Bq is the value of B channel at q point, and Bq′ is the value of B channel at q′ point;
4-2) finding the optimal stitching line for the built model, and solving the stitching seam by graph cut; an energy function is defined as:
E(f)=Σp,q∈NSp,q(lp,lq)+Σp∈pDp(lp) (17)
wherein Sp,q is a smoothing term representing the cost of assigning a pair of pixels (p, q) in the overlapping area to (lp,lq), lp is a label assigned to the pixel p, lq is a label assigned to the pixel q, and DP is a data term representing the cost of marking the pixel p in the overlapping area as lp.

### Claim 5 (depends on 3)

The disparity image stitching and visualization method based on multiple pairs of binocular cameras according to claim 3, wherein the specific steps of building overlapping area model described in step 4) are as follows:
4-1) for the pixels of two images in the overlapping area, calculating the second norm of the RGB pixels corresponding to the overlapping area of the two images, and building t-links; the calculation formulas of the second norm are as follows:
e(p,q)=∥p—p′∥+∥q−q′∥ (14)
∥p−p′∥=(Rp−Rp′)2+(Gp−Gp′)2+(Bp−Bp′)2 (15)
∥q−q′∥=(Rq−Rq′)2+(Gq−Gq′)2+(Bq−Bq′)2 (16)
wherein e(⋅) is a weight function, p is a source image, q is a target image, p is the pixel value of one point in the image p, p′ is the pixel value of a p adjacent point, q is the pixel value of one point in the target image, q′ is the pixel value of a q adjacent point, Rp is the value of R channel at p point, Rp′ is the value of R channel at p′ point, Gp is the value of G channel at p point, Gp′ is the value of G channel at p′ point, Bp is the value of B channel at p point, Bp′ is the value of B channel at p′ point, Rq is the value of R channel at q point, Rq′ is the value of R channel at q′ point, Gq is the value of G channel at q point, Gq′ is the value of G channel at q′ point, Bq is the value of B channel at q point, and Bq′ is the value of B channel at q′ point;
4-2) finding the optimal stitching line for the built model, and solving the stitching seam by graph cut; an energy function is defined as:
E(f)=Σp,q∈NSp,q(lp,lq)+Σp∈PDp(lp) (17)
wherein Sp,q is a smoothing term representing the cost of assigning a pair of pixels (p, q) in the overlapping area to (lp,lq), lp is a label assigned to the pixel p, lq is a label assigned to the pixel q, and Dp is a data term representing the cost of marking the pixel p in the overlapping area as lp.

### Claim 6 (depends on 1)

The disparity image stitching and visualization method based on multiple pairs of binocular cameras according to claim 1, wherein the specific steps of disparity image stitching described in step 6) are as follows:
6-1) transforming the disparity image of the first binocular camera into the image coordinate system of the second binocular camera:
W
⁡
(
x
2
y
2
1
)
=
H
⁡
(
x
1
y
1
1
)
(
18
)
wherein x1 and y1 are the coordinates in the image coordinate system of the first binocular camera; x2 and y2 are the coordinates in the image coordinate system of the second binocular camera; and w is a normalization coefficient;
6-2) stitching image: comparing the positions of the first binocular image after image coordinate system transformation and the second binocular image corresponding to an optimal stitching seam, and merging two visible light images and two disparity images respectively.

### Claim 7 (depends on 3)

The disparity image stitching and visualization method based on multiple pairs of binocular cameras according to claim 3, wherein the specific steps of disparity image stitching described in step 6) are as follows:
6-1) transforming the disparity image of the first binocular camera into the image coordinate system of the second binocular camera:
W
⁡
(
x
2
y
2
1
)
=
H
⁡
(
x
1
y
1
1
)
(
18
)
wherein x1 and y1 are the coordinates in the image coordinate system of the first binocular camera; x2 and y2 are the coordinates in the image coordinate system of the second binocular camera; and w is a normalization coefficient;
6-2) stitching image: comparing the positions of the first binocular image after image coordinate system transformation and the second binocular image corresponding to an optimal stitching seam, and merging two visible light images and two disparity images respectively.

### Claim 8 (depends on 4)

The disparity image stitching and visualization method based on multiple pairs of binocular cameras according to claim 4, wherein the specific steps of disparity image stitching described in step 6) are as follows:
6-1) transforming the disparity image of the first binocular camera into the image coordinate system of the second binocular camera:
W
⁡
(
x
2
y
2
1
)
=
H
⁡
(
x
1
y
1
1
)
(
18
)
wherein x1 and y1 are the coordinates in the image coordinate system of the first binocular camera; x2 and y2 are the coordinates in the image coordinate system of the second binocular camera; and w is a normalization coefficient;
6-2) stitching image: comparing the positions of the first binocular image after image coordinate system transformation and the second binocular image corresponding to an optimal stitching seam, and merging two visible light images and two disparity images respectively.

### Claim 9 (depends on 1)

The disparity image stitching and visualization method based on multiple pairs of binocular cameras according to claim 1, wherein the specific steps of step 7) are as follows:
7-1) converting the disparity images to color images, replacing disparity information with color information, and using different colors to represent different depths;
7-2) superimposing and fusing the color images obtained from the disparity images and the visible light images, and the superposition method is a weighted average method:
Fused image=k*visible light image+(1−k)*color image (19)
wherein k is a weight coefficient.

### Claim 10 (depends on 6)

The disparity image stitching and visualization method based on multiple pairs of binocular cameras according to claim 6, wherein the specific steps of step 7) are as follows:
7-1) converting the disparity images to color images, replacing disparity information with color information, and using different colors to represent different depths;
7-2) superimposing and fusing the color images obtained from the disparity images and the visible light images, and the superposition method is a weighted average method:
Fused image=k*visible light image+(1−k)*color image (19)
wherein k is a weight coefficient.
