OpenCV Q&A Forum - RSS feedhttp://answers.opencv.org/questions/OpenCV answersenCopyright <a href="http://www.opencv.org">OpenCV foundation</a>, 2012-2018.Fri, 28 Aug 2015 11:35:13 -0500Obtain camera coords from 3 x 4 camera matrixhttp://answers.opencv.org/question/69629/obtain-camera-coords-from-3-x-4-camera-matrix/Hello forum,
I am trying to find the coordinates of my Camera (X,Y,Z) using the technique shown [here](http://ksimek.github.io/2012/08/14/decompose/)
However, I fond that because the points in my image does not have any height ie. Z = 0, the inverse of M becomes undefined. Would the camera coordinates I obtain be accurate if I define the all points in the world coordinate with a height of one ie. Z = 1 ? I would then just subtract the height of the camera by 1.
The technique I am using to obtain the camera matrix is shown [here](https://www.youtube.com/watch?v=NWOL8yXL6xI&index=14&list=PLd3hlSJsX_Imk_BPmB_H3AQjFKZS9XgZm) at 42:45
I also set a44 = 1
Fri, 28 Aug 2015 08:56:51 -0500http://answers.opencv.org/question/69629/obtain-camera-coords-from-3-x-4-camera-matrix/Comment by David_86 for <p>Hello forum,</p>
<p>I am trying to find the coordinates of my Camera (X,Y,Z) using the technique shown <a href="http://ksimek.github.io/2012/08/14/decompose/">here</a></p>
<p>However, I fond that because the points in my image does not have any height ie. Z = 0, the inverse of M becomes undefined. Would the camera coordinates I obtain be accurate if I define the all points in the world coordinate with a height of one ie. Z = 1 ? I would then just subtract the height of the camera by 1.</p>
<p>The technique I am using to obtain the camera matrix is shown <a href="https://www.youtube.com/watch?v=NWOL8yXL6xI&index=14&list=PLd3hlSJsX_Imk_BPmB_H3AQjFKZS9XgZm">here</a> at 42:45
I also set a44 = 1</p>
http://answers.opencv.org/question/69629/obtain-camera-coords-from-3-x-4-camera-matrix/?comment=69632#post-id-69632What do you mean by "if I define the all points in the world coordinate with a height of one ie. Z = 1 ?"
There is no world point coming in inside matrix P: it only contains camera intrinsics K, camera rotation R and camera center C.
You can place the camera (or your reference coordinate system) wherever you like, that would only influence the mapping of the 3D points into 2D camera sensor when you multiply P*t, where t is the coordinates vector of the point you are considering.Fri, 28 Aug 2015 09:41:18 -0500http://answers.opencv.org/question/69629/obtain-camera-coords-from-3-x-4-camera-matrix/?comment=69632#post-id-69632Comment by Nbb for <p>Hello forum,</p>
<p>I am trying to find the coordinates of my Camera (X,Y,Z) using the technique shown <a href="http://ksimek.github.io/2012/08/14/decompose/">here</a></p>
<p>However, I fond that because the points in my image does not have any height ie. Z = 0, the inverse of M becomes undefined. Would the camera coordinates I obtain be accurate if I define the all points in the world coordinate with a height of one ie. Z = 1 ? I would then just subtract the height of the camera by 1.</p>
<p>The technique I am using to obtain the camera matrix is shown <a href="https://www.youtube.com/watch?v=NWOL8yXL6xI&index=14&list=PLd3hlSJsX_Imk_BPmB_H3AQjFKZS9XgZm">here</a> at 42:45
I also set a44 = 1</p>
http://answers.opencv.org/question/69629/obtain-camera-coords-from-3-x-4-camera-matrix/?comment=69642#post-id-69642Sorry, the problem I am having is that all my points (X,Y,Z) lie on the same plane (on Z = 0) and therefore I am unsuccessful in using least squares fit to obtain the camera matrixFri, 28 Aug 2015 11:35:13 -0500http://answers.opencv.org/question/69629/obtain-camera-coords-from-3-x-4-camera-matrix/?comment=69642#post-id-69642