Computer Graphics Image processing mtchics nccu edu tw

  • Slides: 46
Download presentation
 Computer Graphics Image processing 紀明德 mtchi@cs. nccu. edu. tw Department of Computer Science,

Computer Graphics Image processing 紀明德 mtchi@cs. nccu. edu. tw Department of Computer Science, National Chengchi University

Outlines • Color space • Filter – Low / high pass filter – Space

Outlines • Color space • Filter – Low / high pass filter – Space / frequency domain – Hybrid images 2

Electromagnetic spectrum

Electromagnetic spectrum

Three-Color Theory • Human visual system has two types of sensors – Rods: monochromatic,

Three-Color Theory • Human visual system has two types of sensors – Rods: monochromatic, night vision�� – Cones�� • Color sensitive�� • Three types of cone�� • Only three values (the tristimulusvalues) are sent to the brain

Additive / Subtractive color Y M C

Additive / Subtractive color Y M C

RGB color space Green Black (0, 0, 0) Red Blue

RGB color space Green Black (0, 0, 0) Red Blue

HSV color space • HSV – hue, – Saturation, – Value, HSV UI

HSV color space • HSV – hue, – Saturation, – Value, HSV UI

Color Harmonization SIGGRAPH 2006 Harmonic templates on the hue wheel.

Color Harmonization SIGGRAPH 2006 Harmonic templates on the hue wheel.

Gamut • a certain complete subset of colors. • the subset of colors which

Gamut • a certain complete subset of colors. • the subset of colors which can be accurately represented in a given circumstance.

CIELAB color space • Perception uniform L a b

CIELAB color space • Perception uniform L a b

New Algorithm Color Grayscale

New Algorithm Color Grayscale

Color 2 Gray: Salience-Preserving Color Removal siggraph 2005 Original Photoshop Grey Color 2 Grey

Color 2 Gray: Salience-Preserving Color Removal siggraph 2005 Original Photoshop Grey Color 2 Grey + Color

brightness contrast

brightness contrast

Checker shadow Illusion

Checker shadow Illusion

IMAGE PRE-PROCESSING FILTER

IMAGE PRE-PROCESSING FILTER

 • Low-pass filter – Smoothing, denoise • High-pass filter – Gradient operators, edge

• Low-pass filter – Smoothing, denoise • High-pass filter – Gradient operators, edge detection

convolution

convolution

Low-pass filter • Mean filter

Low-pass filter • Mean filter

Gaussian Filtering

Gaussian Filtering

Unsharp Masking

Unsharp Masking

3 D Unsharp Masking for Scene Coherent Enhancement SIGGRAPH '08

3 D Unsharp Masking for Scene Coherent Enhancement SIGGRAPH '08

Naïve Approach: Gaussian Blur input BLUR HALOS smoothed (structure, large scale) residual (texture, small

Naïve Approach: Gaussian Blur input BLUR HALOS smoothed (structure, large scale) residual (texture, small scale) Gaussian Convolution

Impact of Blur and Halos • If the decomposition introduces blur and halos, the

Impact of Blur and Halos • If the decomposition introduces blur and halos, the final result is corrupted. Sample manipulation: increasing texture (residual 3)

Bilateral Filter: no Blur, no Halos input smoothed (structure, large scale) edge-preserving: Bilateral Filter

Bilateral Filter: no Blur, no Halos input smoothed (structure, large scale) edge-preserving: Bilateral Filter residual (texture, small scale)

Bilateral Filter Definition: an Additional Edge Term Same idea: weighted average of pixels. new

Bilateral Filter Definition: an Additional Edge Term Same idea: weighted average of pixels. new normalization factor not new space weight new range weight I

Illustration a 1 D Image • 1 D image = line of pixels •

Illustration a 1 D Image • 1 D image = line of pixels • Better visualized as a plot pixel intensity pixel position

Gaussian Blur and Bilateral Filter Gaussian blur p q space q range Bilateral filter

Gaussian Blur and Bilateral Filter Gaussian blur p q space q range Bilateral filter [Aurich 95, Smith 97, Tomasi 98] p normalization space range

Differentiation and convolution • Recall • We could approximate this as • Now this

Differentiation and convolution • Recall • We could approximate this as • Now this is linear and shift invariant, so must be the result of a convolution. (which is obviously a convolution; it’s not a very good way to do things, as we shall see) Computer Vision - A Modern Approach Set: Linear Filters Slides by D. A. Forsyth

High-pass filter • Sobel operator

High-pass filter • Sobel operator

The Fourier space image

The Fourier space image

Fourier space filtering

Fourier space filtering

Fourier space filtering

Fourier space filtering

Hybrid Images siggraph 06

Hybrid Images siggraph 06

Hybrid Images

Hybrid Images

Opacity and Transparency • Opaque surfaces permit no light to pass through • Transparent

Opacity and Transparency • Opaque surfaces permit no light to pass through • Transparent surfaces permit all light to pass • Translucent surfaces pass some light translucency = 1 – opacity ( ) opaque surface =1 38

Chroma-keying (Primatte)

Chroma-keying (Primatte)

Blending • gl. Blend. Func(Glenum S, Glenum D); – Cf = (Cs*S) + (Cd*D)

Blending • gl. Blend. Func(Glenum S, Glenum D); – Cf = (Cs*S) + (Cd*D) • gl. Blend. Func(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

Compositing F foreground color B alpha matte background plate composite C F C B

Compositing F foreground color B alpha matte background plate composite C F C B =0 compositing equation

Compositing F B composite C F C B =1 compositing equation

Compositing F B composite C F C B =1 compositing equation

Order Dependency • Is this image correct? – Probably not – Polygons are rendered

Order Dependency • Is this image correct? – Probably not – Polygons are rendered in the order they pass down the pipeline – Blending functions are order dependent 43 Angel: Interactive Computer Graphics 5 E © Addison-Wesley 2009

Deferred Shading • A shading algorithm is calculated by dividing it into smaller parts

Deferred Shading • A shading algorithm is calculated by dividing it into smaller parts that are written to intermediate buffer storage to be combined later, instead of immediately writing the shader result to the color framebuffer.

Deferred Shading in Killzone 2

Deferred Shading in Killzone 2