63
Gray-level morphology. Shape description 1

Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

Gray-level morphology. Shape description

1

Page 2: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

Today

  Gray scale morphology: an overview of basic principles

  We will start shape description and representation (Sonka Chapter 8)

  Note: some slides of this lecture are adapted from Brian Morse, Computer Vision I, http://morse.cs.byu.edu/650/home/index.php

2

Page 3: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

Gray-scale morphology

  basic ideas of binary morphology extend to grayscale

  logical operations convert to similar arithmetic ones: union becomes maximum, intersection becomes minimum, etc.

3

Page 4: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

Images, Functions, and Umbras

  We will discuss greyscale morphology by first considering one-variable functions (signals).

  The umbra of a function/signal/image f (x) is the set of all positions/values (x, v) such that value v is less than or equal to f(x):{(x,v) | v≤f(x)}

  This construct allows us to now consider greyscale functions as sets, like we did for binary images.

4

Page 5: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

Examples of umbra

5

Page 6: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

Grayscale dilation and erosion

  Grayscale morphology can thus be thought of as binary morphology of the umbras:

Umbra (A ⊕g B) = Umbra (A) ⊕ Umbra (B) Umbra (A ⊖g B) = Umbra (A) ⊖ Umbra (B)

6

Page 7: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

Example

  Let’s dilate a 1-d function f(x) by the structuring element g(x) = 1 over the range {−1 ≤ x ≤ 1}, 0 otherwise.

  Each point in the structuring element causes the image to be increased by one intensity level (intensity dilation).

  However, the spatial spread of the structuring element causes the result at each output position x to be the maximum of the 3-pixel neighborhood. The net effect of these together is (for this case)

  f(x)⊕g g(x)=max{f(x−1)+1,f(x)+1,f(x+1)+1}

7

Page 8: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

8

Page 9: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

Gray-scale dilation

9

Page 10: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

10

Page 11: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

Grey-scale erosion

11

Page 12: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

12

Page 13: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

Umbras of 2D images

  We can extend these ideas to 2-dimensional images I(x, y) by considering the sets of positions (x, y) and possible intensities

  I:{(x,y,v | v≤I(x,y)}

13

Page 14: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

Gray-scale image dilation: example 1

14

Page 15: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

Gray-scale image dilation and erosion: example 2

15

Page 16: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

Gray-scale opening

16

Page 17: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

Gray-scale closing

17

Page 18: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

Gray-scale opening and closing: example

18

Page 19: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

Shape representation

  Represents the process of transition from the image space to the feature space

  Region-based   Contour-based Also Motion representation Event representation etc.

19

Page 20: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

Shape descriptors

20

Page 21: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

21

Region description and representation

Reading:   Sonka 8.3   optional

  Bobick and Davis, “The recognition of human movement using temporal templates”, IEEE Transactions on Pattern Analysis and Machine Intelligence, March 2001.

Page 22: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

22

Region Descriptors   Reading: 8.3.1   A descriptor is a number or set of numbers that

describes some property of a shape   Can’t usually reconstruct the shape, but can be used to

distinguish shapes   Examples:

  Area   Perimeter   Compactness   Eccentricity   Euler Number (count components and holes)

  Practical considerations:   Inside or outside borders?   4- vs. 8-connected perimeters?   Complicated regions?

Page 23: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

23

Compactness

The compactness measure is independent of linear transformations if the outer boundary is measured

Most compact shape: the circle : 4π compactness

Page 24: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

24

Eccentricity

  The ratio of the longest chord compared to the chord perpendicular to it;

  measure of how non-circular a shape is

Page 25: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

25

Rectangularity

http://www.mobileye.com/

Page 26: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

26

Elongation

Can be measured as the ratio between the length and width of the region bounding rectangle

This measure can not be used in curved regions!

Page 27: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

27

Elongation (morphological measure)

Page 28: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

28

Examples of shapes that can be described via elongation (1)

Page 29: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

29

Examples of shapes that can be described via elongation (2)

Stojmenovic, Žunic (2008) Measuring elongation from shape boundary

Page 30: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

30

Concavities

  Read section 8.3.3   Differences between object and its convex

hull are holes or concavities.   For complex shapes: We can build a

hierarchical representation of concavities (concavity tree)

Page 31: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

31

Contour partitioning via concavity analysis

Cronin, “Visualizing concave and convex partitioning of 2D contours”, Pattern Recognition Letters, 2003.

Page 32: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

32

Statistical region descriptors: moments   Read section 8.3.2   Region moment representations interpret a normalized

gray level image function as a probability density of a 2D random variable.

  Properties of this random variable can be described using statistical characteristics - moments.

  Assuming that non-zero pixel values represent regions, moments can be used for binary or gray level region description.

  where i,j are the region point co-ordinates (pixel co-ordinates in digitized images).

Page 33: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

33

Moments

  Represent a global description of a shape layout

  Combine area, compactness, irregularity, and higher order descriptions together

  Associated with statistical pattern recognition

  Not able to handle shape occlusion

Page 34: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

34

Central moments

Page 35: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

35

Higher order moments

Page 36: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

36

Central and normalized bidimensional moments

Page 37: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

37

Symmetry analysis with moments

Page 38: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

38

Example of shape descriptors applied to motion analysis

Bobick and Davis “The recognition of human movement using temporal templates”, IEEE Transactions on Pattern Analysis and Machine Intelligence, March 2001.

Main ideas:   analyzing the shape of motion leads to action recognition   the shape of motion is considered separately from the shape of the object in motion (here, a human silhouette)

Page 39: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

39

Motion energy image (MEI)

  a representation of the spatial distribution of motion (‘where’)

Page 40: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

40

Page 41: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

41

Motion History Image (MHI)

  Describes how the motion evolves over a predefined length of time

  pixel intensity is a function of the motion history at that location, where brighter values correspond to more recent motion.

Page 42: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

42

Page 43: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

43

How are these two templates described?

  7 Hu moments are computed for each motion template/view; the Hu moments are invariant to rotation/scale/translation

Page 44: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

44

Motion recognition process

Page 45: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

Contour-based shape description

  Reading   Sonka 8.2   Optional: Jeong and Radke, elliptical

Fourier Descriptors

45

Page 46: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

Simple geometric descriptors

46

Page 47: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

Contour encoding: chains

47

Page 48: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

Chain codes and variations

48

Page 49: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

Chain codes: smoothing and resampling

49

Page 50: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

50

Page 51: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

51

Page 52: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

Points of extreme curvature

52

Page 53: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

Convex hulls

53

Page 54: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

Fourier descriptors

54

Page 55: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

Fourier descriptors (cont’d)

55

Page 56: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

Why Fourier descriptors?

56

Page 57: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

57

Page 58: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

58

Page 59: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

59

Page 60: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

Example of using contour descriptors

60

Page 61: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

61

Page 62: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

62

Page 63: Gray-level morphology. Shape description - UVic.caaalbu/computer vision 2010/L24-25. Gray level... · Images, Functions, and Umbras We will discuss greyscale morphology by first considering

63