Forum

Author Topic: How to use precise extrinsic and intrinsic to generate point clouds and mesh  (Read 1388 times)

conallwang

  • Newbie
  • *
  • Posts: 1
    • View Profile
Hello,

I have a multi-camera system of 38 cameras, and all cameras have precise extrinsics and intrinsics (calibrated with other approaches). Now I'd like to import these camera parameters into Metashape and generate point clouds and mesh based on them (with fixed extrinsics and intrinsics).

My workflow is like this:
- Import photos
- Set all intrinsics using Tools/Camera Calibration ... (Each camera has a camera group)
- Align photos using Workflow/Align Photos ...
- Export XML file using File/Export/Export Cameras ...
- Modify the content in the transform tag of the XML file to our precise extrinsics
- Re-import the XML file using File/Import/Import Cameras ...
- Generate point clouds and mesh

But this workflow cannot generate satisfactory results. I'm new to this software, so some issues are confusing me:
1. In the fourth step, I attempted to export both the XML file and the tie points, and attempted to use the transformation matrix in the transform tag of the XML file to project the tie points. But I cannot obtain a reasonable image in the corresponding view. So what's the meaning of the transformation matrix in the transform tag? Isn't it converting the coordinates of the camera coordinate system to the global coordinate system?

2. What's the standard workflow to generate point clouds and mesh with precise extrinsics and intrinsics?

Any hints would be much appreciated!

Many thanks!

vkam

  • Newbie
  • *
  • Posts: 28
    • View Profile
Hello conallwang,

Did you manage to get your issue resolved?  I am trying to implement a similar interface and having trouble.  Any help would be appreciated.

Regards,

Vkam

Kiesel

  • Sr. Member
  • ****
  • Posts: 332
    • View Profile
Hi vkam,

generally you can import cameras with intrinsics and extrinsics with the 'import cameras' command. But you need a project, where you have calibrated all cameras and exported them as XML-file (or in an other desired format) before.

Even this a little old , it's from 2016, perhaps it gives you an idea of the process:

https://www.youtube.com/watch?v=YKEUmzSvx7s


Best regards,

Kiesel
« Last Edit: February 14, 2023, 09:57:56 AM by Kiesel »

vkam

  • Newbie
  • *
  • Posts: 28
    • View Profile
Hello Kiesel,

Many thanks for your reply.  Will look into it.

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

Kiesel

  • Sr. Member
  • ****
  • Posts: 332
    • View Profile
Hi vkam,

1. I have just exported cameras from an existing project as XML-file.
2. Created a new project.
3  Added photos
4. Imported the cameras XML-file (images are aligned and references are disabled after this step)
5. Built tie points in upcoming menu (can be done in 'Tools/TiePoints/Build Tie Points...' too)

All works fine here.

Btw. there are other file fomats for camera export as you might know, see attchment.

Best regards,

Kiesel
« Last Edit: February 14, 2023, 10:32:33 AM by Kiesel »