Image Segmentation via Graph-Cuts

Podobné dokumenty
Využití hybridní metody vícekriteriálního rozhodování za nejistoty. Michal Koláček, Markéta Matulová

Transportation Problem

Gymnázium, Brno, Slovanské nám. 7 WORKBOOK. Mathematics. Teacher: Student:

Dynamic programming. Optimal binary search tree

Two-Point Boundary Value Problem

Compression of a Dictionary

Entrance test from mathematics for PhD (with answers)

Tento materiál byl vytvořen v rámci projektu Operačního programu Vzdělávání pro konkurenceschopnost.

DC circuits with a single source

Dynamic Signals. Ananda V. Mysore SJSU

Jakub Zavodny (University of Oxford, UK)

GUIDELINES FOR CONNECTION TO FTP SERVER TO TRANSFER PRINTING DATA

Chapter 7: Process Synchronization

Interaktivní segmentace obrazu s využitím algoritmu pro maximalizaci toku v síti.

Aplikace matematiky. Dana Lauerová A note to the theory of periodic solutions of a parabolic equation

Database systems. Normal forms

Search and state transfer by means of quantum walk. Vyhledávání a přenos stavu pomocí kvantové procházky

Angličtina v matematických softwarech 2 Vypracovala: Mgr. Bronislava Kreuzingerová

Klepnutím lze upravit styl předlohy. nadpisů. nadpisů.

LOGOMANUÁL / LOGOMANUAL

By David Cameron VE7LTD

Extrakce nezávislé komponenty

STLAČITELNOST. σ σ. během zatížení

Czech Technical University in Prague Faculty of Electrical Engineering Department of Computer Science MASTER THESIS

PC/104, PC/104-Plus. 196 ept GmbH I Tel. +49 (0) / I Fax +49 (0) / I I

Configuration vs. Conformation. Configuration: Covalent bonds must be broken. Two kinds of isomers to consider

Gymnázium, Brno, Slovanské nám. 7, SCHEME OF WORK Mathematics SCHEME OF WORK. cz

6.867 Machine Learning

Základy teorie front III

On large rigid sets of monounary algebras. D. Jakubíková-Studenovská P. J. Šafárik University, Košice, Slovakia

DATA SHEET. BC516 PNP Darlington transistor. technický list DISCRETE SEMICONDUCTORS Apr 23. Product specification Supersedes data of 1997 Apr 16

USING VIDEO IN PRE-SET AND IN-SET TEACHER TRAINING

Introduction to MS Dynamics NAV

Klasifikace a rozpoznávání. Bayesovská rozhodovací teorie

Třída: VI. A6 Mgr. Pavla Hamříková VI. B6 RNDr. Karel Pohaněl Schváleno předmětovou komisí dne: Podpis: Šárka Richterková v. r.

Návrh a implementace algoritmů pro adaptivní řízení průmyslových robotů

EXACT DS OFFICE. The best lens for office work

2011 Jan Janoušek BI-PJP. Evropský sociální fond Praha & EU: Investujeme do vaší budoucnosti

Czech Republic. EDUCAnet. Střední odborná škola Pardubice, s.r.o.

LOGBOOK. Blahopřejeme, našli jste to! Nezapomeňte. Prosím vyvarujte se downtrade

Image Analysis and MATLAB. Jiří Militky

WORKSHEET 1: LINEAR EQUATION 1

SPECIAL THEORY OF RELATIVITY

Department of Mathematical Analysis and Applications of Mathematics Faculty of Science, Palacký University Olomouc Czech Republic

Nová éra diskových polí IBM Enterprise diskové pole s nízkým TCO! Simon Podepřel, Storage Sales

2. Entity, Architecture, Process

PART 2 - SPECIAL WHOLESALE OFFER OF PLANTS SPRING 2016 NEWS MAY 2016 SUCCULENT SPECIAL WHOLESALE ASSORTMENT

Mechanika Teplice, výrobní družstvo, závod Děčín TACHOGRAFY. Číslo Servisní Informace Mechanika:

User manual SŘHV Online WEB interface for CUSTOMERS June 2017 version 14 VÍTKOVICE STEEL, a.s. vitkovicesteel.com

VYSOKÁ ŠKOLA HOTELOVÁ V PRAZE 8, SPOL. S R. O.

Škola: Střední škola obchodní, České Budějovice, Husova 9. Inovace a zkvalitnění výuky prostřednictvím ICT

EU peníze středním školám digitální učební materiál

Problém identity instancí asociačních tříd

Just write down your most recent and important education. Remember that sometimes less is more some people may be considered overqualified.

Klepnutím lze upravit styl předlohy. Klepnutím lze upravit styl předlohy. nadpisů. nadpisů. Aleš Křupka.

Vánoční sety Christmas sets

POPIS TUN TAP. Vysvetlivky: Modre - překlad Cervene - nejasnosti Zelene -poznamky. (Chci si ujasnit o kterem bloku z toho schematu se mluvi.

HASHING GENERAL Hashovací (=rozptylovací) funkce

Obrábění robotem se zpětnovazební tuhostí

PAINTING SCHEMES CATALOGUE 2012

PixLa PIXEL LABYRINTH PIXEL LABYRINTH PIXEL LABYRINTH PIXEL LABYRINTH PIXEL LABYRINTH PIXEL LABYRINTH PIXEL LABYRINTH PIXEL LABYRINTH PIXEL LABYRINTH

Digitální učební materiál

Goal: to construct some general-purpose algorithms for solving systems of linear Equations

Enabling Intelligent Buildings via Smart Sensor Network & Smart Lighting

Bioinformatika a výpočetní biologie. KFC/BIN VII. Fylogenetická analýza

These connections are divided into: a) with a form-contact b) with a force-contact

Litosil - application

Execrices. Mathematics FRDIS

CHAIN TRANSMISSIONS AND WHEELS

Výukový materiál v rámci projektu OPVK 1.5 Peníze středním školám

Research infrastructure in the rhythm of BLUES. More time and money for entrepreneurs

CODE BOOK NEISS 8. A code book is an identification tool that allows the customer to perform a test result evaluation using a numeric code.

VY_32_INOVACE_06_Předpřítomný čas_03. Škola: Základní škola Slušovice, okres Zlín, příspěvková organizace

TKGA3. Pera a klíny. Projekt "Podpora výuky v cizích jazycích na SPŠT"

2N Voice Alarm Station

Risk management in the rhythm of BLUES. Více času a peněz pro podnikatele

MO-ME-N-T MOderní MEtody s Novými Technologiemi CZ.1.07/1.5.00/

Geometry of image formation

CHAPTER 5 MODIFIED MINKOWSKI FRACTAL ANTENNA

MC Tlumiče (řízení pohybu) MC Damper

ROLZ-2. Portable AV/Conference Center. Assembly Instructions

Comparation of mobile

Vliv metody vyšetřování tvaru brusného kotouče na výslednou přesnost obrobku

a rhomboid, a side, an angle,a vertex, a height, a perimeter, an area an acute angle, an obtuse angle, opposite sides, parallel sides

TechoLED H A N D B O O K

Gymnázium a Střední odborná škola, Rokycany, Mládežníků 1115

Graph theory and graph algorithms basics

Číslo projektu: CZ.1.07/1.5.00/ Název projektu: Inovace a individualizace výuky

UPM3 Hybrid Návod na ovládání Čerpadlo UPM3 Hybrid 2-5 Instruction Manual UPM3 Hybrid Circulation Pump 6-9

WYSIWYG EDITOR PRO XML FORM

Social Media a firemní komunikace

Air Quality Improvement Plans 2019 update Analytical part. Ondřej Vlček, Jana Ďoubalová, Zdeňka Chromcová, Hana Škáchová

Friction drives have constant or variable drives (it means variators). Friction drives are used for the transfer of smaller outputs.

Postup objednávky Microsoft Action Pack Subscription

Functions. 4 th autumn series Date due: 3 rd January Pozor, u této série přijímáme pouze řešení napsaná anglicky!

stany A B C D tents VÝBAVA stanů Husky 2005/Husky 2005 tents ACCESSORIES

Rozvoj vzdělávání žáků karvinských základních škol v oblasti cizích jazyků Registrační číslo projektu: CZ.1.07/1.1.07/

Střední průmyslová škola strojnická Olomouc, tř.17. listopadu 49

Rozvoj vzdělávání žáků karvinských základních škol v oblasti cizích jazyků Registrační číslo projektu: CZ.1.07/1.1.07/

TGH10 - Maximální toky

Transkript:

1/42 Image Segmentation via Graph-Cuts Pavel Matula 21. května 2012

2/42 Outline Graph Theory Flow Networks and Graph Cuts Maximum Flow Algorithms Discrete Energy Minimization Euclidean Metric Approximation Riemannian Metric Approximation Graph Cut Segmentation Idea and Motivation Geodesic Segmentation Chan-Vese Minimization Conclusion

3/42 Contents Graph Theory Flow Networks and Graph Cuts Maximum Flow Algorithms Discrete Energy Minimization Euclidean Metric Approximation Riemannian Metric Approximation Graph Cut Segmentation Idea and Motivation Geodesic Segmentation Chan-Vese Minimization Conclusion

4/42 Contents Graph Theory Flow Networks and Graph Cuts Maximum Flow Algorithms Discrete Energy Minimization Euclidean Metric Approximation Riemannian Metric Approximation Graph Cut Segmentation Idea and Motivation Geodesic Segmentation Chan-Vese Minimization Conclusion

Flow Network Definition A directed graph G = (V, E) where V is the set of graph nodes and E V V is the set of graph edges. Each edge (u, v) E has a real-valued capacity c uv 0. Further, there are two distinguished nodes in V, called terminal nodes: the source, denoted s and the sink, denoted t. 10 7 8 6 5 s 2 3 10 1 5 t 9 1 1 7 10 7 2 5/42

Cut Definition An st-cut C is a partition of the set V into two disjoint subsets S and T = V \ S such that s S and t T. Cut capacity C G is the sum of the capacities of the edges going from S to T : C G = (u,v) E,u S,v T c uv S 7 8 6 5 10 T s 2 3 10 1 t 5 9 C G = 13 1 7 1 7 2 10 6/42

7/42 Minimum and Maximum Cuts There are 2 V 2 possible st-cuts Minimum cut is a cut with the smallest possible capacity Problem of finding a minimum cut has polynomial time complexity We will discuss algorithms later Maximum cut is a cut with the largest possible capacity Problem of finding a maximum cut is NP-hard There may be several minimum and maximum cuts

8/42 Flow Flow in network G = (V, E) is a mapping f : E R + 0 satisfying Capacity constraint: 0 f uv c uv for all u, v V Continuity condition: for all u V \ {s, t} holds: (f uv f vu ) = 0. v V The value of the flow outgoing from source s is f = v V f sv.

9/42 Maximum Flow and Minimal Cut Duality Maximal flow is a flow with the maximal value. Ford-Fulkerson: problem of finding minimal cut is equivalent to problem of finding maximal flow. capacity of minimal cut is equal to the value of maximal flow. edges belonging to minimal cut are those which capacity is fully saturated by the flow.

10/42 Contents Graph Theory Flow Networks and Graph Cuts Maximum Flow Algorithms Discrete Energy Minimization Euclidean Metric Approximation Riemannian Metric Approximation Graph Cut Segmentation Idea and Motivation Geodesic Segmentation Chan-Vese Minimization Conclusion

11/42 Ford-Fulkerson Obecný iterativní framework pro hledání maximálního toku. Sestrojíme reziduální sít. Najdeme zlepšující cestu v reziduální síti z uzlu s do uzlu t. Zvýšíme tok po dané cestě o hodnotu hrany s nejmenší kapacitou na této cestě. Výpočet opakujeme dokud je možné najít další zlepšující cestu. V obecném případě složitost O(E f ), kde E je počet hran a f hodnota maximálního toku. Nemusí konvergovat pro sítě s neceločíselnými kapacitami.

12/42 Edmonds-Karp Zvláštní případ metody Ford-Fulkerson. Dvě varianty: Zlepšování toku vždy po nejkratší cestě. Složitost O(VE 2 ). Zlepšování toku vždy po nejširší cestě. Složitost O(E log(eu)), kde U je nejvyšší kapacita vyskytující se v síti. Záruka konvergence i pro sítě s iracionálními kapacitami hran.

13/42 Dinitz Zlepšování toku po všech nejkratších cestách naráz. Pomocí prohledávání do šířky jsou nalezeny všechny nejkratší cesty v reziduální síti. Obdržíme podsít nejkratších cest, která neobsahuje smyčky. V získané podsíti najdeme maximální tok pomocí prohledávání do hloubky. Lze ukázat, že v další iteraci bude délka nejkratších cest ostře větší. Složitost O(V 2 E). V praxi výrazně rychlejší, než Edmonds-Karp.

14/42 Push-Relabel V současnosti pravděpodobně nejrychlejší a nejvyužívanější metody pro obecné grafy. Pro každý uzel si udržujeme předpokládanou délku nejkratší cesty k uzlu t. Uzly mohou obsahovat přebytky toku (aktivní uzly). Optimistické prostrkávání toku do uzlů u kterých předpokládáme, že jsou blíže uzlu t. Rozhodování vždy pouze na základě lokálních informací. Vhodné k paralelizaci a lokalizaci výpočtu v paměti. Pro rychlý výpočet ovšem třeba pravidelně provádět globální update informací. Složitost záleží na strategii volby aktivního uzlu: Naivní implementace O(V 2 E) First-in First-out strategie O(V 3 ) Nejvzdálenější aktivní uzel O(V 2 E)

15/42 Contents Graph Theory Flow Networks and Graph Cuts Maximum Flow Algorithms Discrete Energy Minimization Euclidean Metric Approximation Riemannian Metric Approximation Graph Cut Segmentation Idea and Motivation Geodesic Segmentation Chan-Vese Minimization Conclusion

16/42 What energy functions can be minimized via graph cuts? [Kolmogorov, Zabih] Let E be a function of n binary variables of type E(x 1,..., x n ) = i E i (x i ) + i<j E i,j (x i, x j ). Then, E is graph-representable if and only if each term E i,j satisfies the inequality E i,j (0, 0) + E i,j (1, 1) E i,j (0, 1) + E i,j (1, 0). Necessary and sufficient condition to be able to compute the exact global minimum of E using a single graph cut.

17/42 Graph Construction A graph G = (V, E) is built where V contains the two terminal nodes s and t representing the labels 0 and 1, respectively, and a node for each variable x i.

18/42 Contents Graph Theory Flow Networks and Graph Cuts Maximum Flow Algorithms Discrete Energy Minimization Euclidean Metric Approximation Riemannian Metric Approximation Graph Cut Segmentation Idea and Motivation Geodesic Segmentation Chan-Vese Minimization Conclusion

Cut metrics Given a regular orthogonal grid and neighbourhood N C G - Cut metric. Sum of weights of edges connecting inner and outer nodes For any contour - C G C ε and C G C ε with increasing grid resolution and neighbourhood density The Goal How to set edge weights w k? 19/42

20/42 Cauchy-Crofton Formula The Cauchy-Crofton formula establishes a connection between Euclidean length L(C) of a curve C in R 2 and a measure of a set of lines intersecting it: L(C) = 1 n c dl 2 where n c is the number of intersections n c with lines L. Consider the set of all lines L given by polar formula L(φ, ρ). Then the Cauchy-Crofton formula can be written as L(C) = 1 2 π 0 n c (φ, ρ)dφdρ.

21/42 Discretization and Boykov s Approach π + n c (φ, ρ) n C ε = dρ dφ 0 2 k=1 i n c (k, i) n ρ k φ k n c (k) ρ k φ k 2 2 k=1 Weights (2D isotropic case): w k = ρ k φ k 2 ρ k = δ2 e k

22/42 Distance maps N8 N16

23/42 Extension to 3D Cauchy-Crofton C 2 ε = 1 n c dl π Using the same derivative steps w k = ρ k φ k π ρ k = δ xδ y δ z e k

24/42 Contents Graph Theory Flow Networks and Graph Cuts Maximum Flow Algorithms Discrete Energy Minimization Euclidean Metric Approximation Riemannian Metric Approximation Graph Cut Segmentation Idea and Motivation Geodesic Segmentation Chan-Vese Minimization Conclusion

25/42 Riemannian Spaces In Riemannian geometry, each point of the space is associated with a metric tensor M that controls how inner product of two vectors is calculated ("space stretching"). In N-dimensional space, the tensor is a symmetric positive definite N-by-N matrix (a bilinear form) that varies smoothly over the space. In case M is constant, the Riemannian norm of a vector u is calculated as: u R = u T M u.

26/42 Edge Weights Weights approximating a Riemannian metric (Boykov): w R k = w E k det M (u T k M u k) p where u k is a unit vector in the direction of e k, wk E is the weight for the Euclidean metric approximation and p equals to 3/2 and 2 in 2D and 3D, respectively. Euclidean metric a special case where M const = I

27/42 Contents Graph Theory Flow Networks and Graph Cuts Maximum Flow Algorithms Discrete Energy Minimization Euclidean Metric Approximation Riemannian Metric Approximation Graph Cut Segmentation Idea and Motivation Geodesic Segmentation Chan-Vese Minimization Conclusion

28/42 Contents Graph Theory Flow Networks and Graph Cuts Maximum Flow Algorithms Discrete Energy Minimization Euclidean Metric Approximation Riemannian Metric Approximation Graph Cut Segmentation Idea and Motivation Geodesic Segmentation Chan-Vese Minimization Conclusion

29/42 Graph Cut Segmentation Framework s s Cut w si i w ij j t w it t

30/42 Contents Graph Theory Flow Networks and Graph Cuts Maximum Flow Algorithms Discrete Energy Minimization Euclidean Metric Approximation Riemannian Metric Approximation Graph Cut Segmentation Idea and Motivation Geodesic Segmentation Chan-Vese Minimization Conclusion

31/42 How to set the weights? Geodesic Active Contours energy: E GAC (C) = 1 0 g( G σ I(C(q)) ) C (q) dq t-links: 0 or large value (hard constraints) n-links - Riemannian tensors

32/42 Contents Graph Theory Flow Networks and Graph Cuts Maximum Flow Algorithms Discrete Energy Minimization Euclidean Metric Approximation Riemannian Metric Approximation Graph Cut Segmentation Idea and Motivation Geodesic Segmentation Chan-Vese Minimization Conclusion

33/42 How to set the weights? Chan-Vese Functional E CV (C, c 1, c 2 ) = µl(c)+λ 1 (f (x) c 1 ) Ω 2 dx+λ 2 (f (x) c 2 ) 2 dx 1 Ω 2 T-link weights: s Ω 1 w si = λ 2 (f (i) c 2 ) 2 w it = λ 1 (f (i) c 1 ) 2 i w si w it t Ω 2 N-link weights: w ij = µw k - see Page 21

34/42 Graph Cut Based Chan-Vese Minimization Overview Key observation It is possible to setup w ij, w si and w it such that capacity of any cut approximates the CV energy of the corresponding segmentation for fixed c 1 and c 2. Alternating minimization scheme: 1. Obtain an initial estimate of c 1 and c 2 2. Construct graph and find globally minimal segmentation with respect to the fixed mean values 3. Update c 1 and c 2 4. Repeat from 2 until reaching a steady state

35/42 How to initialize c 1 nad c 2? Algorithm idea Minimize the Chan-Vese functional with a relaxed regularization term: E(C, c 1, c 2 ) = λ 1 Ω 1 (f (x) c 1 ) 2 dx + λ 2 Ω 2 (f (x) c 2 ) 2 dx A significantly simpler problem Weighted KMeans clustering Only data terms are compared in each pixel Corresponds to finding a minimum cut with zero N-link weights

36/42 Properties Advantages: Simple and fast (and automatic ) Reflects λ1 and λ 2 Very good estimate for small µ Requires less iterations of the main algorithm Disadvantages: Only an approximation, initialization dependent Does not guarantee reaching a global minimum

Chan-Vese Segmentation - Examples (1) 37/42

Chan-Vese Segmentation - Examples (2) 38/42

39/42 Boundary Smoothness Depends strongly on the neighbourhood size: Large neighbourhoods are computationally expensive

Two-Stage Algorithm Key observation Segmentations are different but very close to each other. Two-stage algorithm: 1. Coarse segmentation using a small neighbourhood 2. Refinement of the segmentation in a narrow band around the boundary using a large neighbourhood q = H(S 1 ) S 1 H(S 1 ) w iq C 1 h H(T 1 ) T 1 w ir r = H(T 1 ) B

41/42 Contents Graph Theory Flow Networks and Graph Cuts Maximum Flow Algorithms Discrete Energy Minimization Euclidean Metric Approximation Riemannian Metric Approximation Graph Cut Segmentation Idea and Motivation Geodesic Segmentation Chan-Vese Minimization Conclusion

42/42 Conclusion Graph-cut framework is powerful tool for discrete function minimization. Finding of minimal cut is a polynomial problem and we obtain global optimum. GC allows interactive segmenation. Geodesic segmentation can easily be implemented using graph-cuts. We have presented an iterative algorithm for Chan-Vese minimization. The neighbourhood system of the grid is related to boundary smoothness. Two stage-minimization reduces memory demands. http://cbia.fi.muni.cz/projects/graph-cut-library.html