  Matched filters (MFs) are elegant and widely used tools to detect and measure
signals that resemble a known template in noisy data. However, they can perform
poorly in the presence of contaminating sources of similar or smaller spatial
scale than the desired signal, especially if signal and contaminants are
spatially correlated. We introduce new multicomponent MF and matched
multifilter (MMF) techniques that allow for optimal reduction of the
contamination introduced by sources that can be approximated by templates. The
application of these new filters is demonstrated by applying them to microwave
and X-ray mock data of galaxy clusters with the aim of reducing contamination
by point-like sources, which are well approximated by the instrument beam.
Using microwave mock data, we show that our method allows for unbiased
photometry of clusters with a central point source but requires sufficient
spatial resolution to reach a competitive noise level after filtering. A
comparison of various MF and MMF techniques is given by applying them to Planck
multifrequency data of the Perseus galaxy cluster, whose brightest cluster
galaxy hosts a powerful radio source known as Perseus A. We also give a brief
outline how the constrained MF (CMF) introduced in this work can be used to
reduce the number of point sources misidentified as clusters in X-ray surveys
like the upcoming eROSITA all-sky survey. A python implementation of the
filters is provided by the authors of this manuscript at
\url{https://github.com/j-erler/pymf}.
