MATLAB coder:It's time to improve the efficiency and universality of cv(computer vision) toolbox code generation

5 views (last 30 days)
The Matlab Coder Toolbox™ is a very useful toolkit, but its code generation is often unsatisfactory and some users use it to generate C/C++ code that is as efficient as possible, generic and not dependent on specific optimisation shared libraries/hardware etc. In my use, the CV toolbox has the following 3 generation methods:
  • Generated according to conventional program logic(e.g. quadrature, control logic if, for, while, etc.)
  • Generated according to the dependency on a specific C/C open source library package call interface (e.g. detectORBFeatures relies on OpenCV, etc.)
  • Generated by dependence on specific shared libraries optimised for different x86 platforms (e.g. imwarp, bwpack functions, etc.)
The first of these generates C/C++ execution efficiency that is closely related to the logic of your own MATLAB code implementation, advantage: the popularity is also very broad, supporting almost any hardware.
The second method generates C/C++ execution efficiency that is closely related to the open source library that you rely on, and the hardware deployment is compatible with that library, with the advantage that it is not easy to implement complex logic by hand.
The third approach generates C/C++ execution efficiency that is dependent on a library for a specific target platform, and performance needs to be considered in terms of hardware deployment. For example, the imwarp function, if generated for an embedded platform, generates c/c++ code directly rather than sharing an optimised library, but its execution is not as efficient as the second approach.
To summarise: in the case of CV toolbox considerations, OpenCV is recognised as having better performance, ease of deployment and popularity, MATLAB's image processing toolbox and computer vision toolbox need to take full advantage of OpenCV to directly call its interface to unify the generation of C/C++ code.
Related material

Answers (0)

Products


Release

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!