Forum

Author Topic: Calculation of pixel size by Metashape  (Read 3177 times)

UAV_project

  • Newbie
  • *
  • Posts: 25
    • View Profile
Calculation of pixel size by Metashape
« on: March 13, 2020, 12:21:05 PM »
I have noticed that Metashape will calculate the pixel_width, pixel_height, and pixel_size seemingly on its own (using the python API) when no values are explicitly provided. The values are very close to what I have calculated myself, but there is still some discrepency:

My calculation :  0.003916667
Metashape calc : 0.00403846

So I am wondering, how does Metashape come up with this value? For my own calculation I used the sensor width or height in mm divided by sensor width or height in pixels.

Also, what would the effect be, using one over the other? Does the use of values which differ by such a small margin have any real effect on the output (DEM, orthomosaic)?

Thanks!

UAV_project

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: Calculation of pixel size by Metashape
« Reply #1 on: March 16, 2020, 01:21:30 PM »
Any ideas? I am mainly just wondering if I should set these values with my own simple calculations or just leave it to Metashape? Since I just found this simple formula through googling I am not sure if it is the best method of calculation for pixel sizes.

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14855
    • View Profile
Re: Calculation of pixel size by Metashape
« Reply #2 on: March 16, 2020, 03:33:14 PM »
Hello UAV_project,

"pixel size (mm)" value in Metashape is based on the following EXIF tags: FocalPlaneXResolution, FocalPlaneYResolution and FocalPlaneResolutionUnit

In case they are missing or incomplete, the value is estimated basing on FocalLength and FocalLengthIn35mmFilm tags in the following way:
pixel_size = FocalLength / FocalLengthIn35mmFilm * Diag35_mm / Diag_pix,
where Diag35_mm = sqrt(36^2 + 24^2) and Diag_pix = sqrt(width_pix^2 + height_pix^2)

Pixel_size and Focal_length (both in mm) are used only to define the Initial value for the focal length in pixels (if Auto option is selected) which is then adjusted during alignment and optimization operations, so if you are calculating the values by some other means and there's a small difference, it is not critical, unless you are fixing the focal length adjustment.
Best regards,
Alexey Pasumansky,
Agisoft LLC