Today we will discuss how you can find the distance of an object from the camera using python OpenCV. Check out the video below. Before we continue, you should know how to detect a colored object. Click this link to check out my previous blog on object detection and tracking. I hope after checking out my previous blog, you are able to write your own code to detect and track objects. We will take forward the Object detection and tracking code to find the distance of an object from the camera. So let's start. Let us first understand the principle using which we will find the distance of the object from the camera. Principle:- As the object moves farther away from the camera, the Y-axis coordinate decreases. This simply means that, if your object is near to the camera, the Y-axis coordinate will be very large. As you move the object farther from the camera, the object will appear to move above in the image and thus decreasing the Y-axis coordinates proportionately. Th...
In this blog, you will get to learn a lot about computer vision. The blog posts are written in such a way that even a newbie can understand. This blog tries to clear the most fundamental concepts of image processing and computer vision.