Bab 10 Image Processing in Java
Bab 10 Image Processing in Java
Objective
gb=(ImageView)findViewById(R.id.my_image_
view);
bmp
=BitmapFactory.decodeResource(getResource
s(),R.drawable.ghaida);
gb.setImageBitmap(bmp);
Pixels
Citra Digital adalah citra kontinyu yang diubah ke dalam bentuk diskrit, baik
koordinat maupun intensitas cahayanya.
Image Matrix as a group of pixels
Pencuplikan dan Kuantisasi
TETANGGA-TETANGGA SEBUAH PIXEL
Sebuah pixel p pada koordinat (x,y)
mempunyai :
→ 4 buah tetangga horisontal dan vertikal
yaitu : (x+1,y), (x-1,y), (x,y+1), (x, y-1)
yang disebut dengan 4 tetangga p = N4(p).
→ 4 buah tetangga diagonal yaitu : (x+1,
y+1), (x+1, y-1), (x-1, y-1), (x-1, y+1) dan
dinyatakan dengan ND(p).
Image
Image File Capacity (bits)
=
Width x Height x Nb x Nc
Logical (0/1)
Single (32 bit: min 1.1755e-038,max
3.4028e+038)
Double (64 bit: min 2.2251e-308, max
1.7977e+308)
UintX (uint8,uint16,uint32,uint64)
Range : 0 up to 2x-1
IntX (int8,int16, int32,int64)
Range : -2x-1 up to 2x-1-1
RGB2Grayscale
Lightness method
Gray=(max(R, G, B) + min(R, G, B)) / 2
Average method
Gray=(R + G + B) / 3
Luminosity method
Gray=aR+bG+cB
a+b+c=1
R,G, & B must uintX type
Usually a=0.21, b=0.71, c=0.07
Point Processing (1)
Thresholding : 0, f ( x, y ) T
f ( x, y )
1, f ( x, y ) T
Reverse : f ‘(x,y)=255 - f(x,y)
Clipping :
255 f ( x, y ) 255
f ( x, y ) f ( x, y ) 0 f ( x, y ) 255
0 f ( x, y ) 0
Point Processing (2)
Rotate
Translate
Dilate
Local Processing
LPF
HPF
Median Filter
Cropping
Global Processing
Histogram Equalization
Movie
Movie File Capacity (bits)
=
Width x Height x Nb x Nc x T x Nf
Width = Width of Image
Height = Height of Image
Nb = Bit Number per pixel (bit/pixel)
Nc = Number of Colour Component Used
Nf = Number of Frames (frame/s)
T = duration (s)