Effacer les filtres
Effacer les filtres

Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

Image Processing SIMULINK Array error

2 vues (au cours des 30 derniers jours)
Jayden  Hasemann
Jayden Hasemann le 9 Oct 2017
Clôturé : MATLAB Answer Bot le 20 Août 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.

Réponses (0)

Cette question est clôturée.

Community Treasure Hunt

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

Start Hunting!

Translated by