Forum

Author Topic: Split in chunks script settings  (Read 8162 times)

matteosin

  • Newbie
  • *
  • Posts: 17
    • View Profile
Split in chunks script settings
« on: November 28, 2018, 07:52:21 AM »
Hi all,

I am using the script split in chunks. I am using this: https://github.com/agisoft-llc/photoscan-scripts/blob/master/src/split_in_chunks_dialog.py

When I run the script the only options I have are the one in the attachment.

Basically, for what concern Dense Point Cloud generation, I just can choose the quality of Dense Point Cloud but not the filter. By default, if I run the script, it will use "aggressive" filter.

Any clue? Thank you

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14813
    • View Profile
Re: Split in chunks script settings
« Reply #1 on: November 28, 2018, 12:31:07 PM »
Hello matteosin,

The selection of the filtering is not implemented in the script. If you wish to change that, you can modify line 285 of the script and set filter=PhotoScan.FilterMode.MildFiltering, for example.
Best regards,
Alexey Pasumansky,
Agisoft LLC

chrisodiachi

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Split in chunks script settings
« Reply #2 on: December 12, 2018, 11:00:08 AM »
Hi,

I used the split in chunks script using a 5 by 5 grid. There was a power cut on chunk 4_4 but luckily i had the autosave feature. How i do finish up the processing the remaining 6 chunks without restarting. I spent two days to get to this point.

Thank you
« Last Edit: December 12, 2018, 11:02:36 AM by chrisodiachi »

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14813
    • View Profile
Re: Split in chunks script settings
« Reply #3 on: December 12, 2018, 11:50:19 AM »
Hello chrisodiachi,

I think that the easiest way could be adding the conditions to the nested loop to skip the processing if the cell indices is related to already processed chunks.

For example, something like the following (put the following codes before line 239 in the sample script: https://github.com/agisoft-llc/photoscan-scripts/blob/master/src/split_in_chunks_dialog.py, if you are using modified code, put the new lines to the corresponding location then):
Code: [Select]
chunk_labels = [ichunk.label for ichunk in PhotoScan.app.document.chunks]
if  "Chunk " + str(i) + "_" + str(j) in chunk_labels:
    continue

I can suggest to check this fix on the smaller test project to see if it actually works and doesn't affect already processed chunks. Also do not forget to make the source chunk (first chunk) active prior to the script run.
« Last Edit: January 17, 2019, 09:18:50 PM by Alexey Pasumansky »
Best regards,
Alexey Pasumansky,
Agisoft LLC

bisenberger

  • Sr. Member
  • ****
  • Posts: 329
    • View Profile
    • Digital Mapping & Graphics
Re: Split in chunks script settings
« Reply #4 on: January 16, 2019, 12:17:51 AM »
Cool!  8)

Thanks for posting this!
Digital Mapping & Graphics LLC
https://digital-mapping.net/

bisenberger

  • Sr. Member
  • ****
  • Posts: 329
    • View Profile
    • Digital Mapping & Graphics
Re: Split in chunks script settings
« Reply #5 on: January 16, 2019, 03:03:37 PM »
There is something really messed up with using this script on a project with multiple chunks. I ran it on a project that had 2 chunks (of two different areas). The first chunk was named south area and the second chunk was named north area. I ran the script with the second chunk (north area) active. The settings I used were Build Dense Cloud, Merge Back, and Ultra. When it completed there were 2 chunks in the project, the first one named south area and the second one named Merged Chunk. The Merged Chunk data is from the first chunk (south area). All the data from the second chunk that was active when I ran the script (north area) is gone.
Digital Mapping & Graphics LLC
https://digital-mapping.net/

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14813
    • View Profile
Re: Split in chunks script settings
« Reply #6 on: January 16, 2019, 03:08:45 PM »
Hello bisenberger,

The default script assumes that there is only one chunk in the active project that requires splitting.
Best regards,
Alexey Pasumansky,
Agisoft LLC

bisenberger

  • Sr. Member
  • ****
  • Posts: 329
    • View Profile
    • Digital Mapping & Graphics
Re: Split in chunks script settings
« Reply #7 on: January 16, 2019, 08:13:43 PM »
Thanks Alexey,
That is good to know.  :)
Digital Mapping & Graphics LLC
https://digital-mapping.net/

chrisodiachi

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Split in chunks script settings
« Reply #8 on: February 14, 2019, 10:37:52 AM »
Hello chrisodiachi,

I think that the easiest way could be adding the conditions to the nested loop to skip the processing if the cell indices is related to already processed chunks.

For example, something like the following (put the following codes before line 239 in the sample script: https://github.com/agisoft-llc/photoscan-scripts/blob/master/src/split_in_chunks_dialog.py, if you are using modified code, put the new lines to the corresponding location then):
Code: [Select]
chunk_labels = [ichunk.label for ichunk in PhotoScan.app.document.chunks]
if  "Chunk " + str(i) + "_" + str(j) in chunk_labels:
    continue

I can suggest to check this fix on the smaller test project to see if it actually works and doesn't affect already processed chunks. Also do not forget to make the source chunk (first chunk) active prior to the script run.


Please i am getting errors when i insert the new lines. Indentation errors and inconsistent use of tabs and spaces in line 236. Can you tell me how to properly insert the code into the script. I am using the metashape splint in chunks script. Thank you

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14813
    • View Profile
Re: Split in chunks script settings
« Reply #9 on: February 14, 2019, 01:37:01 PM »
Hello chrisodiachi,

If you add new lines with the indentation to the script, make sure that you are following the same convention that is already used in the script: same number of "spaces" or "tabs".
Best regards,
Alexey Pasumansky,
Agisoft LLC