You are on page 1of 28

SUMMER TRAINING REPORT

(13th June to 12th July 2011)

ON IMPLEMENTATION OF PLATEAU HISTOGRAM EQUALIZATION ALGOROTHIM FOR IMAGE ENHANCEMENT USING MATLAB

Training undertaken at: Instruments Research and Development Establishment DRDO, MINISTRY OF DEFENCE GOVERNMENT OF INDIA Raipur Road, Dehradun

Submitted by: Ravi Singh B.Tech 3rd yr, Electronic & Communication Engg. Graphic Era University (Dehradun)

ACKNOWLEDGEMENT
First of all I would like to express my sincere gratitude to Shri S.S. SUNDARAM, DIRECTOR IRDE, Dehradun, for giving me the opportunity of working in this esteemed organization. I would also like to thank Dr. S.S. NEGI, ASSOCIATE DIRECTOR TIS division, for giving me the opportunity to work in THERMAL IMAGING SYSTEM DIVISION (TIS) and also, for helping me in selecting the right environment for working and allowing me the project IMPLEMENTATION OF CENTROID ALGORITHM FOR TARGET TRACKING. This acknowledgement would be incomplete without mentioning the name of Mr. Dinesh Chander Singh, Sc. C, who not only guided me throughout the research work, but also provided the inspiration to try and accomplish the task assigned. I would also like to present my sincerest thanks to all the members, staff and officers of the TIS DIVISION for providing a helping hand at the time of need.

Date:

(ravi Singh)

CERTIFICATE
This is to certify that Mr.ravi Singh, student of ELECTRONIC & COMMUNICATION ENGINEERING, B.TECH IIIrd YEAR, GRAPHIC ERA UNIVERSITY, has undergone training at TIS Division of I.R.D.E., Dehradun from 13th June to 12th July 2011 .During this period, he was assigned the work IMPLEMENTATION OF PLATEAU

HISTOGRAM EQUALIZATION ALGOROTHIM FOR IMAGE ENHANCEMENT USING MATLAB. He has


completed his work and his work has been satisfactory during training. We wish him a prosperous career and success in life.

(Dinesh Chander Singh) Scientist C TIS Division IRDE Dehradun

(Dr S.S. Negi) Associate Director TIS Division IRDE Dehradun

CONTENTS
INTRODUCTION TO IRDE PRINCIPLE OF THERMAL IMAGING SYSTEM ELEMENTS OF THERMAL IMAGING SYSTEM MATLAB OVERVIEW DIGITAL IMAGE PROCESSING IMAGE HISTOGRAM PLATEAU HISTOGRAM EQILIZATIONALGORITHM MATLAB CODE RESULT AND ANALYSIS CONCLUSION REFERENCES

INTRODUCTION TO IRDE
Instruments Research and Development Establishment (IRDE), a major equipment oriented establishment within Defence Research and Development organization, came into existence in its present form as an institute devoted exclusively to research and development in the field of instrumentation for the services on 1st December 1961. It, however, has an earlier history as a composite establishment performing dual role of R&D and inspection. 1. Its origin can be traced back to the year 1939, when inspectorate of scientific stores was formed at Rawalpindi for the inspection of telecommunication equipments, used by Indian Army. 2. It underwent changes taking the shape of Technical Development Establishment (Instruments and Electronics). With the increase in tempo of R&D work the responsibility to meet over increasing and exacting requirements of services in the respect of more and more advanced and sophisticated equipment, the establishment was upgraded to I.R.D.E. in February 1960.

CHARTER OF WORK R&D, Design and Technology in the fields of Optical, Electro-

Optical & Optronic Instrumentation, Fire Control Systems, Infrared search and Track and Stand Alone Surveillance Systems. R&D in applied optics including Optics Design, Optics

Technology, Thin Films, Night Vision, Fiber Optics, Integrated & NonLinear Optics, Holography and Optical signal processing etc.

MAJOR AREAS OF ACTIVITIES


Technology and product development: 1. Thermal Imaging 2. Night Vision Instrumentation 3. Laser Ranging & Instrumentation 4. Servo-stabilization Systems 5. Fire Control Systems 6. Software and Microprocessors 7. Photonics and its Applications

SPECIALIZED TECHNOLOGY SUPPORT 1. Optics Design and Fabrication 2. Thin Film Technology 3. Precision Mechanism A large number of instruments for use by services have been designed & developed by the establishment and most of them are now in regular production with Ordnance Factories and other production agencies. Specialized groups of laboratories have been created in the establishment, which is devoted to the design and development of various types of instruments for application like sighting, vision, ranging and engagement etc. Though essentially equipment oriented laboratory I.R.D.E. has to its credit significant contribution in the fields of basic research in different areas of optical & theoretical research, studies conducted in holography, fiber optics, optical-imagery and spectroscopic study of materials in optical and infrared regions.

Apart from normal R&D work connected with design and development of equipment for services use and development of allied and associated technologies, the establishment also has the role of undertaking investigation on major modification either with a view to extending the role of instruments of enhancing their useful life, prepare manufacturing particulars and assist the services in evolution of foreign equipment pertaining to its field of activity. The establishment is also responsible for the transfer of technology to firms both in public and private sectors for creating production base in country for sophisticated instruments developed by it. For this purpose a Technology Transfer Center (TTC) has been set up at the establishment for smooth transfer of new technologies evolved in the field of electro-optical instrumentation to concerned production engineer. ORGANIZATIONAL SETUP The establishment has been organized into 10 technical divisions and 8 independent groups, directly responsible to the director apart from administrative, financial and security aspects. INFRASTRUTURE The establishment has well equipped laboratories looking after the development of optical instruments, night vision equipments, holographic systems, thermal imaging systems etc. All these laboratories are equipped with sophisticated and modern test equipments and devices. LIBRARY & DOCUMENTATION SERVICE The establishment has well-equipped reprographic section to look after printing and reproduction work of technical documents and drawing. It also has a wellstocked technical laboratory.

PRINCIPLE OF THERMAL IMGING SYSTEM


Thermal imaging system as mentioned earlier picks up the IR radiation emitted by the objects, which are at temperature above zero Kelvin and also due to background temperature and emissivity differences. IR radiations are a part of the electromagnetic spectrum pertaining to the IR region and that the spectral radiant emittance curves in accordance with the Plancks black body law, it may be observed that targets at ambient temperature of 300K emit maximum amount of radiation at 10m, whereas the hotter targets like jet exhausts at 700K have peak spectral emission at around 4m. At wavelengths other than those of atmospheric windows i.e. between 2 to 20 m the water vapor and CO2 molecules present in the atmosphere strongly absorb the IR radiation. A thermal sight employing IR detectors sensitive in the spectral bands convert the IR radiation emitted by the target into electrical signals. The detector output after suitable processing is again converted into a visible image either using a CRT displays or LED display.

ELEMENTS OF THERMAL IMAGING SYSTEM


1. Sources of Thermal Radiations
Thermal imaging uses long mid and long wavelength IR because these occur naturally and are readily transmitted through the atmosphere. The objects in the scene are themselves the sources of radiations making up the image. It relies on the observed phenomenon that an objects glows when hot. Also when the temperatures of these objects fall, the range of wavelength of the objects shifts towards the red and of the spectrum. With optics and detectors that work into the IR we would continue to see the element low even as it is cooled to the room temperature and it is in this property that true benefits of the Thermal Imaging are realized. Objects at normal temperature glow even viewed in the infrared and so without the need for external illumination, glow shows even in dark.

2. Optics
Optical system is required to produce a focused image of a distant scene while eliminating radiations from sources outside the scene. Baffles are used to eliminate stray radiation inside the optical system and because the system is a thermal imager it is necessary to fully absorb the stray radiations. Lenses may be used to collect and focus the radiation from the sources. Typically a multi element design is required so that optical aberration can be minimized.

3. Detectors
They have a simple function i.e. to absorb the thermal radiations from the part of scene and convert it to the electrical signal. The strength of the signal is then the measure of the temperature of that part of the scene. By compiling the outputs from many detectors, or moving the scene across the detectors, a complete image of the scene is obtained.

4. Cooling
It is necessary to dissipate the heat of the detector array, which may get heated due to the incident infrared radiations. The cooling may be obtained by either of the following methods Pettier cooling Joule cooling Stirling cooling Most commonly the stirling cooling is adopted in the Thermal Imaging systems.

5. Signal processor and display


In signal processor electrical signals, form IR detector is signal conditioned, digitized and process to form real time image. The display is generally the CRT display. The amplified signal form the detector array is multiplexed to get single line video, which can, then be fed, into the CRT to get IR image of the scene in the CRT. Video can also be made compatible to TV using a digital scan converter and displayed onto a standard monitor.

MATLAB OVERVIEW
MATLAB is a high-performance tool for technical computing. It integrates computation, visualization, and programming in an easy-to-use environment where problems and solutions are expressed in familiar mathematical notation. Typical uses include: 1. Math and computation 2. Algorithm development 3. Data acquisition 4. Modeling, simulation, and prototyping 5. Data analysis, exploration, and visualization 6. Scientific and engineering graphics 7. Application development, including graphical user interface building MATLAB is an interactive tool whose basic data element is an array that does not require dimensioning. This allows you to solve many technical computing problems, especially those with matrix and vector formulations, in a fraction of the time it would take to write a program in a scalar non-interactive language such as C or FORTRAN. The name MATLAB stands for Matrix Laboratory. MATLAB was originally written to provide easy access to matrix software developed by the LINPACK and EISPACK projects, which together represent the state-of- the art in software for matrix computation.

MATLAB has evolved over a period of years with input from many users. In university environments, it is the standard instructional tool for introductory and advanced courses in mathematics, engineering, and science. In industry, MATLAB is the tool of choice for high-productivity research, development, and analysis. MATLAB features a family of application-specific solutions called toolboxes. Very important to most users of MATLAB, toolboxes allow you to learn and apply specialized technology. Toolboxes are comprehensive collections of MATLAB functions (M-files) that extend the MATLAB environment to solve particular classes of problems. Areas in which toolboxes are available include signal processing, control systems, neural networks, fuzzy logic, wavelets, simulation, and many others.

The MATLAB System


The MATLAB system consists of five main parts:1. Desktop Tools and Development Environment: This is the set of tools and facilities that help you use MATLAB functions and files. Many of these tools are graphical user interfaces. It includes the MATLAB desktop and Command Window, a command history, an editor and debugger, and browsers for viewing help, the workspace, files, and the search path. 2. The MATLAB Mathematical Function Library: This is a vast collection of computational algorithms ranging from elementary functions like sum, sine, cosine, and complex arithmetic, to more sophisticated functions like matrix inverse, matrix eigenvalues, Bessel functions, and fast Fourier transforms. 3. The MATLAB Language:

This is a high-level matrix/array language with control flow statements, functions, data structures, input/output, and object-oriented programming features. It allows both "programming in the small" to rapidly create quick and dirty throw-away programs, and "programming in the large" to create complete large and complex application programs. 4. Graphics: MATLAB has extensive facilities for displaying vectors and matrices as graphs, as well as annotating and printing these graphs. It includes high-level functions for two-dimensional and three-dimensional data visualization, image processing, animation, and presentation graphics. It also includes low-level functions that allow you to fully customize the appearance of graphics as well as to build complete graphical user interfaces on your MATLAB applications. 5. The MATLAB Application Program Interface (API): This is a library that allows you to write C and FORTRAN programs that interact with MATLAB. It includes facilities for calling routines from MATLAB (dynamic linking), calling MATLAB as a computational engine, and for reading and writing MAT-files. In the case of tracking, here we use imageprocessing toolbox of MATLAB where there are many functions that will help us during programming.

DIGITAL IMAGE PROCESSING


A thermal image is a continuously varying array of gray shades; shades vary from light to dark. All images are made of gray shades ranging from black to white. A digital image is composed of discreet points of gray tone or brightness, rather than continuously varying levels. Gray value of each pixel along a line is summed together & accumulated sum is subtracted from the previously accumulated sum of the same image. In a digital image, each pixel has a brightness value. To make a digital image from a continuous image, it must be divided into individual points of brightness. Each point of brightness must be described by a digital data value. The process of breaking up a continuous image & determining digital brightness values are referred to as sampling & quantization respectively.

The sampling process samples the intensity of a continuous image at specific locations. The quantization process determines the digital brightness values of each sample, ranging from black, through gray scales to white. A quantized sample is referred to as a picture element, or pixel because it represents a discreet digital element of digital image. The combination of sampling & quantization process is referred to as image digitization. An image is generally sampled into a rectangular array of pixels. Each pixel has an (x,y) coordinates that corresponds to its location with in the image. The xcoordinate is pixels horizontal location; the y- coordinate is its vertical location. The pixel with coordinate (0,0) is the upper left corner of the image. We have used 8- bit image, i.e. it contains 256 gray levels (0 to 25An infocused image consists of sharp images, which contains rapid brightness transitions. Slowly varying brightness transitions represent out-of-focused image.

Pictures are the most common and convenient means of conveying and transmitting information. Pictures concisely convey information about position, sizes and inter relationships between objects. Human beings are good at deriving information from such images because of our innate visual and mental abilities. About 75% of information received by human is in pictorial form. In the present context, the analysis of pictures that employ an overhead perspective, including the radiation not visible to human eye are considered. Thus, the focus will be on analysis of remotely sensed images. These images are represented in digital form. When represented as numbers brightness can be added, subtracted, multiplied, divided and, in general, subjected to statistical

manipulations that are not possible if an image is presented only as a photograph.

An image may be defined as two dimensional function, f(x, y ), where x & y are spatial co-ordinates, and the amplitude of f at any pair of co-ordinate is called the intensity or gray level of the image at that point. When x, y, and the amplitude values of f are finite, discrete quantities, we call the image a digital image. A digital image is composed of finite number of elements, each of which has a particular location and value. These elements are referred to as picture elements, image elements and pixels. Pixel is a term most widely used to denote the elements of digital image. Digital image processing refers to processing digital images by means of a digital computer. There are three types of computerized processes: low, mid and high level. Low-level processes involve primitive operations such as image preprocessing to reduce noise, contrast enhancement and image sharpening. Its inputs as well as outputs are both images. Mid-level processes on images involve tasks such as image segmentation. It is characterized by the fact that its inputs generally are images but its outputs are attributes extracted from those images. Higher level processing involves making sense of an ensemble of recognized objects.

FUNDAMENTAL CLASSES OF DIGITAL IMAGE PROCESSING Digital image processing operations can be grouped into five fundamental classes: 1. Image enhancement 2. Image restoration 3. Image analysis 4. Image compression 5. Image synthesis

IMAGE HISTOGRAM
An image histogram is a type of histogram that acts as a graphical representation of the tonal distribution in a digital image. It plots the number of pixels for each tonal value. By looking at the histogram for a specific image a viewer will be able to judge the entire tonal distribution at a glance. Image histograms are present on many modern digital cameras. Photographers can use them as an aid to show the distribution of tones captured, and whether image detail has been lost to blown-out highlights or blacked-out shadows.[2] The horizontal axis of the graph represents the tonal variations, while the vertical axis represents the number of pixels in that particular tone.[1] The left side of the horizontal axis represents the black and dark areas, the middle

represents medium grey and the right hand side represents light and pure white areas. The vertical axis represents the size of the area that is captured in each one of these zones. Thus, the histogram for a very bright image with few dark areas and/or shadows will have most of its data points on the right side and center of the graph. Conversely, the histogram for a very dark image will have the majority of its data points on the left side and center of the graph.

Image enhancement using plateau histogram equalization algorithm


This self-adaptive contrast enhancement algorithm is based on plateau histogram equalization for infrared images. By analyzing the histogram of image, the threshold value is got self-adaptively. This new algorithm can enhance the contrast of targets in most infrared images greatly. The new algorithm has very small computational complexity while still produces high contrast output images, which makes it ideal to be implemented byFPGA (Field Programmable Gate Array) for real-time image process. This paper describes a simple and eective implementation of the proposed algorithm, including its threshold value calculation, by using pipeline and parallel computation architecture. The proposed algorithm is used to enhance the contrast of infrared

images generated from an infrared focal plane array system and image contrast is improved signicantly. Theoretical analysis and other experimental results also show that it is a very eective enhancement algorithm for most infrared images.

An infrared image is created from infrared radiation of objects and their backgrounds. Generally the temperature dierence between target objects and their background is small, and the temperature of background is high, which result in the fact that most infrared images have highly bright back-ground and low contrast between background and targets. In order to recognize targets correctly from these images, good enhancement algorithms must be applied rstly. Gray stretch, histogram equalization are general image enhancement algorithms. And histogram equalization is a widely used enhancement algorithm, in which the contrast of an image is enhanced by adjusting gray levels according to its cumulative histogram. But histogram equalization algorithm is not applicable to many infrared images, because the algorithm often mainly enhances image background instead of targets. In an eort to overcome this problem, Virgil E. Vichers and Silverman, proposed two new histogram-based algorithms:

plateau histogram equalization and

histogram projection Plateau histogram equalization has been proven to be more eective, which suppresses the enhancement of background by using a plateau threshold value. But the plateau threshold value is an empirical value in general which limits the algorithms practical usage. A modication is made to plateau histogram

equalization. By analyzing the histogram of infrared images, an estimated value of plateau threshold value is got self-adaptively. This modied algorithm is able to enhance the contrast of target objects in most infrared images more eectively than the original algorithm. It has very small computational complexity while still produces high contrast output images, which makes it ideal to be implemented by FPGA for real-time imaging applications. This describes an implementation of our proposed algorithm, including its plateau threshold value calculation by using pipeline and parallel computation architecture. The proposed algorithm has been used to enhance infrared images generated from an infrared focal plane array system and the contrast of image has been improved signicantly.

The principles of self-adaptive plateau Histogram equalization


Plateau histogram equalization
Plateau histogram equalization is a modication of histogram equalization, proposed by Virgil. Vichers and Silverman. An appropriate thresh-old value is selected rstly, which is represented as

Selection of self-adaptive plateau threshold Value


Selection of plateau threshold value is very important in the infrared image enhancement algorithm of plateau histogram equalization. It would have eect on the contrast enhancement of images. Appropriate plateau threshold value would greatly enhance the contrast of image. In addition, some plateau value would be appropriate to some infrared images, but not appropriate to others. As a result, the plateau threshold value would be selected self-adaptively according to different infrared images in the process of image enhancement.

MATLAB CODE
PROGRAM FOR ALGORITHM
Clear all

P=100;

% set the pixel parameter from 1 to (n1*n2)

A=imread (c:\image\256_256bmp); B=rgb2gray(a); Figure (1); imshow(b); b=double(b); [n1,n2] = size(b); For j= 1:256 k(i)=0; c(i)=0; d(i)=0; ds(i)=0; end for i = 1:n1 each For j=1:n2 d=b(i,j); k(:,d+1)=k(:,d+1)+1; end end % count the no of pixel level(intensity) % read the size of b

figure(2); plot(k); xlabel(GRAYSCALE VALUES); %plot the histogram

ylabel(NUMBER OF PIXEL); for i =1:256 c(i)=main(k(i),P); end figure(4); plot(c); for i =1:256 sum=0; for j=1:i sum = sum+c(j); end d(i)=sum; end for i=1:256 ds(i)=floor((256*d(i)/d(256)); end for i=1:n1 for J=1:n2 kk=b(i,j); c(i,j)=ds(:,k+1) end end figure(3); imshow(c,[]);

Results and analysis


In this Algorithm, images are enhanced by histogram equalization, selfadaptive plateau histogram equalization respectively. Then a comparison is made between the original image and the enhanced image. The original histogram has three peaks that respectively represent the background, the upper part and the nether part of the glass. And it is compact and only occupies a fraction of the whole gray levels.

So the image enhanced by self plateau histogram equalization is better than the image enhanced by equalization histogram. It is compact and only occupies a fraction of the whole gray space. Fig(b) is the enhanced image by histogram equalization. The ship is too brightened the background of the sea surface and the sky are greatly enhanced. And they made one uncomfortable. Fig. (e) is the histogram of image (b). In Fig. (e), the rst peak correspond to back-grounds occupy approximately the whole gray levels, and the last peak in Fig. (c) disappeared in Fig. (e). So the backgrounds are mainly enhanced by histogram equalization .Fig. (c) is the enhanced image by self-adaptive plateau histogram equalization.

Conclusion
Infrared images can be enhanced eectively by the proposed algorithm. It has advantages over histogram equalization. And the plateau threshold value can be self-adaptive selected in this algorithm. By using pipeline and parallel computation architecture, the system can process25 frames of 128 128 8 bits

infrared images in every second. And the experimental results show that the quality of enhanced image by self-adaptive plateau histogram equalization is better than the quality of enhanced image by histogram equalization. It works well in the infrared image process system.

REFERENCES
Image processing using MATLAB by C.Gonzalez

Electro optical tracking systems considerationsA.George Downey, SPIE volume 1111, Acquisition, tracking and pointing part 3rd . www.wikipedia.com http://www.octec.co.uk/index.html http://kdl.cs.umass.edu/prox_overview/documentation/tutorial/in dex.html

www.sciencedirect.co.in

You might also like