Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with image generation #90

Open
juvinski opened this issue Nov 30, 2017 · 33 comments
Open

Problem with image generation #90

juvinski opened this issue Nov 30, 2017 · 33 comments

Comments

@juvinski
Copy link

Hi,

I'm using ODM and after some map generation, there is an issue with the final products. On the final image - orthomosaic - there are lines like that:
problem1
problem2
How can I debug or try to see what is been done by mvs-texturing to figure out what is the cause of this error - the source images doesn't have this line BTW.

Best regards

@nmoehrle
Copy link
Owner

This looks to me like an artifact of the local seam leveling. Could you show me the wireframe of at one of these edges?

Best

@juvinski
Copy link
Author

Hi @nmoehrle thanks for your reply.
I'm pretty new on MVS, how can I get this wireframes ?

Best

@pierotofy
Copy link
Contributor

Open the textured mesh (.obj) from the odm_texturing folder in MeshLab, there’s an option to enable wireframe view there.

I’ve also seen these artifacts before, would love to learn more about possible causes and how to prevent them.

@juvinski
Copy link
Author

juvinski commented Dec 1, 2017

Ok, I will try, thanks a lot @pierotofy

@juvinski
Copy link
Author

juvinski commented Dec 1, 2017

Hi,

I made the procedure to access the wireframe
wire
model3d

The 3d image showing a problem area and the wireframe.
I coudn't see anything but if you can I put all texturing objects at this drive's folder
https://drive.google.com/open?id=1_JB-ofIcUSW2lS_qdERF6A9gGmHpmmeT

@pierotofy
Copy link
Contributor

@juvinski for the future, use "flat lines" and toggle the lights.

image

Here's a good screenshot.

image

A few other artifacts from the same dataset.

image

image

@juvinski
Copy link
Author

juvinski commented Dec 1, 2017

Really nice @pierotofy
thanks a lot for the information. I'm looking more this meshlab tool and is really nice :)

@pierotofy
Copy link
Contributor

Just encountered yet another dataset with the artifacts:

image

@nmoehrle
Copy link
Owner

I don't have an explanation for these artifacts, my first guess was an issue with the local seam leveling but those artifact would appear along mesh edges. Nothing within the algorithm should change the input images in such a way. I hope that I find the time to investigate this during the holidays.

@pierotofy
Copy link
Contributor

Please let me know if I can provide you with data or ways to reproduce it. Happy holidays!

@juvinski
Copy link
Author

Me too, I have three or four datasets with same problem

@nmoehrle
Copy link
Owner

Is one of these datasets small enough that you can bisect the issue? Was there a version of texrecon that did not produce these issues?

@pierotofy
Copy link
Contributor

I remember first seeing this problem about 8 months ago. It's possible that it worked before, but I wouldn't be able to tell. @juvinski ?

Tomorrow I'll try to put together a reproducible dataset.

@pierotofy
Copy link
Contributor

pierotofy commented Dec 23, 2017

@juvinski would you be willing to share one of your datasets' images on google drive?

@juvinski
Copy link
Author

juvinski commented Dec 24, 2017

hi @pierotofy and @nmoehrle ,

I don't remember any dataset with this problems since the datasets O processed since November.
I'm running some datasets taked around this year to see if I can see the problem happening with this older datasets.
I have tested in two versions of texrecon - one built in March and other in November - both generated the model with the fail.
This is a dataset - around 760 Mb - If you need something bigger or smallest please let me know.
https://drive.google.com/open?id=1m9QtEJkjk6CvmWDJ3BfoIhipIC_gN_kE

Best regards

@pierotofy
Copy link
Contributor

Ok here's a full, reproducible test case:

Texrecon version is from the OpenDroneMap fork (https://github.com/OpenDroneMap/mvs-texturing/) which is almost on par with the current master.

Dataset with mesh, images and visualsfm file: https://drive.google.com/open?id=12rrV51VSwXvQgXf-TbZBubwN9i-YMZ8w

texrecon /subset/reconstruction.nvm /subset/odm_mesh.ply /subset/output -d gmi -o gauss_clamping -t none

image

@juvinski
Copy link
Author

Btw,
the -d area flag produces the same result.

@pierotofy
Copy link
Contributor

Found a smaller reproducible dataset (18 images) which might be easier to work with.

https://drive.google.com/open?id=1KUPVMyGwStRirXJmoC6BNoiwFp2pGLTF

# texrecon reconstruction.nvm odm_25dmesh.ply odm_textured_model -d gmi -o gauss_clamping -t none

Top right corner shows:

image

@nmoehrle
Copy link
Owner

nmoehrle commented Jan 7, 2018

I finally managed to look into this and the artifact is introduced during the global seam leveling, if the global seam leveling is disabled (--skip_global_seam_leveling) the artifact is gone. However, I have yet to track down why it is introduced. There is a lot of overlapping geometry in the mesh as well as gigantic triangles, but the area around the artifact looks clean as far as I can tell.

@nmoehrle
Copy link
Owner

nmoehrle commented Jan 7, 2018

I just had a result where everything was pink like yours. I initially thought that was the original color you fed into the algorithm, did the algorithm distort the color towards pink?

@pierotofy
Copy link
Contributor

You mean the "subset" dataset? The images are already pinkish due to the camera filter that was used to take the images.

@nmoehrle
Copy link
Owner

nmoehrle commented Jan 7, 2018

Ah ok no I just go a completely corrupt result when retexturing with -L and thought you might have experienced the same... pink

@pierotofy
Copy link
Contributor

Oh I see, no I've never seen that type of pink output. ^_^

@juvinski
Copy link
Author

juvinski commented Jan 9, 2018

Hi,
I didn’t notice problems until last October.
I will try to strip some big dataset. I notice my new camera - nir + green + blue - all datasets have problems instead my rgb.

@juvinski juvinski reopened this Jan 11, 2018
@juvinski
Copy link
Author

Hi,

this dataset can be used.
If you want another one or a little one please let me know.

https://drive.google.com/drive/folders/1DYESz3VnH95kPolA-Qhm1rx4OaZfCJhk?usp=sharing

Best regards.

@nmoehrle
Copy link
Owner

Ok so the issue arises due to the jpeg compression of the undistored images.

The current implementation assumes a pitch black (RGB(0,0,0)) border within undistorted images and calculates a validity mask from it. In a lossy compressed format like jpeg the border is not pitch black and thus regions that should be invalid might be classified as valid and used in the reconstruction. The artifacts we see are the undistortion borders of images.

My previous assessment that the the problem is caused by the global seam leveling was wrong -- there was a race condition when using data costs or the labeling of a previous run (-L, -D) which was fixed with 20bf2a8.

I am reluctant to increase the threshold although this would fix this particular problem because it might cause other issues.

Is it possible for you to write out undistorted images in a lossless format?

@pierotofy
Copy link
Contributor

Thanks for taking the time to look into this @nmoehrle! I think we can export the images in a lossless format, I will discuss it with the OpenDroneMap team.

@juvinski
Copy link
Author

Hi @nmoehrle,

I'm generating undistorted images in png format( and testing compression from 0 to 9).
This change give me better results, for instance, with jpg I was having 65 slashes in the result, now using png I'm having 5. Do you have any clue about how get this result better ?

@nmoehrle
Copy link
Owner

Oh that's surprising - can you provide the dataset that gives you five slashes?

@juvinski
Copy link
Author

in true is the same dataset - I was comparing the image convertion to see what results or differences I will get.
There are datasets I didn't have any slashes with png convertion, but there are I have this diminution.
Previous - with jpg:
p1

After with png:
p2

This is the dataset. https://drive.google.com/open?id=1y2G1Et72H4zsVU0EVNvypZVAtk88Y-Yw
If you wish I can give the model and textures too.

@juvinski
Copy link
Author

juvinski commented Mar 3, 2018

Hi @nmoehrle , I discovered something more about this issue.
I have 2 cameras - all the same except the lens - one is with 3.97 mm and other is 4.35mm.
The 3.97 I didn't have problems, just on the 4,95 lens. How the focal can interfere with the that ?

Best regards.

@pierotofy
Copy link
Contributor

@juvinski you should try to provide a reproducible dataset (images, nvm file, etc.) so that we can try to identify the problem further. Without it it's a bit difficult 👍

@dbadrian
Copy link

dbadrian commented May 9, 2019

Has anyone ever looked deeper into this and found out something new? Using some lossless compression like png fixed a lot of issues, but still some remain as for @juvinski .

Edit: Unlike mentioned above, I could resolve quite a few/all of the left-over artifacts by using area instead of gmi as data term. Why exactly this caused them I can't tell (yet), but I intuitively I'm not surprised that it might cause some local favoring of strong gradients (of maybe a slightly misaligned camera view?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants