Object Detection to Code Generation:

4 次查看(过去 30 天)
Hello,
Is Train ACF object detector compatible with code generation? I am seeing some difficulty compiling the detector to download it to a target for a real time application. Any insight would be greatly appreciated. There is a limitted info in help doc but it is only for object detection from an image, even then, the example does not deep dive :)
Thank you.
Best

回答(1 个)

Sai Pavan
Sai Pavan 2024-5-27
Hello,
I understand that you want to know whether the Aggregate Channel Features (ACF) object detector supports code generation so that it can be used for a real-time application on a target. We can train an object detector with the "trainACFObjectDetector" function and use the trained object detector returned as an object for target-specific applications.
The "acfObjectDetector" object indeed has code generation support as mentioned here: https://www.mathworks.com/help/vision/ref/acfobjectdetector.html#:~:text=C/C%2B%2B%20Code%20Generation
Here is the workflow to use the code generation ability of this function:
  • Convert the trained detector object into a structure using the "toStruct" function. Please refer to the below documentation to learn more about "toStruct" function: https://www.mathworks.com/help/vision/ref/acfobjectdetector.tostruct.html
  • Save the structure as MAT file.
  • Generate C-MEX code that you can run in the MATLAB environment using MATLAB Coder.
  • Use the generated C-MEX file to detect objects in a test image.
Please refer to the following example that demonstrates the code generation ability of "acfObjectDetector": https://www.mathworks.com/help/vision/ug/example-ObjectDetectionFromImages.html
Note: You need to have access to MATLAB Coder product to use the code generation capabilities and to generate the C-MEX files.
Hope it helps!
  1 个评论
Tewodros Mamo
Tewodros Mamo 2024-5-29
Hello Sai,
First of, thank you for your response and the links. However, my application will eventually be integrated to a third party simulink like blocks. I was wondering if a simpler representation of this structures is possible to make this a block or a function that works in simulink or make a matlab function that would then be used in simulink. i.e, A mattrix to insure platform indepenence and portability. like you would represent an adge detector using a 3x3 matrix.
Thank you.
Regards,

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Computer Vision with Simulink 的更多信息

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by