Forum

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Silent_T

Pages: [1]
1
Replying to:
Does anyone solve this Zero resolution problem after splitting in chunks?

Using Alexey's suggestions I was able to split the project into chunks, just without doing any processing (Dense Cloud or Mesh creation) using the "split in chunks" dialog. I was able to then build the dense cloud and mesh on all the chunks using the batch processing feature. quote below:
...
The reason I say I have had limited success is because the result is the creation of all of the split chunks (16 in my case, 4x4), they are just empty (i.e. no dense cloud). I can use these in the batch processing tool like normal, so that is a possibility, albeit not an ideal solution. However, the Build Dense Cloud option within the script no longer works as it is just bypassed. While I do now have a workaround, I'm just curious if I can get this working smoothly...
...

So, this process works, but I have not checked for any script updates that might fix the script, nor have I run it since my previous post. 

2
Python and Java API / Re: split_in_chunks: Zero Resolution Error (v1.5)
« on: January 17, 2019, 11:49:11 PM »
Hello Alexey,
Thank you for the suggestions. I have tried to implement the exception with limited results. I think I need clarification on where exactly to integrate the code.

I'm assuming your code is meant to replace lines 275-279 and/or 283-288 (shown in the attached screenshot). I have tried doing so in both locations together and separate.

The reason I say I have had limited success is because the result is the creation of all of the split chunks (16 in my case, 4x4), they are just empty (i.e. no dense cloud). I can use these in the batch processing tool like normal, so that is a possibility, albeit not an ideal solution. However, the Build Dense Cloud option within the script no longer works as it is just bypassed. While I do now have a workaround, I'm just curious if I can get this working smoothly...

Can you please clarify what lines you think I should be replacing or inserting and where??
Thank you!

Options I have tried:
1: replacing the statement in after "else"
Code: [Select]
if buildDense:
                    if new_chunk.depth_maps:
                        reuse_depth = True
                        if new_chunk.depth_maps.meta['depth/depth_downscale']:
                            quality = QUALITY[new_chunk.depth_maps.meta['depth/depth_downscale']]
                        if new_chunk.depth_maps.meta['depth/depth_filter_mode']:
                            filtering = FILTERING[new_chunk.depth_maps.meta['depth/depth_filter_mode']]
                        try:
                            new_chunk.buildDepthMaps(quality=quality, filter=filtering, reuse_depth=reuse_depth)
                            new_chunk.buildDenseCloud(max_neighbors=100)  # keep_depth=False
                        except RuntimeError:
                            print("Can't build dense cloud for " + chunk.label)

                    else:
                        reuse_depth = False
                        try:
                            chunk.buildDenseCloud()
                        except Exception as exc:
                            print("Something wrong for chunk ", chunk.label, ". Skipped error: ",exc)


2 replacing the first "try" statement
Code: [Select]
if buildDense:
                    if new_chunk.depth_maps:
                        reuse_depth = True
                        if new_chunk.depth_maps.meta['depth/depth_downscale']:
                            quality = QUALITY[new_chunk.depth_maps.meta['depth/depth_downscale']]
                        if new_chunk.depth_maps.meta['depth/depth_filter_mode']:
                            filtering = FILTERING[new_chunk.depth_maps.meta['depth/depth_filter_mode']]
                        try:
                            chunk.buildDenseCloud()
                        except Exception as exc:
                            print("Something wrong for chunk ", chunk.label, ". Skipped error: ",exc)

                    else:
                        reuse_depth = False
                        try:
                            new_chunk.buildDepthMaps(quality=quality,
                                                     filter=Metashape.FilterMode.AggressiveFiltering, reuse_depth=reuse_depth)
                            new_chunk.buildDenseCloud(max_neighbors=100)  # keep_depth=False
                        except RuntimeError:
                            print("Can't build dense cloud for " + chunk.label)

3 replacing both "try" statements
Code: [Select]
if buildDense:
                    if new_chunk.depth_maps:
                        reuse_depth = True
                        if new_chunk.depth_maps.meta['depth/depth_downscale']:
                            quality = QUALITY[new_chunk.depth_maps.meta['depth/depth_downscale']]
                        if new_chunk.depth_maps.meta['depth/depth_filter_mode']:
                            filtering = FILTERING[new_chunk.depth_maps.meta['depth/depth_filter_mode']]
                        try:
                            chunk.buildDenseCloud()
                        except Exception as exc:
                            print("Something wrong for chunk ", chunk.label, ". Skipped error: ",exc)

                    else:
                        reuse_depth = False
                        try:
                            chunk.buildDenseCloud()
                        except Exception as exc:
                            print("Something wrong for chunk ", chunk.label, ". Skipped error: ",exc)

3
Python and Java API / split_in_chunks: Zero Resolution Error (v1.5)
« on: January 17, 2019, 08:54:17 PM »
Hello,
I have received a Zero Resolution error when running the Split In Chunks script to create a dense point cloud. I am using the latest script copied from https://github.com/agisoft-llc/metashape-scripts/blob/master/src/split_in_chunks_dialog.py

I am aware of what the Zero Resolution error means from other posts https://www.agisoft.com/forum/index.php?topic=5109.msg44587#msg44587, and I understand that there are no, or not enough points in the chunk I am processing to create the dense point cloud. See attached screenshot of the 4x4 split that I am processing, the bounding box shown (i.e. 1-4) is the one that stops processing.

However, in the past (before v1.5.0) I have run the script with no problems on chunks with few or no points available to create a dense cloud, similar to this current scenario. The script simply skipped over those chunks with not enough points and didn't create a dense cloud, but continued on processing the other chunks.

In Metashape v1.5 I am getting a Zero Resolution error when the script encounters a chunk with few or no points. Error follows (I have replaced the file location with <FileDir> for brevity):

Quote
File "<FileDir>, line 152, in <lambda>

proc_split = lambda: self.splitChunks()

File "<FileDir", line 286, in splitChunks

new_chunk.buildDenseCloud(max_neighbors=100)  # keep_depth=False

Exception: Zero resolution


I have tried to continue processing from this point using the additional code found in this thread (also pasted below), thinking I could skip it manually with this method: https://www.agisoft.com/forum/index.php?topic=10024.0
Code: [Select]
chunk_labels = [ichunk.label for ichunk in PhotoScan.app.document.chunks]
if  "Chunk " + str(i) + "_" + str(j) in chunk.labels:
    continue

Per the previous threads instructions, I added the above additional code on line 239 (i.e in between the following lines):
Code: [Select]
for i in range(1, partsX + 1):
                if not buildDense:
I Updated "PhotoScan" to "Metashape" and received the following error:
Quote
File "<FileDir>", line 152, in <lambda>

proc_split = lambda: self.splitChunks()

File "<FileDir>", line 240, in splitChunks

chunk_labels = [ichunk.label for ichunk in Metashape.app.document.chunks]

AttributeError: 'Metashape.Chunk' object has no attribute 'labels'

In this case, understand that 'labels' needs to be defined for 'Metashape.Chunk', but I have tried editing the script with my limited coding ability to no success. I can't seem to find a solution to move forward.

Any thoughts on how to get the script to skip chunks with few or no points? Or, as a workaround, how to get the additional script to allow continued processing from what has already been processed? Thanks in advance for any assistance provided.

4
General / Re: Post Processing Software?
« on: March 26, 2016, 06:12:39 PM »
We use Quick Terrain Modeller (http://appliedimagery.com/), it is a very powerful processing tool that does allow the creation of videos and change detection/volumetric measurements. It is designed for far more though and is quite expensive so if you are looking to use this for personal use I would steer away from it.

Unfortunately, I am not aware of any open source software to do what you ask but there is a great interactive visualisation tool through QGIS (http://www.qgis.org/en/site/) that you might find interesting.  If you download the "threejs" plugin, you can generate an interactive model of a DEM with an overlaid Orthophoto (or whatever you would like) that anyone can open up in a web browser.

It is too large to upload here but if you download this link (11mb), unzip it, and open the .html file you can see an example of what the threejs plugin does. https://www.dropbox.com/s/8eede1ynjne0mid/Hakai_Institute.zip?dl=0

Cheers

Pages: [1]