Login  Register

Re: Computing a neighborhood window efficiently

Posted by Gabriel Landini on Jan 16, 2011; 12:48pm
URL: http://imagej.273.s1.nabble.com/Computing-a-neighborhood-window-efficiently-tp3685960p3685968.html

On Sunday 16 Jan 2011, Serafino <[hidden email]> wrote:
> I'm trying to implement a version of the Spatial Fuzzy C-Means as a plugin
> for image segmentation. I need to calculate a spatial function over a
> neighborhood window for each pixel of an image and this step slows thing
> down a

In stackoverfow you posted:

> I have a matrix which represents an image and I need to cycle over each
> pixel  and for each one of those I have to compute the sum of all its
> neighbors, ie  the pixels that belong to a window of radius rad centered on
> the pixel.

If it is the "sum" you want, I would take a look at the implementation of the
built-in mean filter. Just do not divide by the number of pixels and you've
got the sum computed.

Cheers

Gabriel