JuliaImages / ImageFiltering.jl

Julia implementations of multidimensional array convolution and nonlinear stencil operations
Other
99 stars 51 forks source link

introduce a `findall` version of `mapwindow` #224

Open johnnychen94 opened 2 years ago

johnnychen94 commented 2 years ago

Originally posted in https://github.com/JuliaImages/ImageFiltering.jl/pull/223#pullrequestreview-744624172

We have mapwindow that applies function f on every local patch of an image, which can be seen as the image version of map. We don't have the window version of findall that applies f to each local patch, and return coordinates such that f(window_of_p) == true.

Why we need this? We can currently do this by returning a dense Bool matrix from mapwindow and then call findall, but this would usually be unnecessary and not as performant as the manually written for-loops. For example, the benchmark in https://github.com/JuliaImages/ImageSegmentation.jl/pull/72#issuecomment-910135541