[Insight-users] Naively/smoothly interpolating a hole in a grayscale image

David Doria daviddoria at gmail.com
Tue Jul 5 21:20:31 EDT 2011


On Tue, Jul 5, 2011 at 8:00 PM, Richard Beare <richard.beare at gmail.com> wrote:
> Matlab has a function called roifill, which "smoothly interpolates
> inward from the pixel values on the boundary of the polygon by solving
> Laplace's equation". That is something that would be nice to add to
> ITK.
>
> Another alternative if the holes are small is to create a median
> filtered image and replace the holes with the filter output.

Haha I see that roifill solves the Laplace equation. I actually did that here:
http://www.insight-journal.org/browse/publication/791

I was just hoping for a simpler, more "built-in" solution.

The median filter idea is more of what I was looking for, but I would
want to mask the image so that the median never ended up being the
value of the hole. It seems like many filters could benefit from this
"only operate on masked pixels" concept - some of them have it, but it
seems like a SetMask should be added to ImageRegionIterator so that
when filters use an iterator they could optionally only stop at pixels
under the mask.

David


More information about the Insight-users mailing list