# Target Image Matching Algorithm Based on Binocular CCD Ranging

Authors: Dongming Li; Wei Su; Jinhua Yang; Lijuan Zhang
Journal: Abstract and Applied Analysis
 (2014)

---

## Abstract

This paper proposed target image in a subpixel level matching algorithm for binocular CCD ranging, which is based on the principle of binocular CCD ranging. In the paper, firstly, we introduced the ranging principle of the binocular ranging system and deduced a binocular parallax formula. Secondly, we deduced the algorithm which was named improved cross-correlation matching algorithm and cubic surface fitting algorithm for target images matched, and it could achieve a subpixel level matching for binocular CCD ranging images. Lastly, through experiment we have analyzed and verified the actual CCD ranging images, then analyzed the errors of the experimental results and corrected the formula of calculating system errors. Experimental results showed that the actual measurement accuracy of a target within 3 km was higher than 0.52%, which meet the accuracy requirements of the high precision binocular ranging.


---

## Body

## 1. Introduction

Binocular CCD ranging is an optical distance measuring method, which imitates human beings’ distance perception using their eyes to obtain the image of the target object. It is a passive ranging in which the high precision ranging over a long distance can be achieved under natural conditions without sending out any signal to the target object. Binocular CCD ranging is characterized by concealment, which is especially suitable for military equipment ranging, aerial target ranging, and occasions needed to be kept secret and restricted by environment in industrial applications.Image matching, the most core and key technique in binocular CCD ranging, has always been the research hotspot and difficulty for many experts and scholars. Many countries in the world have used weapons with image matching guidance technology, and the earliest one of the weapons is the cruise missile, which has very high concealment. The image matching technology aims to improve the guidance precision of long-range tactical, strategic missile and cruise missile so that the guidance precision is not limited by range distance. Due to the fact that the completion of target matching needs a wide range of image search and that the aircraft inertial navigation system has unstable errors, the matching speed and reliability become the key to matching positioning technology. Therefore, the research for image matching algorithm becomes the key to achieve good performance of guidance. Image matching is proposed by the United States when it was engaged in researches such as the terminal guidance of the projection system and auxiliary aircraft navigation systems in the 1970s and then slowly won the support and funding of the US army. With the rapid development of science and technology, the application of the image matching technology has gradually expanded from purely military purposes to medical image analysis, remote sensing image processing, machine vision, industrial control, and other fields. Therefore, the research for image matching technology has its important theoretical value and application prospect.The so-called image matching is to find one or more mapping transformation in the changing space of the image and register in the space two or more images of the same target scene, under conditions of different time periods, sensors, and perspectives or recognize its corresponding mode in another target image based on the known target schema. In binocular CCD ranging system, the stereo matching of image is the key link, which determines the main precision of the whole system measurement.Here is an outline of the paper. In Section2, the target images are first acquired through the design of binocular CCD ranging system. The target features are extracted and more appropriate regions to the feature region size are chosen to match in Section 3. Section 3 intends to describe how to the subpixel level matching of the target images in conducted by adopting the improved cross-correlation algorithm and three-surface fitting method. To demonstrate the efficiency and reliability of the method, some numerical test examples with comparisons are given in Section 4. Section 5 concludes the paper.


## 2. The Principle of Binocular CCD Ranging

The principle of binocular CCD ranging is based on the binocular parallax, which is to determine the pixel coordinates position of the same target images on the right and the left images and then calculate their pixel difference, also called binocular parallax, so as to obtain the target distance based on binocular CCD ranging model. Figure1 is the schematics of binocular CCD ranging. The baseline distance which is a distance that connect the two cameras’ projection center, expressed as B [1, 2].Figure 1
Schematics of binocular CCD ranging.When TargetA passes by the binocular ranging system formed by cameras on the right and left with two paralleled optical axes, the imaging, respectively, lies on the surface of the left CCD as Point A
1 and the right CCD as Point A
2. Its locations on the two focal planes are x
Left and x
Right. Since the focal lengths of both cameras are f, according to the principle of similar triangle, the measured distance l can be deduced as [3]
(1)
l
=
B
f
x
x
=
x
Left
+
x
Right
,
where x is the position difference of the images that A’s images on the surface of the left CCD and the right one, also known as binocular parallax. It can be seen that under the ideal state that optical axis of binocular camera is strictly paralleled and the target object images are obtained as well, and through the image matching algorithm, the relevant position of the same target in CCD image is determined and the binocular parallax x can be calculated. The focal length and baseline size having been known, the target distance l can be concluded according to formula (1).Binocular CCD ranging system is to use the principle of binocular stereo vision to realize the target image matching by imaging of the same target on different positions through different locations around the camera image on the right and the left. Image matching results directly affect the distance measurement results of binocular CCD ranging system, so as to ensure the accuracy of image matching is the key to the high precision binocular CCD ranging.


## 3. High Precision Image Matching

### 3.1. Fast Matching of Pixel Level

This paper adopts left and right CCD camera model, with the parameters maintaining consistency, the optical axis remaining basically paralleled, the binocular camera coordinate systems keeping in coplanar, and the axis being arranged in parallel. Therefore, the size and proportion of image acquired synchronously are in agreement, and the gray information of images can be less affected by noise. Therefore, the image matching algorithm based on template matching gray cross-correlation is adopted, which is most suitable for binocular CCD ranging system. Its principle is shown in Figure2.Template and search image.
(a)
Search graphS
(b)
Template graphTIn Figure2, graph S is N
x
*
N
y, graph T is M
x
*
M
y. When matching, template image traverses each pixel in the reference map for search. The search subgraph S
i
,
j, with the same size as template graph, has coordinate in the top-left (i, j), and the value ranges of i and j are 0
≤
i
,
j
≤
N
-
M, respectively. Comparing the similarity of the gray value of each pixel in T and S
i
,
j, if S
i
,
j is in accordance with T, then they are phase matching.This paper uses the normalized cross-correlation matching algorithm to compare the similarity ofS
i
,
j and T. The expression of cross-correlation function is
(2)
N
(
i
,
j
)
=
(
∫
∑
m
=
1
M
∑
n
=
1
N
(
T
(
m
,
n
)
-
T
(
m
,
n
)
¯
)
×
(
S
i
,
j
(
m
,
n
)
-
S
i
,
j
(
m
,
n
)
¯
)
∫
∑
m
=
1
M
∑
n
=
1
N
(
T
(
m
,
n
)
-
T
(
m
,
n
)
¯
)
∫
)
×
(
∑
m
=
1
M
∑
n
=
1
N
[
T
(
m
,
n
)
-
T
(
m
,
n
)
¯
]
2
h
h
h
h
h
×
∑
m
=
1
M
∑
n
=
1
N
[
S
i
,
j
(
m
,
n
)
-
S
i
,
j
(
m
,
n
)
¯
]
2
)
-
1
/
2
,
T
(
m
,
n
)
¯
=
1
M
×
N
∑
m
=
1
M
∑
n
=
1
N
T
(
m
,
n
)
,
S
i
,
j
(
m
,
n
)
¯
=
1
M
×
N
∑
m
=
1
M
∑
n
=
1
N
S
i
,
j
(
m
,
n
)
,
where T
(
m
,
n
) is the template image and its size is M
×
N. T
(
m
,
n
)
¯ is the average value of all the gray scales of pixels in T
(
m
,
n
). On the reference image, the search area of the image using (
i
,
j
) as the top-left pixels is S
i
,
j
(
m
,
n
). S
i
,
j
(
m
,
n
)
¯ is the average value of all the gray scales of pixels in the search image. Image matching is to match the pixel at top-left corner of the template on the target image area. The values range of cross-correlation function N
(
i
,
j
) is 0
≤
N
(
i
,
j
)
≤
1, and its value is determined by the matching degree of search image region and template image using (
i
,
j
) as the pixel at top-left corner. Due to the image difference, it is often impossible to get the pixel whose value of cross-correlation function is 1, while the greater the cross-correlation value of the pixel is, the higher the matching degree of the pixel will be. Therefore, the most matching pixel is the one with the biggest value of cross-correlation function [3].In order to achieve the fast matching of images and improve the processing speed of the algorithm, fast image matching method described in [4] is used. The down sampling of image is made first and then the target image area is roughly matched with the reduced image size. After finding the rough matching point by using cross-correlation function, the matching point is restored to the corresponding position in the original image. The restored pixel location of the point is considered as the center for the accurate pixel matching point, which will be found by continuous cross-correlation operations in its surrounding pixels. Thus, it greatly reduces the amount of data of cross-correlation operation, saves the matching time, and realizes the accurate image matching pixel level.


### 3.2. Description of the Fast Matching Algorithm

The steps of improved fast matching algorithm are the following.The first step is to extract the target area of the matching image. When the target image was captured by using binocular CCD camera of binocular ranging system, complete target image matching area “前” appeared on the left and right images. The extraction of target image area is conducted to the target image “前” on the left CCD image and that area is used as a template, preparing for finding out the matching area of the corresponding target image “前” on the CCD image. The actual size of the captured image is about 1300 × 1024 pixels. In order to obtain the complete target image, the template size of the matching target image is 200 × 200 pixels.As shown in Figure3, (a) is the image of left CCD camera and (b) is the target area extracted from the left CCD image as the template matching on the right image. The purpose is to find in the right CCD image the upper left corner matching point on the matching template area “前” extracted from the left CCD, the area of target image to be matched image.Figure 3
Extraction of the target image to be matched.The second step is to downsample the right CCD image to be matched and target area template image extracted from the left CCD image. According to the principle of bilinear interpolation [5–7], 4 times downsample processing is taken to the template image and the right CCD image simultaneously. In Figure 4, (a) is the target template image extracted from the left CCD image and its size is 200 × 200 pixels; (c) is 800 × 600 pixels image, captured with the right CCD camera; (b) is the target template image after being downsampled four times which is lessened into a 50 × 50 pixels; (d) is the right image after being downsampled four times and reduced to 200 × 150 pixels.Downsampling of the target template image and the original left image.
(a)
Target template image of the left one
(b)
The 4 times sampling of Figure (a)
(c)
The right CCD image
(d)
The 4 times sampling of Figure (c)The third step is to do rough matching operation on the right CCD image and the template image after being downsampled. As shown in Figure4, the cross-correlation template matching operation is done between the target template image after being downsampled as (b) and the right image (d). Figure 4(b) can be used as the template to do the template search on (d), making cross-correlation operation for each pixel and finding the coordinate of cross-correlation peaks of the correlation function values (m
0, n
0), which is the rough matching point of the upper left corner of the image coordinates of the target template.The fourth step is to restore the rough matching point to its original image and select the appropriate area to search the pixel matching point. The rough matching point coordinates are (m
0, n
0), which is found in the right image after downsampling in the previous step. When it is restored to its original size of the image, the matching point in the picture should be on the area with pixels coordinates (4m
0, 4
n
0). Then the search of the exact matching point should be made on the appropriate area of the original size CCD image size of 160
×
80 pixels which is cut out of the central point (4m
0, 4
n
0). The area selected can be neither too small nor too big, for it is very easy to exclude the precise matching if it is too small and increase the amount of calculation data if it is too big.The fifth step is to use the original target template image extracted from the left CCD image to do the cross-correlation matching operation on160
×
80 pixel area extracted from the right CCD image in the previous step and determine its correlation peak coordinates so that the precise matching point coordinates in the right CCD image of the target template image extracted from the left CCD image can be found.By implementing these methods of fast matching images, it not only reduces the amount of data calculation and avoids the template matching operation of all pixels on the big size image, but also uses the method of performing the rough matching firstly and then locating precisely to find the relevant peak coordinates of the relevant cross-correlation function distribution and completing the pixel-level matching image.


### 3.3. The Subpixel Level Image Matching of CCD Ranging Image

The accuracy of image matching is the key to achieving the precision distance measuring of the binocular CCD ranging system [8]. Therefore, the accuracy of the image pixel level cannot meet the requirements of the binocular CCD ranging system. In this sense, this paper aims to realize the subpixel level matching of the target image.In this paper, three-surface fitting method [9] is adopted to fit the subpixel level coordinates of the correlation peaks. The cross-correlation peak pixel coordinates of the distribution of the correlation function is taken as a central point; the pixel points around the area of 20
×
20 pixels are selected to fit the fitting points three times; then they are taken into the cross-correlation function with the binary representation of a cubic polynomial. The formula is just as follows:
(3)
N
(
i
,
j
)
=
∑
k
=
0
3
∑
n
=
0
k
a
k
j
x
j
y
k
-
j
.Horizontal and vertical coordinates of about21
×
21
=
441 pixels around the correlation peak and its surrounding can be brought to the binary cubic polynomial, using the least squares method [10] to obtain the expression of the coefficient a
k
j and get the complete expression of binary cubic fitting function. The following diagram in Figure 5 is the three-surface fitting. Using the expression of the binary cubic polynomial, the maximum value of the cubic surface fitting function can be figured out, which is the fitting matching subpixel coordinates and the target image subpixel level matching is completed.Figure 5
The result of three-surface fitting.


## 3.1. Fast Matching of Pixel Level

This paper adopts left and right CCD camera model, with the parameters maintaining consistency, the optical axis remaining basically paralleled, the binocular camera coordinate systems keeping in coplanar, and the axis being arranged in parallel. Therefore, the size and proportion of image acquired synchronously are in agreement, and the gray information of images can be less affected by noise. Therefore, the image matching algorithm based on template matching gray cross-correlation is adopted, which is most suitable for binocular CCD ranging system. Its principle is shown in Figure2.Template and search image.
(a)
Search graphS
(b)
Template graphTIn Figure2, graph S is N
x
*
N
y, graph T is M
x
*
M
y. When matching, template image traverses each pixel in the reference map for search. The search subgraph S
i
,
j, with the same size as template graph, has coordinate in the top-left (i, j), and the value ranges of i and j are 0
≤
i
,
j
≤
N
-
M, respectively. Comparing the similarity of the gray value of each pixel in T and S
i
,
j, if S
i
,
j is in accordance with T, then they are phase matching.This paper uses the normalized cross-correlation matching algorithm to compare the similarity ofS
i
,
j and T. The expression of cross-correlation function is
(2)
N
(
i
,
j
)
=
(
∫
∑
m
=
1
M
∑
n
=
1
N
(
T
(
m
,
n
)
-
T
(
m
,
n
)
¯
)
×
(
S
i
,
j
(
m
,
n
)
-
S
i
,
j
(
m
,
n
)
¯
)
∫
∑
m
=
1
M
∑
n
=
1
N
(
T
(
m
,
n
)
-
T
(
m
,
n
)
¯
)
∫
)
×
(
∑
m
=
1
M
∑
n
=
1
N
[
T
(
m
,
n
)
-
T
(
m
,
n
)
¯
]
2
h
h
h
h
h
×
∑
m
=
1
M
∑
n
=
1
N
[
S
i
,
j
(
m
,
n
)
-
S
i
,
j
(
m
,
n
)
¯
]
2
)
-
1
/
2
,
T
(
m
,
n
)
¯
=
1
M
×
N
∑
m
=
1
M
∑
n
=
1
N
T
(
m
,
n
)
,
S
i
,
j
(
m
,
n
)
¯
=
1
M
×
N
∑
m
=
1
M
∑
n
=
1
N
S
i
,
j
(
m
,
n
)
,
where T
(
m
,
n
) is the template image and its size is M
×
N. T
(
m
,
n
)
¯ is the average value of all the gray scales of pixels in T
(
m
,
n
). On the reference image, the search area of the image using (
i
,
j
) as the top-left pixels is S
i
,
j
(
m
,
n
). S
i
,
j
(
m
,
n
)
¯ is the average value of all the gray scales of pixels in the search image. Image matching is to match the pixel at top-left corner of the template on the target image area. The values range of cross-correlation function N
(
i
,
j
) is 0
≤
N
(
i
,
j
)
≤
1, and its value is determined by the matching degree of search image region and template image using (
i
,
j
) as the pixel at top-left corner. Due to the image difference, it is often impossible to get the pixel whose value of cross-correlation function is 1, while the greater the cross-correlation value of the pixel is, the higher the matching degree of the pixel will be. Therefore, the most matching pixel is the one with the biggest value of cross-correlation function [3].In order to achieve the fast matching of images and improve the processing speed of the algorithm, fast image matching method described in [4] is used. The down sampling of image is made first and then the target image area is roughly matched with the reduced image size. After finding the rough matching point by using cross-correlation function, the matching point is restored to the corresponding position in the original image. The restored pixel location of the point is considered as the center for the accurate pixel matching point, which will be found by continuous cross-correlation operations in its surrounding pixels. Thus, it greatly reduces the amount of data of cross-correlation operation, saves the matching time, and realizes the accurate image matching pixel level.


## 3.2. Description of the Fast Matching Algorithm

The steps of improved fast matching algorithm are the following.The first step is to extract the target area of the matching image. When the target image was captured by using binocular CCD camera of binocular ranging system, complete target image matching area “前” appeared on the left and right images. The extraction of target image area is conducted to the target image “前” on the left CCD image and that area is used as a template, preparing for finding out the matching area of the corresponding target image “前” on the CCD image. The actual size of the captured image is about 1300 × 1024 pixels. In order to obtain the complete target image, the template size of the matching target image is 200 × 200 pixels.As shown in Figure3, (a) is the image of left CCD camera and (b) is the target area extracted from the left CCD image as the template matching on the right image. The purpose is to find in the right CCD image the upper left corner matching point on the matching template area “前” extracted from the left CCD, the area of target image to be matched image.Figure 3
Extraction of the target image to be matched.The second step is to downsample the right CCD image to be matched and target area template image extracted from the left CCD image. According to the principle of bilinear interpolation [5–7], 4 times downsample processing is taken to the template image and the right CCD image simultaneously. In Figure 4, (a) is the target template image extracted from the left CCD image and its size is 200 × 200 pixels; (c) is 800 × 600 pixels image, captured with the right CCD camera; (b) is the target template image after being downsampled four times which is lessened into a 50 × 50 pixels; (d) is the right image after being downsampled four times and reduced to 200 × 150 pixels.Downsampling of the target template image and the original left image.
(a)
Target template image of the left one
(b)
The 4 times sampling of Figure (a)
(c)
The right CCD image
(d)
The 4 times sampling of Figure (c)The third step is to do rough matching operation on the right CCD image and the template image after being downsampled. As shown in Figure4, the cross-correlation template matching operation is done between the target template image after being downsampled as (b) and the right image (d). Figure 4(b) can be used as the template to do the template search on (d), making cross-correlation operation for each pixel and finding the coordinate of cross-correlation peaks of the correlation function values (m
0, n
0), which is the rough matching point of the upper left corner of the image coordinates of the target template.The fourth step is to restore the rough matching point to its original image and select the appropriate area to search the pixel matching point. The rough matching point coordinates are (m
0, n
0), which is found in the right image after downsampling in the previous step. When it is restored to its original size of the image, the matching point in the picture should be on the area with pixels coordinates (4m
0, 4
n
0). Then the search of the exact matching point should be made on the appropriate area of the original size CCD image size of 160
×
80 pixels which is cut out of the central point (4m
0, 4
n
0). The area selected can be neither too small nor too big, for it is very easy to exclude the precise matching if it is too small and increase the amount of calculation data if it is too big.The fifth step is to use the original target template image extracted from the left CCD image to do the cross-correlation matching operation on160
×
80 pixel area extracted from the right CCD image in the previous step and determine its correlation peak coordinates so that the precise matching point coordinates in the right CCD image of the target template image extracted from the left CCD image can be found.By implementing these methods of fast matching images, it not only reduces the amount of data calculation and avoids the template matching operation of all pixels on the big size image, but also uses the method of performing the rough matching firstly and then locating precisely to find the relevant peak coordinates of the relevant cross-correlation function distribution and completing the pixel-level matching image.


## 3.3. The Subpixel Level Image Matching of CCD Ranging Image

The accuracy of image matching is the key to achieving the precision distance measuring of the binocular CCD ranging system [8]. Therefore, the accuracy of the image pixel level cannot meet the requirements of the binocular CCD ranging system. In this sense, this paper aims to realize the subpixel level matching of the target image.In this paper, three-surface fitting method [9] is adopted to fit the subpixel level coordinates of the correlation peaks. The cross-correlation peak pixel coordinates of the distribution of the correlation function is taken as a central point; the pixel points around the area of 20
×
20 pixels are selected to fit the fitting points three times; then they are taken into the cross-correlation function with the binary representation of a cubic polynomial. The formula is just as follows:
(3)
N
(
i
,
j
)
=
∑
k
=
0
3
∑
n
=
0
k
a
k
j
x
j
y
k
-
j
.Horizontal and vertical coordinates of about21
×
21
=
441 pixels around the correlation peak and its surrounding can be brought to the binary cubic polynomial, using the least squares method [10] to obtain the expression of the coefficient a
k
j and get the complete expression of binary cubic fitting function. The following diagram in Figure 5 is the three-surface fitting. Using the expression of the binary cubic polynomial, the maximum value of the cubic surface fitting function can be figured out, which is the fitting matching subpixel coordinates and the target image subpixel level matching is completed.Figure 5
The result of three-surface fitting.


## 4. Experimental Results and Analysis of Image Matching

### 4.1. Experimental Results of Binocular CCD Ranging Experiment

The experiment adopts the CCD camera of OK-AC1300 model with a resolution of1300
×
1024 pixels, two pixels size of 4.65 μm, and working output 8 bitRGB image and chooses the German deterrence Walimex500 mm F8-32 telephoto fixed focal length lens with f = 500 mm. In the experiment, different targets on the distance of about 3 km plurality are measured. Ranging image groups are as follows.The chosen target is “Energy Bureau of Jilin Province.” The images and the selected target in the experiment are shown as in Figure6.Ranging image groups for “Energy Bureau of Jilin Province.”
(a)
The left CCD image
(b)
The right CCD image
(c)
The target imageFigure6 is a group of target images in the CCD ranging. The experiments use GPS navigation and positioning to measure the target shooting location and its latitude and longitude, a distance of 2.2631 km. To test the stability of the CCD ranging system and the running of the algorithm, several groups of target images are captured and matched during the experiment. The software interface of image matching is shown as in Figure 7.Figure 7
Software interface of image matching.Combining the calibration parameters of the far-distant CCD binocular ranging system, the measurement results of experiments are obtained, which are shown in Table1.Table 1
Measurement data of ranging image groups for “Energy Bureau of Jilin Province.”
The number of experiments
Coordinates of left match point (pixel)
Coordinates of right match point (pixel)
Distance (km)
1
(83.00, 229.00)
(87.17, 64.00)
2.252
2
(81.00, 222.00)
(87.35, 62.59)
2.257
3
(82.00, 221.00)
(88.33, 68.00)
2.255
4
(83.00, 225.00)
(86.83, 66.75)
2.258
5
(82.00, 221.00)
(87.07, 66.23)
2.253


### 4.2. The Error Analysis of Binocular CCD Ranging Results

In this paper, the formula of the binocular CCD ranging is modified and the two-dimensional case is discussed, pointing out that the actual three-dimensional imaging calculation is just the expanse of the two-dimensional calculation, which does not affect the calculation of the formula. Binocular vision system imaging model [11, 12] is shown as in Figure 8. O
L and O
R are the optical centers of the left camera and the right camera, respectively, O
L
Z
L and O
R
Z
R are the axes of the two cameras, respectively, and f
L and f
R are the focal lengths of the two cameras, respectively.Figure 8
Imaging model of binocular vision system.In Figure8, Q
1 is setas a calibration point. It is assumed that the coordinates of this calibration point in the camera coordinate system are (x
1L,
z
1L) and (x
1R,
z
1R). According to a first-order radial distortion pinhole model, the ideal position of Q
1 on the image plane is u
11, u
12, but its actual location is u
11
′, u
12
′. It is assumed that the two-dimensional position errors of each pixel are equal. They are both E, which is as follows:
(4)
E
=
(
X
d
-
X
u
)
2
+
(
Y
d
-
Y
u
)
2
.According to the position relationship betweenQ
1 and the point position of the two-dimensional image u
11
′, u
12
′, the position of the optical center of the camera O
L
′ and O
R
′ can be obtained with the linear method to obtain.The coordinates of theu
11 and u
12 in the left and right cameras coordinate system which are obtained from the straight O
L
Q
1 and the intersection of the image plane are as follows:
(5)
u
11
=
(
-
f
L
x
1
L
z
1
L
+
E
,
-
f
L
)
,
u
12
=
(
f
R
x
1
R
z
1
R
,
-
f
R
)
.It can infer(6)
u
11
′
=
(
-
f
L
x
1
L
z
1
L
+
E
,
-
f
L
)
,
u
12
′
=
(
f
R
x
1
R
z
1
R
+
E
,
-
f
R
)
.Based on the lineu
11
′
Q
1
′, the coordinate of O
L
′ in the coordinate system of the left camera is (
Z
1
L
E
/
(
z
1
L
+
f
L
)
,
0
). Similarly, the coordinate of O
R
′ in the right camera coordinate system is (
t
x
-
(
Z
1
L
E
/
(
Z
1
L
+
f
L
)
)
,
0
). Then the testing points were restored by using the obtained camera parameters. Assuming the actual coordinates of the test points for Q
2 as (x
2
L
,
z
2
L) and (x
2
R
,
z
2
R), in theory testing image point Q
2 should be u
21
′, u
22
′. Defined u
21
′ and u
22
′, respectively, are
(7)
u
21
′
=
(
-
f
L
x
2
L
Z
2
L
+
E
,
-
f
L
)
,
u
22
′
=
(
t
x
-
f
R
(
t
x
-
x
2
L
)
z
2
L
-
E
,
-
f
R
)
.Due to the error effects caused by the matching, the corresponding image points ofQ
2, respectively, are detected as u
21
′′, u
22
′′ and the matching error is D; thus
(8)
u
22
′′
=
(
t
x
-
f
R
(
t
x
-
x
2
L
)
z
R
-
E
-
D
,
-
f
R
)
.
Therefore, the baseline length of O
L
′, O
R
′ is
(9)
b
=
t
x
-
2
z
2
L
E
z
2
L
+
f
L
.
And the parallax d is calculated as
(10)
d
=
f
R
(
t
x
-
x
2
L
)
z
2
R
+
E
+
D
+
(
f
L
x
2
L
z
2
L
+
E
)
-
2
z
2
L
E
z
2
L
+
f
L
.According to the CCD camera diagram, the depth value ofQ
2 can be obtained as follows:
(11)
l
′
=
(
t
x
-
2
(
z
2
L
E
/
(
z
2
L
+
f
L
)
)
)
f
×
(
[
(
f
R
(
t
x
-
x
2
L
)
/
z
2
R
)
+
E
+
D
h
h
h
h
h
+
(
(
f
L
x
2
L
/
z
2
L
)
+
E
)
]
h
h
h
h
h
-
(
2
z
2
L
E
/
(
z
2
l
+
f
L
)
)
)
-
1
.The system error is calculated as(12)
l
e
=
l
′
-
l
,
l
=
z
2
L
.In this paper, when calculating the matching error, the system errorD is 0.05 pixel, and the calibration error E is 0.5826 pixel. Therefore, this system error of the paper is about 0.52%.


## 4.1. Experimental Results of Binocular CCD Ranging Experiment

The experiment adopts the CCD camera of OK-AC1300 model with a resolution of1300
×
1024 pixels, two pixels size of 4.65 μm, and working output 8 bitRGB image and chooses the German deterrence Walimex500 mm F8-32 telephoto fixed focal length lens with f = 500 mm. In the experiment, different targets on the distance of about 3 km plurality are measured. Ranging image groups are as follows.The chosen target is “Energy Bureau of Jilin Province.” The images and the selected target in the experiment are shown as in Figure6.Ranging image groups for “Energy Bureau of Jilin Province.”
(a)
The left CCD image
(b)
The right CCD image
(c)
The target imageFigure6 is a group of target images in the CCD ranging. The experiments use GPS navigation and positioning to measure the target shooting location and its latitude and longitude, a distance of 2.2631 km. To test the stability of the CCD ranging system and the running of the algorithm, several groups of target images are captured and matched during the experiment. The software interface of image matching is shown as in Figure 7.Figure 7
Software interface of image matching.Combining the calibration parameters of the far-distant CCD binocular ranging system, the measurement results of experiments are obtained, which are shown in Table1.Table 1
Measurement data of ranging image groups for “Energy Bureau of Jilin Province.”
The number of experiments
Coordinates of left match point (pixel)
Coordinates of right match point (pixel)
Distance (km)
1
(83.00, 229.00)
(87.17, 64.00)
2.252
2
(81.00, 222.00)
(87.35, 62.59)
2.257
3
(82.00, 221.00)
(88.33, 68.00)
2.255
4
(83.00, 225.00)
(86.83, 66.75)
2.258
5
(82.00, 221.00)
(87.07, 66.23)
2.253


## 4.2. The Error Analysis of Binocular CCD Ranging Results

In this paper, the formula of the binocular CCD ranging is modified and the two-dimensional case is discussed, pointing out that the actual three-dimensional imaging calculation is just the expanse of the two-dimensional calculation, which does not affect the calculation of the formula. Binocular vision system imaging model [11, 12] is shown as in Figure 8. O
L and O
R are the optical centers of the left camera and the right camera, respectively, O
L
Z
L and O
R
Z
R are the axes of the two cameras, respectively, and f
L and f
R are the focal lengths of the two cameras, respectively.Figure 8
Imaging model of binocular vision system.In Figure8, Q
1 is setas a calibration point. It is assumed that the coordinates of this calibration point in the camera coordinate system are (x
1L,
z
1L) and (x
1R,
z
1R). According to a first-order radial distortion pinhole model, the ideal position of Q
1 on the image plane is u
11, u
12, but its actual location is u
11
′, u
12
′. It is assumed that the two-dimensional position errors of each pixel are equal. They are both E, which is as follows:
(4)
E
=
(
X
d
-
X
u
)
2
+
(
Y
d
-
Y
u
)
2
.According to the position relationship betweenQ
1 and the point position of the two-dimensional image u
11
′, u
12
′, the position of the optical center of the camera O
L
′ and O
R
′ can be obtained with the linear method to obtain.The coordinates of theu
11 and u
12 in the left and right cameras coordinate system which are obtained from the straight O
L
Q
1 and the intersection of the image plane are as follows:
(5)
u
11
=
(
-
f
L
x
1
L
z
1
L
+
E
,
-
f
L
)
,
u
12
=
(
f
R
x
1
R
z
1
R
,
-
f
R
)
.It can infer(6)
u
11
′
=
(
-
f
L
x
1
L
z
1
L
+
E
,
-
f
L
)
,
u
12
′
=
(
f
R
x
1
R
z
1
R
+
E
,
-
f
R
)
.Based on the lineu
11
′
Q
1
′, the coordinate of O
L
′ in the coordinate system of the left camera is (
Z
1
L
E
/
(
z
1
L
+
f
L
)
,
0
). Similarly, the coordinate of O
R
′ in the right camera coordinate system is (
t
x
-
(
Z
1
L
E
/
(
Z
1
L
+
f
L
)
)
,
0
). Then the testing points were restored by using the obtained camera parameters. Assuming the actual coordinates of the test points for Q
2 as (x
2
L
,
z
2
L) and (x
2
R
,
z
2
R), in theory testing image point Q
2 should be u
21
′, u
22
′. Defined u
21
′ and u
22
′, respectively, are
(7)
u
21
′
=
(
-
f
L
x
2
L
Z
2
L
+
E
,
-
f
L
)
,
u
22
′
=
(
t
x
-
f
R
(
t
x
-
x
2
L
)
z
2
L
-
E
,
-
f
R
)
.Due to the error effects caused by the matching, the corresponding image points ofQ
2, respectively, are detected as u
21
′′, u
22
′′ and the matching error is D; thus
(8)
u
22
′′
=
(
t
x
-
f
R
(
t
x
-
x
2
L
)
z
R
-
E
-
D
,
-
f
R
)
.
Therefore, the baseline length of O
L
′, O
R
′ is
(9)
b
=
t
x
-
2
z
2
L
E
z
2
L
+
f
L
.
And the parallax d is calculated as
(10)
d
=
f
R
(
t
x
-
x
2
L
)
z
2
R
+
E
+
D
+
(
f
L
x
2
L
z
2
L
+
E
)
-
2
z
2
L
E
z
2
L
+
f
L
.According to the CCD camera diagram, the depth value ofQ
2 can be obtained as follows:
(11)
l
′
=
(
t
x
-
2
(
z
2
L
E
/
(
z
2
L
+
f
L
)
)
)
f
×
(
[
(
f
R
(
t
x
-
x
2
L
)
/
z
2
R
)
+
E
+
D
h
h
h
h
h
+
(
(
f
L
x
2
L
/
z
2
L
)
+
E
)
]
h
h
h
h
h
-
(
2
z
2
L
E
/
(
z
2
l
+
f
L
)
)
)
-
1
.The system error is calculated as(12)
l
e
=
l
′
-
l
,
l
=
z
2
L
.In this paper, when calculating the matching error, the system errorD is 0.05 pixel, and the calibration error E is 0.5826 pixel. Therefore, this system error of the paper is about 0.52%.


## 5. Conclusions

In this paper, the proposed image matching algorithm is adopted to improve the accuracy of the binocular CCD passive ranging. During the measurement, the improved cross-correlation algorithm and three-surface fitting algorithm to the target image are applied to achieve the subpixel level image matching, improving the accuracy of ranging. Through the error analysis of measurement results, the paper modified the calculation formula of system errors. Experimental results show that the target measuring accuracy within 3 km is higher than 0.52%, which is of great practical value.



---

*Source: 785072-2014-07-16.xml*