IRAF help page for package images, program fmedian

from NOAO fmedian -- quantize and median filter a set of IRAF imagesUSAGEPARAMETERSDESCRIPTIONEXAMPLESTIME REQUIREMENTSBUGSSEE ALSO

fmedian -- quantize and median filter a set of IRAF images


USAGE

fmedian input output xwindow ywindow


PARAMETERS

input

List of input images.

output

List of filtered images. The number of input images must be the same as the number of output images. If the input image name equals the output image name the filtered images replaces the original image.

xwindow, ywindow

The size of the median filter where both xwindow and ywindow are odd integers. Even values for xwindow or ywindow will be rounded up to the nearest odd integer.

hmin = -32768, hmax = 32767

The histogram quantization parameters. Hmin and hmax define the minimum and maximum permitted values for the integer representation of the IRAF image. The default values are those suitable for the 16 bit twos complement data produced by current CCDS. Hmin and hmax should be chosen so as to minimize the space required to store the image histogram.

zmin = INDEF, zmax = INDEF

The data quantization parameters. Zmin and zmax default to the minimum and maximum values in the IRAF image. Pixel values from zmin to zmax are mapped linearly to integers from hmin to hmax. If zmin = hmin and zmax = hmax the image pixels are converted directly to integers. Image values less than or greater than zmin or zmax will default to hmin and hmax respectively.

unmap = yes

Fmedian produces the median of the original image by default. If the user wishes to preserve the quantized values the unmap parameter should be set to no.

boundary = nearest

The type of boundary extension. The options are:

nearest

Use the value of the nearest pixel.

constant

Use a constant value.

reflect

Reflect pixel values around the boundary.

wrap

Wrap pixel values around the boundary.

constant = 0.

The value for constant valued boundary extension.


DESCRIPTION

FMEDIAN takes a set of IRAF images input and produces a set of filtered images output. The filter consists of a sliding rectangular xwindow by ywindow window in which the center pixel of the window is replaced by the median of the pixels in the window. The median of a sequence of numbers is defined to be that member of the sequence for which (n - 1) / 2 of the elements are equal or smaller in value and (n - 1) / 2 elements are equal or larger in value. Out of bounds pixel references are handled by setting the parameter boundary.

If zmin = hmin and zmax = hmax FMEDIAN maps the image data directly into integers. This operation will result in truncation of the pixel values if the IRAF image format is not integer. Otherwise the IRAF pixel values from zmin to zmax are linearly mapped to integer values from hmin to hmax. The histogram, median and number of pixels less than the median are calculated for the first window position. These quantities are then updated as the median filter moves one position. The unmap parameter is normally set so as to restore the pixel values to the range zmin to zmax, but may be left off is the user wishes to examine the quantized pixels. Note that the precision of the median is (zmax - zmin) / (hmax - hmin).


EXAMPLES

1. Median filter a 16 bit CCD image using a 5 by 5 window

   im> fmedian input output 5 5 hmin=-32768 hmax=32767 
   >>> zmin=-32768.  zmax=32767.

2. Median filter a KPNO PDS image using a 3 by 3 window

im> fmedian input output 3 3 hmin=0 hmax=4095 zmin=0. zmax=4095.

3. Median filter an 8 bit image using a 3 by 3 window

im> fmedian input output 3 3 hmin=0 hmax=255 zmin=0. zmax=255.

3. Median filter an image with real values from 0.0 to 1.0 with a precision of .003.

   im> fmedian input output 5 5 unmap+ hmin=0 hmax=1000 zmin=0. 
   >>> zmax=1.


TIME REQUIREMENTS

It requires approximately 160 and 215 cpu seconds to median filter a 512 by 512 square image with a 5 by 5 and 7 by 7 window respectively. (Vax 11/750 fpa).


BUGS

This technique is most suitable for integer data and data which has not been calibrated. For non-integer data the calculated median is an approximation only.

Note that the defaults for hmin and hmax correspond to the minimum and maximum value of a 16 bit twos complement integer. This can cause problems if the input image is of type short and unmap=no. The problem can be avoided if hmin and hmax are set to numbers well within the data range of a short integer.

If the dymamic range of the data defined by hmin and hmax is large the memory requirements can become very large.


SEE ALSO

median,


This page automatically generated from the iraf .hlp file. If you would like your local iraf package .hlp files converted into HTML please contact Dave Mills at NOAO.

dmills@noao.edu