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

1 次查看(过去 30 天)
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];

采纳的回答

Andrei Bobrov
Andrei Bobrov 2015-11-21
sum(conv2(a,b) == 8)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Graphics Object Identification 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by