Open mdhe1248 opened 2 years ago
Apparently, there was a similar issue: https://github.com/JuliaImages/ImageTransformations.jl/issues/45 Maybe the issue is related to interpolations. Any thoughts or solutions?
Hi, Thanks for reporting this issue. You are right that this is indeed related to interpolations (see https://github.com/JuliaMath/Interpolations.jl/issues/192).
A similar issue was reported in scipy, and Cody-G
pointed out:
I think the reason for this behavior is the same as discussed in an issue I opened a while ago in the Julia interpolations package: JuliaMath/Interpolations.jl#192
TL;DR it's a performance optimization. It avoids the branching logic that would be required to keep the NaN value out of the computation at grid points.
So the bottom line seems to be that you cannot warp an image that contains NaN without it potentially propagating more NaN values.
Could you describe your particular use case? Does your original input image contain NaN values, or are you trying to apply a sequence of warps and the very first warp introduces NaN values?
If your original input doesn't contain NaN values, and you want to apply a sequence of warps, then you could keep your original image around, compose the sequence of warps, and apply it to your original image.
Hi all, If NaN exists at the last row or column of an array,
warp
results in a wrong outcome: It seems to add more NaNs in the outcome array. Initially, I found this while playing with two sequential warping.Then, it looks like that NaN somehow interferes the outcome of
warp
.Does anyone have thoughts? It might be an issue related to OffsetArray, but I am not sure. Also, please advise me if this weird outcome is from my mistake.