Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.


Sadik
Posts:
382
Registered:
1/12/09


Re: roi detection
Posted:
Jan 22, 2013 12:26 PM


I "Saveas"ed the image at the link as 4i...png and then did the following operations.
I = imread('4i0tb8jpg.png'); G = rgb2gray(I); M = imfill(imerode(G==0,strel('disk',1)),'holes'); L = bwlabel(M); % Get the area of each island n = hist(L(L>0),1:max(L(:))); % Erase those with less than 500 pixels [determined after plotting n] for k = 1:max(L(:)) if n(k)<500 L(L==k) = 0; end end
newMask = L>0;
Now you can go from newMask.
Best.



