From 056208c534d0799ef8fec611b4328852bf93c72e Mon Sep 17 00:00:00 2001 From: Stefan van der Walt Date: Sun, 13 Mar 2011 14:50:11 +0200 Subject: [PATCH] DOC: Update median_filter doc to numpy format. --- scikits/image/filter/_ctmf.pyx | 35 +++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/scikits/image/filter/_ctmf.pyx b/scikits/image/filter/_ctmf.pyx index 51e4b618..b58572de 100644 --- a/scikits/image/filter/_ctmf.pyx +++ b/scikits/image/filter/_ctmf.pyx @@ -752,18 +752,31 @@ def median_filter( np.ndarray[dtype=np.uint8_t, ndim=2, negative_indices=False, mode='c'] output, int radius, np.int32_t percent): - """Median filter with octagon shape and masking + """Median filter with octagon shape and masking. + + Parameters + ---------- + data : (M,N) ndarray, dtype uint8 + Input image. + mask : (M,N) array, dtype uint8 + A value of 1 indicates a significant pixel, 0 + that a pixel is masked. + output : (M,N) array, dtype uint8, optional + Array of same size as the input in which to store + the filtered image. + radius : int + Radius of the inscribed circle to the octagon. + percent : int + Sort the unmasked pixels within the octagon into and array + (conceptually) and take the value indexed by the size of that + array times `percent` divided by 100. 50 gives the median. + + Returns + ------- + output : (M,N) ndarray, dtype uint8 + A reference to `output`, if specified, otherwise + the new output array. - data - a 2d array containing the image data - mask - a 2d array of 1=significant pixel, 0=masked - similarly shaped to "data" - output - a 2d array that will hold the output of this operation - similarly shaped to "data" - radius - the radius of the inscribed circle to the octagon - percent - sort the unmasked pixels within the octagon into - an array (conceptually) and take the value indexed - by the size of that array times the percent divided by 100. - 50 gives the median """ if percent < 0: raise ValueError('Median filter percent = %d is less than zero' % \