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 errorErrors occurred during parsing of MATLAB function 'MATLAB Function'Component:MATLAB Function | Category:Coder errorSimulink 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 errorSimulink 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 errorError occurred in 'Swarm_Control/MATLAB Function'.Component:Simulink | Category:Model error
Best Answer