主要内容

ihaart2

Inverse 2-D Haar wavelet transform

Description

example

xrec= ihaart2(a,h,v,d)returns the inverse 2-D Haar transform,xrec, for the approximation coefficients,a, 和the horizontal, vertical, and diagonal detail coefficients,h,v, 和d. All the inputs,a,h,v, 和d, are outputs ofhaart2.

example

xrec= ihaart2(a,h,v,d,等级)returns the inverse 2-D Haar transform at the specified level.

example

xrec= ihaart2(___,integerflag)specifies how the inverse 2-D Haar transform handles integer-valued data, using any of the previous syntaxes.

Examples

collapse all

Obtain the inverse 2-D Haar transform of image and view the reconstructed image.

加载图像并获得其2-D Haar变换。

im = imread('mandrill.png');[a,h,v,d] = haart2(Im);

使用inverse 2-D Haar transform to reconstruct the image.

xrec = ihaart2(a,h,v,d);

比较原始和重建的图像。

ImagesC(IM)标题('Original RGB Image')

图包含轴对象。具有标题原始RGB图像的轴对象包含类型图像的对象。

图ImageC(UINT8(XREC))标题('Reconstructed RGB Image')

图包含轴对象。具有标题重建RGB图像的轴对象包含类型图像的对象。

Obtain the 2-D Haar transform of an image limiting the transform to 2 levels.

Load and view the image of a cameraman.

im = imread('cameraman.tif');ImagesC(IM)

图包含轴对象。The axes object contains an object of type image.

使用默认最大级别获取2-D Haar变换。

[a,h,v,d] = haart2(Im);

使用逆2-d Haar变换重建图像并查看图像。注意近乎完美的重建。

xrec = ihaart2(a,h,v,d); imagesc(xrec)

图包含轴对象。The axes object contains an object of type image.

使用逆2-d哈尔变换重建和查看图像,限于级别2.级别2对应于第四种比例,因为尺度被定义为 2 j , wherejis the level.

xrec1 = ihaart2(a,h,v,d,2); imagesc(xrec1)

图包含轴对象。The axes object contains an object of type image.

Using fewer levels returns the average of the original image at level 2.

Obtain the 2-D Haar transform of an image limiting the transform to integer data.

Load the image of a cameraman.

im = imread('cameraman.tif');

Obtain the 2-D Haar transform using the'整数'旗帜。

[a,h,v,d]=haart2(im,'整数');

使用逆2-d Haar变换重建图像并查看图像。

xrec = ihaart2(a,h,v,d,'整数');imagesc(xrec)

图包含轴对象。The axes object contains an object of type image.

Use integer data when you need to reduce the amount of memory used compared to noninteger data.

Input Arguments

collapse all

近似系数,指定为系数的标量或矩阵,这取决于计算2-D哈尔变换的电平。ais an output from thehaart2function. Approximation, or scaling, coefficients are a lowpass representation of the input. Ifa和the elements ofh,v, 和d向量,xrecis a vector. Ifa和the elements ofh,v, 和dare matrices,xrecis a matrix, where each column is the inverse 2-D Haar transform of the corresponding columns inah,v, ord.

Data Types:single|double

Horizontal detail coefficients by level, specified as a matrix or cell array of matrices.his an output from thehaart2function. Ifhis a matrix, the 2-D Haar transform was computed only down to one level coarser in resolution.

Data Types:single|double

Vertical detail coefficients by level, specified as a matrix or cell array of matrices.vis an output from thehaart2function. Ifvis a matrix, the 2-D Haar transform was computed only down to one level coarser in resolution.

Data Types:single|double

按级别的对角线细节系数,指定为矩阵或小区矩阵数组。dis an output from thehaart2function. Ifdis a matrix, the 2-D Haar transform was computed only down to one level coarser in resolution.

Data Types:single|double

最大水平to which to invert the Haar transform, specified as a nonnegative integer. Ifh是一个小区阵列,等级is less than or equal to长度(h)-1. Ifh是矢量或矩阵,等级must equal0或者be unspecified.

Integer-valued data handling, specified as either'noninteger'或者'整数'.'noninteger'does not preserve integer-valued data in the 2-D Haar transform, and'整数'preserves it. The'整数'option applies only if all elements of inputs,a,h,v, 和d, are integer-valued. The inverse 2-D Haar transform algorithm, however, uses floating-point arithmetic.

Output Arguments

collapse all

2-D Haar wavelet transform, returned as a matrix.

Data Types:single|double

Extended Capabilities

C/C++ Code Generation
使用MATLAB®Coder™生成C和C ++代码。

GPU Arrays
使用并行计算工具箱™在图形处理单元(GPU)上运行,加速代码。

Version History

Introduced in R2016b