International Journal of Application or Innovation in Engineering & Management (IJAIEM) Web Site: www.ijaiem.org Email: editor@ijaiem.org Volume 3, Issue 9, September 2014 ISSN 2319 – 4847 IMAGE PROCESSING BY DIGITAL FILTER USING MATLAB Netranand Pathak1 , Ketandeep Jamwal2 , Mukund Madhav3 , Aditya Madhav4 1 M-Tech, Electrical Engineering (Power system) GALGOTIA UNIVERSITY-NOIDA 1-3 B-Tech, Electronics & Communication Engineering, BHSBIET-Lehragaga ABSTRACT This paper highlights different image processing stages, components of a typical digital image processing system and strategies concerning digital filter design for the applications of image smoothing. The aim of this paper is to study the implementation of two dimensional FIR digital filter using weighted least square method for the application of image demising. The Oxford dictionary defines the word image as the optical appearance of something produced in a mirror or through a lens. Image may be other types of radiant energy and devices . However, optical images are most common and are most important. Amount of light (radiant) energy received at a point of a scene by an observer or by an image sensor varies with direction and distance of that point. The term scene stands for a landscape or a view as seen by a spectator. The scene, indoor, we see around us is, in general, three dimensional, i.e. each point in the scene may have different depth from the observer. However, there are scenes which can be considered as two dimensional, i.e. points comprising the scene have equal depth. KEYWORDS-COMPONENT: Matlab software, SIM 300 GSM/GPRS Modem Some examples of two-dimensional scenes are: flat terrain seen from satellite situated at a high altitude. the shadow of objects created by X-ray, flat polished surface of object or thin slices seen through microscopic, and documents printed on paper. In fact, radiant energy is recorded at corresponding points on a plane to form an image . Hence, the brightness and colour recorded in an image may be represented as a function of several variables. The simplest kind of intensity (optical) image we can think of is a black-and-white (B/W) image. These image are most common and are represented by a function of two variables g x, y where g x, y is the grayness or brightness or intensity of the image at the spatial coordinate x, y . A multi-spectral image is a vector-valued function having number of components equal to that of spectral bands and is represented by g1 x, y , g 2 x, y ,, g n x, y at each x, y . The colour image is a special case of multispectral image: and if we consider intensity measured in three wavelengths corresponding to red, green and blue, then g x, y = g R x, y , g G x, y ,, g B x, y . A temporal argument is added to represent time-varying image g x, y, t (also called image sequences). 1. INTRODUCTION The process of receiving and analyzing visual information by the human species is referred to as sight, perception or understanding. Similarly, the process of receiving and analyzing visual information by digital computer is called digital image processing and scene analysis. The term ‘image’ rather than’ picture is used here, because the computer stores and processes numerical image of a scene. Although ‘pattern recognition’ and ‘image processing’ have a lot in common, yet they were developed as separate disciplines . Two broad classes of techniques, viz., processing and analysis have evolved in the field of digital image processing and analysis. Processing of an image includes improvement in its appearance and efficient representation. So the field consists of not only feature extraction, analysis and recognition of image, but also coding, filtering, enhancement and restoration. Volume 3, Issue 9, September 2014 Page 126 International Journal of Application or Innovation in Engineering & Management (IJAIEM) Web Site: www.ijaiem.org Email: editor@ijaiem.org Volume 3, Issue 9, September 2014 ISSN 2319 – 4847 2. METHODOLOGY The entire process of image processing and analysis starting from the receiving of visual information to the giving out of description of the scene, may be divided into three major stages. Which are also considered as major sub-areas (a) Discretization and representation: This is concerned with converting visual information into a discrete form and making it compatible for computer processing, approximating visual information to save storage space as well as time requirement in subsequent processing. (b) Processing:It is concerned with improving image quality by filtering etc, compressing data to save storage and channel capacity during transmission. Mass storage Transmission Scene Compression Image sensing Digitization Digital image Enhancement Segmentation Improved image Restoration Feature extraction Primitive and relation extraction Statistical/str uctural analysis Description and interpretation Fig.1 Different stages of image processing and analysis scheme (Information flow along the outgoing link from each block) (c) Analysis: It is mainly related to extracting the image features, quantifying shapes, registration and recognition. In the initial stage, the input is a scene (visual information), and the output is corresponding digital image. In the secondary stage, both the input and the output are images where the output is an improved version of the input. And, in the final stage, the input is still an image but the output is a description of the contents of that image. 3. RESULTS Given the impulse response of a digital filter, its frequency response is used to study its behavior to different frequency components. In case of symmetric 2-D FIR digital filter, the magnitude response is same along both the frequency axes, i.e., 1 and 2 . Therefore, maximum magnitude of ripples along the two-frequency axes is same in case of 2-D symmetric FIR digital filter. In the design of FIR digital filters using WLS techniques, the update of weights is important because it affects the convergence of the procedure. There are no analytical methods to ensure that the iterative update schemes in weights are convergence as pointed out by many workers. The convergence problem of course, is still inevitable in the proposed method. The constant parameter determines the update of weights whereas and Volume 3, Issue 9, September 2014 Page 127 International Journal of Application or Innovation in Engineering & Management (IJAIEM) Web Site: www.ijaiem.org Email: editor@ijaiem.org Volume 3, Issue 9, September 2014 ISSN 2319 – 4847 determine the update of G. Eventually, all the parameters affect the convergent properties of the algorithm such as the convergent speed and the achievable peak ripple magnitude (prm). There are no analytical schemes for obtaining these parameters, and the relationship between these parameters are still unknown. However, from the experience of numerous design examples in the literature, we can make a reasonable choice of these parameters. In this low-pass filter with size 55 L = 40, p p = 0.4 and s = 0.6 is used for the illustration of the choice. 1. (a) The constant : It is an acceleration factor in the course of optimization when > 1. As seen from Fig. 4 when = 2 or 2.4 the procedure convergence faster significantly than the other cases with a small increase of minimum prm. Therefore, the choice of = 2 or 2.4 is better under the consideration of convergent speed and convergent error. However, in this work, we choose = 2. 2. (b) The constant : can also be viewed as an acceleration factor for the algorithm. The larger value may result in faster convergence. However, it may cause divergence. For, > 0.5 it has been found that the proposed algorithm fails to converge for several cases. For < 0.4 the algorithm seems converges eventually, whereas the convergent speed is slow or the final prm is relatively large. However, experiments show that = 0.45 is a better choice for the tradeoff between convergent speed and convergent error, as illustrated in Fig. 4. Based on these observations, in this design example, the algorithm diverges when > 0.62 except = 0.68. The number of iterations corresponding to the values, which yield divergence, are meaningless. 3. c) The constant :It has been observed that in few cases, the prm of the (k+1)th iteration is large than that if the kth iteration for some K. This may cause slow convergence. To attack the problem, we try to inhibit the increase of prm by decreasing the update amount of G, when the situation occurs. In this work, = 1 is chosen initially since it gives the maximum convergent speed. Once pr m k 1 > pr m k has been detected, = 1 and = is changed to a large value. In other words, * 50 70 * speed and convergent error. Therefore, in this work, we choose = 50. two values * are used in turn indicate that is a good consideration of convergent 4.FREQUENCY RESPONSE EVALUATION OF THE IMPLEMENTED FILTER The symmetric 2-D FIR filter is designed using two dimensional weighted least squares method for different filter specifications, i.e., pass-band frequency, stop-band frequency, tolerance and order of the filter. The frequency response comparison of these filters with different specifications is illustrated in Figs.3-7. The frequency responses so obtained are normalized frequency responses for the purposes of comparison. Based on literature and our experience of working with the present problem as well as depending upon the requirements of the present application for which the filter is to be designed, the tolerance limit selected in the present case is 0.01. If the value for the tolerance limit selected is smaller than the selected choice, the filter response improves but at the same time, computational time becomes much larger and vice-versa. So the selection of the tolerance limit, is in fact, a trade off between the computational time and filter response. From the results so obtained, first of all, it has been observed that with the modified algorithm, the frequency response of the implemented filter is always circular Fig.2 Performance analysis of the implemented two dimensional digital FIR filter using weighted least squares method (a) Frequency response of a circularly symmetric low pass filter (Order, N = 5, Tolerance = 0.01, Pass-band radius = 0.4 Volume 3, Issue 9, September 2014 Page 128 International Journal of Application or Innovation in Engineering & Management (IJAIEM) Web Site: www.ijaiem.org Email: editor@ijaiem.org Volume 3, Issue 9, September 2014 ISSN 2319 – 4847 and Stop-band radius = 0.6 ); (b) Number of iterations required for convergence versus plot when = 2; * = 50 (c) Number of iterations required for convergence versus plot when = 2; = 0.45; symmetric as illustrated in the Figs 3-7. The transition band obtained is quite sharp in almost all the Figs.3-7 with the implemented technique as compared to that of other design methods reported in the literature. Also, as shown in the Fig.3, the frequency response of low pass symmetric FIR filter is obtained for the specifications: (Order of the filter, N = 5; pass-band cut-off frequency = 0.11; stop-band cut-off frequency = 0.99; and Tolerance = 0.01). It has been observed from the Fig.4 that the frequency response is circular symmetric but the magnitude of ripples in the pass-band as well as stop-band is extremely high and it is much beyond the tolerance limits. Hence the filter with these specifications is not suitable for the present problem. It has been further observed that with the increase of pass-band cut-off frequency from 0.11 to 0.16, the magnitude of ripples decrease sharply and consequently the filter response improves greatly as verified from Figs.4-7. In this manner the final performance parameters selected for the design of filter are: (Order of the filter, N = 5; pass-band cut-off frequency = 0.16; stop-band cut-off frequency = 0.99; and Tolerance = 0.01). On the other hand, the ripple magnitude can also be reduced by increasing the order of the filter but at the same time computational complexity and hence convergence time increases, hence the use of higher order filter beyond an order 5 is also not an optimal solution. Instead we made the use of varying the pass-band cut-off frequency while keeping the stop-band cutoff frequency on the maximum side, i.e., 0.99 for a fifth order filter in the present problem. Further, the transition band is kept purposely larger keeping stop-band cut-off frequency at 0.99, so that the design time is reduced and also to get a wider range for the selection of pass-band frequency so the image information is not lost substantially and at the same time all types of images can be handled with a single filter having same performance parameters. It has also been observed that the sharp ripples occur in the transition band in all the Figs.3-7. However, at the same time with use of the selected parameters, the ripples in the Fig 3 are found to be much smoother and are equally distributed in the entire frequency domain. Fig.3 Frequency response of a circularly symmetric low-pass filter using weighted least square method for Order of the filter, N = 5, PB cut-off frequency = 0.16, SB cut-off frequency = 0.99, and Tolerance = 0.01 Volume 3, Issue 9, September 2014 Page 129 International Journal of Application or Innovation in Engineering & Management (IJAIEM) Web Site: www.ijaiem.org Email: editor@ijaiem.org Volume 3, Issue 9, September 2014 ISSN 2319 – 4847 Fig.4. Frequency response of a circularly symmetric low-pass filter using weighted least square method for Order of the filter, N = 5, PB cut-off frequency = 0.11, SB cut-off frequency = 0.99, and Tolerance = 0.01 Fig.6 Frequency response of a circularly symmetric low-pass filter using weighted least square method. for Order of the filter, N = 5, PB cut-off frequency = 0.13, SB cut-off frequency = 0.99 , and Tolerance = 0.01 Fig.5 Frequency response of a circularly symmetric low-pass filter using weighted least square method for Order of the filter, N = 5, PB cut-off frequency = 0.12, SB cut-off frequency = 0.99, and Tolerance = 0.01 Volume 3, Issue 9, September 2014 Page 130 International Journal of Application or Innovation in Engineering & Management (IJAIEM) Web Site: www.ijaiem.org Email: editor@ijaiem.org Volume 3, Issue 9, September 2014 ISSN 2319 – 4847 Fig.7 Frequency response of a circularly symmetric low-pass filter using weighted least square method for Order of the filter, N = 5, PB cut-off frequency = 0.14, SB cut-off frequency = 0.99, and Tolerance = 0.01 5. DISCUSSION/ANALYSIS Conceptualization of various underlying theoretical principles, stages and components of a typical digital image processing system leading to the formulation of framework for the design and development of one dimensional and two dimensional FIR digital filters. Development of various flowcharts for the implementation of one dimensional and two dimensional FIR digital filters based on their mathematical analysis. Development of the various algorithms for the implementation of one dimensional and two dimensional FIR digital filters based on the flowcharts developed as stated above. Implementation of a circular symmetric two dimensional FIR digital filter using two dimensional weighted least squares method in the MATLAB code. Frequency response evaluation of the implemented circular symmetric two dimensional FIR digital filter. 6.CONCLUSIONS In this Paper, a circular symmetric low-pass filter with different specifications is designed to evaluate the performance of the two dimensional weighted least squares method for its implementation. These specifications include the filter order, sampling frequency, pass-band cut-off frequency and the stop-band cut-off frequency, etc. The filter so designed is applied on different images having different grayscale values to check its authenticity. The performance of the implemented filter is evaluated using the algorithm implemented in MATLAB code. The filter characteristics have been tried for different pass-band and stop-band frequencies varying from 0 to radians. The application of the implemented low-pass filter is further studied to remove the noise from a digital image. The noise contained in the digital image is a high frequency signal whereas the image information itself is a low frequency signal REFERENCES [1] J. K. Aggarwal, R. O. Duda, and A. Rosenfeld (Eds.), “Computer Method in Image Analysis”, IEEE Press, New York, 1977. [2] H. C. Andrews, (Ed.), Digital Image Processing”, IEEE Press, New York, 1978. [3] H. C. Andrews, and B.R. Hunt, “Digital Image Restoration,” Prentice- Hall, Englewood Cliffs, New Jersey 1977. [4] B. Chanda.,D. Dutta Majumder, “Digital Image Processing and Analysis”, Prentice- Hall of India New-Delhi 2000. Volume 3, Issue 9, September 2014 Page 131 International Journal of Application or Innovation in Engineering & Management (IJAIEM) Web Site: www.ijaiem.org Email: editor@ijaiem.org Volume 3, Issue 9, September 2014 ISSN 2319 – 4847 [5] T. Y. Young, and K.S. Fu (Eds.), “Handbook of pattern Recognition and Image Processing”, Academic Press, San Diego, California, 1986. [6] A .K. Jain, “Fundamentals of Digital Image Processing”, Prentice- Hall, Englewood Cliffs, New Jersey 1989. [7] J. Serra, “Image Analysis and Mathematical Morphology”, Academic Press, London, 1982. [8] T. W. Parks and J.H. McClellan, “Chebyshev approximation in nonrecursive digital filters with liner phase,” IEEE Trans. Circuit Theory, vol.CT19,pp.189-194.Mar.1972 [9] J. H. McClellan,”The design of 2-D digital filters by transformation,” in Proc, 7th Ann. Princeton Conf. Inform. Sci. Syst., 1973,pp.247-251. [10] Y. Kamp and J.P. Thirm, “Chebyshiv approximation for 2-D non-recursove digital filters,” IEEE Trans. Circuit Syst, vol. CAS-22, pp.208-218,.Mar.1975 [11] C. S .Burius, J. A. Barreto,and I. W. Selesnick, “Iterative reweighted Least-squares design of FIR filters,” IEEE Trans, Signal Processing vol.42,pp.2926-2936,Nov,1994. [12] J. A. Barreto and C. S. Burius, “Iterative reweighted Least-squares the design of two-dimentional FIR digital filters,” TX.Nov.1994,pp,13-16. [13] C Y. Chi and S. L. Chiou, “A new self –initiated WLS approximation method for the design of two-dimentional equiripple FIR digital filter” in Proc.IEEE Int. Syst.Circuit Syst, San Diego, CA, May 1992 pp.1436-1439. [14] C. L. Lawson, “Contribution to the theory of linear least maxima approximation,” Ph. D. Dissertation, Univ. California, Los Angeles, 1996 [15] A. Gelb, “Applied Optimal Estimation”, Cambridge, MA: The MIT. Press, July 1982. AUTHOR Netrananad Pathak was born in India, on Feb 28, 1990. He graduated in Electrical Engineering from BHSBIET Lehragaga in year 2012. He is pursuing his M.Tech in Power System from Galgotia’s University Noida. His special fields of interest are Power System. Ketandeep Jamwal was born in India, on Oct 14, 1990. He graduated in Electronics & Communication Engineering from BHSBIET Lehragaga in year 2013. He is presently working in telecommunication in 4G installation and commissioning Engineering with Harpy Network for Reliance Jio. Mukund Madhav was born in India, on Dec 02, 1990. He graduated in Electronics & Communication Engineering from BHSBIET Lehragaga in year 2013. He is presently working in telecommunication in 4G installation and commissioning Engineering with Harpy Network for Reliance Jio. Aditya Madhav was born in India, on Dec 02,1990. He has done his Diploma in Electronics & Communication Engineering from BHSBIET Lehragaga in year 2013. He is presently pursuing B-Tech in Civil Engineering. Volume 3, Issue 9, September 2014 Page 132