Académique Documents
Professionnel Documents
Culture Documents
2
TEASER
3
IMAGE SCALING
Result of extending in one
The original image dimension and reducing in
with one the other, compared to
horizontal and standard scaling on the
one vertical seam bottom right
5
SCOPE
6
PROBLEM STATEMENT
Remove or Add
Show the
Input Image pixels for both
output
Vertical and and save
Horizontal
7
IMAGE RESIZING IN GENERAL
• image scaling
• image cropping
8
SCALING AND CROPPING
9
CROPPING
10
SCALING
11
SCALING AND CROPPING
Scaling causes
• changing in shape of image
Cropping causes
• losing some contents which have been deleted
12
REGION-OF-INTEREST (ROI)
14
USING ENERGY
15
USING ENERGY
16
OVERVIEW OF THE ALGORITHM
17
THE FLOW OF THE ALGORITHM
Show Delete or
Result Duplicate seam
18
FIND ENERGY
19
FIND ENERGY
Example:
12 17 33 37 19
18 28 8 25 33
15 11 13 22 24
17 11 11 21 27
20 10 14 26 27
20
FIND ENERGY
12 17 33 37 19
18 28 8 25 33
15 11 13 22 24
Find energy of this pixel
17 11 11 21 27
20 10 14 26 27
21
FIND ENERGY
12 17 33 37 19
Use this 4 pixels to
calculate 18 28 8 25 33
e=
15 11 13 22 24
= 7
17 11 11 21 27
20 10 14 26 27
22
FIND ENERGY
7
Energy of this pixel
23
FIND ENERGY
12 17 33 37 19
To find energy of
the edge pixel, we 18 28 8 25 33
have to expand the
image one pixel 15 11 13 22 24
outward
17 11 11 21 27
20 10 14 26 27
24
FIND ENERGY
12 17 33 37 19
18 28 8 25 33
15 11 13 22 24
17 11 11 21 27
20 10 14 26 27
25
FIND ENERGY
12 12 17 33 37 19 19
12 12 17 33 37 19 19
18 18 28 8 25 33 33
15 15 11 13 22 24 24
17 17 11 11 21 27 27
20 20 10 14 26 27 27
20 20 10 14 26 27 27
26
FIND ENERGY
• Matrix of energy
5.5 16 22.5 13 16
27
DYNAMIC PROGRAMMING
– overlapping sub-problems
Break and reuse ex. Fibonacci sequence
– optimal substructure
Break and Use optimal solutions
28
FIND THE BEST SEAM
Energy
e(i,j)
M(i,j)
M Matrix
30
FIND THE BEST SEAM
• Example: energy matrix
29.5
5.5 40
16 47.5
22.5 57
13 54
16
36.5
6.5 27
8 49.5
11.5 50
20 50.5
6.5
30.5
2.5 33.5
9.5 26
7 41.5
7.5 53
4
31.5
5.5 24.5
3.5 29.5
5.5 43
10 49.5
4.5
33.5
6.5 27.5
3.5 30.5
9.5 44
9 53.5
0.5
31
FIND THE BEST SEAM
5.5 16 22.5 13 16
To find M, Start
with the second 6.5 8 11.5 20 6.5
row. In the first row
we can use energy 2.5 9.5 7 7.5 4
32
FIND THE BEST SEAM
33
FIND THE BEST SEAM
Use 2 values to compare 0 0 0
the minimum one
Keep track 2
5.5 16 22.5 13 16
12
6.5+5.5 =
12
1 2 3
M
34
FIND THE BEST SEAM
35
FIND THE BEST SEAM
Use 3 values to compare 0 0 0
the minimum one
2 1
5.5 16 22.5 13 16
12 8
Keep track
8+5.5 =
13.5
1 2 3
M
36
FIND THE BEST SEAM
0 0 0
2 1 3
5.5 16 22.5 13 16
11.5+13 =
24.5
1 2 3
M
37
FIND THE BEST SEAM
0 0 0 0
2 1 3 2
5.5 16 22.5 13 16
20+13 = 33
1 2 3
M
38
FIND THE BEST SEAM
0 0 0 0 0
5.5 16 22.5 13 2 16 1 3 2 1
Keep track
6.5+13 =
19.5
1 2 3
M
39
FIND THE BEST SEAM
• Matrix of M
5.5 16 22.5 13 16
20 18 26 30.5 28
40
FIND THE BEST SEAM
• Matrix of Keeping track
0 0 0 0 0
2 1 3 2 1
2 1 1 3 2
2 1 2 1 2
3 2 1 1 2
41
BACKTRACK
42
BACKTRACK 0 0 0 0 0
2 1 3 2 1
• Example 2 1 1 3 2
2 1 2 1 2
B
5.5 16 22.5 13 16 3 2 1 1 2
a
c 12 13.5 24.5 33 19.5
k
t 14.5 21.5 20.5 27 23.5
1 2 3
r
a 20 18 26 30.5 28 M
c
24.5 21.5 27.5 35 28.5
k
43
BACKTRACK
0 0 0 0 0
Least M at
the last row
2 1 3 2 1
2 1 1 3 2 5.5 16 22.5 13 16
2 1 2 1 2
12 13.5 24.5 33 19.5
3 2 1 1 2
14.5 21.5 20.5 27 23.5
20 18 26 30.5 28
20 18 26 30.5 28
45
BACKTRACK
0 0 0 0 0
1 2 3
2 1 3 2 1
M
2 1 1 3 2
5.5 16 22.5 13 16
2 1 2 1 2
20 18 26 30.5 28
46
BACKTRACK
0 0 0 0 0
1 2 3
2 1 3 2 1
M
2 1 1 3 2
5.5 16 22.5 13 16
2 1 2 1 2
20 18 26 30.5 28
47
BACKTRACK
0 0 0 0 0
1 2 3
2 1 3 2 1
M
2 1 1 3 2
2 1 2 1 2 5.5 16 22.5 13 16
3 2 1 1 2
12 13.5 24.5 33 19.5
20 18 26 30.5 28
49
DELETE SEAM
• Example
5.5 16 22.5 13 16
12 13.5 24.5 33 16
19.5 22.5 13 16
20 18 26 30.5 21.5
28 20.5 27 23.5
50
DELETE SEAM
51
SHRINK VS STRETCH
To Shrink
• Remove and Shift
To Stretch
• Shift the rest to make blanks
• Find the average the beside pixels
• Put in the Blanks
52
VERTICAL VS HORIZONTAL
To compute Horizontal seam is similar to Vertical
by inversing
• Column to row
• Row to Column
With the same processes
53
IMPLEMENTATION
54
INTERFACE DESIGN
55
INTERFACE DESIGN(CONT)
The overall of interface
5 windows:
4 display
1 controller
56
INTERFACE DESIGN(CONT)
Controller
57
BROWSE AND SAVE
58
DISPLAY
ORIGINAL IMAGE
MODIFIED IMAGE
SEAM IMAGE
ENERGY IMAGE
59
EXAMPLE RESULT
60
EXAMPLE RESULT
61
EXAMPLE RESULT
63
EXAMPLE RESULT
64
COMPARING RESULT
66
CONCLUSION
67
PROBLEM AND LIMITATIONS
• Speed
68
FUTURE WORK
• Improve speed
69
• Let’s see our demo!!
70
71