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

Pages: [1]
1
Python and Java API / 360 Panorama creation using python
« on: January 26, 2021, 12:54:36 PM »
Hi,

I follow this tutorial and created 360 panorama from set of images.
https://www.agisoft.com/pdf/PS_1.1_Tutorial%20(IL)%20-%20Spherical%20panoramas%20generation.pdf

I would like to know whether it can be totally scripted using the python API?

Normally I am not using the 'Tasks' and use the 'chunks' api for customizing the processing.
The only missing part is couldn't find in the documentation is something like "chunk.exportPanorma"

2
Python and Java API / Re: Match Photo Accuracy
« on: March 10, 2019, 11:41:17 PM »
Any better solution?

3
Python and Java API / Re: Reprojection error
« on: March 10, 2019, 04:03:02 PM »
You should multiply it by the GSD.

4
Python and Java API / Re: Reprojection error
« on: March 10, 2019, 02:04:07 PM »
Try this...

Code: [Select]
    doc = Metashape.app.document

    # Compute the re-projection error
    chunk = doc.chunk
    point_cloud = chunk.point_cloud
    points = point_cloud.points
    error, tie_points = [], []

    for camera in [cam for cam in doc.chunk.cameras if cam.transform]:
        point_index = 0
        photo_num = 0
        for proj in doc.chunk.point_cloud.projections[camera]:
            track_id = proj.track_id
            while point_index < len(points) and points[point_index].track_id < track_id:
                point_index += 1
            if point_index < len(points) and points[point_index].track_id == track_id:
                if not points[point_index].valid:
                    continue

                dist = camera.error(points[point_index].coord, proj.coord).norm() ** 2
                error.append(dist)
                photo_num += 1

        tie_points.append(photo_num)

    reprojection_rmse = round(math.sqrt(sum(error) / len(error)), 2)
    reprojection_max = round(max(error) , 2)
    reprojection_std = round(statistics.stdev(error), 2)
    tie_points_per_image = round(sum(tie_points) / len(tie_points), 0)

    print("Average tie point residual error: " + str(reprojection_rmse))
    print("Maxtie point residual error: " + str(reprojection_max))
    print("Standard deviation for tie point residual error: " + str(reprojection_std))
    print("Average number of tie points per image: " + str(tie_points_per_image))

5
Python and Java API / Re: Camera Location Accuracy
« on: March 09, 2019, 10:45:27 PM »
Thanks Alexey.

Is it possible to force the coordinate values to the origin value and use the alignment only for orientation?
I am looking for the optimal processing configuration for direct geo-referencing...

 

6
Python and Java API / Re: Match Photo Accuracy
« on: March 09, 2019, 10:35:06 PM »
Yes, Aerial Data.

Is there any better approach to process a data-set using the maximal accuracy?

Code: [Select]
    for accuracy in [HighestAccuracy, HighAccuracy, MediumAccuracy, LowAccuracy, LowestAccuracy]:

        chunk.matchPhotos(accuracy=accuracy,
                          preselection=Metashape.ReferencePreselection,
                          tiepoint_limit=tiepoint_limit,
                          keypoint_limit=keypoint_limit,
                          generic_preselection=True,
                          reference_preselection=True,
                          keep_keypoints=True)

        # Align images location
        chunk.alignCameras(cameras=chunk.cameras, adaptive_fitting=True)

        total_cameras = len([cam for cam in chunk.cameras])
        align_cameras = len([cam for cam in chunk.cameras if cam.transform])
        align_prcntg = (float(align_cameras) / float(total_cameras)) * 100.0

        print("Total cameras: {}".format(total_cameras))
        print("Align cameras: {}".format(align_cameras))
        print("Alignment Percentage: {}%".format(align_prcntg))

        if align_prcntg > 90.0:
            print("Alignment was succesfull - {}%, continue processing...".format(align_prcntg))
            break

        print(50 * '=')
        print("Could not align images using the desired accuracy value : {}".format(accuracy))
        print("Trying again with degraded accuracy...")

        for camera in chunk.cameras:
            camera.transform = None
        chunk.point_cloud = None

7
Python and Java API / Match Photo Accuracy
« on: March 07, 2019, 05:36:09 PM »
Hi,

I was processing an 800 images project using python script with the HighestAccuracy.
The alignment process could align only small portion of the images (~100 images)

So I tried to re-process using  HighAccuracy and MediumAccuracy and got pretty much same results (partial alignment)

Only when degrade the accuracy into LowAccuracy the alignment was successful.

1. What could be the reason for the partial alignment? does the SW filter some tie points based on a certain threshold?
2. After getting a partial alignment in the first time, I would like to analyze the data and decide on the optimal accuracy value without trying all possible values and waste precious processing time. Is this possible?

Thanks!

8
Python and Java API / Camera Location Accuracy
« on: March 07, 2019, 05:13:38 PM »
Hi,

Does the accuracy value constrains the bundle adjustment to refine the camera location within the accuracy value range?

For example:
- Accuracy set to 0.1, will constrain the algorithm to refine the camera locations within 10CM from the initial value.
- Accuracy set to infinity, won't put any constrains for the bundle adjustment.

Correlator3D (another photogrammetry software) apply to this logic, this enable the user to apply 'direct geo-referencing' by limit the DoF.

Pages: [1]