제 2 장 영상의 디지털화
[email protected]
Prof. Doo-Hyun Choi
Introductory Image Processing
In this lecture?
영상 모델
그레이 영상(Gray image) / 컬러 영상 (Color image)
영상의 디지털화
영상의 표본화/ 영상의 양자화
Image & Image Formation
Two projections possible
Field of View & Brightness
디지털 영상 신호의 저장
디지털 영상의 데이터 양
디지털 영상의 파일 저장 양식
BMP 파일 / PCX 파일 / TIFF 파일 / GIF 파일 / JPG 파일 / PNG 파일 / Etc.
Related Fields
Introductory Image Processing Lecture Note 02
IISL, School of Electronics Engineering, KNU (3/24)
영상 모델
그레이 영상 (Gray Image)
영상: 빛의 세기를 2차원 함수f (x, y)로 나타낸 것 f (x, y): 공간좌표 (x, y)에서 빛의 강도, 영상의 밝기.
조명성분i (x, y), 반사정도 r (x, y), f (x, y) = r (x, y) i (x, y) 여기서, 0< f (x, y) <∞, 0< i (x, y) <∞, 0< r (x, y) <1
명암도l, Lmin≤ l ≤ Lmax 여기서, Lmin≥ rminimin, Lmax≤ rmaximax
l∈[Lmin, Lmax] [0, L], 즉, [검정, 흰색]의 회색조, 8비트의 경우엔 [0, 255]
컬러 영상 (Color Image)
RGB 각각의 명암도로 표현됨.
) , ( yx f
) , ( yx i
) , ( yx r
Introductory Image Processing IISL, School of Electronics Engineering, KNU
영상의 디지털화 (1/5)
영상의 디지털화
표본화(sampling): 공간적 디지털화
양자화(quantization): 명암도의 디지털화
1차원 신호의 디지털화 = 시간 디지털화 (sampling) + 크기 디지털화 (quantization)
연속시간+연속값 t 크기
아날로그 신호
t 크기
이산시간+연속값 이산 신호
t 크기
이산시간+이산값 디지털
신호 4
6 7
Binary Code 0100 0110 0111
Introductory Image Processing Lecture Note 02
IISL, School of Electronics Engineering, KNU (5/24)
영상의 디지털화 (2/5)
영상의 표본화
영상f (x, y): M x N 의 이산크기의 배열, f (m, n): (m, n) 위치의 화소 값, pixel, pel
y
원점
x
f (x, y) (그레이레벨)
] 1 , 0 [ ], 1 , 0 [ , ) 1 , 1 ( )
1 , 1 ( ) 0 , 1 (
) 1 , 1 ( )
1 , 1 ( )
0 , 1 (
) 1 , 0 ( )
1 , 0 ( )
0 , 0 ( )
,
( ∈ − ∈ −
−
−
−
−
−
−
= m M n N
N M f M
f M
f
N f f
f
N f f
f n
m f
영상의 디지털화 (3/5)
다양한 공간 해상도의 Lena 영상들
256 x 256 64 x 64
32 x 32 8 x 8
128 x 128
16 x 16
Introductory Image Processing Lecture Note 02
IISL, School of Electronics Engineering, KNU (7/24)
영상의 디지털화 (4/5)
영상의 양자화
명암도l∈[Lmin, Lmax] [0, L], 8비트의 경우 l∈ [0, 255] 256 단계의 명암도
인간 눈: 500 단계의 명암 해상도 (9비트)
CRT 디스플레이: 4-8 비트
인쇄: 3-4 비트
계측 장비: 고 명암 해상도가 필요함.
Introductory Image Processing IISL, School of Electronics Engineering, KNU
영상의 디지털화 (5/5)
다양한 명암 해상도의 Lena 영상들
256 명암도 128 명암도 64 명암도 32 명암도
16 명암도 8 명암도 4 명암도 2 명암도
Introductory Image Processing Lecture Note 02
IISL, School of Electronics Engineering, KNU (9/24)
Image (1/2)
Image
A spatial representation of an object, a two-dimensional or three-dimensional scene, or another image
Sensing devices
Passive sensing device: CCD (camera or video image)
Active sensing device: radar, laser range finder, infrared sensor, sonar
Continuous function defining usually a rectangular region of a plane
I(r,c): intensity value of row r and column c.
Example
Intensity image : optic or photographic sensors (radiant energy)
Range image : range finder sensors (line-of-sight distance)
Tactile image : tactile sensors (sensor deformation)
Image (2/2)
Image
Function with resulting (discrete) values of the light intensity at each point over a planar region
Picture element = pixel or pel
I(r, c) : intensity value at (r, c)
Binary-valued image
0 or 1
8-bit gray image
0 ~ 255
24-bit color image
R(0 ~ 255) * G(0 ~255) * B(0 ~ 255)
Ex: 640 x 480 24-bit color image
Spatial resolution (640 x 480)
color resolution (24-bit color encoding)
Introductory Image Processing Lecture Note 02
IISL, School of Electronics Engineering, KNU (11/24)
Image Formation
Two key questions of image formation
1. What determines where the image of some point will appear? location 2. What determines how bright the image of some surface will be? brightness
Image: two-dimensional pattern of brightness
Two projections possible
Perspective projection
Consider an ideal pinhole at a fixed distance in front of an image plane
Orthographic projection
Assume that the distance of an object being imaged is small or similar to the focal length
Introductory Image Processing IISL, School of Electronics Engineering, KNU
Perspective Projection
Consider an ideal pinhole at a fixed distance in front of an image
O: pinhole
P(X,Y,-z0)
P’(x,y,z)
-z0 f: focal length
z: optical axis
( ) ( )
( ) ( )
( ) ( ) , camera : 1
: factor ion magnificat
, 0 , , coordinate
image ing correspond
and 0 , , : coordinate
scene Since
: :
: :
) , , (
) , , (
2 0 2
2 2
0 0 0
0 0
− <
= ′ +
= +
−
=
−
=
= −
= ′
′
= −
= ′
′
−
′ =
−
′ =
= ′
′
−
=
z m f Y X
y m x
y x Y
X
mY y
mX x
z Y f y y
z X f x x
Y z y f
X z x f f
y x P O
z Y X OP
T T
T T
δ δ
δ δ
δ δ δ
δ
Introductory Image Processing Lecture Note 02
IISL, School of Electronics Engineering, KNU (13/24)
Orthographic Projection
Let depth range of a scene be the range of distances of surfaces from the camera.
The magnification is approximately constant when the depth range of the scene being images is small relative to the average distance of the surfaces from the camera.
e.
convenienc
for 1 - or 1 to set is and
: on Simplicati
of value average
the : and
where
0
0
Y m y
X x
z z z
m f mY
y mX x
=
=
−
− −
= ′
−
=
−
=
O: pinhole
P(X,Y,-z0) P’(x,y,z)
-z0 f: focal length
z: optical axis
Field Of View
The field of view of an imaging system is the angle of the cone of directions encompassed by the scene that is being imaged.
A telephoto lens is one that has a long focal length relative to the image size and thus a narrow field of view.
A wide-angle lens has a short focal length relative to the image size and thus a
wide field of view.
Introductory Image Processing Lecture Note 02
IISL, School of Electronics Engineering, KNU (15/24)
Brightness
Brightness: image brightness, scene brightness
Irradiance
Image brightness, Power per unit area falling on a surface (W/m
2)
the power of the radiant energy falling on the infinitesimal surface patch of area δA
Radiance
Scene brightness, energy flux emitted from a surface
Power per unit foreshortened area emitted into a unit solid angle (W/(m
2⋅st): Watts per square meter per steradian) by a surface
The power emitted by the infinitesimal surface patch of area δA into an infinitesimal solid angle δω
A E P
δ
=
δ
Irradianceδω δ
δ
A L= P RadianceIntroductory Image Processing IISL, School of Electronics Engineering, KNU
디지털 영상 신호의 저장(1/2)
디지털 영상의 데이터 양
정지 영상의 데이터 양= 수평 방향 화소 수 x 수직방향 화소 수 x 화소당 비트 수
예1: 영상의 크기: 512 x 512, 화소 당 256 명암도의 흑백 영상 512 x 512 x 8 = 2,097,152 bit or 29x 29x 23/ 23= 256KBytes
예2: 영상의 크기: 512 x 512, 화소 당 R, G, B 각각 256 명암도의 컬러 영상 3 x 256KB = 768KBytes
초당 동영상의 데이터 양= 정지영상의 데이터 양 x 초당 프레임 수
예1: 영상의 크기: 512 x 512, 화소 당 256 명암도의 흑백 영상을 초당 30 프레임 처리한다 면
256KB x 30 = 7,680KB = 7.5MBytes
예2: 영상의 크기: 512 x 512, 화소 당 R,G, B 각각 256 명암도의 컬러 영상을 초당 30 프레 임 처리한다면
7.5M x 3 = 22.5MBytes
Introductory Image Processing Lecture Note 02
IISL, School of Electronics Engineering, KNU (17/24)
디지털 영상 신호의 저장(2/2)
디지털 영상의 저장 형식
BMP 파일
장치 종속적 비트맵 (DDB: Device Dependent Bitmap)
영상의 출력 속도를 높일 수 있으나 시스템에 따라 색이 다르게 표현된다.
장치 독립적 비트맵 (DIB: Device Independent Bitmap)
파일헤더에 색 정보를 포함하므로 장치에 무관하게 항상 일정한 색으로 표현됨.
PCX 파일
Paintbruth 프로그램을 개발한 Zsoft사에서 제안
영상 데이터는 라인 별로 Run length Encoding 되어 있다.
TIFF 파일
Tagged Image File Format의 약자
스캐너 판매자와 desktop publishing s/w를 위해 엘더스사와 마이크로소프트사가 공동 개발
이종 컴퓨터간의 데이터 호환을 위해 개발된 형식
GIF 파일
Graphic Interchange Format의 약자
미국의 CompuServe사에서 1987년 데이터 전송 및 화상 압축과 복구를 위해 규정한 방식
수정된 LZW 압축 방식사용
높은 압축률과 빠른 실행 속도가 장점.
Jpeg (1/3)
Steps of the lossy sequential DCT-based coding mode
Not DFT, But DCT! Why?
DCT uses smaller coefficients
DCT have more efficient energy compaction capability
Introductory Image Processing Lecture Note 02
IISL, School of Electronics Engineering, KNU (19/24)
1-D Example
Jpeg (2/3)
Introductory Image Processing IISL, School of Electronics Engineering, KNU
Jpeg (3/3)
2D Example
Original Data
1 2 3 4 5 6 7 8
1
2
3
4
5
6
7
8
After DFT-IDFT Data
1 2 3 4 5 6 7 8
1
2
3
4
5
6
7
8
After DCT-IDCT Data
1 2 3 4 5 6 7 8
1
2
3
4
5
6
7
8
Introductory Image Processing Lecture Note 02
IISL, School of Electronics Engineering, KNU (21/24)
Related Fields (1/2)
Digital image processing (DIP)
Image coding
Pattern classification (recognition)
Scene analysis
Pattern Classification (Recognition)
Image(Feature vector)
Class number
Digital Image Processing
Image Image
Image Coding
Image Code
Scene Analysis
Input description Output description
Related Fields (2/2)
Computer vision (machine vision, artificial vision, robot vision)
Application Feedback
Imaging Device(Information/Description)
Scene Image Symbolic
Data
Computer VisionIntroductory Image Processing Lecture Note 02
IISL, School of Electronics Engineering, KNU (23/24)
HW #3
512 x 512 256 gray Lena 영상의 해상도를 변경.
공간해상도 변화 (256 x 256, 128 x 128, 64 x 64, 32 x 32, 16 x 16)
강의노트 6페이지 참조
명암해상도 변화 (256, 128, 64, 32, 16, 8, 4, 2)
강의노트 8페이지 참조
Sampling theorem에 대해 조사하고 정리하시오.
BMP 파일의 내부구성(헤더 및 데이터)에 대해 조사하고 정리하시오.
GIF의 압축 표준인 LZW에 대해 조사하시오.
제출: 최봉석 조교([email protected]) due to next Tuesday.
Introductory Image Processing IISL, School of Electronics Engineering, KNU