| Oil and natural gas,as dangerous chemicals under national supervision,have extremely high requirements for safety during pipeline transportation.Due to the hidden danger of pipeline welds,it is of great significance to study the safety of weld defects in in-service pipelines.Aiming at the shortcomings of low performance and poor real-time performance of traditional image acquisition card in ray real-time imaging system,and the demand for flaw detection of in-service pipelines,this paper designs an embedded system for pipeline weld defect detection based on FPGA + ARM.Firstly,the FPGA with parallel computing and pipeline characteristics is used to collect and process the weld image.The initialization of OV7670 is completed by SCCB protocol,and the video data stream is output by DVP interface.In the SDRAM memory module,the data cache across clock domain is realized by asynchronous FIFO and SDRAM controller.A fast median filter based on pipeline architecture and Sobel edge detection algorithm are used to realize image processing.After caching the processed image data to SDRAM,the VGA interface is used to output the video image with gray threshold segmentation in real time.According to the top-up modular design idea,and through the Modelsim platform to verify the effectiveness of the design,the design of the real-time image subsystem is realized.Secondly,the flexibility and scalability of ARM-Linux software in embedded platform are used to manage system resources and system function expansion.After transplanting Linux in ARM,the separation of user space and kernel space is completed.In the user space,considering the scalability of the application architecture,a multi-threaded application framework for transmitting information in the form of ’ mail ’ is designed by using the data structure of linked list and queue and the thread mutual exclusion mechanism,which improves the manageability of threads and reduces the consumption of resources.In the kernel space,based on the Linux device tree mechanism and the character device driver framework,the kernel and hardware resources are decoupled and the functional modules are extended.In order to realize the interactive control of the system,the Qt signal and slot mechanism is used to realize the motion control and information interaction of the upper computer to ARM,and the control of the realtime image subsystem is realized through the communication between ARM and FPGA.Finally,the system is tested and verified.The effectiveness and rapidity of the image preprocessing algorithm are verified by comparative analysis.The real-time image subsystem is tested to be able to effectively detect weld image defects.Qt host computer and ARM information interaction and data storage test is normal.It is verified that the system design meets the basic requirements. |