Forum

Author Topic: Undesired cutting of model in python workflow?  (Read 5125 times)

Frank

  • Newbie
  • *
  • Posts: 6
    • View Profile
Undesired cutting of model in python workflow?
« on: September 01, 2014, 11:53:42 PM »
Hello,

i am currently evaluating if i should purchase the pro version of PhotoScan.
For me the main reasons is the ability of python scripting for automatic processing which can save me a lot of time worth the money.

For evaluation purposes i wrote a python script which loops a directory containing subdirectories with the individual picture sets. Then all picture sets are processed automatically (complete workflow) and a *.psz file is written for each subdirectory.

That all works perfectly except 2 remaining problems:

1.)   I have the feeling that PS gets slower after running a while (10 hours or more).
Currently im using
“import gc”
“gc.enable()”

and I am also deleting the current chunk in my for each loop after it was saved
“doc.chunks.remove(chunk)”
Any other hints?

2.)   The much bigger problem and absolute show stopper is the following:
The Region, which is calculated automatically is sometimes cutting the model undesired.
When I manually use PS and resize the Region I get a better model without missing parts
(see Attachments also)
How can I avoid that cutting of the model using automatic processing with  python script?


Thank you a lot for your help!
Regards Frank

Frank

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Undesired cutting of model in python workflow?
« Reply #1 on: September 07, 2014, 07:18:18 PM »
Can anyone help me please concerning issue 2.) ?

Cutting of the models while using python workflow:

Thank you alot!

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14854
    • View Profile
Re: Undesired cutting of model in python workflow?
« Reply #2 on: September 08, 2014, 09:43:44 AM »
Hello Frank,

Bounding Box can be resized and repositioned using Python script, but to do that some criterion should be suggest. For example, center of the bounding box can be estimated based on camera positions (the simplest way is to average their locations) and the size could be selected as a distance from the center to any camera.
It's just an example of what can be done.

Also you can place static markers in scene. It will allow to set up the coordinate system and scale of the model, thus the bounding box size and center can be defined in absolute units.

If you have already any idea of the BB definition, but need any assistance in scripting, let me know.
Best regards,
Alexey Pasumansky,
Agisoft LLC

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14854
    • View Profile
Re: Undesired cutting of model in python workflow?
« Reply #3 on: September 08, 2014, 09:45:02 AM »
And as for the second (actually the first) question. It seems strange to me.
Maybe you can send the script via e-mail or PM?
Best regards,
Alexey Pasumansky,
Agisoft LLC

Frank

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Undesired cutting of model in python workflow?
« Reply #4 on: September 08, 2014, 01:59:24 PM »
Hi Alexey,

i sent you the script in a private message.
Concerning the first question: I think it may be a problem with the PC (or any background software) where PS runs currently.
Maybe you can take a look at the script and confirm me dooing the garbage collection correct?
I will run some more tests on a new, highend PC next week as soon as its delivered.

The needed help with the bounding box is for sure more important for me :=)

Thank you for your help!
Regards Frank