Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Euler Number Computation By Kishore Kulkarni (Under the Guidance of Dr. Longin Jan Latecki)

Similar presentations


Presentation on theme: "1 Euler Number Computation By Kishore Kulkarni (Under the Guidance of Dr. Longin Jan Latecki)"— Presentation transcript:

1 1 Euler Number Computation By Kishore Kulkarni (Under the Guidance of Dr. Longin Jan Latecki)

2 2 Outline  Connected Components & Holes  Euler Number & its significance For Binary Images For Graphs Analogy between Euler number for graphs & binary images  Concavities and Convexities  Relation between Euler Number, Concavities & Convexities  Euler Number computation for test images.  Justification of correctness of algorithm used for computing Euler Number

3 3 Connected Components & Holes  Connected Components – 4, 6 and 8 Connectivity.  Holes

4 4 Euler Number The Euler Number (also called as the connectivity factor) is defined as the difference between connected components and holes. Formally, Euler Number is given by n comp E = n comp - ∑ n i hole where i = 1 n comp => number of foreground connected components n i hole => number of holes for i th connected component

5 5 Euler Number E = 5 – 11 = -6E = 11 – 4 = 7

6 6 Significance of Euler Number  Euler Number is a topological parameter, which describes the structure of an object, regardless of its specific geometric shape.  Euler number (for discrete case) is a local measure and is obtained as the sum of measures in the local neighbourhoods.  Although it is a local measure, it can be used to obtain global properties.  For objects with no holes, it can be used to calculate the number of connected components.

7 7 Euler Number for Graphs If V, E, and F represent the set of vertices, edges and faces respectively then for any graph we have |V| + |F| = |E|+ R where R is the Euler Number for graphs |V| = 7, |F| = 3(or 4), |E| = 9 Euler Number, R = 7 + 3(or 4) – 9 = 1(or 2) depending upon whether or not we treat the area outside the graph as a face.

8 8 Equivalence of Euler Number for graphs and Binary images  Any binary image can be represented as a graphs where Every black pixel (1) is represents the vertex of the graph Two neighbouring black pixels (vertices of the graphs) are joined to form an edge  The Euler Number for the binary image and its corresponding graph is the same.

9 9 Euler Number – Contd… Consider the following image. Euler Number E = 2 – 0 = 2. For the corresponding graph, we have |V| = 28, |E| = 30, |F| = 4 R = 28 – 30 + 4 = 2

10 10 Convexities & Concavities  A region R is said to be convex iff, for every x 1, x 2 in R, [x 1, x 2 ] belongs to R.  A convex hull for a region R is defined as the convex closure of region R.  Convexity (or the convex number) N 2 + (X, α) is defined as the number of first entries in the object in a given direction α.

11 11 Convexity & concavity….  Concavity (or the concave number) N 2 - (X, α) is defined as the number of exits in a given direction α.  In the following figure, N 2 + (X, 90) = 3 N 2 - (X, 90) = 2

12 12 Convexities and Concavities…  For a binary image with 4-connectivity the convexities and concavities can be represented by the following 2*2 masks.  Convexities – Three 0’s and one 1.  Concavities – Three 1’s and one 0.

13 13 Euler Number in terms of convexity and concavity  The relationship between Euler Number, Convexities and concavities is given by N 2 (X) = N 2 + (X) - N 2 - (X)  So now we have the following relation E = c – h = v – e + f = N 2 + (X) - N 2 - (X)  The upstream convexity [ ] -------- (1)  The upstream concavity [ ] ----------(2)

14 14 Algorithm for computing Euler Number (for 4-connectivity) For every pixel (x, y) of the image, Do if p(x,y) = 1 and p(x-1, y) = p(x, y-1) = p(x-1, y-1) = 0 convexities ++ if p(x,y) = 0 & p(x+1, y) = p(x, y+1) = p(x+1, y+1) =1 concavities ++ end Euler number = convexities - concavities

15 15 Euler Number for test images Image 1: Number of Convexities = 74 Number of Concavities = 74 Euler Number = 0

16 16 Euler Number for test images Image 2: Number of Convexities = 86 Number of Concavities = 85 Euler Number = 1

17 17 Euler Number for test images Image 3: Number of Convexities = 135 Number of Concavities = ? Euler Number = ?

18 18 Euler Number for test images Image 4: Number of Convexities = 74 Number of Concavities = 73 Euler Number = 1

19 19 Euler Number for test images Image 5: Number of Convexities = 27 Number of Concavities = 16 Euler Number = 11 = Number of Objects

20 20 Euler Number for test images Image 6: Number of Convexities = 51 Number of Concavities = 61 Euler Number = -10 Number of Holes = 1-(-10) = 11

21 21 Why does this approach always returns Euler Number ? To prove: Euler Number for an image = Number of upstream convexities - Number of upstream concavities Proof: First we prove that Euler Number for the whole image is the sum of Euler numbers for every component. Then we prove the above equality for one component to complete the proof.

22 22 Proof - Contd…. Euler number for component is given by E i = 1 – n i hole where n i hole is the number of holes in component i Consider n comp n comp ∑ E i = ∑ (1 - n i hole ) i = 1 i = 1 n comp = n comp - ∑ n i hole i = 1 = E image

23 23 Proof - Contd…. The upstream convexity [ ] -------- (1) The upstream concavity [ ] ----------(2) The first pixel with value ‘1’ in the image should be of type (1). Hence this convexity refers to the connected component. Now any pixel with the mask [ ] can (1)be a Hole (2)be a Background If (1) then we are done..

24 24 Proof - Contd…. If it is a background pixel then we have an extra concavity count. Hence we need to prove that there exists an equivalent convexity to balanced the same. Now if it a background pixel, then the two edges in the 2*2 mask (referring to graphical representation of a binary image) should not form a cycle with any of the previously visited black pixels (otherwise we get a hole). If this is the case there should be a pixel with the mask [ ]. Hence we can prove that number of concavities exceeding number of holes and convexities exceeding 1 are equal by similar argument. Thus they cancel out. Hence the result.


Download ppt "1 Euler Number Computation By Kishore Kulkarni (Under the Guidance of Dr. Longin Jan Latecki)"

Similar presentations


Ads by Google