Research Article

Linear Correction and Matching Method for 3D Line Structure Reconstruction

Algorithm 1

Steps of constructing gradient gravitational map.
 Input: image .
 Output: gradient gravitational map
(1)Calculate the edge map of image and calculate the size of
(2)Solve the extended gradient map of
(3)Construct a 3D matrix called , where and are and coordinates, respectively. Fill in with and according to the above method.
(4)Calculate the gravitational value at each location:
m Exit = true
while (mExit)
for i=1:M
for j=1:N
 {
mExit=false;
if (GM (1, i, j)! = 0
 {
mExit=true;
for kx = −1 : 1
for ky = −1 : 1
if (GM (1, i + kx, j + ky) = 0
 {
  if gradient direction = = 45°
   draw a circle centered on the current position,
   and according to the edge pixels that intersect
   first to fill in
   GM (1, i + kx, j + ky) and GM (2, i + kx, j + ky);
  else
   according to the EGM (i + kx + ky); }
  }
 }
(5)Return