ISSN : 0976-8491 (Online) | ISSN : 2229-4333 (Print) www.ijcst.com. INTERNATIONAL ... method is good for detecting the edges and also shows good results for ... is an important pre-processing step for computer vision algorithm designed for ..... Rajni Thakur received her graduate degree in science in 2008 and Masters in ...
IJCST Vol. 3, Issue 2, April - June 2012
ISSN : 0976-8491 (Online) | ISSN : 2229-4333 (Print)
Detection and Removal of Cast Shadow from Digital GrayScale Images using Novel Fuzzy Technique 1 1
Sanyam Anand, 2Rajni Thakur
Dept. of Computer-Science, Lovely Professional University, Phagwara, Jalandhar, Punjab, India 2 Lovely Professional University, Phagwara, Jalandhar, Punjab, India
Abstract Shadow has always been an obstacle for intelligent transportation system, detection and removal for self and cast -shadows is a challenging task. In order to achieve this goal, edge pixels are computed by using Harris edge detection algorithm followed by background elimination by comparing two edge frames. After getting a foreground image, a fuzzy based novel algorithm is applied to remove the shadowing area of an image where fuzzy rules are used to decide the image columns that are part of the foreground objects or shadows. Experimental results show, this method is good for detecting the edges and also shows good results for cast-shadow removal without harming the self-shadow of object. Keywords Surveillance System, Shadow Detection, Shadow Removal, Fuzzy Rules, Harris Algorithm, Susan Algorithm I. Introduction Transportation is an interesting area of research that has gained importance in recent years. Intelligent Transportation System (ITS) is impossible to use without surveillance. Intelligence requires information, and information requires data, which is generated by surveillance devices. In traffic surveillance system, there are always moving objects with shadow. Shadow with object may lead a system unreliable. Shadow occurs when objects occlude light from light source. Shadows provide rich information about the object shapes as well as light orientations. Also, shadow of an object may cause embarrassments. Sometimes system cannot recognize the original image of a particular object. Shadow in image reduces the reliability of many computer vision algorithms. Shadow often degrades the visual quality of images. Shadow removal in an image is an important pre-processing step for computer vision algorithm designed for image enhancement. Shadow is categorized as selfshadow and cast-shadow.
Fig. 1: Object with Cast and Self- Shadows w w w. i j c s t. c o m
Distinction between these types of shadows is important for successful object recognition. Shadow detection helps detect the shadowing part of an object and shadow removal aims to remove cast shadow from object. Removal of cast-shadow must preserve their self-shadow. Both cast and self-shadow has different brightness values.The brightness of all the shadows in an image depends on the reflectivity of the object upon which they are cast as well as the illumination from secondary light sources. Self-shadow usually have a higher brightness than cast shadows since they receive more secondary lighting from surrounding illuminated objects. Application areas of camera surveillance are various public areas like entrance to building, airports, stations, Close Circuit Television (CCTV) cameras, traffic monitoring, building and gates, investigation, highways, medical images etc. Shadow detection and removal are important task for such surveillance system.Shadow degrades the visual quality of the images. Shadows may be an error in the detection and classification of vehicles. Due to presence of shadow in image leads a system unreliable. In traffic surveillance system, system must able to track the flow of traffic in surveillance system. Hence, presence of shadow becomes a major drawback of a surveillance system. In a highway scenario, appropriate distinction of object with shadow must be necessary otherwise system will misclassified by both two shadows. Misclassification of object with shadow will be causes a system unreliable, to identifying a self-shadow i.e. object itself is a critical task. In this paper, we aim to propose a novel algorithm/technique that detects cast shadows from grey scale digital images. By removing those shadows to provide enhanced object locations and provide better accuracy as compare to the existing algorithms. The work revolves around images taken for the purpose of traffic surveillance. Whereas, images are taken from highway scene and position of camera will be taken as stationary, i.e. objects like cars are moving and background of scene must be still. For analysis various frames are extracted from videos of highway scenes. Harris algorithm is used here to achieve the good results. In a first step, taking a video with still camera for moving object, such as cars buses etc. Second step is extracting the frames from video. Third step includes, applying Harris algorithm to detect the edges for a complete object because results of Harris for edge detection are better than Susan edge detection algorithm. In last step, shadow is removed by introducing a novel fuzzy based algorithm/technique .The coding for the presented shadow detection and removal frames has been done using MATLAB 7.6.0.324(R2008a). II. Related Work In previous years there has been a fair amount of research done on shadow detection and removal for various images like, Susan algorithm [6], used to detect moving shadow, lane boundaries detection algorithm [20], based on gradient distribution features, on the basis of color property moving cast shadow is detected and removed [18], applicable for both human and vehicles images, for intelligent transportation moving shadow is detected via texture feature and perceptual grouping [17]. This approach International Journal of Computer Science And Technology
283
IJCST Vol. 3, Issue 2, April - June 2012
improves moving shadow detection. A comparison of Susan and Harris corner detection algorithm [9] proves Harris superior [21]. Shadow detection for indoor outdoor scène [8] based on adaboost classifiers in a co-training framework. Shadow removal for traffic Images [7, 13], where shadow is detected and removed for traffic images, presence of shadow in images is analyzed by illumination assessment method. An approach for Human detection with Shadow removal for real time video surveillance [4]. For Highway Scenarios moving cast shadow removal [12]. Shadow detection and removal for vehicle detection [1-2]. Cast shadow detection and removal [11, 16], in real time ensssvironment. Shadow detection for moving humans [10], based on structure of object. Shadow removal in gray scale images [5], based on entropy minimization method for finding the invariant direction. Fuzzy based approaches for moving object detection [3, 19], Fuzzy information system based on image segmentation by using shadow detection [14]. Shadow is eliminated on the basis of shadow position and edges attributes [15]. III. Proposed Work With Experimental Results This paper proposes an algorithm that detects cast shadows and removes those shadows from grayscale digital images by enhancing existing algorithms. The images are taken for the purpose of traffic surveillance. Only grayscale images are taken for analysis.
ISSN : 0976-8491 (Online) | ISSN : 2229-4333 (Print)
Frame 1
Frame 2 Fig. 3: Original Images Extracted from Highway Scene with Still Camera B. Harris Edge Detection Apply Harris edge detection technique to get two output frames. These frames will have non- edge pixels removed. 1. Harris Edge Detection Algorithm Step 1- Input GrayScale images, σ =0.1, threshold η=168 Step 2- Convolution with respect to x and y is calculated Step 3- Gaussian filter g is applied Step 4- For each pixel (x,y) in image calculate convolution Step 5- Calculating value of λ1 with respect to x-axis and λ2 with respect to y-axis Step 6- Difference of λ1 and λ2 is calculated and setting up threshold value.
l 1 = apb(i, j ) + apb(i, j ) − 4 × I x2 (i, j ) × I y2 (i, j ) + 4 × I xy (i, j ) × I xy (i, j ); l 2 = apb(i, j ) − apb(i, j ) − 4 × I x2 (i, j ) × I y2 (i, j ) + 4 × I xy (i, j ) × I xy (i, j ); Step7- Diff = abs (lambda1-lambda2) If Diff > η then Step 8- Output as “Edge Pixel” Step 9- Exit Fig. 2: Flow Chart A. Frame Extraction Manually Extracting frames from video of traffic in highway scenario, where background of image has been stationary and objects (cars, bus, truck etc.) moving. Position of camera should be still. Such frames are extracted named as frame1 and frame2 for analysis and given below:
284
International Journal of Computer Science And Technology
Frame 3
w w w. i j c s t. c o m
ISSN : 0976-8491 (Online) | ISSN : 2229-4333 (Print)
IJCST Vol. 3, Issue 2, April - June 2012
If (reslt>= 0.5) L( 1,i-maxloci)=1; Step 8- Compute fuzzy fis system for strength of L Step 9- store input in array and evaluate the results If(resltmaxpix; Maxpix=countpix; Maxloc i=i; Maxloc j=j; Step 4- initializing M,L; Step 5- Read a fuzzy fis file For j=maxlocj+1:maxlocj+sj-1; Colstrength=0; For i=maxloci+1:maxloci+si-1; If (I (i,j) ) Colstrength=colstrength+1; Step 6- store the values of colstrength in array Step 7- Evaluate fis system results w w w. i j c s t. c o m
Fig. 7: Fuzzy Output Membership Function
International Journal of Computer Science And Technology
285
IJCST Vol. 3, Issue 2, April - June 2012
ISSN : 0976-8491 (Online) | ISSN : 2229-4333 (Print)
Frame 7: Cast Shadow Removal Using Novel Fuzzy Technique Fig. 10: Shadow Rremoval
Fig. 8: Seven Fuzzy Rules Fig. 8, fuzzy rules are made on the basis of column strength that results the removal of shadowing pixels and preserving the nonshadowing pixels.
Fig. 9: Fuzzy Output
Frame 6: Shadow Removal on the Basis of Fforeground Pixels/ Shadow Pixels
286
International Journal of Computer Science And Technology
Frame 6, shows cast-shadow removal, where Harris algorithm is used to detect edges and shadow is removed on the basis of column strength and suspected foreground column and frame7 shows the result of cast-shadow removal using fuzzy rules. Both of two images shows novel fuzzy based shadow removal is more accurate than simple shadow removal technique. IV. Conclusion This thesis works around the traffic images for the use of surveillance system where grey scale images for analysis are taken from video of highway traffic scenario, still camera is initial requirement. MATLAB 7.6.0.324(R2008a) tool is used for this study. Frames are extracted from video and edges are detected by applying Harris edge detection algorithm, Harris algorithm detects edges of object with their shadow. Extract the foreground image by comparing two frames where background of both two frames remains stationary. Now shadow removal is done by using fuzzy based novel technique. This whole work achieves good edge detection effect and good cast-shadow removal effects where self-shadow is preserved. IV. Acknowledgments We would like to express our greatest gratitude to the people who have helped & supported us throughout this paper. We are grateful to our teachers, Mr. Dalwinder Singh (C.O.D of CSE dept. LPU Phagwara, India) for their continuous support for the paper, from initial advice & contacts in the early stages of conceptual inception & through on going advice & encouragement to this day. References [1] Chun-Ting Chen,“An Enhanced Segmentation on Visionbased Shadow Removal for Vehicle Detection” National Science Council, 2010. [2] Ehsan Adeli Mosabbeb,“A New Approach for Vehicle Detection in Congested Traffic Scenes Based on Strong Shadow Segmentation”, G. Bebis et al. (Eds.): ISVC 2007, Part II, LNCS 4842, pp. 427–436, 2007. Springer-Verlag Berlin Heidelberg, 2007. [3] Fida El Baf,"Thierry Bouwmans, Bertrand Vachon, “Fuzzy Integral for Moving Object etection” IEEE, 2008. [4] Fadhlan Hafiz et.al,“Foreground Segmentation-Based Human Detection With Shadow Removal”, International Conference on Computer and Communication Engineering (ICCCE 2010), 11-13 May , Kuala Lumpur, Malaysia, 2010. [5] Graham D. Finlayson,“Entropy Minimization for Shadow Removal” University of East Anglia, Norwich, UK. Kluwer Academic Publishers. Printed in the Netherlands, 2009. w w w. i j c s t. c o m
ISSN : 0976-8491 (Online) | ISSN : 2229-4333 (Print)
[6] Huang Si-ming Liu Bing-han at.el.,"Moving shadow detection based on Susan algorithm”, National Science Foundation of P.R.China, the Fujian Province Science Foundation of P.R.China Grant No.2009J01248, IEEE, 2011. [7] J.M. Wang,“shadow detection and removal for traffic images”, In proceedings IEEE international conference on networking, sensing & control, Taipei Taiwan, March, 2004. [8] Jie Zhao,et.al,“Shadow Detection Based on Adaboost Classifiers in a Co-training Framework”, IEEE, 2011. [9] Li-hui Zou,"The Comparison of Two Typical Corner Detection Algorithms”, Second International Symposium on Intelligent Information Technology Application, 2011. [10] Muhammad Shoaib et.al,“Shadow Detection for movimg Humans using Gradient based back ground subtraction”, Institutfur Information sverarbeitung, Leibniz University at Hannover IEEE, 2009. [11] Pankaj Rajan, Wei Yan,"Department of Computer Science, Department of Architecture Texas A&M University, College Station, Texas Seventh International Conference on Advances in Pattern Recognition, 2009. [12] Rui Caseiro,“Learning Moving Cast Shadows for Robust Foreground Detection in Highway Scenarios”, 2010 13th International IEEE Annual Conference on Intelligent Transportation Systems Madeira Island, Portugal, September 2010. [13] Ryan P. Avery,“A shadow removal for traffic Images”, Department of Civil and Environmental Engineering University of Washington Seattle, 2006. [14] S. Muthu kumar,“Fuzzy Information System based on Image Segmentation by using Shadow Detection”, Centre For Information Technology and Engineering, MS University, Tirunelveli, India. M.Tech student, CITE, IEEE, 2010. [15] Shiping Zhu, Li Ma,“An Adaptive Shadow Elimination Algorithm Using Shadow Position and Edges Attributes”, 3rd International Congress on Image and Signal Processing, 2010. [16] S.Lakshmi, V.Sankaranarayanan,“Cast Shadow Detection and Removal in a Real- time Environment”, IEEE, 2010. [17] Xu Jieqiong, Wang Guoyu,“An Approach for Intelligent Transportation Moving Shadow Detection via Perceptual Grouping and Texture Feature” College of Information Science and Engineering, Ocean University of China, Qingdao, China, IEEE, 2011. [18] Xue Li,“Robust Moving Cast Shadows Detection and Removal with Reliability Checking of the Color Property”, Sixth International Conference on Image and Graphics, 2011. [19] Ying Ding,“A fuzzy background model for moving object detection”, School of Computer Science and Technology, Jilin University, China, IEEE, 2009. [20] Yanjun Fan Weigong Zhang Xu Li,“A robust lane boundaries detection algorithm based on gradient distribution features”, School of Instrument Science and Engineering Southeast University Nanjing, China, Eighth International Conference on Fuzzy Systems and Knowledge Discovery (FSKD), 2011. [21] Zhiyong Ye,"In the study of, An Improved Algorithm for Harris Corner Detection”, school of Information, Yunnan University, Kunming, China IEEE, 2009.
w w w. i j c s t. c o m
IJCST Vol. 3, Issue 2, April - June 2012
Sanyam Anand received his graduated Degree in bachelor in technology from CGC Landran and his masters in technology in IT in 2011 from CGC Landran. Currently he is working as the assistance professor in lovely professional university, Phagwara, INDIA. His research interests include search engines, digital images processing and software engineering. Rajni Thakur received her graduate degree in science in 2008 and Masters in computer science in 2010 from Guru Nanak Dev University, Amritsar, India. She is pursuing M.Tech CSE from Lovely Professional University, India. Her research interests include image processing, networking and Neural Networks. She has attended several conferences at national and international level.
International Journal of Computer Science And Technology
287