Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You can indeed find the surface area of leather pieces like that, assuming they lie flat.

You need to calibrate the camera extremely well, and then it is a matter of simple math, and careful measurement. You lay the calibration target out on the conveyor and use solvePnP to get the camera location and orientation. And that gives you the plane of the conveyor relative to the camera. You can project the ray from the camera to the plane at any pixel, giving you a point. If you do that for the pixels that are the edges of the leather, and use those points to get the surface area.

You know the size of your calibration target, so you can use that as a test to make sure your code works properly.

The projection of the ray is outside of OpenCV, but it's just math. Google the intersection of a vector with a plane and you'll find the formulas. Give it a try, and we'll be glad to help you fix problems, but it's important you have tried to solve things already. We won't do it for you. This should be enough to get you started.