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
Is it possible/recommended to add an overload to warp that takes a lookup table instead of a transform. The functionality would be similar to OpenCVs remap found here.
The text was updated successfully, but these errors were encountered:
Absolutely, tform can be any function or function-like object that accepts StaticArrays.SVector as input and also outputs an SVector.
The default range inference does not apply to generic function, so in this case you have to specify indices as well.
A quick example:
using ImageTransformations, ImageCore, ImageShow, TestImages
using StaticArrays
functionshrink_to(R0)
function_shrink(I)
I_first, I_last =first(R0).I, last(R0).I
ntuple(ndims(R0)) do n
i, from, to = I[n], I_first[n], I_last[n]
clamp(i, from, to)
end|> SVector
endend
img =testimage("cameraman")
imgs =warp(img, shrink_to(CartesianIndices((64:448, 64:448))), axes(img))
mosaic(img, imgs; nrow=1)
which gives
I just came up with this very "meaningless" demo, if you have a better showcase, please share it here, or add a demo card to https://juliaimages.org/dev/examples/
Is it possible/recommended to add an overload to warp that takes a lookup table instead of a transform. The functionality would be similar to OpenCVs remap found here.
The text was updated successfully, but these errors were encountered: