You are on page 1of 135
ik TES Choice Based Credit System | with effect from the Academic Year 2018-2019 | | | { DiciTAL IMAGE PROCESSING (Using MATLAB Codes) (Elective II) (USCS605) Dhananjay K. Theckedath 4 | | + Model Question Papers as per Examination Pattern 4 ; + With Muiticolour Diagrams | 9A, CBSCEI9A Price 230/- we tT z SYLLABUS ‘TOPICS (Credits : 03 Lectures / Week : 03) ‘USCS60S Digital Image Processing Objectives ‘To study two-dimensional Signals and Systems. To understand image fundamentals and transforms necessary for image processing. To study the image enhancement techniques in spatial and frequency domain. To study image segmentation and image compression techniques. Expected Learning Outcomes ‘Learner should review the fundamental concepts of a digital image processing system. Analyze the images in the frequency ‘domain using various transforms. Evaluate the techniques for image enhancement and image segmentation. Apply various compression techniques. They willbe familiar with basic image processing techniques for solving real problems. Uniti | Introduction to image-processing System ; Introduction, Image Sampling, Quantization, Resolution, Human Visual Systems, Elements of an Image-processing ‘System, Applications of Digital Image Processing. 2D Signals and Systems : 2D signals, separable sequence, periodic sequence, 2D systems, classification of 2D systems, 2D Digital filter. Convolution and Correlation ; 2D Convolution through graphical method, Convolution through 2D Z-transform, 2D Convolution through matrix analysis, Circular Convolution, Applications of Circular Convolution, 2D Correlation. Image Transforms : Need for transform, image transforms, Fourier transform, 2D Diserete Fourier Transform, Properties of 2D DFT, Importance of Phase, Walsh ‘transform, Hadamard transform, Haar transform, Slant transform, Discrete Cosine transform, KL transform. ‘(Refer Chapters 1, 2,3, 68 and Appendix} Tmage Enhancement : Image Enhancement in spatial domain, Enhancement through Point operations, Histogram manipulation, Linear and nonlinear Gray Level ‘Transformation, local or neighborhood operation, Median Filter, Spatial domain High pass filtering, Bit-plane slicing, Image Enhancement in frequency domain, Homomorphic filter, Zooming operation, Image Arithmetic. Binary Image Processing : Mathematical morphology, Structuring elements, Morphological image processing, Logical operations, Morphological operations, Dilation and Erosion, Distance Transform. Colour Image Processing : Colour images, Colour Model, Colour image quantization, Histogram of a colour image. (Refer Chapters 4, 5, 6, 10 and 11) ‘Image Segmentation : Image segmentation techniques, Region approach, Clustering techniques, Thresholding, Edge-based segmentation, Bdge detection, Edge Linking, Hough Transform. Image Compression : Need for image compression, Redundancy in images, ‘Image-compression scheme, Fundamentals of Information Theory, Run-length coding, Shannon-Fano coding, Huffman Coding, Arithmetic Coding, Transform-baied compression, Image-compression standard. (Refer Chapters 7 and 9 Digital i Processing (MU_ jomp.) ‘Chapter4 tnioduction tolmage Processing 11019 1 ioducton ee 12 Wna!Do We Maa by mage rae ? 14 Tee Bctemagnat Spec. 15 Unteotnenay. 18 Ta Hunan Va Sym 1181 mage Fomaton in Ee 162 Vauel Phenom, ‘© Chapter Ends. oe) ere Chapter 2:_ Image Seneing and Acquisition 2-1 to 2-11 ar 12 13 14 4 18 16 2a 24 22 BB 23 : 20 7 een: 3: ling and Quantization 3-1 to 3-7 31 ntroduetion... sen 34 se no 5A 52 83 54 Introduction near St2t0hIAg. renee Histogram Equalization on. 1 53 7 a7 ‘Addional Examples on Histogram Modal .o..5-14 ‘+ Chapter Ende. 524 oe ™:=—" Chapter 6 : tmage Enhancement in Fr xy Domain, 6-1 t0 6-33 61 62 83 ea eat 42 643 644 65 681 652 653 66 661 662 663 064 67 68 Ch 7A 72 761 Iatroduct09 a] The Fourier TrAnsf01M nee 64 1-Dimensional Fourlr Transform. 62 2-Dimensional Fourior Transform.. 64 Diserete Fourier Transform (DFT) ne sn 2D: Discrete Fourier Transton (DPT) orn 8 Proportes of Discrete Fourier Tranformn. 8 {Image Enhancement in Frequency DOMAIN ren O15 ‘Low Pass Frequency Domain Fite... ey ‘eal Low Pass Fiter (LPF) Butterworth Low Pass Fitters (BLPF).. sn. 6-20 Gaussian Low Pass Fitar(GLPF)... 22 High Pass Frequency Domain Fiters. 828 ‘eal High Pass Fitors (MPF). Butterworth High Pass Fiters (BHPF). Gaussian High Pass Fiters (GHPF), ‘High Boost Fitering (Uneharp Masking / High Frequency Empnass) eran ‘HomamnorphicFiterng.. Importance of Phase, Iotroduetion .. seine [Image Segmentation based on Discontinuties Point Detection, Roberts Mask. 7 Prowits and Sobel Oparators. Compass Operators... Image Segmentation using the ‘Second Derivative-The Laplacian, Edge Linking. Local Processing... 744 sn PAB son TAT Digital Processing (MU. 7.82 Hough Transform... posnsene TAT 7.7 Global Processing va Graph - Theoretic Techniques. : ne) 7.8 Connectivity sn : 731 7.9 Distance Transform... 733 7310 Peden es eprerao Sogmn Based on Simiartes). 7A08 7102 728 7108 740 7404 740 71 krage Segmaenion une on Trott nn 72 ANA Global Threshoiding. renin TS TA12 Local Thresho}dig nnn on 78 7.42 Addiional Solved Examples... 748; + Chaptor Ends, 750 Chapters :_tmage Transforms ei too Bt InrodUetON oe sn A 22 Linear Transformations seine A 82.1 OneDimonsonal Discrete Unear Transformations. 222 Unitary and Orthogonal Matces.. 823 TwoDimensional Discrete Linear Transformations 23° Divert Coshe Transom (OC. 84 The Sine Transform... 85 Nonsinusoidal Transforms 85.1 Tha Kronecker Product 852 WalstrHadamard Transform. 85.3 Tho Walsh Transform en 854 The Hear Transform... 855 Tho Slant Transform, 86 The Karhunen Loove Transform (Hoteting Transtom) on. ‘+ Chapter Ends. —_—_Sa& eee 81 IntroduetOn nn senna BA 92 Redundant and relevant Data 4 23 Error Criteria, 02, 93.1 Objective Exor Criteria 82 832 Subjective Error Ciera... o4 94 Lossless Compression Techniques. oO 941 Dictionary Based Coding. ay 1944.1) Pun Length Encoding (LE)... 04 942 Statistical Coding... 98 94.3 Hulman Encoding... : 08 Table of Contents 25 Atiinmatic Coding. 86 Shannon-Feno Coding. 9.7 Lossy Compression 97.1 mproves Gry Sele (165) Cuaiizaton 9.7.2 Transform Coding (JPEG Coding) 97.8 Joint Photographic Experts Group (JPEQ).. 93 JPEG 2000. 7 89 Imago Compression Modo! 21 Compareon of Loads an Lossy Compression, + Chapter Ends. 935 ——EEEEEE Chapter 10: image Morphology 10-1 to 10-12 401 nroduction 102 —_Aaltymetic and Logical Operation. 104 402.1 Asithmetic Operations 1022 Logical Operations 103 Basie Detnitons 10.3.1 Ditton 1032. Erosion.. o 104 ASinpe Practe! Fora for mpemerdng Dilation and Erosion. 105 Smuaturing Elements, 10.6 Opening and Closing Operations. 10.61 Opening 1062 Closing... 107 Solved Example © Chapter Ends... on —E—————————iese ‘Chapter 11: Colour image Processing _11-1 to 11-22 11 fntroduetion a 112 Colour Models. 2 11.2.1 RGB Colour Mode. 112 11.22 _ NTSC Colour Model. 115 1123 YObCr Colour Mode. 107, 11.24 CMYand CMYK Models. 18 11.25. HSi Colour Model... 11410 11.3 Peeudo-Colourng 1143 114 Fub-Colour image Processing. 11414 41.44 Colour image Smoothing {Low Pass Averaging)... 11-10 41.42 Colour Image Sharpening (High Pess Firing)... 1-17 11.5 Colour Segmentation sn a At19 11.54 Segmentation using HS! Model... 1119 41.52 Segmentation using RGB Mode! 1121 = Chapter Ends. 1422 Appendix A: 2D Signals and SYStEME nn Ac 10 Ae1S Opel eas! Introduction to Image Processing 4.1 Introduction Human beings are primarily visual creatures who depend on their eyes to gather information around them. Of the five senses that human beings have, sight is what we depend upon the most, Not many animals depend on their visual systems; the way human beings do. ‘Bats use high frequeney sound waves. They emit sound waves which reflect back when they encounter some obstruction. Cats have poor vision but an excellent sense of smell, Snakes locate prey by heat emission and fish have ‘organs that sense electrical fields. 1.2. What Do We Mean by Image Processing ? ‘What happens when we look at an object ? ‘The eye records the scene and sends signals to the brain, These signals get processed in the brain and some. ‘meaningful information is obtained. Let us take a simple example : when we see fire, we immediately identify it as something hot. Two things have happened here. (1) The scene has been recorded by the eye. (2). The brain processed this scene and gave out a warning signal. image processing !!! = We start processing images from the day we are bora Hence image processing is an integral part of us and ‘We continue to process images till the day we die. So ven if this subject seems to he new, we have been subconsciously doing this, all these years. The human eye-brain mechanism represents the ultimate imaging system, Apart from our vision, we have another important trait that is common to all human beings. We like to store ‘information, analyse it, discuss it with others and try to Dotter it. This trait of ours is responsible for the rapid development of the human race. Barly human beings strove to record their world by carving crude diagrams on stone, AUL the drawings that we soe in old caves is just that; storing images seen, trying to analyse them and discussing it with others in the tbe, Refer Fig. 1.2.1. This art developed through the ages by way of ‘materials and skill, By the mid-nineteenth contury, photography was well established, Image processing that we study starts from this era. ‘Though it was stated earlier that the human eye-brain. mechanism represents the ultimate imaging system, image processing as a subject involves processing images obtained by a camera. With the advent of ‘computers, image processing as a subject grew rapidly. tal Image Processin Comp) Introduotion to Image Processi — Images from a camera are fed into a computer where algorithms are vritten to process these images, Here, the camera replaces the human eye and the computer does the processing. — Hence image processing as an engineering subject is basically manipulation of images by a computer. Let us now define what we mean by an image. The world around us is 3-dimensional, while images obtained through a camera are 2-dimensional, Hence an image can be defined as a 2dimensional representation of a 3-dimensional world. Consider the image shown in Fig. 13.1. ees : =e Fig. 13.1 In moving from the 3-dimensional world to the 2-dimensional image, we loose one dimension. Depth information is lost. As can be seen from the Fig, 1.3.1, the handle of the tea cup is missing. All family pictures, photographs on identity cards etc, are 2-dimensional. If this statement is not cles, let us take a simple example, Example of « 1-dimensional and a 2-dimensional signal Consider a voltage signal shown in Fig. 1.3.2. We are all familiar with a signal of this kind, Here the voltage is varying with respect to time. ‘This is a typical 1-dimensional signal, If we want to locate a dot on the wave, all we need to ‘Ven vons Fig. 13.2 Let us see why images are 2-dimensional functions. ‘Consider the image shown in Fig. 1.3.3. i 1 pe ta ID Mig. 13.4 In this case, 10 locate the dot shown, we need to know its position in two directions (x and y) Fig. 1.3.4. Hence all mages that we see are 2-dimensional functions. A typical image is represented as shown in Fig. 1.3.5. Here (x,,¥,) are the spatial coordinates and f is the grey level (colour in the case of colour image) at that point. Hence grey level f varies with respect to the x and y coordinates, FR dts 10 Processing (MU-B.Sc.- Comp.) _1-3 1.4 The Electromagnetic Spectrum Introduction to Image Processin ‘The apparatus shown in Fig. 1.2.2 will work only if light is incident on the object. What we call light is actually a very small section of the electromagnetic energy spectrum.The entire spectrum is shown in Fig. 1.4.1. The optical spectrum 10 200 300 360 455 492 877 597 itra-viotet Visible tight ee ‘Near|Violet Blue Green Yellow OrangeRed| Near MediumFar Extreme ul Gamma rays Cosmic rays Xrays 1010*10"'10710"10 “10 “1010 “10° 1. 19 40° 40° 10° 10° 10° 40” 10° 10°10"°40" 622 770 ©1500 8000 4x10" 405 Infra-red um waves Radio waves Audio frequencies Wits, oie 1010'%10" amy Fig. 14 Blectromagnetic energy, as the name suggests, exists in the simultaneous form of electricity and magnetism. These two forms of the same energy are transmitted together as electromagnetic radiation. One cannot exist without the other. A flow of electric current always produces ‘magnetism, and magnetism is used to produce electricity Electromagnetic radiation is propagated outwards from its source at a velocity of 300,00,0000 meters per second (3x 10° misec). Although our natural source of electromagnetic radiation is the sun, there are also a number of man-made sources which, among many others, include tungsten filament lamps, gas discharge lamps and lasers. Light is a band of electromagnetic radiation mediated by the human eye and is limited to a spectrum extending from 380 nm to 760 nim, ‘Most ofthe images that we encounter in our day to day life are taken from cumerss which are sensitive to this range of the electromagnetic spectrum (380 - 760 nm). We must not forget though, that there are cameras which are capable of detecting infrared, ultraviolet light, X-rays and radio waves too. The electromagnetic spectrum can be expressed in terms of wavelength and frequency. The wavelength (2) and the frequency (v) are related by the expression ant 4.1) Here cis the speed of fight = 3x 10" m/sec Ext Calculate the frequency of oscillation of green light. Soin. It has been kriown that green light has a wavelength of approximately 500 nm (500 10m) Its frequency of oscillations can be calculated using Equation (1.4.1). he v Bo e Processing (MU - B.Sc.- Comp. 14 v = 6x10" He ie, the frequency of {600,000,000,000,000 cycles/see ! green light is Henee it is more convenient to discuss clectromagnetic radiation in terms of wavelengths (am) rather than frequencies (Hz) Units of Intensity We know that for an object to be seen, some amount of light has to fall omit. ‘The unit of luminous intensity (1) is candela (ed) (SI unit) which by definition, is (1/60)" of a square centimetre of the surface of a black body radiator at the absolute temperature of 2045 K. ‘Tho unit is called candela because initially it was efined as a standard candle burning a specific amount of wax per hour. There is another important unit apart from ‘candela that we encounter. This unit is called lux. Introduction to Image Processit 1.6 The Human Visual System 1K is important for designers and users of image processing to understand the characteristics of the human vision system. For efficient design of algorithms whose output is a photograph or a display viewed by a human observer, itis beneficial to have an understanding of the ‘mechanism of human vision, Many interesting studies have been carried out and the subject of visual perception has grown over the years. We begin with the structure of the human eye, ‘Tho Fig. 1.6.1 shows the horizontal as well as the vertical cross section of a human eye ball. The front of the eye is covered by a transparent surface called comes. The remaining outer cover, sclera, is composed of a fibrous coat jing blood that surrounds the choroid, a layer conti capillaries. Sclera is the white portion of the eye, Inside the choroid, is the retina which is composed of two types of photoreceptors. These photoreceptors are specialised to convert light rays into receptor potentials. ‘These photoreceptors are called rods and cones (named due to their shape). Rods are long and slender while cones are shorter and thicket. Nerves connecting the retina leave the ‘eyeball through the optic nerve bundle. Light entering the ‘comeais focused on the retina surface by a Jens that changes shape under muscular contol to perform proper focusing of near and distant objects. The iris acis as a diaphragm to control the amount of light entering the eye. Viual axis Optic nerve FE biota image Processing (MU-B.S0-Comp) 15 Inoducton to Image Processing Each retina has about 6 million cones and 120 milion rods. Rods are most important for black and white vision in dim light, They also allow us to discriminate between 3 m) the lens exhibits its lowest refractive power (Focal length = 17 mm). ‘When the eye focuses on nearby objects, the lens of the eye is strongly refractive (Focal length = 14 mm) Let us take an example : &. BA ‘Consider an observer looking ata lamp-post which is at a distance of 50m. Ir the beight of the lamp post is 10 m, find the size of the {age formed in the retina Retinal image). Soin, : Since the image is far away, the focal length is approximately 17 mm. We use the similarity of triangles. Let the retinal image be r CB orcas Image Processing (MU -B.Se- Comp.) 1-8 Intrsduction to Image Processing wot 30 777 1 = 34mm _s-The height ofthe retinal image is 3.4 mm_ If the same image is observed at a distance of 100 m, we get 40 2 100 = 17 r= 1.7mm 1.6.2" Visual Phenomena ‘The human eye is a complex system and the images that we perceive are also equally complex. We shall now ‘explain the visual phenomena. What the human eye senses, are in general intensity images- Intensity, Brightness and Contrast are three different phenomena. Intensity ofa light source depends on the total amount of light emitted by it, Hence intensity is a physical property and can be measured, Brightness on the ‘other hand is a psycho-visual concept and fence is actually a sensation to light intensity. Contrast may be defined as the difference in perceived brightness. (Q) Contrast Sensitivity : The response of the human eye ‘to changes in the intensity of illumination is known to ‘be non-linear. ‘Consider the simple experiment: plate ¥ Fig. 1.6.3 We take a diffuser (opaque) glass plate and illuminate it from the bottom with constant illumination I The observer is asked to look at this glass plate, from the top. At the centre of this glass plate, the intensity of illumination is increased from I to I + AI. The observer is now asked to observe whether he or she can detect this increase. If the observer cannot detect the change, the intensity is farther increased by another increment of AL. This procedure is continued till the observer detects the difference, This is known as the Just Noticeable Difference GND). Bemis pera can AL Weber ratio = F* Here [is a constant and [is the incremented value. 7 Fig. 64 A low Weber ratio implies that even a small variation (AD) was detected by the observer. A high Weber ratio implies that large variations (Al + AL +...) were required for the observer to notice the change. Hience a low Weber ratio means that the observer has good discernible vision. At proper illuminations, the Weber ratio of a group of people is more or less constant at 0.02, Weber ratio also depends on the illamination I ‘As can be seen from the graph, the weber ratio is large at very low as well as very high levels of illurnination. This should not come as 2 surprise. Our discrimination quality reduces when we are in a room that is not well Hi. At the same time our discrimination quality also reduces when there is too much fight. ' : | i Ae, O02 Intensity Fig. 1.6.5 @) Brightness Adaptation : The range of light intensity levels to which the human visual system can adupt is enormous, of the order of 10" from the scotopic threshold to the glare limit t simply means we can see things in the dark and also when there is a lot of illumination. It has been shown that the intensity of light perceived by the human visual system (subjective brightness) is a logarithmic function of the light intensity incident on the human eye. ‘The curve in the Fig. 1.6.6 represents the range of intensities that the human visual system can adapt. ‘When illumination is tow, itis the scotopic vision that plays a dominant role while for high intensities of illumination, it is the photopic vision which is dominant. As can be seen from the figure, the transition from scotopic vision to photopic vision is gradual and at certain levels of illaminations, both of them play a role. To cut a Jong story short, the dynamic range of the ‘human eye is enormous. But there is catch here. The eye cannot operate over the enlire range simultaneously i.e, at a given point of time, the eye can only observe-a small range of illumination. This phenomena is known as Brightness Adaptation. The fact that our eyes can operate only on a small range, ‘can be proved by a simple experiment on ourselves. Bhotopia Seotopic + 4 2 Paunsaer jeeater | o Fig. 1.6.6 Stare at the sun for a couple of seconds, the eye adapts itself to the upper range of the intensity values. Now look away from the sun and you will find that you cannot see anything for sometime, This is because the eye takes a finite time to adap itself to this new range. AA similar phenomenon is observed when the power supply of our homes is cut-off in the night. Everything seems to be pitch dark and nothing ean be seen for sometime. But gradually our eyes adjust to this low level of illumination and then things start geting Visible even in the dack. (3) Acuity and Contour (Mach Bands) : Mach bands aro named after the Austrian physicst Emst Mach (1838-1916). Consider a set of grey scale strips shown in Fig. 1.67, Fig. 167, Each of the eight strips have uniform intensities within the strip. This can be seen if we place our hand on all the other strips and observe only one strip at a time. ‘But when we look at all the eight strips together, visual appearance is that each strip looks darker at its right side than its left. This is called the Mach band effect. ‘The actual and the perceived intensity charts are shown in Fig. 1.6.8 (a) and (b), Digital | | _- (@) Actual intensity Processing (MU (b) Perceived intensity Fig. 16.8 ‘The incensities tend to overshoot at the right hand edges, The overshoot is @ consequence of the spatial frequency response of the eye. The human eye possesses @ lower sensitivity 10 high and low spatial frequencies than to mid range frequencies (spatial frequencies will ‘be covered in chapter of Image Enhancement in Spatial Domain). The implication of is that perfect edge contours in an image can be sacrificed to a certain extent as the human eye bas an perfect response to high spatial frequency brightness transitions. (4) Simultaneous Contrast : Consider the image shown in Fig. 1.69. Fig. 1.6.9 Each of the small circles have the same intensity, but because the surrounding grey level of each of the circles is different, the circles do not appear equally bright, Hence the intensity that we perceive are not actually the absolute values, Introduction to Image Proct (5) Integration : Another important property of our eye is that it integrates the scene as a whole, This is @ property that facilitates programming. When we look ata picture, we do not fook at each point, but the image asa whole, Let us take an example, read the following lines as fast as you can. “Accodring to a recheearch at an Elingsh Unvertisy, it deosn't mttaer in what oreder the Iters in a word are, the only iprmoetat thing is that the frist and the Isat ltteer is at the rghit place, The rset can be @ total mses and you can still raed it wouthit @ porbelm. This is Deusease we do not raed ervey Iteter by itself but the word as a wiohe.” ‘You could read it, inspite ofthe spelling mistakes only because of the integration property of the eye. Before we end, one issue needs to be sorted out. A very common question that people ask is what is the image processing, computer graphics and compoter vision ? difference between Image processing deals with manipulation of images. ‘A input image is modified into a new image, Computer graphics deals with creation of images. In computer graphics, models (2D or 3D) are created using ‘mathematical functions (Descriptors). Computer vision which is also known as Machine vision deals with the analysis of image content. Computer vision is used 10 automate a process, Table 1.6.4 CG 7 Description (Mathematical function) From the Table 1.6.1, BE gat mage Proceasing (MU Image processing —> Input (Image) — Output (Image) Computer graphics ~» Input (Description) ~ Output (image) (Computer vision > Input (Image) ~ Output (Description) ‘The material provided in this chapter is primarily bs information which would be required in subsequent ‘discussions. Our study of the human visual system, though not exhaustive, provides a basic idea of the capabilities of the eye in perceiving pictorial information. Jn this chapter, preliminary concepts of digital image processing are presented. Difference between. one-dimensional and two-dimensional signals is explained. Topics such as electromagnetic spectrum and inverse square law are discussed with examples. Elements of the human ‘visual system are presented. Basic anatomy of the human eye is explained with a few illustrations. Perceptual characteristics such as brightness adaptation and logarithmic, response to incideat intensity in the form of Weber's ratio are also introduced. The concepts explained here will be found useful in understanding image processing algorithms in subsequent chapters, This chapter forms the fundamental base required to understand image processing. So Comp. 19 as a4 as ae a7 as as ato aie Introduction to Image Pr ‘What do we mean by image processing ? Why do we say that an image is a 2D-tunction ? ‘Calculate the frequency of oscillation of red light. Explain the structure of the human eye. Explain the term scotopic vision, photopic vision and ‘mesopic vision. Brightness discrimination is poor at low levels of itumination. Explain. Images are processed either for human perception or for machine perception. Explain, ‘What does the Weber ratio imply ? What do Mach bands imply ? lf an observer is looking at an object 12 m high and @ distance of 2m, Find out the size of the retinal image. Distinguish between image processing and graphics. Explain the term brightness adaptation. Chapter Ends... gug

You might also like