How can I measure the diamater of a tube in a production line?

Hi all,

I recieve recyclable metal at my facility. We currently manually sort everything into bins depending on the size of the scrap metal. I would like to automate this. The first step is to identify the 3D bounding box of a piece of scrap metal on a conveyer. Does anyone have any idea how this could be achieved? Optimally, it should be accurate to the 0.5cm since it helps grade the quality of the scrap metal.

Is there some sort of manufacturing standard for creating these 3D measurements?

Thanks!

I would use OpenCV, C++, and a set of stereo cameras to estimate the bounding box. The accuracy depends on the lenses and how big of a space is involved. The system would need to be calibrated and setup for your specific environment. The diameter of the tubes could be estimated with certain assumptions and given that the tube ends are visible to the cameras.