ImLab Scilab Function
Last update :
imlearningdata - learning data creation: image segmentation first step. Training phases of clustering methods can then be applied on this learning set.
Calling Sequence
-
[learningdata] = imlearningdata(percentage,mask,weights,im1[,im2[,im3[,im4[,im5[,im6[,im7[,im8[,im9[,im10]]]]]]]]])
Parameters
-
percentage
: proportion of mask pixels that must belong to the learning set. The harder the clustering of the image is, the bigger the percentage must be.
-
mask
: matrix returned by an ImLab function or user-defined matrix allowing to define which pixels can be chosen to belong to the learning set. A pixel can be chosen only if its value in the mask is not null. If images have 2 or 3 dimensions, the mask must have the same size as images. If images are hypermatrix with 4 dimensions, the mask must only have 3 dimensions (corresponding to X, Y and Z coordinates).
-
weights
: vector containing the weights for each image, in other words the relative importance of each image in clustering. If all the images have the same importance, this parameter can be a vector made of ones. There must be as many weights in this vector as images. The first weight corresponds to the first image (im1), and so on.
-
imx
: (hyper)matrix which contains interesting data for clustering. For example, it can be a graylevel image or an average image. All the images parameters are different attributes images: different computations of the same data. Images can have 2, 3 or 4 dimensions. 3D hypermatrix are used when pixels have 3 coordinates (x,y,z). 4D hypermatrix are used for color images or others images with several components. If pixels only have 2 coordinates (x,y) and more than one component, 4D hypermatrix must be used but the third dimension size equals 1. All the images parameters must have the same dimension and the same size.
-
learning_data
: set of values for the randomly chosen pixels. If images parameters are 2D or 3D (hyper)matrix, learning_data is a 2D matrix: each line corresponds to a pixel and each column corresponds to an attribute (an image parameter). If images parameters are 4D hypermatrix, learning_data is a 3D hypermatrix where each plan corresponds to a pixel component.
Description
This function chooses at random image pixels having a non null value in the mask. The number of chosen pixels is computed with the percentage and the number of non null values in the mask. The result learning set contains the set of values of each chosen pixel in each image for each component. These values are balanced with the relative weights of the different attributes images. The result learning set can be used to compute one or more training phase(s) of image segmentation methods.