## 2-D Continuous Wavelet Transform App

The 2-D continuous wavelet transform (CWT) app enables you to
analyze your image data and export the results of that analysis to
the MATLAB^{®} workspace. The app provides all the functionality
of the command line functions `cwtft2`

and `cwtftinfo2`

. Access the 2-D CWT app in
the apps gallery by selecting **Wavelet Design & Analysis** in
the **Signal Processing and Communications** section
or entering

cwtfttool2

at the MATLAB command prompt.

### 2-D Continuous Wavelet Transform

The 2-D continuous wavelet transform is a representation of
2-D data (image data) in 4 variables: dilation, rotation, and position.
Dilation and rotation are real-valued scalars and position is a 2-D
vector with real-valued elements. Let *x* denote
a two-element vector of real-numbers. If

$$f(x)\in {L}^{2}({\mathbb{R}}^{2})$$

is square-integrable on the plane, the 2-D CWT is defined as

$${\text{WT}}_{f}(a,b,\theta )={\displaystyle {\int}_{{\mathbb{R}}^{2}}f}(x)\frac{1}{a}\overline{\psi}({r}_{-\theta}({\scriptscriptstyle \frac{x-b}{a}}))\text{\hspace{0.17em}}dx\text{\hspace{1em}}a\in {\mathbb{R}}^{+},\text{\hspace{0.05em}}\text{\hspace{0.17em}}x,b\in {\mathbb{R}}^{2}$$

where the bar denotes the complex conjugate and *r _{θ}* is
the 2-D rotation matrix

$${r}_{\theta}=\left(\begin{array}{cc}\mathrm{cos}(\theta )& -\mathrm{sin}(\theta )\\ \mathrm{sin}(\theta )& \mathrm{cos}(\theta )\end{array}\right)\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.05em}}\theta \in [0,2\pi )$$

The 2-D CWT is a space-scale representation of an image. You can view the inverse of the scale and the rotation angle taken together as a spatial-frequency variable, which gives the 2-D CWT an interpretation as a space-frequency representation. For all admissible 2-D wavelets, the 2-D CWT acts as a local filter for an image in scale and position. If the wavelet is isotropic, there is no dependence on angle in the analysis. The Mexican hat wavelet is an example of an isotropic wavelet. Isotropic wavelets are suitable for pointwise analysis of images. If the wavelet is anisotropic, there is a dependence on angle in the analysis, and the 2-D CWT acts a local filter for an image in scale, position, and angle. The Cauchy wavelet is an example of an anisotropic wavelet. In the Fourier domain, this means that the spatial frequency support of the wavelet is a convex cone with the apex at the origin. Anisotropic wavelets are suitable for detecting directional features in an image. See Two-Dimensional CWT of Noisy Pattern for an illustration of the difference between isotropic and anisotropic wavelets.

### 2-D CWT App Example

This example shows how to analyze an image using the 2-D CWT app.

Load the triangle image in the MATLAB workspace.

`imdata = imread('triangle.jpg');`

Launch the 2-D CWT app by selecting **Wavelet
Design & Analysis** in the **Signal Processing
and Communications** section of the apps gallery. From the **2-D** section,
select **Continuous Wavelet Transform 2-D**. Alternatively,
enter

cwtfttool2

at the MATLAB command prompt.

Select **File –> Import Data** to
import the `imdata`

variable.

From the `Wavelet`

drop down
menu, select the **cauchy** wavelet.

For the **Angles** and **Scales**,
select the **Manual** option.

Click **Define** to specify a vector
of angles. Select **Manual** from the `Type`

drop-down
list and specify a vector of angles from 0 to `7*pi/8`

radians
in increments of `pi/8`

radians, `0:pi/8:(7*pi)/8`

.
Click **Apply** to apply your choice of angles.

Click **Define** to specify a vector
of scales from 0.5 to 4 in increments of 0.5. Select **Linear** from
the `Type`

drop-down list. Set **First
Scale** equal to 0.5, **Gap between two scales** equal
to 0.5, and **Number of Scales** equal to 8. Equivalently,
you can select **Manual** from the `Type`

drop-down
list and specify the vector of scales as `0.5:0.5:4`

.
Click **Apply** to apply your choice of scales.

Click **Analyze** to obtain the 2-D CWT.

Set the `Index of Scale`

to be
1 and click **More on Angles**. Click **Movie** to
step through the manually-defined angles for the 2-D CWT coefficients
at scale 0.5.

Select **File –> Export Data –>
Export CWTFT Struct to Workspace** to export the analysis
to the MATLAB workspace. You can find an explanation of the structure
fields in the function reference for `cwtft2`

.