In order to solve the problem that the image encryption algorithm cannot eliminate the strong correlation between adjacent pixels in the image, with poor ability to resist attack and low efficiency, an Image encryption algorithm for torsional components of generators based on complex chaotic model is proposed. Extracting the RGB torsional vibration component of the image for discrete cosine transform transformation, it is then rotated and fused to complete the initial encryption of the image information. In order to further enhance the security of image information, 2-D discrete cosine transform and 2-D compressed sensing measurement are applied to the initial encrypted image information. The real number matrix of measurement is merged into the complex value matrix, and the adaptive random phase coding is applied. The image information complex chaotic encryption model is constructed according to the coding result, so as to eliminate the strong correlation between the adjacent pixels. Particle swarm optimization is used to co-ordinate and optimize the parameters of the compound chaotic encryption model to improve the encryption performance of the model. Experimental results show that the pixel has low correlation, high security and strong ability to resist attacks after encrypting with this algorithm.