17

I am working with OpenCV, Android and OpenGL for an Augmented Reality project. As far as I know the coordintate system in OpenGL is

enter image description here

The OpenCV coordinate system is:

enter image description here

When combining these devices with android sensors how can I do the coordinate system conversions and [R|t] matrix conversion? Is there a good tutorial or documentation were all of this conffusing stuff is explained?

genpfault
  • 47,669
  • 9
  • 68
  • 119
Jav_Rock
  • 21,011
  • 18
  • 115
  • 164

1 Answers1

16

If you look at the picture, then you see, that the both coordinate systems have the same handednes, but the OpenCV one is rotated by pi around the x axis. This can be represented by the following rotation matrix:

 1  0  0
 0 -1  0
 0  0 -1
datenwolf
  • 149,702
  • 12
  • 167
  • 273
  • Yes, for changing between openCV and OpenGL an inversion about y and z axis is needed. The biggest problem comes with android sensors... – Jav_Rock Jan 31 '12 at 15:59
  • It is *not* a rotation. The coordinate system (y-axis) is flipped at the x-axis. The z-axis is unaffected. – Stefan Jun 14 '13 at 14:30
  • 6
    @Stefan: Look again: In the pictures OP pasted into his answer the Z axis has been flipped, too. According to those pictures (OpenGL Z axis comes out of the screen, OpenCV Z axis goes into the screen) it's a rotation by 180° along the X axis. – datenwolf Jun 14 '13 at 14:33