The problem considered in this paper is the detection of targets in a multispectral image. One of the difficulties encountered in this problem is the fact that the abundances of the observed signals are unknown. The generalized likelihood ratio test (GLRT) is often used in detection problems such as this one. The GLRT replaces the unknown parameters, in this case the signal abundances, with maximum likelihood estimates (MLEs) of those parameters. In general, the GLRT is not an optimal test. It is argued that for the signal model in this paper, constrained least squares (CLS) estimates of the unknown parameters are more appropriate than MLEs. A hypothesis test called the constrained multirank signal detector (CMSD) is derived using CLS estimates of the signal abundances. The performance of this test is calculated and is compared to the performance of the GLRT derived for the same signal model.