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 - colin.spexigeo

Pages: [1]
1
General / How is the total marker error (pix) being calculated
« on: February 07, 2020, 01:11:31 AM »
Hi there,

I'm interested in how the "Total" value of marker errors is being calculated. I had assumed that it was an average (mean) of all camera projection errors, but this does not seem to be the case.

For example, Agisoft reports the following:

Errors
-dYUxAmaeU0.143
-YDOHdBJSz0.458
-YOo6Otjv50.629
CYzKGPFuwI0.437
f6n4TJCcSD0.054
FqIO_ToeyF0.397
Fy4qsbY3ft0.661
ladYl1TVsF0.497
nziQ02gyo50.322
pfZjrVEIQA0.518
rFtTrwWuiN1.332
tQGuj6cN-y0.585
VcznBnOJaW0.358
XDxBg3CLSh0.135
Total0.554 pix

However, the *average* values of all these errors is actually 0.466.

Does anybody know how the "total" values is being calculated?

Thanks in advance,
Colin

2
Python and Java API / Applying geoid to DEM appears to have no effect
« on: June 28, 2019, 09:30:48 PM »
Hello again,

As one of the final steps of our processing pipeline, I need to apply a geoid to adjust the DEM elevations (current DEM values are based on WGS84 ellipsoidal elevation).

The geoid I'm using is CGG2013.

I'm attempting to programmatically accomplish the addition of a new CRS with geoid as laid out in this tutorial. Here's how I'm going about it:

Code: [Select]
geoid_path = os.path.join(geoids_directory, 'EPSG 4269', 'CGG2013.tif')
crs = Metashape.CoordinateSystem('EPSG::4269')  # NAD83
crs.addGeoid(geoid_path)
self.chunk.buildDem(projection=crs)

The DEM end sup in NAD83, however, it seems to have had no effect on the resultant elevations coming back in the DEM. Am I missing something here?

Thank you for your time,
Colin

3
Hi there,

We are trying to add some interactivity to our GCP automation process, allowing the user to adjust the marker projections in photos in an outside program. We then want to load up those specific adjustments into Metashape and have Metashape do the marker re-projection on unpinned marker projections.

I'm able to set the `pinned` and `coords` via Python just fine, but it never "re-projects" the other markers based on the changes I'm making via script. If I do the equivalent thing via the normal GUI interface (clicking the marker, dragging it to a new position), it updates all the other photo projections. Is there a way to trigger this via script?

This is roughly what I'm doing now:

Code: [Select]
from Metashape import Vector
offset = Vector((100, 200))
chunk = Metashape.app.document.chunks[0]
marker = chunk.markers[0]
projection = marker.projections.items()[1]
projection.coord += offset
projection.pinned = True
# I expect other un-pinned projections to be adjusted at this point!

Thanks,
Colin

4
Python and Java API / Markers are slightly off
« on: April 02, 2019, 09:16:47 PM »
Hi there,

I'm attempting to automatically add GCP markers via script. The user provides a list of GCP latitude/longitude/elevation values, and the script will ingest it and add markers, then send back the projections to an API so the user can verify and modify them. I've hit a snag with my script that adds the markers, however. The markers I add via the coordinates are slightly off (rotated)

To demonstrate this, I have this script that will attempt to add a marker at the exact spot that the cameras are according to their reference data.

Code: [Select]
chunk = Metashape.app.document.chunks[0]

# Take in WGS84 point and project it into the chunk
def add_marker(point):
    p = chunk.crs.unproject(point)
    p = chunk.transform.matrix.inv().mulp(p)
    chunk.addMarker(p)

for camera in chunk.cameras:
    add_marker(camera.reference.location)

If the script is working correctly, then the markers would be overlapping with the camera positions. However, they are not, as you can see in the attached photo. All I had done with this chunk previously was add and align the photos.

Any help with this is appreciated!

5
Python and Java API / Can't save settings: Permisson denied
« on: March 25, 2019, 11:51:19 PM »
Hi there,

I am moving our company's pipeline scripts from PhotoScan to Metashape, but I'm running into an odd error when running scripts. The error is:

"Can't save settings: Permisson denied"

I have looked online and there doesn't seem to be anyone else running into this problem. I think that this is a related symptom of another problem I'm having where I'm unable to run `addPhotos`, only getting back: "RuntimeError: Can't load photos"

The invoking user has read/write permissions for both the Metashape executable and all of the photos that are trying to be added, so I don't know where the permission error could be.

Any help resolving this issue would be appreciated!

6
Python and Java API / Translating WGS84 coordinates to local coordinates
« on: October 05, 2018, 09:15:14 PM »
Hi there,

I'm trying to convert a polygon with WGS84 coordinates to local space so I can fit Agisoft's region box around a predefined geofence.

I have tried the following, but It gives me an "Unsupported datum transformation" exception.

Code: [Select]
chunk.crs
Out[372]: 2018-10-05 11:11:56 <CoordinateSystem 'WGS 84 (EPSG::4326)'>

chunk.shapes.crs
Out[373]: 2018-10-05 11:12:10 <CoordinateSystem 'WGS 84 (EPSG::4326)'>

chunk.shapes[0].vertices
Out[374]: 2018-10-05 11:12:17 Shape.Vertices([Vector([-123.06583, 49.02038, 0.0]), Vector([-123.065345, 49.020376, 0.0]), Vector([-123.06535, 49.020779, 0.0]), Vector([-123.065825, 49.020783, 0.0]), Vector([-123.06583, 49.02038, 0.0])])

localCrs = PhotoScan.CoordinateSystem('LOCAL')

localCrs
Out[376]: 2018-10-05 11:13:43 <CoordinateSystem 'Local Coordinates (m)'>

PhotoScan.CoordinateSystem.transform(chunk.shapes[0].vertices[0], chunk.shapes.crs, localCrs)
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-377-d48b461d2fab> in <module>()
----> 1 PhotoScan.CoordinateSystem.transform(chunk.shapes[0].vertices[0], chunk.shapes.crs, localCrs)

RuntimeError: Unsupported datum transformation

Any help is appreciated! Thank you!

7
I'm trying to automate the generation of orthomosaics and models. There is only one problem currently, that being that when I export the model, the origin point does not align with the "ground" plane that I'd expect it to.

https://i.imgur.com/ICYrDxE.jpg

The photos are taken with a DJI drone, so there should be sufficient altitude data to rectify this issue.

My first plan was to simply get the transform location of the camera in PhotoScan and then offset the chunk by whatever the difference was with the reported altitude in the EXIF data. However, I believe there's some sort of coordinate system translation that needs to occur beforehand, as the translation matrices of the cameras are, for example:

Code: [Select]
cam.transform.translation()
Out[138]: 2018-08-16 11:45:05 Vector([-0.41432089205811645, 4.574950116471244, 0.02561866387081857])

Meanwhile, the chunk translation is:

Code: [Select]
chunk.transform.translation
Out[145]: 2018-08-16 11:47:10 Vector([-2238541.869777814, -3528167.781020327, 4742206.90104938])

I'm not sure in what units these are supposed to be or how to proceed. Any help is appreciated!

The camera reports it's altitude as:

Code: [Select]
2018-08-16 11:49:33    drone-dji:AbsoluteAltitude="+64.49"
2018-08-16 11:49:33    drone-dji:RelativeAltitude="+51.20"

Thanks :)

P.S. Is it possible that it's using the AbsoluteAltitude to determine the ground plane? How could I attempt to translate the chunk "down" by a set distance in meters?

Pages: [1]