Forum

Author Topic: Total Error of References  (Read 3958 times)

yweidmann

  • Newbie
  • *
  • Posts: 9
    • View Profile
Total Error of References
« on: November 16, 2016, 07:54:56 PM »
Dear Community

Is there an access by Python available to get the "Total Error" of all the markers (as shown in the Reference section) in meters (or in pixels)?
Would be great to have access as well to the individual errors of each marker.

Question:
- In which class of the API do I have the access to this information?

Looking for any hint.

Best regards,
Yvo

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14853
    • View Profile
Re: Total Error of References
« Reply #1 on: November 16, 2016, 07:56:05 PM »
Hello Yvo,

This information is not stored in the project file, you need to calculate it in the script, if you wish to access it.
Best regards,
Alexey Pasumansky,
Agisoft LLC

Milderinne

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: Total Error of References
« Reply #2 on: November 29, 2016, 01:11:20 PM »
Hello everyone,
Actually I would also like to access the errors for scalebars.
How is it possible to calculate them and afterwards filter for them?

I hope anyone can help.
Kind regards!

Milderinne

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: Total Error of References
« Reply #3 on: December 06, 2016, 02:49:08 AM »
Hello anyone any hints for this?
I would be very happy to get some help!
Kind regards!
« Last Edit: December 07, 2016, 11:57:59 PM by Milderinne »

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14853
    • View Profile
Re: Total Error of References
« Reply #4 on: December 06, 2016, 01:35:21 PM »
Hello Milderinne,

Providing that the chunk is referenced, scale bar has input (source) distance and both of it's ends are defined in space you can use the following code to get the estimated distance and errors:
Code: [Select]
chunk = PhotoScan.app.document.chunk #active chunk
for scalebar in chunk.scalebars:
    dist_source = scalebar.reference.distance
    if not dist_source:
        continue #skipping scalebars without source values
    if type(scalebar.point0) == PhotoScan.Camera:
        if not (scalebar.point0.center and scalebar.point1.center):
            continue #skipping scalebars with undefined ends
        dist_estimated = (scalebar.point0.center - scalebar.point1.center).norm() * chunk.transform.scale
    else:
        if not (scalebar.point0.position and scalebar.point1.position):
            continue #skipping scalebars with undefined ends
        dist_estimated = (scalebar.point0.position - scalebar.point1.position).norm() * chunk.transform.scale
    dist_error = dist_estimated - dist_source
    print(scalebar.label,str(dist_source),str(dist_estimated),str(dist_error))
Best regards,
Alexey Pasumansky,
Agisoft LLC

Milderinne

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: Total Error of References
« Reply #5 on: December 08, 2016, 12:49:02 AM »
Hello Alexey,
thank you so much for your great help!

I have one more question:
I noticed that this calculated dist_error differ from the one provided within the GUI under Reference - Scale Bars - Error (m). How does this come and do I have to be careful about that?

Kind regards!

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14853
    • View Profile
Re: Total Error of References
« Reply #6 on: December 08, 2016, 02:08:52 PM »
Hell Milderinne,

Can you post the screenshot with the estimated distances for your scale bars from the Reference pane and the output produced by the script?
Best regards,
Alexey Pasumansky,
Agisoft LLC