The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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 ]

Posts: 384
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;

newMask = L>0;

Now you can go from newMask.


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

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.