Code covered by the BSD License  

Highlights from
clusterImg

4.6

4.6 | 5 ratings Rate this file 44 Downloads (last 30 days) File Size: 5.01 KB File ID: #12979
image thumbnail

clusterImg

by Brett Shoelson

 

12 Nov 2006 (Updated 21 Jun 2010)

Interactively segment RGB image into n user-defined clusters.

| Watch this File

File Information
Description

[IDX,C,sumd,D] = clusterImg(imgin,nClusters,inMask)
 
This function implements kmeans clustering on an input RGB (m x n x 3) image. The user inputs at least two inputs: IMGIN and NCLUSTERS, and this function will step through an interactive color segmentation using kmeans clustering. It is interactive in that the user will be prompted to click-define the target colors in the segmentation. (There will be NCLUSTERS prompts.) Optionally, the user can also input a third argument containing a binary mask of the input image, in which case the program will operate on a subimage defined by the BOUNDING BOX of the (true) inMask.

Following segmentation (clustering), the user can EXPORT THE CLUSTERED IMAGE TO THE WORKSPACE, along with its corresponding colormap. Additionally, the user can opt to EXPORT A BINARY MASK OF A SINGLE COLOR CLUSTER TO THE WORKSPACE, or AUTO-GENERATE ALL MASKS. All of these options are initiated by press of a uicontrol pushbutton.

Required Products Image Processing Toolbox
Statistics Toolbox
MATLAB release MATLAB 7.3 (R2006b)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (7)
19 Dec 2006 Bowo Lee

but, didn't explain to the beginner how to install the toolbox like image processing, statistic toolbox

15 Aug 2007 smiled fisher  
11 Dec 2007 ed rams

perfect

03 Mar 2008 Jiang Hu

Thank you for your code!

12 Apr 2008 li chuan-he

thanks you

06 Aug 2009 shoo chen

thank you ,you are very strong

04 Nov 2010 Nam Le

thank you

Please login to add a comment or rating.
Updates
29 Nov 2007

New pushbutton will auto-generate binary masks for all (clustered) colors in the image. Also, fixes two small bugs (missing documentation for LABELS, improper capitalization in description of workspace variables.)

04 May 2010

added copyright

21 Jun 2010

updated license text file to The MathWorks, Inc.

21 Jun 2010

Updated M file and license text file copyright to The MathWorks, Inc.

Tag Activity for this File
Tag Applied By Date/Time
morphology Brett Shoelson 22 Oct 2008 08:48:48
segmentation Brett Shoelson 22 Oct 2008 08:48:48
kmeans cluster color segmentation Brett Shoelson 22 Oct 2008 08:48:48
morphology Thomas 18 Jun 2009 16:41:57
kmeans cluster color segmentation Faten 08 Apr 2010 01:47:49
morphology Tony Leung 09 May 2011 00:17:24

Contact us at files@mathworks.com