For traditional orthogonal subspace projection method, before performing hyperspectral image target detection, we must acquire the background spectrum vectors. However, in many cases, we cannot obtain the prior knowledge of the background spectrum accurately. And constrained energy minimization algorithm detect targets without a priori information of background spectrum, but the algorithm has a poor performance on the big target detection and cannot effectively extract the target contour. For this reason, we propose a sample weighted orthogonal subspace projection algorithm by defining the weighted autocorrelation matrix to estimation background, and then use the orthogonal subspace projection method to detect the targets. The algorithm effectively reduces the proportion of target pixels in the sample autocorrelation matrix, and has better inhibitory effect to the background. It overcomes the inherent defects of orthogonal subspace projection and constrained energy minimization, the experimental results shows better detection effect.