Created
February 5, 2019 19:59
-
-
Save etrulls/e721e9f158225f82a2280246802230f0 to your computer and use it in GitHub Desktop.
Compute track length
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from colmap.scripts.python.read_model import read_model, qvec2rotmat | |
from colmap.scripts.python.read_dense import read_array | |
from imageio import imread | |
import matplotlib.pyplot as plt | |
import deepdish as dd | |
import h5py | |
import matplotlib.patches as patches | |
from time import time | |
root = '/cvlabdata1/cvlab/datasets_eduard/colmap/' | |
# root = '/cvlabdata1/cvlab/datasets_eduard/colmap_pa/' | |
# seq = 'reichstag' | |
seq = 'sacre_coeur' | |
src = root + '/' + seq | |
cameras, images, points = read_model(path=src + '/dense/sparse', ext='.bin') | |
print(f'Cameras: {len(cameras)}') | |
print(f'Images: {len(images)}') | |
print(f'3D points: {len(points)}') | |
num_obs = [] | |
for idx in points: | |
num_obs.append(len(np.unique(points[idx].image_ids))) | |
num_obs = np.array(num_obs) | |
print(num_obs.min()) | |
print(num_obs.max()) | |
print(num_obs.mean()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment