RETRO (vipl) functions
LIBRARY ROUTINE
lvquant - Perform N-dimensional vector quantization or classification
LIBRARY CALL
int lvquant(
xvimage *i,
int nvecs,
int mapflg,
xvimage **ccimage,
int ccflg,
xvimage **cvimage,
int cvflg,
int sp,
int axis)
INPUT
- i - pointer to vector image to be quantized.
- nvecs - number of vectors to generate
- mapflg - output image map enable
- ccimage - cluster center output image structure
- cvimage - cluster variance output image structure
- sp - split point method: 0 is mid-span, 1 is mean
- axis - split axis: 1 is max-span axis, 2 is max variance
axis, 3 is principal eigenvector
OUTPUT
- i - the image pointed to by i on input is modiifed
to contain the single-band classification
pixel plane and the map is modified so that
it contains the representative vectors.
RETURN VALUE
TRUE (1) on success, FALSE (0) on failure
DESCRIPTION
vquant performs N-dimensional vector quantization, also known
as non-parametric vector classification. The technique is
based on Paul Heckbert's median cut, with the modification
that the histograms may have many independent axes, and
are stored in a sparse data structure. Additionally, the
splitting of a cluster is governed by the 2-norm of the
subspace spanned by that cluster.
When splitting a cluster, the split axis is normally chosen
to be the axis with the largest span across the enclosed
data points, and the split point is the middle of the
span. By setting the variance split flag, the split axis
is chosen to be the axis with the largest variance of data
across that axis, which should give better results at the
cost of more computation. When the variance split flag is
selected, the split point is at the mean of the
distribution of data long the split axis.
ADDITIONAL INFORMATION
none
EXAMPLES
none
SIDE EFFECTS
none
RESTRICTIONS
vquant will currently only work on images of type
VFF_TYP_FLOAT. Additionally, the output is currently
restricted to type VFF_TYP_1_BYTE, and this in turn restricts
the maximum number of representative vectors to 256.
Additionally, vquant suffers from the same statistical
influences that vgamut does; see vgamut(1) for more details.
MODIFICATION
23-Jul-91 Scott Wilson Fixed uninitialized next pointer
(Tom Lane)
FILES
$RETRO/objects/library/vipl/src/lvquant.c
SEE ALSO
vipl(3)
COPYRIGHT
Copyright (C) 1993 - 1997, Khoral Research, Inc. ("KRI") All rights reserved.