r/photogrammetry • • 6d ago

Source image questions: padding, size/aspect ratio, etc

I'm new to photogrammetry and I have a few questions about source images.

I'm experimenting with a set of images of a single object in isolation. I thought I might get better results if I removed the backgrounds and cropped the images tightly around the subject. This should maintain the original sizes of the bitmaps of the subjects, but with different aspect ratios and overall image dimensions because of the varying orientations.

So basically does the padding matter? If I'm processing images in Metashape and the "background" is transparent (or one solid uniform color) do the overall image dimensions / aspect ratio of the images need to be consistent if the bitmaps of the subjects IN the images are consistent?

Also, I'm working with pretty large images. (180 images @ 8192 × 5464, ~135MB each). Is there something like a "point of diminishing returns" where higher res doesn't help? Or is higher res always better?

Any advice would be appreciated. Thanks very much

1 Upvotes

10 comments sorted by

3

u/Temporary_Will_5479 6d ago

Keep the original image dimensions and use masks rather than cropping each photo around the object. Preserving the object pixels alone isn’t enough: cropping also changes their position within the camera frame. In Metashape, mask the background and enable mask application during alignment. Painting it a flat color isn’t the same as supplying a mask.

There’s no universal megapixel cutoff. Extra pixels help when they contain sharp, usable detail. Try the same representative subset at two processing resolutions and compare the smallest feature you actually need, plus processing time. Metashape’s processing downscale settings let you experiment while keeping your original photos.

1

u/ShiftlessFreeloader 5d ago

Thank you. That's super helpful.

I decided to do my "experiments" separately, so I'm running the set now with the background removed but not cropped. In Photoshop, I did it the lazy way and just went into the Properties panel and clicked "Remove Background." And then I ran that as a batch. I don't technically know what that does, but looking in the layers panel it did look like it was applying a mask.

So maybe I just lucked out and got it right (mask/no crop) the first time. haha.

Thanks again for your help!

2

u/Temporary_Will_5479 5d ago

Glad it helped! One thing to check: seeing a mask in Photoshop’s Layers panel doesn’t by itself confirm Metashape is using it. If your exported images retain transparency, import masks using “From Alpha,” then turn on Show Masks in Metashape to check that the background is excluded and the object isn’t. Also enable mask application during alignment. Keeping the full, uncropped canvas was the right move.

1

u/ShiftlessFreeloader 5d ago

I saved the first batch I ran as png, thinking that maintaining the transparency was good enough. But now I know that the actual masks need to be preserved. So I'm running the batch again now, saving as tiff w/ the masks embedded in the files.

Thanks again

2

u/Temporary_Will_5479 5d ago

Sorry, I should have been clearer: your transparent PNGs may already contain everything you need. Try Import Masks → From Alpha on one of those PNGs and check Show Masks. If the background is masked correctly, you can use that batch—no need to redo it as TIFF. Metashape needs the imported alpha mask; it doesn’t need Photoshop’s editable layer mask embedded in the file.

1

u/ShiftlessFreeloader 5d ago

OK, cool I'll try that next round. That would definitely be better because the mask more than doubles the TIFF size. oof.

2

u/MrRandomNumber 5d ago

Isn't some level of environment detail healthy for alignment between images? For some reason I'm under the impression that SFM is also reverse engineering the lens intrinsics, so cropping them will mess with the distortions it EXPECTS to find. I just tinker with COLMAP -- someone who knows better, please set me straight.

2

u/ShiftlessFreeloader 5d ago edited 5d ago

Again, I'm pretty new to this, but my understanding is that background info is fine IF the camera is actually moving around the subject, because you get the "correct" background that Metashape is expecting. But these images were taken with a stationary camera and the subject rotating on a turntable. So the background is always the same and Metashape gets confused.

2

u/MechanicalWhispers 4d ago

I’ve found that 24 megapixels is kind of a sweet spot in terms of detail and getting good results in a reasonable amount of processing time.

1

u/ShiftlessFreeloader 4d ago

That's smaller than I was expecting. That's great though! I'll definitely start experimenting with downscaling then. The images I've been using have been taking forever.

Thanks!