Forum

Author Topic: Thermal Orthomosaic FLIR Data  (Read 1734 times)

steven.h

  • Newbie
  • *
  • Posts: 1
    • View Profile
Thermal Orthomosaic FLIR Data
« on: January 27, 2020, 04:24:28 PM »
Hi Everyone

I'm currently trying to stitch Thermal images into a Mosaic using Metashape. It seems like Metashape is not able to create an orthomosaic (Actually the alignment already produces some strange output). Maybe someone can help me with the stitching process?

The camera used for image capturing is the "FLIR TAU 2 640":
Images: 640x512
Images are Geotagged

Since the process should be automated I use the Python Interface. The script also works on multispectral images (R,G,B,NIR,RedEdge). Due to the strange outputs I also used the User Interface to fiddle around with the different steps. There I noticed that the alignement output doesn't look like a planar surface but more like randomly transformed single frames.

It would be really nice if someone could help me or share his script if available. Since it is possible to do it with pix4d (already tried) it should also be possible with this software I guess. I

Here my Workflow:

  • adding Images to chunk
  • match Photos (high accuracy, generic_preselection=True, reference_preselection=True ,keypoint_limit=80000, tiepoint_limit=6000)
  • align Cameras
  • build Depthmaps (quality=Metashape.HighQuality, filter=Metashape.AggressiveFiltering)
  • buildDenseCloud
  • build DEM (source = Metashape.DenseCloudData, interpolation=Metashape.EnabledInterpolation)
  • build Orthomosaic  (surface = Metashape.ElevationData , blending=Metashape.MosaicBlending, fill_holes=True)
  • export Ortho

Hereby I also share some example data: https://drive.google.com/drive/folders/1KOo1gTCl2XnPLO8ESpH_IF2mlSWj806S?usp=sharing
and example Output:  https://drive.google.com/open?id=1n65sdW0rkJv-H_FWIhFPjah72ionFT30

If it helps more to see my workflow in code:
Code: [Select]
procDir = sys.argv[1]
imgFileNum=len(sorted(glob.glob(procDir+'/*.jpg')))
print(4*' '+procDir+' images: '+str(imgFileNum))

saveDir=procDir+'/Outputs'
if os.path.exists(saveDir):
    shutil.rmtree(saveDir)
os.mkdir(saveDir)
doc = Metashape.app.document
doc.clear()
chunk = doc.addChunk()
chunk = doc.chunks[0]

images_b1=glob.glob(procDir+'/*.jpg')
if len(images_b1)>0:
    print("[INFO] Start Stitching Thermal data...")
    imagesAll = images_b1
   
    chunk.addPhotos(imagesAll)

    chunk.matchPhotos(accuracy=Metashape.HighAccuracy, generic_preselection=True,reference_preselection=False,,keypoint_limit=80000, tiepoint_limit=6000)
    #[HighestAccuracy, HighAccuracy, MediumAccuracy, LowAccuracy, LowestAccuracy]
    chunk.alignCameras()
    chunk.buildDepthMaps(quality=Metashape.LowestQuality, filter=Metashape.AggressiveFiltering)
    #[UltraQuality, HighQuality, MediumQuality, LowQuality, LowestQuality]
    chunk.buildDenseCloud()
    doc.save(saveDir+'/project0_Thermal.psx')
    chunk = doc.chunks[0]
   
    chunk.buildDem(source = Metashape.DenseCloudData, interpolation=Metashape.EnabledInterpolation)
    chunk.buildOrthomosaic(surface = Metashape.ElevationData , blending=Metashape.MosaicBlending, fill_holes=True)
    pathDEM = saveDir+'/project0_DEM_Thermal.tif'
    chunk.exportDem(path = pathDEM, tiff_overviews=True)
    pathOrtho = saveDir+'/project0_Ortho_Thermal.tif'
    chunk.exportOrthomosaic(path = pathOrtho, write_alpha=False, tiff_overviews=True)
    doc.save(saveDir+'project0_DONE.psx')


Thanks for your help :)