Download presentation
Presentation is loading. Please wait.
1
Image Filtering with GLSL
2
Outline Convolution Convolution implementation using GLSL
Commonly used convolution filter Mean Filter Gaussian Filter Laplacian Filter Sharpness Filter Sobel Filter
3
Convolution1 Convolution Convolution kernel
an operation in which the final pixel is the weighted sum of the neighboring pixels Convolution kernel a matrix which gives some weight to each one of the neighbor pixels Also known as filter, mask, kernel, template, or window
4
Convolution2
5
Mean Filter Most commonly used for the image noise elimination
eliminating pixel values which are unrepresentative of their surroundings
6
Gaussian Filter1 A kind of lowpass filter
Used to blur an image and remove detail and noise 1/16 4/16 2/16
7
Gaussian Filter2
8
Gaussian Filter3 Filter size 3 5 9 15 35
9
Laplacian Filter1 Used for the image edges detection -4 1
10
Laplacian Filter2
11
Sharpness Filter Used to increase and to make stand out the details of an image -1 -1 -1 -1 -1 5 -1 -1 9 -1 -1 -1 -1 -1
12
Sobel Filter1 Edge detection: compute opposite of the (color) gradient vector, or the norm of this vector
13
Sobel Filter2 Height map to Normal map Using Sobel Filters (ref)
Encode [-1,1]3 to [0,1]3 Note: in glsl, I swap the first and third rows of Gy, as the t axis points up!
14
馬賽克
17
Fragment Shader (1/2) Array constructor (assume texture 256x256)
step_w = 1/256 Array constructor
18
Fragment Shader (2/2)
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.