Python OpenCV – Depth map from Stereo Images
OpenCV is the huge open-source library for the computer vision, machine learning, and image processing and now it plays a major role in real-time operation which is very important in today’s systems.
Note: For more information, refer to Introduction to OpenCV
Depth Map : A depth map is a picture where every pixel has depth information(rather than RGB) and it normally represented as a greyscale picture. Depth information means the distance of surface of scene objects from a viewpoint. An example of pixel value depth map can be found here : Pixel Value Depth Map using Histograms
Stereo Images : Two images with slight offset. For example, take a picture of an object from the center. Move your camera to your right by 6cms while keeping the object at the center of the image. Look for the same thing in both pictures and infer depth from the difference in position. This is called stereo matching. To have best results, avoid distortions.
- Collect or take stereo images.
- Import OpenCV and matplotlib libraries.
- Read both left and right images.
- Calculate disparity using stereo.compute.
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course