Azzera filtri
Azzera filtri

Info

Questa domanda è chiusa. Riaprila per modificarla o per rispondere.

Image Processing SIMULINK Array error

1 visualizzazione (ultimi 30 giorni)
Jayden  Hasemann
Jayden Hasemann il 9 Ott 2017
Chiuso: MATLAB Answer Bot il 20 Ago 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.

Risposte (0)

Questa domanda è chiusa.

Community Treasure Hunt

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

Start Hunting!

Translated by