Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: roi detection
Replies: 3   Last Post: Jan 22, 2013 12:26 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Sadik

Posts: 381
Registered: 1/12/09
Re: roi detection
Posted: Jan 22, 2013 12:26 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

I "Save-as"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.



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.