GigaNumericsin Deep Structure Analysis of...

44
GigaNumerics in Deep Structure Analysis of Images Employing MathLink and the Parallel Computing Toolkit Bart Janssen Luc Florack and Bart ter Haar Romeny

Transcript of GigaNumericsin Deep Structure Analysis of...

Page 1: GigaNumericsin Deep Structure Analysis of Imageslibrary.wolfram.com/infocenter/Conferences/5818/WTC-Deep... · GigaNumericsin Deep Structure Analysis of Images Employing MathLinkand

GigaNumerics

in Deep Structure

Analysis of Im

ages

Employing M

athLinkan

d the Parallel C

omputing Toolkit

Bart Janssen

LucFlorackand Bart ter Haar Rom

eny

Page 2: GigaNumericsin Deep Structure Analysis of Imageslibrary.wolfram.com/infocenter/Conferences/5818/WTC-Deep... · GigaNumericsin Deep Structure Analysis of Images Employing MathLinkand

2

•Scale

Space

•Toppoints

•Im

age Rec

onstru

ction

•M

athem

atica Im

plemen

tation

•Scale

Space

•Toppoints

•Im

age Rec

onstru

ction

•M

athem

atica Im

plemen

tation

Outline

Page 3: GigaNumericsin Deep Structure Analysis of Imageslibrary.wolfram.com/infocenter/Conferences/5818/WTC-Deep... · GigaNumericsin Deep Structure Analysis of Images Employing MathLinkand

3

The problem of scale:

Objects live at different scales

Gala looking into the Mediterranean Sea

Salvador Dali

Page 4: GigaNumericsin Deep Structure Analysis of Imageslibrary.wolfram.com/infocenter/Conferences/5818/WTC-Deep... · GigaNumericsin Deep Structure Analysis of Images Employing MathLinkand

4

The problem of scale:

Objects live at different scales

Solution?

Look at all scales

simultaneously

Gala looking into the Mediterranean Sea

Salvador Dali

Page 5: GigaNumericsin Deep Structure Analysis of Imageslibrary.wolfram.com/infocenter/Conferences/5818/WTC-Deep... · GigaNumericsin Deep Structure Analysis of Images Employing MathLinkand

5

Sca

le Space

in Human Vision

•The human

visual system is

a multi-scale sampling device

•The retina co

ntains receptive

fields

of va

rying size.

Page 6: GigaNumericsin Deep Structure Analysis of Imageslibrary.wolfram.com/infocenter/Conferences/5818/WTC-Deep... · GigaNumericsin Deep Structure Analysis of Images Employing MathLinkand

6

Sca

le for Calculating Deriva

tive

s•To calcu

late derivatives w

e nee

d smooth

(continuous) data.

•Im

age data is not sm

ooth.

Pixel data

1stOrd

er D

erivative

Intensity

0

Page 7: GigaNumericsin Deep Structure Analysis of Imageslibrary.wolfram.com/infocenter/Conferences/5818/WTC-Deep... · GigaNumericsin Deep Structure Analysis of Images Employing MathLinkand

7

•At the original

scale of a

dithered

imag

e we cannot

calculate a

derivative.

•W

e nee

d to

observe the

imag

e at a certain

scale.

BLUR

Page 8: GigaNumericsin Deep Structure Analysis of Imageslibrary.wolfram.com/infocenter/Conferences/5818/WTC-Deep... · GigaNumericsin Deep Structure Analysis of Images Employing MathLinkand

8

Practical Implementation

•Scale-Space Axioms

–Linea

rity

–Spatial sh

ift inva

rian

ce

–Isotropy

–Cau

sality

–Separability

•Lea

d to the Gau

ssian K

ernel

2

22 1

2/

2

2

)2(

1)

,(

σ

πσ

σ

D

D

xx

ex

G

++

=

K

Page 9: GigaNumericsin Deep Structure Analysis of Imageslibrary.wolfram.com/infocenter/Conferences/5818/WTC-Deep... · GigaNumericsin Deep Structure Analysis of Images Employing MathLinkand

9

Calculating Deriva

tive

s with Gauss

ians

•The derivative of the data at a scale σ

is

defined

as

•Due to nice properties of the Gau

ssian this

can be rewritten

as

)};

()

({

01

σx

Gx

Lx

⊗∂∂

);

()

(1

xG

xL

x∂∂

Page 10: GigaNumericsin Deep Structure Analysis of Imageslibrary.wolfram.com/infocenter/Conferences/5818/WTC-Deep... · GigaNumericsin Deep Structure Analysis of Images Employing MathLinkand

10

Calculating Deriva

tive

s of Im

ages

•Differentiationbec

omes

Integration!

...ListConvolve/ FFT-method

(Lap

lacian

)

Page 11: GigaNumericsin Deep Structure Analysis of Imageslibrary.wolfram.com/infocenter/Conferences/5818/WTC-Deep... · GigaNumericsin Deep Structure Analysis of Images Employing MathLinkand

11

Gauss

ian Sca

le Space

s

x

y

Page 12: GigaNumericsin Deep Structure Analysis of Imageslibrary.wolfram.com/infocenter/Conferences/5818/WTC-Deep... · GigaNumericsin Deep Structure Analysis of Images Employing MathLinkand

12

•Scale

Space

•Toppoints

•Im

age Rec

onstru

ction

•M

athem

atica Im

plemen

tation

•Scale

Space

•Toppoints

•Im

age Rec

onstru

ction

•M

athem

atica Im

plemen

tation

Outline

Page 13: GigaNumericsin Deep Structure Analysis of Imageslibrary.wolfram.com/infocenter/Conferences/5818/WTC-Deep... · GigaNumericsin Deep Structure Analysis of Images Employing MathLinkand

13

Singular points of a

Gaussian scale space image

Fold C

atastrophe

Page 14: GigaNumericsin Deep Structure Analysis of Imageslibrary.wolfram.com/infocenter/Conferences/5818/WTC-Deep... · GigaNumericsin Deep Structure Analysis of Images Employing MathLinkand

14

Singular points of a

Gaussian scale space image

Fold C

atastrophe

Page 15: GigaNumericsin Deep Structure Analysis of Imageslibrary.wolfram.com/infocenter/Conferences/5818/WTC-Deep... · GigaNumericsin Deep Structure Analysis of Images Employing MathLinkand

15

Stability of To

p Points

•W

e can calcu

late the

varian

ce of the

displacemen

t of top

points under noise.

•W

e nee

d 4

thord

er

derivatives in the top-

points for that.

Page 16: GigaNumericsin Deep Structure Analysis of Imageslibrary.wolfram.com/infocenter/Conferences/5818/WTC-Deep... · GigaNumericsin Deep Structure Analysis of Images Employing MathLinkand

16

Applica

tions

•Opticflow

estimation

•M

atch

ing

•Im

age Editing/ Seg

men

tation?

Page 17: GigaNumericsin Deep Structure Analysis of Imageslibrary.wolfram.com/infocenter/Conferences/5818/WTC-Deep... · GigaNumericsin Deep Structure Analysis of Images Employing MathLinkand

17

OpticFlow

Estim

ation

Page 18: GigaNumericsin Deep Structure Analysis of Imageslibrary.wolfram.com/infocenter/Conferences/5818/WTC-Deep... · GigaNumericsin Deep Structure Analysis of Images Employing MathLinkand

18

Optic Flow Estim

ation

Page 19: GigaNumericsin Deep Structure Analysis of Imageslibrary.wolfram.com/infocenter/Conferences/5818/WTC-Deep... · GigaNumericsin Deep Structure Analysis of Images Employing MathLinkand

19

Page 20: GigaNumericsin Deep Structure Analysis of Imageslibrary.wolfram.com/infocenter/Conferences/5818/WTC-Deep... · GigaNumericsin Deep Structure Analysis of Images Employing MathLinkand

20

Rotate and scale

acco

rding to the

cluster m

eans.Match

ing

Page 21: GigaNumericsin Deep Structure Analysis of Imageslibrary.wolfram.com/infocenter/Conferences/5818/WTC-Deep... · GigaNumericsin Deep Structure Analysis of Images Employing MathLinkand

21

Differential Inva

riants

•Fea

tures are

irreducible 3

rd

ord

er differential

inva

rian

ts.

•These features

are rotation and

scale inva

rian

t.

Page 22: GigaNumericsin Deep Structure Analysis of Imageslibrary.wolfram.com/infocenter/Conferences/5818/WTC-Deep... · GigaNumericsin Deep Structure Analysis of Images Employing MathLinkand

22

In this exa

mple

we hav

e tw

o

clusters of

correc

tly match

ed

points.

C1

C2

Page 23: GigaNumericsin Deep Structure Analysis of Imageslibrary.wolfram.com/infocenter/Conferences/5818/WTC-Deep... · GigaNumericsin Deep Structure Analysis of Images Employing MathLinkand

23

•Scale

Space

•Toppoints

•Im

age Rec

onstru

ction

•M

athem

atica Im

plemen

tation

•Scale

Space

•Toppoints

•Im

age Rec

onstru

ction

•M

athem

atica Im

plemen

tation

Outline

Page 24: GigaNumericsin Deep Structure Analysis of Imageslibrary.wolfram.com/infocenter/Conferences/5818/WTC-Deep... · GigaNumericsin Deep Structure Analysis of Images Employing MathLinkand

24

Image Reco

nstruction

Given

features

Selec

t from

metam

eric

class

such

that

(consisten

t features)

Page 25: GigaNumericsin Deep Structure Analysis of Imageslibrary.wolfram.com/infocenter/Conferences/5818/WTC-Deep... · GigaNumericsin Deep Structure Analysis of Images Employing MathLinkand

25

Reco

nstructionfrom

SingularPoints

Use

differential

stru

cture

in singularpoints

as fea

tures.

=

Page 26: GigaNumericsin Deep Structure Analysis of Imageslibrary.wolfram.com/infocenter/Conferences/5818/WTC-Deep... · GigaNumericsin Deep Structure Analysis of Images Employing MathLinkand

26Variational

Approac

h

Page 27: GigaNumericsin Deep Structure Analysis of Imageslibrary.wolfram.com/infocenter/Conferences/5818/WTC-Deep... · GigaNumericsin Deep Structure Analysis of Images Employing MathLinkand

27

The solutionis anA-orthogonal

projectionof onto

Gen

eralisationusinggelfandtriples (R

. Duits)

Minim

isationof

under

the co

nstraints

Page 28: GigaNumericsin Deep Structure Analysis of Imageslibrary.wolfram.com/infocenter/Conferences/5818/WTC-Deep... · GigaNumericsin Deep Structure Analysis of Images Employing MathLinkand

28

Prior and DualFilters

Page 29: GigaNumericsin Deep Structure Analysis of Imageslibrary.wolfram.com/infocenter/Conferences/5818/WTC-Deep... · GigaNumericsin Deep Structure Analysis of Images Employing MathLinkand

29

Reco

nstructionfrom

SingularPoints

This

mea

ns

Gramm

matrix:

Projection:

Page 30: GigaNumericsin Deep Structure Analysis of Imageslibrary.wolfram.com/infocenter/Conferences/5818/WTC-Deep... · GigaNumericsin Deep Structure Analysis of Images Employing MathLinkand

30

Page 31: GigaNumericsin Deep Structure Analysis of Imageslibrary.wolfram.com/infocenter/Conferences/5818/WTC-Deep... · GigaNumericsin Deep Structure Analysis of Images Employing MathLinkand

31

Page 32: GigaNumericsin Deep Structure Analysis of Imageslibrary.wolfram.com/infocenter/Conferences/5818/WTC-Deep... · GigaNumericsin Deep Structure Analysis of Images Employing MathLinkand

32

•Scale

Space

•Toppoints

•Im

age Rec

onstru

ction

•M

athem

atica Im

plemen

tation

•Conclusions

•Scale

Space

•Toppoints

•Im

age Rec

onstru

ction

•M

athem

atica Im

plemen

tation

•Conclusions

Outline

Page 33: GigaNumericsin Deep Structure Analysis of Imageslibrary.wolfram.com/infocenter/Conferences/5818/WTC-Deep... · GigaNumericsin Deep Structure Analysis of Images Employing MathLinkand

33

Basicim

plementation

•BuildGramm

Matrix

•In

versionof Gramm

Matrix

•Building and Sam

pling R

econstru

ction

Page 34: GigaNumericsin Deep Structure Analysis of Imageslibrary.wolfram.com/infocenter/Conferences/5818/WTC-Deep... · GigaNumericsin Deep Structure Analysis of Images Employing MathLinkand

34

makeGramm@kernel_,orders_,points_,8xsize_,ysize_<D

:=Module@8

Φtensor,gramm,signmx,signmy,subΦ,signs<,

subΦ@8st_,dx_,dy_<D

:=

submatrixofinnerproducts;

Φtensor=

Map@

subΦ,

Outer@Plus,points,81,−1,−1< #&ê@

points,1D,

82<

D ;

gramm=Chop@Flatten@

Map@

Flatten,

Transpose@Φtensor,82,4,1,3<D,

82<

D, 1 DD;

gramm

D

Page 35: GigaNumericsin Deep Structure Analysis of Imageslibrary.wolfram.com/infocenter/Conferences/5818/WTC-Deep... · GigaNumericsin Deep Structure Analysis of Images Employing MathLinkand

35

subΦ@8st_,dx_,dy_<D:=If@Negative@dxD,

If@Negative@dyD,

signmxsignmysubΦ@8st,

−dx,

−dy<D,

signmxsubΦ@8st,

−dx,

dy<D

D,

If@Negative@dyD,

signmysubΦ@8st,dx,

−dy<D,

subΦ@8st,dx,dy<D

=submatrixofinnerproducts;

D

D;

Dyn

amic

Programming

Page 36: GigaNumericsin Deep Structure Analysis of Imageslibrary.wolfram.com/infocenter/Conferences/5818/WTC-Deep... · GigaNumericsin Deep Structure Analysis of Images Employing MathLinkand

36Parallel Im

plementation

Φtensor

=

Map@

subΦ,

Outer@Plus,

points,

81,

−1,

−1< #&

ê@

points,

1D,

82<

D;

ExportEnvironment@GaussianDerivativeAt,xsize,ysize,

signmy,signmx,kernel,orders,subΦD;

Φtensor

=

ParallelMap@

Map@subΦ,#D&,

Outer@Plus,points,

81,

−1,

−1< #

&ê@points,1D

D;

Page 37: GigaNumericsin Deep Structure Analysis of Imageslibrary.wolfram.com/infocenter/Conferences/5818/WTC-Deep... · GigaNumericsin Deep Structure Analysis of Images Employing MathLinkand

37

Sampling the Reco

nstruction

adva

ntageof sy

mbolicpower

FourierK@gamma_,scale_,order_,8wx_,wy_<,8xi_,yi_<D:=ModuleA8<,

Exp@�Hwxxi

+wyyiLD

H−�wx

Lorder@@1DDH−

�wy

Lorder@@2DD

1

1+gamma2 Hwx2+wy2L

Exp@−scaleHwx2

+wy2 LD

1

E FourierReconstructionFunction

=

Compile@

88x,_Real<,

8y,_Real<<,

Evaluate@rfD

D;

Page 38: GigaNumericsin Deep Structure Analysis of Imageslibrary.wolfram.com/infocenter/Conferences/5818/WTC-Deep... · GigaNumericsin Deep Structure Analysis of Images Employing MathLinkand

38

Parallel Sampling

ParallelSampleReconstruction@8xsize_,ysize_<D

:=Module@8x,y,FourierimageData,image,newfeaturepoints,n,wlist<,

wlist=listoffrequencies;

ExportEnvironment@FourierReconstructionFunctionD;

FourierimageData=ParallelMap@Apply@FourierReconstructionFunction,#D&,wlist,82

<D;

image=Re@InverseFourier@FourierimageData,FourierParameters→

81,1<D

DPRange@xsizeD,

Range@ysizeDT;

image

D

Page 39: GigaNumericsin Deep Structure Analysis of Imageslibrary.wolfram.com/infocenter/Conferences/5818/WTC-Deep... · GigaNumericsin Deep Structure Analysis of Images Employing MathLinkand

39Mathem

atica Dem

o 1

Page 40: GigaNumericsin Deep Structure Analysis of Imageslibrary.wolfram.com/infocenter/Conferences/5818/WTC-Deep... · GigaNumericsin Deep Structure Analysis of Images Employing MathLinkand

40

Mathlinkforbetterperform

ance

(sometimes)

:Begin:

:Function:MLSobolevReconstruction

:Pattern:MLSobolevReconstruction[X__?(VectorQ[#1,NumberQ]&), Y__?(VectorQ[#1,NumberQ]&),...

:Arguments:{X,Y,OX,OY,T,F,gridsize,gamma}

:ArgumentTypes:{RealList,RealList,IntegerList,...

:ReturnType:Manual

:End:

#inc

lude

<m

ath.

h>...

#inc

lude

"m

athl

ink.

h"

#inc

lude

"y

our

own

stuf

f.h"

void

ML

Sobo

levR

econ

stru

ctio

n(do

uble

*X,lo

ng X

coun

t,do

uble

*Y,lo

ng Y

coun

t,...

.

{

mal

loc(

);

do

som

e co

mp

utat

ions

;

ML

Put

Rea

lLis

t(st

dlin

k,da

ta,s

ize)

;

fre

e();

}

Page 41: GigaNumericsin Deep Structure Analysis of Imageslibrary.wolfram.com/infocenter/Conferences/5818/WTC-Deep... · GigaNumericsin Deep Structure Analysis of Images Employing MathLinkand

41Mathem

atica Dem

o 2

Page 42: GigaNumericsin Deep Structure Analysis of Imageslibrary.wolfram.com/infocenter/Conferences/5818/WTC-Deep... · GigaNumericsin Deep Structure Analysis of Images Employing MathLinkand

42

(State of the)Art

Page 43: GigaNumericsin Deep Structure Analysis of Imageslibrary.wolfram.com/infocenter/Conferences/5818/WTC-Deep... · GigaNumericsin Deep Structure Analysis of Images Employing MathLinkand

43

Questions?

Topological A

bduction of Europe -Hom

age to Rene Thom

Salvador Dali

MathVisionTools

http://w

ww.bmi2.bmt.tue.nl/im

age-an

alysis/

Page 44: GigaNumericsin Deep Structure Analysis of Imageslibrary.wolfram.com/infocenter/Conferences/5818/WTC-Deep... · GigaNumericsin Deep Structure Analysis of Images Employing MathLinkand

44

Ack

nowledgements

•Bart ter Haa

r Romen

y

•Evg

uen

iaBalmachnova

•Rem

coDuits

•LucFlorack

•Frans Kan

ters

•Bram Platel