Doubt with model and world2cam and cam2world functions

337 views
Skip to first unread message

joaquin.gonz...@gmail.com

unread,
Apr 26, 2016, 6:13:00 PM4/26/16
to OCamCalib Toolbox

I have a problem and I want to know if the method that I am doing is correct.

I have a model of a cam obtained with Ocam Toolbox. Imagine: I have one point in the space. To convert this point into 2D pixel position, I am using the world2cam function of the calibration toolbox. To do the reverse problem, I am using the cam2world function of the same toolbox.

In case 1: I only obtain the point in 2D if I put into the function the following expression: ss = - model.ss. In this way I obtain a good representation of the point in pixel coordinates.

In case 2: If I put the expression above, I obtain the original point in negative. Instead, if I leave the original expression (ss = model.ss), I obtain the original point in 3D representation.

Do you know why this is happening? I will be very thankful to you if you help me.

Bernd Pfrommer

unread,
Apr 27, 2016, 7:18:23 PM4/27/16
to OCamCalib Toolbox, joaquin.gonz...@gmail.com
While I don't think I fully understand what you are referring to, I have encountered similar issues when working with the OcamCalib toolbox. I think it has to do with the choice of coordinate system. As far as I remember, the function f(rho) assumed negative values, which corresponds to negative focal length.
When working in homogeneous coordinates you have a choice what you want to use for "Z" when scaling your x = X/Z and y = Y/Z. I found that the sign of Z actually matters, i.e. I get different (wrong!) answers when using e.g. a positive Z (I don't remember which way was correct). I ended up flipping all signs of the homogeneous 2D points and things worked out nicely.
Reply all
Reply to author
Forward
0 new messages