Forum

Author Topic: Export image quality estimate to .txt or spreadsheet  (Read 7585 times)

Fieldstitch

  • Newbie
  • *
  • Posts: 6
    • View Profile
Export image quality estimate to .txt or spreadsheet
« on: July 06, 2017, 05:00:46 AM »
Hello,

Is it possible to export the image quality estimate to a spreadsheet for further processing, like calculating an average?
I cannot find any function to do so and it doesn't show up in the generated report.

I am using the latest version of Agisoft Photoscan Pro

Thanks in advance.
Paul

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15726
    • View Profile
Re: Export image quality estimate to .txt or spreadsheet
« Reply #1 on: July 07, 2017, 01:32:15 PM »
Hello Paul,

Thank you for contacting.

At the moment you can do that via Python scripting only.

Code: [Select]
chunk = PhotoScan.app.document.chunk
for camera in chunk.cameras
   if "Image/Quality" in camera.photo.meta.keys():
      print(camera.label + "\t" + camera.photo.meta["Image/Quality"])

It should print the list of cameras with the quality value (if present) to the Console pane.
Best regards,
Alexey Pasumansky,
Agisoft LLC

Fieldstitch

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Export image quality estimate to .txt or spreadsheet
« Reply #2 on: July 10, 2017, 07:16:56 AM »
Hello Alexey,

Thanks for the response. I tried this python script by running it by tools/run script in photscan. However, the script does not run. I copied your code and saved it as a .py file.
Can I export the data to spreadsheet of .txt/.csv if the image quality estimate is displayed in the console panel?

Further, I was wondering if it was possible to export the number point matchers per image?

Thank in advance,
Paul

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15726
    • View Profile
Re: Export image quality estimate to .txt or spreadsheet
« Reply #3 on: July 10, 2017, 11:57:24 AM »
Hello Paul,

If you are running the script from the external .py file and not from the Console pane, then you need to add the following line in the beginning of the script:
Code: [Select]
import PhotoScanYou can save the Console pane contents.


For the direct file export you can use the following:
Code: [Select]
import PhotoScan
chunk = PhotoScan.app.document.chunk
path = PhotoScan.app.getSaveFileName("Specify output path:)
file = open(path, "wt")
for camera in chunk.cameras:
   if "Image/Quality" in camera.photo.meta.keys():
      file.write(camera.label + "\t" + camera.photo.meta["Image/Quality"]+"\n")
file.close()
« Last Edit: July 11, 2017, 10:09:49 AM by Alexey Pasumansky »
Best regards,
Alexey Pasumansky,
Agisoft LLC

Fieldstitch

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Export image quality estimate to .txt or spreadsheet
« Reply #4 on: July 11, 2017, 01:46:13 AM »
Hello Alexey,

Thanks for the quick response. The script worked flawless. Sorry for my python beginner questions.

To complete the script there need to be added a colon (':') after the for statement.

Cheers,
Paul

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15726
    • View Profile
Re: Export image quality estimate to .txt or spreadsheet
« Reply #5 on: July 11, 2017, 10:10:20 AM »
Quote
To complete the script there need to be added a colon (':') after the for statement
Fixed, thank you for pointing on the error.
Best regards,
Alexey Pasumansky,
Agisoft LLC

Fieldstitch

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Export image quality estimate to .txt or spreadsheet
« Reply #6 on: July 14, 2017, 08:29:40 AM »
Hello Alexey,

Is there also a script available for exporting the number of key point matches per image frame?

This data can give a real good insight in how well the match performs.

Thanks in advance.

Cheers,
Paul