Image Processing 1. Introduction Computer Engineering, g, Sejong University Dongil Han What is Image Processing? Science of manipulating a picture Enhance or distort t an image Create a new mage from portions of other images 2/49
미디언필터링 (Median Filtering) 3/49 Image Processing vs. Computer Graphics They are companion technologies Computer graphics Works with 2-D, 3-D objects Image processing 4/49
Image based rendering Original image User marked edge Generated image 5/49 Four basic classifications Point processing Modifies a pixel s value based on that pixel s original value or position Area processing Geometric processing Change the position or arrangement of the pixels Frame processing See Figure 1.1 ~ 1.4 6/49
Four basic classifications Point processing example Area processing example Geometric processing example 7/49 Frame processing example Image Processing Applications Science and Space NASA research projects provided millions of images Movies Morphing Image Warping(see Figure 1.5) The paperless office Medical industry X-rays, ultrasound, CT(computed tomography), MRI(magnetic resonance imaging), etc. 8/49
Image Processing Applications Gamma-ray imaging 9/49 Image Processing Applications X-ray imaging 10/49
Image Processing Applications MRI images 11/49 Image Processing Applications Machine vision Automated inspection Extensively used in semiconductor manufacturing Law enforcement Fingerprint inspection Iris recognition 12/49
Image Processing Applications 13/49 Image Processing Applications http://www.ri.cmu.edu/projects/project_320.html / t / j t 14/49
Visual Perception Structure of the human eye Blind Spot Cornea : 각막 Pupil : 동공 Iris : 홍채 Lens : 수정체 Retina : 망막 Fovea : 중심와 Blind Spot : 맹점 Optic Nerve : 시신경 15/49 Visual Perception Rods and Cons Rods - respond to dim light for BW vision - - do not contribute color vision Cones - - one of f3 spectral ltypes: S(blue), M(green), L(red) - concentrated in the center of retina 16/49
Visual Perception The left eye 17/49 Visual Perception 18/49
Visual Perception Spectral response of cones - see Figure 1.7 19/49 Visual Perception 원추세포 (Cone) 의경우세가지종류의색수용체 S 형 : M 형 : 중간파장의가시광선에반응 L 형 : R, G, B 성분의형태와는약간차이존재 S M L 20/49
Visual Perception Simultaneous Contrast 21/49 Visual Perception Perceived Brightness 22/49
Color representation Color model(color space) Different image processing systems use different color models TV camera, Display monitor : RGB color space Broadcasting : YIQ color space HSI Color space : Hue( 색상 ), Saturation( 채도 ), Intensity( 명도 ) 로색을표현 XYZ, LAB, YUV, YCbCr, etc. 23/49 Color representation RGB color space 24/49
Color representation CMYK color space Primary color : cyan, magenta, yellow CMY color space M = 1.0 - G CMYK color space Black(K) is added Black is more pure black than the combination of other three colors Black ink is cheaper than colored ink 25/49 원색 (Primary Color) 빛의합성 (Mixture of light) Additive primaries( 가법혼색 ) Red, Green, Blue 염료의합성 (Mixture of pigments) Subtractive primaries( 감법혼색 ) Cyan, Magenta, Yellow 26/49
HSI color space 색을인간이이해하기쉽도록표현 색상 (Hue) 성분은칼라스펙트럼을표현 채도 (Saturation) ti 성분은색의순도를표현 색에흰색이섞이지않은정도를표현 핑크는빨강에비해서흰색이많이섞임 명도 (Intensity) 성분은색의밝기를표현 광원이아닌표면색 (Surface color) 의표현에적합 27/49 RGB to HSI RGB 신호와 HSI 신호의관계식은 H θ = 360 θ if if B G B > G θ = cos 1 0.5[( R G ) + ( R B )] 2 [( R G) + ( R B)( G B)] θ 값은 red 축을기준으로측정 3 S = 1 [min( R, G, B)] ( R + G + B) ) 1 I = ( R + G + B) 3 RGB 값은 [0,1] 사이의값으로정규화됨 RGB 색공간과의비선형함수로 HSI 색공간이결정됨 1/ 2 28/49
RGB, HSI Color Model 29/49 HSI Color Model 30/49
Color image and its components 31/49 Color representation YCbCr color space Y : 밝기정도표현 Cr : 붉은정도표현 Y = 0.299R + 0.587G + 0.114B Cb = -0.16874R 0.33216G + 0.5B Cr = 0.5R 0.41869G 0.08131B08131B 기타규격별로 RGB 와 YCbCr 간의다른변환관계식존재 32/49
Image capture Image capturing device Photo diode : 빛을받으면전류를발생, 0-D sensor Camera : 2-D image sensor CCD(charge coupled device) 추후 sampling과 quantization을거쳐서변환된 digital 영상을영상처리에서사용 33/49 Image capture 34/49
Image capture CCD의동작원리 전하를판독할수있도록적절한순간에이동시킴 35/49 Analog image Image acquisition process Analog image examples: 렌즈계에의한화상 ( 카메라필름, 영화필름 ) 36/49
Sampling and Quantization sampled image : 이산적인위치만가짐 quantized image : 이산적인밝기만가짐 37/49 Digital Image Digital image sampling 되고 quantized 된 image Picture elements = pels = pixels 38/49
Digital Image Representation 영상의크기 : 해상도 (resolution) 로표현 ( 예 :256 256, 512 512) 0 f(x,y) L, L = 2 k -1(L = 1, 63, 255, 1023, etc.) (x,y) : 공간좌표 (spatial coordinate) t : 시간축좌표 (temporal coordinate) 39/49 Digital Image Representation 영상의함수표현 f(x,y) : 이차원정지영상 (2-D still image) f(x,y,z) : 삼차원정지영상 (3-D still image) f(x,y,t) : 이차원동영상 (2-D moving image, video sequence) f(x,y,λ) : 이차원칼라영상 (color image) 함수값의의미 - TV camera, scanner 등 대상물체의투과율정보 (especially bodies) -X-ray 영상, 초음파영상 (Ultrasonic imaging) 등 - 수중음파탐지기 (sonar imaging), 레이더등 대상물체의온도 - 적외선카메라 (infrared camera) 등 40/49
Digital Image Representation Sampling effect 41/49 Digital Image Representation Sampling theorem( 표본화정리 ) 화상정보를보존하기위해서는신호가가지는최고주파수의 2 배이상의주파수로표본화를해야한다. 42/49
Digital Image Representation Quantization effect 43/49 Digital Image Representation false contour Quantization effect 44/49
Digital Image Storage 디지털영상의데이터량 M X N 의화소로분해, 각화소에 k 비트할당 : M*N*k 비트의데이터량 M, N, k 는주어진영상의특징에따라서결정. 45/49 Software 교재의 source code 참고 영상 : PNM(Portable Anymap Format) file format PBM(portable bitmaps): 이진파일 PGM(portable graymap): 밝기영상저장 File header에서포맷형태정의 46/49
PNM file format PNM header + image data PNM header Magic Number What type of file and how data is stored Image Width Width of image in pixels Image Height Height of image in pixels Max Maximum gray scale/color channel value 각각의필드는 white space 로분리됨 (blanks, tabs, line feeds, or carriage returns) Image data 부는 ASCII 형태나 raw binary 형태를가짐 Magic number를이용해서정의 이진파일의경우 Max 부분을사용하지않음 47/49 PNM file format Magic number Format ASCII RAWBITS PBM P1 P4 PGM P2 P5 PPM P3 P6 Image data format 48/49
PPM file example 720x256 image PNM file format File 내용 49/49 P3 720 256 255 210 0 0 214 0 0 204 0 0 209 0 0 199 0 0 204 0 0 194 0 0 199 0 0 189 0 0 194 0 0 184 3 0 189 8 0 179 15 0 184 19 0 174 26 0 179 31 0 169 38 0 174 43 0 164 49 0 169 54 0 159 61 0 164 66 0 154 73 0 158 77 5 149 84 26 153 89 31 144 96 52 148 101 57 Magic number Image size Channel level l Image data