Generate intrinsic matrix from exif values

asked 2018-03-14 06:01:51 -0600

KirbX gravatar image

updated 2018-03-14 06:54:03 -0600

Hi all! I'm trying to find the Essential Matrix in order to find the movement of one camera according to another.

I calculate F using SIFT matches, then findFundamentalMat with ransac to remove outliers then findFundamentalMat with LMEDS. The results seems good (the equation xEx' = 0 is nearly verified for each pairs (x,x'). Now, I would like to calculate E, using the formula E = K'(t)FK. Since I don't know which camera was used to generate photos, I would like to create K from scratch, but without any way to calibrate it, so I would like to use Exif values to create it. Actually i'm doing so :

K =  
 Fx  0  Cx  
  0   Fy  Cy  
  0    0   1

with (Cx, Cy) = (image.width/2, image.height/2) (I have to assume that the principale point is the middle of the image).

But for (Fx, Fy) actually i'm really not sure of what I'm doing...

Fx = focal_length(mm) * X_res(DPI) / 25.4 (because 1inch  = 25.4mm)

and

Fy = focal_length(mm) * Y_res(DPI) / 25.4

1st, i'm not sure if the formula is good and 2nd, I saw that openCV want pixel instead of mm for matrix but I don't understand...

Can someone help me?

Thanks!

edit retag flag offensive close merge delete