Giter Site home page Giter Site logo

Comments (2)

mihaidusmanu avatar mihaidusmanu commented on July 21, 2024 4

Hello. We are using the colmap pose convention - i.e., world-to-camera with qvec in format w, x, y, z and tvec in format x, y, z (see https://colmap.github.io/format.html#images-txt). Thus, given a 3D point in world coordinates P, to obtain the coordinates in camera frame, you have to do something along the lines:

def mat_from_quat(quat):
    # quat is [w, x, y, z]
    from scipy.spatial.transform import Rotation as R
    rot = R.from_quat([quat[1], quat[2], quat[3], quat[0]]) # expects [x, y, z, w]
    mat = rot.as_matrix()
    return mat

R = mat_from_quat(qvec)
P_camera = R @ P + tvec

from pycolmap.

alexs7 avatar alexs7 commented on July 21, 2024

@mihaidusmanu This should work also when the points are in camera coordinates ?
At the end of the end they are just 3D points (does it matter if they are in camera space or world ) ?

from pycolmap.

Related Issues (20)

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.