Hi Yuri,
I'd recommend copy/pasting the core imfilter algorithm:
https://github.com/timholy/Images.jl/blob/4ba5163c2904086422b8c521598949926acaaf3e/src/algorithms.jl#L459-L482
and just before the tmp = zero(TT) line, put in a check like
if !(@nref $N mask i)
continue
end
If you're running julia 0.4, you can write that code without macros, but it's
not easy to do so efficiently on julia 0.3.
--Tim
On Saturday, May 02, 2015 04:37:10 PM Yuri Vishnevsky wrote:
> Hi all,
>
> I am playing around with image inpainting
> (http://en.wikipedia.org/wiki/Inpainting) using the very simple approach
> outlined here: http://www.cs.columbia.edu/~bmbowen/papers/inpainting.pdf
>
> The entire algorithm, in pseudocode, is
>
> initialize Ω; // A mask signifying the area of the image to be inpainted
> for (iter =0; iter < num_iteration; iter++)
>
> convolve masked regions with kernel;
>
>
> Doing a little bit of research I found that Tim Holy's Images.jl package
> already has a function called imfilter that takes an image and a kernel.
>
> But I couldn't find a way to pass along mask information – I don't want to
> apply the kernel to every pixel in the image, only those within the masked
> region. Is there a way to do this using the functionality in base Julia or
> in an existing package?
>
> ~ Yuri