stereolabs / zed-open-capture

Low level Linux camera driver for the ZED USB3 stereo cameras. API docs available here:
https://stereolabs.github.io/zed-open-capture
MIT License
101 stars 35 forks source link

[Question] Is the result of algorithm in OpenCV stereo the same as the result in ZED SDK? #5

Closed violet17 closed 4 years ago

violet17 commented 4 years ago

I want to use ZED camera to compute depth map without discrete GPU. According to the issue, I want to get more detail about computing depth map.

Thanks.

Myzhar commented 4 years ago

Hi @violet17 the starting point for you is the rectify example. Once you have the rectified images right_rect and left_rect you can directly use them with one of the OpenCV stereo matcher to obtain the disparity map: https://docs.opencv.org/trunk/dd/d86/group__stereo.html

This is an example: https://resources.oreilly.com/examples/9781786469717/blob/master/OpenCV3ComputerVisionApplicationProgrammingCookbookThirdEdition_Code/Chapter11/stereoMatcher.cpp#L144-173

violet17 commented 4 years ago

@Myzhar Thanks for the solution. I will have a try.

violet17 commented 4 years ago

Hi @violet17 the starting point for you is the rectify example. Once you have the rectified images right_rect and left_rect you can directly use them with one of the OpenCV stereo matcher to obtain the disparity map: https://docs.opencv.org/trunk/dd/d86/group__stereo.html

This is an example: https://resources.oreilly.com/examples/9781786469717/blob/master/OpenCV3ComputerVisionApplicationProgrammingCookbookThirdEdition_Code/Chapter11/stereoMatcher.cpp#L144-173

Hi @Myzhar , Can I directly compute the depth map using this formula: Z = B*f/disparity? Do I need to add some scales? How to get the value of distance of two cameras B?