35
Prof. Feng Liu Spring 2020 http://www.cs.pdx.edu/~fliu/courses/cs510/ 05/05/2020

Prof. Feng Liuweb.cecs.pdx.edu/~fliu/courses/cs510/lectures/Lecture11.pdfPicture Surface Selection 7 A plan view (xz slice) of a scene.The extracted camera locations are shown in red,

  • Upload
    others

  • View
    7

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Prof. Feng Liuweb.cecs.pdx.edu/~fliu/courses/cs510/lectures/Lecture11.pdfPicture Surface Selection 7 A plan view (xz slice) of a scene.The extracted camera locations are shown in red,

Prof. Feng Liu

Spring 2020

http://www.cs.pdx.edu/~fliu/courses/cs510/

05/05/2020

Page 2: Prof. Feng Liuweb.cecs.pdx.edu/~fliu/courses/cs510/lectures/Lecture11.pdfPicture Surface Selection 7 A plan view (xz slice) of a scene.The extracted camera locations are shown in red,

Last Time

Panorama

2

Page 3: Prof. Feng Liuweb.cecs.pdx.edu/~fliu/courses/cs510/lectures/Lecture11.pdfPicture Surface Selection 7 A plan view (xz slice) of a scene.The extracted camera locations are shown in red,

Demo

http://graphics.stanford.edu/courses/cs178/applets/projection.html 3

Page 4: Prof. Feng Liuweb.cecs.pdx.edu/~fliu/courses/cs510/lectures/Lecture11.pdfPicture Surface Selection 7 A plan view (xz slice) of a scene.The extracted camera locations are shown in red,

Multi-perspective Panorama

4

Reprint from Seitz and Kim 03

Page 5: Prof. Feng Liuweb.cecs.pdx.edu/~fliu/courses/cs510/lectures/Lecture11.pdfPicture Surface Selection 7 A plan view (xz slice) of a scene.The extracted camera locations are shown in red,

Multi-perspective Panorama

5

A. Agarwala, M. Agrawala, M. Cohen, D. Salesin, R. Szeliski. Photographing long scenes with multi-viewpoint panoramas. SIGGRAPH 2006

Page 6: Prof. Feng Liuweb.cecs.pdx.edu/~fliu/courses/cs510/lectures/Lecture11.pdfPicture Surface Selection 7 A plan view (xz slice) of a scene.The extracted camera locations are shown in red,

A Good Multiple Perspective Panorama

Each object in the scene is rendered from a viewpoint

roughly in front of it to avoid perspective distortion.

The panoramas are composed of large regions of

linear perspective seen from a viewpoint where a

person would naturally stand (for example, a city block

is viewed from across the street, rather than from

some faraway viewpoint).

Local perspective effects are evident; objects closer to

the image plane are larger than objects further away,

and multiple vanishing points can be seen.

The seams between these perspective regions do not

draw attention

6

Page 7: Prof. Feng Liuweb.cecs.pdx.edu/~fliu/courses/cs510/lectures/Lecture11.pdfPicture Surface Selection 7 A plan view (xz slice) of a scene.The extracted camera locations are shown in red,

Picture Surface Selection

7

A plan view (xz slice) of a scene. The extracted camera locations are shown in red, and the recovered 3D scene points in black. The blue polyline of the picture surface is drawn by the user to follow the building facades. The y-axis of the scene extends out of the page; the polyline is swept up and down the y-axis to form the picture surface.

z

x

Reprint from Agarwala et al. 2006

Page 8: Prof. Feng Liuweb.cecs.pdx.edu/~fliu/courses/cs510/lectures/Lecture11.pdfPicture Surface Selection 7 A plan view (xz slice) of a scene.The extracted camera locations are shown in red,

Project Images onto Picture Surface

8

Reprint from Agarwala et al. 2006

Page 9: Prof. Feng Liuweb.cecs.pdx.edu/~fliu/courses/cs510/lectures/Lecture11.pdfPicture Surface Selection 7 A plan view (xz slice) of a scene.The extracted camera locations are shown in red,

View Point Selection

9

1.Each image is a view2.Pick a good view for each pixel

Reprint from Agarwala et al. 2006

Page 10: Prof. Feng Liuweb.cecs.pdx.edu/~fliu/courses/cs510/lectures/Lecture11.pdfPicture Surface Selection 7 A plan view (xz slice) of a scene.The extracted camera locations are shown in red,

Examples

10

http://grail.cs.washington.edu/projects/multipano/

Page 11: Prof. Feng Liuweb.cecs.pdx.edu/~fliu/courses/cs510/lectures/Lecture11.pdfPicture Surface Selection 7 A plan view (xz slice) of a scene.The extracted camera locations are shown in red,

Today

Segmentation

11

Input Output

With slides by C. Dyer

Page 12: Prof. Feng Liuweb.cecs.pdx.edu/~fliu/courses/cs510/lectures/Lecture11.pdfPicture Surface Selection 7 A plan view (xz slice) of a scene.The extracted camera locations are shown in red,

Image Segmentation

How do we know which groups of pixels in a

digital image correspond to the objects to be

analyzed?

◼ Objects may be uniformly darker or brighter than

the background against which they appear

Black characters imaged against the white background of

a page

Bright, dense potatoes imaged against a background that

is transparent to X-rays

◼ Challenging for many other cases

12Credit: C. Dyer

Page 13: Prof. Feng Liuweb.cecs.pdx.edu/~fliu/courses/cs510/lectures/Lecture11.pdfPicture Surface Selection 7 A plan view (xz slice) of a scene.The extracted camera locations are shown in red,

Image Segmentation

13

Right: USFWS Photo by Jim Rorabaugh, http://www.fws.gov/southwest/es/arizona/Reptiles.htm

Page 14: Prof. Feng Liuweb.cecs.pdx.edu/~fliu/courses/cs510/lectures/Lecture11.pdfPicture Surface Selection 7 A plan view (xz slice) of a scene.The extracted camera locations are shown in red,

Image Segmentation: Definitions

“Segmentation is the process of partitioning an

image into semantically interpretable regions.”

◼ H. Barrow and J. Tennenbaum, 1978

“An image segmentation is the partition of an

image into a set of non-overlapping regions

whose union is the entire image. The purpose

of segmentation is to decompose the image

into parts that are meaningful with respect to a

particular application.”

◼ R. Haralick and L. Shapiro, 1992

14Credit: C. Dyer

Page 15: Prof. Feng Liuweb.cecs.pdx.edu/~fliu/courses/cs510/lectures/Lecture11.pdfPicture Surface Selection 7 A plan view (xz slice) of a scene.The extracted camera locations are shown in red,

Image Segmentation: Definitions

“The neurophysiologists’ and psychologists’

belief that figure and ground constituted one of

the fundamental problems in vision was

reflected in the attempts of workers in

computer vision to implement a process called

segmentation. The purpose of this process is

very much like the idea of separating figure

from ground ...”

◼ D. Marr, 1982

15Credit: C. Dyer

Page 16: Prof. Feng Liuweb.cecs.pdx.edu/~fliu/courses/cs510/lectures/Lecture11.pdfPicture Surface Selection 7 A plan view (xz slice) of a scene.The extracted camera locations are shown in red,

Segmentation methods

Automatic segmentation

◼ Mean-shift

◼ Watershed

◼ Normalized Cut Method

◼ …

Interactive segmentation

◼ Lazy snapping

◼ Grab cut

◼ Interactive geodesic segmentation

◼ …

16

Page 17: Prof. Feng Liuweb.cecs.pdx.edu/~fliu/courses/cs510/lectures/Lecture11.pdfPicture Surface Selection 7 A plan view (xz slice) of a scene.The extracted camera locations are shown in red,

Normalized Cuts and Image Segmentation

Normalized Cuts and Image Segmentation

◼ J. Shi and J. Malik, IEEE Trans. Pattern Analysis and Machine Intelligence 22(8), 1997 Citation 6417 according to Google Scholar as 2013-05-06

Citation 8698 according to Google Scholar as 2014-05-05

Citation 10032 according to Google Scholar as 2015-05-04

Citation 13215 according to Google Scholar as 2017-05-15

Citation 15712 according to Google Scholar as 2019-05-09

Citation 17148 according to Google Scholar as 2020-05-05

◼ Divisive (aka splitting, partitioning) method

◼ Hierarchical partitioning

◼ Graph-theoretic criterion for measuring goodness of

an image partition

17

Page 18: Prof. Feng Liuweb.cecs.pdx.edu/~fliu/courses/cs510/lectures/Lecture11.pdfPicture Surface Selection 7 A plan view (xz slice) of a scene.The extracted camera locations are shown in red,

Segmentation by Partition

Criterion for measuring a candidate partitioning:

◼ Affinity measure between elements within each

region is high, and the affinity between elements

across regions is low

◼ Affinity: element × element -> R+

Defines the similarity of a pair of data elements.

Examples of components of an affinity function: spatial

position, intensity, color, texture, motion.

18Credit: C. Dyer

Page 19: Prof. Feng Liuweb.cecs.pdx.edu/~fliu/courses/cs510/lectures/Lecture11.pdfPicture Surface Selection 7 A plan view (xz slice) of a scene.The extracted camera locations are shown in red,

Affinity (Similarity) Measures

Intensity

Distance

Color

Texture

Motion

19Credit: C. Dyer

Page 20: Prof. Feng Liuweb.cecs.pdx.edu/~fliu/courses/cs510/lectures/Lecture11.pdfPicture Surface Selection 7 A plan view (xz slice) of a scene.The extracted camera locations are shown in red,

Problem Formulation

Given an undirected graph G = (V, E), where V is a set of nodes, one for each data element

(e.g., pixel), and E is a set of edges with weights

representing the affinity between connected

nodes

Find the image partition that maximizes the

“association” within each region and minimizes the “disassociation” between regions

Finding the optimal partition is NP-complete

20Credit: C. Dyer

Page 21: Prof. Feng Liuweb.cecs.pdx.edu/~fliu/courses/cs510/lectures/Lecture11.pdfPicture Surface Selection 7 A plan view (xz slice) of a scene.The extracted camera locations are shown in red,

Cut

Let A, B partition G. Therefore , and

The affinity or similarity between A and B is

defined as

= total weight of edges removed

The optimal bi-partition of G is the one that

minimizes cut

Cut is biased towards small regions

21

=BA

VBA =

( )

=B,A

ijBA,ji

wcut

Credit: C. Dyer

Page 22: Prof. Feng Liuweb.cecs.pdx.edu/~fliu/courses/cs510/lectures/Lecture11.pdfPicture Surface Selection 7 A plan view (xz slice) of a scene.The extracted camera locations are shown in red,

Normalized Cut

So, instead define the normalized similarity,

called the normalized-cut(A,B), as

N-cut measures the similarity between regions (“disassociation” measure)

N-cut removes the bias based on region size (usually)

22Credit: C. Dyer

Page 23: Prof. Feng Liuweb.cecs.pdx.edu/~fliu/courses/cs510/lectures/Lecture11.pdfPicture Surface Selection 7 A plan view (xz slice) of a scene.The extracted camera locations are shown in red,

Normalized Cut

Similarly, define the “normalized association:”

Nassoc measures how similar, on average,

nodes within the groups are to each other

New goal: Find the bi-partition that minimizes

ncut(A,B) and maximizes nassoc(A,B)

But, it can be proved that ncut(A,B) = 2 –nassoc(A,B), so we can just minimize ncut: y = arg min ncut

23Credit: C. Dyer

Page 24: Prof. Feng Liuweb.cecs.pdx.edu/~fliu/courses/cs510/lectures/Lecture11.pdfPicture Surface Selection 7 A plan view (xz slice) of a scene.The extracted camera locations are shown in red,

Let y be a P = |V| dimensional vector where

Let

define the affinity of node i with all other nodes

Let D = P x P diagonal matrix:

24Credit: C. Dyer

Page 25: Prof. Feng Liuweb.cecs.pdx.edu/~fliu/courses/cs510/lectures/Lecture11.pdfPicture Surface Selection 7 A plan view (xz slice) of a scene.The extracted camera locations are shown in red,

25Credit: C. Dyer

Page 26: Prof. Feng Liuweb.cecs.pdx.edu/~fliu/courses/cs510/lectures/Lecture11.pdfPicture Surface Selection 7 A plan view (xz slice) of a scene.The extracted camera locations are shown in red,

26Credit: C. Dyer

Page 27: Prof. Feng Liuweb.cecs.pdx.edu/~fliu/courses/cs510/lectures/Lecture11.pdfPicture Surface Selection 7 A plan view (xz slice) of a scene.The extracted camera locations are shown in red,

27Credit: C. Dyer

Page 28: Prof. Feng Liuweb.cecs.pdx.edu/~fliu/courses/cs510/lectures/Lecture11.pdfPicture Surface Selection 7 A plan view (xz slice) of a scene.The extracted camera locations are shown in red,

NCUT Segmentation Algorithm

28Credit: C. Dyer

Page 29: Prof. Feng Liuweb.cecs.pdx.edu/~fliu/courses/cs510/lectures/Lecture11.pdfPicture Surface Selection 7 A plan view (xz slice) of a scene.The extracted camera locations are shown in red,

Example

29

Input image

Reprint from [Shi and Malik 97]

Page 30: Prof. Feng Liuweb.cecs.pdx.edu/~fliu/courses/cs510/lectures/Lecture11.pdfPicture Surface Selection 7 A plan view (xz slice) of a scene.The extracted camera locations are shown in red,

Eigen values and vectors

30

Subplot (a) plots the smallest eigenvectors of the generalized eigenvaluesystem (11). Subplots (b)-(f) show the eigenvectors correspondingthe second smallest to the ninth smallest eigenvalues of the system. The eigenvectors are reshaped to be the size of the image.

Reprint from [Shi and Malik 97]

Page 31: Prof. Feng Liuweb.cecs.pdx.edu/~fliu/courses/cs510/lectures/Lecture11.pdfPicture Surface Selection 7 A plan view (xz slice) of a scene.The extracted camera locations are shown in red,

31

(a) shows the original image of size 80x100. Image intensity is normalized to lie within 0 and 1. Subplots (b)-(h) show the components of the partition with Ncut value less than 0.04.

Reprint from [Shi and Malik 97]

Page 32: Prof. Feng Liuweb.cecs.pdx.edu/~fliu/courses/cs510/lectures/Lecture11.pdfPicture Surface Selection 7 A plan view (xz slice) of a scene.The extracted camera locations are shown in red,

More examples

32Credit: C. Dyer

Page 33: Prof. Feng Liuweb.cecs.pdx.edu/~fliu/courses/cs510/lectures/Lecture11.pdfPicture Surface Selection 7 A plan view (xz slice) of a scene.The extracted camera locations are shown in red,

Comments on NCUT

Recursively bi-partitions the graph instead of using the

3rd, 4th, etc. eigenvectors for robustness reasons (due

to errors caused by the binarization of the real-valued

eigenvectors)

Solving standard eigen-value problems takes O(P3) time

Can speed up algorithm by exploiting the “locality” of

affinity measures, which implies that A is sparse

(nonzero values only near the diagonal) and (D – A) is

sparse. This leads to a O(P1.5) time algorithm

33Credit: C. Dyer

Page 34: Prof. Feng Liuweb.cecs.pdx.edu/~fliu/courses/cs510/lectures/Lecture11.pdfPicture Surface Selection 7 A plan view (xz slice) of a scene.The extracted camera locations are shown in red,

Student Paper Presentations

Presenter: Gatehouse, Christopher Deep High Dynamic Range Imaging of Dynamic Scenes

N. K. Kalantari and R. Ramamoorthi

SIGGRAPH 2017

Presenter: Ghildyal, Abhijay Night Sight: Seeing in the Dark on Pixel Phones

◼ https://ai.googleblog.com/2018/11/night-sight-seeing-in-dark-on-

pixel.html

◼ https://www.blog.google/products/pixel/see-light-night-sight/

34

Page 35: Prof. Feng Liuweb.cecs.pdx.edu/~fliu/courses/cs510/lectures/Lecture11.pdfPicture Surface Selection 7 A plan view (xz slice) of a scene.The extracted camera locations are shown in red,

Next Time

Interactive segmentation

Matting

Student paper presentations◼ 05/07: Giampietro, James

AutoCollage

C. Rother, L. Bordeaux, Y. Hamadi, A. Blake, SIGGRAPH 2006

◼ 05/07: Green, Jordan Picture Collage

J. Wang, J. Sun, L. Quan, X. Tang, H. Shum, CVPR 2006

◼ 05/12: Khan, Umairullah Video Tapestries with Continuous Temporal Zoom. C. Barnes, D. Goldman, E. Shechtman, and

A. Finkelstein, SIGGRAPH 2010

◼ 05/12: Kraiger, Keaton Poisson image editing. P. Pérez, M. Gangnet, and A. Blake, SIGGRAPH 2003

35