By the way, Cliff Reiter's median in J isn't slow at all, for example compared 
to famous software like ImageMagick:

$ time convert -median 3x3 p19.pgm m3.pgm 

real    0m11.961s
user    0m22.333s
sys     0m0.292s
$
$ time convert -median 13x13 p19.pgm m13.pgm

real    1m13.204s
user    2m22.517s
sys     0m0.352s

Good old xv uses 10s resp. 5 minutes.

Ben 

________________________________________
From: [email protected] [[email protected]] on 
behalf of Ben Gorte - CITG [[email protected]]
Sent: Wednesday, April 24, 2013 15:47
To: [email protected]
Subject: Re: [Jchat] J for Image Processing

   6!:2 'med3 =: 3 medianf p19'
17.9526
   6!:2 'med13 =: 13 medianf p19'
47.2474
   $p19
3072 4608

(A median 3x3 median filter on a 3072x4608 image takes 18s, and a 13x13 median 
takes 47s).

This is on an Intel Core 2 Duo CPU at 2.00GHz , using the median function from 
the already-mentioned book of Cliff Reiter "Fractals, Visualization and J":

   medianf =: 1 : '(2#m) "_ (<.-:*:m)&{@:(/:~)@,;._3 ]'

I have a C program doing the same in 0.7s resp. 1.2s, but when I consider how 
much time it took me to write that one, I must compute an awful lot of medians 
with it before earning back that time.

Ben
________________________________________
From: [email protected] [[email protected]] on 
behalf of Sarah Arnold [[email protected]]
Sent: Wednesday, April 24, 2013 15:02
To: [email protected]
Subject: Re: [Jchat] J for Image Processing

Hi
I should have been a bit more precise: I'm into astronomy. I'm mostly
interested in noise reduction / signal enhancement and therefore apply
different filters to the image. Some of this operations, like for
example the MedianFilter[] function, take a lot of computation time.

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to