Blob Analysis

Embed Size (px)

Citation preview

  • 8/3/2019 Blob Analysis

    1/28

    1

    BLOBsLecture on the image part (5)

    Automatic Perception 9

    Thomas Moeslund

    Computer Vision and Media Technology lab.

    Aalborg University

    [email protected]

  • 8/3/2019 Blob Analysis

    2/28

    2

    Fundamental Steps in Computer Vision

    Knowledge baseProblem

    domain Image

    acquisition

    Preprocessing

    SegmentationRepresentation

    and description

    Recognition

    and

    InterpretationResult

    Point 1: 22,33

    Point 2: 24, 39

    ..

    Actor sitting

    So far:

    Preprocessing Segmentation

    Today

    BLOBs

    Segmentation

    Representation

    Feature extraction

    Representation

  • 8/3/2019 Blob Analysis

    3/28

    3

    Agenda

    BLOBs

    Finding the pixels for each object

    Extracting features

    Calculate features

    For example size and shape

    Feature vector = [2,1,,3]

    Feature vector = [4,7,,0]

    .

    .

    .

    .

    .

    .

  • 8/3/2019 Blob Analysis

    4/28

    4

    BLOBwhat is it?

    Blob versus BLOB

    BLOB = Binary Large Object

    Also know as a Particle

    .

    .

    .

  • 8/3/2019 Blob Analysis

    5/28

    5

    What can BLOBs be used for?

    Isolate the different objects (BLOBs)

    Represented as a list of pixels

    Representing each object (BLOB) by a setof features (=characteristics)

    Calculated from the list of pixels

    For example the position and size of an object

  • 8/3/2019 Blob Analysis

    6/28

    6

    Why calculate features for a BLOB? When more objects are present after segmentation,

    how will you figure out which is the one ofinterest? (very relevant for your projects!)

    Solution: Make a model of the object

    you are looking for

    Calculate its characteristics (features)

    Calculate the characteristics (features) of each BLOB inthe image

    Compare the features of each BLOB with the featuresof the model

    The best match defines the object

  • 8/3/2019 Blob Analysis

    7/28

    7

    Isolating a BLOB

    What we want:

    For each object in the image, a list with its pixels

    How do we get that? Connected component analysis

    (Region growing)

    Define: connectivity

    Who are my neighbors? 4-connected

    8-connected

  • 8/3/2019 Blob Analysis

    8/28

    8

    Connected component analysis

    Binary image (0,1)

    Seed point: where do we start?

    Grassfire concept

    Delete (burn) the pixels we visit

    Visit all CONNECTED (4 or 8) neighbors

    3

    4

    12

  • 8/3/2019 Blob Analysis

    9/28

    9

    Connected component analysis

    3

    4

    1

    2

    x 3

    4

    1

    2

    xx 3

    4

    1

    2

    xx x

  • 8/3/2019 Blob Analysis

    10/28

    10

    Connected component analysis

    3

    4

    1

    2

    x

    3

    4

    12

    xx

    34

    1

    2

    xx xx

    x

    x

    x

    x

    x

  • 8/3/2019 Blob Analysis

    11/28

    11

    Connected component analysis

    3

    4

    12

    x 3

    4

    1

    2

    xx 3

    4

    1

    2

    xx xx

    x

    x

    x

    x

    xxx x

    Recursive algorithm

    (show: blob, TH, analyze (set: outlines))

  • 8/3/2019 Blob Analysis

    12/28

    12

    Extracting features

  • 8/3/2019 Blob Analysis

    13/28

    13

    Agenda: Extracting features

    What is the purpose?

    What kind of features can be extracted and

    how?

    Feature matching

    Relating Features and Pattern Recognition

  • 8/3/2019 Blob Analysis

    14/28

    14

    Why feature extracting?

    Generate some entities (numbers) that can be used in patternrecognition For example size and shape

    From image operations to mathematical operations Input: a list of pixel positions

    Output: Feature vector First step: remove too small, too big, and border BLOBs

    (show: AuPbSn40, TH, analyze (set: outlines, size, border))

    Feature vector = [2,1,,3]

    Feature vector = [4,7,,0]

    .

    .

    .

    .

    .

    .

    .

    .

    .

    .

  • 8/3/2019 Blob Analysis

    15/28

    15

    Features

  • 8/3/2019 Blob Analysis

    16/28

    16

    Features

    Area (number of pixels)

    Used to remove noise (small/big objects)

    Number of holes in the object

    Holes area

    Total area = area + holes area

    Perimeter = length of contour

    Bounding box Upper left corner

    Height and width of bounding box

    One BLOB

  • 8/3/2019 Blob Analysis

    17/28

    17

    Features

    Center of mass (xm,ym)

    Compactness

    Minimum for a disc

    Minimum for a rectangle

    Circularity Longest distance (Ferets diameter)

    Orientation of the object

    Orientation of Ferets diameter

    objecti

    im xx

    objecti

    im yy

    areaPerimeter

    2

    Area

    Perimeter2

    HeightWidth

    Area

  • 8/3/2019 Blob Analysis

    18/28

    18

    Features

    Shapes

    Bounding box ratio: Height / Width

    Says something about the elongation How well does the object fit a rectangle

    Can be derived from: Area and Perimeter

    How well does the object fit an ellipse

    Can be derived from: Area and Perimeter Many other features: see the notes for today and

    be creative!

    Degree of elongation

  • 8/3/2019 Blob Analysis

    19/28

    19

    Feature Matching

  • 8/3/2019 Blob Analysis

    20/28

    20

    Feature Matching

    But what if more BLOB have the samenumber of TRUEs?

    Solution: Measure the DISTANCE from eachBLOB to the model and pick the BLOB withthe shortest distance, i.e. the BLOB mostsimilar to the model

    A much better method as it is based on statistics!

    How do we define a distance?

  • 8/3/2019 Blob Analysis

    21/28

    21

    Feature Matching

    Solution: Measure the DISTANCE from the

    BLOB to each of the models and pick the

    model with the shortest distance, i.e. themodel most similar to the BLOB

    How do we define a distance?

  • 8/3/2019 Blob Analysis

    22/28

    22

    Feature Matching

    Distance in feature-space

    Feature 1: Area

    Feature 2: Circularity

    2 dimensional feature space

    BLOB:

    Model types:

    Feature 1

    Feature 2MATCH!

  • 8/3/2019 Blob Analysis

    23/28

    23

    Feature Matching: Distance

    features

    j

    fjifjfiffif BMBMBMiD#

    1

    2

    ,

    2

    2,2

    2

    1,1 )()()()(

    Feature 1

    Feature 2

    Euclidean distance

  • 8/3/2019 Blob Analysis

    24/28

    24

    Feature Matching

    Problem:

    Area is measured in 1000s and circularity [0,1]

    That means that the area will dominate thedistance measure completely!

    Solutions:

    Use ratios: So W/H is a better feature than W or H

    Normalize all feature to the same interval, e.g., [0,1] Let some of the features be TRUE/FALSE and

    others Euclidean distances

  • 8/3/2019 Blob Analysis

    25/28

    25

    Feature Matching

    features

    j

    fjifjjfiffif BMWBMWBMWiD#

    1

    2

    ,

    2

    2,22

    2

    1,11)()()()(

    What if we trust some features more thanothers?

    For example, with small objects the perimetermight be uncertain

    Solution: Weigthing

    features

    j

    fjifjfiffif BMBMBMiD#

    1

    2

    ,

    2

    2,2

    2

    1,1)()()()(

  • 8/3/2019 Blob Analysis

    26/28

    26

    What to remember

    BLOB = Binary Large OBject Find a list of pixels for each object

    Connectivity: 4 versus 8 connected

    Connected component analysis Features (=characteristics) of an object

    Many exist

    Many more can be derived

    Feature matching

    TRUE/FALSE Euclidean distance

    Normalize

    Learn the features of the model

  • 8/3/2019 Blob Analysis

    27/28

    27

    Exercises Questions to the lecture?

    What was good about the lecture and what could have beenbetter?

    Discuss the PE-questions

    In what order will the pixels be marked if a

    4-connected kernel is used? 8-connected kernel is used?

    Calculate the perimeter of this object using

    different distance measures

    Euclidean distance, city-block (manhatten) distance, chessboard distance

    Find out what they are by searching the internet

    Play around in ImageJ with the BLOB analysis (Analyze)

    perhaps you can combine it with morphology

    Find the approximate centers of all dots in the image: dots-lines

  • 8/3/2019 Blob Analysis

    28/28

    28

    Exercises

    If youre using images in you project: Which features could you imagine using?

    Imagine you are using the Area of a BLOB as a feature in

    your project. Find a way to normalize the feature matching,so the result always is in the interval: [0,1] (where 0 meansa very poor match and 1 means a perfect match)

    What features can be used to classify the different letters inthe image: alphabeth?

    Draw the signature for a box What is the problem with this signature compared with thesignature for the circle?

    How can this problem be handled?

    How is region growing different from connectedcomponent analysis?