# Generated disparity map is not proper

**URL:** <https://forum.opencv.org/t/generated-disparity-map-is-not-proper/11686>\
**Category:** Python\
**Tags:** calib3d, stereo\
**Created:** [January 18, 2023, 9:31am UTC](https://forum.opencv.org/t/generated-disparity-map-is-not-proper/11686 "2023-01-18T09:31:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hellomam69](https://avatars.discourse-cdn.com/v4/letter/h/e274bd/32.png) [@hellomam69](https://forum.opencv.org/u/hellomam69)\
**Post date:** [January 18, 2023, 9:31am UTC](https://forum.opencv.org/t/generated-disparity-map-is-not-proper/11686/1 "2023-01-18T09:31:35Z")

</div>

Hi,  
I am trying to generate the disparity map using two raspberry pi v2 cameras but cannot create a proper disparity map I have done stereo calibration and stereo rectification.  
the projection error for both cameras is around 0.0309 and baseline is 75mm

I followed the procedure mentioned in the below link:

> **[Making A Low-Cost Stereo Camera Using OpenCV | LearnOpenCV #](https://learnopencv.com/making-a-low-cost-stereo-camera-using-opencv/)**
>
> In this post, we will learn how to create a custom low-cost stereo camera (using a pair of webcams ) and capture 3D videos with it using OpenCV. We provide code in Python and C++.

these are my stereo rectifed images and disparity map.

 ![stereo image and disparity map](https://us1.discourse-cdn.com/flex020/uploads/opencv/original/2X/2/29141d6f59f59de15335a5dba36a70fe764fc36f.jpeg)

Would you tell where i am doing wrong.

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [January 18, 2023, 3:17pm UTC](https://forum.opencv.org/t/generated-disparity-map-is-not-proper/11686/2 "2023-01-18T15:17:03Z")

</div>

calibration is broken. look at your pictures.

---

<div class="post-metadata">

**Author:** ![hellomam69](https://avatars.discourse-cdn.com/v4/letter/h/e274bd/32.png) [@hellomam69](https://forum.opencv.org/u/hellomam69)\
**Post date:** [January 18, 2023, 4:01pm UTC](https://forum.opencv.org/t/generated-disparity-map-is-not-proper/11686/3 "2023-01-18T16:01:07Z")

</div>

how do properly re-calibrate .please help me I have been trying to do this for a week now

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [January 18, 2023, 11:11pm UTC](https://forum.opencv.org/t/generated-disparity-map-is-not-proper/11686/4 "2023-01-18T23:11:33Z")

</div>

present the calibration pictures. dropbox/gdrive/whatever works. I’m just looking to browse them superficially, for typical mistakes. if you want to, you can blur out anything you don’t want people to see.

stereo isn’t “low cost” anymore if you have to sink a week of your time into it. unless you’re doing this for the learning experience, I’d recommend just buying an “RGBD sensor” like a kinect or intel realsense or whatever’s popular these days.
