next up previous contents index
Next: flbg_train Up: Reference Previous: flbg_adap   Contents   Index


$ \bigcirc$Name

flbg Generates a (sequence of) codebook(s) from a training set of images using LBG (generalized Lloyd) algorithm

$ \bigcirc$Command Synopsis

flbg [-s CodeBookSize] [-w VectorWidth] [-h VectorHeight] [-l] [-d Decim] [-e Edge] [-W Weight] [-M] [-p] [-A TrainImage2] [-B TrainImage3] [-C TrainImage4] [-D TrainImage5] [-E TrainImage6] [-F TrainImage7] [-G TrainImage8] [-i InitRandCB] [-r RepeatRand] [-f NResCB] [-g NResResCB] [-a ResCodeBook] [-b ResResCodeBook] TrainImage1 CodeBook

-s CodeBookSize : Size of output codebook

-w VectorWidth : Width of vectors (default : 2)

-h VectorHeight : Height of vectors (default : 2)

-l : Take overlapping vectors in training images

-d Decim : Decimation factor in training images (for wavelet transform)

-e Edge : Do not take overlapping vectors if the distance to an edge is smaller than Edge (default : 0)

-W Weight : Weighting factors for the components of vector (fsignal)

-M : Generate codebooks of size equal to a power of two and smaller than Size

-p : Do not print information

-A TrainImage2 : Training image (fimage)

-B TrainImage3 : Training image (fimage)

-C TrainImage4 : Training image (fimage)

-D TrainImage5 : Training image (fimage)

-E TrainImage6 : Training image (fimage)

-F TrainImage7 : Training image (fimage)

-G TrainImage8 : Training image (fimage)

-i InitRandCB : Initiate algorithm with a randomly drawn codebook of size InitRandCB

-r RepeatRand : Run the algorithm RepeatRand times (irrelevant if InitRandCB is smaller than 1)

-f NResCB : Index of first residual codebook (ResCodeBook)

-g NResResCB : Index of second residual codebook (ResResCodeBook)

-a ResCodeBook : First residual codebook (fimage)

-b ResResCodeBook : Second residual codebook (fimage)

TrainImage1 : Training image (fimage)

CodeBook : Output codebook (fimage)

screen output : Quantization M.S.E. for training set

$ \bigcirc$Function Summary

void flbg (Size , Width , Height , Lap , Decim , Edge , Weight , MultiCB , PrintSNR , Image2 , Image3 , Image4 , Image5 , Image6 , Image7 , Image8 , InitRandCB , RepeatRand , NResCB , NResResCB , ResCodeBook , ResResCodeBook , Image1 , CodeBook , MSE )

int *Size ;

int *Width , *Height ;

int *Lap ;

int *Decim ;

int *Edge ;

Fsignal Weight ;

int *MultiCB ;

int *PrintSNR ;

Fimage Image2 , Image3 , Image4 , Image5 , Image6 , Image7 , Image8 ;

int *InitRandCB ;

int *RepeatRand ;

int *NResCB , *NResResCB ;

Fimage ResCodeBook , ResResCodeBook ;

Fimage Image1 ;

Fimage CodeBook ;

float *MSE ;

$ \bigcirc$Description

This module creates a training set of vectors extracted from one or several images, and generates a codebook (or a set of codebooks) for this training set using the LBG algorithm (see [GG92], [LBG80]). The input images are read in the files TrainImage, TrainImage2, ..., TrainImage8. The generated codebook is stored in the CodeBook file. It can be used for example for the vector quantization of images with the fvq module.

The creation of the training set is made with the help of mk_trainset module. See its documentation for the definition of the -w, -h, -l, -d and -e options.

The codebook is generated using the flbg_train module. See the documentation of this module for a brief description of the LBG algorithm and the definition of the -s, -W, -M, -a, -b, -f and -g options.

The -i option has a different effect here compared to flbg_train. When selected, a random codebook of size InitRandCB is generated and used as initial codebook for the flbg_train module. These means that all the components of all the vectors in this initial codebooks are randomly drawn according to independent gaussian variables. All these variables have the same mean and variance, which are the empirical mean and variance of the components of the vectors in Trainset. InitRandCB must be a strictly positive integer.

The -r option, when selected, has the same effect as if the flbg module was run RepeatRand times, except that the resulting codebooks (or sets of codebooks) are not stored on the disc, except for the last one. It is useful iff the -i option is selected with InitRandCB > 2 (otherwise the same computation is repeated RepeatRand times!). The purpose of this option is to compare the rates and signal to noise ratios when different initial codebooks are chosen.

$ \bigcirc$See Also

flbg_train, mk_codebook, mk_trainset.


$ \bigcirc$Version 2.02

Last Modification date : Thu Nov 29 20:23:57 2001

$ \bigcirc$Author

Jean-Pierre D'Ales

next up previous contents index
Next: flbg_train Up: Reference Previous: flbg_adap   Contents   Index
mw 2004-05-05