Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Digital Image
gridof
ofsquares,
squares,
aagrid
eachof
ofwhich
which
each
containsaasingle
single
contains
color
color
eachsquare
squareisis
each
calledaapixel
pixel(for
(for
called
pictureelement)
element)
picture
February 9, 2016
Pixels
February 9, 2016
Pixels
February 9, 2016
Pixels
Pixel Location: p = (r , c)
Pixel Value: I(p) = I(r , c)
February 9, 2016
Pixel : [ p, I(p)]
5
Pixels
February 9, 2016
Pixel : [ p, I(p)]
Coding
Matlab
OpenCV
February 9, 2016
February 9, 2016
February 9, 2016
February 9, 2016
10
left
leftclick
clickhere
hereand
andhold
hold
February 9, 2016
drag
dragto
tohere
hereand
andrelease
release
11
February 9, 2016
12
February 9, 2016
13
February 9, 2016
14
Intensityvalues
values
Intensity
areintegers
integers
are
between00and
and255.
255.
between
227
222
96
imageclass:
class:uint8
uint8
image
imagetype:
type:truecolor
truecolor
image
row: 231
February 9, 2016
15
Intensityvalues
values
Intensity
arenumbers
numbers
are
between00and
and1.1.
between
0.89
0.87
0.38
imageclass:
class:double
double
image
imagetype:
type:truecolor
truecolor
image
row: 231
February 9, 2016
16
Numberat
atpixel
pixel
Number
locationisisan
anindex
index
location
intoaacolormap.
colormap.
into
Intensityvalues
values
Intensity
areintegers
integers
are
between00and
and1.1.
between
colormap
0.1804
0.6863
0.8863
0.1882
0.7098
0.9059
0.0627
0.2902
0.2549
red
green
blue
col: 326
256
226
231
65
row: 231
imageclass:
class:uint8
uint8
image
imagetype:
type:colormapped
colormapped
image
February 9, 2016
17
24-bit truecolor
February 9, 2016
18
24-bit truecolor
February 9, 2016
19
111 121
48 111
48
110
48 111 110 111
110 111 121
48 121
121
48 110 111
48
110 121
48 121 110
actual values
values in
in CMAP(109:113,:)
CMAP(109:113,:)
actual
R
G
B
109
110
111
112
113
0.6588
0.2196
0.4706
0.5333
0.2824
0.4706
0.1569
0.3451
0.4078
0.2196
0.8471
0.2824
0.5961
0.6588
0.3451
255*CMAP(109:113,:)
255*CMAP(109:113,:)
R
G
B
109
110
111
112
113
168
56
120
136
72
120
40
88
104
56
216
72
152
168
Last
Last
33
cols.
cols.
only
only
88
February 9, 2016
20
% truecolor as .bmp
imwrite(I,image_name.bmp,bmp);
% truecolor as .jpg (default quality = 75)
imwrite(I,image_name.jpg,jpg);
% truecolor as .jpg (quality = 100)
imwrite(I,image_name.jpg,jpg,Quality,100);
% colormapped as .bmp
imwrite(I,cmap,image_name.bmp,bmp);
% colormapped as .gif
imwrite(I,cmap,image_name.gif,gif);
February 9, 2016
Assuming
Assumingthat
that
IIcontains
containsthe
theimage
image
of
the
correct
class,
of the correct class,
that
that
cmap
cmapisisaacolormap,
colormap,
and
that
and that
image_name
image_nameisisthe
the
file-name
that
you
file-name that you
want.
want.
22
Double Exposure:
Adding Two Images
February 9, 2016
23
February 9, 2016
24
February 9, 2016
25
February 9, 2016
26
February 9, 2016
27
Intensity Masking:
Multiplying Two Images
February 9, 2016
28
February 9, 2016
29
February 9, 2016
scaledback
backinto
intothe
therange
range0-255.
0-255.
scaled
30
Fun(if
(ifyoure
yourean
animaging
imaginggeek)
geek)
Fun
thingto
totry
trywith
withMatlab
Matlab
thing
indexing: Scramble
Scramblean
animage!
image!
indexing:
February 9, 2016
31
>>
>>
>>
>>
>>
>>
>>
>>
Theimage
imagecan
canbe
be
The
unscrambledusing
using
unscrambled
the
row
and
column
the row and column
permutation
permutation
vectors,rr&&c.c.
vectors,
xlabel('What is it?')
K(r,c,:) = J;
figure
image(K)
truesize
title('Yay!!!')
xlabel('Photo: Lawraa on Flickr.com')
February 9, 2016
32