Forum

Author Topic: Getting the number of disabled images  (Read 4590 times)

Ingsayyad

  • Jr. Member
  • **
  • Posts: 89
    • View Profile
Getting the number of disabled images
« on: September 11, 2017, 12:36:26 PM »
I am wondering if I can get the number of disable images in a projekt. Please see attached image for further info

SAV

  • Hero Member
  • *****
  • Posts: 710
    • View Profile
Re: Getting the number of disabled images
« Reply #1 on: September 12, 2017, 09:13:19 AM »
Hi Ingsayyad,

Two ways to solve your problem:

1. Manually count all disabled images  :o
2. Use following Python script  8)

Code: [Select]
import PhotoScan
doc = PhotoScan.app.document
chunk = doc.chunk
x = 0

for camera in chunk.cameras:
if not camera.enabled:
x = x + 1
camera.selected = True
else:
camera.selected = False

print ('Disabled images: %d ' % x)

The script will show you the number of disabled images in the console (tested with PhotoScan 1.2.6).
If you cannot see the console, then open it by clicking VIEW > PANES > CONSOLE.

I hope that helps.

Regards,
SAV

P.S. To run this Python script, simply save it as count_disabled.py and start it by clicking the Run Script icon (third from left in the CONSOLE pane) and then choosing the previously saved count_disabled.py file.  :)
« Last Edit: September 12, 2017, 09:16:57 AM by SAV »

Ingsayyad

  • Jr. Member
  • **
  • Posts: 89
    • View Profile
Re: Getting the number of disabled images
« Reply #2 on: September 13, 2017, 10:59:13 AM »
thanx. u r great.

SAV

  • Hero Member
  • *****
  • Posts: 710
    • View Profile
Re: Getting the number of disabled images
« Reply #3 on: September 13, 2017, 12:43:16 PM »
No worries. Happy to help.  :D

All the best.

Regards,
SAV

thanx. u r great.

Jeremiah_ROWE

  • Guest
Re: Getting the number of disabled images
« Reply #4 on: September 14, 2017, 06:56:43 PM »
Along the same lines, is it possible to get a list of of all of the disabled cameras file names, rather than just a count?

SAV, I would really appreciate it if you could provide some guidance with the python scripting to do this. I don't see a way to sort or filter cameras by enabled/disabled status within Agisoft.

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14935
    • View Profile
Re: Getting the number of disabled images
« Reply #5 on: September 14, 2017, 07:16:23 PM »
To display only enabled cameras in the Photos pane:

Code: [Select]
import PhotoScan
doc = PhotoScan.app.document
chunk = doc.chunk
enabled_list = list()

for camera in chunk.cameras:
if camera.enabled:
enabled_list.append(camera)
print(camera.label + " is enabled.")

PhotoScan.app.photos_pane.setFilter(enabled_list)
Best regards,
Alexey Pasumansky,
Agisoft LLC

SAV

  • Hero Member
  • *****
  • Posts: 710
    • View Profile
Re: Getting the number of disabled images
« Reply #6 on: September 14, 2017, 07:18:59 PM »
Hi Jeremiah_ROWE,

Here is the code that should do the job for you (tested on PhotoScan v1.2.6)

Code: [Select]
import PhotoScan
doc = PhotoScan.app.document
chunk = doc.chunk
x = 0

for camera in chunk.cameras:
if not camera.enabled:
x = x + 1
camera.selected = True
print (camera.label)
else:
camera.selected = False

print ('Disabled images: %d ' % x)

This Python script will show you all the names of the disabled images as well as the total number of disabled images in the console. Note that this script also automatically selects all disabled images. If you want to filter based on disabled images, then simply right click on one of the selected ones in the photo pane after running the script and choose FILTER PHOTOS BY SELECTION. Done.

I hope that helps.

Regards,
SAV

Along the same lines, is it possible to get a list of of all of the disabled cameras file names, rather than just a count?

SAV, I would really appreciate it if you could provide some guidance with the python scripting to do this. I don't see a way to sort or filter cameras by enabled/disabled status within Agisoft.

SAV

  • Hero Member
  • *****
  • Posts: 710
    • View Profile
Re: Getting the number of disabled images
« Reply #7 on: September 14, 2017, 07:20:48 PM »
Alexey and I were basically posting at the same moment  :)

Well, you have two solutions now ;-) Pick the one you like better.

Regards,
SAV

Jeremiah_ROWE

  • Guest
Re: Getting the number of disabled images
« Reply #8 on: September 14, 2017, 08:14:04 PM »
Thank you both very much!