Speckle design is the key to high quality image reconstruction in compressive sensing based computational correlation imaging. Aiming at the problems of high redundancy and low quality of correlation imaging in traditional speckle pattern generation methods, we propose a speckle design method based on principal component analysis (PCA). In this method, the data in the high-dimensional space arc projected into the low-dimensional space. Combined with image prior knowledge, a set of measurement matrixes arc obtained by sample training method, which can improve the image quality at low sampling rate. The experimental results show that, compared with traditional methods, when the sampling rate is the same and lower than 0.5, this method can increase the peak signal-to-noise ratio of the image by 5 dB, and the structural similarity can be increased by 0.2. It provides a new idea for similar scenes that obtain high-quality images at low sampling ratio.