You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MSVC compilation error in bilateral_upsampling.hpp #2016
The fix is to make dx and dy int, not float. They are used as indices in matrix and compiler cannot choose the correct overload
Why do dx and dy variables float at all? And how does it work before?
Visual Studio 2015
Eigen 3.3.90 (latest from mercurial repo)
I will create a pull request as soon as my last pull request will be approved
Ok, one more question - d_color is float too. We cast the sum of color channel diffs (int if I understand correctly) to float, then we cast it to Eigen index. Would it be correct to make d_color of Eigen index type and just cast to it only once (sum)?
I think that in terms of semantics that piece of code is alright. The d_color variable contains L1 distance between the colors, not an index. And then when we actually perform access into the vector, we say "hey, this distance happens to be indexing into the vector, so let's cast".
Your code has less casts, so probably marginally faster. But it's a minor thing anyway.
Activity
taketwo commentedon Sep 30, 2017
Similar to #1890 #1914.
Don't know why, but it makes no sense.
It still works for me with Eigen 3.3 and GCC 5.4.
These two issues are unrelated, I see no reason to make one dependent on another. Also this one is trivial, we can merge it right away.
[-]MSVC compilation error in bilateral_upsampling.cpp[/-][+]MSVC compilation error in bilateral_upsampling.hpp[/+]denix56 commentedon Sep 30, 2017
Ok, one more question - d_color is float too. We cast the sum of color channel diffs (int if I understand correctly) to float, then we cast it to Eigen index. Would it be correct to make d_color of Eigen index type and just cast to it only once (sum)?
taketwo commentedon Sep 30, 2017
I think that in terms of semantics that piece of code is alright. The
d_colorvariable contains L1 distance between the colors, not an index. And then when we actually perform access into the vector, we say "hey, this distance happens to be indexing into the vector, so let's cast".Your code has less casts, so probably marginally faster. But it's a minor thing anyway.