Agisoft Metashape

Agisoft Metashape => Bug Reports => Topic started by: BinaryEclipse on January 18, 2020, 12:32:46 PM

Title: Checker grid like lines in depth map generation.
Post by: BinaryEclipse on January 18, 2020, 12:32:46 PM
In the latest 1.6 version I've noticed for some of my models when generating mesh using depth maps on high, it tends to produce small vertical and horizontal line in the mesh. They can be smoothed out somewhat.

If you imagine an actual checker board, the white and black pairs of squares are slightly different heights, so for a given square, the one diagonally opposite has the same height.

+ What is a good way to attach the project files here?
Title: Re: Checker grid like lines in depth map generation.
Post by: Alexey Pasumansky on January 18, 2020, 05:26:02 PM
Hello BinaryEclipse,

Can you please send the related project files as a download link to support@agisoft.com?
Title: Re: Checker grid like lines in depth map generation.
Post by: BinaryEclipse on January 19, 2020, 03:12:00 AM
Thanks Alexey, I'll try to put upload it to google drive or something. Fortunately this example has only 52 photos, but it happens with larger sets as well.
Title: Re: Checker grid like lines in depth map generation.
Post by: BinaryEclipse on January 19, 2020, 01:17:49 PM
Sent the email. It's different each time I regenerate the depth maps, sometimes it's just 1 square in a corner, sometimes it's 16 smaller ones, sometimes they appear off axis. They're not always on the subject if I mask out everything, but will almost always be on the turntable if I mask out the subject/background(maybe because it's larger). I forgot to include in the email, I'm using an 1800x, 48 GB ram, 5700 XT + Fury X.

https://drive.google.com/drive/folders/1ahCOzZnAF4kNqzTnQnkqLzqNIw2FcClQ
Title: Re: Checker grid like lines in depth map generation.
Post by: Alexey Pasumansky on January 19, 2020, 02:44:48 PM
Hello BinaryEclipse,

Thank you for sharing the data, we will check that.
Title: Re: Checker grid like lines in depth map generation.
Post by: Vlad on January 20, 2020, 04:44:23 AM
can confirm bug.
looks like depth map used for mesh are 8bit.
and this bug from beta versions.
Title: Re: Checker grid like lines in depth map generation.
Post by: Alexey Pasumansky on January 20, 2020, 12:40:24 PM
Hello BinaryEclipse, hello Vlad,

Can you please confirm that the issue is still observed in the version 1.6.1 build 10009?

If the issue is still there, please provide the processing logs.
Title: Re: Checker grid like lines in depth map generation.
Post by: Mak11 on January 20, 2020, 09:13:34 PM
Alexey,

1.6.1 did fix my issues reported last month (https://www.agisoft.com/forum/index.php?topic=11331.msg52331#msg52331) 👍🏼 not sure if they are related to the one reported here but make sure to regenerate the depth maps and not re-use them after installing v1.6.1.

cheers

Mak
Title: Re: Checker grid like lines in depth map generation.
Post by: BinaryEclipse on January 21, 2020, 05:20:49 AM
Still happening for me, the major ones on the turntable stopped(for this image set at least) but they still show up on the model. I've encountered the bug mentioned by Vlad and Mak one time(with a different model) where it looks like low bit depth, but I think this is a different issue.

I've attached the log after rerunning alignment, optimize and mesh.
Title: Re: Checker grid like lines in depth map generation.
Post by: BinaryEclipse on January 21, 2020, 08:29:43 AM
Just for fun, here are the logs for another model. As a zip because it's from a much larger image set.
Title: Re: Checker grid like lines in depth map generation.
Post by: Alexey Pasumansky on January 23, 2020, 06:30:21 PM
Hello BinaryEclipse,

We are not observing this issue on our side.

I can suggest to run Build Mesh operation (you can re-use the depth maps) with only GPUs enabled and if the issue is reproduced, try to use only one of them at a time and check, if the results are difference for each run (with a single GPU utilized). If GPU run is fine, then try to use CPU only and also check the result.
Title: Re: Checker grid like lines in depth map generation.
Post by: BinaryEclipse on January 24, 2020, 02:30:26 AM
Alexey, I think the issue is related to using 5700 XT in combination. The lines go away only if the XT is used on it's own or disabled. They come back if XT is used in combination with the Fury X, CPU, or Fury X + CPU.

In one case I ran build mesh on a different image set that had a bad alignment, one section was raised by about 3x more than I usually see. Maybe the values for alignment aren't always the same for XT?
Title: Re: Checker grid like lines in depth map generation.
Post by: Alexey Pasumansky on January 24, 2020, 12:50:21 PM
Hello BinaryEclipse,

Thanks for additional input, we'll try to reproduce it using 5700XT in combination with other cards.

Which AMD driver version you have installed and which OS version is used?
Title: Re: Checker grid like lines in depth map generation.
Post by: BinaryEclipse on January 25, 2020, 02:00:10 AM
Radeon 20.1.1, and Windows 10 Pro Version 10.0.18362 Build 18362
Title: Re: Checker grid like lines in depth map generation.
Post by: BinaryEclipse on February 11, 2020, 04:32:33 AM
Any progress on reproducing this Alexey?
Title: Re: Checker grid like lines in depth map generation.
Post by: Alexey Pasumansky on February 11, 2020, 08:19:26 PM
Hello BinaryEclipse,

We were not able to reproduce this issue, but are observing some suspicious behavior on the same GPU. I'll send you some testing instructions via PM in a couple of minutes which you can check. If with these instructions you will be able to get proper results, then the reason is very likely related to hardware/driver.
Title: Re: Checker grid like lines in depth map generation.
Post by: Mak11 on February 11, 2020, 08:32:11 PM
Alexey,

OpenCL support on the RDNA GPUs (5700XT) is known to be really bad (AMD is taking its sweet time to fix this unfortunately) & with the Adrenalin 2020 drivers messing up OpenCL on Vega 2 GPUs (Radeon VII) it is looking like getting in touch with AMD may be the best way to try to fix these issues .

Mak
Title: Re: Checker grid like lines in depth map generation.
Post by: Alexey Pasumansky on February 11, 2020, 08:45:20 PM
Hello Mak,

Hopefully, with the tests we'll be able to confirm our assumption and then provide the related information to AMD.
Title: Re: Checker grid like lines in depth map generation.
Post by: Mak11 on February 11, 2020, 09:12:35 PM
Hello Mak,

Hopefully, with the tests we'll be able to confirm our assumption and then provide the related information to AMD.

Yup. As a matter of fact I'm suspecting that the OpenCL/Compute changes introduced in the Adrenaline 2020 drivers aimed at the rDNA GPUs (previous drivers were simply horrible on the OpenCL front for those cards and Adrenaline 2020 brought some performance improvements there) is what has probably "broken" OpenCL on the Vega 2 cars (Radeon VII/Pro).

Mak
Title: Re: Checker grid like lines in depth map generation.
Post by: BinaryEclipse on February 12, 2020, 11:00:17 AM
Alexey, I've run the mesh generation with depth maps on the version you sent, with and without the tweak. I don't get any lines after running each twice, but the runs without the tweak generate more "erratic" meshes and appear to be not as smooth.


Without the tweak, run twice:
Title: Re: Checker grid like lines in depth map generation.
Post by: BinaryEclipse on February 12, 2020, 11:05:22 AM
Logs with the tweak, run twice:
Title: Re: Checker grid like lines in depth map generation.
Post by: Alexey Pasumansky on February 12, 2020, 02:10:44 PM
Hello BinaryEclipse,

Can you please confirm that you have tried to set up the tweak to the string value provided in PM and have re-started the application before running the processing? And that "without" tweak run corresponds to the same tweak with the value set to "space" symbol - also after application re-start?
Title: Re: Checker grid like lines in depth map generation.
Post by: BinaryEclipse on February 12, 2020, 11:23:22 PM
Yes I restarted and verified the values before running each time. I'll run it again just to be sure. "no tweak" is the one with a space as the value.
Title: Re: Checker grid like lines in depth map generation.
Post by: BinaryEclipse on February 13, 2020, 12:18:33 AM
Fresh run logs attached, still no lines, run twice each.
Title: Re: Checker grid like lines in depth map generation.
Post by: Alexey Pasumansky on February 15, 2020, 08:05:29 PM
Thanks for additional info, BinaryEclipse,

If the behavior of GPU-based processing results on XT5700 is quite random, I can suggest to continue using the provided tweak (however, it will increase the processing time), but if the processing artifacts stop appearing (with some driver updates, for example), you can remove the tweak and work in common mode.
Title: Re: Checker grid like lines in depth map generation.
Post by: BinaryEclipse on February 16, 2020, 01:01:26 AM
Thanks Alexey. It's usually not a huge deal, they get worse with worse alignment or might not show on the model randomly. Smaller cases can be smoothed out which I usually do anyway before refining. 1.6.2 seems to fix the specific issue of lines.
Title: Re: Checker grid like lines in depth map generation.
Post by: e.spiridonova on October 10, 2023, 03:59:57 PM
Hello,

We have published a pre-release version of Metashape 2.1: https://www.agisoft.com/forum/index.php?topic=15894.0

There is a minor improvement in mesh generation algorithm that reduces banding in some cases.