Raspberry Pi, Open CV and Python : Automated Volume Calculation of a Box

 Volume Calculation using Image Processing and Distance Sensor !

I started my internship at Lambda Theta on 16th May and I was working on a project to calculate volume of a box. We decided to use the image processing for the calculation of 2 dimensions while the third dimension was to be calculated using distance sensor.


Box detected and showing the size of the rectangle and on the left volume of the box
Eye Of The Project

I have previously posted about about the use of Raspberry Pi 3 for this project and image processing to be done using OpenCV with Python.

I must admit that used Python over an year ago and this was my first time with OpenCV, however, tutorials at PyImageSearch made my task much easier. There is already a tutorial on PyImageSearch on how to measure the size of an object in an image. The tutorial uses an object of a known size as a reference to calculate the size of an object. 

However, in our case the problem was that we couldn't use a reference object because the height of the box would vary every time. So we used a distance sensor to calculate the height of the object. And then this height was used as a reference to calculate the width and length of the box. I can't give out the exact details on how we achieved this but if you really want to know contact me personally and I might be able to help you a little.


Comments