Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

Image Processing SIMULINK Array error

1 Ansicht (letzte 30 Tage)
Jayden  Hasemann
Jayden Hasemann am 9 Okt. 2017
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
I am doing some image processing on SIMULINK as part of a control system. I have written a code up in Matlab which detects the amount of a certain range of colour and then determines the percentage of that colour in the enitre image. This is seen here:
vals=reshape(HSI,[],3);
map= (vals>=[0.17 0 0.41] & vals<=[0.48 0.07 0.99]);
map2= all(map,2);
percentage=sum(map2,1)/numel(map2)*100;
When I use a matlab function block in simulink however i get this error. Note the image (called HSI) is coming from a 'From Video Device' Block.
Size mismatch (size [307200 x 3] ~= size [1 x 3]).
Function 'Prediction_alg' (#36.429.448), line 11, column 7:
"vals>=[0.17 0 0.41]"
Launch diagnostic report.
I think this is because simulink does not reshape the image, but I am unsure. Any help on this issue will be greatly appreciated.

Antworten (0)

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by