Find the columns where a certain number is repeated consecutively
1 次查看(过去 30 天)
显示 更早的评论
I have a matrix of ones and zeros of an Image (690 x 1100)
I need to find the columns where at least 50 zeros are repeated.
Can someone help me?
2 个评论
采纳的回答
Jonas
2021-4-18
quick and dirty small example
a=[ 1 1 1 0 1;...
0 1 1 0 1;...
0 0 1 1 1;...
0 1 1 1 1];
nrOfMinZerosPerCol=2;
colsWithRepetitions=~all(conv2(a,ones(nrOfMinZerosPerCol,1),'valid'),1);
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Processing Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!