OpenDroneMap / ODM

A command line toolkit to generate maps, point clouds, 3D models and DEMs from drone, balloon or kite images. 📷
https://opendronemap.org
GNU Affero General Public License v3.0
4.91k stars 1.11k forks source link

Inconsistent Orthomosaic Image Results Using OpenDroneMap with PyODM #1794

Closed mithilpatil1994 closed 3 months ago

mithilpatil1994 commented 3 months ago

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:

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:

Questions:

Any insights would be greatly appreciated!

github-actions[bot] commented 3 months ago

Thanks for the report, but it looks like you didn't include a copy of your dataset for us to reproduce this issue? Please make sure to follow our issue guidelines :pray:

p.s. I'm just an automated script, not a human being.

pierotofy commented 3 months ago

Also, for all questions, let's please move the conversation over to https://community.opendronemap.org :pray:

smathermather commented 3 months ago

Thanks for joining us on the forum!

Linking back to the forum in case anyone finds this through a search of issues: https://community.opendronemap.org/t/inconsistent-orthomosaic-image-results-using-opendronemap-with-pyodm-1794/21393