Forum

Author Topic: Camera calibration - focal length or equivalent focal length?  (Read 28228 times)

madmage

  • Newbie
  • *
  • Posts: 10
    • View Profile
Camera calibration - focal length or equivalent focal length?
« on: October 23, 2015, 04:25:37 PM »
Dear all,
I am using a Xiaomi Yi camera and I am not sure the EXIF data on the pictures it produces are correct. There are two main issues I see:
1) the focal length of the calibration dialog is the equivalent focal length or the true focal length? the EXIF shows 2.73mm, which is the true focal length, it is not clear for me how the software can retrieve the crop factor in order to compute the equivalent focal length
2) the camera has a flag to "rectify" the images produced, that removes the barrel distortion of the pictures, the problem seems that this doesn't change the EXIF data, so that PhotoScan expect a distorted image, while the camera is providing an undistorted one

madmage

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Camera calibration - focal length or equivalent focal length?
« Reply #1 on: October 25, 2015, 12:19:37 PM »
How is it possible that nobody knows this? Do you always trust the EXIF data???

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15729
    • View Profile
Re: Camera calibration - focal length or equivalent focal length?
« Reply #2 on: October 25, 2015, 01:05:57 PM »
Hello madmage,

PhotoScan uses both focal length in mm and sensor pixel size to convert focal length into pixel units. So you do not need to recalculate focal length accoriding to the camera crop factor.
Best regards,
Alexey Pasumansky,
Agisoft LLC

madmage

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Camera calibration - focal length or equivalent focal length?
« Reply #3 on: October 26, 2015, 02:54:39 PM »
Hello madmage,

PhotoScan uses both focal length in mm and sensor pixel size to convert focal length into pixel units. So you do not need to recalculate focal length accoriding to the camera crop factor.

Thanks for the answer!
So... how does it retrieve the sensor pixel size? (I am trying to understand if the computation done using the EXIF data is right or wrong).

Second thing: the camera has a built-in rectifier for the photos (to undistort the fish-eye effect). Do you think it's better to turn this feature off and then use the "fisheye" option in the camera settings of PhotoScan(Pro), or turn the camera feature on and leave the PS setting to "frame"? I'm afraid that with the rectification, the EXIF data, remaining the same, are completely wrong.

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15729
    • View Profile
Re: Camera calibration - focal length or equivalent focal length?
« Reply #4 on: October 26, 2015, 03:17:52 PM »
Hello madmage,

PhotoScan reads the following tags from EXIF to estimate focal length in pixels:

FocalLength,
FocalPlaneXResolution,
FocalPlaneYResolution
Best regards,
Alexey Pasumansky,
Agisoft LLC

madmage

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Camera calibration - focal length or equivalent focal length?
« Reply #5 on: October 26, 2015, 03:22:48 PM »
Hello madmage,

PhotoScan reads the following tags from EXIF to estimate focal length in pixels:

FocalLength,
FocalPlaneXResolution,
FocalPlaneYResolution

In the EXIF of the photos I am processing, there is only the FocalLength field, not the other two. So: how is PhotoScan deducing/retrieving/computing the sensor size?

James

  • Hero Member
  • *****
  • Posts: 772
    • View Profile
Re: Camera calibration - focal length or equivalent focal length?
« Reply #6 on: October 26, 2015, 03:24:03 PM »
Second thing: the camera has a built-in rectifier for the photos (to undistort the fish-eye effect). Do you think it's better to turn this feature off and then use the "fisheye" option in the camera settings of PhotoScan(Pro), or turn the camera feature on and leave the PS setting to "frame"? I'm afraid that with the rectification, the EXIF data, remaining the same, are completely wrong.

If nothing else, i would turn off the rectification because defishing to rectilinear is going to crop out potentially useful portions of the image, and photoscan seems to do a good job of sorting out lens distortion all by itself anyway.

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15729
    • View Profile
Re: Camera calibration - focal length or equivalent focal length?
« Reply #7 on: October 26, 2015, 03:30:23 PM »
In case PhotoScan is not able to derive focal length and pixel pitch size information, it will assume that focal length in 35 mm equivalent equals to 50 mm.
Best regards,
Alexey Pasumansky,
Agisoft LLC

madmage

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Camera calibration - focal length or equivalent focal length?
« Reply #8 on: October 26, 2015, 03:39:24 PM »
In case PhotoScan is not able to derive focal length and pixel pitch size information, it will assume that focal length in 35 mm equivalent equals to 50 mm.

35mm focal length (that, in my case is completely wrong, since it is 2.73mm)... and what pixel size? how can I insert the right values if I found them?

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15729
    • View Profile
Re: Camera calibration - focal length or equivalent focal length?
« Reply #9 on: October 26, 2015, 03:41:09 PM »
Hello madmage,

You can type in correct values in the corresponding fields of the Camera Calibration window: Pixel Size (mm) and Focal Length (mm).
Best regards,
Alexey Pasumansky,
Agisoft LLC

madmage

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Camera calibration - focal length or equivalent focal length?
« Reply #10 on: October 26, 2015, 04:06:32 PM »
Hello madmage,

You can type in correct values in the corresponding fields of the Camera Calibration window: Pixel Size (mm) and Focal Length (mm).

Thanks for you fast responses!
The sensor that my camera mounts seems to be this one:
http://www.sony.net/Products/SC-HP/new_pro/december_2013/imx206_e.html
that the specs says to have a "Diagonal 7.77 mm (Type 1/2.3) approx. 16.35M effective pixels (4672H x 3500V)" size, so what number should I put in "Pixel Size (mm)" field? How to compute it?

Thanks again!

madmage

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Camera calibration - focal length or equivalent focal length?
« Reply #11 on: October 26, 2015, 04:21:12 PM »
"Diagonal 7.77 mm (Type 1/2.3) approx. 16.35M effective pixels (4672H x 3500V)" size, so what number should I put in "Pixel Size (mm)" field? How to compute it?

Thanks again!

If I open the photos in PhotoScan, in the camera calibration dialog, it already contains the following values:
Pixel Size (mm): 0.000854441 x 0.000854441
Focal Length (mm): 2.73

It seems like PhotoScan has retrieved the pixel size somewhere (where??) and that they are not what I would expect: the diagonal pixel size is sqrt(4672^2+3500^2) = ~5838, so the pixel size should be something like 7.77mm/4858 pixels = 0.0013309, am I wrong?

Paulo

  • Hero Member
  • *****
  • Posts: 1629
    • View Profile
Re: Camera calibration - focal length or equivalent focal length?
« Reply #12 on: October 26, 2015, 04:50:22 PM »
Hello,

these sensor size 1/2.3 16 MP have pixel size of around 1.34 um or 0.00134 mm... so this value should be entered in pixel size filed...

ths focal length of 2.73 mm semms almost to correspond to super wide angle or fisheye camera...
Best Regards,
Paul Pelletier,
Surveyor

madmage

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Camera calibration - focal length or equivalent focal length?
« Reply #13 on: October 26, 2015, 05:15:16 PM »
Hello,

these sensor size 1/2.3 16 MP have pixel size of around 1.34 um or 0.00134 mm... so this value should be entered in pixel size filed...

ths focal length of 2.73 mm semms almost to correspond to super wide angle or fisheye camera...

Thanks pap@1956, I am testing the reconstruction using these parameters (1h to go). What about the second issue? Since it is a fisheye lens, should I:
1) enable the camera built-in rectifier function and set the camera type to "frame" in PhotoScan;
2) disable the camera built-in rectifier function and set the camera type to "fisheye" in PhotoScan?

Paulo

  • Hero Member
  • *****
  • Posts: 1629
    • View Profile
Re: Camera calibration - focal length or equivalent focal length?
« Reply #14 on: October 26, 2015, 05:24:51 PM »
Madmage,

I would use original non rectified images and use Fisheye camera model in PhotoScan. I have done similar projects with Phantom Vision FC200 camera and using Fisheye model does it better than trying to undistort images with Adobe LightRoom lens profile correction for example and then use these undistorted frame images in PS.
Best Regards,
Paul Pelletier,
Surveyor