Forum

Author Topic: AttributeError, but why?  (Read 1182 times)

xyz

  • Newbie
  • *
  • Posts: 5
    • View Profile
AttributeError, but why?
« on: February 04, 2021, 03:52:01 PM »
Hi,

I want to automate gradual selection filters. As a start i tried the following code, exactly as written in the python manual:

Code: [Select]

import Photoscan
doc = PhotoScan.app.document

project_path = "G:\\data\test\\"
project_name = "test"

chunk = PhotoScan.app.document.chunk
treshold = 0.5
f = PhotoScan.Filter.ReprojectionError()
f.init(chunk, criterion = PhotoScan.PointCloud.Filter.ReprojectionError)
f.selectPoints(threshold)

doc.save()

print("Finised")



However, i keep get the message:
AttributeError: type object 'PhotoScan.PointCloud' has no attribute 'Filter'

What is missing?

Thanks



Paulo

  • Hero Member
  • *****
  • Posts: 1076
    • View Profile
Re: AttributeError, but why?
« Reply #1 on: February 04, 2021, 05:44:59 PM »
I think you should change 
Code: [Select]
f = PhotoScan.Filter.ReprojectionError()for
Code: [Select]
f = PhotoScan.PointCloud.Filter()
and it should work
Best Regards,

Paul Pelletier,
Surveyor

xyz

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: AttributeError, but why?
« Reply #2 on: February 04, 2021, 05:56:44 PM »
Thank you for the tip! It still gives the same error..

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14004
    • View Profile
Re: AttributeError, but why?
« Reply #3 on: February 05, 2021, 12:10:37 AM »
Hello xyz,

Which version of PhotoScan/Metashape do you use?
Best regards,
Alexey Pasumansky,
Agisoft LLC

xyz

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: AttributeError, but why?
« Reply #4 on: February 05, 2021, 01:10:09 PM »
Hi Alexy,

I am using version 1.2.6 of PhotoScan

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14004
    • View Profile
Re: AttributeError, but why?
« Reply #5 on: February 05, 2021, 08:23:24 PM »
Hello xyz,

PointCloud.Filter class has been added in the version 1.3.0.
Best regards,
Alexey Pasumansky,
Agisoft LLC

xyz

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: AttributeError, but why?
« Reply #6 on: February 06, 2021, 12:17:17 AM »
Thanks