Forum

Author Topic: Help in localframe explain  (Read 2840 times)

Phogi

  • Jr. Member
  • **
  • Posts: 99
    • View Profile
Help in localframe explain
« on: November 22, 2019, 06:48:04 AM »
Hi everyone,

Could anyone give some hints about the chunk.crs.localframe() matrix?
Hello claranine,

Code: [Select]
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!

Phogi

  • Jr. Member
  • **
  • Posts: 99
    • View Profile
Re: Help in localframe explain
« Reply #1 on: December 02, 2019, 09:49:55 AM »
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?

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14817
    • View Profile
Re: Help in localframe explain
« Reply #2 on: December 04, 2019, 07:45:50 PM »
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.
Best regards,
Alexey Pasumansky,
Agisoft LLC

Phogi

  • Jr. Member
  • **
  • Posts: 99
    • View Profile
Re: Help in localframe explain
« Reply #3 on: December 06, 2019, 08:42:18 AM »
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!

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14817
    • View Profile
Re: Help in localframe explain
« Reply #4 on: December 06, 2019, 01:18:29 PM »
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).
Best regards,
Alexey Pasumansky,
Agisoft LLC