50
1 http://www.iict.bas.bg/acomi n 8/6/2013 INSTITUTE OF INFORMATION AND COMMUNICATION TECHNOLOGIES BULGARIAN ACADEMY OF SCIENCE Centro de Visión por Computador, Departament de Matemàtica Aplicada i Anàlisi, Universitat de Barcelona AComIn: Advanced Computing for Innovation Snakes, level sets and graph- cuts (Deformable models)

Snakes, level sets and graph- cuts (Deformable models)iict.bas.bg/acomin/news/24-6-07-2013-P_Radeva/AComIn III Snakes.p… · Snakes, level sets and graph-cuts (Deformable models)

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Snakes, level sets and graph- cuts (Deformable models)iict.bas.bg/acomin/news/24-6-07-2013-P_Radeva/AComIn III Snakes.p… · Snakes, level sets and graph-cuts (Deformable models)

1http://www.iict.bas.bg/acomi

n8/6/2013

INSTITUTE OF INFORMATION AND COMMUNICATION

TECHNOLOGIESBULGARIAN ACADEMY OF

SCIENCE

Centro de Visión por Computador, Departament de Matemàtica Aplicada i Anàlisi,

Universitat de Barcelona

AComIn: Advanced Computing for Innovation

Snakes, level sets and graph-cuts

(Deformable models)

Page 2: Snakes, level sets and graph- cuts (Deformable models)iict.bas.bg/acomin/news/24-6-07-2013-P_Radeva/AComIn III Snakes.p… · Snakes, level sets and graph-cuts (Deformable models)

SnakesSnakes, , levellevel setssets andand graphgraph--cutscuts

(Deformable (Deformable modelsmodels))

Centro de Visión por Computador, Departamento de Matemática Aplicada y Análisis,

Universidad de Barcelona

Petia Radeva

Page 3: Snakes, level sets and graph- cuts (Deformable models)iict.bas.bg/acomin/news/24-6-07-2013-P_Radeva/AComIn III Snakes.p… · Snakes, level sets and graph-cuts (Deformable models)

8/6/2013 3http://www.iict.bas.bg

The problems of Medical image analysis vs. Computer Vision

Segmentation

Object recognition

Atlas matching

Registration

3D reconstruction

Deformation/Motion analysis

Page 4: Snakes, level sets and graph- cuts (Deformable models)iict.bas.bg/acomin/news/24-6-07-2013-P_Radeva/AComIn III Snakes.p… · Snakes, level sets and graph-cuts (Deformable models)

Motivation Challenges K-means Snakes

From tutorial de Antonio Torralba

Page 5: Snakes, level sets and graph- cuts (Deformable models)iict.bas.bg/acomin/news/24-6-07-2013-P_Radeva/AComIn III Snakes.p… · Snakes, level sets and graph-cuts (Deformable models)

Motivation Challenges K-means Snakes

Page 6: Snakes, level sets and graph- cuts (Deformable models)iict.bas.bg/acomin/news/24-6-07-2013-P_Radeva/AComIn III Snakes.p… · Snakes, level sets and graph-cuts (Deformable models)

DUCK

DUCK

GRASS

PERSON

TREE

LAKE

BENCH

PERSON

PERSON PERSON

DUCK

PATH

SKY

SIGN

Motivation Challenges K-means Snakes

Page 7: Snakes, level sets and graph- cuts (Deformable models)iict.bas.bg/acomin/news/24-6-07-2013-P_Radeva/AComIn III Snakes.p… · Snakes, level sets and graph-cuts (Deformable models)

A VIEW OF A PARK ON A NICE SPRING DAY

Motivation Challenges K-means Snakes

Page 8: Snakes, level sets and graph- cuts (Deformable models)iict.bas.bg/acomin/news/24-6-07-2013-P_Radeva/AComIn III Snakes.p… · Snakes, level sets and graph-cuts (Deformable models)

PERSON FEEDINGDUCKS IN THE PARK

PEOPLE WALKING IN THE PARK

DUCKS LOOKING FOR FOOD

Do not feed

the ducks sign

Motivation Challenges K-means Snakes

Page 9: Snakes, level sets and graph- cuts (Deformable models)iict.bas.bg/acomin/news/24-6-07-2013-P_Radeva/AComIn III Snakes.p… · Snakes, level sets and graph-cuts (Deformable models)

DUCKS ON TOP OF THE GRASS

PEOPLE UNDER THE SHADOW OF THE TREES

Motivation Challenges K-means Snakes

Page 10: Snakes, level sets and graph- cuts (Deformable models)iict.bas.bg/acomin/news/24-6-07-2013-P_Radeva/AComIn III Snakes.p… · Snakes, level sets and graph-cuts (Deformable models)

Image Understanding

+ context, prior information

It’s not just issue of quantity!!

What you see What the computer sees

(same image in false colors)Same informationPresented in a way your brain is not trained to cope with.

Motivation Challenges K-means Snakes

Page 11: Snakes, level sets and graph- cuts (Deformable models)iict.bas.bg/acomin/news/24-6-07-2013-P_Radeva/AComIn III Snakes.p… · Snakes, level sets and graph-cuts (Deformable models)

8/6/2013 11http://www.iict.bas.bg

Image Understanding

– “Sensory Gap”• The sensor doesn’t measure exactly what we want to

observe (eg. 2D projection, noise, occlusions…)

– “Semantic Gap”• Images are low level collections of numbers…How to

extract semantically significant, abstract descriptors? (eg: “a chair”, “forest”). Processes as complex as those happening in the brain are needed.

Automated Image Analysis is a VERY difficult problem

Page 12: Snakes, level sets and graph- cuts (Deformable models)iict.bas.bg/acomin/news/24-6-07-2013-P_Radeva/AComIn III Snakes.p… · Snakes, level sets and graph-cuts (Deformable models)

Challenges 1: view point variation (Sensory gap)

Michelangelo 1475-1564

Motivation Challenges K-means Snakes

Page 13: Snakes, level sets and graph- cuts (Deformable models)iict.bas.bg/acomin/news/24-6-07-2013-P_Radeva/AComIn III Snakes.p… · Snakes, level sets and graph-cuts (Deformable models)

Challenges 2: illumination

slide credit: S. Ullman

Motivation Challenges K-means Snakes

Page 14: Snakes, level sets and graph- cuts (Deformable models)iict.bas.bg/acomin/news/24-6-07-2013-P_Radeva/AComIn III Snakes.p… · Snakes, level sets and graph-cuts (Deformable models)

Challenges 3: occlusion

Magritte, 1957

Motivation Challenges K-means Snakes

Page 15: Snakes, level sets and graph- cuts (Deformable models)iict.bas.bg/acomin/news/24-6-07-2013-P_Radeva/AComIn III Snakes.p… · Snakes, level sets and graph-cuts (Deformable models)

Challenges 4: scaleMotivation Challenges K-means Snakes

Page 16: Snakes, level sets and graph- cuts (Deformable models)iict.bas.bg/acomin/news/24-6-07-2013-P_Radeva/AComIn III Snakes.p… · Snakes, level sets and graph-cuts (Deformable models)

Challenges 6: background clutter

Klimt, 1913

Motivation Challenges K-means Snakes

Page 17: Snakes, level sets and graph- cuts (Deformable models)iict.bas.bg/acomin/news/24-6-07-2013-P_Radeva/AComIn III Snakes.p… · Snakes, level sets and graph-cuts (Deformable models)

Challenges 5: deformation

Xu, Beihong 1943

Motivation Challenges K-means Snakes

Page 18: Snakes, level sets and graph- cuts (Deformable models)iict.bas.bg/acomin/news/24-6-07-2013-P_Radeva/AComIn III Snakes.p… · Snakes, level sets and graph-cuts (Deformable models)

Challenges 7: intra-class variation

Motivation Challenges K-means Snakes

Page 19: Snakes, level sets and graph- cuts (Deformable models)iict.bas.bg/acomin/news/24-6-07-2013-P_Radeva/AComIn III Snakes.p… · Snakes, level sets and graph-cuts (Deformable models)

8/6/2013 19http://www.iict.bas.bg

Some chairs

Related by function, not form

Motivation Challenges K-means Snakes

Page 20: Snakes, level sets and graph- cuts (Deformable models)iict.bas.bg/acomin/news/24-6-07-2013-P_Radeva/AComIn III Snakes.p… · Snakes, level sets and graph-cuts (Deformable models)

Segmentation is a subjective process (semantic gap)

Motivation Challenges K-means Snakes

From tutorial Jitendra Malik

Page 21: Snakes, level sets and graph- cuts (Deformable models)iict.bas.bg/acomin/news/24-6-07-2013-P_Radeva/AComIn III Snakes.p… · Snakes, level sets and graph-cuts (Deformable models)

Subjective contours and free-form models

Grouping factors

Motivation Challenges K-means Snakes

From Kass, Witkin & Terzopoulos

Page 22: Snakes, level sets and graph- cuts (Deformable models)iict.bas.bg/acomin/news/24-6-07-2013-P_Radeva/AComIn III Snakes.p… · Snakes, level sets and graph-cuts (Deformable models)

Background vs. ForegroundMotivation Challenges K-means Snakes

Page 23: Snakes, level sets and graph- cuts (Deformable models)iict.bas.bg/acomin/news/24-6-07-2013-P_Radeva/AComIn III Snakes.p… · Snakes, level sets and graph-cuts (Deformable models)

Spatial clustering

Motivation Challenges K-means Snakes

Page 24: Snakes, level sets and graph- cuts (Deformable models)iict.bas.bg/acomin/news/24-6-07-2013-P_Radeva/AComIn III Snakes.p… · Snakes, level sets and graph-cuts (Deformable models)

The segmentation challengeMotivation Challenges K-means Snakes

Page 25: Snakes, level sets and graph- cuts (Deformable models)iict.bas.bg/acomin/news/24-6-07-2013-P_Radeva/AComIn III Snakes.p… · Snakes, level sets and graph-cuts (Deformable models)

Priming with prior knowledge (top-down or bottom-up image processing?!)

If you have never seen it before, this figure probably means little at first sight?!Need of high-level knowledge to interpret imagesreal-time analysis needs selective processingno need of considering the whole scene (less comp. load).

Motivation Challenges K-means Snakes

Page 26: Snakes, level sets and graph- cuts (Deformable models)iict.bas.bg/acomin/news/24-6-07-2013-P_Radeva/AComIn III Snakes.p… · Snakes, level sets and graph-cuts (Deformable models)

The problem of imagesegmentation

Usually, models are hand-crafted or too general.

Aim: Statistically based technique for buildingcompact models of the shape and appearanceof flexible objects

Models should allow for theexpected variations in size, shape and appearance of thestructure

Motivation Challenges K-means Snakes

Page 27: Snakes, level sets and graph- cuts (Deformable models)iict.bas.bg/acomin/news/24-6-07-2013-P_Radeva/AComIn III Snakes.p… · Snakes, level sets and graph-cuts (Deformable models)

How to introduce high-level knowledge to regularize the segmentation problem?

• Similar pixels properties

• General high-level constraints – location of images– boundary smoothness, etc.

• Model-guided segmentation and recognition

Motivation Challenges K-means Snakes

Page 28: Snakes, level sets and graph- cuts (Deformable models)iict.bas.bg/acomin/news/24-6-07-2013-P_Radeva/AComIn III Snakes.p… · Snakes, level sets and graph-cuts (Deformable models)

Segmentation as a clustering problem

Clustering (píxels, elements, etc.) with the same properties

• “Agglomerative clustering”

• “Divisive clustering”

Motivation Challenges K-means Snakes

Page 29: Snakes, level sets and graph- cuts (Deformable models)iict.bas.bg/acomin/news/24-6-07-2013-P_Radeva/AComIn III Snakes.p… · Snakes, level sets and graph-cuts (Deformable models)

Histogram 3DMotivation Challenges K-means Snakes

Page 30: Snakes, level sets and graph- cuts (Deformable models)iict.bas.bg/acomin/news/24-6-07-2013-P_Radeva/AComIn III Snakes.p… · Snakes, level sets and graph-cuts (Deformable models)

K-Means• Algorithm

– Fix cluster centres;

– Assign points to the most similar clusters

– Recalculate clusters centres

• x can be any feature as long as features distance can be estimated.

Motivation Challenges K-means Snakes

Page 31: Snakes, level sets and graph- cuts (Deformable models)iict.bas.bg/acomin/news/24-6-07-2013-P_Radeva/AComIn III Snakes.p… · Snakes, level sets and graph-cuts (Deformable models)

Image Clusters based on intensity Clusters based on colour

Results of the clusterization by K-MeansMotivation Challenges K-means Snakes

Page 32: Snakes, level sets and graph- cuts (Deformable models)iict.bas.bg/acomin/news/24-6-07-2013-P_Radeva/AComIn III Snakes.p… · Snakes, level sets and graph-cuts (Deformable models)

http://www.ece.neu.edu/groups/rpl/kmeans/

ExampleMotivation Challenges K-means Snakes

Page 33: Snakes, level sets and graph- cuts (Deformable models)iict.bas.bg/acomin/news/24-6-07-2013-P_Radeva/AComIn III Snakes.p… · Snakes, level sets and graph-cuts (Deformable models)

How to introduce high-level knowledge to regularize the segmentation problem?

• Similar pixels properties

• General high-level constraints – Boundary smoothness.– Physics-based models, etc.

• Model-guided segmentation and recognition

Motivation Challenges K-means Snakes

Page 34: Snakes, level sets and graph- cuts (Deformable models)iict.bas.bg/acomin/news/24-6-07-2013-P_Radeva/AComIn III Snakes.p… · Snakes, level sets and graph-cuts (Deformable models)

8/6/2013 34http://www.iict.bas.bg

Why snakes

Edge map is ambiguous to be interpreted

Motivation Challenges K-means Snakes

From A. Blake

Page 35: Snakes, level sets and graph- cuts (Deformable models)iict.bas.bg/acomin/news/24-6-07-2013-P_Radeva/AComIn III Snakes.p… · Snakes, level sets and graph-cuts (Deformable models)

8/6/2013 35http://www.iict.bas.bg

Motivation

• Challenge – locate and recognize different objects in an image

• How to integrate and interpret the diverse local image cues (intensity, gradient, texture, etc.)

• Bottom-up or top-down approach?!

• Geometrical shape information – local and generic to global and specific(smoothness, elasticity, hand-crafted shapes)

• “There are no 2 leaves of the same shape” – intrinsic intraclass variation

• Object deformation – varying imaging conditions, sensor noise, occlusion, imperfect segmentation

• Can we come up with a versatil and flexible approach for object modeling and representation to deal with a variety of shape deformationbs andvariations while maintaining a certain structure?!

Motivation Challenges K-means Snakes

Page 36: Snakes, level sets and graph- cuts (Deformable models)iict.bas.bg/acomin/news/24-6-07-2013-P_Radeva/AComIn III Snakes.p… · Snakes, level sets and graph-cuts (Deformable models)

What is a snake in Computer Vision?!

• Snake - elastic continuous curve that from an initialposition begins to deform to adjust the object's contour.

• External forces attract the snake towards image features.

• Internal forces avoid discontinuities in the snake shape.

Motivation Challenges K-means Snakes

Page 37: Snakes, level sets and graph- cuts (Deformable models)iict.bas.bg/acomin/news/24-6-07-2013-P_Radeva/AComIn III Snakes.p… · Snakes, level sets and graph-cuts (Deformable models)

8/6/2013 37http://www.iict.bas.bg

Snake representation

• A snake is an elastic curve defined by means of:

a discrete representation

• - point-based snake - elastic curve as a sequence of snaxels :

a continuous representation

• - a tesselation established over the parametrization set

• - decomposition of the curve in a basis of functions (usually piecewisepolynomials)

• - small support of the basis functions

Motivation Challenges K-means Snakes

Page 38: Snakes, level sets and graph- cuts (Deformable models)iict.bas.bg/acomin/news/24-6-07-2013-P_Radeva/AComIn III Snakes.p… · Snakes, level sets and graph-cuts (Deformable models)

8/6/2013 38http://www.iict.bas.bg

Energy-Minimizing Curve

• Snake - an elastic curve with associated energy:

• Potential - a surface P ( x, y ) with valleys corresponding to image features

• External (image) forces attract the snake to the potential valleys:

Motivation Challenges K-means Snakes

Page 39: Snakes, level sets and graph- cuts (Deformable models)iict.bas.bg/acomin/news/24-6-07-2013-P_Radeva/AComIn III Snakes.p… · Snakes, level sets and graph-cuts (Deformable models)

8/6/2013 39http://www.iict.bas.bg

Deformable models are physics-based models

Model the objects as physics-based ones

Motivation Challenges K-means Snakes

Page 40: Snakes, level sets and graph- cuts (Deformable models)iict.bas.bg/acomin/news/24-6-07-2013-P_Radeva/AComIn III Snakes.p… · Snakes, level sets and graph-cuts (Deformable models)

8/6/2013 40http://www.iict.bas.bg

Energy-Minimizing Curve

Initial snake deforming snake converged snake

Original image image features potential field

Internal forces penalize stretching and bending:

External (image) forces attract the snake to the potential valleys

Motivation Challenges K-means Snakes

Page 41: Snakes, level sets and graph- cuts (Deformable models)iict.bas.bg/acomin/news/24-6-07-2013-P_Radeva/AComIn III Snakes.p… · Snakes, level sets and graph-cuts (Deformable models)

8/6/2013 41http://www.iict.bas.bg

Image feature extraction - edge detectionMotivation Challenges K-means Snakes

Page 42: Snakes, level sets and graph- cuts (Deformable models)iict.bas.bg/acomin/news/24-6-07-2013-P_Radeva/AComIn III Snakes.p… · Snakes, level sets and graph-cuts (Deformable models)

8/6/2013 42http://www.iict.bas.bg

Internal Energy of the Snake

• membrane energy given by the first derivative of the curve that avoids the stretching and discontinuity of the curve:

• thin-plate energy given by the second derivative of the curvethat avoids the bending of the curve:

Snake deformations with different elastic properties

Segmentation by snakes - an energy-minimization procedure.

Motivation Challenges K-means Snakes

Page 43: Snakes, level sets and graph- cuts (Deformable models)iict.bas.bg/acomin/news/24-6-07-2013-P_Radeva/AComIn III Snakes.p… · Snakes, level sets and graph-cuts (Deformable models)

8/6/2013 43http://www.iict.bas.bg

Energy-Minimization Procedure for a Point-Based Snake

Motivation Challenges K-means Snakes

Page 44: Snakes, level sets and graph- cuts (Deformable models)iict.bas.bg/acomin/news/24-6-07-2013-P_Radeva/AComIn III Snakes.p… · Snakes, level sets and graph-cuts (Deformable models)

8/6/2013 44http://www.iict.bas.bg

Energy-Minimization ProcedureMotivation Challenges K-means Snakes

Page 45: Snakes, level sets and graph- cuts (Deformable models)iict.bas.bg/acomin/news/24-6-07-2013-P_Radeva/AComIn III Snakes.p… · Snakes, level sets and graph-cuts (Deformable models)

8/6/2013 45http://www.iict.bas.bg

Stiffness matrix AMotivation Challenges K-means Snakes

Page 46: Snakes, level sets and graph- cuts (Deformable models)iict.bas.bg/acomin/news/24-6-07-2013-P_Radeva/AComIn III Snakes.p… · Snakes, level sets and graph-cuts (Deformable models)

8/6/2013 46http://www.iict.bas.bg

Snake Energy-Minimization Procedure

• Iterative procedure for snake energy minimization:

The snake deformation is a composition of: • snake attraction by external forces • snake smoothing due to internal forces.

Motivation Challenges K-means Snakes

Page 47: Snakes, level sets and graph- cuts (Deformable models)iict.bas.bg/acomin/news/24-6-07-2013-P_Radeva/AComIn III Snakes.p… · Snakes, level sets and graph-cuts (Deformable models)

8/6/2013 47http://www.iict.bas.bg

Flexible templates (Yuille et al.)Motivation Challenges K-means Snakes

Page 48: Snakes, level sets and graph- cuts (Deformable models)iict.bas.bg/acomin/news/24-6-07-2013-P_Radeva/AComIn III Snakes.p… · Snakes, level sets and graph-cuts (Deformable models)

8/6/2013 48http://www.iict.bas.bg

Snake in a MultiScale DeformationScheme

Different behaviour of a snake without (II row) and with (III row) MSDS application

Properties:• Priority to strong image features (local minima of the snake

energy),• Less dependence of snake initialization.

Motivation Challenges K-means Snakes

Page 49: Snakes, level sets and graph- cuts (Deformable models)iict.bas.bg/acomin/news/24-6-07-2013-P_Radeva/AComIn III Snakes.p… · Snakes, level sets and graph-cuts (Deformable models)

8/6/2013 49http://www.iict.bas.bg

Segmentation of facial features in snapshots

Motivation Challenges K-means Snakes

Page 50: Snakes, level sets and graph- cuts (Deformable models)iict.bas.bg/acomin/news/24-6-07-2013-P_Radeva/AComIn III Snakes.p… · Snakes, level sets and graph-cuts (Deformable models)

8/6/2013 50http://www.iict.bas.bg

Advantages of deformable shapes• Physics-based and active models;

• Soft and hard constraints;

• Selective wrt false image features;

• Interpret sparse, incomplete and redundant information;

• Integration of data from multiple cues;

• Well-elaborated mathematical apparatus;

• Local and non-affine deformations;

• Generic restrictions allowed;

• Use of an approximate geometric object's model;

• Snakes regularize in a natural way ill-posed problems of Computer Vision.

Motivation Challenges K-means Snakes