File Exchange

image thumbnail

Fuzzy c-means segmentation

version 1.0.0.0 (1.77 KB) by Santle Camilus
This program segments an image into 2 partitions using standard Fuzzy k-means algorithm.

37 Downloads

Updated 09 Oct 2009

View License

This program illustrates the Fuzzy c-means segmentation of an image.
This program converts an input image into two segments using Fuzzy k-means algorithm. The output is stored as "fuzzysegmented.jpg" in the current directory.This program can be generalised to get "n" segments from an image by means of slightly modifying the given code.

Cite As

Santle Camilus (2020). Fuzzy c-means segmentation (https://www.mathworks.com/matlabcentral/fileexchange/25532-fuzzy-c-means-segmentation), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (34)

It works fine for gray images so when the input image is in RGB format you will get the following error.
Array dimensions must match for binary array op.
Thanks,

Chamani Shiranthika

Mahoro Adidja

i got an error "unable to write to fuzzysegmented.jpg"how can it be solved thanks

parvathy prathap

sameeksha shrivastava

my email id : sameeksha.shrivastava88@gmail.com

mariena aloor

Sir

good work
iam thankful to your generous heart.Actually i want to update this code to get new initial centroid by using some equations.can you help me sir

esi esi

Good Work.

mariena aloor

I need image segmentation using FCM algorithm please send it to my mail address aloormariena@gmail.com

anas noor

Abhisek Banerjee

garima sharma

Could you please tell which distance measure is used in this code?

suja s

i got an error "unable to write to fuzzysegmented.jpg".how can this be solved?

IKA HERAWATI

Ahmed Abdeldaim

Array dimensions must match for binary array op.

Error in fuzzycmeans (line 32)
distance=IMM-c;

May I get the code for fcm for n clusters or it would be really helpful if someone tell me how to do for n clusters.My mail I'd is aliatabassum12@gmail.com Thank you :)

Rishabh Bansal

Hello, Please tell me how to do for n-segments instead of 2-segments. Thanks

tan yuki

Hi, is it possible to make it cluster into 3 region? I am trying to add cc3 into the code provided but i facing problem on how to change the equation for daoShu, distance, and u3.

Any advice?
Thanks

Omid Faghihi

Rojalin

I get this error..
??? Error using ==> iter2 at 31
Array dimensions must match for binary array op.
distance=IMM-c;
sir plz reply me...
barik.linky@gmail.com

priyanka

could you please send me the code of fuzzy c means image segmentation using the inbuilt command of matlab to my mail address priyanka.theultimate@gmail.com ?
please please do help because i'm working on a project and i have to submit it asap !

samira

i get this error:
Error using ==> ==
Array dimensions must match for binary array op.
Error in ==> fuzzycmeans at 32
distance=IMM-c;
sir send me reply to this mail address
(samira_rad65@yahoo.com)

LENIN RAJA

further more information required for image segmentation and various fuzzy techniques as well as various optimization techniques.

Edwin

Would you please teach me how to modify the codes for n segments from the original codes?

Thanks for your help in advanced!

shaik gousal

I need image segmentation using FCM algorithm please send it to my mail address mohammadgousal@gmail.com. thank you.

shaik gousal

whether this code is using fcm or fkm .If itis fkm then please anybody send the image segmentation using fcm i will be thank ful to you.............please

shaik gousal

i get this error:
Error using ==> ==
Array dimensions must match for binary array op.
Error in ==> fuzzycmeans at 32
distance=IMM-c;
sir send me reply to this mail address mohammadgousal@gmail.com.thanking you sir......

mahisnair

when i try to segment my multispectral images of size 500*500 ,the code give me this error "??? Array dimensions must match for binary array op".what does it mean? and could you please help

Ganesh Sistu

Good Work.

Gayadre sundararajan

Input image should be CONVERTED from RGB2 GRAY to run the code.

" Array dimensions must match for binary array op " - 'error will not occur'

Gayadre sundararajan

Thanks...!it is very helpful...

Gayadre sundararajan

SL

This program works well! But may I know how could I modify the codes to generalize it to get "n" segments instead of 2. Thank you!

Diggs

when i try to segment my multispectral images of size 500*500 ,the code give me this error "??? Array dimensions must match for binary array op".what does it mean? and could you please help

poo

any idea about optimal feature based segmentation of an image using FCM

MATLAB Release Compatibility
Created with R14
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!