In order to explore the influence of piano music immersive virtual reality cooperation, a method of VR image recognition based on mapping equation is proposed. Firstly, through the feature extraction of the image, the main color of the target image is obtained, and the extracted results are smoothed. Through the two steps of color space conversion and tone reverse mapping, the morphological transformation of the image is realized to obtain the transition image. The K-means clustering matching operation is performed on the transition image, and the optimal energy equation of color migration is obtained by hierarchical migration and global migration. The reverse mapping color migration algorithm is put into the virtual reality technology. A virtual piano is developed with HTC Vive suite and Leap Motion sensor fixed on the helmet as the hardware platform, and Unity3D and related Stream VR plug-ins and Leap Motion plug-ins as the software platform. The virtual piano forms a virtual keyboard with a cube component. By compiling the script response function of the cube component being approached and pressed or released, the performance events of the virtual piano keyboard are recorded, and the sound of the virtual piano is further realized with the help of MIDI. The experimental results show that 400 groups of data are collected for the four gesture movements, of which 300 groups are used for training modeling and 100 groups for recognition. The gesture recognition results based on HMM are shown in figure 3, and the visible recognition rate can reach more than 88%. It is proved that the immersion of 3D virtual piano is much higher than that of 2D virtual piano displayed on ordinary computer screen; Moreover, it can be played naturally with both hands, and the sense of comfort and fluency is much stronger than the 2D virtual piano played with the help of mouse and keyboard.