File Exchange

image thumbnail

Automatic Thresholding

version 1.0 (2.43 KB) by

Provides automatic thresholding based on the ISODATA method.

4.29412
18 Ratings

23 Downloads

Updated

View License

This iterative technique for choosing a threshold was developed by Ridler and Calvard .The histogram is initially segmented into two parts using a starting threshold value such as 0 = 2B-1, half the maximum dynamic range.
The sample mean (mf,0) of the gray values associated with the foreground pixels and the sample mean (mb,0) of the gray values associated with the background pixels are computed. A new threshold value 1 is now computed as the average of these two sample means. The process is repeated, based upon the new threshold, until the threshold value does not change any more.

Reference :T.W. Ridler, S. Calvard, Picture thresholding using an iterative selection method, IEEE Trans. System, Man and Cybernetics, SMC-8 (1978) 630-632.

Comments and Ratings (24)

Sidra Aleem

Its not working I ma facing the following error.
Undefined function or variable 'Threshold'.

Error in isodata (line 68)
level = (Threshold - 1) / (N(end) - 1);

Error in same (line 49)
th = isodata(imreslt1);

Sagar Sawant

i am kind of new to matlab and i want to use this code for thresholding so will somebody please tell what kind of output will i be getting by using this ?? i mean will i be getting just the value or a image?

Trung Nguyen

it's nicee

Brent Snyder

To resolve error:

??? Undefined function or variable "Threshold".

Error in ==> isodata at 68
level = (Threshold - 1) / (N(end) - 1);

Move "Threshold=T(i);" after the "end" outside the while loop rather than inside it.

homym Hoi

homym Hoi

It's what I need!


Hi!
The code has been useful so far,but when i use certain grayscale images I get the following error:
??? Undefined function or variable "Threshold".

Error in ==> isodata at 68
level = (Threshold - 1) / (N(end) - 1);

do you know of a way i can resolve this?

shan

shan (view profile)

Thanks for your code its really very good

Upasna

Upasna (view profile)

Hi!
The code has been useful so far,but when i use certain rgb images I get the following error:
??? Undefined function or variable "Threshold".

Error in ==> isodata at 68
level = (Threshold - 1) / (N(end) - 1);

do you know of a way i can resolve this? Many thanks.

Usman Ahmad

lee lang chua

Hi,ur code is useful to me.but, I also need the PCA source code to extract the bright region from the blood vessel in the retinal image. can anyone send it to me if found? thank you.

JINGFU JIN

Ali Tavallaei

Thank you . God bless u

mahendran mariappan

Vikas Humbe

It is nice

fan zhang

It has a bug!
When the program run to "while abs(T(i)-T(i-1))>=1" for the first time: if T(i)-T(i-1)=0,then the Var "Threshold" can't get a value!
we should set a default value for Var "Threshold" before 56#"while...."

FABIAN ROMERO

it´s true, is better than graythresh

sagar jambhorkar

it is useful

Senes Yin

It's what I need!

Raghavan Gopalakrishnan

better than graythresh

Toni Amengual

I need information about ISODATA for studies

rojas julio

good

george cranberry

fast implementation, faster than graythresh but yiled comparable results. works like a charm!

Updates

1.0

BSD license

MATLAB Release
MATLAB 6.5 (R13)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video