� Computer Graphics Meets CVGIP
李同益 | |
Image Resizing Using Seam Carving (SC)
Image/Video Retargeting
16 : 9
? : ?
2.39 : 1
4 : 3
Direct scale
along x axis
Distorted
along x axis
Image Resizing
4:3
16:9
1:1
Resizing – Standard Solutions
© Blender Foundation
Resizing – Standard Solutions
© Blender Foundation
Resizing – Standard Solutions
© Blender Foundation
Resizing – Standard Solutions
© Blender Foundation
Resizing – Content-Aware Solutions
Seam-carving
[Avidan+Shamir 2007]
i.e., cut unimportant
seams
Non-homo. warping
[Wolf et al. 2007], i.e.,
deform non-important
objects only
Optimized scale&stretch
[Wang et al. 2008], i.e.
allowing uniform scale
for important objects
and non-uniform scale
for non-important
objects
Determine ‘important’ regions
Apply operator
[Visual Media Retargeting, SIGGRAPH Asia 09 Course]
Seam carving: nonlinear cropping�[Avidan and Shamir 2007; Rubinstein et al. 2008]
i.e., Gray = R*0.299 + G*0.587 + B*0.114
An image gradient is a directional change in the intensity or color in an image.
(x,y)
(x,y)
10
Original image to be made narrower
Scaling is undesirable because the castle is distorted.
Cropping is undesirable
because part of the castle is removed.
Seam carving
Image reduction & Image enlarging
11
Image enlarging n seams
i.e., select n highest seams and duplicate n seams
Image reducing n seams, i.e., select n lowest seams and delete n seams
Seam Carving
12
Image reduction
13
Image reduction (conti.)
14
12.8 |
Image reduction (conti.)
15
12.8 |
12.8 |
Image reduction (conti.)
16
12.8 |
12.8 |
13.4 |
Image reduction (conti.)
17
12.8 |
12.8 |
13.4 |
13.1 |
Image reduction (conti.)
18
12.8 |
12.8 |
13.4 |
13.1 |
13.5 |
Image reduction (conti.)
19
12.8 |
12.8 |
13.4 |
13.1 |
13.5 |
12 |
Image reduction (conti.)
20
12.8 |
12.8 |
13.4 |
13.1 |
13.5 |
12 |
Image reduction
21
Image reduction (conti.)
22
2 |
Image reduction (conti.)
23
2 |
2.6 |
Image reduction (conti.)
24
2 |
2.6 |
3.2 |
Image reduction (conti.)
25
2 |
2.6 |
3.2 |
Image reduction (conti.)
26
2 | 2.6 | 3.2 | 2 | 3 | 2 | 3.2 | 2.9 | 2.4 | 1.5 |
Image reduction (conti.)
27
2 | 2.6 | 3.2 | 2 | 3 | 2 | 3.2 | 2.9 | 2.4 | 1.5 |
The disadvantage is to lose some important pixels on some deleted lines
such as 2nd line (with 2.4)
Image reduction
28
Image reduction (conti.)
29
1.6 |
Image reduction (conti.)
30
1.6 |
1.5 |
Image reduction (conti.)
31
1.6 |
1.5 |
1.9 |
Image reduction (conti.)
32
1.6 |
1.5 |
1.9 |
Image reduction (conti.)
33
1.6 |
1.5 |
1.9 |
1.3 |
1.9 |
1.7 |
2.2 |
1.7 |
1.6 |
1.0 |
Image reduction (conti.)
34
1.6 |
1.5 |
1.9 |
1.3 |
1.9 |
1.7 |
2.2 |
1.7 |
1.6 |
1.0 |
Image reduction
35
Image reduction (conti.)
36
Image reduction (conti.)
37
V
V
V
V
V
Image reduction (conti.)
38
V
V
V
V
V
This pixel is not selected for
this line,
So, breaking continuity
Aspect Ratio Change(1/2)
Seam removals
Scaling
Cropping
39
Aspect Ratio Change(2/2)
image is widened by seam
insertion.
40
(a) To add a line, 1) choose a seam with
largest value, and then 2) repeat a same seam
(b) To add n line, 1) choose n seams first
and then 2) repeat n seams
Object Removal
描繪出要移除的物件
41
Limitations
42
Without detection
With detection
Limitations
43
影片Demo
44
Reference
http://danluong.com/2007/12/21/seam-carving-matlab-implementation-tutorial/
http://www.thegedanken.com/retarget/
http://code.google.com/p/seam-carving-gui/
45
OPTIMIZED SCALE-AND-STRETCH FOR IMAGE RESIZING
published in ACM Siggraph Asia 2008
Importance map
saliency map
[Itti et al. 98]
x
=
importance map
gradients only
importance map
The warping mechanism
quads with high importance:�uniform scaling
quads with low importance:
allowed non-uniform scaling
Optimize the location of mesh vertices, interpolate image
The warping mechanism
Results
original
SC (Seam carving)
ours
51
Motion-Aware Temporal Coherence for Video Resizing
Yu-Shuen Wang1, Hongbo Fu2, Olga Sorkine3, Tong-Yee Lee1, Hans-Peter Seidel4
ACM Transaction on Graphics (Proceedings of SIGGRAPH 2009 Asia)
1National Cheng Kung University, Taiwan, 2City University of Hong Kong, 3New York University, 4MPI Informatik
52
Non-homogeneous Resizing of Complex Models