mkmask: Create the initial master object mask

Package: xdimsum

Usage

mkmask input expmap output nthreshold

Parameters

input
The input image name. The input image is assumed but not required to be a mosaic of several input images.
expmap
The input exposure map image which defines the total expsoure per pixel. Expmap is used normalize the input image to uniform pixel-to-pixel noise. If the exposure map is undefined then a uniform exposure level for all the pixels is assumed.
output
The name of the output object mask.
nthreshold
If interactive = no then the object detection threshold used to create the object mask equals nthreshold times the internally computed recommended threshold.
negthresh = no
Use negative as well as positive masking thresholds ?
statsec = ""
The input image section used to compute the recommended object detection threshold.
nsigrej = 3.0
The bad pixel rejection criterion used to compute the recommended object detection threshold.
maxiter = 20
The maximum number of bad pixel rejection iterations used to compute the recommended object detection threshold.
subsample = 1
The block averaging factor applied to the normalized input image before median filtering.
filtsize = 15
The size of the median filter. The effective size of the median filter is subsample * filtsize.
nsmooth = 3
The size of the boxcar smoothing filter applied to the median filtered image.
ngrow = 0
The half_width of the region growing box.
interactive = yes
Set the value of the object detection threshold interactively ?
threshold
The value of threshold if interactive is yes.

Description

MKMASK creates an object mask called output for the input image input using an optional exposure map expmap and an object detection threshold set by the user if interactive is yes or equal to nthreshold times an internally computed recommeded number if interactive is no.

MKMASK normalizes the input image to a uniform pixel-to-pixel rms by multiplying by a factor of sqrt (expmap / maxexpmap) where maxexpmap is the maximum exposure level in the exposure map.

The standard deviation of the normalized input image pixels is computed using pixels in statsec and iterative rejection with rejection parameters of nsigrej and maxiter. Pixels with 0's in the exposure map are excluded from the image statistics computation. If the exposure map is undefined then a uniform exposure level is assumed.

If interactive = yes the user is prompted for the detection threshold threshold. If interactive = no the detection threshold is set to nthreshold * the recommended threshold where the recommended threshold is defined to be

recthreshold = 4.5 * sigma / nsmooth

Sigma is the standard deviation of the sky pixels. If negthresh is set to "yes" then both negative and positive masking threshold are used.

Before median filtering the normalized input image is block-averaged by a factor of subsample. The size of the median filter filtsize refers to the block-averaged image. Therefore the effective size of the median filter is actually subsample * filtsize. After median filtering but before thresholding the image block-replicated to its original size and is smoothed using a boxcar filter of size nsmooth.

The filtered and smoothed image pixels greater than or equal to the detection threshold are set to 1 in the output object mask. The remaining pixels are set to 0. If ngrow > 0 pixels within a box of half-width ngrow pixels are assumed to be object pixels.

The actual mask creation is done by the MAKEMASK task. More information on MAKEMASK can be found in the task help page.

If interactive is yes then the final object mask is displayed on the image display.

Examples

1. Create the object mask for the combined image created with xnregistar.

cl> mkmask mosaic mosaic.exp mosaic.pl 1.1 statsec="" nsigrej=5.0 \
    maxiter=10 nsmooth=3 subsample=2 filtsize=15 ngrow=0 interactive-

Time requirements

Bugs

See also

makemask, blkavg, fmedian, boxcar