how to Import Agisoft Camera Alignment in Realitycapture

Hello,

Recently, I’ve been using RealityCapture to process some scanned datasets, which are sequences of images. However, I found that RealityCapture couldn’t effectively align these data, while Metashape could align most of them. Therefore, I hope to transfer the alignment results from Metashape to RealityCapture.

Initially, I exported a point cloud based on tie points from Metashape in E57 format, containing approximately over three hundred thousand points. Unfortunately, RealityCapture doesn’t support importing this format, resulting in import failure. I tried importing this E57 file into CloudCompare and MeshLab, and they imported it successfully.

Subsequently, I generated another point cloud based on depth maps in Metashape, with around over thirty million points. This time, I successfully imported it into RealityCapture, but the displayed points were very sparse. In the 1D panel list, only a few thousand points were displayed, resulting in very poor model quality.

Later, I learned from the forum that the alignment results from Metashape can be exported in Bundle out format for use in RealityCapture. I followed the instructions provided by the forum staff, but RealityCapture reported that it couldn’t find the file.

I found that this post is quite old, and the images in it cannot be displayed properly. Therefore, I’m seeking help here. (https://forums.unrealengine.com/t/import-agisoft-camera-alignment/711976)

My questions are:

  1. Does RealityCapture support importing alignment results exported as point clouds from Metashape?
  2. How can I correctly import the alignment results from Metashape into RealityCapture in Bundle out file format?

Software versions and system environment:

  • Windows 11 23H2
  • RealityCapture version: 1.4.0.117414RC
  • Metashape version: v2.1.1 build 17695

Thank you very much for your reply!

Hi,
for the point cloud import you can try this workflow:Texturing Handheld Laser Scan Models | Tutorial
Regarding your second question, what problem do you have exactly? Are you following all advices from that post? Also this can help: Bundler .OUT file not working.

Thank you for your reply.

Regarding the video tutorial you provided for the first question, it seems unrelated to my needs. Actually, the dataset I’m dealing with is a forest scanned using photogrammetry. It aligns poorly in RealityCapture (RC), but aligns well in Metashape. Therefore, I want to export the point cloud generated by Metashape (regardless of whether it’s tie points or depth-based) as an E57 file and import it into RC to start the model calculation process.

As for the second question, I have read both the post you provided and the one you suggested. I can confirm that I followed the instructions in the post diligently. Each line in my list.txt corresponds to the name of a jpg file, and the images are named accordingly. The number of files matches the number of entries in the txt file. However, RC still reports that it cannot find the files. I hope to receive further guidance from you.

Thank you for your assistance.

OK then, for the first case it is not possible to do now. I thought something else by recommending the mentioned workflow. I am sorry for that.

Can you share some more information regarding your bundle issue? Do you have all data in one folder? Is it like this:


How does look your OUT file?

Are there some not aligned images in Metashape? If so, first removed all of the unaligned images in Metashape, then export the undistorted images using the “framenum” method. Then write a small batch file to create the image list so it had the exact right number of images in it and named correctly in this case 2580

1 Like

This is the way.

I haven’t even gone as far as using this batch file, I’m just exporting the calibrated images.


As shown in the screenshot, there are a total of 378 photos. There are 378 lines in list.txt. I even wrote a small script to check for any extra photos.

The result is obvious:
image

In fact, I found this problem when exporting in Metashape. It defaults to exporting all photos, so I removed the misaligned photos in Metashape before exporting. This is how I exported in Metashape (Sorry, I blurred some information because that is another projects):


image
The exported out file can be opened with an editor, and the content is like this:

Still not sure where the problem occurred that caused rc to fail to import the out project file. Looking forward to your further guidance.

Hi, I suppose the issue will be the non consistency in the naming of the images. As you have image named 398.JPG and next one is 409.JPG. There are missing 399, 400 etc. I suppose the maximal image name should be 378.JPG for your case.


Does it mean that the photo names must be consecutive? Including the image file names and the contents of the list.txt file? But when I aligned in MS, photos 399-408 were not aligned, so I removed them.

Yes, I think so.
How have you removed those images from Metashape? Have you just deleted them or created a new project without those images.
I suppose it won’t be just 399-408 images, also the other ones, as you have quite big difference between names and orders (363 - 398.JPG)

I am aligning photos in MS, and there are some photos that are not aligned. I will delete the unaligned photos in MS, and then export the photos and out files. So, am I doing the right thing by exporting photos in MS? Is it the image conversion function in the MS software that I showed in the screenshot above? Also, if the aligned photos in the MS software must be consecutively named, it doesn’t seem very reasonable because there are always photos that are not aligned, and the alignment results are not the same each time. Even if I align them and remove the unaligned photos from the folder on the hard drive, then rename the remaining photos as a sequence without gaps, and align them in MS again, there may still be photos that are not aligned… So, I can try…

Hi,
I checked this and not aligned images are not exported to the bundle from MS.
To export you should use Export Cameras option, not Convert images.
Exported list file will have the original names of the images, you need to rewrite that according their order in the list. Also, the images have to have the same name and the maximal nave value should be the number of aligned images in MS.
Like, there is one not aligned image (26 is aligned out of 27):


Exported list is without that camera:
image
These needs to be renamed accordingly:
image
and also the cameras in the folder:
image