We present a new detection algorithm based on the wavelet transform for the
analysis of high-energy astronomical images. The wavelet transform, becaus
e of its multiscale structure, is suited to the optimal detection of pointl
ike as well as extended sources,regardless of any loss of resolution with t
he off-axis angle. Sources are detected as significant enhancements in the
wavelet space, after the subtraction of the nonflat components of the backg
round. Detection thresholds are computed through Monte Carlo simulations in
order to establish the expected number of spurious sources per held. The s
ource characterization is performed through a multisource fitting in the wa
velet space. The procedure is designed to correctly deal with very crowded
fields, allowing for the simultaneous characterization of nearby sources. T
o obtain a fast and reliable estimate of the source parameters and related
errors, we apply a novel decimation technique that, taking into account the
correlation properties of the wavelet transform, extracts a subset of almo
st independent coefficients. We test the performance of this algorithm on s
ynthetic fields, analyzing with particular care the characterization of sou
rces in poor background situations, where the assumption of Gaussian statis
tics does not hold. In these cases, for which standard wavelet algorithms g
enerally provide underestimated errors, we infer errors through a procedure
that relies on robust basic statistics. Our algorithm is well suited to th
e analysis of images taken with the new generation of X-ray instruments equ
ipped with CCD technology, which will produce images with very low backgrou
nd and/or high source density.