Ulrik Söderström ulrik.soderstrom@tfe.umu.se 2 Feb 207 Representation and description
Representation and description Representation involves making object definitions more suitable for computer interpretations Description is to quantify our representation of objects First segmentation, then representation, and finally description 2
3 Invariances In all representation it is desirable to chose a method that is Translational invariance Size invariance Rotational invariance ]), [ ), ( ( )), ( ( y x y x f r y x f r ]), [ ), ( ( )), ( ( y x y x f r y x f r cos sin sin cos ), ( )), ( ( y x f r y x f r
Example Source image (6x6) Rotated 27 deg. 4
Source image (64x64) Rotated 27 deg. 5
Representations An external representation is based upon the outer borders (edges) of the object An internal representation is based upon the interior of an area/object (color, texture etc.) 6
Chain coding Chain coding consist of walking around the periphery of the object step by step while recording directions at each pixel Definition of directions (d 4 and d 8 ) 7
Digital boundary After resampling 8
d 4 chain code d 8 chain code 9
The chain code information table will have the same length as the periphery of the object. In many cases this will be unreasonably long It could be reduced by resampling the image with a lower resolution. This will also reduce noise The chain code is very much dependent on the starting point 0
To reduce this dependence we see the code as a circular number with n digits When circulating the code, we look for the smallest number, when the chain code is interpreted as an integer. This will result in a code that is independent of starting point. Example: 025004453 => 004453025
To make the code rotationally invariant we record the differences in direction (counter clockwise) instead of the absolute directions This representation will than be rotationally invariant Example 0034603647 => 03223363 2
Polygonal approximation Objects can also be represented by polygons i.e. a series of boarder points connected by straight lines A polygon should, with as few points as possible, present the basic characteristics of the object 3
Minimum perimeter polygons Enclose the shape with cells Rubber band contained within the cells Error is max 2d d = width of cells 4
Merging. Merge points along a border until a leastsquare fit error threshold is reached 2. Set the error to 0 3. Repeat step and 2 A new line is not started until the error threshold is reached -> incorrect corners 5
Splitting Split the shape into parts until a criterion is reached Finds important (prominent) edges 6
Splitting algorithm. Set i= 2. Mark the two points on the border that have the largest distance from each other with p 3. Connect the points with a polygon 4. Find the point, on the border, that has the largest distance to the line in 3. If this distance is larger than a threshold level, mark the point with p i 5. Increase i one step 6. If no points have been added, stop else goto 3 7
Signatures Describe the shape as a D-function e.g. distance to center, based on angle 8
Boundary segments Use a set of features to represent the boundary Only useful for large boundaries with similar shapes 9
Description To quantify a representation of an object Properties like length, curvature etc. Boundary descriptors Region descriptors 20
Length One of the simplest measurements is to find the length P of the perimeter of an object. This is done by calculating the number of border pixels i.e. the number of pixels that has at least one background neighbour 2
This can be done more exact by assuming that the center of a pixel is a center of a polygon. 22
The diameter of an object is defined as: Diam(B)= max[d(p i, p j,)] Where D is any metric The line passing throw p i and p j is called the major axis The curvature of the periphery is the angle between two line segments 23
Area We can approximate area with the number of pixels in an object, but we get a more exact representation if we see every pixel centre as a corners of a polygon Than the area will be (one corner in origo) 24
25 And the total area will be ) ( 2 ) )( ( 2 2 2 2 2 2 2 2 2 y x y x y y x x y x y x y x da N b i i i i y x y x A 2
One way of measuring shape is P2 A 2 P 4A P =perimeter and A is the area of the object. A perfect circle has P 2A = 26
27
Shape numbers. Calculate the chain code of the object 2. Calculate the difference code for the chain code 3. Rotate the code to make it translational invariant This integer is called the shape measurement of the object. The number of digits is the shape number of the object. 28
29
Excentricity The relation between the length of the main axis and the largest width perpendicular to the main axis is called excentricity Given an order of the shape we can find the rectangle that is the best approximation of the objects excentricity 30
The rectangle is adjusted so it s main axis coincide with the objects main axis This rectangle defines a resampling grid The shape measurement is then calculated on the resampling object 3
32
33 Create complex numbers from coordinates The Fourier transform of s(k) The inverse Fourier transform Fourier descriptors ) ( ) ( ) ( k jy k x k s 0 / 2 ) ( ) ( K k K uk j e k s K u a 0 / 2 ) ( ) ( K u K uk j e u a k s 0 / 2 ) ( ) ˆ( P u K uk j e u a k s
34
Regional descriptors Describes the inside of a region Area Compactness Perimeter 2 / Area Dimensionless = not sensitive to size 35
Topological descriptors Not sensitive to deformation Quite simple descriptors Euler number Connected components - holes 36
Texture No standard to define texture Smoothness, coarseness, regularity Statistical approaches Histogram, entropy, etc. Spectral approaches Fourier representation Frequencies in the texture 37
Principal components The information is compacted in descending order The first principal component has most information The entire region is represented sparsely Principal information can be compared between different regions. 38
Regionprops Useful function in MATLAB Measures a set of properties for objects in an image The image can be binary or grayscale all Shape measurements Pixel value measurements Used for grayscale 39