image analysis
play

Image Analysis The topics of this lecture are (chapter 11) - PowerPoint PPT Presentation

Image Analysis The topics of this lecture are (chapter 11) Representation and description Chain codes Polygonal Approximations Skeletons Christina Olsn colsen@cs.umu.se Fourier descriptors Department of Computing Science Matlabs


  1. Image Analysis The topics of this lecture are (chapter 11) Representation and description Chain codes Polygonal Approximations Skeletons Christina Olsén colsen@cs.umu.se Fourier descriptors Department of Computing Science Matlab’s regionprops Umeå University March 3, 2009 Christina Olsén (CS, UmU) Representation and description March 3, 2009 1 / 35 Christina Olsén (CS, UmU) Representation and description March 3, 2009 2 / 35 Intermediate level Segmentation Low level Preprocessing Representation Knowledge Discretization Classification Representation By representation is meant that we make the object High level information more accessible for computer-interpretation Problem domain Results Description By description is meant that we quantify our representation of the object Discretization makes it possible to talk about images . To conclude: First segmentation and then representation and Pre-processing adapts the image to our specific application. description Segmentation makes it possible to talk about objects in the image. Representation and description makes it possible to talk about the properties of objects And finally, interpretation makes it possible to talk about the contents of the image by classifying objects Christina Olsén (CS, UmU) Representation and description March 3, 2009 3 / 35 Christina Olsén (CS, UmU) Representation and description March 3, 2009 4 / 35

  2. Invariance Ursprungsbild (16x16) Roterad 27 grader In all representation it is desirable to choose methods that are rotational , scale and translation invariant This mean that the calculated representation r ( f ( x , y )) is the same regardless if we translate: r ( f ( x , y )) = r ( f ( x , y ) + [ α x , α y ]) scale: Ursprungsbild (64x64) Roterad 27 grader r ( f ( x , y )) = r ( f ( x , y ) · [ β x , β y ]) rotate: � cos θ � �� sin θ r ( f ( x , y )) = r f ( x , y ) · − sin θ cos θ Christina Olsén (CS, UmU) Representation and description March 3, 2009 5 / 35 Christina Olsén (CS, UmU) Representation and description March 3, 2009 6 / 35 External Chain coding Chain coding is based on the idea that we follow the outer edge of the object and store the direction in which we are travelling The directions are calculated as: 1 2 3 1 An external representation of an area is based on the the outer border of that area (i.e. the edge) 2 0 4 0 We are not interested in the internal properties of the object (grey-level, color, texture etc), even if these were important to our 5 7 ability to segment the object 3 6 The chain code is of the same length as the perimeter of the object, which in many cases are too long A solution to this is to re-sample the image to a lower resolution before calculating the code The re-sampling also reduces noise sensitivity Christina Olsén (CS, UmU) Representation and description March 3, 2009 7 / 35 Christina Olsén (CS, UmU) Representation and description March 3, 2009 8 / 35

  3. The chain code is highly dependent on the starting point To reduce this dependency we regard the code as a circular number with n numerals. By finding the 1 ≤ i ≤ n that yields the lowest number when the chain code is read like a ordinary number we obtain a code that is invariant to starting point Ex 1. The code 0364700346 becomes 0034603647. To make the code even more robust we do not keep track of the absolute direction in which we are travelling, but only the changes in direction. This makes the code invariant to rotation Ex 2. The code 0034603647 becomes 0312233631 Christina Olsén (CS, UmU) Representation and description March 3, 2009 9 / 35 Christina Olsén (CS, UmU) Representation and description March 3, 2009 10 / 35 Polygonal approximation Let i = 3 1 Mark the points in the object that have the furthest distance from 2 each other with p 1 and p 2 . It is also possible to represent an object by a polygon, that is a Connect the points in the order they are numbered with lines 3 series of points connected by lines (often straight, but curved For each segment in the polygon find the point on the perimeter 4 lines are possible) between the points that have the furthest distance to the The polygon should with as few points as possible capture the polygonal line-segment. If this distance is larger than a threshold characteristics of the object mark the point with a label p i The simplest polygonal representation is to use the pixels on the Renumber the points so that they are consecutive 5 perimeter of the object Increase i 6 If no points have been added break, otherwise go to 3. 7 Christina Olsén (CS, UmU) Representation and description March 3, 2009 11 / 35 Christina Olsén (CS, UmU) Representation and description March 3, 2009 12 / 35

  4. Convex hull Skeletonizing The convex hull H of a set S is defined as the smallest convex We define an objects skeleton or medial-axel as the points in set that contains S the object that have several nearest neighbors on the edge of the We define the set D = H \ S . object The points that have neighbors from the sets D , H and ∁ H is called p i . These points are used for representation of the object p p 1 6 D p 2 p D 3 D p 5 S p 4 H To limit the number of points found it is possible to smooth the edge of the object Christina Olsén (CS, UmU) Representation and description March 3, 2009 13 / 35 Christina Olsén (CS, UmU) Representation and description March 3, 2009 14 / 35 Description To find the skeleton by using the definition is very costly, since it involves calculating the distance between all points in the object to all points on the perimeter The purpose with the description is to quantify a Usually some iterative method is used that removes perimeter representation of an object. pixels until only the skeleton remains This implies that we instead of talking about regions in the image In order to achieve this, the following rules must be adhered to: we can talk about their properties , such as length, curviness, (a) erosion of the object must be kept to a minima and so on (b) connected components must not be broken (c) end points must not be removed Christina Olsén (CS, UmU) Representation and description March 3, 2009 15 / 35 Christina Olsén (CS, UmU) Representation and description March 3, 2009 16 / 35

  5. Simple measures One of the simplest descriptions is the length P of the perimeter of an object The obvious measure of perimeter-length is the number of edge √ Intuitively we would like to set a = 1 and b = 2 pixels. That is, pixel that do belong to the object, but have a neighbor that belong to the background. It is, however, possible to show that the length of the perimeter will be slightly overestimated with these values A more precise measure is to assume that each pixel-center is a corner in a polygon The optimal weights for a and b (in least square sense) will The length of the perimeter is given by depend on the curviness of the perimeter If the perimeter is a straight line (!?) a = 0 . 948 and b = 1 . 343 P = a · N e + b · N o will be optimal Christina Olsén (CS, UmU) Representation and description March 3, 2009 17 / 35 Christina Olsén (CS, UmU) Representation and description March 3, 2009 18 / 35 We can approximate the area of an object with the number of The diameter of an object is defined as pixels belonging to the object More accurate measures is, however, obtained by using a Diam ( B ) = max i , j [ D ( p i , p j )] polygonal approximation The area of a polygon segment (with one corner in the origin) is where D is a metric given by The line that passes through the points p i and p j that defines the diameter is called the main axis of the object dA = x 2 y 1 − 1 2 x 1 y 1 − 1 2 x 2 y 2 + 1 The curviness of the perimeter can be obtained by calculating 2 ( x 2 − x 1 )( y 1 − y 2 ) the angle between two consecutive line-segments of the polygonal approximation The curvature at point p j of the curve { p i } N i = 1 is also given by c = || p j − 1 − 2 p j + p j + 1 || 2 where p i ∈ R 2 Christina Olsén (CS, UmU) Representation and description March 3, 2009 19 / 35 Christina Olsén (CS, UmU) Representation and description March 3, 2009 20 / 35

  6. The area of the entire polygon is then N b A = 1 � x i y i + 1 − x i + 1 y i P 2 A = 11 . 9249 P 2 A = 0 . 8014 P 2 A = 1 . 2536 2 i = 1 A circle of radius r has the area A = π r 2 and the length of the perimeter is P = 2 r π so by defining the quotient P 2 A = P 2 4 π A we have a measurement that is 1 if the object is a circle. The larger the measurement the less circle-like is the object. Christina Olsén (CS, UmU) Representation and description March 3, 2009 21 / 35 Christina Olsén (CS, UmU) Representation and description March 3, 2009 22 / 35 Shape The quotient between the length of the main axis and the largest width orthogonal to the main axis is called the eccentricity of A measure of the shape of the object can be obtained according to: the object. Calculate the chain code for the object 1 Given a order of the shape we can find the rectangle that best approximates the eccentricity of an object Calculate the difference code for the chain code 2 The rectangle is rotated so that it’s main axis coincide with the Rotate the code so that it is minimal 3 one of the object This number is called the shape number of the object 4 This rectangle defines a re-sampling grid The length of the number is called the order of the shape 5 The shape number is then calculated on the re-sampled object Christina Olsén (CS, UmU) Representation and description March 3, 2009 23 / 35 Christina Olsén (CS, UmU) Representation and description March 3, 2009 24 / 35

Recommend


More recommend