| Due to the inherent reasons of the optical lens,the image captured by the camera will have different degrees of distortion,which will bring serious errors in machine vision,industrial monitoring,feature recognition and other occasions.This errors cannot be eliminated but can only be improved due to the inherent characteristics of the optical lens.Geometric transformation is performed on each pixel position of the distorted image to restore the original spatial relationship and original gray value relationship between pixels,which is also one of the important steps in image processing.This thesis mainly focuses on the geometric correction of image distortion before image processing,designs a real-time image distortion correction system based on the improved directional polynomial interpolation algorithm,and implements it on FPGA,while improving memory consumption and system performance.It has certain application value and prospects in the fields of monitoring,computer vision,and reversing images.The content of this thesis is reflected in the following aspects:(1)Aiming at the problem that using FPGA to calculate mapping coordinate in real time is too complicated and wastes resources.Using the camera calibration method based on Matlab to obtain the camera’s geometric parameters and distortion parameters,and using these parameters to make a coordinate mapping table in advance,which is stored in the FPGA memory.Subsequent look-up tables are used to replace complex online calculations to reduce internal hardware resource consumption.(2)Aiming at the shortcomings of poor edge processing effect and blurred image details of the bilinear interpolation algorithm used in traditional image correction,the existing direction polynomial interpolation algorithm is improved to ensure the processing effect and simplify the direction polynomial interpolation algorithm.According to the direction polynomial interpolation algorithm And the advantages of bilinear interpolation are applied to the processing of image edge and non-edge respectively,which improves the effect of distortion correction..(3)In order to improve the hardware processing speed and reduce resource consumption,Propose LUT coordinate compression method.According to the principle of image scaling,the huge look-up table is compressed and stored in the FPGA on-chip ROM.When used,the complete look-up table is reconstructed online through bilinear interpolation.This method significantly reduces memory consumption.(4)In order to improve the efficiency of bilinear interpolation,an odd-even caching method is proposed,and the pixel coordinates are divided into parity and even and stored in four independent BRAM,The interpolation module can simultaneously extract the four-point pixel values required for bilinear interpolation within one clock.Through the simulation verification of each module,In this paper,the image of real-time distortion correction system can carry on the rapid and effective correction to the image,the experimental results show that the LUT compression reconstruction method has greatly reduced the consumption of storage resources,odd-even ring method compared with the traditional cache line buffering up 4 times the performance of the system,at the same time in FPGA to achieve better real-time image correction effect. |