I have calibrated camera and undistorted image, object on image is binarized and only contours are shown. Then I use rectangle to get the dimension of the object -> I have distance in pixels. The camera has fixed position and after calibration the distance from object is fixed too.
Size of the red rectangle ~ 81×630 pixels.
Is there any way to transform pixels to millimeters using only OpenCV calibration or should I measure pixel size of object with known dimension?