Font Size: a A A

OpenCV Transplantation And Optimization Based On FT-M7002

Posted on:2020-06-29Degree:MasterType:Thesis
Country:ChinaCandidate:G H SunFull Text:PDF
GTID:2428330602452301Subject:Engineering
Abstract/Summary:PDF Full Text Request
Open CV(Open Source Computer Vision Library)is a cross-platform computer vision library that can be used in image processing and computer vision.It contains many general algorithms for visual processing and image processing,precisely because of its rich underlying structure.Support for the diversity and utility of its features,so Open CV has become one of the most powerful open source tools in the field of computer vision.Digital signal processors(DSPs)are now widely used in important fields such as communications,computers,networks,industrial control,military equipment,etc.,and play an indispensable role.The FT-M7002(hereafter referred to as the M7002)is a completely autonomous high-performance DSP.The development of an image processing platform based on the M7002 DSP can greatly promote the application of the DSP in the field of image processing and artificial intelligence.However,there is currently little research on crosscompilation porting for the DSP platform and porting optimization for the Open CV library.Therefore,this paper explores a general method of porting Open CV to the DSP platform through cross-compilation of Linux operating system,and summarizes the general method of optimizing Open CV,which can reduce the development threshold of implementing general DSP image processing platform,and then Improve the development efficiency of the M7002 DSP.The main work of this paper includes the following aspects:1.Complete the transplantation and optimization of about 80,0000 lines of source code on the underlying Open CV 2.4.9(hereinafter referred to as Open CV)on the M7002.This paper aims to realize the FT-M7000 IDE toolchain can support C++ language and complete the Open CV source code porting on the M7002 platform.It deeply analyzes the difference between the underlying support of Open CV and the underlying support of the M7002 platform,and then combines the principle of cross-compilation.In the Linux system,the tool chain on the M7002 platform is generated by cross-compilation,and then the various libraries that Open CV depends on are cross-compiled,and then the toolchain script file of the corresponding platform is rewritten.This file assists Cmake to compile the Open CV source code to generate the corresponding The file is built,and the Open CV library is cross-compiled.In the process,the Open CV library is complemented and tailored for the difference between the platform and the underlying library.Finally,the general method of porting Open CV to the M7002 platform is summarized and implemented.This approach fills the gap in the technology of porting Open CV to the DSP platform through cross-compilation.Subsequently,the correctness of the porting Open CV library was fully tested,and then the Open CV library was optimized by using the general optimization method of opening the cache and the compiler optimization option to realize the running speed of Open CV on the M7002.2.How to make full use of the computing performance of the M7002.In this paper,by analyzing how the underlying function of Open CV function realizes the algorithm characteristics of the corresponding image processing function and the characteristics of M7002 architecture,the optimization idea of the function of Open CV is proposed to realize the optimization of Open CV operation speed.The optimization idea is mainly to add a timing function at the bottom of the function function,to find a number of algorithm functions with higher running time,and then to carry out vector migration and optimization of this part of the algorithm.This paper first transplants the algorithm function of Open CV pixel operation class,and summarizes the general method of vectorization transplantation and optimization for pixel operation,which achieves a running speed of up to 13.7 times under the premise of ensuring correct calculation.Then it analyzes the function of the underlying layer to operate the pixel to realize the image processing function through complex mathematical operations,and analyzes the implementation principle of the underlying algorithm of the function,determines the loop code segment that can be vectorized,and then transforms it by the general method summarized above.It was found that the results after the transformation were also correct.3.The characteristics of the vector C code after transplantation are analyzed,and the vector C code after the transplantation is optimized.Firstly,the commonly used C code optimization method---loop expansion is used to optimize the vector C after transplantation,and the performance is only improved by about 30% after optimization.Finally,according to the specific behavior realized by the vector C code after the transplantation,the vector C code is optimized by the double buffer optimization method.The optimized running performance is about 50% higher than the vector C code after the transplantation.
Keywords/Search Tags:FT-M7002, OpenCV, Linux, Cross-compilation, Vectorization, Loop unrolling, Double buffer
PDF Full Text Request
Related items