2007 IEEE International Symposium
onSignalProcessing and InformationTechnology
Object's
Shadow Removal
with
Removal
Validation
M.A.
As'aril,
U.U.
Sheikh2, S.A.R. Abu-Bakar3ComputerVision,Video and ImageProcessing
(CvviP) Research
Group Dept. ofMicroelectronics and Computer EngineeringFaculty ofElectrical Engineering Universiti Teknologi Malaysia 81310UTMSkudai, Johor, Malaysia Phone: +6075535274, Fax: +6075566272
E-mail:
amirulmukmininjbgyahoo.com',
uus831gyahoo.com2,
syedgfke.utm.my3
Abstract- We introduce in this paper, a shadow detection and global thresholding process is applied to the resultant image removal methodfor moving objects especially for humans and (after image division) in order to get the shadow's blob. The vehicles. An effective method is presented for detecting and authors claim theirmethod to be more generic in detecting and removing shadows from foreground figures. We assume that removingshadows.
theforegroundfigures have been extracted from the input The shadow detection method developed by [5] is imagebysomebackground subtraction method. A figure may applied to graylevel images taken by a stationary camera. The contain only one moving object with or without shadow. The authors used the Canny edge detector to both the foreground homogeneityproperty of shadows is explored in a novel way and background figures (is mapped to the foreground's for shadow detection and image division technique is used. shape). After that, image subtraction is performed on the The process is followed by filtering, removal, boundary foreground edges and background edgesto extract the object's removal and removal validation. edges. Object recovery process is applied to the object's edges
torecoverobjectshapes on the basis of the information in the Keywords - Shadow removal, homogeneity, umbra, object's edges and attributes ofshadow. There are three rules
penumbra or attributes of shadow as
defined
by authors. Firstly, brightforeground pixels is preserved because they are impossible to belong to shadows. Secondly, foreground pixels with I. INTRODUCTION attributes different from the attributes of shadow are preserved and lastly, foreground pixels nearby object edges are Shadow is a common problem that one could preserved.
encounter in motion estimation of daytime traffic scenes. The approachdescribed in [6] is applied for humanor
Shadows can cause object merging, object shape distortion pedestrian and it is basedonprioriinformation which isobject etc., causing error in object tracking and classification. Many moment and object orientation. In order to precisely remove
researchers had proposed shadow detection or removal based the unwanted shadows, this paper presents a histogram
onprioriinformation, such as the geometry of the scene or the projection method to separate each pedestrian from moving moving objects and the location of the light source while region
first.
Then, acoarse-to-fine
approach is applied for others are based on shadow attributes. There are three main detecting the boundaries between the pedestrian and its shadow attributes, firstly, shadows or moving shadows are shadow. At the coarse stage, a moment-based method is attached totheir respective obstruction object for most of the appliedto estimate the orientation of the detectedpedestrian. time, secondly, transparency which is that shadow always According to the orientation and silhouette features of the makes the region it covers darker and lastly, homogeneity detected regions, a rough approximation of the exact shadow which is the ratio between pixels when illuminated and the area can be detected. At thefine
stage, the roughsamepixelsunder shadows can be roughly linear. approximation of the shadow region is further
refined
through Method that has beenproposedin [1], [2], [3] and [4] Gaussian shadowmodeling.
Themajor
difficulty
in shadow is an image division technique (between background and modeling is the choice of the proper model, which can reflect foreground). Image division is used because it highlights the various appearances of shadows at different orientation andhomogeneity property or attributes of shadow. For [2], after
lighting.
information (e.g. principal edgedirections). The authors said
this method does not assume a particular lighting condition, Outputfrom
and required no human interaction or parameter training. background
Experiments on practical real-world traffic video sequences demonstrate that this method is simple, robust and efficient
under traffic scenes with different lighting condition. Object'sBlob Background's
II. MOTIVATION
0-ImageDivision
Many techniques which are based on homogeneity property of shadows assume that ratio between pixels when
illuminated and that are whensubjectedtoshadow isconstant. Thresholding & But, authors in[1] said that thegroundtruth data show that the
ratio is highly dependent on illumination in the scene and hence shadow detection will not be effective in case ifthe
ratio is assumed to be constant. In other words, the ratio is Filtering
always changing due to different illumination for different scenes. That is why; the authors in [1] proposed an adaptive
thresholdingtechniquetoimproveor tosolve theproblem. Boundary
Most of the researchers that develop shadow Removal
detection based on this property (homogeneity) or image
divisiontechnique justassumethe ratio isalwaysconstantand
use fix threshold value for the thresholding process (global Val
thresholding). Inaddition, the
majority
of researchers thatuseimage division technique always use an additional technique l
after the image division process because the
image
divisionprocess is used to highlight the homogeneity property of Result
shadowespeciallythe umbraregionbutnotpenumbra. That is why; they have proposed so many additional processes in
orde
to
rmvethepoenumarn suchoas
multigradin Figure1.Overallalgorithmof theproposedshadow removaltechnique order to remove thepenumbra
region
such asmulti-gradient
analysis [5]andprojectionhistogramanalysis [1].
B. Thresholding III. THEALGORITHM
The purpose ofthresholding is to decide the shadow's The flowchart in
figure
1 shows the mainalgorithm of blob in the resultantimage
after theimage
division process theproject that has beenproposedand the resultantimage
for(Img-Div).
Making
use offindings
from some researchers every process is shown with an example infigure
4. It has[e.g
1,2,3,4],
most of theexisting approaches
markpixels
been assumed that the input (object's blob and
background's
lying
betweenacertain range of value in the divisionimage
asblob) is obtained from some background subtraction. All
belonging
to ashadow.process infigure 1 isexplainedinthefollowingsections. In
[2],
the authors setpixels
value range of 50-80 (t min=50,
t_max= 80) as belonging to shadowpixels.
A. ImageDivision However, the range ishighly dependentonthe illumination in
the scene. In addition, different scenes also
produce
different level at illumination. Authorsin [1] hadproposed
anadaptive
In
this process,
theobject's
blob,ob(x,
y),{x,
y E7Z2}
threshold in order to solve this type of problem. However, this is divided with the background's blob, bk(x, y), {x, y E7Z2}
technique has been tested with a few video samples and itIthas been said before that the purpose ofimagedivision isto seems that thistechnique does
not
work effectivelycompared
highlight the homogeneity property of shadows. Resultant to a
fixed threshold.
Itis
because
the range of adaptive image after the division process ismultiplied
with a constant threshold depends on theaverage
value ofthe division image for the purpose ofincreasingthesignal
of the resultantimage.
and this
will causethat the threshold
value(range)
that Inthiscase,the
constant valueis100(Eq.]).Theresultofathis
belongs to the shadowchange
randomly.
Because ofthis
process is define as
Img_Div(x,
y). problem, in this proposed technique, the range has been set according to the scene (Eq.2) and this is done by studying theob(x, y) histogram ofthe division image over a few samples.
Img
Th ={1,
t_min
<Img-Div
< t_maxV(x y) (2)
The purpose of the Percentage Checking process is to Img-7h = O,otherwise ' ' check whether the removal process was correct or not. This is done by checking the percentage of area that has been removed in the removal process (Eq.3), where BR representC. Filtering thepercentage of area that has been removed over the area of
whole object's blob. Based on the study and analysis of The purpose of filtering is to enhance the resultant sample images, the shadow removal is correct if the image after the thresholding process(Img_Th) and to findthe percentage value is within a range that is dependent on a scene biggest blob which is predicted as the shadow's blob or (Eq.4), where RV,
percent-min
and percent_max represent shadow region. Filtering process include filling, erosion and removalvalidation result, minimum percentage and maximum dilation to enhance the image and labeling to predict the percentage (the range). This percentage range will be shadow. It is assumed that the biggest blob after the labeling explained later in section IV. If the percentage value does not process orconnected component process as a shadowregion. fall inthat range, it is assumed that the removal did not workcorrectly.
D. BoundaryRemoval areathat has been removed
BR =
object's
blobarea x 100(3)
The purpose is to remove the penumbra region of
shadow,
or inother words to remove the shadow's boundary. true,percent_mi
. BR . percentmax The first step in this process is to get the coordinates of the RV = falseotherwise(4)
boundary (object's blob). This is also called as boundary tracing process. After that, each boundary pixel and its
neighbor is checked whether it is a shadowpixelor not.Inthis The second sub process is the Vertical Scan process case, neighbor pixels that are only located in the
horizontal,
which will check whichpart
of theobject's
blob ispredicted
vertical, and diagonal (45 and -45 degree) of the boundary as ashadow
region.
IntheFiltering
process, it is assumed thatpixel
with certain offset(range
betweenneighbor pixels
and thebiggest
blob after thatlabeling
process is the shadow'sboundary
pixel)
arechecked.region.
However based on thestudy
ofinput
samples,
Figure2 shows the boundary pixel (greycoloredpixel
sometimes,
the secondbiggest
blob iS the correct shadow thatis locatedatthecentre) and theneighboring pixels (blackregion
setimes, thes
and thebiggest
biggest
blobblob isiS
not a shadowthe
region.
crect
Figure
shadow3 coloredpixels thatare locatedatthehorizontal, vertical and shows anexample
where theFiltering
process has done adiagonal of
theboundary pixel)
with an offset valueequal
to.. .
wrongprediction,
and based on theanalysis, this biggest
blob two. So, iftheboundary pixel
or itsneighboring pixels
are (wrongpredicted
shadow's region)
is always located at the detected as shadowpixels,the boundaryis assumed as apixel center oftheobject'sblob.
from the shadow'sboundary.Atthisstage,theboundary pixel S
and itsneighboring pixel is removed(turnthepixelintowhite pfm tu the
entid
ofthe
oet's
alst
tocolor).
~~~~~~~~~~~perfonmed
though
the centroid of theobject's
blobjust
tocolor),
make sure that the predicted shadow's region is not located atthe center of object's blob. However, the Vertical Scan process can only be applied on certain scenes. Some scenes
are notsuitable because it willonlycause apoorerresult.
g | Incorrect| 9 Output
Figure2.Neighbor pixelschecked aroundaboundarypixel Input Image After Image Division
withanoffset oftwo and Thresholding
Process
CorrectOutput
F.
Removal ValidationFigure 3. Vertical scan to determine correct removal
Object's Blob Background's Blob formulas that are applied in this analysis where the PV, and
PSSrepresent the percentage of correct result from a video samples,number of video samples in a scene and percentage ofcorrectremoval ina scene.
no.of frames withcorrect result
~~~Result
after PV =(5image division & no.of frames in videosample
thresholding
~~~~process
EN PPSS NN (6)
-] filtering
process
removal 3
/ ~~process _1WIIIl1
(a) (b)
Boundary removal resulIt
Figure4. Shadow removal process
(c) (d)
IV. EXPERIMENTAL RESULTS AND DISCUSSION
In order to demonstrate its usability, the proposed shadow detectionand removal have been
applied
on different types of video sequences and different types of scenes. Infigure 5, three results of the shadow detection and removalare (e) (f)
presented. Inthe first scene,the input is shown
figure
5a andtheoutputis shownfigure 5b. For thisscene,the Vertical Scan Figure 5. Shadow removal results for several scenes (before a, c, eand
process is disabled because the object orientation is not ' '
suitable application of process. This is also true for the third
scene (figure 5e and 5f). In the first scene, the range of
shadow pixelhas been set from 20 to 50 and the percentage TABLE I
value for the Percentage Checking process (see Removal SCENESANDPERCENTAGEOFCORRECTREMOVAL
Validationprocess)is 8%to45%. SCENE
Percentage
of CorrectForthe second scene (figure 5c and
5d),
the Vertical Removal(%)
Scan process is applied to prevent errors that have been ISt 100.00
mentioned before, in figure 4. The shadow pixelrange is set
9rd1
from 60 to 98 and percentage value for the Percentage 3
69.18
Checking process is 8%-33%. For the third scene, shadow pixel range is from 45 to 75 and the percentage ranges are
similartothe secondscene. V. CONCLUSION
Table 1 show the accuracyorthe percentage ofcorrect
results based on the scenesthat have been shown in
figure
5. A novel method to detect attached shadow has beenIn each scene, the
vehicle
ismonitored
andanalyzed for
a nresented. The, targret senuence 1S a dnvfime trnffic- sceneperiod
oftime
and the overall success rateis
calculated.This
prsne.Tetgtsquceiadyim tafcsee corrctesul frm evrynvolving different
types oforientation
and scenes.Figure
5 is calculatedbythe percentage o shows the resultwith different
types of objectsize, orientation
video sample,P1/1
{i = 1.. N}(bygetting
thenumber of
n cnsframes that have the correctresult over the number offrames) ansce.
daytime progresses but may change rapidly due to the [3] A. Bevilacqua, M. Roffilli, "Robust denoising and changing weather conditions as well as due to the passing moving shadows detection in traffic scenes." Proc. of objects. So, the proposed technique especially the Removal IEEE Computer Society Conference on Computer Validation process will assist the removal process in order to Vision and Pattern Recognition, Kauai Marriott, detect whether there are shadows present in an image. Hawaii, pp 1-4, 2001.
The proposed method improves object detection, [4] Falah E. Alsaqre, Yuan Baozong, "Moving Shadows which is a very critical task in video surveillance and vision- DetectionInVideo Sequences." Proc. of 7th ICSP 04,
based traffic monitoring systems. V2, pp 1306-1309, 2004.
[5] J.M. Wang, Y.C. Chung, C. L. Chang, S. W. Chen, "Shadow Detection and Removal for Traffic
VI. ACKNOWLEDGMENT Images." Proc. ofIEEE International Conference on
Networking, Sensing and Control, Taipei, Taiwan, This project has been made possible through the
VI,
pp 649-654, 2004.research contract grant managed by Universiti Teknologi [6] Chia-Jung Chang, Wen-Fong Hu, Jun-Wei Hsieh, Malaysia (UTM) under the vote 68305. The authors would Yung-Sheng Chen, "Shadow Elimination for like to express their gratitude for this support to UTM. Effective Moving Object Detection with Gaussian Models." Proc. of 16th International Conference on
VII. REFERENCES Pattern Recognition (ICPR '02), V2, pp 540-543,
2002.
[1] Mohamed IbrahimM, Anupama R, "SceneAdaptive
[7]
Angie
W. K.So,
Kwan-YeeK.
Wong,
Ronald H. Y.Shadow Detection
Algorithm."
Transactions onChung,
andFrancis
Y. L.Chin.
"ShadowDetection
For Vehicles
By
Locating
The Ob ect-ShadowEngineering, Computing and Technology, V2, Boury Prc. LofASE on
JecoSial
December,pp 88-91, 2004.
Boundary."
Proc. of IASTED Conference onSignal
[2] Alessandro Bevilacqua, "Effective Shadow Detection and Image Processing (SIP 2005), pp 315-319, 2005. in Traffic Monitoring Applications." Journal of