Agisoft Metashape
Agisoft Metashape => Python and Java API => Topic started by: Phogi on November 22, 2019, 06:48:04 AM
-
Hi everyone,
Could anyone give some hints about the chunk.crs.localframe() matrix?
Hello claranine,
sourceGeogr = camera.reference.location #source values in geographic coordinate system
estGeogr = chunk.crs.project(chunk.transform.matrix.mulp(camera.center)) #estimated position in geographic coordinate system
sourceGeoc = chunk.crs.unproject(camera.reference.location) #measured values in geocentric coordinates
estimGeoc = chunk.transform.matrix.mulp(camera.center) #estimated coordinates in geocentric coordinates
local = chunk.crs.localframe(chunk.transform.matrix.mulp(camera.center)) #local LSE coordinates
error = local.mulv(estim - source)
As in this post why the error needs to use local.mulv to transform rather than directly use (estim - source)? Is this due to unit difference?
Thanks in advance!
-
Aha I generally got the answer from different threads, since the camera errors need to be calculated in the same unit, while if directly subtract estim position to source position they can be degrees which is not correct. In localframe I suppose the unit is meter, then can scale to other unit if needed?
-
Hello Phogi,
localframe coordinates are in meters, if you need to scale the errors to different units, you need to use the unit scale definition. Usually the number is available in the crs.wkt line.
-
Thank you Alexey!
I got another question, could you help to identify?
I found
camera.project(chunk.markers[0].position)
and
markers[0].projections[camera].coord
both can return the x/y of the image pixels, but they are different, could you tell me which one should be the correct one?
Thanks!
-
Hello Phogi,
camera.project returns the 2D projection of the given 3D point in the image frame coordinates. Whereas marker.projections[camera] returns the position of the marker projection (green/blue flag) on the related image. The difference between these values should correspond to the reprojection error for the marker on the given image.
To camera.project method you can pass any 3D point (in the internal chunk's coordinate system).