Code covered by the BSD License  

Highlights from
Region Growing

4.39394

4.4 | 33 ratings Rate this file 294 Downloads (last 30 days) File Size: 54.7 KB File ID: #19084
image thumbnail

Region Growing

by

 

06 Mar 2008 (Updated )

Segmentation by growing a region from seed point using intensity mean measure

| Watch this File

File Information
Description

Simple but effective example of "Region Growing" from a single seed point.

The region is iteratively grown by comparing all unallocated neighbouring pixels to the region. The difference between a pixel's intensity value and the region's mean, is used as a measure of similarity. The pixel with the smallest difference measured this way is allocated to the region.

This process stops when the intensity difference between region mean and new pixel becomes larger than a certain treshold

Acknowledgements

This file inspired Region Growing (2 D/3 D Grayscale).

MATLAB release MATLAB 7.5 (R2007b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (54)
11 Jul 2014 DENNIS Dietz

Simple program, easy to use on medical images.

20 Jun 2014 bo xia

hi thanks want details

25 May 2014 Mohammed ashraf

??? Subscript indices must either be real positive integers or logicals.

Error in ==> regiongrowing at 34
reg_mean = I(x,y); % The mean of the segmented region

how could this problem be solved please response ASAP

28 Apr 2014 syed umar

I am getting an error: "Not enough input arguments" Please help me how to solve the problem, Please tell me How to pass input arguments?

12 Mar 2014 NITHYA V R

want details

01 Mar 2014 Luke Xie

Thanks for the function. Good code to have in your image processing toolbox.

28 Nov 2013 adi

In order to avoid this error, you have to convert your image to type of double by:
I=im2double(I); (I is the image)

27 Nov 2013 Sandy

??? Error using ==> minus
Class of operand is not supported.

Error in ==> regiongrowing at 69
dist = abs(neg_list(1:neg_pos,3)-reg_mean);

How could this problem be solved?

18 Nov 2013 Fitroh Amaluddin

guys can u share the correct code?

11 Oct 2013 Ana Djuricic

Hi,

if someone knows example for region growing using multiple seed points, please share! Thank you!

Greets,
Ana

30 Aug 2013 Gaurav Mittal

Worked like charm, thanks for providing this code.

16 Aug 2013 Francesco

Hi... I found an error executing this code. The details of error are follows:

Error using -
Integers can only be combined with integers of the same class, or scalar doubles.

Error in regiongrowing (line 69)
dist = abs(neg_list(1:neg_pos,3)-reg_mean);

Thanks !

08 May 2013 Preeti

kindly reply to my question. I have sent u many mails that this code is not working fine for me as i am getting a white image only. I need the ROI which i selected with seed point. Please reply.

23 Apr 2013 lin

well good!

21 Mar 2013 Rajesh Gothwal

Hi... I have found an error when i am executing this code. The details of error are follows:

??? Error using ==> minus
Integers can only be combined with integers of the same class, or
scalar doubles.
dist = abs(neg_list(1:neg_pos,3)-reg_mean);
Thanks !

18 Aug 2012 nayana

i should say that this is very helpful for beginners like me, but i have a doubt, on what basis can we determine the value to reg_max distance
if we choose to segment a particular region

09 Aug 2012 Preeti

I have tried the code on image size 512*512. after providing the x and y values, i get J of same size 512*512 with all white image. No segmentation has been done. Please suggest!

05 Jun 2012 Mauro A

Can you give me some example parameters?

29 May 2012 Deonne C

I can't download the file as well. Some one please help?

17 Apr 2012 ding

Hi,
Thank you

22 Mar 2012 Gene  
13 Mar 2012 aspirin crocin

i cant download d file....help me!!!

30 Dec 2011 Deepak

Thq Dirk-Jan Kroon for such short code.I am working dicom image.I convert it into JPG.i have a problem over run time.

??? Undefined function or method 'regiongrowing' for input
arguments of type 'double'.

I even defined im2double() fnc.but i got an error...

17 Dec 2011 Sivan Ran

Hi,
How can I make it work for 3D images?

Thank you

22 Nov 2011 fsdm fsdm  
21 Nov 2011 kalarmago

What are x and y, I believe image(x,y) coordinate, but when I tested other x,y values (eg, x=308,y=244, I(x,y)=0.73) then the segmented result image is not desired.

17 Oct 2011 saif

thank you

12 Oct 2011 Xin He

very helpful thanks!

26 Sep 2011 michiko

very helpful!Thank you very much!!!

29 May 2011 paramveer sran

i have downloaded this piece o code but when i tried to run on the same image i.e medtest.png i got the following error. could you plz tell me where is the problem and how to solve this
>> regiongrowing
??? Maximum recursion limit of 500 reached. Use set(0,'RecursionLimit',N)
to change the limit. Be aware that exceeding your available stack space can
crash MATLAB and/or your computer.

Error in ==> isstruct at 99
thanx

30 Mar 2011 myriam robert

I change reg_maxdist to 10 and it's ok.
Does anybody have find how use the region growing for 3D matrix ?
thank you

30 Mar 2011 myriam robert

I have a MRI coup from a 3D data matrix "Y" so it's Y( : , : , 14) .
the algorithm doesn't work on this coup. In the result I have only one white pixel ( the seedpoint).
I change the line 70 but it doesn't change anything.
can you help me please?

07 Jan 2011 Aravind

can somebody explain how to segment a carotid artery ?

05 Dec 2010 Hank Will

This looks pretty cool! But I wonder processing larger images with this routine (e.g. satellite data). Any suggestions? In my case I don't get any error, but processing a 10 Bit panchromatic imagery subset of just 15 Mb leads to no valuable results.
Would highly appreciate any thoughts about workflows for matlab for this purpose!
Thanks!

23 Nov 2010 Esther Kneepkens

Thank you a lot!

23 Jun 2010 Jess

No need to change line 70 if use im2double with imread as given in the example (line 21 - comment section)

08 Jun 2010 Natarajan

code works except as Ron did . got to change the line 70.

However the i didn't get a segmented/thresholded output for 16 bit grey scale! Thanks

Would be great if someone could give an idea of whats the issue!

03 Feb 2010 anoop R

Very useful piece of code.

12 Dec 2009 taccini

Hello All,
first i want to thank Dirk about his work and all the matlab community because there are very helpful for me.
well i need to use the region growing for 3D matrix.
this code could be adapted or any one have some idea?
thanks.

23 Sep 2009 jack lumber  
31 Mar 2009 siti 85

cannot download.. why?

21 Mar 2009 Torres Chhetri

its was a great help, would you like to extend your for taking random seed pixels for a colorful image. if u do that, it would be so great.

25 Feb 2009 Jag

thanks, seems like a handy piece of code.
On R2008b I had to change line 70 to

dist = abs(neg_list(1:neg_pos,3)-double(reg_mean));

to get it to run with the sample image.

20 Feb 2009 ucd puri

Hi, I figured out what was the problem, my data set was in int16 format so, it was eaisy to make amendments, but i am not sure if my region is segmented correctly. Regards tanuj

06 Feb 2009 ucd puri

Hi All, This is an excellent piece of code. I am just an intermediate matlab programmer and have a couple of questions on this code.
(1) It works perect on normal images. But i have a dicom int16 medical image, when i give it as an input, i get an output image with only one pixel (the seed pixel that i selected) . I changes the code a little bit for example instad of imread, i used dicomread, and in place of imshow(I,[]) i used imshow(I,'displayRange',[]).
(2) the file explaination reads '"This process stops when the intensity difference between region mean and
new pixel become larger than a certain treshold (t)" but this t is 0.2 which you have defined in the file, what if i want to use an grey intensity level of say 600 as threshold. As my image is int16 dicom, it has 2^16 , so it grey sclae ranges from -32768 to + 32768.
thanks a lot for help in advance.
tanuj

22 Jan 2009 Ida Haggstrom  
19 Dec 2008 rasool shaik

good

01 Aug 2008 ryan hartadi

it works very good, so simple. need to de developed in other area

31 Jul 2008 Paolo L

very good, simple to read, simple to understand, it works fine for a start, useful for student exercises

18 May 2008 Zonglei Zhen

region growing is a very useful method for sgementation. This program is a good start of it.

22 Apr 2008 Roberto Mantia

It does what it should do. Very good !

17 Apr 2008 balamurugan samy

useful

08 Apr 2008 jichao zhao

That is excellent one. I am wondering whether you can extend your work to colorful graph, not just gray scale.

26 Mar 2008 Xin Liu

It's very helpful. Thanks!

Contact us