I have a set of aerial photographs taken in long lines. Over 80% overlap along the lines. Roughly 5000 photos. The GPS data is great, and includes lat/lon, altitude, roll, pitch, yaw.
I'm experimenting with different methods to get an orthomosaic for the entire set, but it just isn't working out. Here are the current steps I take:
1. Load the photos into chunks, with each chunk containing a group of ~ 20 overlapping photos in a contiguous area along my flight line. There is overlap in the photos between the different chunks, so several photos at the edges will appear in two chunks.
2. For each chunk:
- chunk.matchPhotos(generic_preselection=False)
- chunk.alignCameras()
-
After some testing, I decided at this point to do some additional things that may or may not be helping things...: - If after aligning the chunk, the chunk
is aligned, but a section of at least 4 images in a row (which due to my naming means they would be near each other) is not aligned (says 'NA' in the gui), I would move those photos out of that chunk and into a new chunk. Then I align those new chunks, and do the same if needed, so that wherever possible I don't have large groups of unaligned photos. This was supposed to get as many photos aligned as possible...
3. For each chunk/new partial chunk:
- Check the total error of the chunk by using the math described here:
https://www.agisoft.com/forum/index.php?topic=5748.0 - If the total chunk error is less than 10m, accept it, if not try again (a few times) to align that chunk, before giving up, and ignoring that bad chunk in the future.
-
I couldn't decide how to pick my error threshold, although usually I do not hit the 10m much smaller, like < 0.54. Merge good chunks:
- doc.mergeChunks(goodChunks,merge_markers=True)
- mergedChunk = doc.chunks[len(doc.chunks)-1]
5. Build mesh:
- mergedChunk.buildModel(surface=Metashape.Arbitrary, interpolation=Metashape.EnableInterpolation,face_count=Metashape.LowFaceCount)
6. Build orthomosaic:
- mergedChunk.buildOrthomosaic(surface=Metashape.ModelData,blending=Metashape.MosaicBlending,projection=Metashape.CoordinateSystem("EPSG::4326"))
My reasoning for splitting it up into the chunks was that because I had such a long varying flightline, when I tried to run it all in one model the results were no good, and I thought that might be because the program was creating a model over a long area (?) . Sometimes, this method described above has produced good results, but not consistently enough. If I ever have an area with a LOT of overlap (when the flight is more of a grid pattern instead of a line), the results are perfect.
Some of the "bad" results are like these:
You can see the roads completely warped in one, and the rim of a mountain disconnected in another.