0
$\begingroup$

EDIT2: I've added an assumption that the camera calibration matrix is given. Other factors (rotation, camera pose) are still not given.

I want to measure actual lengths of floor edges (blue lines in the example below) of a room by finding the homography matrix, from its length given in pixels (of blue lines in the second image).

We can use the camera calibration matrix, the height of the room (green lines in the example below), the room layout image (like the second image) and the assumption that the room follows Manhattan layout.

Example:

original image

layout image

EDIT: I've removed some words that makes the question looks begging for an working code. Anyway, thank you for your answers. I've decided to take photos from our camera with drawing several lines parallel with the wall to do this.

$\endgroup$
  • $\begingroup$ I might be missing something, but the only blue line that you could induce the length of in this picture is the far end. You can't tell how far the room extends behind the camera's field of view. $\endgroup$ – Marcus Müller May 30 at 9:57
  • $\begingroup$ Also, none of these lines are visible in the picture, so OpenCV doesn't have any visual thing to work on. Maybe start with an empty room and work from there. You can try to find the wall lines from a room with furniture obstructing the view later on. $\endgroup$ – Marcus Müller May 30 at 9:59
  • $\begingroup$ I've removed some words that makes the question looks begging for an working code. Anyway, thank you for your answers. I've decided to take photos from our camera with drawing several lines parallel with the wall to do this. $\endgroup$ – frozenca May 31 at 7:25
  • $\begingroup$ @MarcusMüller Is it possible to calculate homography matrix by the image when we know the actual room ceiling height and the precise camera calibration matrix? Still don't-know-params are room width, rotation angle, camera pose, etc. $\endgroup$ – frozenca Jun 17 at 5:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.