[a,h,v,d] = haart2(x)
[a,h,v,d] = haart2(x) performs the 2-D Haar discrete wavelet transform (DWT) of the matrix, x. haart2 returns the approximation coefficients, a, at the coarsest level. haart2 also returns cell arrays of matrices containing the horizontal, vertical, and diagonal detail coefficients by level. If the 2-D Haar transform is computed only at one level coarser in resolution, then h, v, and d are matrices. The default level depends on the number of rows of x.
[a,h,v,d] = haart2(x)执行矩阵x的二维Haar离散小波变换(DWT)。haart2返回最粗级别的近似系数a。Haart2还按级别返回包含水平、垂直和对角线细节系数的矩阵单元格数组。如果二维Haar变换只在一个较粗的分辨率上计算,那么h, v和d是矩阵。默认级别取决于x的行数。
[a,h,v,d] = haart2(x,level)
Show the effect of limiting the maximum level of the 2-D Haar transform on an image.
获得图像限制在最大级别的二维Haar离散小波变换。
im = imread('cameraman.tif');
imagesc(im);
[a2,h2,v2,d2] = haart2(im,2);
imagesc(a2);