Filter löschen
Filter löschen

how Calculate the number of object(submatrix) in matlab?

1 Ansicht (letzte 30 Tage)
ahmad saleh
ahmad saleh am 21 Nov. 2015
Bearbeitet: ahmad saleh am 21 Nov. 2015
number of object =5
a=[0 0 0 0 0 0 0 0 0 0 0;0 0 1 1 1 1 0 1 0 1 1;0 0 1 0 1 0 1 1 1 0 0;0 1 1 1 1 0 1 0 1 0 0;1 0 1 0 1 0 1 1 1 0 0;1 0 1 1 1 1 0 0 0 0 0;0 0 0 0 0 0 1 1 1 0 0;0 1 1 1 1 0 1 0 1 0 0;0 0 1 0 1 0 1 1 1 0 0;0 0 1 1 1 0 0 0 0 0 0;0 1 0 0 0 0 0 0 0 0 0];
b=[1 1 1;1 0 1;1 1 1];

Akzeptierte Antwort

Andrei Bobrov
Andrei Bobrov am 21 Nov. 2015
sum(conv2(a,b) == 8)

Weitere Antworten (0)

Kategorien

Mehr zu Images finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by