cvg / Hierarchical-Localization

Visual localization made easy with hloc
Apache License 2.0
3.12k stars 579 forks source link

SFM on Sequential Image Data #321

Open sumitsarkar1 opened 11 months ago

sumitsarkar1 commented 11 months ago

Hi...great toolbox....I am new to this field...just curious if we can use hloc to run on sequential / SLAM ike data...Machine Hall data set or Kitti Data set...and generate the camera trajectory / visual dodmetry and a sparse 3D model...specially the image retrieval process ...since we are using sequential / ordered data...given we know the intrinsics of the camera...lastly I am aware of the COLMAP format for camera intrinsic ...however I am a bit confused about the format of parameter "k" in opts = dict(camera_model='SIMPLE_RADIAL', camera_params=','.join(map(str, (f, cx, cy, k))))

jytime commented 6 months ago

You can check COLMAP https://github.com/colmap/colmap/blob/a36156a64191127f83f6011616044d889667209c/src/colmap/sensor/models.h#L224 for its definition. k is the radial distortion parameter


// Simple camera model with one focal length and one radial distortion
// parameter.
//
// This model is similar to the camera model that VisualSfM uses with the
// difference that the distortion here is applied to the projections and
// not to the measurements.
//
// Parameter list is expected in the following order:
//
//    f, cx, cy, k
//
struct SimpleRadialCameraModel
    : public BaseCameraModel<SimpleRadialCameraModel> {
  CAMERA_MODEL_DEFINITIONS(
      CameraModelId::kSimpleRadial, "SIMPLE_RADIAL", 1, 2, 1)
};