Inconsistent Orthomosaic Image Results Using OpenDroneMap with PyODM #1794

I’m using PyODM to generate orthomosaic images from a large set of TIFF files (ranging from 1,000 to 5,000 images) captured by a drone. However, I notice that the generated orthomosaic image is different each time I run the process, even though I’m using the same set of images and the same code.

Setup:

  • Repository: I’m using the OpenDroneMap repository cloned as follows:
    # Clone the OpenDroneMap repository
    git clone https://github.com/OpenDroneMap/ODM --recursive
    cd ODM
    
  • Code: Here’s a simplified version of my Python code using PyODM:
import threading
from pyodm import Node, exceptions
import glob
import os
from pathlib import Path

def progress_callback(task_id):
    if int(task_id == 100):
        print("Uploading Images done")

def print_progress(task):
    taskInfo = task.info()
    print(taskInfo.status)

def startOrthoProcess():
    node = Node('localhost', port=3000)
    try:
        print(node.info())
    except exceptions.NodeConnectionError as e:
        print("Cannot connect: " + str(e))
        return {
            "status": 500,
            "message": "Cannot connect to Node"
        }

    option_flags = {
        'auto-boundary': True, 
        'radiometric-calibration': "camera"
    }
    
    image_files = [str(p) for p in Path("/path/to/images").rglob("*.tif")]
    print(len(image_files))
    
    task = node.create_task(image_files, option_flags, progress_callback=progress_callback)
    taskInfo = task.info()
    print(taskInfo)
    
    timer = threading.Timer(60.0, print_progress, args=[task])  # 60 second timer to show progress
    timer.start()
    
    try:
        result_dir = "results"
        if not os.path.exists(result_dir):
            os.makedirs(result_dir)
        
        task.wait_for_completion()
        task.download_assets(result_dir)
        print(f"Result saved in: {result_dir}/odm_orthophoto/odm_orthophoto.tif")
        
        return {
            "status": 200,
            "message": "Successfully generated Orthomosaic"
        }

    except exceptions.TaskFailedError as e:
        print("Error: " + str(e))
        return {
            "status": 500,
            "message": str(e)
        }

def main():
    startOrthoProcess()

if __name__ == "__main__":
    main()

What I’ve Tried:

  • I’ve ensured that the images and metadata are consistent.
  • The option_flags are the same for each run.
  • I’ve checked the server environment, and it seems stable.
  • The variability persists even when processing 1,000 to 5,000 images.

Questions:

  • What could cause the orthomosaic images to differ each time the process is run?
  • Are there any specific options or flags in OpenDroneMap that might introduce variability?
  • How can I ensure that the results are consistent across multiple runs?

Any insights would be greatly appreciated!

With photogrammetry, there typically is random initialization and resulting inconsistencies between runs. We’ve found that using an orb feature type instead of sift or dsp-sift tends to improve consistency between runs, as orb feature extraction is intended to solve part of this problem.

@Saijin_Naib may have some recommendations for settings with orb. It has some disadvantages in the implementation we currently use, and he’s spent some time changing settings to work around some of those limitations.

But: worth to just try setting feature-type to orb and turning up the min-num-features to 50000 and see if you can get the consistency you are looking for.

Below is the Additional information for better under-standing.

My folder structure for Drone captured Image is as follow -

.001
├── IMG_0200_1.tif
├── IMG_0200_2.tif
├── IMG_0200_3.tif
├── IMG_0200_4.tif
├── IMG_0200_5.tif
├── IMG_0201_1.tif
├── IMG_0201_2.tif
├── IMG_0201_3.tif
├── IMG_0201_4.tif
├── IMG_0201_5.tif
├── IMG_0202_1.tif
├── IMG_0202_2.tif
├── IMG_0202_3.tif
├── IMG_0202_4.tif
├── IMG_0202_5.tif
… total image count - 1000

Multi-Spectral Image band info -

  • (‘IMG_0200_1.tif’, ‘Red’, 1)
  • (‘IMG_0200_2.tif’, ‘Green’, 2)
  • (‘IMG_0200_3.tif’, ‘Blue’, 3)
  • (‘IMG_0200_4.tif’, ‘NIR’, 4)
  • (‘IMG_0200_5.tif’, ‘Rededge’, 5)

Basic image information -

Image Type : tiff (TIFF)
Width : 1280 pixels
Height :960 Pixels
Camera Brand : MicaSense
Camera Model : RedEdge
Exposure Time : 0.0011475 s
Metering Mode : Average
Focal Length :5.5 mm
Software :v3.4.3
Created On : 2024:01:03 07:31:39
Coordinates : 26.989772° N 79.939374° E (183 m)

@smathermather - Thank you for the suggestion! I’ll give this a try by setting the feature type to ORB and increasing the minimum number of features to 50,000. I’ll let you know how it goes.

I tried your parameters, but I’m still facing the same issue. Could it be due to my local system, a Dell Vostro 14 3000 with an Intel Core i3, possibly overheating? The first time I run the code, the image generated is correct, but subsequent runs with the same code and images produce incorrect outputs.