ual man v1

17

Upload: others

Post on 15-Feb-2022

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ual Man v1

ShearLab 3D

Manualv1.0August the 29th, 2013

Page 2: ual Man v1

Contents1 Introdu tion 22 Shearlets - A Brief Overview 22.1 Continuous Shearlet System . . . . . . . . . . . . . . . . . . . . . . . . . . 32.2 Cone-Adapted Shearlet System . . . . . . . . . . . . . . . . . . . . . . . . 32.3 Dis rete Shearlet Transform . . . . . . . . . . . . . . . . . . . . . . . . . . 42.4 Frame Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52.5 Sparse Approximation sing Shearlets . . . . . . . . . . . . . . . . . . . . . 52.6 Referen es . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 Digital Shearlet Transform 63.1 2D Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63.2 3D Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73.3 Inverse Digital Shearlet Transform . . . . . . . . . . . . . . . . . . . . . . 84 ShearLab 3D 84.1 Implementation of the Digital Shearlet Transform . . . . . . . . . . . . . . 84.2 How to Use ShearLab 3D . . . . . . . . . . . . . . . . . . . . . . . . . . . 104.2.1 Compute a Shearlet De omposition . . . . . . . . . . . . . . . . . . 104.2.2 Serial De omposition for Large Data . . . . . . . . . . . . . . . . . 114.2.3 Compute the Re onstru tion . . . . . . . . . . . . . . . . . . . . . 124.2.4 Serial Re onstru tion for Large Data . . . . . . . . . . . . . . . . . 135 Examples 135.1 Image Denoising . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135.2 Video Denoising . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

1

Page 3: ual Man v1

Figure 1: Anisotropi ally s aled and sheared atoms e� iently over urve-like singulari-ties.1 Introdu tionShearLab 3D is a MATLAB Library, developed for pro essing two- and three-dimensionalsignals using a ertain lass of basis fun tions named shearlets. These fun tions were �rstdes ribed in 2005 by Labate, Lim, Kutnyiok and Weiss [10℄ with the goal of onstru tingsystems of basis-fun tions ni ely suited for representing anisotropi features (e.g. urvi-linear singularities) that often are present in multivariate data.This manual aims to give a short overview of the usage of ShearLab 3D and the on eptsbehind it. Se tion 2 provides a brief introdu tion to the general theory of shearlets, while hapter 3 is devoted to the dis rete nonseparable shearlet transform (DNST), the mainalgorithm used in ShearLab 3D. Finally, hapters 4 and 5 explain the �ner implementa-tional details and ontain a few sample s ripts.2 Shearlets - A Brief OverviewIt is a well established fa t that wavelets provide optimally sparse representations for 1-Dfun tions that are smooth away from point singularities. In higher dimensions, however,this optimality an not be retained, as wavelets, due to their isotropi nature, are notideally suited for overing anisotropi features su h as urve-like singularities (see �gure1).Shearlets have been onstru ted with the aim of improving on this short oming by ap-plying anisotropi s aling to the generating fun tion (i.e. di�erent dimensions an havedi�erent s aling fa tors). Naturally, introdu ing dire tional sele tivity to a system ofrepresenting fun tions demands the apability of varying the dire tion. In the theoryof shearlets, this is a hieved by applying a so- alled shearing operator along with the(anisotropi ) s aling operator. In short, shearlets are very similar to wavelets in thesense that both are onstru ted from generating fun tions that an be modi�ed with a2

Page 4: ual Man v1

50 100 150 200 250 300 350 400 450 500

50

100

150

200

250

300

350

400

450

500

50 100 150 200 250 300 350 400 450 500

50

100

150

200

250

300

350

400

450

500

50 100 150 200 250 300 350 400 450 500

50

100

150

200

250

300

350

400

450

500

50 100 150 200 250 300 350 400 450 500

50

100

150

200

250

300

350

400

450

500

50 100 150 200 250 300 350 400 450 500

50

100

150

200

250

300

350

400

450

500

50 100 150 200 250 300 350 400 450 500

50

100

150

200

250

300

350

400

450

500Figure 2: A square is (paraboli ally) s aled twi e and sheared three times. ertain operator. But while for wavelets, only isotropi s aling is possible, shearlets aresubje t to both anisotropi s aling and shearing (see �gure 2).2.1 Continuous Shearlet SystemLetAa =

(

a 0

0 a1/2

)

, Ss =

(

1 s0 1

) (1)be a (paraboli ) s aling matrix and a shearing matrix with a > 0, then, assuming theexisten e of a generating fun tion ψ ∈ L2(R2), a two-dimensional ontinuous shearletsystem

SHcont(ψ) = {ψa,s,t = a3/4ψ(A−1a S−1

s (· − t)) | a > 0, s ∈ R, t ∈ R2}, (2)and the asso iated shearlet transform

f 7→ SHψf(a, s, t) = 〈f, ψa,s,t〉 (3)with f ∈ L2(R2) and (a, s, t) ∈ R>0 × R × R2 an be de�ned. So SHψ maps a fun tionf ∈ L2(R

2) to a set of oe� ients where ea h oe� ient is indexed by a s aling parametera, a shearing parameter s and a translation parameter t.2.2 Cone-Adapted Shearlet SystemOne look at �gure 2 reveals a signi� ant problem of the shearlet system just introdu ed.In order to apture horizontally aligned anisotropi stru tures, one would have to ap-ply the shearlet matrix a great number of times (leading to shearlets that are almost3

Page 5: ual Man v1

50 100 150 200 250 300 350 400 450 500

50

100

150

200

250

300

350

400

450

500

210 220 230 240 250 260 270 280 290 300

210

220

230

240

250

260

270

280

290

300Figure 3: The leftmost image shows the tiling of the frequen y-domain used in the one-adapted shearlet systems. The pi ture in the enter shows the magnitude response of ashearlet within the horizontal ones of the frequen y domain while the image to the rightshows the same shearlet in the time-domain.horizontally aligned but also very alongated). To avoid this issue, whi h would be verydi� ult to handle in any digital implementation, the so- alled one-adapted ontinuousshearlet system was introdu ed. Here, the Fourier-domain is partitioned into four ones(two horizontal, two verti al) and a square-shaped low-pass region (see �gure 3). Thehorizontal and verti al ones are now asso iated with their own generating fun tions ψ, ψand additionally, we introdu e a s aling fun tion φ, overing the low-pass region.LetAa =

(

a1/2 00 a

) (4)be another s aling matrix, shearlet generators ψ, ψ ∈ L2(R2) and a s aling fun tion

φ ∈ L2(R2) be given. The one-adapted ontinuous shearlet system SHcont(φ,ψ, ψ) isthen given by the union of the following sets:

Φ ={

φt = φ(· − t) : t ∈ R2}

Ψ ={

ψa,s,t = a−3

4ψ(A−1a S−1

s (· − t)) : a ∈ (0, 1], |s| ≤ 1 + a1/2, t ∈ R2}

Ψ ={

ψa,s,t = a−3

4 ψ(A−1a S−T

s (· − t)) : a ∈ (0, 1], |s| ≤ 1 + a1/2, t ∈ R2}

.The respe tive transform an be de�ned analogous to (3).2.3 Dis rete Shearlet TransformA dis rete one-adapted shearlet system an now be de�ned as a ountable subset of the ontinuous one-adapted shearlet system.Let φ ∈ L2(R2) be a s aling fun tion, ψ, ψ ∈ L2(R

2) be shearlet generators and c =(c1, c2) ∈ R2

>0 be sampling onstants then the regular one-adapted dis rete shearlet4

Page 6: ual Man v1

system SH(φ,ψ, ψ, c) is de�ned by the union of the following sets:Φ =

{

φm = φ(· − c1m) : m ∈ Z2}

,

Ψ ={

ψj,k,m = 23

4jψ(SkA2j · −Mcm) : j ≥ 0 |k| ≤ ⌈2j/2⌉,m ∈ Z

2}

,

Ψ ={

ψj,k,m = 23

4jψ(STk A2j · −Mcm) : j ≥ 0 |k| ≤ ⌈2j/2⌉,m ∈ Z

2}with A2j = diag(2j , (2j)1/2),A2j = diag((2j)1/2, 2j),Mc = diag(c1, c2) and Mc = diag(c2, c1).Note that the set Φ is asso iated with the low-frequen y region, the Ψ with the horizontal ones and Ψ with the verti al ones. Also note that this de�nition an be extended to

α-shearlets (these shearlets are not restri ted to paraboli s aling and use fa tors 2αjinstead of 2j), introdu ed by Grohs, Keiper, Kutyniok and S haefer in 2013 [3℄, whi h an also be used in ShearLab 3D.A shearlet transform an again be de�ned analogues to (3).2.4 Frame PropertyA set of fun tions Ψ ⊂ L2(R2) ful�llingA‖f‖2 ≤

ψ∈Ψ

|〈f, ψ〉|2 ≤ B‖f‖2 (5)with ertain onstants A,B > 0 (independent of f ) for all f ∈ L2(R2) is said to be a frameof L2(R

2). If A = B, Ψ is alled a tight frame whereas a tight frame with A = B = 1is alled a Parseval frame. Note that every orthonormal basis of L2(R2) is ne essarily aParseval frame and that the notion of a frame an be onsidered a generalization of the on ept of orthonormal basis for redundant systems.It has been shown in [4℄ that one an �nd band-limited shearlet generators ψ, ψ and ashearlet s aling fun tion φ su h that the dis rete one-adapted shearlet system de�nesa Parseval frame of L2(R

2). Also, it has been shown in [5℄ that there exist ompa tlysupported shearlet generators ψ, ψ su h that the dis rete one-adapted shearlet systemforms a frame in L2(R2). Whether there also exists a tight frame onstru ted from om-pa tly supportet shearlets is still an open question.2.5 Sparse Approximation sing ShearletsIn the spirit of orthonormal bases, ea h frame Ψ in L2(R

2) is asso iated with the frameoperatorS : L2(R

2) → L2(R2) : f 7→

ψ∈Ψ

〈f, ψ〉ψ. (6)whi h is positive, self-adjoint and invertible.5

Page 7: ual Man v1

Clearly, any f ∈ L2(R2) an now be written as

f =∑

ψ∈Ψ

〈f, ψ〉S−1ψ (7)where S−1 is the dual frame operator and the sequen e (S−1ψ)ψ∈Ψ is alled the anoni aldual frame.Now, one an de�ne the best n-term approximation of f ∈ L2(R2) to be

fn =∑

i∈I

〈f, ψi〉S−1ψi (8)where I is the index-set asso iated with the n largest shearlet oe� ients 〈f, ψi〉 and (of ourse, |I| = n).It was shown in [9℄ that there exist ompa tly supported shearlet generators ψ, ψ anda shearlet s aling fun tion φ su h that the best n-term approximation of fun tions f inthe lass of artoon like images (a subset of L2(R2) de�ned by fun tions of the form

f = f0 + f1χB where f0, f1 ∈ C2(R2) and δB is a losed C2 urve) obeys‖f − fn‖2 = O(n−2(log n)3) (9)whi h is (besides the log fa tor) the optimal de ay rate a hievable. This also gives amathemati al justi� ation of the superiority of shearlet systems over wavelet or Fourierbases whi h annot guarantee optimal de ay rates (see [9℄).2.6 Referen esFor a extensive introdu tion to the theory of shearlets, see the book published by GittaKutyniok and Demetrio Labate in 2012 [6℄ and the arti les referen ed at the and of thismanual.3 Digital Shearlet TransformShearLab 3D implements a one (in the 3D ase: pyramid) adapted dis rete shearletsystem based on ompa tly supported shearlets (see [8℄). The spe i� algorithm waspublished in 2013 by Wang-Q Lim [11℄ and will be qui kly summarized here.3.1 2D DataThe goal of the algorithm is to ompute shearlet oe� ients

〈ψ2Dj,k,m, f〉 (10)where ψ2D

j,k,m is a two-dimensional digital shearlet from the one-adapted dis rete shearletsystem indexed by a s ale paramter j, a shearing paramter k and a translation parameter6

Page 8: ual Man v1

m and f ∈ ℓ2(Z2).We use a nonseparable shearlet generator

ψ(ξ) = P (ξ1/2, ξ2)ψ1 ⊗ φ1(ξ) (11)where P is a 2D dire tional �lter, φ1 is a 1D s aling fun tion and ψ1 is the waveletfun tion of the orresponding multiresolution analysis.Be ause ofψj,k,m(·) = ψj,0,m(Sk/2j/2 ·), (12)we need two ingredients for the digitization of shearlets ψj,k,m: Digitial shearlet �lters

ψ2Dj,0 and a digital shear operator Sd

k/2j/2.Let J ∈ N be highest s ale to be onsidered (i.e. j < J for all shearlets ψj,k,m), then thedigital shearlet �lter ψ2D

j,0 is given by:ψ2Dj,0 = pj ∗

(

gJ−j ⊗ hJ−j/2) (13)where pj are the Fourier oe� ients of P (2J−j−1ξ1, 2

J−j/2ξ2), hJ−j is a low-pass �lterasso iated with the s aling fun tion φ1 and gJ−j is the orresponding high-pass �lter,asso iated with the wavelet fun tion ψ1.Furthermore, we de�ne the digital shear operator Sdk/2j/2

to beSdk/2j/2

(x) =((

x↑2j/2 ∗1 hj/2)

(Sk·) ∗1 hj/2)

↓2j/2(14)with x ∈ ℓ2(Z2) and the digital shearlet �lter

ψ2Dj,k = Sd

k/2j/2ψ2Dj,0 . (15)The 2D digital shearlet transform for a signal f ∈ ℓ2(Z2) is now given by:

DST 2Dj,k,m(f) = (ψ2D

j,k ∗ f)(m) (16)for j ∈ {0, J − 1} and |k| <⌈

2j(α−1)/2⌉.3.2 3D DataEa h 3D digital shearlet �lter an be onstru ted by ombining two 2D digital shearlet�lters in the frequen y domain:

ψ3Dj,k (ξ) = ψ2D

j,k1(ξ1, ξ2)ψ2Dj,k2(ξ1, ξ3) (17)The 3D digital shearlet transform for a signal f ∈ ℓ2(Z3) is thus given by:

DST 3Dj,k,m(f) = (ψ3D

j,k ∗ f)(m) (18)where j ∈ {0, J − 1} and |k| <⌈

2j(α−1)/2⌉. 7

Page 9: ual Man v1

50 100 150 200 250 300 350 400 450 500

50

100

150

200

250

300

350

400

450

500

50 100 150 200 250 300 350 400 450 500

50

100

150

200

250

300

350

400

450

500

50 100 150 200 250 300 350 400 450 500

50

100

150

200

250

300

350

400

450

500Figure 4: Magnitude responses in the frequen y domain of the separable shearlet gener-ator gJ ⊗ hJ (left), the 2D fan �lter P (middle) and the nonseparable shearlet generatorψ2D0,0 with J = 4.3.3 Inverse Digital Shearlet TransformThe dual digital shearlet �lters ψ2D

j,k and ψ3Dj,k are given by:

ˆψ2Dj,k

(ξ) =ψ2Dj,k

(ξ)

j,k

∣ψ2Dj,k

2 ,ˆψ3Dj,k

(ξ) =ψ3Dj,k

(ξ)

j,k

∣ψ3Dj,k

2 . (19)4 ShearLab 3D4.1 Implementation of the Digital Shearlet TransformShearLab3D provides an implementation of the digital transform summarized in hapter3. Hen e, it an be used to ompute the digital shearlet transform of arbitrarily sizedtwo- and three dimensional signals a ording to formulas (16), (18) as well as the inverseshearlet transform (19).Applying the onvolution theorem, formulas (16), (18) and (19) an be omputed bymultiplying onjugated digital shearlet �lters ψ2Dj,k , their duals ψ2D

j,k and the given signalfJ in the frequen y domain. This means that both the de omposition and the re on-stru tion algorithm redu e to multiple omputations of the fast fourier transform. Thus,their omplexity is given by O (R ·N log(N)), where R ∈ N is the redundan y of thespe i� digital shearlet system (i.e. the number of �lters ψ2D

j,k ).Following equation (13), the onstru tion of a 2D digital shearlet �lter ψ2Dj,k , requieresa 1D lowpass �lter h1 and a 2D dire tional �lter P . The 1D �lter h1 de�nes a waveletmultiresolution analysis (and thereby the highpass �lter g1) whereas the trigonometri polynomial P will be used to ensure the wedge shape of the essential frequen y support of

ψ2Dj,k depi ted in �gure 3.1. Please note that the proper hoi e of these �lters is essentialfor generating an optimal digital shearlet system as it will in�uen e important propertieslike frame bounds and dire tional sele tivity.

8

Page 10: ual Man v1

Our hoi e for h1, from now on denoted by hShearLab1 (see �gure 5), is a maximally �at (i.e.a maximum number of derivatives of the magnitude frequen y response at 0 and π van-ish) and symmetri 9-tap lowpass �lter that is normalized su h that ∑n hShearLab(n) = 1.It has two vanishing moments (i.e. ∫

φ(x)xk = 0 for k ∈ {0, 1}) and while there is nosymmetri , ompa tly supported and orthogonal wavelet besides the Haar wavelet, therenormalized �lter √2hShearLab at least approximately ful�ls the orthonormality ondi-tion, that is

2∑

n

hShearLab(n)hShearLab(n+ 2l)− δl0

≤ 0.0018for all ∈ Z with δ denoting Krone ker's delta. By hoosing hShearLab to be maximally�at, the amount of ripple in the digital �lter ψ2Dj,k is signi� antly redu ed. This leads toa better lo aliziation of the shearlets in the frequen y domain. The highpass �lter g1,hereafter denoted by gShearLab, is of ourse hosen to be the asso iated mirror �lter, thatis

gShearLab(n) = (−1)n · hShearLab(n).Please note that the �lter oe� ients hShearLab are quite similar to those of the Cohen-Daube hies-Feauveau 9/7 wavelet [1℄, famously used in the JPEG 2000 standard. Whilethe CDF 9/7 wavelet has four vanishing moments and higher degrees of regularity bothin the Hölder and Sobolev sense, trading these advantageous properties for maximal �at-nass seems to be the optimal hoi e for most appli ations.For the trigonometri polynomial PShearLab2 (see �gure 5), we use the maximally �at 2Dfan �lter des ribed in [2℄.1 2 3 4 5 6 7 8 9

−0.1

0

0.1

0.2

0.3

0.4

0.5

0.6

1 2 3 4 5 6 7 8 90

0.2

0.4

0.6

0.8

1

(a) (b) ( )Figure 5: (a) The oe� ients of the 1D lowpass �lter hShearLab. (b) Magnitude frequen yresponse of hShearLab. ( ) Magnitude response of the 2D fan �lter PShearLab.In the original de�nition of the one-adapted dis rete shearlet system [7, p. 26℄, theparaboli s aling matrix was de�ned as A2j = diag(2j , 2j/2) and the shearing parameter1The 9-tap �lter hShearLab an be generated in MATLAB withdesign(fdesign.lowpass('N,F3dB',8,0.5),'maxflat');. The approximate values are hShearLab =(0.01049,−0.02635,−0.05178, 0.27635, 0.58257, ...).2The 2D fan �lter PShearLab an be obtained in MATLAB using the Nonsubsampled ContourletToolbox by the statement fftshift(fft2(modulate2(dfilters('dmaxflat4','d')./sqrt(2),' ')));9

Page 11: ual Man v1

k ∈ Z ranged from −⌈2j/2⌉ to ⌈2j/2⌉ in ea h one for ea h s ale j ∈ N. However, thisde�nition was generalized in [3℄ using a fa tor α ∈ (1,∞) su h that A2j = diag(2j , 2αj/2)and |k| ≤ ⌈2(α−1)j/2⌉ in ea h one and for ea h s ale j ∈ N. ShearLab 3D supports thisgeneralization by allowing the user to spe ify the exa t number of shearings (in powersof 2) o uring on ea h s ale of a shearlet system3. Note that an in reased number ofdi�erently oriented shearlets on a ertain s ale e�e tively leads to a �ner partitioning ofthe frequen y domain (see �gure 6).(a) (b) ( ) (d)Figure 6: Plots (a) and (b) show the magnitude frequen y response of a shearlet in thehorizontal frequen y ones on the third s ale of a four-s ale system. Ea h shearlet wassheared on e but the system in (a) ontains only �ve di�erently oriented shearlets in thehorizontal ones, while the system in (b) has nine di�erently sheared horizontal shearlets.The magnitude frequen y response of the maximally sheared shearlet in the verti al ones (d) is almost equal to the response of the orresponding shearlet in the horizontal ones ( ). In most ases, the digital shearlet �lter (d) an be omitted to de rease theredundan y of a shearlet system.4.2 How to Use ShearLab 3DIn order to use ShearLab 3D, just download the pa kge from www.shearlab.org and addanything in it to your MATLAB path.Please note that ShearLab 3D requires the Signal Pro essing Toolbox and the ImagePro essing Toolbox. If additionally the Parallel Computing Toolbox is available, CUDA- ompatibale NVidia graphi s ards an be used to gain a signi� ant speed up.4.2.1 Compute a Shearlet De ompositionIn order to ompute the shearlet de omposition of arbitrariliy sized two- or three-dimensionaldata, you just have to onstru t a shearlet system and then all the SLshearde method:3e.g.: For a three-s ale 2D shearlet system, the ve tor shearLevels = [0 1 1℄ means that 20 =

1 shearings o ur in both dire tions in both ones on the �rst s ale and 21 = 2 shearings o ur inboth dire tions in both onse on the se ond and third s ale. In luding the unsheared shearlets, this on�guration de�nes a system of 2 · ((2 · 1 + 1) + (2 · 2 + 1) + (2 · 2 + 1)) = 26 di�erent shearlets. Thedefault value of shearLevels in ShearLab 3D is eil((1:nS ales)/2);10

Page 12: ual Man v1

% 2DsizeX = 500 ;s izeY = 300 ;useGPU = 0 ;data = randn ( sizeX , s izeY ) ;system = SLgetShearletSystem2D (useGPU , sizeX , sizeY , 4 ) ;s h e a r l e t C o e f f i i e n t s = SLshearde 2D ( data , system ) ;% 3DsizeX = 70 ;s izeY = 71 ;s i z eZ = 68 ;useGPU = 0 ;data = randn ( sizeX , sizeY , s i z eZ ) ;system = SLgetShearletSystem3D (useGPU , sizeX , sizeY , s izeZ , 1 ) ;s h e a r l e t C o e f f i i e n t s = SLshearde 3D ( data , system ) ;The array shearletCoe� ients is three dimensional in the 2D and four dimensional in the3D ase. In both ases, the last dimension enumerates all shearlets within the spe i�edsystem with di�erent shearing parameters k and s aling parameters j while the �rst twoor three dimensions are asso iated with the translates of one single shearlet (see �gure8).50 100 150 200 250 300 350 400 450 500

50

100

150

200

250

300

350

400

450

500

50 100 150 200 250 300 350 400 450 500

50

100

150

200

250

300

350

400

450

500

50 100 150 200 250 300 350 400 450 500

50

100

150

200

250

300

350

400

450

500Figure 7: The two images to the right show all shearlet oe� ients of the translates oftwo di�erent shearlets. The used system has four s ales, a redundan y of 49 and wasspe i�ed with shearLevels = [1, 1, 2, 2]. The shearlet orresponding to the oe� ients inthe entered pi ture has a s ale parameter j = 1 a shearing parameter k = 2 and lives onthe horizontal frequen y ones. The shearlet orresponding to the oe� ients plotted inthe rightmost image has a s ale parameter j = 2, a shearing parameter k = 0 and liveson the verti al frequen y ones.4.2.2 Serial De omposition for Large DataSometimes, espe ially in the three-dimensional ase, the data to be analysed is so largethat it's impossible to keep all shearlet oe� ients in memory at the same time. In this11

Page 13: ual Man v1

ase, it is also possible to ompute the shearlet de omposition in a serialized manner.Then, only the oe� ients asso iated to the translates of one single shearlet are availableat one point in time.% 2DsizeX = 1024;s izeY = 1024;data = randn ( sizeX , s izeY ) ;% prepare s e r i a l p r o e s s i ng[ Xfreq , Xre , p r epa r edF i l t e r s , dualFrameWeightsCurr , s h e a r l e t I d x s ℄ = . . .SLprepareSer ia l2D (useGPU , data , 4 ) ;f o r j = 1 : s i z e ( sh ea r l e t I dx s , 1 )sh ea r l e t I dx = sh e a r l e t I d x s ( j , : ) ;%s h e a r l e t de omposit ion[ o e f f i i e n t s , s h ea r l e t , dualFrameWeightsCurr ,RMS℄ = . . .SLshearde Ser ia l2D (Xfreq , s h ea r l e t I dx , p r epa r edF i l t e r s , dualFrameWeightsCurr ) ;% add p ro e s s i ng hereend% 3DsizeX = 192 ;s izeY = 192 ;s i z eZ = 192 ;data = randn ( sizeX , sizeY , s i z eZ ) ;% prepare s e r i a l p r o e s s i ng[ Xfreq , Xre , p r epa r edF i l t e r s , dualFrameWeightsCurr , s h e a r l e t I d x s ℄ = . . .SLprepareSer ia l3D (useGPU , data , 2 ) ;f o r j = 1 : s i z e ( sh ea r l e t I dx s , 1 )sh ea r l e t I dx = sh e a r l e t I d x s ( j , : ) ;%s h e a r l e t de omposit ion[ o e f f i i e n t s , s h ea r l e t , dualFrameWeightsCurr ,RMS℄ = . . .SLshearde Ser ia l3D (Xfreq , s h ea r l e t I dx , p r epa r edF i l t e r s , dualFrameWeightsCurr ) ;% add p ro e s s i ng hereend4.2.3 Compute the Re onstru tionIf shearlet oe� ients and the orresponding system are present, it is possible to omputea re onstru tion. This an be done by simply alling the SLshearre method.% 2Dre on s t ru t i on = SLshearre 2D ( o e f f i i e n t s , system ) ;% 3Dre on s t ru t i on = SLshearre 3D ( o e f f i i e n t s , system ) ;12

Page 14: ual Man v1

4.2.4 Serial Re onstru tion for Large DataOf ourse, data an also be onstru ted from the shearlet oe� ients during serial pro- essing.% 2Df o r j = 1 : s i z e ( sh ea r l e t I dx s , 1 )sh ea r l e t I dx = sh e a r l e t I d x s ( j , : ) ;%s h e a r l e t de omposit ion[ o e f f i i e n t s , s h ea r l e t , dualFrameWeightsCurr ,RMS℄ = . . .SLshearde Ser ia l2D (Xfreq , s h ea r l e t I dx , p r epa r edF i l t e r s , dualFrameWeightsCurr ) ;% add p ro e s s i ng hereXre = SLshear r e Se r i a l 2D ( o e f f i i e n t s , s h ea r l e t , Xre ) ;endr e on s t ru t i on = SL f i n i s hSe r i a l 2D (Xre , dualFrameWeightsCurr ) ;% 3Df o r j = 1 : s i z e ( sh ea r l e t I dx s , 1 )sh ea r l e t I dx = sh e a r l e t I d x s ( j , : ) ;%s h e a r l e t de omposit ion[ o e f f i i e n t s , s h ea r l e t , dualFrameWeightsCurr ,RMS℄ = . . .SLshearde Ser ia l3D (Xfreq , s h ea r l e t I dx , p r epa r edF i l t e r s , dualFrameWeightsCurr ) ;% add p ro e s s i ng hereXre = SLshear r e Se r i a l 3D ( o e f f i i e n t s , s h ea r l e t , Xre ) ;endr e on s t ru t i on = SL f i n i s hSe r i a l 3D (Xre , dualFrameWeightsCurr ) ;5 Examples5.1 Image DenoisingThe following ode shows how an image distorted with Gaussian white noise an bedenoised using the digital shearlet transform and hard thresholding.%%se t t i n g ssigma = 30 ;s a l e s = 4 ;th r e sho l d i ngFa t o r s = [ 0 3 3 4 4 ℄ ;%%load dataX = double ( imread ( ' barbara . jpg ' ) ) ;%%add no i s eXnoisy = X + sigma∗ randn ( s i z e (X) ) ;%% r ea t e s h e a r l e t sshear l e tSys tem = SLgetShearletSystem2D (0 , s i z e (X, 1 ) , s i z e (X, 2 ) , s a l e s ) ;%%de omposit ion o e f f s = SLshearde 2D( Xnoisy , shear l e tSys tem ) ;13

Page 15: ual Man v1

%%thr e sho l d i ngf o r j = 1 : shear l e tSys tem . nShea r l e t ssh ea r l e t I dx = shear l e tSys tem . s h e a r l e t I d x s ( j , : ) ; o e f f s ( : , : , j ) = o e f f s ( : , : , j ) . ∗ ( abs ( o e f f s ( : , : , j ) ) > . . .t h r e sho l d i ngFa t o r s ( sh ea r l e t I dx (2)+1)∗ shear l e tSys tem .RMS( j )∗ sigma ) ;end%%re on s t r s u t i o nXre = SLshearre 2D ( o e f f s , shear l e tSys tem ) ;%% ompute psnrPSNR = SL omputePSNR(X, Xre ) ;Figure 8: Image denoising using ShearLab 3D. The grays ale image (values ranging from0 to 255) was distorted with Gaussian white noise with σ = 30 and denoised using hardtresholding on the shearlet oe� ients.5.2 Video DenoisingThe following ode shows how a video distorted with Gaussian white noise an be denoisedusing the digital shearlet transform and hard thresholding.%%se t t i n g ssigma = 30 ;s a l e s = 3 ;shearLeve l s = [ 0 0 1 ℄ ;t h r e sho l d i ngFa t o r s = [ 3 3 3 4 ℄ ;fu l lSys t em = 0 ;useGPU = 0 ;%%load dataload ' missamer i aseq ' ;X = double (X) ;%%add no i s eXnoisy = X + sigma∗ randn ( s i z e (X) ) ;%%prepare s e r i a l p r o e s s i ng[ Xfreq , Xre , p r epa r edF i l t e r s , dualFrameWeightsCurr , s h e a r l e t I d x s ℄ = . . .SLprepareSer ia l3D (useGPU , Xnoisy , s a l e s , shearLeve l s , fu l lSys t em ) ;f o r j = 1 : s i z e ( sh ea r l e t I dx s , 1 )sh ea r l e t I dx = sh e a r l e t I d x s ( j , : ) ;

14

Page 16: ual Man v1

%%sh e a r l e t de omposit ion[ o e f f s , s h e a r l e t , dualFrameWeightsCurr ,RMS℄ = . . .SLshearde Ser ia l3D (Xfreq , s h ea r l e t I dx , p r epa r edF i l t e r s , dualFrameWeightsCurr ) ;%%put p ro e s s i ng o f s h e a r l e t o e f f i i e n t s here , f o r example :%%hard th r e sho l d i ng o e f f s = o e f f s . ∗ ( abs ( o e f f s ) > th r e sho l d i ngFa t o r s ( sh ea r l e t I dx (2)+1)∗RMS∗ sigma ) ;%%sh e a r l e t r e on s t ru t i onXre = SLshear r e Se r i a l 3D ( o e f f s , s h e a r l e t , Xre ) ;endXre = SL f i n i s hSe r i a l 3D (Xre , dualFrameWeightsCurr ) ;%% ompute psnrPSNR = SL omputePSNR(X, Xre ) ;Referen es[1℄ Albert Cohen, Ingrid Daube hies, and Jean-Christophe Feauveau. Biorthogonalbases of ompa tly supported wavelets. Communi ations on Pure and AppliedMathemati s, 45:1992, 1992.[2℄ Arthur L. da Cunha, Jianping Zhou, and Minh N. Do. The nonsubsampled on-tourlet transform: Theory, design and appli ations. IEEE Trans. Image Pro .,15:3089�3101, 2006.[3℄ Phlipp Grohs, Sandra Keiper, Gitta Kutyniok, and Martin S häfer. Alpha mole ules.preprint, 2013.[4℄ Kanghui Guo, Gitta Kutyniok, and Demetrio Labate. Sparse multidimensional rep-resentations using anistropi dilation and shear oper. Wavelets and Splines (Athens,GA, 2005), pages 189�201, 2006.[5℄ Pisamai Kittipoom, Gitta Kutyniok, and Wang-Q Lim. Constru tion of ompa tlysupported shearlet frames. Constr. Approx., 35:21�72, 2012.[6℄ Gitta Kutyniok and Demetrio Labate, editors. Shearlets Multis ale Analysis forMultivariate Data. Birkhäuser Boston, 2012.[7℄ Gitta Kutyniok and Demetrio Labate. Shearlets: Multis ale Analysis forMultivariate Data, hapter Introdu tion to Shearlets, pages 1�38. Birkhäuser Boston,2012.[8℄ Gitta Kutyniok, Jakob Lemvig, and Wang-Q Lim. Optimally sparse approximationsof 3d fun tions by ompa tly supported shearlet frames. SIAM J. Math. Anal.,44:2962�3017, 2012.[9℄ Gitta Kutyniok and Wang-Q Lim. Compa tly supported shearlets are optimallysparse. J. Approx. Theory, 163:1564�1589, 2011.15

Page 17: ual Man v1

[10℄ Demetrio Labate, Wang-Q Lim, Gitta Kutyniok, and Guido Weiss. Sparse mul-tidimensional representation using shearlets. In SPIE Pro ., volume 5914, pages254�262, 2005.[11℄ Wang-Q Lim. Nonseparable shearlet transform. IEEE Trans. Image Pro ., 2013. toappear.

16