Compute an optimal threshold for seperating the data into two classes .
This algorithm can be summarized as follows. The histogram is initially segmented into two
parts using a a randonly-select starting threshold value (denoted as T(1)). Then, the data are classified into two classes (denoted as c1 and c2). Then, a new threshold value is computed as the average of the above two sample means. This process is repeated untill the threshold value
does not change any more.
The algorithm was implemented by Dhanesh Ramachandram . However, the input data of her/his algorithm should lie in the range [0,255]. My code doesn't have this requirement.
t = func_threshold(T);
Reference: . T. W. Ridler, S. Calvard, Picture thresholding using an iterative selection method,
IEEE Trans. System, Man and Cybernetics, SMC-8, pp. 630-632, 1978.
. Dhanesh Ramachandram, Automatic Thresholding. Available online at: http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=3195&objectType=file
Contact me : email@example.com
This program is written in Mar. 2006 during my postgraduate studying in Singapore.
Inspired by: Automatic Thresholding