Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors when using Meshroom to make photogrammetry model of small (1 cm long) objects #2591

Open
megaraptor1 opened this issue Nov 3, 2024 · 11 comments

Comments

@megaraptor1
Copy link

I have been having trouble getting Meshroom to properly compile images into a 3D model using photogrammetry. I have been taking pictures of several specimens using a Canon EOS 90D macro lens (so focal length and lens information are available for all photos). These specimens are fairly small, the largest is about 1.2 cm in diameter. There are about ~150 pictures taken in several rings all around the specimen at different orientation angles (see below for reconstructed cameras). The specimen remains in the same position on every image but has merely been rotated on a turntable at angles of about 8-9 degrees between each image. The specimen is also on a background with unique, non-repeating symbols or imagery to make image matching easier. The pictures are all very crisp and it is possible to make out details on them very easily, so in theory it should be relatively straightforward for Meshroom to match the images.

Images of specimen are relatively crisp

Nevertheless, despite this Meshroom has consistently been unable to produce models of these specimens. I have tried taking photos of these specimens on two different occasions, as well as tried to create models for multiple specimens, but have been unable to.

On the first attempt, despite the specimen being in focus and sharply defined in each photo, Meshroom simply failed to reconstruct
cameras for about half of the total images.

Reconstructing specimen in Meshroom

This led to a lot of gaps in the model and a really distorted final product.

Resulting model

I tried taking pictures of the same specimen again from a different orientation and I did get all of the cameras (see picture below).

AMNH 28439 second attempt

In practice, the StructureFromMotion model for this attempt looked better but when I opened the resulting mesh for this file in MeshLab it was completely empty and only had a few triangles (which I got out of the Texturing subfolder of the MeshroomCache folder). Additionally, I get an error saying "the following textures have not been loaded: texture_1001.exr", which suggests a texture file was not output from Meshroom.

Second attempt resulting mesh

I tried this again with a second specimen and got similar results. Again, in this case all 164 cameras were accurately reconstructed (see image) and the StructureFromMotion model would suggest the model would turn out relatively okay.

Photograph of specimen 2

But once the process was finished when I opened the resulting model in Meshlab and there was nothing there but a few triangles.

Resulting mesh for specimen 2

I am unsure as to what is going wrong. I have been fairly diligent about doing things to improve mesh correlation and creation, but it doesn't seem to work. Notably, I've been able to get Meshroom to work with photographs of large objects from a distance and screenshots of a 3D model, but I haven't been able to get it to work with photos of these smaller specimens.

Desktop (please complete the following and other pertinent information):

  • OS: Windows 10
  • Python version: 3.7.4
  • Meshroom version: 2023.2.0
@msanta
Copy link

msanta commented Nov 4, 2024

Can you show some cropped in views of the subject at full resolution? To me it looks like the photos taken from the side do not have enough depth of field and Meshroom was unable to get enough features out of the specimen itself to work out the camera positions. In the image view there is an icon with 3 dots that shows the features that were detected in the image. Take a look to see what Meshroom detected on the specimen.
image

Are you able to get closer to the specimen so it takes up half the image and use focus stacking to get enough of it in focus?

As to why you didn't get a mesh from the second attempt I do not know. The point cloud looks decent enough. Double click on the meshing node which should show the mesh in the viewer. How many triangles is it reporting?

Are you able to share the images so I can play around with them?

@megaraptor1
Copy link
Author

Are you able to get closer to the specimen so it takes up half the image and use focus stacking to get enough of it in focus?

No, I do not think I can get any closer. I was already getting fairly close to the minimum possible focal distance and when I tried to get closer the camera would fail to take the picture.

As to why you didn't get a mesh from the second attempt I do not know. The point cloud looks decent enough. Double click on the meshing node which should show the mesh in the viewer. How many triangles is it reporting?

When I bring the one with the decent point cloud up it says the result mesh has only 99 triangles. By contrast, the one with the distorted model produces a mesh of about 326k triangles.

In the image view there is an icon with 3 dots that shows the features that were detected in the image. Take a look to see what Meshroom detected on the specimen.

This is the one that failed to work

Meshroom Points 2

This is the revised version of the first specimen that produced a near-empty model

Meshroom Points

I tried opening the other project that produced an empty model, but somehow it got overwritten and is now blank.

Can you show some cropped in views of the subject at full resolution?

Here are some cropped in views of the subject at full resolution. These are the same images I showed the views with the icon with three dots..

Cropped in specimen 2

Cropped in specimen 1

Are you able to share the images so I can play around with them?

Yes. How may I best be able to send them to you?

@msanta
Copy link

msanta commented Nov 7, 2024

No, I do not think I can get any closer. I was already getting fairly close to the minimum possible focal distance and when I tried to get closer the camera would fail to take the picture.

Would focus stacking be an option?

Yes. How may I best be able to send them to you?

Could you put them on Google Drive (or Dropbox) and share the folder?

@megaraptor1
Copy link
Author

Would focus stacking be an option?

I am not sure. The specimen is in focus with the camera with the current set of images. I have the depth of field turned up to maximum for each photo.

Could you put them on Google Drive (or Dropbox) and share the folder?

Okay, I have a folder together. Where do I need to share it?

@FlachyJoe
Copy link

Maybe you could paint your object to avoid flare.

@megaraptor1
Copy link
Author

megaraptor1 commented Nov 10, 2024 via email

@FlachyJoe
Copy link

And what about structured lighting?

@msanta
Copy link

msanta commented Nov 11, 2024

Okay, I have a folder together. Where do I need to share it?

Just paste the link here.

@megaraptor1
Copy link
Author

Here is the link to the folder.

https://www.dropbox.com/scl/fo/riwqhpocigsx1cfkdy8o2/AJx9AKDJZUjcovP7iE3T35o?rlkey=6ybnfsf5xsrt6ychw96ql6av1&st=oigpm9y0&dl=0

@FlachyJoe

I am unsure what you mean by structured lighting. Do you mean a 3D surface scanner? I tried experimenting with one but I didn't get very good results, the type of scanner I had available didn't seem able to scan such a small specimen.

@msanta
Copy link

msanta commented Nov 14, 2024

For the first dataset Meshroom produced a model for me:

image

I only did the SfM step for the second dataset, but it looked fine.

Can you check the log in the meshing node. Are there any warnings in it?

What I would try to do is to reconstruct something else using the exact same settings you used for the specimens. It doesn't have to be very detailed (30 photos will do). If that doesn't work then try again with the default settings. If it works with default settings then you could try changing settings one at a time until it no longer works.

@FlachyJoe
Copy link

@megaraptor1 I think about a light pattern projected on the model to increase the feature count. The light has to be fixed relative to the model so fixed on the turn-table.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants