Introduction to Computer Graphics – Image Processing (1) –
July 4, 2019 Kenshi Takayama
Introduction to Computer Graphics Image Processing (1) July 4, - - PowerPoint PPT Presentation
Introduction to Computer Graphics Image Processing (1) July 4, 2019 Kenshi Takayama Todays topics Edge-aware image processing Gradient-domain image processing 2 Image smoothing using Gaussian Filter Smoothness parameter
July 4, 2019 Kenshi Takayama
2
3
𝜏 = 2 𝜏 = 5 𝜏 = 10 Original
𝑦2 2𝜏2 Gaussian Kernel of radius 𝜏
4
𝑦 −𝜏 −2𝜏 −3𝜏 3𝜏 2𝜏 𝜏 𝐻𝜏 𝑦
𝐪
𝑦2 2𝜏2 Gaussian Kernel of radius 𝜏
5
𝑦 −𝜏 −2𝜏 −3𝜏 3𝜏 2𝜏 𝜏 𝐻𝜏 𝑦
𝐪
𝐫∈Ω
6
𝑦 −𝜏 −2𝜏 −3𝜏 3𝜏 2𝜏 𝜏 𝐻𝜏 𝑦
http://people.csail.mit.edu/sparis/bf_course/
2𝑠 + 1 2𝑠 + 1
Stencil
7
𝜏 = 20 𝜏 = 5 downsample upsample
8
3 × smoothed detail enhanced detail halos!
9
3 × smoothed detail enhanced detail
𝐪
𝐫∈Ω
10
𝜏r = 32 𝜏r = 128 𝜏r = 512 Original In all cases, 𝜏s = 10
11
Real-time video abstraction [Winnemöller SIGGRAPH06]
12
https://en.wikipedia.org/wiki/Tone_mapping Fast bilateral filtering for the display of high-dynamic-range images [Durand SIGGRAPH02]
Short exposure Long exposure
13
γ correct. (𝑌 → 𝑌𝛿) details lost HDR image Bilateral Filter details preserved
https://en.wikipedia.org/wiki/Tone_mapping Fast bilateral filtering for the display of high-dynamic-range images [Durand SIGGRAPH02]
𝐪
𝐫∈Ω
14
𝐪 𝜏s , 𝐽𝐪 𝜏r for pixel location 𝐪 and intensity 𝐽𝐪
Gaussian kernel applied to Euclidean distance in the feature space
to sample points {𝐠𝐪} in the feature space Simpler computation
15
𝐻𝜏s 𝐪 − 𝐫 𝐻𝜏r 𝐽𝐪 − 𝐽𝐫 = exp − 𝐪 − 𝐫 2 2𝜏s
2
exp − 𝐽𝐪 − 𝐽𝐫
2
2𝜏r
2
= exp − 𝐠𝐪 − 𝐠𝐫
2
2 = 𝐻1 𝐠𝐪 − 𝐠𝐫
16
A Fast Approximation of the Bilateral Filter using a Signal Processing Approach [Paris ECCV06] Real-time edge-aware image processing with the bilateral grid [Chen SIGGRAPH07]
17
White scribble constraint of weight=1 Black scribble constraint of weight=0 Weight map Application: color adjustment
Real-time edge-aware image processing with the bilateral grid [Chen SIGGRAPH07]
18
Instant Propagation of Sparse Edits on Images and Videos [Li PG10] Bilateral Hermite Radial Basis Functions for Contour-based Volume Segmentation [Ijiri EG13]
https://www.youtube.com/watch?v=mL6ig_OaQAA
Interpolation using RBF [Li10] (Purpose: edit propagation for images/videos) Interpolation using Hermite RBF [Ijiri13] (Purpose: segmentation of CT volume)
19
Digital Photography with Flash and No-Flash Image Pairs [Petschnigg SIGGRAPH04] Flash Photography Enhancement via Intrinsic Relighting [Eisemann SIGGRAPH04]
Photo A: without flash Correct color Noisy, blurred Photo F: with flash Incorrect color Less noisy, sharp
JBF𝜏s, 𝜏r 𝐵, 𝐺 𝐪 ≔ 1 𝑋
𝐪
𝐫∈Ω
𝐻𝜏s 𝐪 − 𝐫 𝐻𝜏r 𝐺
𝐪 − 𝐺 𝐫
𝐵𝐫
After applying JBF
20
A non local algorithm for image denoising [Buades CVPR05]
NLMF𝜏 𝐽 𝐪 ≔ 1 𝑋
𝐪
𝐫∈Ω
𝐻𝜏 𝐨𝐪 − 𝐨𝐫 𝐽𝐫
Noisy input Bilateral NL Means
21
22
Poisson image editing [Perez SIGGRAPH03] Gradient Domain Manipulation Techniques in Vision and Graphics [Agrawal ICCV07 Course]
Simple copying Boundary blurred Gradient-domain processing Source Dest.
23
Efficient gradient-domain compositing using quadtrees [Agarwala SIGGRAPH07]
Simple tiling Gradient-domain processing
24
Offset Dest. Source
25
Mean value coordinates [Floater CAGD03] Coordinates for instant image cloning [Farbman SIGGRAPH09]
https://www.youtube.com/watch?v=AXvPeuc-wRw
26
27
×2
||
28
Find 𝑔
𝑗
that minimize
𝑗
𝑔
𝑗 − 𝑔 𝑗−1 − 𝑗 2
subject to: 𝑔ȁ𝜖Ω = 𝑔∗ȁ𝜖Ω
Find function 𝑔 such that its gradient closely matches user-specified target 𝑗
Find image 𝑔 whose gradient best matches user-specified target gradient field 𝐡 by solving Poisson equation
29
Find 𝑔
𝑗
that minimize
𝑗
𝑔
𝑗 − 𝑔 𝑗−1 − 𝑗 2
subject to: 𝑔ȁ𝜖Ω = 𝑔∗ȁ𝜖Ω Find 𝑔 𝑦, 𝑧 that minimizes න
𝑦,𝑧 ∈Ω
𝛂𝑔 𝑦, 𝑧 − 𝐡(𝑦, 𝑧) 2 subject to: 𝑔ȁ𝜖Ω = 𝑔∗ȁ𝜖Ω
Solve Poisson equation: Δ𝑔 = 𝛂 ⋅ 𝐡 subject to: 𝑔ȁ𝜖Ω = 𝑔∗ȁ𝜖Ω
30
Poisson image editing [Perez SIGGRAPH03]
source dest. source dest. source dest.
31
Real-time gradient-domain painting [McCann SIGGRAPH08] Code: http://graphics.cs.cmu.edu/projects/gradient-paint/gradient_paint.r2403.tar.gz
https://www.youtube.com/watch?v=9MGjrsPzFc4
Before After Before After
32
Poisson image editing [Perez SIGGRAPH03]
Amplify/suppress within selected region Local Tone Mapping Set to zero except where detected as edges Stylization
33
34
Find 𝐰𝑗 that minimize
𝑗,𝑘 ∈𝐹
𝑥𝑗𝑘 𝐰𝑗 − 𝐰
𝑘 − 𝐟𝑗𝑘 2
subject to: 𝐰𝑑 = 𝐰𝑑
∗, 𝑑 ∈ 𝐽𝐷
Mesh editing with poisson-based gradient field manipulation [Yu SIGGRAPH04] Laplacian surface editing [Sorkine SGP04] Interfaces and algorithms for the creation, modification, and optimization of surface meshes [Nealen PhD07]
Edge vector of original shape target gradient A few constraints of vertex positions boundary condition
Poisson equation
Fix vertex positions, compute local rotation using SVD
Fix local rotations, compute vertex positions via Poisson equation
35
On linear variational surface deformation methods [Botsch TVCG08] As-rigid-as-possible surface modeling [Sorkine SGP07]
https://www.youtube.com/watch?v=ltX-qUjbkdc
Without rotation With rotation
Fast & approx. computation using cage-based method
Adapt GPU-based Poisson solver (originally for image processing)
36
GeoBrush: Interactive Mesh Geometry Cloning [Takayama EG11]
https://www.youtube.com/watch?v=FPsccn_gG8E