Skip to content

Calculate localization error using sfm_gt as reference model #465

@davidng82

Description

@davidng82

I ran COLMAP successfully with my RGB data. My dataset includes synchronized RGB, depth, and IMU data for each timestamp. After running COLMAP, I used the script create_gt_sfm.py to generate a ground-truth model (sfm_gt) using depth information.

Now, I want to calculate localization error. Here's what I’ve done so far:

  1. Split RGB data
    I split the RGB images into an 80% training set and 20% test set.

  2. Feature extraction (on training set)
    Local features:
    python -m hloc.extract_features
    --image_dir images_train
    --export_dir outputs/train_hloc
    --conf superpoint_max

Global features:
python -m hloc.extract_features
--image_dir images_train
--export_dir outputs/train_hloc
--conf netvlad

  1. Image retrieval (get pairs)
    python -m hloc.pairs_from_retrieval
    --descriptors outputs/train_hloc/global-feats-netvlad.h5
    --output outputs/train_hloc/pairs-train-netvlad.txt
    --num_matched 20

  2. Match features
    python -m hloc.match_features
    --pairs outputs/train_hloc/pairs-train-netvlad.txt
    --features feats-superpoint-n4096-r1024
    --export_dir outputs/train_hloc
    --conf superglue

  3. Problem when running triangulation
    python -m hloc.triangulation
    --sfm_dir outputs/train_hloc/sfm_localized
    --reference_sfm_model outputs/sfm_gt
    --image_dir images_train
    --pairs outputs/train_hloc/pairs-train-netvlad.txt
    --features outputs/train_hloc/features.h5
    --matches outputs/train_hloc/matches.h5

But I get an error like this: KeyError: "Unable to synchronously open object (object 'XYZ.png' doesn't exist)".
I assume this is because the sfm_gt was generated from the full RGB dataset, while I am now trying to triangulate using only the 80% training subset (images_train).

Questions:
For the --reference_sfm_model argument, is it okay to use sfm_gt, even though it includes all RGB images?
If not, should I generate a new sfm_gt that uses only the images_train subset?
Is there a way to skip the missing-image check or restrict triangulation to the intersecting images?

Any suggestions would be greatly appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions