Forum

Author Topic: viewport image export  (Read 8163 times)

nickc

  • Newbie
  • *
  • Posts: 25
    • View Profile
viewport image export
« on: January 15, 2015, 09:34:52 PM »
I am working on automatic reporting features within agisoft python 1.1 api.

I would like to be able to export a viewport camera perspective as an image. The idea is to be able to email previews after the model is completed rather than opening an external 3d application and re-rendering. Perhaps export all the "predefined views" (top,bottom,left,right,front,back)

I am asking for a feature because currently the only option for preview images is through othrophoto export... while this is great is not ideal for anything but geography. perspective camera is more ideal for any other use case (product phtography for example)


thanks!!!
« Last Edit: January 16, 2015, 12:31:09 AM by nickc »

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14813
    • View Profile
Re: viewport image export
« Reply #1 on: January 16, 2015, 04:33:53 PM »
Hello Nick,

Do you need high resolution render? Probably just a screenshot will be sufficient?
Best regards,
Alexey Pasumansky,
Agisoft LLC

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14813
    • View Profile
Re: viewport image export
« Reply #2 on: January 16, 2015, 05:02:23 PM »
For example, to take the screenshot of the whole window you can use the following code:

Code: [Select]
import PhotoScan
from PySide.QtGui import QPixmap, QApplication
app = PhotoScan.app
QPixmap.grabWindow(QApplication.desktop().winId()).save('test.png', 'png')

The viewpoint can be adjusted using PhotoScan.app.viewpoint.
Best regards,
Alexey Pasumansky,
Agisoft LLC

nickc

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: viewport image export
« Reply #3 on: January 16, 2015, 06:13:58 PM »
yea i was thinking I could do that. For our own purposes I was looking for a 2048 x 2048 image.thanks!
« Last Edit: January 16, 2015, 06:17:09 PM by nickc »

nickc

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: viewport image export
« Reply #4 on: January 16, 2015, 06:20:42 PM »
Also I cant seem to find "PhotoScan.app.viewpoint." in the docs: http://www.agisoft.com/pdf/photoscan_python_api_1_1_0.pdf

What are the parameters for this?

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14813
    • View Profile
Re: viewport image export
« Reply #5 on: January 16, 2015, 06:22:36 PM »
Hello Nick,

Please search for PhotoScan.Viewpoint class in API reference.
Best regards,
Alexey Pasumansky,
Agisoft LLC

nickc

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: viewport image export
« Reply #6 on: January 16, 2015, 06:26:40 PM »
got it. thanks.

nickc

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: viewport image export
« Reply #7 on: January 16, 2015, 06:48:26 PM »
is the current viewport vectors saved somewhere? can i position the camera within the main viewport and copy the settings out to code?