⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme2

📁 Vector Quantization压缩算法
💻
字号:
EXAMPLE:Three training images: man, couple, crowd which are 512X512 and 8bpp.One test image: lena which is also 512X512 and 8bpp.  Make a VQ ofdimension 4 made from 2X2 blocks of the images with 512 codewords.The data is stored as "unsigned char" data.  So check the vq.h file(see the first real line of file) and make sure that DATA is definedas:#define DATA	unsigned charNote: If you are using 16bpp then define data as short int, etc.Then if needed, compile the programs:"make all""make clean"Put all of the training images into one file:cp man training_datacat couple >> training_datacat crowd >> training_dataBlock the training data into vectors taken from 2X2 chunks of the imageusing the "block" program.  The training_data now has threeimages, so there are 3*512=1536 rows and 512 columns:block -i training_data -r 1536 -l 512 -h 2 -w 2 -o training_data.TSThe output is a file called training_data.TS where TS is for trainingset.  Now the training data are ready to use.  Use the "stdvq" programto make a codebook with 512 codewords.  Recall that the vectordimension is 4.stdvq -t training_data.TS -c codebook -d 4 -f 512This will output a codebook called "codebook" with 512 codewords ofdimension 4.  Another option is:stdvq -t training_data.TS -c codebook -d 4 -f 512 -WThis will output a codebook with 512 codewords of dimension 4, aswell as codebooks with 256, 128, 64, 32, 16, 8, 4, 2, and 1 codewords.The codebooks are called codebook.512, codebook.256, ..., codebook.1To encode the test image, the test image must first be arranged intovectors using the "block" program.  Then the "stdvqe" program is usedto encode the test image.  Finally, the "unblock" program is used toarrange the encoded/decoded vectors into a decoded image.  Note thatthe "stdvqe" program does both encoding and decoding on the data anddoes not output the indices of the compressed vectors.block -i lena -r 512 -l 512 -h 2 -w 2 -o lena.TSstdvqe -c codebook -i lena.TS -o lena.TS.encodedunblock -i lena.TS.encoded -r 512 -l 512 -h 2 -w 2 -o lena.final

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -