의료 영상에서 특정 영역의 추출

Download Report

Transcript 의료 영상에서 특정 영역의 추출

What are Images?

2-D function F(x, y) or I(r, c)

F : pixel value, intensity, color

x, y : coordinate
Digital Image

image : analog, continuous

digital image : discrete

2-D array, matrix

pixel, picture element
Image types

pixel value types

binary images : 2 values

monochrome

gray-scale, black-and-white

color images : R, G, B

multispectral images
Digital Image Files

header



image size, bits per pixel
no. of bands, file type
raw data : pixel values


(un)compressed
palatte, lookup table (LUT)
Image Files

bmp

gif

png

jpg
BMP
구조체
BITMAPFILEHEADER
이름
bfType (2)
"BM"
내용
bfSize (4)
파일의 전체 크기
bfReserved1 (2)
bfReserved2 (2)
BITMAPINFOHEADER
bfOffBits (4)
파일에서 실제 그림 정보가 저장되어 있는 위치
biSize (4)
BITMAPINFOHEADER의 크기
biWidth (4)
그림의 가로 크기
biHeight (4)
그림의 세로 크기
biPlanes (2)
Plane의 수
biBitCount (2)
한 픽셀당 비트 수
biCompression (4)
압축 유무
biSizeImage (4)
실제 그림 정보의 크기
biXPelsPerMeter (4)
한 픽셀당 가로 길이 (meter)
biYPelsPerMeter (4)
한 픽셀당 세로 길이 (meter)
biClrUsed (4)
그림에서 실제 사용되는 컬러 수
biClrImportant (4)
rgbBlue (1)
중요하게 사용되는 컬러 수
palette
rgbGreen (1)
RGBQUAD
rgbRed (1)
rgbReserved (1)
Bits
실제 그림 정보
GIF – Graphics Interchange Format
구조체
GIF Header
이름
내용
Signature (3)
"GIF"
Version (3)
"87a" or "89a"
ScreenWidth (2)
영상의 폭
ScreenHeight (2)
영상의 높이
Packed (1)
색상정보, 해상도, 등등
BackgroundColor (1)
배경색
AspectRatio (1)
종횡비
Global Color Map
RGB (3) * 256
팔레트
Image Desriptor
Separator (1)
0x2C
Left (2)
이미지 왼쪽 위치
Top (2)
이미지 오른쪽 위치
Width (2)
이미지 폭
Height (2)
이미지 높이
Packed (1)
논리적 컬러 테이블 크기, 등등
CodeSize (1)
Root의 비트 크기
BlockByteCount (1)
실제 그림 데이타의 byte 수
bytes (BlockByteCount)
실제 그림 데이터
0x00
데이터의 끝
Raster Data
PNG – Portable Network Graphics



pronounced “ping”
Lossless compression
Chunk로 구성됨
Length (4)
Chunk data의 크기
Chunk type (4)
Chunk의 종류
Chunk data
실제 chunk data
CRC (4)
Cyclic Redundancy Check
transparency 비교

GIF와의 비교





최대 256 색상만 지원하는 GIF에 비해 PNG는 true color도 지원
GIF에 비해 20~30%정도 압축률이 좋음
GIF가 animation을 지원하는 데 반해 PNG는 지원하지 않음; PNG
의 확장인 MNG는 animation을 지원함
GIF는 background color transparency를 지원하는데 비해, PNG
는 alpha channel transparency를 지원
Gamma correction
PNG
이름
내용
Signature (8)
\211 P N G \r \n \032 \n
IHDR
image header (width, height, bit depth, color type, compression method,
filter method, interlace method)
cHRM
white balance
gAMA
specified gamma
iCCP
ICC color profile
sBIT
significant bits : indicates the color-accuracy of the source data
sRGB
indicates that standard RGB colors are used
PLTE
palette
bKGD
background color
hIST
histogram
tRNS
contains transparency information
pHYs
physical size of the image
tIME
the time last modified
iTXt
international (UTF-8) text
IDAT
실제 그림 데이터
IEND
파일의 끝
JPEG

Joint Photographic Expert Group




손실 압축방법 (lossy compression)



ISO/IEC IS 10918-1
ITU-T Recommendation T.81
JPEG 표준은 영상을 어떤 식으로 압축하는가에 대해서만 규정하고, 실제
파일 저장 형태는 JFIF (JPEG File Interchange Format)에 의해 규정된다
사람의 눈이 색의 미세한 차이를 인식하지 못하는 점을 이용
실제 사진과 같이 인접한 픽셀간 색의 차이가 작은 영상에 효과적
여러 가지 압축 방법

Baseline JPEG


Progressive JPEG


DCT (Discrete Cosine Transform) 압축 방법
하나의 파일을 여러 번의 스캔으로 나눈다; 첫 번째 스캔은 매우 낮은 화질의 이
미지를 만들고, 이어지는 스캔에서 점차적으로 화질을 높인다
Hierarchical JPEG


하나의 파일에 여러 가지 해상도를 가지는 영상을 동시에 저장하는 방법
여러 파일에 나누어 저장하는 것보다 압축률을 높일 수 있다
Baseline JPEG
컬러모델 변환
Chrominance
down-sampling
DCT transform
Quantization
Huffman
encoding
Decompressed
image
Compressed
image
컬러모델
역변환

Inverse
DCT transform
Inverse
quantization
Huffman
decoding
RGB model을 YIQ model로 변환



Chrominance
up-sampling
Luminance (Y), Chrominance (Inphase, Quadrature)
사람의 눈이 chrominance의 차이를 잘 인식하지 못하므로 이를 손
실 압축하기 위함 (chrominance down-sampling)
DCT transform

주파수 영역으로 변환하여 상대적으로 정보량이 적은 고주파 성분
을 구분하여 손실 압축하기 위함
Marker codes
Marker
Code value
Meaning
SOF0
0xFF 0xC0
Baseline DCT ( Huffman )
SOF1
0xFF 0xC1
Extended sequential DCT ( Huffman )
SOF2
0xFF 0xC2
Progressive DCT ( Huffman )
SOF3
0xFF 0xC3
Spatial ( sequential ) DCT ( Huffman )
DHT
0xFF 0xC4
Define Huffman Table
SOF5
0xFF 0xC5
Differential sequential DCT ( Huffman )
SOF6
0xFF 0xC6
Differential progressive DCT ( Huffman )
SOF7
0xFF 0xC7
Differential spatial ( Huffman )
SOF9
0xFF 0xC9
Extended sequential DCT ( arithmetic )
SOF10
0xFF 0xCA
Progressive DCT ( arithmetic )
SOF11
0xFF 0xCB
Spatial ( sequential ) lossless ( arithmetic )
DAC
0xFF 0xCC
Define Arithmetic Coding
SOF12
0xFF 0xCD
Differential sequential DCT ( arithmetic )
SOF13
0xFF 0xCE
DIfferential progressive DCT ( arithmetic )
SOF14
0xFF 0xCF
Differential spatial ( arithmetic )
SOI
0xFF 0xD8
Start of Image
EOI
0xFF 0xD9
End of Image
SOS
0xFF 0xDA
Start of Scan
DQT
0xFF 0xDB
Define Quantization Table
DNL
0xFF 0xDC
Define Number of Line
DRI
0xFF 0xDD
Define Restart Interval
DHP
0xFF 0xDE
Define Hierarchical Progression
JPEG 파일 구조
<SOI>
<DHT> ...
<DQT> ...
<SOF>
...
<SOS> ...
<SOS> ...
<SOS> ...
<EOF>
<EOI>
JPEG 파일 전체 구조 :
SOI
Tables
Frames
EOI
SOF
Frame Header
Scan Data 1
Scan Data 2 ...
SOS
Scan Header
ECS Data 1
ECS Data 2 ...
MCU Data ...
Frame Header :
SOF (2)
Lf (2)
P (1)
Y (2)
Scan Header :
SOS (2)
Ls (2)
Ns (1)
Cs (1)
Quantization table :
DQT (2)
Lq (2)
Pq (0.5) Tq (0.5)
Huffman table :
DHT (2)
Lh (2)
Th (0.5)
X (2)
Nf (1)
Td (0.5) Ta (0.5)
C (1)
H (0.5)
V (0.5)
Tq (1)
Ss (1)
Se (1)
Ah (0.5)
Ai (0.5)
Quantization table (64)
Huffman Code Length (16)
Huffman codes (64)






















Lf : frame header의 길이
P : 양자화 비트 수
Y : 영상의 세로 크기
X : 영상의 가로 크기
Nf : 프레임을 구성하는 컴포넌트 수
C : 컴포넌트 번호
H : 수평 샘플링 인자
V : 수직 샘플링 인자
Tq : 양자화 테이블 번호
Ls : scan header 블록의 길이
Ns : 스캔 컴포넌트 수
Ss : 스펙트럴 선택 방식의 개시
Se : 스펙트럴 선택 방식의 종료
Ah, Ai : 비트 위치를 표시하는 상위 정보와 하위 정보
Cs : 컴포넌트 번호
Td : DC 계수 엔트로피 부호 테이블 번호
Ta : AC 계수 엔트로피 부호 테이블 번호
Lq : table header의 길이
Pq : 양자화 테이블의 각 값의 비트수
Tq : 양자화 테이블 번호
Lh : huffman table header의 길이
Th : 허프만 테이블 번호
Image Files

bmp

gif – lossless (LZW)

png – lossless (LZW)

jpg – lossy (DCT)
Binary image

BMP


GIF


Microsoft의 경우 : palette에 2개의 색상을 정하고, 8bpp color
index를 사용하는 bitmap을 생성한 후에, 이를 LZW 압축 방법으로
저장
PNG


Palette contains two entries, each bit in the bitmap array
represents a pixel
GIF와 유사
JPEG

자연 영상을 대상으로 한 압축 방식이기 때문에 binary image에는
적합하지 않음
Monochrome image

BMP


GIF


Either palette(2, 16, 256) or true color can be used
PNG


Either palette(2, 16, 256) or true color can be used
Either palette(2, 16, 256) or true color can be used
JPEG

As there is no palette information, only true color can be
used