Forum

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Sylvain M.

Pages: 1 [2]
16
I found this:
https://github.com/agisoft-llc/metashape-scripts/blob/master/src/samples/general_workflow.py

This will help me a lot!  :D
I'll be back soon with a more complete code!
(but maybe not for several days, as I'm working on other things in parallel)

17
PS. : I forgot to mention that I'm a French speaker: please excuse me if some of the wording isn't optimal or understandable!  ;)

18
Hi everyone,

I'm a beginner on Metashape, as well as on Python.
My goal is to automate in Python a processing chain to create an orthomosaic from a folder of multispectral photos (from a DJI Mavic 3M drone).
For the moment, I've created an Agisoft batch job (XML) that meets my needs.

By any chance, is there a tool that can convert a batch job into a Python script?

If not, I'd like to take advantage of this thread to work on this script step by step, with the help of anyone who can help me.
So I'll start by sharing the first bits of code I've written (I confess, with the help of ChatGPT), which could perhaps be optimised?

Code: [Select]
import Metashape
import os

# Params
project_path = r"D:\PROJECTPATH\MYPROJECT.psx"
photos_folder = r"D:\PHOTOSPATH"

# Create project and chunk
doc = Metashape.Document()
doc.save(path=project_path)
chunk = doc.addChunk()

# Photos import
# I don't think this method is optimal: it should be possible to specify that this is a multi-camera system
photo_list = [os.path.join(photos_folder, photo) for photo in os.listdir(photos_folder) if photo.lower().endswith(('.jpg', '.jpeg', '.png', '.tif', '.tiff'))]
chunk.addPhotos(photo_list)

doc.save()

Thank you very much for any help you can give me, or any examples you can send me links to.

Pages: 1 [2]