Agisoft Metashape

Agisoft Metashape => Bug Reports => Topic started by: andyroo on May 23, 2020, 03:25:28 AM

Title: Correlation matrix disappeared?
Post by: andyroo on May 23, 2020, 03:25:28 AM
I've been running a series of tests with the same imagery (multiple conversion-to-jpeg parameters) and in one case, the correlation matrix disappeared in the chunks that were copied (via script) from the initial alignment chunk. I can't see anything different from the other projects - the alignment and optimization and script are all run in batch - (1) align, (2) optimize, (3) run script.

The script copies the original chunk and runs gradual selection, saving a new chunk each time it optimizes to a threshold value for first Reconstruction Uncertainty, then Projection accuracy, then Reprojection Error. All of the copied chunks have the correlation matrix grayed out.

I just tried copying manually and the correlation matrix survives the copy. I'll try running just the script again, guessing it will work, but wondering what would cause this...
Title: Re: Correlation matrix disappeared?
Post by: Alexey Pasumansky on May 24, 2020, 08:05:36 PM
Hello andyroo,

Can you specify the steps performed by the script? Is that correct that you mean that chunk.copy() command doesn't transfer the correlation matrix to the chunk's copy?
Title: Re: Correlation matrix disappeared?
Post by: andyroo on June 16, 2020, 05:25:57 AM
Yes, it was chunk.copy() and it only happened once out of about 30 times, but I thought it was odd.

The copy command is third line from the bottom in this code:

Code: [Select]
        chunk = doc.chunk

        # check that chunk has a point cloud
        try:
            len(chunk.point_cloud.points)
        except AttributeError:
            # print exception so it will be visible in console
            print('AttributeError: Chunk "' + chunk.label + '" has no point cloud. Ensure that image '
                                                            'alignment was performed. Stopping execution.')
            raise AttributeError('Chunk "' + chunk.label + '" has no point cloud. Ensure that image alignment '
                                                           'was performed. Stopping execution.')

        # copy active chunk, rename, make active
        ru_chunk = chunk.copy()
        ru_chunk.label = chunk.label + '_RU' + str(parg.ru_filt_level)
        print('Copied chunk ' + chunk.label + ' to chunk ' + ru_chunk.label)