Finding areas of data based on value threshold and contiguous size, both height and length.
3 次查看(过去 30 天)
显示 更早的评论
Hi,
I would like to find the indices of this matrix where values are >3 and are larger than 3 x 5 in size. I have tried using the Image Processing Toolbox and binaryVector...
Any help much appreciated.
A = [2.5 2.5 2.5 2.5 2.5 2.5 2.5 2.5 2.5 2.5 2.5 2.5;
2.5 2.5 2.5 2.5 2.5 2.5 2.5 2.5 2.5 2.5 2.5 2.5;
2.5 2.5 3.5 3.5 3.5 3.5 3.5 3.5 2.5 2.5 2.5 2.5;
2.5 2.5 3.5 3.5 3.5 3.5 3.5 3.5 2.5 2.5 2.5 2.5;
2.5 2.5 3.5 3.5 3.5 3.5 3.5 3.5 2.5 2.5 2.5 2.5;
2.5 2.5 3.5 3.5 3.5 3.5 3.5 3.5 2.5 2.5 2.5 2.5;
2.5 2.5 2.5 2.5 2.5 2.5 2.5 2.5 2.5 2.5 2.5 2.5;
2.5 3.5 2.5 2.5 2.5 2.5 2.5 2.5 2.5 2.5 2.5 2.5;
2.5 2.5 2.5 2.5 2.5 2.5 2.5 2.5 2.5 3.5 3.5 2.5;
2.5 2.5 2.5 2.5 2.5 2.5 2.5 2.5 2.5 3.5 3.5 2.5;
2.5 2.5 3.5 2.5 2.5 2.5 2.5 2.5 2.5 2.5 2.5 2.5;
2.5 2.5 2.5 2.5 2.5 2.5 2.5 2.5 2.5 2.5 2.5 2.5]
0 个评论
回答(1 个)
Jan
2021-4-23
Start with:
B = (A > 3);
0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 0 1 1 1 1 1 1 0 0 0 0
0 0 1 1 1 1 1 1 0 0 0 0
0 0 1 1 1 1 1 1 0 0 0 0
0 0 1 1 1 1 1 1 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 1 0
0 0 0 0 0 0 0 0 0 1 1 0
0 0 1 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0
Now mention, what you have tried with the image processing tooolbox and which problems occurred.
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!