Skip to the content.

Automatic Estimation of the Scale Factor Based on Aruco Markers (Work in Progress!)

PyPI - Python Version PyPI GitHub Workflow Status license

About

This project aims to automatically compute the correct scale of a point cloud generated with COLMAP by placing an aruco marker into the scene.

Installation

PyPi

This repository is tested on Python 3.6+ and can be installed from PyPi

pip install aruco-estimator

Usage

Dataset

An exemplary data set is provided. The dataset shows a simple scene of a door with an aruco marker. Other dataset might follow in future work. It can be downloaded by using

from aruco_estimator import download

dataset = download.Dataset()
dataset.download_door_dataset(output_path='.')

Scale Factor Estimation

An example of how to use the aruco estimator is shown below.

from aruco_estimator.aruco_localizer import ArucoLocalizer
from aruco_estimator.visualization import ArucoVisualization
from aruco_estimator import download
from colmap_wrapper.colmap import COLMAP
import os
import open3d as o3d

# Download example dataset. Door dataset is roughly 200 MB
dataset = download.Dataset()
dataset.download_door_dataset()

# Load Colmap project folder
project = COLMAP(project_path=dataset.dataset_path, image_resize=0.4)

# Init & run pose estimation of corners in 3D & estimate mean L2 distance between the four aruco corners
aruco_localizer = ArucoLocalizer(photogrammetry_software=project, aruco_size=dataset.scale)
aruco_distance, aruco_corners_3d = aruco_localizer.run()
logging.info('Size of the unscaled aruco markers: ', aruco_distance)

# Calculate scaling factor, apply it to the scene and save scaled point cloud
dense, scale_factor = aruco_localizer.apply() 
logging.info('Point cloud and poses are scaled by: ', scale_factor)
logging.info('Size of the scaled (true to scale) aruco markers in meters: ', aruco_distance * scale_factor)

# Visualization of the scene and rays 
vis = ArucoVisualization(aruco_colmap=aruco_localizer)
vis.visualization(frustum_scale=0.7, point_size=0.1)

# Write Data
aruco_localizer.write_data()

Registration and Scaling

In some cases COLMAP is not able to registrate all images into one dense reconstruction. If appears to be reconstructed into two seperated reconstruction. To registrate both (up to know only two are possible) reconstructions the aruco markers are used to registrate both sides using ArucoRegistration.

from aruco_estimator.registration import ArucoRegistration

scaled_registration = ArucoRegistration(project_path_a=[path2part1],
                                                    project_path_b=[path2part2])
scaled_registration.scale(debug=True)
scaled_registration.registrate(manual=False, debug=True)
scaled_registration.write()

To test the code on your local machine try the example project by using:

python3 aruco_estimator/test.py --test_data --visualize --frustum_size 0.4

Limitation / Improvements

Acknowledgement

Trouble Shooting

References

[1] Erich, F., Bourreau, B., Neural Scanning: Rendering and determining geometry of household objects using Neural Radiance Fields Link. 2022

Citation

Please cite this paper, if this work helps you with your research:

@inproceedings{meyer2023cherrypicker,
  title={CherryPicker: Semantic skeletonization and topological reconstruction of cherry trees},
  author={Meyer, Lukas and Gilson, Andreas and Scholz, Oliver and Stamminger, Marc},
  booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  pages={6244--6253},
  year={2023}
}