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 - mrv2020

Pages: [1] 2 3 ... 6
1
General / Re: Agisoft Metashape 2.3.0 pre-release
« on: November 14, 2025, 05:04:39 AM »
Hi,

I would like to request a new parameter for the Python API, such as document.save(silent=True) or an equivalent option.

Currently, calling doc.save() from a script triggers the same progress popup as a manual save, which interrupts the workflow when using autosave scripts. A silent save mode (no popup, no UI interruption) would be extremely useful for background autosave routines.

Because if the user has a polyline and polygon when opening the popup, sometimes it closes and what was clicked with the active command is lost when the popup appears, or a native command that activates an autosave as soon as the user finishes creating a shape. Below is the autosave code we use.

Code: [Select]
# -*- coding: utf-8 -*-
import Metashape

try:
    from PySide2 import QtCore
except ImportError as e:
    Metashape.app.messageBox(
        "Error importing PySide2 (QtCore).\n"
        "Autosave requires Qt Timer.\n\n"
        "Detail: %s" % str(e)
    )
    raise

autosave_timer = None
autosave_interval_min = 5
autosave_enabled = False

def autosave_log(msg):
    print("[AUTOSAVE] " + msg)

def autosave_tick():
    doc = Metashape.app.document

    if doc is None:
        autosave_log("No document open, skipping autosave.")
        return

    if not doc.path:
        autosave_log("Project has not been saved yet (no path).")
        return

    try:
        doc.save()
        autosave_log("Project saved: %s" % doc.path)
    except Exception as e:
        autosave_log("Error saving project: %s" % str(e))

def autosave_enable():
    global autosave_timer, autosave_enabled, autosave_interval_min

    if autosave_enabled:
        Metashape.app.messageBox("Autosave is already enabled.")
        return

    if autosave_timer is None:
        autosave_timer = QtCore.QTimer()
        autosave_timer.timeout.connect(autosave_tick)

    autosave_timer.start(int(autosave_interval_min * 60 * 1000))
    autosave_enabled = True

    autosave_log("Autosave ENABLED – interval: %d min" % autosave_interval_min)
    Metashape.app.messageBox(
        "Autosave enabled every %d minute(s)." % autosave_interval_min
    )

def autosave_disable():
    global autosave_timer, autosave_enabled

    if not autosave_enabled:
        Metashape.app.messageBox("Autosave is already disabled.")
        return

    if autosave_timer is not None:
        autosave_timer.stop()

    autosave_enabled = False
    autosave_log("Autosave DISABLED.")
    Metashape.app.messageBox("Autosave disabled.")

def autosave_set_interval():
    global autosave_interval_min, autosave_enabled, autosave_timer

    new_value = Metashape.app.getInt(
        "Autosave interval (minutes):",
        autosave_interval_min
    )

    if new_value <= 0:
        Metashape.app.messageBox("Invalid value. Insert minutes > 0.")
        return

    autosave_interval_min = new_value
    autosave_log("New interval: %d min" % autosave_interval_min)

    if autosave_enabled and autosave_timer is not None:
        autosave_timer.stop()
        autosave_timer.start(int(autosave_interval_min * 60 * 1000))
        autosave_log("Timer restarted with new interval.")
        Metashape.app.messageBox(
            "Interval updated to %d minute(s)." % autosave_interval_min
        )
    else:
        Metashape.app.messageBox(
            "Interval set to %d minute(s), but autosave is OFF.\n\nUse:\nAutoSave → Enable"
            % autosave_interval_min
        )

label_enable = "AutoSave/Enable"
label_disable = "AutoSave/Disable"
label_interval = "AutoSave/Interval (min)"

Metashape.app.addMenuItem(label_enable, autosave_enable)
Metashape.app.addMenuItem(label_disable, autosave_disable)
Metashape.app.addMenuItem(label_interval, autosave_set_interval)

print("AutoSave loaded. Use:")
print("  %s" % label_enable)
print("  %s" % label_disable)
print("  %s" % label_interval)
autosave_log("Autosave script loaded.")

2
General / Re: Agisoft Metashape 2.3.0 pre-release
« on: November 13, 2025, 11:24:24 PM »
Code: [Select]
2025-11-13 17:02:11 Saving project...
2025-11-13 17:12:03 saved project in 592.042 sec
2025-11-13 17:12:03 Finished processing in 592.091 sec (exit code 1)
>>>

Hi, in version 2.3 Metashape is taking a very long time to save the project (before/after setting masks and saving the PSX). I’m on Windows 11, workstation: AMD Ryzen 9 9950X3D, 128 GB DDR5 RAM, NVMe M.2 SSDs.

the issue happens with 500-15k photos, regardless of image size. Saving is extremely slow. In version 2.1 the same project saved in about 30 seconds, even with 15k photos.

Also, after importing a shape or KML, saving the PSX shows “bad allocation memory”, and sometimes it completely fails and the shape data is lost (the doc.xml inside the shapes folder gets corrupted or disappears).

One way I try to fix the bad allocation memory error in the shapefiles is to select all of them and add a new arbitrary description and label, such as 01 or AA, and save the shapefile. The bad allocation error disappears, but after a while it reappears, so I repeat the process and it doesn't occur again for a while.

3

Hi Alexey,

I ran a test on the current version 2.2. The scenarios are the facade of a small building. So, with the same set of cameras, all with precise coordinates and the check marked, it aligned perfectly with a global error of 0.016m. After that, I loaded the same cameras into a new project, disabled a random group of 30% and aligned the same set. The cameras with coordinates produced a global error of 0.017m, but the disabled group was completely wrong. I created markers to check the deviation and optimize, and found errors in the order of 700 error (pix).

The solution adopted was to misalign the group of wrong cameras, optimize the set and then manually align in small groups. Even without markers, they align perfectly, but it is a lot of rework and a long time to align 20 photos at a time, taking more than several minutes.

cameras without coordinates within a set with cameras with GPS have difficulty aligning in version 2.2, in version 1.86 it aligned perfectly, regardless of the number of images without coordinates with check or even without coordinates informed.


4
Hello,

Given the limitations encountered when trying to align all 95,000 images into a single chunk, I constantly deal with large groups of images and I suggest you use the official split_in_chunks_dialog.py script from Agisoft https://github.com/agisoft-llc/metashape-scripts/blob/master/src/split_in_chunks_dialog.py. Since the images are georeferenced, it allows you to automatically split your images into smaller, more manageable chunks, preserving the structure and facilitating the alignment into smaller chunks that your machine can handle more reliably, without modifying the desired precision parameters such as tie and key limits.

Once split, you can align each chunk individually using the same settings (or slightly reduced) and then use the "Merge Chunks" function to combine them.

I recommend you use an overlapping edge for better overlap between the splits when generating the merger chunks.

This approach significantly reduces the memory load and avoids crashes, while maintaining the accuracy of the model.

Best regards,

5
General / Re: How to create orthomosaic showing only ground layer?
« on: March 12, 2025, 06:09:48 PM »
Hi

After aligning the point cloud, you can apply masks to objects on the photos that you do not want to appear in the orthophoto. You can do this manually by opening each of the photos and creating a mask, Chapter 6. Editing, Using masks of the user manual, page 140, https://www.agisoft.com/pdf/metashape-pro_2_2_en.pdf, or consider using an AI to generate the masks and importing them into Metashape to generate the orthophoto.

6
General / Re: Only one node remains working in network processing
« on: March 01, 2025, 09:33:23 PM »
Hi,

From what you present and at the 77% alignment stage there is no longer enough division for distribution among the clusters, they have simply already completed their part, that is, it is correct. Now another single one is not advancing. In the top bar search for workers and see the number of parts that were created, (processing / and to be processed).

7
Hi Alexey,

Some image sets are aligned incorrectly in version 2.2, but I only notice the misalignment after generating the DEM, so I use markers to manually realign.

So two things happen: if realignment optimization has already been applied, it takes an excessive amount of time to complete the manual alignment compared to a set that has not been optimized.

And another situation is that if a set has images without coordinates, they will almost always not be aligned with the others. I did a test in version 1.8.6 and the same dataset was aligned the first time and without any imperfections, with the DEM smooth and wrinkle-free.

Another test was activating the adaptive camera with a set that has more than one type of lens or camera model, the alignment always fails in version 2.2.1 requiring intervention with markers to correct even if they have precise coordinates, and again in 1.8.6 it passed perfectly the first time.

And when version 2.2.1 finishes the alignment, I notice that the global error is 0.23m and after optimization it reaches 0.048m. With filtering, we reach 0.02m. In version 1.8.6, the accuracy is 0.0186m the first time without needing to optimize after alignment.

8
Python and Java API / How to Synchronize Photo Advancing
« on: January 11, 2025, 07:35:27 PM »
Hi,

I’ve been trying to create a script that allows me to open multiple photos simultaneously in Metashape and advance through them together (synchronized). Currently, I can open multiple photos, but advancing to the next one only works individually.

Here’s the part of my script where I try to advance all selected photos:

Code: [Select]
for camera in current_cameras:
    try:
        current_index = all_cameras.index(camera)
        next_camera = all_cameras[current_index + 1]
        camera.selected = False
        next_camera.selected = True
    except IndexError:
        Metashape.app.messageBox("Reached the end of the photo list.")
        break

It works, but only advances one camera at a time. Is there a built-in function or better approach to synchronize advancing for all opened photos at once?

Thanks in advance for any suggestions!

9
General / Re: Agisoft Metashape 2.2.0 pre-release
« on: November 27, 2024, 05:24:17 PM »
Hi Alexey,

Same here. I am encountering an issue related to camera alignment in Metashape Professional, which appears to have been introduced in version 2.2.0. This issue was not present in version 2.1, where the same workflow functioned correctly.

Some cameras that were previously aligned in the project are being misaligned when new groups of cameras are processed. My workflow is designed to align only the unprocessed cameras while keeping the previously aligned ones intact, but this behavior is not being respected in version 2.2.0. I tried including reset_alignment=False but that didn't work either.

Code: [Select]
def align_images(document, cameras_to_align):
    if cameras_to_align:
        chunk = document.chunk
        unaligned_cameras = [cam for cam in cameras_to_align if cam.transform is None]
       
        if not unaligned_cameras:
            print("No cameras to align: all are already aligned.")
            return
       
        chunk.matchPhotos(cameras=unaligned_cameras, downscale=1,
                          generic_preselection=True, reference_preselection=True)
        chunk.alignCameras(cameras=unaligned_cameras, reset_alignment=False)

10
Python and Java API / Issues with Camera Alignment in Metashape 2.2
« on: November 27, 2024, 04:53:56 PM »
Code: [Select]
def align_images(document, cameras_to_align):
    if cameras_to_align:
        chunk = document.chunk
        unaligned_cameras = [cam for cam in cameras_to_align if cam.transform is None]
       
        if not unaligned_cameras:
            print("No cameras to align: all are already aligned.")
            return
       
        chunk.matchPhotos(cameras=unaligned_cameras, downscale=1,
                          generic_preselection=True, reference_preselection=True)
        chunk.alignCameras(cameras=unaligned_cameras, reset_alignment=False)


Hi Alexey,

I am encountering an issue related to camera alignment in Metashape Professional, which appears to have been introduced in version 2.2.0. This issue was not present in version 2.1, where the same workflow functioned correctly.

Some cameras that were previously aligned in the project are being misaligned when new groups of cameras are processed. My workflow is designed to align only the unprocessed cameras while keeping the previously aligned ones intact, but this behavior is not being respected in version 2.2.0. I tried including reset align=False but that didn't work either.

11
Feature Requests / Command to Advance All Open Photos Simultaneously
« on: November 16, 2024, 11:13:03 PM »
Hi Alexey,

I would like to suggest a new feature for Agisoft Metashape.

When multiple photos are opened in the viewer, it is currently necessary to advance them one by one. This process can be time-consuming when working with a large number of images.

My suggestion is to implement a command or shortcut that allows all open photos to advance simultaneously, synchronizing the movement across all viewer windows. This feature would significantly streamline workflows involving the visual analysis of multiple images.

Thank you for your attention to this request! I would be happy to provide additional details if needed.

Best regards,

12
Bug Reports / Re: Mask 2.2.0
« on: October 25, 2024, 11:21:23 PM »
Hi Alexey,

Thanks for the response. While you're checking into the mask issue, one thing I've noticed is that reducing the image size before applying the AI mask can sometimes speed things up, depending on the workflow. It might be worth exploring ways to streamline the process further by adding quality options, like Low to High, to balance between speed and detail during mask generation.

Best regards,

13
Bug Reports / Re: Build Texture broken with GPU's enabled
« on: October 23, 2024, 11:07:47 PM »


Try Tweak

main/gpu_enable_cuda = False

14
Bug Reports / Mask 2.2.0
« on: October 19, 2024, 10:58:17 PM »
Hi Alexey,

I generate my masks externally using AI, and in the latest version (2.2.0) of Agisoft, I’ve been facing issues when importing these masks. In version 2.1, I could easily import the first mask and then use the "union" option to add the rest. However, in the current version, the "union" option doesn’t seem to work at all, or I might be using it incorrectly.

Now, after importing the first mask, the process already takes longer, and then I have to manually use the "merger masks" option to create the final mask. This additional step significantly increases the time spent on the task, more than doubling the time compared to version 2.1.

Could you clarify if I’m missing something regarding the "union" option, or if there is a fix in progress? It would be very helpful to restore the previous workflow, as it was much more efficient for handling large numbers of masks.

Thank you for your help!

15
Bug Reports / VIDEO IMPORT
« on: June 07, 2024, 03:25:57 PM »
Hi,

I am facing an issue with frame positioning when using metashape with videos captured by the GoPro 11. When I import videos from the GoPro 7, the frame positions are proportional to reality and everything works correctly. However, when importing videos from the GoPro 11, this correct positioning association does not occur, resulting in frames being hundreds of meters off from the correct location.

I would like to emphasize that the telemetry analysis of the GoPro 11 video has excellent positional accuracy, and the paused frame of the video corresponds exactly to the real location. The problem specifically occurs when generating the JPGs or PNGs in Agisoft, which do not match the correct location.

Has anyone else experienced this issue or knows how to correct this positioning discrepancy when using the GoPro 11 in Agisoft?

Pages: [1] 2 3 ... 6