Research on Image Compression of Packaging and Decoration Based on MATLAB (I)

[Abstract] This paper introduces the advantages of MATLAB, and uses its wavelet toolbox to compress packaging and decoration drawings.
Keywords: MATLAB; packaging image. CLC number:TP319 Document code:B Article ID:1001-3563(2003)05-0067-02

Research on MATLAB for Compressing Packagtag lmages
LUO Guang-lin XIAO Ding HE Ke-zhi

(Xi`an University of Technology, Xiʻan 710048, China)
Abstract: The text introduces the advantages of MATLAB, and uses its wavelet toolbox to compress packaging images.
Key words: MATLAB;Packaging image

At present, there are Pho-toshop, CorelDraw, AutoCAD and so on. However, these softwares rarely involve the compression of images to meet the needs of images for transmission and storage. Based on this consideration, we try to use MATLAB programming to handle the compression of packaging and decorating images to achieve a close combination of packaging and computers.
1 MATLAB
MATLAB is a set of high-performance numerical calculation and visualization software introduced by MathWorks. It integrates numerical analysis, matrix calculation, signal processing and image display. The wavelet analysis toolbox attached to it is powerful and can fulfill most of wavelet analysis. Part of the work. The emergence of the MATLAB toolbox avoids repetitive labor in programming, shortens the development cycle and reduces costs, and is therefore favored by engineering students and researchers.
In the literature introducing the use of the MATLAB wavelet tool to compress images, always convert true color RGB images to grayscale index images for processing. After this kind of processing, the stored data of the image can be compressed to some extent, but it is difficult to restore the ideal color image from the compressed data. In this paper, image compression is handled by related functions in MATLAB, and the image can be restored from the compressed data. Experimental results show that the restored image is ideal. In this paper, the processing of the Lena image is mainly used as an example. After the binary wavelet multi-level decomposition is performed on it, the low-frequency and high-frequency approximate coefficient matrix is ​​processed accordingly to study the method of compressing the image with the wavelet toolbox in MATLAB.
2 image compression method In practical applications, first need to read image data from the image file. MATLAB uses the imreed() function to complete this task. For example, there is a color image file picl in the computer D disk. Jps, can be read by the following statement:
X=imread('D:\picl.jpg');
The MATLAB Image Processing Toolbox supports four basic image types: indexed image, grayscale image, binary image, and RGB image. MATLAB reads an image directly from an image file as an RGB image. It is stored in a three-dimensional array. This three-dimensional array has three faces, which correspond to Red, Green, and Blue, and the data in the faces are the intensity values ​​of the three colors. The elements in the faces correspond to each other. Pixels in the image.
The index image data includes an image matrix X and a color map array map, wherein the color map is an array sorted by the color values ​​in the image. For each pixel, the image matrix X contains a value, which is the index in the color map array map. The color map is an m × 3 double-precision matrix, each row specifies red, green, and blue (R, G, B) monochromatic values, map = [RGB], and R, C, B are in the range [0, 1] The real number, m is the number of pixels in the index image. Then different wavelet functions can be used according to the situation to decompose and compress the index image. Here, the layered image X generated above is decomposed by two layers using the dbl wavelet.
[c,l]=wavedec2(X,2,'dbl').
Here, after an index image is decomposed by a wavelet, a series of sub-images with different resolutions can be obtained, and the corresponding frequencies of sub-images with different resolutions are different. The high-resolution (ie, high-frequency detail) sub-images have values ​​close to 0, which is more pronounced at higher frequencies. For an image, the most important part of representing an image is the low-frequency (ie, approximate) portion.
All the component coefficients of the multi-layer wavelet decomposition are stored in the vector c, and the coefficients of the low-frequency approximation and high-frequency details need to be extracted from the vector C. MATLAB uses the appcoet2() and detcoef2() functions, respectively, to accomplish this task. This method deals with the low-frequency and high-frequency parts, thus extracting low-frequency and high-frequency approximation coefficients.
cAl=appcoef2(c,1,'dbl,'1);cH1=detcoef2('h',c,1,1);
cD1=detcoef2('d',c,l,1); cV1=detcoef2('v',c,l,1).
(To be continued)

BED

Double Bed,Platform Bed,Queen Bed,Trundle Bed

Tv Stand Co., Ltd. , http://www.peilinchen.com