How to use the find function against regionprops?
Show older comments
Hi there, I''m having trouble using the find function.. Basically, I have this image called binaryImage, I want to find specific areas of the image with a range of parameters. Here's my code:
Lh=bwlabel(binaryImage,8);
blobMeasurements = regionprops(Lh, I, 'all');
And a whole bunch of codes(not included here) that allow me to display in Matlab, a few parameters of the labeled areas(blobs):
Blob # Mean Intensity Area Diameter Eccentricity
# 1 196.6 4393.0 74.8 0.6
# 2 234.1 55.0 8.4 0.9
# 3 242.9 9.0 3.4 0.9
# 4 216.2 316.0 20.1 1.0
# 5 232.7 49.0 7.9 1.0
.
.
.
para1 = [blobMeasurements.Eccentricity];
para2 = [blobMeasurements.MeanIntensity];
Keeper_Indexes = find(0.9<para1<=0.1 & 230<para2<250);
PossibleCracks = ismember(Lh, Keeper_Indexes);
figure, imshow(PossibleCracks, 'DisplayRange', []), title('Possible Cracks');
I thought it would show me the areas of blobs#2, #3, and #5, but figure 'Possible Cracks' doesn't show me that.. instead it shows me alot of unnessary other blob areas. What should i do? Please advice! Thank you!
Accepted Answer
More Answers (0)
Categories
Find more on Image Arithmetic 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!