File Exchange

image thumbnail

Fuzzy c-means thresholding

version 1.0 (22 KB) by

Thresholding by 3-class fuzzy c-means clustering.



View License

FCMTHRESH Thresholding by 3-class fuzzy c-means clustering
[bw,level]=fcmthresh(IM,sw) outputs the binary image bw and threshold level of image IM using a 3-class fuzzy c-means clustering. It often works better than Otsu's methold which outputs larger or smaller threshold on fluorescence images.

sw is 0 or 1, a switch of cut-off position.
sw=0, cut between the small and middle class
sw=1, cut between the middle and large class

Contributed by Guanglei Xiong (
at Tsinghua University, Beijing, China.

Inspired by Xiaobo Zhou
at Harvard Medical School.

Comments and Ratings (15)

Can someone explain what is the meaning of 3 class fuzzy? Is it the output of the image which has three output with different level ?


csh (view profile)

Sadoon U

thanks for your code. can you sent me this paper in my email.

thanks very well


Could you please email me the paper that is related to this code thank thati can cited the paper.

Ijaz Hussain

Will you please email me its paper.


sara (view profile)


Diggs (view profile)

Hi Guanglei,the code is so nice on biological images.and fair on remote sensing images.have tried to test both methods on remote sensing images but results show otsu is better.
though i have used tested your code on several remote sensing images,I have failed to understand how the code operates.all is that your code segments the image into three classes using FCM clustering thresholding based on 3-class Fuzzy clustering,where by the threshold is obtained by averaging the maximum
in the class with the smallest center and the minimum in the class with the middle center. am i right or wrong about your method?.hope to hear from you.chao

Stacy Ross

I received an error when trying to run the test code.

In the fcmthresh function, it does not now what fcm is in

Any advice?

Thank you.



muk (view profile)


hbu  (view profile)

the sourcode is good !thank you.

giri babu kande

oleksandr makoveychuk





MATLAB Release
MATLAB 7.0.4 (R14SP2)

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

» Watch video