Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
roi detection

Subject: roi detection

From: subbmdee

Date: 21 Jan, 2013 13:17:08

Message: 1 of 4

Hi,

I am trying to mark (detect) the region of interest.
The roi in the below figure is at the top center with a black band (white in its negative)
oi46.tinypic.com/4i0tb8.jpg

is there any way to detect that region?

thanks

Subject: roi detection

From: Sadik

Date: 22 Jan, 2013 02:28:09

Message: 2 of 4

Hi Subbmdee,

Thresholding and then checking circularity of each blob should help.

Please see regionprops and google the definition of circularity to see how you can utilize the properties coming with regionprops.

Best.

Subject: roi detection

From: subbmdee

Date: 22 Jan, 2013 11:51:09

Message: 3 of 4

"Sadik " <sadik.hava@gmail.com> wrote in message <kdktfo$h04$1@newscl01ah.mathworks.com>...
> Hi Subbmdee,
>
> Thresholding and then checking circularity of each blob should help.
>
> Please see regionprops and google the definition of circularity to see how you can utilize the properties coming with regionprops.
>
> Best.

But the image has already been thresholded and am not finding a way to get blobs so that regionprops can be applied. Is there a way do morphing initially to trim this?

Subject: roi detection

From: Sadik

Date: 22 Jan, 2013 17:26:08

Message: 4 of 4

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.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us