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

Wrong colors/color skewing when using global seam leveling #63

Open
svetlins opened this issue Dec 19, 2016 · 20 comments
Open

Wrong colors/color skewing when using global seam leveling #63

svetlins opened this issue Dec 19, 2016 · 20 comments

Comments

@svetlins
Copy link

Hello,

I'm trying to texture a mesh with some aerial imagery (as part of a larger toolchain - OpenDroneMap). The results I'm getting are somewhat wrong and I've traced the color skewing to mvs-texturing and more specifically to the the global seam leveling option. Here is the nvm, images and ply file as well as screen shots of the results I'm comparing.

Here is the result with --skip_global_seam_leveling:
good
(exact command used: texrecon pmvs/nvmCams.nvm mesh.ply output/good -d gmi -o none --skip_global_seam_leveling)

And here is without:
bad
(exact command used: texrecon pmvs/nvmCams.nvm mesh.ply output/bad -d gmi -o none)

The texrecon executable was built by me against 93a261f which was the latest master at the time of writing this issue.

One interesting tidbit/observation that may as well be wrong but it looks like this color skewing is noticeable on all aerial datasets I've tested with but is more pronounced on ones that were shot with some kind of color filter as this one is.

I'm ready to provide any other details if you need them.

And thanks a lot for your work!

@rion-saeon
Copy link

rion-saeon commented Jan 17, 2017

@rion-saeon
Copy link

Mesh and Orthophoto anomalies issue #454

ee7c846c-dbee-11e6-8ccd-2a74cb632c5f

@nmoehrle
Copy link
Owner

Thanks, for raising the issue and providing an example.
I am sorry that I haven't addressed this issue yet and that I cannot tell you when I will have time to do so...

@dakotabenjamin
Copy link

dakotabenjamin commented Jan 17, 2017

I will also provide another example of color balance issues. Maybe it is related to #59 as well?

odm_orthophoto_scaled

edit: provided a better reconstruction and with global seam leveling disabled below:

odm_orthophoto_seams

@smathermather
Copy link

Hi @nmoehrle -- is there any way we can help, either by providing development resources or other issues?

@nmoehrle
Copy link
Owner

Thanks for the offer!

I have two deadlines coming up that currently require all of my attention so I cannot experiment with these datasets myself.

That being said I could not help myself and had a look at your first dataset. If you reconstruct it without any seam leveling you see how different the colors of the input image actually are. The issue here is that our global seam optimization has due to the view selection little to no constraints on how to adjust the images. There are many regions where it has only three image, with wildly different colors, that separate all other images so it simply distributes the errors.

no-seam-leveling
view-selection

The only Idea that I currently have is regularizing the global adjustments. In datasets with less boundaries this happens implicitly and a regularization would hurt the quality there but for these datasets it might be necessary.

The relevant section in the paper is 4.3 equation (3) the implementation is in global_seam_leveling.cpp#L243. In theory it should be possible to simply multiply with another regularization matrix that penalizes adjustments in general. If you search for a reference the wiki entry for Tikhonov regularizations is actually quite good.

The issues of the other datasets look different to me, I belief that alignment (and thus the adjustment of non corresponding colors) is more of an issue there.

I am happy to answer questions but I cannot dig into it myself right now.

Best,
Nils

@nmoehrle
Copy link
Owner

Only global seam leveling without regularization:
before
Only global seam leveling with regularization:
after

Seams like a regularization could work - could you guys do some tuning and testing?

@dakotabenjamin
Copy link

I have a few datasets run with a lens filter so yes I can do that.

@svetlins
Copy link
Author

@nmoehrle that original dataset looks much better! I will run a few other datasets and will post results here. (I assume I need to build the regularization branch)

Thanks again for your awesome work! :)

@nmoehrle
Copy link
Owner

Yes the regularization is the multiplication with a weighted identity matrix in this line that puts a quadratic penalty on all adjustments. The hard coded weight is the first thing that came to my mind - so its arbitrary - and requires tuning or should be exposed to the command line...

@dakotabenjamin
Copy link

I will be testing on this dataset: https://github.com/OpenDroneMap/odm_data_seneca You can see the mosaic I've generated from the original mvstex results in the README.

@dakotabenjamin
Copy link

For tuning, what kind of range are we looking at? This kind of math is far beyond my understanding, so the best I can do is guess and check the numbers.

So far the results look good for me using the default 0.0001
image

@dakotabenjamin
Copy link

@dakotabenjamin
Copy link

Visually, 0.0001 looks better. 0.00001 has too much darkening along the edges and 0.001 has these patches of light and dark. I would say the former does the best job accounting for some of the vignetting and cloud-cover issues from the original dataset.

@nmoehrle
Copy link
Owner

Wow, lucky guess I guess ^^

Indeed with 1e-3 we can already see how the leveling is degrading and 1e-5 is not strong enough for the borders, but I think this will depend somewhat on the dataset so I wont merge it into master right away at least not without exposing it to the command line.

It would be interesting to see the results when we only regularize the borders...

Thanks for testing!

@rion-saeon
Copy link

rion-saeon commented Feb 8, 2017

Before (didn't pass --mvs_texturing-skipGlobalSeamLeveling):
odm_orthophoto_resized

After (smathermather/OpenDroneMap: mvs-global-illumination-patch Branch):
odm_orthophoto_mvs-texturing_resized

@nmoehrle
Copy link
Owner

nmoehrle commented Feb 8, 2017

Was there a cloud? Or is it still failing?

@rion-saeon
Copy link

Cloud.

@smathermather
Copy link

Outstanding. Dakota and I are testing a couple of other tricky datasets today. We'll let you know how it goes... .

dakotabenjamin pushed a commit to OpenDroneMap/mvs-texturing that referenced this issue Dec 5, 2017
npcasler pushed a commit to SolSpecSolutions/mvs-texturing that referenced this issue Aug 14, 2019
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

5 participants