-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[question] Camera intrinsics matrix from cameras.sfm #2326
Comments
px and py are offsets wrt the center of the image. I know it's not the standard way that everybody uses but here you have to add px and py to Also I never remember in which format, row-major or colum-major, the matrices are saved. If after fixing the px and py problem you still have a large projection error try to read R and transpose it before using it. |
Also for the focal length, again it is not a standard format as it is expressed in mm. To get it back in pixel you can use the formula
|
As for the matrix, it should be stored in column-major order as per default in Eigen |
hey @simogasp, thanks a lot! The projection is still way off unfortunately.
gives |
It's coming from here when reading the exif and here when reading from json
with fmm the focal in mm from the json and fx the focal on the x in pixels. It's confusing because the focal length in pixel is always used for all computations but it's exported in mm for compatibility with the ABC and software like Maya Blender and so on. @fabiencastan @servantftechnicolor can you check if it is the right conversion? I see that you transpose R in the snippet of code. I imagine that without transposing it does not work either, does it? |
Yeah indeed it doesn't work without transposing R either. Is pheraps the way I compute the coordinates wrong? |
just to be sure because I don't speak numpy, I was assuming that
is the matrix product of the matrices, right? so that we correctly have |
Thanks a lot! I got it just now. All the things you suggested were correct:
But now it works perfectly even without distortion parameters! Thanks again!! |
That was my next question. I was smelling the usual problem with the different conventions used for expressing the camera frame from computer graphics and computer vision... It's always the usual suspect! ;-) Just for future reference would you mind posting your working snippet of code, like the one above? Thanks! |
yes of course! from the json I posted at the beginning of the question i get the data, then:
and that works perfectly :) thanks again |
Describe the problem
I am trying to obtain the projection coordinates on an image of a 3D point of the mesh generated with Meshroom. However when constructing the camera intrinsic matrix as described in [(https://en.wikipedia.org/wiki/Camera_resectioning)] I get wrong results.
This is what i get from cameras.sfm after structure from motion.
from here I did the following:
obtaining
point_image = array([ 13.60954989, -25.90018649, 1. ])
which is unfortunately incorrect. Therefore my questions are the following:additional info both the coordinates of the point and the camera center are in meters (obtained from blender), but i guess rescaling everything in mm would not make a difference. Is this wrong?
Desktop (please complete the following and other pertinent information):
The text was updated successfully, but these errors were encountered: