Image Retargeting Shai Avidan Tel Aviv University Bidirectional - - PowerPoint PPT Presentation

image retargeting
SMART_READER_LITE
LIVE PREVIEW

Image Retargeting Shai Avidan Tel Aviv University Bidirectional - - PowerPoint PPT Presentation

Image Retargeting Shai Avidan Tel Aviv University Bidirectional Similarity (Simakov et al. 2008) The Bidirectional (dis)similarity measure for images S and T: Goal: Given S, find T s.t. min d(S,T) Bidirectional Similarity The error


slide-1
SLIDE 1

Image Retargeting

Shai Avidan

Tel Aviv University

slide-2
SLIDE 2

Bidirectional Similarity (Simakov et al. 2008)

The Bidirectional (dis)similarity measure for images S and T: Goal: Given S, find T s.t. min d(S,T)

slide-3
SLIDE 3

Bidirectional Similarity

  • T

S d T q q T p S Q Q q P P p p Q P D P S P P q T Q Q T S d T q

cohere m i i m m m S P i i m m cohere

, term the to pixel

  • f

color the

  • f
  • n

contributi the is N 1 Then ,..., in pixel

  • f

position the to ing correspond ,..., in pixels the be ,..., Let , min arg i.e., in matches ing correspond the denote ,..., Let pixel contain that in patches all denote ,..., Let : , to s contribute pixel a error The

1 2 T 1 1 1 1 1

  • T

S d T q q T p S Q Q q P P p p Q P D Q P S P P q T Q Q T S d T q

complete n j i m m n T Q j j j n n complete

, term the to pixel

  • f

color the

  • f
  • n

contributi the is ˆ N 1 Then ˆ ,..., ˆ in pixel

  • f

position the to ing correspond ˆ ,..., ˆ in pixels the be ˆ ,..., ˆ Let , ˆ min arg ˆ s.t. S ˆ i.e., in ˆ ,..., ˆ patches some to patch" similar most the " as serve and pixel contain that in patches all denote ˆ ,..., ˆ Let : , to s contribute pixel a error The

1 2 S 1 1 1 1 1

  • m

i i n j i

q T p S q T p S q T Err T q

1 2 T 1 2 S

N 1 ˆ N 1 error nal bidirectio global the to pixel the

  • f
  • n

contributi the is error term The

  • T

S 1 1 T S

N N N 1 ˆ N 1 : rule update get the we zero, to equating and color unknown the respect to with

  • f

derivative Taking m n p S p S q T q T q T Err

n j m i i i

slide-4
SLIDE 4
slide-5
SLIDE 5
  • Shift-Maps represent a mapping for each pixel in the output

image into the input image

  • The color of the output pixel is copied from corresponding input

pixel

Shift-Map

) ,t (t M(u,v)

y x

slide-6
SLIDE 6
  • We use relative mapping coordinate (like in Optical Flow)

Our Approach : Shift-Map

) , ( ) , ( ) , ( y x I t v t u I v u R

y x

  • )

,t (t M(u,v)

y x

  • )

,t (t M(u,v)

y x

slide-7
SLIDE 7

Our Approach : Shift-Map

slide-8
SLIDE 8
  • We look for the optimal mapping - can be

described as an Energy Minimization problem

Geometric Editing as an Energy Minimization

  • N

q p s R p d

q M p M E p M E M E

,

)) ( ), ( ( )) ( ( ) (

slide-9
SLIDE 9

The Smoothness Term

  • Assigns a penalty to a discontinuity

introduced to the output image by a discontinuity in the Shift-Map

This term will minimize editing artifacts and create good stitching in the output image

  • Discontinuities are computed based on

color differences and gradient differences

(preserve image structure)

slide-10
SLIDE 10

The Smoothness Term

R - Output Image I - Input Image

)) ( ), ( ( ) ( ) (

  • !
  • q

M p M E q M p M

s

q’ p q No discontinuity in the shift-map

p’

slide-11
SLIDE 11

2 ' 2 ' 2 ' 2 '

)) ' ( ) ( ( )) ' ( ) ( ( )) ' ( ) ( ( )) ' ( ) ( ( p I n I q I n I p I n I q I n I

q p q p

"

  • "
  • "
  • "
  • The Smoothness Term

q’

  • !

# )) ( ), ( ( ) ( ) ( q M p M E q M p M

s

p’ np’ nq’ R - Output Image I - Input Image

)) ( ), ( ( ) ( ) (

  • !
  • q

M p M E q M p M

s

p q Discontinuity in the shift-map

slide-12
SLIDE 12
  • Use picture borders
  • Can incorporate importance mask

– Order constraint on mapping is applied to prevent duplications of important areas

The Data Term: Retargeting

slide-13
SLIDE 13
  • Minimal energy mapping can be represented as

graph labeling where the Shift-Map value is the selected label for each output pixel

  • Labels: relative shift

Shift-Map as Graph Labeling

slide-14
SLIDE 14
  • Minimal energy mapping can be represented as

graph labeling where the Shift-Map value is the selected label for each output pixel

  • Labels: relative shift

Shift-Map as Graph Labeling

slide-15
SLIDE 15

# Nodes : number of pixels in the image # Labels : number of possible shifts

  • Retargeting:

– Horizontal shifts: change in width – Vertical shifts: optional - add limited range

Labels and Nodes Range

✡ ✩ ✄
  • $
  • %
  • therwise

) , ( : s Constraint External y t v x t u v u M E

y x D

  • )

, ( ) , ( importance low means S Large : s constraint Saliency

y x D

t v t u S v u M E

  • ity

discontinu prevent to term smoothness by the Multiply

  • therwise

1 , 1 ), , ( , ) , 1 ( and , ) , ( Let : s Constraint Order

  • $

&

  • x

x S y x y x

t t v u M v u M E t t v u M t t v u M

slide-16
SLIDE 16

Optimal Labeling Using Graph Cuts

  • Global minimization of the energy is NP-

hard

  • We use approximate techniques :

Graph Cuts based expansion moves

Fast Approximate Energy Minimization via Graph Cuts, [Boykov, Veksler, Zabih, PAMI 2001]

slide-17
SLIDE 17

Hierarchical Solution

slide-18
SLIDE 18
  • This is an approximate solution

–leading to local minimum –many of the theoretical guarantees of the “alpha expansion” algorithm are lost

in practice we get good results

Computation time is seconds

Hierarchical Solution

slide-19
SLIDE 19

Results and comparison

slide-20
SLIDE 20

Results and Comparison

Input

slide-21
SLIDE 21

Results and Comparison

slide-22
SLIDE 22

Results and Comparison

Input

slide-23
SLIDE 23

Results and Comparison

slide-24
SLIDE 24

Results and Comparison

Input

slide-25
SLIDE 25

Results and Comparison

Video-Retargeting Optimized Scale and Stretch Improved Seam Carving Shift-Maps

slide-26
SLIDE 26

Results and Comparison

Input

slide-27
SLIDE 27

Results and Comparison

slide-28
SLIDE 28

When does it fail and why?

slide-29
SLIDE 29

Forward Energy

slide-30
SLIDE 30
slide-31
SLIDE 31

Results

slide-32
SLIDE 32

Results

slide-33
SLIDE 33

Results