Forum

Author Topic: Are cx, cy offsets from the image center?  (Read 1619 times)

KevinCain

  • Newbie
  • *
  • Posts: 7
    • View Profile
Are cx, cy offsets from the image center?
« on: February 05, 2024, 09:40:39 PM »
In the usual camera intrinsics matrix 'cmat', principal point cx and cy values are usually reported relative to the top left corner of the image. When I export cameras from a working MetaShape scene, I see the focal length is close to what I expect from ground truth, but the cx and cy values are too small to be correct:

        <calibration type="frame" class="adjusted">
          <resolution width="4096" height="3072"/>
          <f>3219.6608142452687</f>
          <cx>15.06484921721751</cx>
          <cy>18.666422272474204</cy>
          <k1>0.020779613732155765</k1>
          <k2>-0.07437917334021335</k2>
          <k3>0.092287814089154596</k3>
          <p1>0.0015838090169121772</p1>
          <p2>0.001715584978710574</p2>
        </calibration>

Are cx, cy perhaps offsets from the image center rather than from the top-left corner? This interpretation is somewhat unconventional for camera intrinsics, where cx & cy denote the absolute position of the principal point in the image coordinate system, measured from the top-left corner.

Paulo

  • Hero Member
  • *****
  • Posts: 1354
    • View Profile
Re: Are cx, cy offsets from the image center?
« Reply #1 on: February 06, 2024, 12:09:52 AM »
Yes Kevin.

the principal point offset is from image center as User Manual:

Code: [Select]
u = w * 0.5 + cx + x'f + x'B1 + y'B2
v = h * 0.5 + cy + y'f

where w is image width and h image height in pixels and u, v are image coordinates (pixels) relative to top left corner. So in your referenced model, the principal point coordinates are  (w * 0.5 + cx, h * 0.5 + cy)
« Last Edit: February 06, 2024, 01:10:36 AM by Paulo »
Best Regards,
Paul Pelletier,
Surveyor

KevinCain

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Are cx, cy offsets from the image center?
« Reply #2 on: February 07, 2024, 04:33:08 AM »
Thanks for confirming. this makes sense.

My only question is how to make the minor correction to account for B1, per your thread here:
using B1 affinity coefficient of Agisoft calibration, the relationship between f, fx and fy is following:
Code: [Select]
fy = f
fx = f + B1
« Last Edit: February 07, 2024, 04:38:37 AM by KevinCain »