Forum

Author Topic: Changing region?  (Read 11243 times)

vkam

  • Newbie
  • *
  • Posts: 29
    • View Profile
Changing region?
« on: February 13, 2023, 03:28:55 AM »
Hello,

I am using Metashape 2.0 Pro software.  When I add photos and build the mesh and point cloud, everything works fine.  But when I import a camera calibration file to apply to the added photos, software complains about no tie points.  I believe I need to adjust/scale teh region of interest such that the photo tie points can again be correlated?  Would appreciate if somebody could help.

Thanks!

Vkam

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15710
    • View Profile
Re: Changing region?
« Reply #1 on: February 13, 2023, 12:22:11 PM »
Hello Vkam,

Can you provide the screenshot of the Camera Calibration dialog with the results of calibration data import?
Best regards,
Alexey Pasumansky,
Agisoft LLC

vkam

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: Changing region?
« Reply #2 on: February 14, 2023, 05:37:06 AM »
Hi Alexey,

Thanks for your response.  When I import my calera xml file, I see attached.  I also attached my modified camera calibration file (it has camera extrinsic and intrinsic data replaced).


vkam

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: Changing region?
« Reply #3 on: February 14, 2023, 05:42:06 AM »
Hi Alexey,

Here is a description of what I am seeing.  I posted on another thread.

We do have a fully featured calibration workflow - non Agisoft - for a camera array.  I am able to rework the extrinsic data from that process into a camera.xml file for Metashape (I run a session letting Metashape do the calibration, then export the camera XML, then hack it to overwrite my extrinsic and sensor calibration info).  The puzzling thing is, if I do:
1. Add Photos
2. Import hacked camera XML

Metashape brings up TiePoint computation GUI, but disables all images. Anyway, if I re-enable images and call up AlignPhotos() (there is no GUI item for tie point calculations), the function finds no matches.  But if I do:
1. Add photos
2. Run AlignPhotos() to calculate tie points
3. Import camera XML
4. Rerun AlignPhotos()

Then things "appear" to work.  I say appear because Metashape forces top left camera to be world origin for some odd reason.

In any case, I can process this odd looking workflow as a python script.  But I have low confidence that Metashape is actually doing what it appear to be doing.

Cheers!

Vkam

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15710
    • View Profile
Re: Changing region?
« Reply #4 on: February 14, 2023, 06:50:57 PM »
Hello Vkam,

Do you need to import only calibration information or you are interested in both exterior and interior orientation parameters import?
Best regards,
Alexey Pasumansky,
Agisoft LLC

vkam

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: Changing region?
« Reply #5 on: February 14, 2023, 10:49:15 PM »
Hello Alexey,

I am not sure what you mean by interior orientation.  I am interested in ingesting camera intrinsic parameters - i.e. focal length, principal point, distortion parameters (images are undistorted, so distortion params are zero).  I am also interested in ingesting camera extrinsic parameters - i.e. positions and orientations of cameras in a fixed rig.  We get very accurate values for these parameters using custom calibration software.  In my camera XML file, I also "fixed" the bounding box, with the assumption that might have something to do with failure of alignPhotos() (it is returning "no tie points").

I suspect, I am including some parameters in the camera XML, that might be putting alignPhotos() in a bad state - just a guess.

Thanks for your help!

Regards,

Vkam

vkam

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: Changing region?
« Reply #6 on: February 15, 2023, 04:33:09 AM »
Hello Alexey,

An update - I managed to figure out what was wrong with my camera calibration file.  Chunk label was wrong and camera "enabled" flags were being set to false.  Attached is an updated calibration file.

Now I can implement the expected workflow:
1.  Add photos
2.  Import camera calibration file
3.  Compute tie points from GUI that pope up
4.  ....

One thing that does not seem right - when I re-export camera calibration file, I see the camera intrinsic parameters changed.  Also, all camera extrinsic are expressed with reference to top left camera.  See attached re-exported camera calibration file (cam_cal_ms_tiny.xml)

vkam

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: Changing region?
« Reply #7 on: February 16, 2023, 09:45:07 PM »
Hello Alexey,

An update - I think we have a resolution, although we don't understand it.  Might be pointing to a bug in Metashape.  I am attaching two xml fragments - good_sample.txt and bad_sample.txt.  These enumerate how intrinsic information is ingested to Metashape.  When we ingest data with calibration as "fixed" and all fields frozen (that's our interpretation of fixed), the software builds very few tie points.  When we ingest intrinsic as in good_sample.txt - almost identical information, except p1 and p2 are not zero (not sure about cx and cy), the software produces good tie points and successfully builds mesh.

Hope this is helpful to others using camera rigs and to you as well.

Regards,
VKam

vkam

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: Changing region?
« Reply #8 on: February 18, 2023, 08:42:04 PM »
Re-attaching - correctly this time.

I believe we narrowed down the problem to interpretation of cvx and cy.  Metashape software wants to see cx = 0 and cy = 0.  In our conventional understanding, cx = image_width / 2 - 0.5 and cy = image_height / 2 - 0.5

VKam

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15710
    • View Profile
Re: Changing region?
« Reply #9 on: February 20, 2023, 04:12:57 PM »
Hello VKam,

Were you able to get the desired results after fixing cx and cy values (as estimated from the middle of the image)?
Best regards,
Alexey Pasumansky,
Agisoft LLC