Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent Orthomosaic Image Results Using OpenDroneMap with PyODM #1794

Closed
mithilpatil1994 opened this issue Aug 14, 2024 · 3 comments
Closed

Comments

@mithilpatil1994
Copy link

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!

Copy link

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 🙏

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

@pierotofy
Copy link
Member

pierotofy commented Aug 14, 2024

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

@smathermather
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants