MODULE 1 DIP: MODULE I 1 DIGITAL IMAGE FUNDANENTALS Introduction industry, intelligent transportation, etc. To apply image processing techniques, the first step is to digitize the picture into an image file. Further, the The field of digital image processing refers to methods have to be applied to rearrange picture parts, processing digital images by means of digital enhance color separation, and improve quality. computer. Digital image is composed of a finite number of elements, each of which has a particular location and value. These elements are called picture elements, image elements, pels and pixels. Pixel is the term used most widely to denote the elements of digital image. The value of pixel has ranged from 0 to 255. Example: The figure below is showing an image and corresponding pixels of a point Example: Medical applications use image processing techniques for picture enhancement, in tomography, and in simulation operations. Tomography is a method used for X-ray photography. What is an Image? An image is represented as a function f(x,y) which is 2-dimensional, where x and y are the spatial or plane coordinates. The range of ‘f’ at any point of (x,y) is called the intensity or gray level of the image at that point. If x, y and the values of ‘f ’ are finite, the image is said to be a digital image. Types of Image The image containing only two-pixel elements that are 1 and 0, where 1 represents white, and 0 represents black color, are called binary images or monochrome. How it works? The image which consists of the only black and white color is called a black and white image. There is an ‘8-bit color format image’ with 256 different shades of colors, usually known In the above figure, an image has been captured by a camera and has been sent to a digital system to remove all the other details, and just focus on the water drop as Grayscale Image. In this, 0 represents Black, 127 stands for gray, and 255 depicts white. by zooming it in such a way that the quality of the image remains the same. Image processing is defined as a technique to enhance raw images captured using various vision sensors for various applications such as medical imaging, the film DIP: MODULE I 2 Another is the ‘16-bit color format’, which Array representation of an image has 65,536 different colors in it. In this format, the distribution of color is different from the Grayscale image. A 16-bit format is further segregated into three formats: Red, Green, and Blue abbreviated as RGB format. After displaying the image using the following command: show(i) Representation of Image The image is represented as an array or matrix of square pixels arranged in rows and columns. Matlab is a very good platform to retrieve, read, and process We can also see the pixel values of a particular point, as shown in the figure below. It shows the position of the pointed pixel as (X, Y) and values of RGB that is color details of red, green and blue. images. It has an image processing toolbox also. It is known that the image is exhibited as columns and rows as represented below Example: To read an image, we have to use the following command in MatLab i=imread('F:\image.jpg'); APPLICATIONS OF DIGITAL IMAGE PROCESSING: After executing this command, the image will be saved to a variable I as a 3-dimensional array or matrix as Since digital image processing has very wide shown in the figure below. The array has a size of applications and almost all of the technical fields are 225X224X3. It has different pixel values ranging from impacted by DIP, we will just discuss some of the 0 to 255. major applications of DIP. Digital image processing has a broad spectrum of applications, such as DIP: MODULE I 3 1. Remote sensing via satellites and other spacecraft’s 2. Image transmission and storage for business 6. Closed-circuit television-based security monitoring systems and applications 7. In military communications 3. Medical processing Medical applications: 4. RADAR (Radio Detection and Ranging) 1. Processing of chest X-rays 5. SONAR (Sound Navigation and Ranging) 2. Cineangiograms 6. Acoustic Image Processing (The study of 3. Projection images of trans axial tomography underwater sound is known as Underwater Acoustics or Hydro Acoustics) 4. Medical images that occur in radiology nuclear magnetic resonance (NMR) 7. Robotics and automated inspection of industrial 5. Ultrasonic scanning parts IMAGE PROCESSING TOOLBOX (IPT): Images acquired by satellites are useful in tracking It is a collection of functions that extend the capability of of the MATLAB numeric computing environment. 1. Earth resources These functions, and the expressiveness of the 2. Geographical mapping MATLAB language, make many image-processing operations easy to write in a compact, clear manner, 3. Prediction of agricultural crops thus 4. Urban growth and weather monitoring 5. Flood and fire control and many providing an ideal software prototyping environment for the solution of image processing other environmental applications Space image applications include: problem Analog image processing :Analog image processing is done on analog signals. It includes processing on two dimensional analog signals. In this type of processing, 1. Recognition and analysis of objects contained in the images are manipulated by electrical means by images obtained from deep space-probe missions. varying the electrical signal. The common example 2. Image transmission and storage applications occur in broadcast television include is the television image.Digital image processing has dominated over analog image processing with the passage of time due its wider range 3. Teleconferencing of applications. 4. Transmission of facsimile images (Printed Digital image processing : The digital image documents and graphics) for office automation processing deals with developing a digital system that 5. Communication over computer networks performs operations on an digital image. DIP: MODULE I 4 COMPONENTS OF DIGITAL IMAGE PROCESSING SYSTEM Software : Software consists of specialized modules to perform the digital image processing tasks. They are There are many parts involved in processing an image. usually coded in a binary format into the processor. Figure illustrates the components involved in the Mass storage : The images that are processed can be digital image processing system. The following list of varying sizes. For example, an image can be 1024 explains each art present in Figure . by 1024 pixels, and the intensity of each pixel can be 8 bits. Hence, processing many images of such a size demands a lot of memory. Image displays : Image displays commonly used are color monitors whose display is derived from graphic or image cards. The devices for recording image include laser printers, film cameras, heat sensitive devices inkjet units and digital units such as optical and CD ROM disk. Films provide the highest possible resolution, but paper is the obvious medium of choice for written applications. Hardcopy : Hardcopy formats that are used to display the output of digital image processing system . The devices for recording image include laser printers, film cameras, heat sensitive devices inkjet units and digital units such as optical and CD ROM disk. Films provide Sensor : The initial part of a digital image processing the highest possible resolution, but paper is the system is the sensor that is responsible for obtaining obvious medium of choice for written applications. the image from the environment and digitizing it into Networking : Networking is an important part of a format compatible for processing by a digital today’s digital image processing system, and the key computer. considerations are the bandwidth of transmission as Specialized digital image processing hardware : Here the images require a lot of memory. analog images are converted to a digital format. Furthermore, primitive operations such as Arithmetic Logical Unit are performed on the input. These systems are characterized by fast speeds Computer : A computer is the main processing part of the digital image processing system that performs the computational tasks. DIP: MODULE I 5 FUNDAMENTAL STEPS IN DIGITAL IMAGE PROCESSING SYSTEM Figure: image restoration process 4. Color image processing This step involves processing of color images by taking into consideration the various color models available. The internet forms a major source of color digital images. 1. 5. Image Acquisition Wavelet and mutiresolution process The image acquisition stage involves The general aim of any the foundation for resolution. image acquisition is to transform an optical are representing image in various degrees of preprocessing, such as scaling. These In this stage, an image is represented in image (real-world data) into an array of various degrees of resolution. Image is numerical data which could be later divided into smaller regions for data manipulated on a computer. compression Image acquisition is achieved by suitable cameras. We use different cameras for different applications. 2. Image enhancement Image enhancement is the process of manipulating an image so the result is a- Fourier transform more suitable than the original for a b- Wavelet transform 6. specific application. 3. It refers to the process of highlighting Compression is a technique which is certain information of an image, as well used for reducing the requirement of as any storing an image. It is a very important unnecessary information according to stage because it is very necessary to specific needs. compress data for internet use. weakening or removing Image restoration Compression Image compression is familiar (perhaps Image restoration is to restore a degraded inadvertently) to most users of image back to the original image computers in the form of image file is extensions, such as the jpg file extension subjective, image restoration is objective used in the JPEG (Joint Photographic Unlike DIP: MODULE I enhancement, which 6 7. Experts Group) image compression gain a level of understanding of what an standard. image contains. Morphological processing Morphology is a broad set of image processing operations that process In this stage, the label is assigned to the object, which is based on descriptors. 11. Knowledge Base images based on shapes. Morphological operations apply a Knowledge is the last stage in DIP. In this structuring element to an input image, stage, important information of the image is creating an output image of the same located, which limits the searching processes. size. The knowledge base is very complex when In a morphological operation, the value the image database has a high-resolution of each pixel in the output image is based satellite. on a comparison of the corresponding pixel in the input image with its neighbors. 8. SOME BASIC RELATION SHIP BETWEEN PIXELS Segmentation Image segmentation is a method in A pixel p at coordinates (x,y) has four which a digital image is broken down horizontal and vertical neighbors whose into various subgroups called Image coordinates are given by: segments which helps in reducing the (x+1,y), (x-1, y), (x, y+1), (x,y-1) complexity of the image to make further processing or analysis of the image (x, y-1) simpler. 9. (x-1, y) Representation and description It always follows the output P (x,y) (x+1, y) of (x, y+1) segmentation step that is, raw pixel data, constituting either the boundary of an image or points in the region itself. In either case converting the data to a This set of pixels, called the 4-neighbors or p, is form suitable for computer processing is denoted by N4(p). Each pixel is one unit distance from necessary. (x,y) and some of the neighbors of p lie outside the 10. Object recognition When humans look at a photograph or watch a video, we can readily spot people, objects, scenes, and visual details. The goal is to teach a computer to do what comes naturally to humans: to DIP: MODULE I digital image if (x,y) is on the border of the image. The four diagonal neighbors of p have coordinates: (x+1, y+1), (x+1, y-1), (x-1, y+1), (x-1, y-1) and are denoted by ND (p). 7 (x-1, y+1) (x+1, y-1) 1. 4-adjacency: Two pixels p and q with values from V are 4-adjacent if q is in the set N4(p). P (x,y) 2. 8-adjacency: Two pixels p and q with values from V are 8-adjacent if q is in the set N8(p). (x-1, y-1) (x+1, y+1) 3. m-adjacency =(mixed) m-adjacency: These points, together with the 4-neighbors, are called the 8-neighbors of p, denoted by N8 (p). (x-1, y+1) (x, y-1) Two pixels p and q with values from V are madjacent if : (x+1, y-1) q is in N4(p) or q is in ND(p) and the set N4(p) ∩ N4(q) has no pixel whose values are (x-1, y) P (x,y) (x+1, y) (x-1, y-1) (x, y+1) (x+1, y+1) from V (no intersection) Mixed adjacency is a modification of 8-adjacency. It is introduced to eliminate the ambiguities that often arise when 8-adjacency is used. As before, some of the points in ND (p) and N8 (p) fall outside the image if (x,y) is on the border of the image. For example: Adjacency and Connectivity • Let V: a set of intensity values used to define adjacency and connectivity. • In a binary image, V = {1}, if we are referring to adjacency of pixels with value 1. • • In this example, we can note that to connect In a gray-scale image, the idea is the same, between two pixels (finding a path between but V typically contains more elements, for two pixels): example, V = {180, 181, 182, …, 200} – In 8-adjacency way, you can find multiple paths between two pixels If the possible intensity values 0 – 255, V set can be any subset of these 256 values. – While, in m-adjacency, you can find only one path between two pixels • So, m-adjacency has eliminated the multiple path connection that has been generated by Type of Adjacency DIP: MODULE I the 8-adjacency. 8 • Two subsets S1 and S2 are adjacent, if some component, then set S is called a connected pixel in S1 is adjacent to some pixel in S2. set. Adjacent means, either 4-, 8- or m-adjacency. Digital Path • Region and boudary • Region A digital path (or curve) from pixel p with Let R be a subset of pixels in an coordinate (x,y) to pixel q with coordinate image, we call R a region of the image if R is (s,t) is a sequence of distinct pixels with a connected set. coordinates (x0,y0), (x1,y1), …, (xn, yn) where (x0,y0) = (x,y) and (xn, yn) = (s,t) and pixels (xi, • Boundary yi) and (xi-1, yi-1) are adjacent for 1 ≤ i ≤ n • n is the length of the path • If (x0,y0) = (xn, yn), the path is closed. contour) of a region R is the set of pixels in the region that have one or more neighbors We can specify 4-, 8- or m-paths depending on the type of adjacency specified • The boundary (also called border or Return to the previous example: that are not in R. If R happens to be an entire image, then its boundary is defined as the set of pixels in the first and last rows and columns in the image. This extra definition is required because an image has no neighbors beyond its borders Normally, when we refer to a region, we are referring to subset of an image, and any pixels in the boundary of the region that happen to coincide with the border • In figure (b) the paths between the top right of the image are included implicitly as part of the and bottom right pixels are 8-paths. And the region boundary. path between the same 2 pixels in figure (c) is m-path Connectivity Distance measures • For pixels p, q and z, with coordinates (x,y), (s,t) and (v,w), respectively, D is a distance • Let S represent a subset of pixels in an function if: image, two pixels p and q are said to be (a) D (p,q) ≥ 0 (D (p,q) = 0 iff p = q), connected in S if there exists a path between • them consisting entirely of pixels in S. (b) D (p,q) = D (q, p), and For any pixel p in S, the set of pixels that are (c) D (p,z) ≤ D (p,q) + D (q,z). connected to it in S is called a connected component of S. If it only has one connected • The Euclidean Distance between p and q is defined as: DIP: MODULE I 9 De (p,q) = [(x – s)2 + (y - t)2]1/2 Pixels having a distance less than or equal to some value r from (x,y) are the points Pixels having a D8 distance from (x,y), less than or equal to some value r form a square Centered at (x,y) contained in a disk of radius r centered at (x,y) Example: • The D4 distance (also called city-block D8 distance ≤ 2 from (x,y) form the following contours distance) between p and q is defined as: of constant distance. D4 (p,q) = | x – s | + | y – t | Pixels having a D4 distance from (x,y), less than or equal to some value r form a Diamond centered at (x,y) Dm distance: is defined as the shortest m-path between the points. In this case, the distance between two pixels will depend on the values of the pixels along the path, as well as the values of their neighbors Example: The pixels with distance D4 ≤ 2 from (x,y) form the following contours of constant distance. The pixels with D4 = 1 are the 4-neighbors of (x,y) • Example: Consider the following arrangement of pixels and assume that p, p2, and p4 have value 1 and that p1 and p3 can have can have a value of 0 or 1 Suppose that we consider the adjacency of pixels values 1 (i.e. V = {1}) • The D8 distance (also called chessboard distance) between p and q is defined as: D8 (p,q) = max(| x – s |,| y – t |) DIP: MODULE I 10 • Cont. Example: Now, to compute the Dm between points p and p4 Here we have 4 cases: Case1: If p1 =0 and p3 = 0, The length of the shortest m-path (the Dm distance) is 2 (p, p2, p4) Case2: If p1 =1 and p3 = 0 The Human Eye now, p1 and p will no longer be adjacent (see m- • Diameter: 20 mm adjacency definition) then, the length of the shortest • 3 membranes enclose the eye path will be 3 (p, p1, p2, p4) – Cornea & sclera – Choroid – Retina Case3: If p1 =0 and p3 = 1 The Choroid The same applies here, and the shortest –mpath will be 3 (p, p2, p3, p4) • The choroid contains blood vessels for eye nutrition and is heavily pigmented to reduce extraneous light entrance and backscatter. • It is divided into the ciliary body and the iris diaphragm, which controls the amount of light that enters the pupil (2 mm ~ 8 mm). Case4: If p1 =1 and p3 = 1 The length of the shortest m-path will be 4 (p, p1 , p2, The Lens • The lens is made up of fibrous cells and is suspended p3, p4) by fibers that attach it to the ciliary body. • It is slightly yellow and absorbs approx. 8% of the visible light spectrum. ELEMENTS OF VISUAL PERCEPTION SIMPLE IMAGE FORMATION MODEL The Retina • The retina lines the entire posterior portion. Human Visual Perception DIP: MODULE I 11 • Discrete light receptors are distributed over the surface of the retina: – cones (6-7 million per eye) and – rods (75-150 million per eye) The Fovea • The fovea is circular (1.5 mm in diameter) but can be assumed to be a square sensor array (1.5 mm x 1.5 Cones mm). • Cones are located in the fovea and are sensitive to • The density of cones: 150,000 elements/mm2 ~ color. 337,000 for the fovea. • Each one is connected to its own nerve end. • A CCD imaging chip of medium resolution needs 5 • Cone vision is called photopic (or bright-light vision). Rods mm x 5 mm for this number of elements Image Formation in the Eye • The eye lens (if compared to an optical lens) is flexible. • Rods are giving a general, overall picture of the field of view and are not involved in color vision. • It gets controlled by the fibers of the ciliary body and to focus on distant objects it gets flatter (and vice • Several rods are connected to a single nerve and are versa). sensitive to low levels of illumination (scotopic or dim-light vision). Receptor Distribution Image Formation in the Eye • Distance between the center of the lens and the retina (focal length): – varies from 17 mm to 14 mm • The distribution of receptors is radially symmetric (refractive power of lens goes from minimum to about the fovea. maximum). • Cones are most dense in the center of the fovea while • Objects farther than 3 m use minimum refractive lens rods increase in density from the center out to powers (and vice versa). Image Formation in the Eye approximately 20% off axis and then decrease. • Example: – Calculation of retinal image of an object Cones & Rods • Perception takes place by the relative excitation of light receptors. • These receptors transform radiant energy into electrical impulses that are ultimately decoded by the brain. Brightness Adaptation & Discrimination DIP: MODULE I 12 • Range of light intensity levels to which HVS (human number of different intensities a person can see at visual system) can adapt: on the order of 1010 . any one point in a monochrome image • Subjective brightness (i.e. intensity as perceived by • Overall intensity discrimination is broad due to the HVS) is a logarithmic function of the light different set of incremental changes to be detected intensity incident on the eye. at each new adaptation level. Illustration • Perceived brightness is not a simple function of intensity – Scalloped effect, Mach band pattern – Simultaneous contrast VIDICON CAMERA PRINCIPLE Vidicon Camera Tube The HVS cannot operate over such a range simultaneously. For any given set of conditions, the current sensitivity Definition: A Vidicon is a type of camera tube whose basis of working is photoconductivity. Basically it changes optical energy into electrical energy by the variation in resistance of the material with respect to the illumination. These camera tubes were invented in the 50s. The tube length is around 12 to 20 cm with a diameter of 1.5 to 4 cm. Due to small size and easily operational characteristic, at the time of development, they became highly popular. level of HVS is called the brightness adaptation level. Around 5000 to 20, 000 hours is generally considered as the estimated life span of Vidicon. Content: Vidicon Camera Tube Principle of Operation Small values of Weber ratio mean good 1. Construction 2. Working 3. Advantages 4. Disadvantages 5. Applications Principle of Operation of Vidicon brightness discrimination (and vice versa). • At low levels of illumination brightness discrimination is poor (rods) and it improves significantly as background illumination increases (cones). • The typical observer can discern one to two dozen different intensity changes – i.e. the DIP: MODULE I Photoconductivity is the basis of working of a Vidicon. We all know that photo means light and so photoconductivity is the property that shows the variation in conductivity of any material with the change in intensity of light falling on that surface. More simply we can say it as the application of optical energy changes the electrical conductivity of the material. And as we have already discussed that a camera tube changes optical energy into an electrical one. Thus this principle is applied in Vidicon in order to convert light energy into electrical energy. 13 With the advancement in technology, even more, compact camera tubes were developed that includes the designing variation in the electron gun. Hence this has given rise to various derivatives of Vidicon that are Plumbicon, Saticon, Newvicon etc. Construction of Vidicon The figure below represents the cross-sectional representation of a Vidicon camera tube: as a signal electrode and creates electrical contact with a metal target electrode. This electrode consists of a photoconductive layer of selenium or antimony trisulphide towards the side of the electron gun. This conductive coating is also known as the target electrode. The signal plate is provided with positive external dc supply. Working of Vidicon Camera Tube Initially, light from a scene is allowed to fall on the faceplate by passing it through a lens system. As we have already discussed that the target plate is composed of 2 layers, one is of tin oxide while at the other side a photoconductive layer is present. The electron beam is used for scanning the target plate. This electron beam is produced by an electron gun. This is focussed towards the photoconductive layer using focusing coils. By the presence of deflection coils, the electron beam scans the target horizontally as well as vertically. The gun is usually composed of a cathode that emits electron beam. Grid 1: It is abbreviated as G1 and is known as the control grid. Grid 2: G2 is known as accelerating anode, provided with a voltage of around 300 V. Grid 3: G3 acts as the accelerating grid that further accelerates the electron beam emitted by a combination of cathode and G1 and initially accelerated by the accelerating anode. This highly accelerated beam is focussed towards the target plate by the electrostatic field of the grid and the magnetic field offered by the focusing coil. Grid 4: A wire mesh denoted as G4 acts as a deaccelerating anode that allows the landing of an electron beam with low velocity over the target plate in order to prevent secondary emission. The photoconductive material over here is generally an intrinsic semiconductor that offers high resistance in darkness and low resistance when exposed to light. The target region is composed of a faceplate that has a layer of tin oxide deposited over it. This layer is known DIP: MODULE I So when light reaches the photoconductive material (target) as shown in the figure above, then by absorbing the light energy, free electrons get generated. Due to the externally supplied positive potential at the signal plate, the electrons start to migrate towards it and this causes vacancy of electrons on the photoconductive region. Thereby generating positive charges over the surface of the material. It is to be noted here that the created positive charge will be proportional to the number of free electrons produced by the photon energy. So we can say that the charge-image generated on the layer towards the gun side is proportional to the incidenting optical image. As we have already discussed that the photoconductive layer offers high resistivity nearly about 20 MΩ in the dark while low resistivity nearly about 2 MΩ in bright light. Thereby causing the generation of charge on its surface according to the intensity of falling radiation. Further, a scanning beam is emitted by the cathode that is accelerated by the accelerating grid and is focussed towards the photoconductive layer. Just before landing on the surface of the material, the beam suffers deceleration. This deceleration is performed so that the falling electrons may not cause secondary emission. So a low-velocity scanning electron beam reaches the target plate. Thus the electrons from the beam start depositing on the surface of the material in order to neutralize the vacancy of electron created in it. This resultantly produces an electric current. It is to be noteworthy here that only the sufficient amount of electrons that are needed to neutralize the positive charge will be utilized. However, the 14 remaining electrons that were not collected at the plate will travel a reverse path due to the presence of positive grids. The figure below represents the electric circuit of Vidicon: image is displayed on the screen even after the removal of the actual scene. Capacitive Lag: When scanning beam is provided to the target plate then the time needed for recharging of the plate depends on the pixel capacitance and the resistance of the beam-time constant CtRb. The value of the time constant must not be very high, as this will lead to incomplete charging of the plate in one scan. And so this will cause the generation of the smeared tail (or blurred end) behind the moving objects. So to prevent this high beam current must be provided that resultantly cause a reduction in beam resistance thereby charging the discharged pixels in a single scan. Advantages Thus we can say that the scanning current is proportional to the deposited electrons and so to the brightness of the incident light. This causes the video signal as the output across the load resistor. The scanning of every single element of the target is performed at a regular interval of around 40 ms. Thus is a stored action. This charge on the plate remains the same till the time each pixel gets neutralized. Thereby enhancing the sensitivity of the tube. What is Image Lag? Image lag is basically the term defined as the time delay in generating the signal current according to the frequent variations at the time of illuminating the target. In the case of photoconductive camera tubes, this delay can occur due to two reasons thus defined differently. The two different image lag is as follows: Photoconductive Lag: This type of image lag occurs when the photoconductive material somewhat responds slowly to the brightness variation. Basically in this case when light incident on the target plate then few numbers of electrons fails to migrate to the signal plate. This causes the existence of a faded charge image of the scene for some seconds. And this faded DIP: MODULE I Small-sized and light-weighted. It provides good resolution. Vidicon offers variable sensitivity towards illumination, by causing variation in target voltage. It provides better SNR than image orthicon TV camera tubes. Disadvantages Though it provides good sensitivity, somewhat less than the sensitivity of image orthicon. It offers around 20 nano ampere of dark current. The problem of image lag may lead to burn-in of the image at the target when exposed to longduration in bright scenes. Applications Initially, Vidicon camera tubes were used in a domestic or industrial recording like in CCTVs. But with the arrival of improved tubes, these are finding major uses in the television industry, in education, and aerospace applications. Advantages Small-sized and light-weighted. It provides good resolution. Vidicon offers variable sensitivity towards illumination, by causing variation in target voltage. It provides better SNR than image orthicon TV camera tubes. Disadvantages 15 Though it provides good sensitivity, somewhat less than the sensitivity of image orthicon. It offers around 20 nano ampere of dark current. The problem of image lag may lead to burnin of the image at the target when exposed to long-duration in bright scenes. The clarity of the photos taken from a digital camera depends on the resolution of the camera. This resolution is always measured in the pixels. If the numbers of pixels are more, the resolution increases, thereby increasing the picture quality. There are many type of resolutions available for cameras. They differ mainly in the price. Applications Initially, Vidicon camera tubes were used in a domestic or industrial recording like in CCTVs. But with the arrival of improved tubes, these are finding major uses in the television industry, in education, and aerospace applications. DIGITAL CAMERA Color Filtering using Demosaicing Algorithms The sensors used in digital cameras are actually coloured blind. All it knows is to keep a track of the intensity of light hitting on it. To get the colour image, the photosites use filters so as to obtain the three primary colours. Once these colours are combined the The image sensors used in an digital can be either a required spectrum is obtained. Charge Coupled Device (CCD) or a Complimentary Metal Oxide Semi-conductor (CMOS). Both these For this, a mechanism called interpolation is carried image sensors have been deeply explained earlier. out. A colour filter array is placed over each individual photosite. Thus, the sensor is divided into red, green The image sensor is basically a micro-chip with a width of about 10mm. The chip consists arrays of sensors, which can convert the light into electrical charges. Though both CMOS and CCD are very common, CMOS chips are known to be more cheaper. But for higher pixel range and costly cameras mostly CCD technology is used. and blue pixels providing accurate result of the true colour at a particular location. The filter most commonly used for this process is called Bayer filter pattern. In this pattern an alternative row of red and green filters with a row of blue and green filters. The number of green pixels available will be equal to the number of blue and red combined. It is designed in a A digital camera has lens/lenses which are used to different proportion as the human eye is not equally focus the light that is to be projected and created. This sensitive to all three colours. Our eyes will percept a light is made to focus on an image sensor which true vision only if the green pixels are more. converts the light signals into electric signals. The light hits the image sensor as soon as the photographer hits the shutter button. As soon as the shutter opens the pixels are illuminated by the light in different intensities. Thus an electric signal is generated. This electric signal is then further broke down to digital data and stored in a computer. Pixel Resolution of a Digital Camera The main advantage of this method is that only one sensor is required for the recording of all the colour information. Thus the size of the camera as well as its price can be lessened to a great extent. Thus by using a Bayer Filter a mosaic of all the main colours are obtained in various intensities. These various intensities can be further simplified into equal sized mosaics through a method called demosaicing algorithms. For this the three composite colours from DIP: MODULE I 16 a single pixel are mixed to form a single true colour by Optical-zoom lenses with automatic focus – These are finding out the average values of the closest lenses with focal length adjustments. They also have surrounding pixels. the “wide” and “telephoto” options. Take a look at the digital camera schematic shown Digital zoom – Full-sized images are produced by below. taking pixels from the centre of the image sensor. This Digital Camera Diagram method also depends on the resolution as well as the sensor used in the camera. Parameters of a Digital Camera Replaceable lens systems – Some digital cameras Like a film camera, a digital camera also has certain replace their lenses with 35mm camera lenses so as to parameters. These parameters decide the clarity of the obtain better images. image. First of all the amount of light that enters through the lens and hits the sensor has to be controlled. For this, the parameters are 1. Aperture – Aperture refers to the diameter of the Digital Cameras v/s Analog Camera The picture quality obtained in a film camera is much better than that in a digital camera. opening in the camera. This can be set in automatic as The rise of technology has made filming the help of well as the manual mode. Professionals prefer manual digital techniques easier as well as popular. mode, as they can bring their own touch to the image. 2. Shutter Speed – Shutter speed refers to the rate and Since the digtal copy can be posted in websites, photos can be sent to anyone in this world. amount of light that passes through the aperture. This can be automatic only. Both the aperture and the shutter speed play important roles in making a good COLOR IMAGE PROCESSING image. 3. Focal Length – The focal length is a factor that is designed by the manufacturer. It is the distance between the lens and the sensor. It also depends on the size of the sensor. If the size of the sensor is small, the focal length will also be reduced by a proportional amount. 4. Lens – There are mainly four types of lenses used The use of color is important in image processing because: Color is a powerful descriptor that simplifies object identificationand extraction. Humans can discern thousands of color shades and intensities, compared to about only two dozen shades of gray. Color image processing is divided into two major areas: for a digital camera. They differ according to the cost of the camera, and also focal length adjustment. They are Fixed-focus, fixed-zoom lens – They are very common and are used in inexpensive cameras. DIP: MODULE I 17 Full-color processing: images are acquired with a full-color sensor,such as a color TV camera or color scanner.Pseudocolor processing: The problem is one of assigning a monochrome color to a intensity or particular range of intensities. Colors are seen as variable combinations of the primary color s of light: red (R), green (G), and blue (B). The primary colors can be mixed to the The characteristics used to distinguish one color from another are: Brightness: means the amount of intensity (i.e. color level). Hue: represents dominant color as perceived by an observer. Saturation: refers to the amount of white light mixed with a hue. Color Fundamentals produce Color characteristics secondary colors: magenta (red+blue), cyan (green+blue), and yellow (red+green). Mixing the three primaries, or a secondary with its opposite primary color, produces white light. Color Models The purpose of a color model is to facilitate the specification of colors in some standard way. A color model is a specification of a coordinate system and a subspace within that system where each color is represented by a single point. Color models most commonly used in image processing are: RGB model for color monitors and video cameras CMY and CMYK (cyan, magenta, yellow, black) models for colorprinting HSI (hue, saturation, intensity) model The RGB color model Figure 1: primary and secondary colors of light RGB colors are used for color TV, monitors, and video cameras. In this model, each color appears in its primary colors red, green, and blue. This model is based on a Cartesian coordinate system. The color subspace is the cube shown in the figure below. However, the primary colors of pigments are cyan (C), magenta (M), and yellow (Y), and the secondary colors are red, green, and blue. A proper combination of the three The different colors inthis model are points on or inside the cube, and are defined by vectors extending from the origin. pigment primaries, or a secondary with its opposite primary, produces black. Figure 2: primary and secondary color of pigment CMY colors are used for color printing. DIP: MODULE I 18 Figure 3: RGB color model All color values R, G, and B have been normalized in the range [0, 1].However, we can represent each of R, G, and B from 0 to 255. Each RGB color image consists of three component images, one for each primary color as shown in the The HSI color model figure below. These three images are combined on the screen to produce a color image. The RGB and CMY color models are not suited The total number of bits used to represent each pixel for describing colors in terms of human in RGB image iscalled pixel depth. For example, in an interpretation. When we view a color object, we RGB image if each of the red, green, and blue images describe it by its hue, saturation, and brightness is an 8-bit image, the pixel depth of the RGB image is (intensity). Hence the HSI color model has been 24-bits. The figure below shows the component presented. The HSI model decouples the intensity images of anRGB image. component from the color-carrying information (hue and saturation) in a color image. As a result, The CMY and CMYK color model this model is an ideal tool for developing color Cyan, magenta, and yellow are the primary colors image processing algorithms. of pigments. Most printing devices such as color The hue, saturation, and intensity values can be printers and copiers require CMY data input or obtained from the RGBcolor cube. That is, we perform an RGB to CMY conversion internally. can convert any RGB point to a corresponding This conversionis performed using the equation point is the HSI color model by working out the geometrical formulas. where, all color values have been normalized to the range [0, 1]. In printing, combining equal amounts of cyan, magenta, and yellow produce muddy-looking black. In order to produce true black, a fourth color, black, is added, giving rise to the CMYK color model. The figure below shows the CMYK component images of an RGB image. DIP: MODULE I 19 Quantization: Digitizing the amplitude value is called quantization. To convert a continuous image f(x, y) into digital form, we have to sample the function in both coordinates and amplitude. Difference between Image Sampling and Quantization: Sampling SAMPLING AND QUANTISATION To create a digital image, we need to convert the continuous sensed data into digital form. This process includes 2 processes: Sampling: Digitizing the co-ordinate value is called sampling. DIP: MODULE I Quantization Digitization of coordinate values. Digitization of amplitude values. x-axis(time) – discretized. x-axis(time) – continuous. y-axis(amplitude) – continuous. y-axis(amplitude) – discretized. Sampling is done prior to the quantization process. Quantizatin is done after the sampling process. It determines the spatial resolution of the digitized images. It determines the number of grey levels in the digitized images. It reduces c.c. to a series of tent poles over a time. It reduces c.c. to a continuous series of stair steps. A single amplitude value is selected from different values of the time interval to represent it. Values representing the time intervals are rounded off to create a defined set of possible amplitude values The basic idea behind sampling and quantization is illustrated in Fig. 1. Figure 1(a) shows a continuous image, f(x, y), that we want to convert to digital form. An image may be continuous with respect to the x- and y-coordinates, and also in amplitude. To convert it to digital form, we have to sample the function in both coordinates and in amplitude. Digitizing the coordinate 20 values is called sampling. Digitizing the amplitude values is called quantization. The one-dimensional function shown in Fig.1 (b) is a plot of amplitude (gray level) values of the continuous image along the line segment AB in Fig. 1(a).The random variations are due to image noise. To sample this function, we take equally spaced samples along line AB, as shown in Fig.1 (c).The location of each sample is given by a vertical tick mark in the bottom part of the figure. The samples are shown as small white squares superimposed on the function. The set of these discrete locations gives the sampled function. However, the values of the samples still span (vertically) a continuous range of gray-level values. In order to form a digital function, the gray-level values also must be converted (quantized) into discrete quantities. The right side of Fig. 1 (c) shows the gray-level scale divided into eight discrete levels, ranging from black to white. The vertical tick marks indicate the specific value assigned to each of the eight gray levels. The continuous gray levels are quantized simply by assigning one of the eight discrete gray levels to each sample. The assignment is made depending on the vertical proximity of a sample to a vertical tick mark. The digital samples resulting from both sampling and quantization are shown in Fig.1 (d). Starting at the top of the image and carrying out this procedure line by line produces a two-dimensional digital image. Sampling in the manner just described assumes that we have a continuous image in both coordinate directions as well as in amplitude. In practice, the method of sampling is determined by the sensor arrangement used to generate the image. When an image is generated by a single sensing element combined with mechanical motion, as in Fig. The output of the sensor is quantized in the manner described above. However, sampling is accomplished by selecting the number of individual mechanical increments at which we activate the sensor to collect data. Mechanical motion can be made very exact so, in principle; there is almost no limit as to how fine we can sample an image. However, practical limits are established by imperfections in the optics used to focus on the sensor an illumination spot that is inconsistent with the fine resolution achievable with mechanical displacements. When a sensing strip is used for image acquisition, the number of sensors in the strip establishes the sampling limitations in one image direction. Mechanical motion in the other direction can be controlled more DIP: MODULE I accurately, but it makes little sense to try to achieve sampling density in one direction that exceeds the sampling limits established by the number of sensors in the other. Quantization of the sensor outputs completes the process of generating a digital image. Fig.1. Generating a digital image (a) Continuous image (b) A scan line from A to Bin the continuous image, used to illustrate the concepts of sampling and quantization (c) Sampling and quantization. (d) Digital scan line When a sensing array is used for image acquisition, there is no motion and the number of sensors in the array establishes the limits of sampling in both directions. Figure 2 illustrates this concept. Figure 2 (a) shows a continuous image projected onto the plane of an array sensor. Figure 2 (b) shows the image after sampling and quantization. Clearly, the quality of a digital image is determined to a large degree by the number of samples and discrete gray levels used in sampling and quantization. Fig.2. (a) Continuos image projected onto a sensor array (b) Result of image sampling and quantization. 21