Agisoft Metashape

Agisoft Metashape => Bug Reports => Topic started by: Gall on September 12, 2017, 03:42:24 PM

Title: Image quality estimation for multi plane layout
Post by: Gall on September 12, 2017, 03:42:24 PM
The image quality estimation feature does not work as intended on multi plane projects. The index seems to be calculated from the right plane (according to the master channel) but it is stored in the wrong place.

I'll illustrate with a simple 2-planes project.

From the GUI
Launching the estimation for all cameras will work as "intended" (meaning it will only compute the quality for the plane set as master channel, not sure if it should compute all the plane at once or not). Now, after estimating the quality for the second plane, the results are only visible (and overwrite the previous ones) when setting the first plane as master channel.
This is clearly not intended.

From Python
From Python we can see the same behavior:
Code: [Select]
>> chunk.estimateImageQuality()
>> chunk.cameras[0].planes[0].photo.meta['Image/Quality'], chunk.cameras[0].planes[1].photo.meta['Image/Quality']
('0.9175', None)
Default parameter, which should represent all cameras, only process the first plane.

Code: [Select]
>> chunk.estimateImageQuality([cam.planes[1] for cam in chunk.cameras])
>> chunk.cameras[0].planes[0].photo.meta['Image/Quality'], chunk.cameras[0].planes[1].photo.meta['Image/Quality']
('0.9175', None)
Setting the second plane as parameter will also only compute the first plane (although, for unknown reasons, I had a couple times the results of the second plane but stored in the first one. Can't reproduce it though).

But, as a workaround, we can at least use the method from PhotoScan.utils:
Code: [Select]
>> for cam in chunk.cameras:
>>     cam = cam.planes[1]
>>     cam.photo.meta['Image/Quality'] = str(PhotoScan.utils.estimateImageQuality(cam.photo.image()))
>> chunk.cameras[0].planes[0].photo.meta['Image/Quality'], chunk.cameras[0].planes[1].photo.meta['Image/Quality']
('0.9175', '0.8142930269241333')
This way, the indices are correctly visible in the photo panel for each plane (when switching master channel).
Title: Re: Image quality estimation for multi plane layout
Post by: Alexey Pasumansky on September 12, 2017, 05:41:15 PM
Hello Gall,

Thank you for reporting. In the version 1.4 it should be fixed. Here's a small test for 5-band camera (added via multiplane layout):

Code: [Select]
chunk = PhotoScan.app.document.chunk
chunk.estimateImageQuality(chunk.cameras[0].planes)
[chunk.cameras[0].planes[i].photo.meta['Image/Quality'] for i in range(5)]
>>>  ['0.899388', '0.871391', '0.877417', '0.710741', '0.902904']
Title: Re: Image quality estimation for multi plane layout
Post by: Alexey Pasumansky on September 19, 2017, 08:39:13 PM
Hello Gall,

Version 1.4 pre-release is available: http://www.agisoft.com/forum/index.php?topic=7730.0
If you have time for testing, please let me know if the mentioned functionality works as expected.