This document introduces graphs and their ability to represent images. It defines what a graph is and different types of graphs. It discusses common data structures used to store graphs like adjacency lists, adjacency matrices, and incidence matrices. It then covers how graphs can represent images by having vertices represent pixels and edges represent pixel adjacency. Region adjacency graphs and dual graphs are introduced as ways to represent image regions and relationships. Combinatorial maps are presented as another way to represent graphs and implicitly store dual graphs. Finally, applications of using graphs for image segmentation are mentioned.
2. • Graph G = (V,E)
• Set of vertices V
• Set of edges E, where E ⊂ V x V
• Edges can be directed or undirected
Graph Definition
2
V = {1, 2, 3, 4, 5}
E = {(1,2), (2,3), (3,2), (4,3), (4,1), (4,5), (5,5)}
1
2
3
4
5
1
1
=
3. • Parallel / Double edges
• Self-loops
• Simple graph: contains NO parallel edges and NO self-loops
• Multigraph: contains parallel edges and/or self-loops
Graph Definition
3
4. • Planar graphs
• Contains no crossing edges
• Tree
• Connects all vertices without cycles
• Forest
• All connected components are trees
Graph Definition
4
5. • Vertices generally stored in array or vector
• Most common data-structures to store edges
• Adjacency list
• Adjacency matrix
• Incidence matrix
• Edge data-structure defines complexity of graph operations
• Storage- and computational cost
• Operations for example: add edge, remove edge, check adjacency,…
Graph Data-structure
5
6. • Collection of unordered linked lists, one for each vertex
• Great for representation of sparse graphs
Adjacency List
6
1
2
3
4
5
1 2 3 4 5
2 3 2 1 5
4 3
5
Graph
opera*on
Complexity
Store
graph
O(|V|+|E|)
Add
Vertex
O(1)
Add
Edge
O(1)
Remove
Vertex
O(|E|)
Remove
Edge
O(|E|)
Adjacency
check
O(|V|)
V
7. • Square matrix with side length |V|
• Describes if two vertices are adjacent
• Symmetric if undirected graph, binary if simple graph
Adjacency Matrix
7
1
2
3
4
5
Graph
opera*on
Complexity
Store
graph
O(|V|²)
Add
Vertex
O(|V|²)
Add
Edge
O(1)
Remove
Vertex
O(|V|²)
Remove
Edge
O(1)
Adjacency
check
O(1)
1
1
1
1
1
1
1
1
V
V
8. • Matrix of size |V| x |E|
• Describes incidence relationship between vertices and edges
Incidence Matrix
8
1
2
3
4
5
Graph
opera*on
Complexity
Store
graph
O(|V|*|E|)
Add
Vertex
O(|V|*|E|)
Add
Edge
O(|V|*|E|)
Remove
Vertex
O(|V|*|E|)
Remove
Edge
O(|V|*|E|)
Adjacency
check
O(|E|)
1
2
3
4
5
a
1
1
b
1
1
c
1
1
d
1
1
e
1
1
f
1
V
E
c
b
d
a
e
f
11. • Built by applying reduction operations to a graph
• Lowest level stores original graph
• Top level stores maximally reduced graph (single vertex)
Graph Pyramid
11
12. • Vertices describe pixels
• Edges describe adjacency relationships between pixels
• 4-connected image graph is always planar
Graphs and Images
12
13. • Simplified image graph
• Vertices describe connected regions of any shape and size
• Edges describe adjacency relationships between regions
• Simple graph – no multiple edges, no self-loops
Region Adjacency Graph
13
14. • Does not uniquely describe a “setting” of regions
• Cannot describe inclusion relationship and multiple borders
Region Adjacency Graph
14
15. • Every planar graph has a dual graph
• Primal graph
• Vertices describe regions
• Edges describe adjacency relationships between regions
• Dual graph
• Vertices describe faces
• Edges describe borders of faces
Dual Graphs
15
17. • Differentiates between adjacency and inclusion relationship
• Preserves multiple borders
Dual Graphs
17
1
4
18. • Differentiates between adjacency and inclusion relationship
• Preserves multiple borders
• Does not uniquely describe a “setting” of regions
Dual Graphs
18
1
4
19. • Different representation of a graph
• Combinatorial Map CM = (D, α, σ)
• Set of “darts” D
• α involution connecting two darts
• σ permutation connecting two darts
• Can be stored in single array
Combinatorial Maps
19
1
2
3
4
σ
α
20. • Modification of the σ permutation
• Vertex merging (edge contraction)
• Edge removal
CM Reduction Operations
20
21. • Primal combinatorial map implicitly stores dual map CM’=(D, α, γ)
• Dual map can be computed anytime from the primal, and vice-versa
• Combination of α involution and σ permutation
• γ = (α * σ) or γ = (σ * α)
Dual Combinatorial Maps
21