Newsgroups: comp.parallel
From: Zahid.Hussain@brunel.ac.uk (Zahid Hussain)
Subject: Re: Parallel Methods for Median Filtering
Organization: Brunel University, Uxbridge, UK
Date: Wed, 8 Feb 1995 14:09:48 GMT
Message-ID: <3ha2rm$em3@molnir.brunel.ac.uk>

<dbader@Glue.umd.edu (David Bader)> wrote
>
[stuff deleted]
>
>Why not try this:
> 
>Input:  X[n,m] is the original matrix 
>Output: Y[n,m] is the median-filtering of X.
>(Suppose X[i,j] is the <i,j> element of X)
>Data Layout: W.L.O.G. suppose sqrt(p) divides n and m.
>             Assign a tile of elements of size n/sqrt(p) x m/sqrt(p)
>  	     to each processor i, for i in [0,p-1].
>For all pixels <i,j> in parallel do
>   Y[i,j] = X[i,j] + X[i-1,j] + X[i+1,j];
>   barrier();
>   Y[i,j] = Y[i,j] + X[i,j-1] + X[i,j+1];
>   barrier();
>   Y[i,j] = Y[i,j] / 9.0;
>Endfor
>
[stuff deleted]
-david
[signature deleted]
However, this algorithm does not perform a medium filter. For a median
filter you need to carry out a sort and find the median value in the
neighbourhood. Athough for a bit-serial SIMD array processors you
can use a divide-and-conquor technique (see Hussain, "Digital Image
Processing, practical applications of parallel processing techniques, 
Ellis Horwood, 1991, ISBN 0-13-213281-8pbk). What is presented above
is an average of the neighbourhood filter. For an SIMD implementation 
of a Gaussian filter do

Image := Add(Image, ShiftLeft(Image,1));
Image := Add(Image, ShiftRight(Image,1));
Image := Add(Image, ShiftDown(Image,1));
Image := Add(Image, ShiftUp(Image,1)) / 16;

Regards,
	Zahid

-- 
Dr Zahid Hussain		URL: http://http2.brunel.ac.uk:8080/~eesrzzh2
Brunel University		E-mail: Zahid.Hussain@brunel.ac.uk
Uxbridge, Middlesex UB8 3PH	Tel: +44 (0)895 274000 x2227
England, UK			Fax: +44 (0)895 258728

