How to create Matlab Simulink Model for Object Detection?

조회 수: 3 (최근 30일)
Sorath Asnani
Sorath Asnani 2014년 9월 20일
댓글: hegel77 2020년 3월 1일
Hello everyone! I have created a Cascade Classifier for Weapon Detection. The code is working perfectly. Now I want to simulate my code and i have to create a simulink model for the Gun Detection. I have an Input image, and the detector.xml file. I want the Detected image as Output. Can anyone guide me that which block can be used for this purpose? Any help will be highly appreciated. Thanks.

채택된 답변

Birju Patel
Birju Patel 2014년 10월 1일
Hi Sorath,
You can call the vision.CascadeObjectDetector by using a MATLAB Function block in Simulink. For example:
% MATLAB Function block code
function y = fcn(u) %#codegen
coder.extrinsic('vision.CascadeObjectDetector'); % only supported in simulation
detector = vision.CascadeObjectDetector;
bboxes = step(detector, u);
y = zeros(size(u), 'like',u);
y = insertShape(u, 'rectangle', bboxes); % draw a box around detected object
Note the use of coder.extrinsic. The vision.CascadeObjectDetector is only supported in simulation modes. You won't be able to generate code for the vision.CascadeObjectDetector inside of Simulink.
Hope that helps.
  댓글 수: 6
junaed khan
junaed khan 2018년 10월 18일
i need help.i am trying to solve similer tipe of project.please help me
hegel77
hegel77 2020년 3월 1일
how do you pass or bring in the xml detector file into the matlab function?
also is there a way to generate code to deploy to android device?
thanks,

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Computer Vision with Simulink에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by