ImLab Scilab Function
Last update :
imhierarclustrain - hierarchical clustering method, training phase: second step of image segmentation using hierarchical clustering method.
Calling Sequence
-
[prototype] = imhierarclustrain(learningdata,classnb)
Parameters
-
learningdata
: set of pixels attributes values. This data is obtained with 'imlearningdata' Imlab function.
-
classnb
: number of classes (or regions) that must be created during the segmentation.
-
prototype
: representative values of the classes. If learningdata parameter is a 2D matrix, the result prototype is also a 2D matrix where each line corresponds to an attribute in learningdata and each column corresponds to a class. If learningdata parameter is a 3D hypermatrix, the result prototype is also a 3D hypermatrix where each plan corresponds to a pixel component in learningdata.
Description
Thanks to learning data and following hierarchical clustering method, this function creates classes and returns their features in a prototype. The number K of classes is user defined.
Algorithm :
1. Initialisation: each cluster contains a single object.
2. Merge the two closest clusters. The new cluster is represented by its centre of gravity. Step 2 is repeated until the number of clusters equals K.
The result prototype is formed with the K centres. Note that the distance used is the euclidean one.