In this post, we are trying to calculate the dimensions of objects in an image and the distances between the object is computed. First, we must find the value of pixels per a given metric. To find this value, we need a reference object from the image. We must store the input image in the memory.
- Perform the grayscale which identifies the objects present in the picture
- Perform a gaussian filter to remove the unnecessary noise in the picture.
- Edge detection method is done to detect the edges of the object present in the picture using contours.
- Sort the objects present in the picture in order and compare against an object library
- If contour area is too small disregard the object otherwise calculate the dimensions of the object.
- Get pixels per metric ratio, Height & Width (pixels). For finding pixels per metric ratio, we need two parameters and they are Height & Width of the reference object.
One more important factor is that to know the details about height of the camera – the perspective. (Coming Soon)