| With the development of industrialization in China,the demand for water resources is also growing continuously.However,water supply pipelines,as an important way of water resources transportation,have serious leakage phenomenon.In order to manage the problem of water waste,many strategies and methods have been proposed at home and abroad to detect water leakage in water supply pipes.However,the more mature foreign leak detection methods and leak detection instruments have limitations in China due to the high price and other reasons.The current detection methods in China are not automated enough and have low detection accuracy.To address the above problems,this thesis investigates a method of pipeline image leak detection based on FPGA.The method involves placing an underwater robot to swim inside a large diameter pipeline,while using a video module to capture images of the interior of the pipeline and automatically identify the leaks.For this purpose,the following work was done in the thesis.Firstly,based on the above detection method,the model of underwater robot Blue ROV used to swim inside the pipe was determined.a camera for capturing images of the pipe and an FPGA development board for the main control were also determined.Secondly,an image-based recognition model for detecting water leakage is built on the pc side.The recognition model includes image enhancement algorithm and neural network algorithm.Firstly,we analyze the characteristics of the water leakage image and its causes,and choose two image enhancement algorithms(median filter and histogram equalization)to do comparison experiments for the characteristics of uneven illumination and overall darkness of the image.It is found that the histogram equalization algorithm can not only enhance the contrast between the water leakage point and the pipe wall,but also improve the correct rate of detecting water leakage by 2.3%.Then the comparison experiments are performed on the images after histogram equalization using Res Net networks of different depths.Through the analysis,the single-channel Res Net18 network with the least FPGA resource consumption and higher accuracy of 95.5% is selected.Finally,the overall system of FPGA that can carry the recognition model is designed.It includes an image acquisition module,an image enhancement module,a ddr cache module,a Res Net18 neural network module and an image display module.Among them,the algorithm steps are adjusted to fit FPGA implementation for the histogram equalization algorithm,and the statistical approach in the algorithm steps is proposed to be improved.And for the identified Res Net18 network model to quantify the weights,and according to its network structure on top of the FPGA development board for circuit mapping and optimization,where the FPGA design for the existing Max Pool module is improved to reduce the ram resources by 2/3.FPGA system design is completed,the accuracy loss of the whole system relative to the pc-side recognition model is calculated to be 0.82%.Using this FPGA system to test the pipe images in the test set,the leak detection accuracy is 94.71% and the system frame rate is 49 fps,which can realize real-time pipe leak detection and achieve the expected design goal. |