Download presentation
Presentation is loading. Please wait.
Published byDarcy Elliott Modified over 9 years ago
1
Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr Image Processing 고려대학교 컴퓨터 그래픽스 연구실
2
CGVR Graphics Lab @ Korea University cgvr.korea.ac.kr Image Processing Quantization Uniform quantization Random dither Ordered dither Floyd-Steinberg dither Pixel operations Add random noise Add luminance Add contrast Add saturation Filtering Blur Detect edge Warping Scale Rotate Warps Combining Morphs Composite
3
CGVR Graphics Lab @ Korea University cgvr.korea.ac.kr Image Processing Quantization Uniform quantization Random dither Ordered dither Floyd-Steinberg dither Pixel operations Add random noise Add luminance Add contrast Add saturation Filtering Blur Detect edge Warping Scale Rotate Warps Combining Morphs Composite
4
CGVR Graphics Lab @ Korea University cgvr.korea.ac.kr Overview Image compositing Blue-screen mattes Alpha channel Porter-Duff compositing algebra Image morphing Specifying correspondences Warping Blending
5
CGVR Graphics Lab @ Korea University cgvr.korea.ac.kr Image Compositing Separate an image into “elements” Render independently Composite together Applications Cel animation Chroma-keying Blue-screen matting Dobkin meets Elvis
6
CGVR Graphics Lab @ Korea University cgvr.korea.ac.kr Blue-Screen Matting Composite foreground and background images Create background image Create foreground image with blue background Insert non-blue foreground pixels into background
7
CGVR Graphics Lab @ Korea University cgvr.korea.ac.kr Alpha Channel Encodes pixel coverage information α = 0 : no coverage (or transparent) α = 1 : full coverage (or opaque) 0 < α < 1 : partial coverage (or semi-transparent) Example : α = 0.3 Partial coverageSemi-Transparent or
8
CGVR Graphics Lab @ Korea University cgvr.korea.ac.kr Compositing with Alpha Controls the linear interpolation of foreground and background pixels when elements are composited α = 0 0< α < 1 α = 1
9
CGVR Graphics Lab @ Korea University cgvr.korea.ac.kr Pixels with Alpha Alpha channel convention : (r, g, b, α) represents a pixel that is α covered by the color C=(r/α, g/α, b/α) Color components are premultiplied by α Can display (r, g, b) values directly Closure in composition algebra What is the meaning of the following? (0, 1, 0, 1) = (0, ½, 0, 1) = (0, ½, 0, ½) = (0, ½, 0, 0) =
10
CGVR Graphics Lab @ Korea University cgvr.korea.ac.kr Pixels with Alpha Alpha channel convention : (r, g, b, α) represents a pixel that is α covered by the color C=(r/α, g/α, b/α) Color components are premultiplied by α Can display (r, g, b) values directly Closure in composition algebra What is the meaning of the following? (0, 1, 0, 1) = full green, full coverage (0, ½, 0, 1) = half green, full coverage (0, ½, 0, ½) = full green, half coverage (0, ½, 0, 0) = no coverage
11
CGVR Graphics Lab @ Korea University cgvr.korea.ac.kr Semi-Transparent Objects Suppose we put A over B over background G How much of B is blocked by A? A B G
12
CGVR Graphics Lab @ Korea University cgvr.korea.ac.kr Semi-Transparent Objects Suppose we put A over B over background G How much of B is blocked by A? How much of B is shows through A? α Aα A A B G
13
CGVR Graphics Lab @ Korea University cgvr.korea.ac.kr Semi-Transparent Objects Suppose we put A over B over background G How much of B is blocked by A? How much of B is shows through A? How much of G shows through both A and B? α Aα A (1 – α A ) A B G
14
CGVR Graphics Lab @ Korea University cgvr.korea.ac.kr Semi-Transparent Objects Suppose we put A over B over background G How much of B is blocked by A? How much of B is shows through A? How much of G shows through both A and B? (1 – α A ) α Aα A (1 – α A ) (1 – α B ) A B G
15
CGVR Graphics Lab @ Korea University cgvr.korea.ac.kr Opaque Objects How do we combine 2 partially covered pixels 3 possible colors (0, A, B) 4 regions (0, A, B, AB) B A BA 0 AB
16
CGVR Graphics Lab @ Korea University cgvr.korea.ac.kr Composition Algebra 12 reasonable combinations A in BB over AA over BBAclear A xor BB atop AA atop BB out AA out BB in A
17
CGVR Graphics Lab @ Korea University cgvr.korea.ac.kr Example: C = A over B For colors that are not premultiplied : C = α A A + (1 – α A ) α B B α = α A + (1 – α A ) α B For colors that are premultiplied : C’ = A’ + (1 – α A ) B’ α = α A + (1 – α A ) α B A over B
18
CGVR Graphics Lab @ Korea University cgvr.korea.ac.kr Image Composition Example Jurassic Park
19
CGVR Graphics Lab @ Korea University cgvr.korea.ac.kr Overview Image compositing Blue-screen mattes Alpha channel Porter-Duff compositing algebra Image morphing Specifying correspondences Warping Blending
20
CGVR Graphics Lab @ Korea University cgvr.korea.ac.kr Image Morphing Animate transition between two images
21
CGVR Graphics Lab @ Korea University cgvr.korea.ac.kr Cross-Dissolving Blend image with “over” operator Alpha of bottom image is 1.0 Alpha of top image varies from 0.0 to 1.0
22
CGVR Graphics Lab @ Korea University cgvr.korea.ac.kr Image Morphing Combines warping and cross-dissolving
23
CGVR Graphics Lab @ Korea University cgvr.korea.ac.kr Image Morphing The warping step is the hard one Aim to align feature in images How specify mapping for the warp?
24
CGVR Graphics Lab @ Korea University cgvr.korea.ac.kr Feature Based Warping Beier & Neeley use pairs of lines to specify warp Given p in destination image, where is p’ in source image? Beier & Neeley SIGGRAPH 92
25
CGVR Graphics Lab @ Korea University cgvr.korea.ac.kr Warping with One Line Pair What happens to the “F”? Translation
26
CGVR Graphics Lab @ Korea University cgvr.korea.ac.kr Warping with One Line Pair What happens to the “F”? Scale
27
CGVR Graphics Lab @ Korea University cgvr.korea.ac.kr Warping with One Line Pair What happens to the “F”? Rotation
28
CGVR Graphics Lab @ Korea University cgvr.korea.ac.kr Warping with One Line Pair What happens to the “F”? In general, similarity transformations
29
CGVR Graphics Lab @ Korea University cgvr.korea.ac.kr Warping with Multiple Line Pairs Use weighted combination of points defined by each pair of corresponding lines
30
CGVR Graphics Lab @ Korea University cgvr.korea.ac.kr Warping with Multiple Line Pairs Use weighted combination of points defined by each pair of corresponding lines P’ is a weighted average
31
CGVR Graphics Lab @ Korea University cgvr.korea.ac.kr Weighting Effect of Each Line Pair To weight the contribution of each line pair : Where length[i] is the length of the i -th line dist[i] is the distance from a point P to the i -th line a, b, p are constants that control the wrap
32
CGVR Graphics Lab @ Korea University cgvr.korea.ac.kr Warping Pseudocode WarpImage(Image, L’[…], L[…]) Begin for each destination pixel p do psum = (0, 0) wsum = 0 for each line L[i] in destination do p’[i] = p transformed by (L[i], L’[i]) psum += p’[i] * weight[i] wsum += weight[i] end p’ = psum / wsum Result(p) = Image(p’) end
33
CGVR Graphics Lab @ Korea University cgvr.korea.ac.kr Morphing Pseudocode GenerateAnimation(Image 0, L 0 […], Image 1, L 1 […]) Begin for each intermediate frame time t do for i=1 to number of line pairs do L[i] = line t-th of the way from L 0 [i] to L 1 [i] end Warp 0 = WarpImage(Image 0, L 0, L) Warp 1 = WarpImage(Image 1, L 1, L) for each pixel p in FinalImage do Result(p) = (1-t)*Warp 0 + t*Warp 1 end
34
CGVR Graphics Lab @ Korea University cgvr.korea.ac.kr Beier & Neeley Example Image 0 Image 1 Warp 0 Warp 1 Result
35
CGVR Graphics Lab @ Korea University cgvr.korea.ac.kr Beier & Neeley Example Image 0 Image 1 Warp 0 Warp 1 Result
36
CGVR Graphics Lab @ Korea University cgvr.korea.ac.kr Image Processing Quantization Uniform quantization Random dither Ordered dither Floyd-Steinberg dither Pixel operations Add random noise Add luminance Add contrast Add saturation Filtering Blur Detect edge Warping Scale Rotate Warps Combining Morphs Composite
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.