In the previous chapter, we learned how to detect objects using the OpenCV library, both via the cascade classifiers approach and the deep learning approach. In this chapter, we will discuss how to measure the distance between the detected objects or between the object of interest and our camera. We will detect cars in a new application and measure the distance between cars and the distance between a car and the camera.
The following topics will be covered in this chapter:
- Detecting cars using the YOLOv3 model with OpenCV
- Methods to measure distance in different view angles
- Measuring the distance between cars in the bird's eye view
- Measuring the distance between a car and the camera in the eye-level view