Graphics Image Processing cgvr korea ac kr Graphics

  • Slides: 36
Download presentation
Graphics Image Processing 고려대학교 컴퓨터 그래픽스 연구실 cgvr. korea. ac. kr Graphics Lab @

Graphics Image Processing 고려대학교 컴퓨터 그래픽스 연구실 cgvr. korea. ac. kr Graphics Lab @ Korea University

Image Processing n Quantization CGVR n Filtering n Blur Uniform quantization n Detect edge

Image Processing n Quantization CGVR n Filtering n Blur Uniform quantization n Detect edge n Random dither n Ordered dither n Floyd-Steinberg dither n Warping n Scale n Pixel operations n Rotate n Warps n Add random noise n Add luminance n Add contrast n Combining n Add saturation n Morphs n Composite n cgvr. korea. ac. kr Graphics Lab @ Korea University

Image Processing n Quantization CGVR n Filtering n Blur Uniform quantization n Detect edge

Image Processing n Quantization CGVR n Filtering n Blur Uniform quantization n Detect edge n Random dither n Ordered dither n Floyd-Steinberg dither n Warping n Scale n Pixel operations n Rotate n Warps n Add random noise n Add luminance n Add contrast n Combining n Add saturation n Morphs n Composite n cgvr. korea. ac. kr Graphics Lab @ Korea University

Overview n CGVR Image compositing Blue-screen mattes n Alpha channel n Porter-Duff compositing algebra

Overview n CGVR Image compositing Blue-screen mattes n Alpha channel n Porter-Duff compositing algebra n n Image morphing Specifying correspondences n Warping n Blending n cgvr. korea. ac. kr Graphics Lab @ Korea University

Image Compositing n CGVR Separate an image into “elements” Render independently n Composite together

Image Compositing n CGVR Separate an image into “elements” Render independently n Composite together n n Applications Cel animation n Chroma-keying n Blue-screen matting n Dobkin meets Elvis cgvr. korea. ac. kr Graphics Lab @ Korea University

Blue-Screen Matting n CGVR Composite foreground and background images Create background image n Create

Blue-Screen Matting n CGVR Composite foreground and background images Create background image n Create foreground image with blue background n Insert non-blue foreground pixels into background n cgvr. korea. ac. kr Graphics Lab @ Korea University

Alpha Channel n CGVR Encodes pixel coverage information α = 0 : no coverage

Alpha Channel n CGVR Encodes pixel coverage information α = 0 : no coverage (or transparent) n α = 1 : full coverage (or opaque) n 0 < α < 1 : partial coverage (or semi-transparent) n n Example : α = 0. 3 or Partial coverage cgvr. korea. ac. kr Semi-Transparent Graphics Lab @ Korea University

Compositing with Alpha n CGVR Controls the linear interpolation of foreground and background pixels

Compositing with Alpha n CGVR Controls the linear interpolation of foreground and background pixels when elements are composited α=0 0< α < 1 α=1 cgvr. korea. ac. kr Graphics Lab @ Korea University

Pixels with Alpha n CGVR Alpha channel convention : (r, g, b, α) represents

Pixels with Alpha n CGVR Alpha channel convention : (r, g, b, α) represents a pixel that is α covered by the color C=(r/α, g/α, b/α) n Color components are premultiplied by α n Can display (r, g, b) values directly n Closure in composition algebra n n What is the meaning of the following? (0, 1, 0, 1) = n (0, ½, 0, ½) = n (0, ½, 0, 0) = n cgvr. korea. ac. kr Graphics Lab @ Korea University

Pixels with Alpha n CGVR Alpha channel convention : (r, g, b, α) represents

Pixels with Alpha n CGVR Alpha channel convention : (r, g, b, α) represents a pixel that is α covered by the color C=(r/α, g/α, b/α) n Color components are premultiplied by α n Can display (r, g, b) values directly n Closure in composition algebra n n What is the meaning of the following? (0, 1, 0, 1) = full green, full coverage n (0, ½, 0, 1) = half green, full coverage n (0, ½, 0, ½) = full green, half coverage n (0, ½, 0, 0) = no coverage n cgvr. korea. ac. kr Graphics Lab @ Korea University

Semi-Transparent Objects n CGVR Suppose we put A over B over background G A

Semi-Transparent Objects n CGVR Suppose we put A over B over background G A n B G How much of B is blocked by A? cgvr. korea. ac. kr Graphics Lab @ Korea University

Semi-Transparent Objects n CGVR Suppose we put A over B over background G A

Semi-Transparent Objects n CGVR Suppose we put A over B over background G A n B G How much of B is blocked by A? αA n How much of B is shows through A? cgvr. korea. ac. kr Graphics Lab @ Korea University

Semi-Transparent Objects n CGVR Suppose we put A over B over background G A

Semi-Transparent Objects n CGVR Suppose we put A over B over background G A n B G How much of B is blocked by A? αA n How much of B is shows through A? (1 – α A) n How much of G shows through both A and B? cgvr. korea. ac. kr Graphics Lab @ Korea University

Semi-Transparent Objects n CGVR Suppose we put A over B over background G A

Semi-Transparent Objects n CGVR Suppose we put A over B over background G A n B G How much of B is blocked by A? αA n How much of B is shows through A? (1 – α A) n How much of G shows through both A and B? (1 – α A) (1 – α B) cgvr. korea. ac. kr Graphics Lab @ Korea University

Opaque Objects n CGVR How do we combine 2 partially covered pixels 3 possible

Opaque Objects n CGVR How do we combine 2 partially covered pixels 3 possible colors (0, A, B) n 4 regions (0, A, B, AB) n A AB A B 0 B cgvr. korea. ac. kr Graphics Lab @ Korea University

Composition Algebra n CGVR 12 reasonable combinations clear A B A over B B

Composition Algebra n CGVR 12 reasonable combinations clear A B A over B B over A A in B B in A A out B B out A A atop B B atop A A xor B cgvr. korea. ac. kr Graphics Lab @ Korea University

Example: C = A over B n CGVR For colors that are not premultiplied

Example: C = A over B n CGVR For colors that are not premultiplied : C = αAA + (1 – αA) αBB n α = αA + (1 – αA) αB n n For colors that are premultiplied : C’ = A’ + (1 – αA) B’ n α = αA + (1 – αA) αB n A over B cgvr. korea. ac. kr Graphics Lab @ Korea University

Image Composition Example CGVR Jurassic Park cgvr. korea. ac. kr Graphics Lab @ Korea

Image Composition Example CGVR Jurassic Park cgvr. korea. ac. kr Graphics Lab @ Korea University

Overview n CGVR Image compositing Blue-screen mattes n Alpha channel n Porter-Duff compositing algebra

Overview n CGVR Image compositing Blue-screen mattes n Alpha channel n Porter-Duff compositing algebra n n Image morphing Specifying correspondences n Warping n Blending n cgvr. korea. ac. kr Graphics Lab @ Korea University

Image Morphing n CGVR Animate transition between two images cgvr. korea. ac. kr Graphics

Image Morphing n CGVR Animate transition between two images cgvr. korea. ac. kr Graphics Lab @ Korea University

Cross-Dissolving n CGVR Blend image with “over” operator Alpha of bottom image is 1.

Cross-Dissolving n CGVR Blend image with “over” operator Alpha of bottom image is 1. 0 n Alpha of top image varies from 0. 0 to 1. 0 n cgvr. korea. ac. kr Graphics Lab @ Korea University

Image Morphing n CGVR Combines warping and cross-dissolving cgvr. korea. ac. kr Graphics Lab

Image Morphing n CGVR Combines warping and cross-dissolving cgvr. korea. ac. kr Graphics Lab @ Korea University

Image Morphing n CGVR The warping step is the hard one n Aim to

Image Morphing n CGVR The warping step is the hard one n Aim to align feature in images How specify mapping for the warp? cgvr. korea. ac. kr Graphics Lab @ Korea University

Feature Based Warping n CGVR Beier & Neeley use pairs of lines to specify

Feature Based Warping n CGVR Beier & Neeley use pairs of lines to specify warp n Given p in destination image, where is p’ in source image? Beier & Neeley SIGGRAPH 92 cgvr. korea. ac. kr Graphics Lab @ Korea University

Warping with One Line Pair n CGVR What happens to the “F”? Translation cgvr.

Warping with One Line Pair n CGVR What happens to the “F”? Translation cgvr. korea. ac. kr Graphics Lab @ Korea University

Warping with One Line Pair n CGVR What happens to the “F”? Scale cgvr.

Warping with One Line Pair n CGVR What happens to the “F”? Scale cgvr. korea. ac. kr Graphics Lab @ Korea University

Warping with One Line Pair n CGVR What happens to the “F”? Rotation cgvr.

Warping with One Line Pair n CGVR What happens to the “F”? Rotation cgvr. korea. ac. kr Graphics Lab @ Korea University

Warping with One Line Pair n CGVR What happens to the “F”? In general,

Warping with One Line Pair n CGVR What happens to the “F”? In general, similarity transformations cgvr. korea. ac. kr Graphics Lab @ Korea University

Warping with Multiple Line Pairs n CGVR Use weighted combination of points defined by

Warping with Multiple Line Pairs n CGVR Use weighted combination of points defined by each pair of corresponding lines cgvr. korea. ac. kr Graphics Lab @ Korea University

Warping with Multiple Line Pairs n CGVR Use weighted combination of points defined by

Warping with Multiple Line Pairs n CGVR Use weighted combination of points defined by each pair of corresponding lines P’ is a weighted average cgvr. korea. ac. kr Graphics Lab @ Korea University

Weighting Effect of Each Line Pair n CGVR To weight the contribution of each

Weighting Effect of Each Line Pair n CGVR To weight the contribution of each line pair : Where length[i] is the length of the i-th line n dist[i] is the distance from a point P to the i-th line n a, b, p are constants that control the wrap n cgvr. korea. ac. kr Graphics Lab @ Korea University

Warping Pseudocode CGVR Warp. Image(Image, L’[…], L[…]) Begin for each destination pixel p do

Warping Pseudocode CGVR Warp. Image(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 cgvr. korea. ac. kr Graphics Lab @ Korea University

Morphing Pseudocode CGVR Generate. Animation(Image 0, L 0[…], Image 1, L 1[…]) Begin for

Morphing Pseudocode CGVR Generate. Animation(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 = Warp. Image(Image 0, L) Warp 1 = Warp. Image(Image 1, L) for each pixel p in Final. Image do Result(p) = (1 -t)*Warp 0 + t*Warp 1 end end cgvr. korea. ac. kr Graphics Lab @ Korea University

Beier & Neeley Example Image 0 Warp 0 Image 1 Warp 1 CGVR Result

Beier & Neeley Example Image 0 Warp 0 Image 1 Warp 1 CGVR Result cgvr. korea. ac. kr Graphics Lab @ Korea University

Beier & Neeley Example Image 0 Warp 0 Image 1 Warp 1 CGVR Result

Beier & Neeley Example Image 0 Warp 0 Image 1 Warp 1 CGVR Result cgvr. korea. ac. kr Graphics Lab @ Korea University

Image Processing n Quantization CGVR n Filtering n Blur Uniform quantization n Detect edge

Image Processing n Quantization CGVR n Filtering n Blur Uniform quantization n Detect edge n Random dither n Ordered dither n Floyd-Steinberg dither n Warping n Scale n Pixel operations n Rotate n Warps n Add random noise n Add luminance n Add contrast n Combining n Add saturation n Morphs n Composite n cgvr. korea. ac. kr Graphics Lab @ Korea University