computer-vision / takahashi2012cvpr

An Implementation of Takahashi, Nobuhara and Matsuyama "A New Mirror-based Camera Pose Estimation Using an Orthogonality Constraint" presented at CVPR 2012
https://computer-vision.github.io/takahashi2012cvpr/
Other
26 stars 11 forks source link

How to identify 3D reference points of X (working on own text data) #2

Closed SubhashPavan closed 5 years ago

SubhashPavan commented 5 years ago

I was trying to implement your version1 Opencv implementation and wanted to try out the algorithm with new data.

These are the steps that I have followed, please let me know how do I proceed?

  1. I have the Camera Intrinsic Params that I have obtained from Opencv

  2. I have taken three images of X posed at different angles from different poses/angles

  3. Now my question is how do I populate model.txt file. For instance point (175,0,0) how do I read this? I am assuming that this is in camera coordinates and 175 doesnt indicate any specific UoM

Please help!

nbhr commented 5 years ago

In short, the points in model.txt are identical to the object points in OpenCV camera calibration.

I guess you used a chess pattern for your intrinsic camera calibration by OpenCV with providing the 3D positions of the chess corners as object points and their projections as image points.

Similarly, our calibration algorithm requires the 3D positions of the model points as model.txt and their 2D projections via a mirror in different poses as input?.txt. So if a chess pattern is used, model.txt should be identical to object points in OpenCV. If another object is used, please provide its geometry by yourself.

Hope this helps.

TNA8 commented 2 years ago

How to flip the detection result for input?.txt? screenshot

nbhr commented 2 years ago

It actually depnds on your implementation. If you are not sure, I would suggest using ChArUco pattern instead of the traditional chesspattern. It does not find the pattern if the image is mirrored (I guess). So you first need to flip the entire image anyway, find the pattern, and flip it back to get the origial corner position.

Anyway the key point is to make the points provided in input{1,2,3}.txt be the projections of the same line in model.txt.

TNA8 commented 2 years ago

Thanks for your reply. I have other questions.

Thanks in advance.

nbhr commented 2 years ago

Hi, while we recommend v2 basically, v1 should be ok as well. The unit in model.txt is arbitrary. if you describe the 3D point positions in meters, you get the mirror poses in meters as well. In your case, if you provide the 3D chess corner positions in pixels, your camera / mirror poses will be descibed in pixels.

TNA8 commented 2 years ago

Got it. Thanks