| With the continuous progress of China’s industrial manufacturing level,the types and quantities of workpieces are also increasing year by year.At the same time,the quality of workpieces is increasingly required.Surface defect of workpiece is the most important factor that affects the quality of workpiece.Surface defect detection technology has been widely concerned by researchers in this field.In the field of surface defect detection technology,machine vision detection is widely used in industrial sites due to its unique advantages of non-contact and non-destructive testing.At this stage,the machine vision detection device relies on the computer or embedded device based on ARM to work,which has the defects of high cost,low detection efficiency and poor real-time performance.Therefore,this thesis proposes an on-line image acquisition and defect detection system for workpiece surface based on FPGA(Field Programmable Gate Array).By utilizing the parallel computing characteristics and pipelining structure of the FPGA,the system achieves hardware acceleration of image acquisition and processing,and finally achieves the goal of real-time online detection.First of all,this thesis elaborates a series of digital image processing algorithms used by the defect detection system,including graying,histogram equalization,median filtering,image segmentation and morphological filtering algorithms,which lays a theoretical foundation for the subsequent FPGA logic development.Secondly,the overall design architecture of image acquisition and display system for workpiece surface is detailed in this article,which mainly includes image acquisition,caching and display module design.With the help of Inter-Integrated Circuit(IIC)protocol,image acquisition achieves the register configuration of OV5640 camera.With the help of design acquisition module,the 8 bit image data output by the camera is converted to 24 bit RGB 888 data format.Image caching is the process of configuring AXI Video Direct Memory Access(VDMA)with an ARM processor to provide high-speed,high-bandwidth direct memory access between DDR3 and AXI4-Stream peripherals via VDMA.In the image display module,with the help of Video Timing Controller(VTC)IP,the corresponding RGB_The timing information of the LCD screen is obtained.Video streaming data is generated via AXI4-Stream to Video Out IP.In this thesis,the hardware design ideas and development process of each algorithm are described in detail,and the logic function of the hardware module is verified by Vivado simulation software,using Verilog HDL language to implement various algorithms in image preprocessing,each algorithm is laid out and wired into FPGA logical resources.To improve the real-time detection,an improved multi-objective defect detection algorithm is proposed in this thesis based on FPGA,in order to accurately obtain the boundary coordinates of multi-objective defects and achieve synchronous annotation of multi-objective defects.Finally,each module was integrated in pipeline architecture in this article and ported to the image acquisition and display system.Taking copper clad plate as an example,the image acquisition and display,image preprocessing,and defect detection functions were tested using the ZYNQ platform.The results show that the system achieves stable video display at a resolution of and a frame rate of 60 fps,and has good detection performance for copper clad plates with multiple surface defects;The image signal processed by the algorithm only has a delay of about 0.6246 us compared with the original image signal;The time required to collect or process a frame of pixel data is only 5.3ms;The single burst transmission time for direct memory access between FPGA peripherals and DDR3 is 0.64ms,and the transmission data size reaches 512bytes;The total power consumption of the system is 1.944 W with Timing closure,and the hardware resources have more margin.In summary,this system meets the requirements of real-time,high-precision,and low power consumption for defect detection on the surface of workpiece,and has high application value. |