Graphics Processing Systems 2015: Author: Ungureanu Estera-Bianca 2 Year MIT, 2016
Graphics Processing Systems 2015: Author: Ungureanu Estera-Bianca 2 Year MIT, 2016
Graphics Processing Systems 2015: Author: Ungureanu Estera-Bianca 2 Year MIT, 2016
Project
Image Effects
Author:
Ungureanu Estera-Bianca
2nd year MIT, 2016
Page 1 of 9
fig.1
For the Project, the channels Y,U,V have ranges from 0 to 255 in unsigned char form.
All the input images are in format YUV 420p with size (width x heigh)t = 640x480 (VGA).
2) Image Effects
a) Sharpen : Image sharpening falls into a category of image processing called spacial filtering. The
Laplacian operator is an example of a second order or second derivative method of enhancement. As a
result, the Laplacian operator store fine detail of an image which has been smoothed to remove noise.
It is a matrix and looks like this fig.2. To complete the image sharpening the filtered Laplacian image
is subtracted back to the original image, and scale the data into the range 0 to 255.
fig.2
1 1 1
1 -8 1
1 1 1
b) Emboss : An emboss filter gives a 3D shadow effect to the image, the result is very useful for a
bumpmap of the image. It can be achieved by taking a pixel on one side of the center, and subtracting
one of the other side from it. Pixels can get either a positive or a negative result. To use the negative
pixels as shadow and positive ones as light, for a bumpmap, a bias of 128 is added to the image. Now,
most parts of the image will be gray, and the sides will be either dark gray/black or bright gray/white.
fig.3
Page 2 of 9
c) Blur
fig.4
d) Motion Blur : Motion blur is achieved by blurring in only 1 direction. It's as if the camera is
moving from the top left to the bottom right.
fig.5
e) Edge Detect :
fig.6
f) Grayscale : Y channel remain the same, U and V channels are are setted to middle value.
(256/2 = 128)
g) Luminance enhance (histogram equalization)
Histogram equalization is performed in the following way:
The histogram of the input image is calculated;
Cumulative distribution of the histogram is calculated;
Use the cumulative distribution to construct a look-up table that maps each gray value to the
equalized one and
Update the image using the look-up table constructed in the last step.
3) Tools:
Page 3 of 9
4) Appendix
An example small grayscale image (10x10):
34
50
93
32
10
192
239
230
227
215
22
150
0
19
90
70
202
174
86
165
77
77
77
44
48
27
196
14
195
237
48
158
219
30
73
88
205
22
6
110
237
233
43
36
63
20
50
127
53
125
205
251
56
94
148
230
123
100
168
191
29
112
42
151
159
53
192
189
46
191
212
165
113
101
183
34
88
186
166
94
107
47
140
28
99
38
41
214
36
123
41
229
94
84
22
106
37
187
249
8
-1
8
-1
-1
-1
-1
The row=2, column=2 pixel and its neighborhood from the image above: The row=2, column=2
pixel and its neighborhood from the image above:
34
50
93
22
150
0
77
77
77
To apply the convolution filter multiply the filter values with the image data block. Work with each pixel
and its 3x3 neighborhood:
-1*34
-1*50
-1*93
-1*22
8*150
-1*0
-1*77
-1*77
-1*77
34
50
93
22
255
0
77
77
77
Continue with all other 3x3 blocks in the image using original values. For example the next image block
is:
22
150
0
77
77
77
48
158
219
The 3x3 "window" is shifted to the right by one and that the new pixel value is NOT used but stored as a
second new image.
Most of the image is processed in this manner. Image borders create problems and are ignored.
Many filters can easily be defined for other purposes.
5) Results
YUV Channels
Page 5 of 9
Sharpen
Emboss
Page 6 of 9
Blur
Motion Blur
Page 7 of 9
Edge Detect
Gray
Page 8 of 9
Luminance enhancement
Page 9 of 9