Created
December 21, 2016 08:54
-
-
Save mstrYoda/b9c72eb181aa2d4591840d8654023958 to your computer and use it in GitHub Desktop.
matlab regionprops example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I = imread('coins.png'); | |
bw = im2bw(I, graythresh(I)); | |
bw2 = imfill(bw,'holes'); | |
s = regionprops(bw2, 'BoundingBox'); | |
for k=1:length(s), | |
boundary = s(k).BoundingBox; | |
I2 = imcrop(I,boundary); | |
subplot(1,length(s),k),imshow(I2); | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment