Using vision.CascadeObjectDetector on Simulink
Show older comments
Hello, I read the previous answers about the same problem but I am still not able to solve my problem. What i want is to detect water bottles and get their centroids. Here is my code,
function centroids = fcn(img)
coder.extrinsic('vision.CascadeObjectDetector');
detector = vision.CascadeObjectDetector('...\Bottle.xml');
bboxes = step(detector,img);
centroids = [bboxes(:,1)+(bboxes(:,3)/2),bboxes(:,2)+(bboxes(:,4)/2)];
And the errors are,
Unexpected MATLAB operator.
Function 'MATLAB Function' (#88.264.265), line 5, column 21:
":"
Launch diagnostic report.
Component:MATLAB Function | Category:Coder error
Errors occurred during parsing of MATLAB function 'MATLAB Function'
Component:MATLAB Function | Category:Coder error
Simulink cannot determine sizes and/or types of the outputs for block 'MATLAB Function' due to errors in the block body, or limitations of the underlying analysis. The errors might be inaccurate. Fix the indicated errors, or explicitly specify sizes and/or types for all block outputs.
Component:MATLAB Function | Category:Coder error
Simulink cannot determine sizes and/or types of the outputs for block 'MATLAB Function' due to errors in the block body, or limitations of the underlying analysis. The errors might be inaccurate. Fix the indicated errors, or explicitly specify sizes and/or types for all block outputs.
Component:Simulink | Category:Model error
Error occurred in 'Swarm_Control/MATLAB Function'.
Component:Simulink | Category:Model error
Accepted Answer
More Answers (0)
Categories
Find more on Computer Vision with Simulink in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



