# public documents.sextractor_doc

## [/] [detect_threshold.tex] - Rev 22

\section{Thresholding}
Thresholding is applied to the background-subtracted, filtered image
to isolate connected groups of pixels. Each group defines the
approximate position and shape of a basic {\sc SExtractor} detection
that will be processed further in the pipeline. Groups are made of
pixels whose values exceed the local threshold and which touch each
other at their sides or angles (8-connectivity'').

\subsection{Configuration parameters.}
Thresholding is mostly controlled through the {\tt DETECT\_THRESH},
{\tt DETECT\_MINAREA} and {\tt DETECT\_MAXAREA} keywords.

{\tt DETECT\_THRESH} sets the threshold value. If one single value is
given, it is interpreted as a threshold in units of the (unfiltered) background's
standard deviation. For example:
\begin{verbatim}
DETECT_THRESH 1.5
\end{verbatim}
will set the detection threshold at 1.5$\sigma$ above the local
background. It is important to note that {\em the standard deviation
quoted here is that of the un{\tt FILTER}ed image, at the pixel
scale}. Hence, on images with white Gaussian background noise for
instance, a {\tt DETECT\_THRESH} of $3.0$ will be close to optimum if
low-pass {\tt FILTER}ing is turned off, but sub-optimum (too high) if
it is on. On the contrary, if the background noise of the image is
intrinsically correlated from pixel-to-pixel, a {\tt DETECT\_THRESH}
of $3.0$ (with no {\tt FILTER}ing) will be too low and will result in a
poor reliability of the extracted catalogue.
\gam{Umm, my past image simulations convinced me that $3\,\sigma$ thresholds were
optimal on smoothed images, even if the noise is correlated in these.}

Two numbers can be given as arguments to {\tt DETECT\_THRESH}, in
which case the first one is interpreted as an absolute threshold in
units of magnitudes per square-arcsecond'', and the second as a
zero-point in the same units.
\begin{verbatim}
DETECT_THRESH 27.2,30.0
\end{verbatim}
will for example set the threshold at $10^{-0.4 (27.2-30)} = 13.18$

{\tt DETECT\_MINAREA} sets the minimum number of pixels a group should
have to trigger a detection. Obviously this parameter can be used just
like {\tt DETECT\_THRESH} to detect only bright and big'' sources,
or to increase detection reliability. It is however more tricky to
manipulate at low detection thresholds because of the complex
interplay of object topology, noise correlations (including those
induced by filtering), and sampling. In most cases it is therefore
recommended to keep {\tt DETECT\_MINAREA} at a small value, typically
1 to 5 pixels, and let {\tt DETECT\_THRESH} and the filter define {\sc
SExtractor}'s sensitivity.

{\tt DETECT\_MAXAREA}, on the other hand, sets the maximum number of pixels
a group must have in order to trigger a detection. Thus, this parameter may be
used in conjunction with {\tt DETECT\_MINAREA} in order to detect only objects
whose size is within a certain range. Note that, although large objects may
be removed from the catalogue by filtering out those with {\tt ISOAREAF\_IMAGE}
larger than some threshold, these detections would still appear in the
check-image. If it is required that large objects be not present in it,
{\tt DETECT\_MAXAREA} should be used in order to effectively exclude them from
the check-image. See fig. \ref{fig:detect_maxarea_example} for an example.

%---------------------------------- Fig. segmentmeth --------------------------------
\begin{figure}[htbp]
\centerline{\includegraphics[width=14cm]{ps/detect_maxarea_example.ps}}
\caption{Example of how the {\tt DETECT\_MAXAREA} parameter can be used in order
not to detect objects larger than a determined number of pixels.
{\em Left}: close-up of the original image.
{\em Center}: {\tt OBJECTS} check-image generated without {\tt DETECT\_MAXAREA}.
{\em Right}: the same {\tt OBJECTS} check-image, when generated with {\tt DETECT\_MAXAREA} = 100.
}
\label{fig:detect_maxarea_example}
\end{figure}