**Name**

**fscalq** Scalar quantization of an image

**Command Synopsis**

**fscalq** [-p] [-h] [-n *StepNum*] [-s *StepSize*] [-c] [-o *Compress*] *Input* *QImage*

-p : Do not print info on SNR

-h : Insert only a reduced header at top of Compress

-nStepNum: Number of quantization steps

-sStepSize: Size of quantization steps

-c : 0 is a quantization step

-oCompress: Compressed representation of Image

Input: Input image (fimage)

QImage: Output quantized image (fimage)

screen output :

screen output :

screen output :

screen output :

**Function Summary**

void fscalq (PrintSNR , SmallHeader , NStep , SStep , Center , Compress , Image , Result , MSE , SNR , Ent , RateAr )

int *PrintSNR ;

int *SmallHeader ;

int *NStep ;

float *SStep ;

int *Center ;

Cimage Compress ;

Fimage Image ;

Fimage Result ;

double *MSE ;

double *SNR ;

double *Ent ;

double *RateAr ;

**Description**

This module compresses a graylevel image (fimage) using a uniform scalar quantization algorithm.

Compress is the output compressed file. Notice that the list
of quantization symbols is arithmetically encoded using the
*arithm_encode2* module (see the documentation of this module
for further details).

QantizedImage is the quantized image, which can be reconstructed from Compress.

The -h option indicates that only a reduced header (not including the dimensions of image) should be inserted at the beginning of the Compress file.

The -n option specifies the number of steps for the quantization.
If we call *m* and *M* respectively the minimum and the maximum gray level
values in Input, then the stepsize is computed so that *m* and *M* fall
in the two extremal cells.

The -s option specifies the stepsize for the quantization. Once again,
the number of steps is then computed in order that *m* and *M* fall
in the two extremal cells. Note that the -n and -s options are mutually
exclusive.

The -c option forces the quantization grid to contain 0. Thus 0 is a quantization step.

**See Also**

`fwvq`.

**Version 2.03**

Last Modification date : Mon Feb 11 18:07:18 2002

**Author**

Jean-Pierre D'Ales