71
Computational Photography Tamara Berg Features

Computational Photography

  • Upload
    taite

  • View
    36

  • Download
    0

Embed Size (px)

DESCRIPTION

Computational Photography. Tamara Berg Features. Representing Images. Keep all the pixels!. Pros? Cons?. 2 nd Try. Compute average pixel. Pros? Cons?. 3rd Try. Photo by: marielito. Represent the image as a spatial grid of average pixel colors Pros? Cons?. QBIC system. - PowerPoint PPT Presentation

Citation preview

Page 1: Computational Photography

Computational Photography

Tamara BergFeatures

Page 2: Computational Photography

Representing Images

Keep all the pixels!

Pros? Cons?

Page 3: Computational Photography

2nd Try

Compute average pixel

Pros? Cons?

Page 4: Computational Photography

3rd Try

Represent the image as a spatial grid of average pixel colorsPros?Cons?

Photo by: marielito

Page 5: Computational Photography

QBIC system

• First content based image retrieval system – Query by image content (QBIC) – IBM 1995– QBIC interprets the virtual canvas as a grid of coloured areas,

then matches this grid to other images stored in the database.

QBIC link

Page 6: Computational Photography

Feature Choices

Page 7: Computational Photography

Global vs Local?

Depends whether you want whole or local image similarity

Person

Beach

Page 8: Computational Photography

Feature types!

The representation of these two umbrella’s should be similar…. Under a color based representation they look completely different!

Page 9: Computational Photography

Image Features

Global vs Local – depends on the task

Feature Types: color histograms (color), texture histograms (texture), SIFT (shape)

Outline

Page 10: Computational Photography

Global Features

• The “gist” of a scene: Oliva & Torralba (2001)

source: Svetlana Lazebnik

Page 11: Computational Photography

Scene Descriptor

Hays and Efros, SIGGRAPH 2007

Compute oriented edge response at multiple scales (5 spatial scales, 6 orientations)

Page 12: Computational Photography

Scene Descriptor

Gist scene descriptor (Oliva and Torralba 2001)“semantic” descriptor of image compositionaggregated edge responses over 4x4 windowsscenes tend to be semantically similar under this descriptor if very close

Hays and Efros, SIGGRAPH 2007

Page 13: Computational Photography

Local Features

source: Svetlana Lazebnik

Feature points (locations) + feature descriptors

Page 14: Computational Photography

Why extract features?• Motivation: panorama stitching– We have two images – how do we combine them?

source: Svetlana Lazebnik

Page 15: Computational Photography

Why extract features?• Motivation: panorama stitching– We have two images – how do we combine them?

Step 1: extract features

Step 2: match features

source: Svetlana Lazebnik

Page 16: Computational Photography

Why extract features?• Motivation: panorama stitching– We have two images – how do we combine them?

Step 1: extract features

Step 2: match features

Step 3: align images

source: Svetlana Lazebnik

Page 17: Computational Photography

Characteristics of good features

• Repeatability– The same feature can be found in several images despite geometric and

photometric transformations • Saliency

– Each feature has a distinctive description• Compactness and efficiency

– Many fewer features than image pixels• Locality

– A feature occupies a relatively small area of the image; robust to clutter and occlusion

source: Svetlana Lazebnik

Page 18: Computational Photography

Applications • Feature points are used for:– Retrieval– Indexing– Motion tracking– Image alignment – 3D reconstruction– Object recognition– Indexing and database retrieval– Robot navigation

source: Svetlana Lazebnik

Page 19: Computational Photography

Feature Types

Shape! Color!

Texture!

Page 20: Computational Photography

Color Features

Page 21: Computational Photography

RGB Colorspace

• Primaries are monochromatic lights (for monitors, they correspond to the three types of phosphors)

RGB matching functions

source: Svetlana Lazebnik

Page 22: Computational Photography

HSV Colorspace

• Perceptually meaningful dimensions: Hue, Saturation, Value (Intensity)

source: Svetlana Lazebnik

Page 23: Computational Photography

Color Histograms

Page 24: Computational Photography

Uses of color in computer visionColor histograms for indexing and retrieval

Swain and Ballard, Color Indexing, IJCV 1991.source: Svetlana Lazebnik

Page 25: Computational Photography

Uses of color in computer vision

Skin detection

M. Jones and J. Rehg, Statistical Color Models with Application to Skin Detection, IJCV 2002.

source: Svetlana Lazebnik

Page 26: Computational Photography

Uses of color in computer vision

Image segmentation and retrieval

C. Carson, S. Belongie, H. Greenspan, and Ji. Malik, Blobworld: Image segmentation using Expectation-Maximization and its application to image querying, ICVIS 1999. source: Svetlana Lazebnik

Page 27: Computational Photography

Color features

Pros/Cons?

Page 28: Computational Photography

Interaction of light and surfaces• Reflected color is the result of

interaction of light source spectrum with surface reflectance

source: Svetlana Lazebnik

Page 29: Computational Photography

Interaction of light and surfaces

Olafur Eliasson, Room for one color

source: Svetlana Lazebnik

Page 30: Computational Photography

Texture Features

Page 31: Computational Photography

Texture Features• Texture is characterized by the repetition of basic

elements or textons• For stochastic textures, it is the identity of the

textons, not their spatial arrangement, that matters

Julesz, 1981; Cula & Dana, 2001; Leung & Malik 2001; Mori, Belongie & Malik, 2001; Schmid 2001; Varma & Zisserman, 2002, 2003; Lazebnik, Schmid & Ponce, 2003

Page 32: Computational Photography

Texture Histograms

Universal texton dictionary

histogram

Julesz, 1981; Cula & Dana, 2001; Leung & Malik 2001; Mori, Belongie & Malik, 2001; Schmid 2001; Varma & Zisserman, 2002, 2003; Lazebnik, Schmid & Ponce, 2003

Page 33: Computational Photography

Shape Features

Page 34: Computational Photography

We want invariance!!!

• Good features should be robust to all sorts of nastiness that can occur between images.

Slide source: Tom Duerig

Page 35: Computational Photography

Types of invariance

• Illumination

Slide source: Tom Duerig

Page 36: Computational Photography

Types of invariance

• Illumination• Scale

Slide source: Tom Duerig

Page 37: Computational Photography

Types of invariance

• Illumination• Scale• Rotation

Slide source: Tom Duerig

Page 38: Computational Photography

Types of invariance

• Illumination• Scale• Rotation• Affine

Slide source: Tom Duerig

Page 39: Computational Photography

Edge detection• Goal: Identify sudden changes

(discontinuities) in an image– Intuitively, most semantic and

shape information from the image can be encoded in the edges

– More compact than pixels

• Ideal: artist’s line drawing (but artist is also using object-level knowledge)

Source: D. Lowe

Page 40: Computational Photography

Origin of edges• Edges are caused by a variety of factors:

depth discontinuity

surface color discontinuity

illumination discontinuity

surface normal discontinuity

Source: Steve Seitz

Page 41: Computational Photography

Characterizing edges• An edge is a place of rapid change in the

image intensity functionimage

intensity function(along horizontal scanline) first derivative

edges correspond toextrema of derivative

source: Svetlana Lazebnik

Page 42: Computational Photography

Finite difference filters

• Other approximations of derivative filters exist:

Source: K. Grauman

Page 43: Computational Photography

Finite differences: example

• Which one is the gradient in the x-direction (resp. y-direction)?source: Svetlana Lazebnik

Page 44: Computational Photography

How to achieve illumination invariance

• Use edges instead of raw values

Slide source: Tom Duerig

Page 45: Computational Photography

Local Features

source: Svetlana Lazebnik

Feature points (locations) + feature descriptors

Page 46: Computational Photography

Local Features

source: Svetlana Lazebnik

Feature points (locations) + feature descriptors

Where should we put features?

Page 47: Computational Photography

Local Features

source: Svetlana Lazebnik

Feature points (locations) + feature descriptors

How should we describe them?

Page 48: Computational Photography

Where to put features?

source: Svetlana Lazebnik Edges

Page 49: Computational Photography

Finding Corners

• Key property: in the region around a corner, image gradient has two or more dominant directions

• Corners are repeatable and distinctive

C.Harris and M.Stephens. "A Combined Corner and Edge Detector.“ Proceedings of the 4th Alvey Vision Conference: pages 147--151.

source: Svetlana Lazebnik

Page 50: Computational Photography

Corner Detection: Basic Idea

• We should easily recognize the point by looking through a small window

• Shifting a window in any direction should give a large change in intensity

“edge”:no change along the edge direction

“corner”:significant change in all directions

“flat” region:no change in all directionsSource: A. Efros source: Svetlana Lazebnik

Page 51: Computational Photography

Harris Detector: StepsCompute corner response R

source: Svetlana Lazebnik

Page 52: Computational Photography

Harris Detector: StepsFind points with large corner response: R>threshold

source: Svetlana Lazebnik

Page 53: Computational Photography

Harris Detector: StepsTake only the points of local maxima of R

source: Svetlana Lazebnik

Page 54: Computational Photography

Harris Detector: Steps

source: Svetlana Lazebnik

Page 55: Computational Photography

Local Features

source: Svetlana Lazebnik

Feature points (locations) + feature descriptors

How should we describe them?

Page 56: Computational Photography

Shape Context

• (a) and (b) are the sampled edge points of the two shapes. (c) is the diagram of the log-polar bins used to compute the shape context. (d) is the shape context for the circle, (e) is that for the diamond, and (f) is that for the triangle. As can be seen, since (d) and (e) are the shape contexts for two closely related points, they are quite similar, while the shape context in (f) is very different.

Page 57: Computational Photography

Geometric Blur

Page 58: Computational Photography

Geometric Blur

Page 59: Computational Photography

Geometric Blur

Page 60: Computational Photography

SIFT

• SIFT (Scale Invariant Feature Transform) - stable robust and distinctive local features

• Current most popular shape based feature – description of local shape (oriented edges) around a keypoint

Page 61: Computational Photography

Feature descriptor

Page 62: Computational Photography

Feature descriptor

• Based on 16*16 patches• 4*4 subregions• 8 bins in each subregion• 4*4*8=128 dimensions in total

Page 63: Computational Photography

Rotation Invariance

• Rotate all features to go the same way in a determined manner

• A histogram is formed by quantizing the orientations into 36 bins;

• Peaks in the histogram correspond to the orientations of the patch;

Page 64: Computational Photography

Eliminating rotation ambiguity• To assign a unique orientation to circular

image windows:– Create histogram of local gradient directions in

the patch– Assign canonical orientation at peak of

smoothed histogram

0 2 p

Page 65: Computational Photography

Rotation Invariance

Slide source: Tom Duerig

Page 66: Computational Photography

Actual SIFT stage output

Page 67: Computational Photography

Application: object recognition

• The SIFT features of training images are extracted and stored

• For a query image1. Extract SIFT feature2. Efficient nearest neighbor indexing3. 3 keypoints, Geometry verification

Page 68: Computational Photography
Page 69: Computational Photography
Page 70: Computational Photography
Page 71: Computational Photography

For next class

• Read big data intro papers (links on course website)