In order to enhance the retention of angle information in complex flow fields and reduce edge step distortion and blur effects caused by the reconstruction process, this paper proposes an optical flow pyramid interpolation optimization method for particle image velocity measurement based on the multi-scale pyramid iterative optical flow algorithm and nearest neighbor interpolation. By calculating the distance between each site and grid points, the grid point with the smallest distance is identified and its value is assigned to the site. In addition, the nearest pixels with similar gradient directions are searched in the current image plane for corner correspondence. This approach preserves original edges while reducing step distortion and blurring effects commonly encountered in optical flow algorithms. As a result, it helps minimizing reconstruction angle error and root mean square error, particularly at image edges. The proposed algorithm was tested for its reconstruction effect in different flow fields through simulation experiments, including single vortex current, double vortex current, and DNS turbulence, under various parameters. Both the proposed algorithm and common algorithms were employed to simulate these flow fields, and the reconstructed results were compared with the true values. The accuracy of the algorithm was quantitatively evaluated using root-mean-square error and average angle error. The results demonstrate that the proposed algorithm achieves closer reconstruction results to the true values across all three flow fields. Specifically, compared to pre-optimization, the root- mean- square error and average angle error were increased by 15.96% and 19.87% respectively in the single vortex current field, by 15.03% and 19.56% in the pair vortex current field, and by 14.90% and 17.37% in the DNS turbulent field. Notably, at image edges, the proposed algorithm exhibits smaller reconstruction errors which validate its correctness while also indicating its ability to effectively retain angle information thereby reducing reconstruction errors. The accuracy of PIV reconstruction is influenced by two important parameters, namely particle size and displacement. To investigate the impact of particle size and particle displacement on the reconstruction effect of PIV in the flow field, a total of 50, 000 imaging particles were randomly distributed in a two-dimensional imaging plane measuring 256 pxx256 px. The previous-used three flow fields, including single vortex current, double vortex current, and DNS turbulence, were subjected to 400 iterations of optical flow using both the proposed algorithm and the conventional optical flow algorithm. This analysis aimed to assess how particle size and displacement affect the root mean square error (RMSE) and average angular error (AAE) of the reconstructed results. The findings demonstrate that under different conditions of particle size and displacement, the proposed algorithm outperforms the conventional optical flow algorithm in terms of fitting accuracy as well as precision during optical flow iteration. Specifically, when keeping particle size constant, small displacements can increase RMSE accuracy by approximately 18%, while large displacements can enhance it by about 15%. Moreover, when maintaining a constant displacement size within a range of 1 px similar to 7 px for particle sizes, both RMSE and AAE values obtained from the proposed algorithm surpass those achieved with common optical flow algorithms. To verify the performance of the algorithm in practice, an experimental system based on two-dimensional PIV principle is built. The 100 micron PSP particles were used as tracer particles, and a certain amount of tracer particles was added to the quartz container containing dimethylsilicone oil as the flow field to be measured. An electric slide table is used to rotate and inject water into the flow field to simulate the vortex current field and jet field respectively. The images of the flow field to be measured captured by the CMOS camera are put into the PIV system for analysis and reconstruction. The reconstruction results show that the optimized algorithm in this paper can obtain a velocity field consistent with the manifold of common algorithms, which verifies the correctness of the proposed algorithm. It also shows that the proposed algorithm has good practicability in the actual complex flow field.