Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

camera rotation and translation based on two images


I'm just starting my little project in OpenCV and I need your help :) I would like to calculate rotation and translation values of the camera basing on two views of the same planar, square object.

I have already found functions such as: getPerspectiveTransform, decomposeEssentialMat, decomposeHomographyMat. Plenty of tools, but I'm not sure which of them to use in my case.

I have a square object of known real-world dimensions [meters]. After simple image processing I can extract pixel values of the vertices and the center of the square.

Now I would like to calculate the relative rotation and translation of the camera which led to obtain the second of two images:
"Reference view" and "View #n"
(please see below).

Any suggestions will be appreciated :)

  1. Reference view:
    image description
    (center of the object is on the optical axis of camera, the camera-object distance is known)
  2. View #1:
    image description
  3. View #2:
    image description
  4. View #3:
    image description