gk-12 sensors! matrices and digital pictures part ii - matrix operations with digital pictures
TRANSCRIPT
GK-12 Sensors!
Matrices and Digital Pictures
Part II - Matrix operations with digital pictures.
GK-12 Sensors!
General Electric
• Original Digital X-Ray
• 320 x 224• 256 shades of gray
GK-12 Sensors!
Contrast: Scalar Multiplication
))1,1(()1,1(
)(
XfY
XfY
• Matrix is multiplied by a scalar to shift color
• Scalar is defined by a set of equations.
• The range of the element values must remain the same
• X is the matrix of the original picture
• Y is the matrix of the new picture
• Y is a function of X
GK-12 Sensors!
Original (X) Negative (Y)
Negative
XY
X
1
10
0 0.2 0.4 0.6 0.8 10
0.2
0.4
0.6
0.8
1
InputO
utpu
t
GK-12 Sensors!
Original (X) Square (Y)
Square
2)1,1()1,1(
10
XY
X
0 0.2 0.4 0.6 0.8 10
0.2
0.4
0.6
0.8
1
Input
Out
put
GK-12 Sensors!
Original (X) Square root (Y)
Square root
2)1(1
10
XY
X
0 0.2 0.4 0.6 0.8 10
0.2
0.4
0.6
0.8
1
InputO
utpu
t
GK-12 Sensors!
Original (X) Haversine (Y)
Haversine
XY
X
cos12
1
10
0 0.2 0.4 0.6 0.8 10
0.2
0.4
0.6
0.8
1
InputO
utpu
t
GK-12 Sensors!
Histogram - A plot of the number pixels for each color value.
0 50 100 150 200 250 3000
2000
4000
6000
8000
10000
Element Value
Num
ber of
Pix
els
GK-12 Sensors!
Original (X) Slope (Y)
Slope
15.0
5.00
X
X
1
2
Y
XY
0 0.2 0.4 0.6 0.8 10
0.2
0.4
0.6
0.8
1
InputO
utpu
t
GK-12 Sensors!
Edge Sharpening: Convolution
111
191
111
H
• Convolution is an operation between two same size matrices that creates a scalar.
• The elements at the same location in each matrix are multiplied
• This product is summed with the product of the other elements.
220
210
000
X
...)2,1()2,1()1,1()1,1( XHXHy
3220290000 y
GK-12 Sensors!
• A new matrix of the same size needs to be created
• Start with the matrix of the original picture, X
• Add a row or column of zeros on each edge
• Choose a 3x3 matrix from Xnew convolve with H
• Create a new matrix, Y, by convolving H with every 3x3 matrix
22
21X
111
191
111
H
0000
0220
0210
0000
newX
1313
133Y
GK-12 Sensors!
Original (X) Edge Sharpening