Finding areas of data based on value threshold and contiguous size, both height and length.
1 view (last 30 days)
Show older comments
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 Comments
Answers (1)
Jan
on 23 Apr 2021
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.
See Also
Categories
Find more on Convert Image Type in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!