AliceVision icon indicating copy to clipboard operation
AliceVision copied to clipboard

[calibration] Camera calibration format

Open simogasp opened this issue 8 years ago • 12 comments

Decide the format to use for the camera calibration file. Note that we must be able to deal with:

  • a camera with fixed intrinsics parameters
  • a camera with intrinsics parameters changing over time (f, pp, and k3)
  • a camera rig composed of N (N = {1,2,3}) cameras

So far for the camera localization (voctree or cctag based) a simple txt file is used using a format like this

// the structure of the file is
// int #image width
// int #image height
// double #focal
// double #ppx principal point x-coord
// double #ppy principal point y-coord
// double #k0
// double #k1
// double #k2

as explained here https://github.com/poparteu/openMVG/blob/voctree_localizer/src/openMVG/dataio/IFeed.cpp#L18

simogasp avatar Oct 22 '15 13:10 simogasp

Why not directly use the cereal serialization of the existing camera class

pmoulon avatar Oct 22 '15 14:10 pmoulon

yes, the json it's the natural and obvious solution, but we need to define how to deal with a video stream in which the camera calibration is changing over time. So we need something like frame ID -> camera calibration, for each frame or just whenever it changes. I don't know

simogasp avatar Oct 22 '15 14:10 simogasp

The SfM_Data format already support that. Why not create a sfm_data file for the video, with different intrinsic for each frame. So you save, load it for an entire video...

pmoulon avatar Oct 22 '15 14:10 pmoulon

yes, the thing i forgot to mention (i will added to the description) is that we deal with a rig of 3 cameras. So we need to take also that into account. (ie one of the camera may change the parameters while the other does not). BTW did you do anything to deal with a rig of cameras, ie like a class modeling the rig or other?

simogasp avatar Oct 22 '15 14:10 simogasp

In the SfM_Data class to make some intrinsics shared or not, so you can do whatever you want.

Regarding the rig: I have started a functional draft here: https://github.com/pmoulon/openMVG/blob/develop_rig_subposes/src/openMVG/cameras/Camera_Pinhole.hpp#L136 In which you must update the subpose with known data.

Additionnaly a RigView concept have been created: https://github.com/pmoulon/openMVG/blob/develop_rig_subposes/src/openMVG/sfm/sfm_view.hpp#L73 The idea is to store additional info like the RIG id & subchannel id

pmoulon avatar Oct 22 '15 14:10 pmoulon

cool, that could be useful. If i understand correctly a rig is composed of several Rig_Pinhole_Intrinsic, each having a subpose wrt some reference camera. And then in sfmdata each view is like a normal view but it also contains the reference to the rig ID (in case there are several rigs) and an its internal ID inside the rig

simogasp avatar Oct 22 '15 15:10 simogasp

You got it. I think it was a flexible solution. The other solution was to make all intrinsic have a subpose and let it bet Id by default (but this solution impose to check always if the subpose is Id or not). I have preferred to make a new class first to test and ensure that the design fit the needs.

pmoulon avatar Oct 22 '15 15:10 pmoulon

Ok thanks!

simogasp avatar Oct 22 '15 15:10 simogasp

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar May 11 '20 00:05 github-actions[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar May 07 '21 00:05 github-actions[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar May 04 '22 00:05 github-actions[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Apr 30 '23 00:04 github-actions[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Apr 25 '24 00:04 github-actions[bot]