Вы находитесь на странице: 1из 19

IMAGE PROCESSING IN JAVA

Objective

1. Putting Image File to b. Local Level


Java Project Explore 1) LPF
2. Viewing Image 2) HPF
3. Image Processing : 3) Median Filter
a. Point Level (Pixel by pixel) 4) Block Splitting Averaging
1) RGB2Grayscale c. Global Level
2) Black or white pixel 1) Histogram Equalization
(Thresholding)
d. Morphology
3) Reverse
4) Clipping
1) Dilation
5) Rotate 2) Erosion
6) Translation 3) Open
7) Dilate 4) Close
Viewing Image

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

Width = Width of Image


Height = Height of Image
Nb = Bit Number per pixel (bit/pixel)
Nc = Number of Colour Component Used
Digital Image Type

 Binary (Only 1 bit B/W  0/1)


 Nb=1, Nc=1
 Grayscale (Only 1 colour component)
 Nb=8,16,24,32, Nc=1
 RGB (3 Colour Components)
 Nb=8,16,24,32, Nc=3
Binary Image
Grayscale Image
True Colour Image
Bit – Byte Conversion
 1 byte = 8 bits 1 Mbyte = …….. Kbyte
 1 kilobyte (K / Kb) = 2^10 bytes = 1 Gbyte = ……… Mbyte = ………….
1,024 bytes Kbyte
 1 megabyte (M / MB) = 2^20 bytes =
1,048,576 bytes
 1 gigabyte (G / GB) = 2^30 bytes =
1,073,741,824 bytes
 1 terabyte (T / TB) = 2^40 bytes =
1,099,511,627,776 bytes
 1 pentabyte (P / PB) = 2^50 bytes =
1,125,899,906,842,624 bytes
 1 exabyte (E / EB) = 2^60 bytes =
1,152,921,504,606,846,976 bytes
Data Type

 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)

Вам также может понравиться