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:
region growing

Subject: region growing

From: Pamela

Date: 27 Aug, 2012 16:15:18

Message: 1 of 4

Can you give me a correction for my for loop because the region growing should be starting from a seed pixel (x,y) not from the begining of image:
x=300
y=450
[L,R]=size(I);
 for i=1:L
   for j=1:R
        %instructions
    end
end
I try this also but it is not correct because it can't across all pixels
x=300
y=450
[L,R]=size(I);
 for i=x:L
   for j=y:R
        %instructions
    end
end

Subject: region growing

From: Pamela

Date: 28 Aug, 2012 09:50:07

Message: 2 of 4

HELP me please!!

Subject: region growing

From: hari prasad

Date: 28 Aug, 2012 11:52:07

Message: 3 of 4

"Pamela" wrote in message <k1i48f$c7b$1@newscl01ah.mathworks.com>...
> HELP me please!!

Could you please be a little specific as of, what exactly the code does and what is your requirement?

Subject: region growing

From: Matt J

Date: 28 Aug, 2012 14:41:15

Message: 4 of 4

"Pamela" wrote in message <k1g6el$81g$1@newscl01ah.mathworks.com>...
>
> I try this also but it is not correct because it can't across all pixels
> x=300
> y=450
> [L,R]=size(I);
> for i=x:L
> for j=y:R
> %instructions
> end
> end
================

A for-loop doesn't seem very appropriate here. A while loop seems like what you need, for example as this author did:

http://www.mathworks.com/matlabcentral/fileexchange/35269-simple-single-seeded-region-growing

Aside from this, do you really need to reinvent this wheel? There are several other region-growing code submissions on the File Exchange.

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