# Get depth from dfs

Source: https://forum.modalai.com/topic/2898/get-depth-from-dfs
Category: General Questions (https://forum.modalai.com/category/2/general-questions)
Posted: 2023-11-24 08:55:41 UTC by planch98
Replies: 2 · Views: 862

## planch98 · 2023-11-24 08:55:41 UTC

Hi, I'm currently working on an application that requires depth information. After configuring voxl-dfs-server I'm able to obtain a good disparity. I compute the depth information as so: depth = focal length*baseline/disparity. The result that I obtain seems wrong by a scaling factor. Focal length and baseline are taken from the calibration file obtained from voxl-calibrate-camera stereo.

Can you share some information on how to perform this operation? 

dfs config file:
```
"dfs_pair_1_input_pipe":	"stereo_rear",
	"dfs_pair_1_skip_n_frames":	1,
	"dfs_pair_1_blur_size":	9,
	"dfs_pair_1_post_median_size":	15,
	"dfs_pair_1_intrinsics_file":	"/data/modalai/opencv_stereo_rear_intrinsics.yml",
	"dfs_pair_1_extrinsics_file":	"/data/modalai/opencv_stereo_rear_extrinsics.yml",
	"dfs_pair_1_en_cvp_rectification":	1,
	"dfs_pair_1_min_disparity":	4,
	"dfs_pair_1_max_disparity":	64,
	"dfs_pair_1_min_threshold":	10,
	"dfs_pair_1_cost_threshold":	80,
```

## Reply by cch · 2023-11-25 03:06:36 UTC

@planch98 Have you ever tried to calibrate the camera again to see if the parameters have changed? After calibrating the stereo camera several times, I found that the wrong parameters could be obtained due to inputting the wrong width of the chessboard. By the way, could you please give some suggestions on this issue [link text](https://forum.modalai.com/topic/2800/voxl-2-dfs-server-failed)?

## Reply by Moderator (ModalAI staff) · 2023-11-27 16:37:08 UTC (in reply to cch)

@cch you can see the code where voxl-vision-hub takes the pointcloud topic from DFS and uses the information, this should be a good reference: https://gitlab.com/voxl-public/voxl-sdk/services/voxl-vision-hub/-/blob/master/src/voa_manager.c?ref_type=heads#L434
