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.


Topics - Dark_Corvid

Pages: [1]
1
In my script, I enabled the log with
Code: [Select]
Metashape.Application.Settings(log_enable=True) This generates a log file as expected.

However, when I try to set the log to a save location as specified in the API
Code: [Select]
Metashape.Application.Settings(log_path="C:/somelocation") the log is not saved where specified.

Any help would be appreciated.

2
Python and Java API / Refinement script: buildDepthMaps & PointCloud
« on: July 05, 2019, 02:03:00 AM »
I'm trying to create a script that refines data in an existing .psx file. After loading the file,  I try to run chunk.buildDepthMaps and receive "Error: Null point cloud" even though a sparse point cloud exists in the .psx.

Any ideas?

Code: [Select]
#SFB Get reference to the currently active DOM
doc = Metashape.Document()

#AIW Attemtps to open an existing project.
# - A new project is created if an existing project is not available.
# - This must be done immediatly after getting reference to active DOM.
# - .psx format will not save correctly otherwise.
try:
    doc.open("{}{}.psx" .format(PATH_TO_IMAGES, IMAGE_PREFIX), read_only=False, ignore_lock=True)
except:
    print("No document exists!\nCreating a new document.")
    doc.save("{}{}.psx" .format(PATH_TO_IMAGES, IMAGE_PREFIX))

#AIW Adds a chunk to the current document.
chunk = doc.addChunk()

#SFB Build the list of image filenames
images = []
for image in range(1, 121):
    filename = ("%s%s%04d.tif" %(PATH_TO_IMAGES, IMAGE_PREFIX, image))
    images.append(filename)
print(images)

#SFB Indicate processing is starting
sys.stdout.flush()
print("\nStarting processing:")
start = time.time()

#AIW From API "Add a list of photos to the chunk."
# - Must be run before getting a reference to camera.
phaseTime = time.time()
PHASE_LABEL = "Adding Photos"
chunk.addPhotos(images, progress=progress_callback)
print_time_elapsed(phaseTime)
doc.save()

#AIW Getting reference to camera. Index is out of range if not run after chunk.addPhotos.
camera = chunk.cameras[0]

#AIW From API "Generate depth maps for the chunk."
# - First step of the Metashape GUI "Workflow" process called "Dense Cloud".
phaseTime = time.time()
PHASE_LABEL = "Building Depth Maps"
chunk.buildDepthMaps(quality=Metashape.LowQuality, filter=Metashape.AggressiveFiltering, progress=progress_callback)
print_time_elapsed(phaseTime)
doc.save

3
Python and Java API / Resizing Reconstruction Volume
« on: June 26, 2019, 03:23:03 AM »
In Agisoft Metashape 1.5.3, how does one go about resizing the reconstruction volume? I searched the Metashape Python API for 1.5.3 and was not able to find the right information. An old version of this topic is here: https://www.agisoft.com/forum/index.php?topic=1504.0 but the method no longer works. ch.region is not in the API that I could find.

Any help would be appreciated.

Pages: [1]