Software for depth estimation

Last Update: June 6th 2008

 

This software generates depth maps for 1D parallel images.

 

Three stereo images in YUV 4:2:0 formats are inputted into this software.

 

    

Left image               Center image               Right image

 

Then the depth map in PGM format of center image is outputted.

 

Depth map

 

*****************************************************************

Input files

·          View images (YUV 4:2:0 format)

·          Camera parameter file (Text file)

·          Parameter configuration file (.cfg file)

Output files

·          Depth map (YUV 4:2:0 video)

·          Znear and Zfar (Text file)

 

n      Input/output file format

   YUV 4:2:0 video files are inputted or outputted.

 

n      Camera parameter file

   Intrinsic and extrinsic camera parameters are gathered in a text file. Then, each camera has to be named for identifying them. For example, cameras which correspond to the view26, view27, and view28 are named as param_ak26, param_ak27, and param_ak28, respectively. Figure 2 shows an example of camera parameter file. These parameters have to be ordered in not increasing order number but camera order from left to right.

 

 

Fig.1 An example of camera parameter file.

 

 

n      Parameter configuration file

   Conventional text file for parameter configuration was replaced by a configuration file (.cfg file). This file has to be named gDepthEstimation.cfgh and has to be put in the directory containing  DepthEstimation.exe file. Table 1 shows the parameters which are included in parameter configuration file. The following 17 parameters are included in the file.

 

1.     Depth Type

2.     Width of view image

3.     Height of view image

4.     Total number of frames

5.     Left camera name

6.     Center camera name

7.     Right camera name

8.     Minimum value of disparity search range

9.     Maximum value of disparity search range

10. Minimum value of disparity range

11. Maximum value of disparity range

12. Smoothing coefficient (larger than or equal to 1.0)

13. File name of left view image (This may include file path)

14. File name of center view image (This may include file path)

15. File name of right view image (This may include file path)

16. File name of output depth map (This may include file path)

17. Camera parameter file name

 

Note: Disparity search range is not always same as all pairs of views. Changing this range may effects resultant depth maps. This range is determined visually.

Disparity range has to include disparity search ranges for all views. Minimum value of disparity range is smaller than or equal to minimum value of all disparity search ranges. In the same way, maximum value of disparity range is larger than or equal to maximum value of all disparity search ranges. Minimum and maximum values of disparity range correspond to Zfar and Znear values. Figure 2 shows this relation.

Smoothing coefficient is a positive value larger than or equal to 1.0. This value is chosen experimentally.

 

     

Fig. 2 Relation between disparity search range and disparity range

 

Figure 3 shows an example of parameter configuration file.

Fig.3 An example of parameter configuration file.

 

Depth type

This software is equipped two types of depth computation mode. One is depth from camera and the other is depth from the origin of 3D space. That is because there exist the following two cases: Type I) the direction of camera is opposite to that of the 3D coordinate, Type II) the direction of camera is same as that of 3D coordinate. Figure 4 shows the former case. In this case, depth from the origin of 3D space takes not only positive value but also negative value. On the other hand, depth from camera is always positive value. Then Type I is selected. Otherwise, Type II is selected.

 

Fig.4 Relation between camera arrangement and 3D coordinate system.

 

********************************************************************

 

Usage of software

DepthEstimation.cfg file has to be put in the directory containing DepthEstimation.exe file.

If you use this program from command prompt, please input DepthEstimation.exe and press Enter key. Then depth estimation starts. If you use this program from Visual Studio, no input into command prompt is needed.

 

 

**************************************************************************

Software download

 

Software is distributed in two forms: binary file and Visual Studio 2005 project file.

 

You can generate depth image with binary file gDepthEstimation.exeh

This file can also be used from command prompt.

 

To download binary file [download]

This zip file includes exe file and related files.

 

 

Source code is distributed as Visual Studio 2005 project file. To compile this project, Visual Studio 2005 must be installed on your computer.

 

To download Visual Studio 2005 project file [download]

 

**************************************************************************

 

Acknowledgement

I would like to express my thanks to MPEG-FTV EE participants who gave us useful and kindly comments and questions concerning to the first version of our software.

 

Kazuyoshi Suzuki

 

If you have a question, donft hesitate to mail to