Computing a neighborhood window efficiently
Posted by
Serafino on
Jan 16, 2011; 11:36am
URL: http://imagej.273.s1.nabble.com/Computing-a-neighborhood-window-efficiently-tp3685960.html
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 bit if I simply implement the windowing as in the mean shift filter (ie by simply cycling through each each and creating a window ex nihilo).
I thought up some optimizations, but doing them in Java leads to worse results than the unoptimized one!
Here is a link to the question I posted on StackOverflow (it shows the code for the algorithm optimization).
http://stackoverflow.com/questions/4699396/java-code-optimization-on-matrix-windowing-computes-in-more-timeIs there another way to compute that? What am I doing wrong in Java ?(in C++ it is optimized)