Home

Awesome

VP-Estimation-with-Prior-Gravity

Implementation of the paper Vanishing Point Estimation in Uncalibrated Images with Prior Gravity Direction (ICCV 2023)

We propose a set of new solvers to extract the 3 orthogonal vanishing points of an uncalibrated image (i.e. unknown focal length), given a prior on the gravity direction. This repo assumes a Manhattan world with 3 main directions x, y, z. We also give the implementation of previous solvers that also work without prior gravity or with calibrated images.

teaser

Installation

Dependencies

The following dependencies need to be installed on your system:

Instructions

Clone the repository and its submodules: git clone --recurse-submodules https://github.com/cvg/VP-Estimation-with-Prior-Gravity.git

Install the necessary requirements and the Python package:

pip install -r requirements.txt
pip install -Ive .

Demo usage

Check out the demo notebook for an example of VP estimation with our hybrid solver.

Which solver shall I use?

<table style="width:100%" align="center"> <tr> <th align="center">Calibrated images</th> <th align="center">Known gravity</th> <th align="center">Solver to use</th> </tr> <tr> <td align="center" rowspan="2">Yes</td> <td align="center">Yes</td> <td align="center">calibrated_100g</td> </tr> <tr> <td align="center">No</td> <td align="center">calibrated_210</td> </tr> <tr> <td align="center" rowspan="2">No</td> <td align="center">Yes</td> <td align="center">hybrid</td> </tr> <tr> <td align="center">No</td> <td align="center">uncalibrated_220 or uncalibrated_211</td> </tr> </table>

Evaluation

Download the test datasets: YorkUrbanDB, ScanNet (follow the instruction in the NeurVPS ReadMe), and Lamar (we use the 4 sequences of the validation query images of the CAB building, located in CAB/sessions/query_val_hololens).

Then run one of the scripts runners/run_york_urban.py, runners/run_scannet.py, or runners/run_lamar.py. For example, a typical run on YorkUrban would be:

python runnners/run_york_urban.py <name of the solver> <path to the YorkUrban dataset> --nms non_orth --line_detector lsd --use_gt_gravity --magsac_scoring

Here are a few explanations on the options:

Bibtex

If you use this code in your project, please consider citing the following paper:

@InProceedings{Pautrat_2023_UncalibratedVP,
    author = {Pautrat, Rémi and Liu, Shaohui and Hruby, Petr and Pollefeys, Marc and Barath, Daniel},
    title = {Vanishing Point Estimation in Uncalibrated Images with Prior Gravity Direction},
    booktitle = {International Conference on Computer Vision (ICCV)},
    year = {2023},
}