GithubHelp home page GithubHelp logo

dylan-campbell / gosma Goto Github PK

View Code? Open in Web Editor NEW
21.0 2.0 4.0 78 KB

The Globally-Optimal Spherical Mixture Alignment (GOSMA) algorithm

Home Page: https://sites.google.com/view/djcampbell/research-software

License: GNU General Public License v3.0

CMake 0.84% C++ 61.88% Cuda 37.28%

gosma's Introduction

Globally-Optimal Spherical Mixture Alignment (GOSMA)

This code implements the GOSMA algorithm for estimating the position and orientation of a calibrated camera from a single image with respect to a 3D model.

Copyright (c) 2019 Dylan John Campbell

Installing

Dependencies

Operating System

  • Developed and tested on Ubuntu 18.04 LTS
  • May be compiled on other systems, although no guarantee is given

Installing on Linux

  1. In the src folder, copy (or link to) the CppNumericalSolvers folder
  2. In the release folder, open a terminal
  3. Run: cmake -D CMAKE_BUILD_TYPE=Release ../src
  4. Run: make

Running

  1. Run the following command from the terminal in the Release folder (arguments in square brackets are optional):
./gosma point-set_filename bearing-vector-set_filename config_filename output_filename [translation_domain_filename [rotation_domain_filename]]

Inputs

  • point-set_filename: filename of a plain text file with rows of whitespace-separated coordinates [x y z]
  • bearing-vector-set_filename: filename of a plain text file with rows of whitespace-separated normalised coordinates [x y z]
  • config_filename: filename of a configuration file, see ./release/config.txt
  • output_filename: filename of the file in which to append the program output
  • translation_domain_filename [optional]: filename of a plain text file with rows of whitespace-separated coordinates and side-widths [x y z wx wy wz] where [x y z] are the coordinates of minimum vertex and [wx wy wz] are the cuboid's side-widths
  • rotation_domain_filename [optional]: filename of a plain text file with rows of whitespace-separated coordinates and side-widths [x y z wx wy wz] where [x y z] are the coordinates of minimum vertex and [wx wy wz] are the cuboid's side-widths
  • If more than a single class is present, the user may optionally include class count files, to be located in the same directory as the data files (point-set and bearing vector set files).
    • Assumes that the file name is the same as the data file name with "_class_counts" appended
      • e.g. point_set_class_counts.txt
    • Format: <label number>
      • Class labels are assumed to correspond between 2D and 3D data

Output

  • The output is appended to the output file in the form [tx ty tz R11 R12 R13 R21 R22 R23 R31 R32 R33 l d1 d2 c]
  • t is a 3x1 translation vector
  • R is a 3x3 rotation matrix such that the transformed point-set P' = R(P - t) is aligned with the bearing vector set F
  • l is L2 distance of the mixture models at the output transformation
  • d1 is the runtime duration (in seconds) of the GOSMA algorithm
  • d2 is the runtime duration (in seconds) of generating the mixture models
  • c is the optimality certificate (1 if optimal)

Settings

  • See ./release/config.txt
  • GPUs: if more than one GPU is available, adjust kNumDevices in gosma.cu accordingly

Citation

Any publications resulting from the use of this code should cite the following paper:

Dylan Campbell, Lars Petersson, Laurent Kneip, Hongdong Li, and Stephen Gould, "The Alignment of the Spheres: Globally-Optimal Spherical Mixture Alignment for Camera Pose Estimation", IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Long Beach, USA, IEEE, Jun. 2019

Please use the following bibtex entry:

@inproceedings{campbell2019globally,
  author = {Campbell, Dylan and Petersson, Lars and Kneip, Laurent and Li, Hongdong and Gould, Stephen},
  title = {The Alignment of the Spheres: Globally-Optimal Spherical Mixture Alignment for Camera Pose Estimation},
  booktitle = {Proceedings of the 2019 Conference on Computer Vision and Pattern Recognition (CVPR)},
  pages={to appear},
  address={Long Beach, USA},
  month = {June},
  year = {2019},
  doi={},
  organization={IEEE}
}

Licence

This project is licensed under the GNU General Public License v3.0 - see the LICENSE.md file for details.

gosma's People

Contributors

dylan-campbell avatar

Stargazers

duan-she-li avatar XStarry avatar  avatar K9 avatar Sean Lee avatar Hongkai_Ding avatar Jin Wu avatar Patrick avatar Wang ruoxiao avatar Shijie Lin avatar Jan Schmidt avatar liumz avatar Zilin Si avatar Kristijan Bartol avatar  avatar Sérgio Agostinho avatar Shihao Jiang (Zac) avatar Huai Yu avatar  avatar Romain Janvier avatar  avatar

Watchers

James Cloos avatar Romain Janvier avatar

gosma's Issues

Ground Truth of sample data

Hi Dylan,

I have tried both of your nice works, the gopac, and gosam.
But when using the same sample data as provided in the code file, I found that they generate two different results.
GOPAC:
0.9771 -0.1823 0.1099 -0.4097
-0.0002 0.5155 0.8569 0.6900
-0.2129 -0.8373 0.5036 3.1726

GOSMA:
-0.4018 0.0936 -0.9109 -0.7847
0.4731 0.8729 -0.1190 0.3235
0.7840 -0.4788 -0.3951 2.4940
Both certificates the optimality. I cant differential them.
So could you share with me the ground truth of the sample data?

Best,
EB

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.