Return to Post-BCD pages
 
Manual Contents
 
Getting Started
 
Input Files
 
Background Matching (overlap.pl)
 
Mosaicking (mosaic.pl)
 
Point Source Extraction (apex*.pl)
 
Basic Concepts
 
Appendix 1: Full List of MOPEX Scripts
 
Appendix 2: Fatal Bit Patterns
 
Appendix 3: Full Lit of MOPEX Modules

Basic Concepts: Image Segmentation

Overview

The Detect (Outlier) module performs image segmentation and computes the centroids for the detected pixel clusters. These clusters may be real astronomical sources or they may be spurious. The module is called at the beginning of both the outlier rejection and point source extraction processes.

The program starts by computing the initial threshold based the user specified detection threshold (Detection_Threshold). Upon the first pass the program finds all the pixels above the initial threshold. It creates a list of all contiguous clusters of pixels above the initial threshold. Then it compares the number of pixels with the minimum and maximum allowed sizes of a cluster specified by the user (Detection Max Area and Min Area). If the number of pixels in a particular cluster is less than the minimum number, the cluster is discarded. If the number of pixels in a cluster is greater than the maximum number, the program goes through an iterative process of raising the threshold with the intention of either shrinking the cluster and/or splitting it into smaller clusters.


Figure 1: Raising the threshold splits a big cluster into two smaller clusters.


To this end, the program recalculates the threshold for this particular cluster and finds all the pixels above the new threshold. See Figure 1 for an illustration of this process. When the iterative procedure is finished, a list of estimated detection locations is created. The centroid is found for each cluster, which is the estimated location of the point source corresponding to this cluster.


Thresholding

The calculation of the initial value of the threshold depends on the type of image being processed. It is specified by the user by setting input parameter Input_Type. It has two settings: "image_input" (default) and "snr_input". The first setting corresponds to a regular image, the second one is used for the signal-to-noise ratio images. For "image_input" the initial threshold T is computed as follows:

T = M+Ds

where, D is the detection threshold (number of sigma), M is the mean signal in the image, and s is the standard deviation of the image. The process is repeated iteratively, with M and s recomputed excluding pixels greater than T, until all pixels used are below T.

For "snr_input", the intital threhold is simply set equal to the D parameter.

Initial image segmentation is performed. The clusters exceeding Detection_Max_Area size are subject to further segmentation. At this point the threshold is recalculated, so that the new higher threshold will either shrink the "oversized" clusters or break them into several smaller ones. This new threshold is calculated individually for each cluster.

THRESHOLD_TYPE:: The way the image segmentation threshold is recalculated is determined by the input parameter Threshold_Type, which has three settings: "simple","combo", and "peak". The threshold type does not depend on the type of input image.

  • Threshold_Type ="simple". The mean value Mcl and standard deviation scl of all pixels in the cluster are calculated. The cluster specific threshold is

    Tcl = Mcl+Dscl

    The new threshold is applied to the cluster. If the cluster is shrunk or split, the threshold is recalculated again for each new cluster. If the number of pixels after applying a new threshold doesn t change, the cluster is passed down for centroid computation, even though the number of pixels in it is greater than Detection_Max_Area.

    There are two problems with this simple -minded approach. First, once Tcl fails to reduce the cluster, this is the end of the segmentation process. Second, this approach will very often fail to resolve two or more point sources that end up in one cluster after the initial thresholding. If one of the point sources is significantly brighter than the others it will drive Tcl to be higher than the pixels in the fainter point sources. The two schemes below were designed to alleviate these problems.

  • Threshold_Type ="combo". The following heuristic formula is used

    Here Tmin is the difference between the initial threshold T and the minimum of the whole image. SegLevel is the number of times the threshold for this cluster has been raised without any effect on the cluster. Here is how it works: Initially, for each cluster it is set to 1. Then a new threshold is calculated. If all the pixels in the cluster are higher than the threshold, then the threshold is raised and SegLevel is incremented. This is repeated until some of the pixels in the cluster end up below the threshold. At this point SegLevel is reset to 1. This approach works better then the first one, since the threshold is raised slower and segmentation doesn't stop after the first failure.

  • Threshold_Type ="peak". This is the most convoluted and is also the most effective one. It is the scheme that has been found to do the best for point source extraction. The condition, that a cluster is split when it is greater than Detection_Max_Area, is supplemented with one more condition:

      A cluster is split as long as there is more then one "peak pixel" per cluster or it is greater than Detection_Max_Area.

    A peak pixel is any pixel greater than any other pixel within a certain radius. In command-line MOPEX, the namelist parameter Peaks_Radius is used to specify this radius. The GUI uses the default radius of 1, i.e. a pixel greater than the 8 adjacent pixels is declared a peak. (Also, if Peaks_Image_Filename is set in the namelist an image of peak pixels will be written out). For each cluster the value Pmin of the lowest peak is found. Segmentation threshold Tcl is first is set to

    Tcl = Pmin-Tmin

    If the cluster doesn't change (split or shrink), then the threshold is slowly raised:


This is repeated up to Max_Segmentation_Level times. The value of Max_Segmentation_Level is selectable in command-line MOPEX, but is left to the default (50) in the GUI. After that the centroid is found for the resulting cluster, even though it might have more then one peak in it. There is one provision to prevent the program from splitting wings off of a bright star. If a cluster fails to be split, normally the threshold will be raised, but if the number of pixels in the cluster is greater than Extended_Object_Area, then this cluster is left the way it is, even though it might have more than one peak in it.


Coadded Images

There is one issue with processing coadded images. Due to the variable coverage the noise level, being inversely proportional to the square root of the coverage, varies throughout such an image . One way to deal with this problem is to use Gaussnoise module to produce an SNR image. Gaussnoise produces a local estimate of the noise and therefore the effects of the variable coverage will be reflected in the SNR image. There are two problems with this approach. First, it is time consuming. Second, the process of raising threshold to split/shrink clusters has been designed with the Input_Type="image_input" in mind. It is not clear how it will work for "snr_input" images. The alternative is to use a coverage map (CoverageMap_Filename). The coverage map is used to attenuate coadded images , i.e. an input coadded image is multiplied by the sqrt(coverage map), if a coverage map is provided.


Probability Images

The parameter Probability_Threshold in APEX settings is used for the so-called PSP images produced by the Point Source Probability module. The PSP images are products of non-linear filtering of regular images. They have the maximum value of 1. They very often have a cluster of pixels with the values saturated very close to 1. If the probability threshold is set, then pixels greater than the probability threshold are excluded from calculation of the initial threshold. Without using it there is a possibility of having the initial threshold greater then 1, which will lead to having no detections.


Passive deblending

The output of this program is used for point source extraction. Point source extraction performs passive deblending. The detected point sources, determined to be in a close proximity from one another so that their PRF's overlap, are fitted simultaneously. The Detect module provides the classification of detections as candidates for passive deblending. If a cluster created by the initial thresholding is consequently split into several clusters, the latter are classified as a blend of clusters. There are two columns in the output table that are used for detection blend classification:

  • Blendid keeps track of the sequential number of a detection blend in the table.
  • Blendsize gives the number of detections in the blend.

The columns have the same values for each detection in a particular blend. For non-blend detections, these columns are set to zero. Figure 2 shows an example of image segmentation after the recursive thresholding is performed.


Figure 2: An example of image segmentation with Detection_Min_Area=3; Detection_Max_Area=9. A blend of detection with BlendSize=2 is shown


Centroid

For all detected clusters the centroid is found:

The value of the greatest pixel in the cluster is saved as the "flux" in the output table. This quantity can be used only as a guide to the flux of a point source; the Detect module is not meant to compute photometry; the modules Source Estimate or Aperture should be used for that purpose.





SPITZER HOME || SPITZER SCIENCE || INSTRUMENTS || SCIENCE USER SUPPORT || SEARCH

help@spitzer.caltech.edu

This file was last modified on Tue Jun 10 17:37:42 PDT 2008.

California Institute of Technology Jet Propulsion Laboratory NASA