View metadata, citation and similar papers at core.ac.uk brought to you by CORE

provided by UMP Institutional Repository

MOVINGOBJECTDETECTIONUSINGCELLULARNEURALNETWORK(CNN) PREMALATHASUBRAMANIAM Thisthesisissubmittedaspartialfulfillmentoftherequirementsfortheawardofthe BachelorDegreeofElectricalEngineering(ControlandInstrumentation) FacultyofElectrical&ElectronicsEngineering UniversityMalaysiaPahang NOVEMBER,2008 “Iherebyacknowledgethatthescopeandqualityofthisthesisisqualifiedfortheaward oftheBachelorDegreeofElectricalEngineering(ControlandInstrumentation)” Signature :______ Name:AMRANBINABDULHADI Date :14NOVEMBER2008 ii “Allthetrademarkandcopyrightsusehereinarepropertyoftheirrespectiveowner. Referencesofinformationfromothersourcesarequotedaccordingly;otherwisethe informationpresentedinthisreportissolelyworkoftheauthor.” Signature :______ Author :PREMALATHASUBRAMANIAM Date :15NOVEMBER2008 iii Speciallydedicatedto mybelovedparentsandbestfriendsfortheirfullsupport andlovethroughoutmyjourneyofeducation. iv

ACKNOWLEDGEMENT

Iwouldliketothankmyparentsfortheirlove,supportandpatienceduringthe year of my study. I also would like to take this opportunity to express my deepest gratitudetomysupervisor,EnAmranbinAbdulHadiforhispatienceandguidancein preparing this paper. Special thanks to all my friends who have directly or indirectly havecontributedtomysuccessincompletingthisthesis.Lastbutnotleast,Iwouldlike tothankGodforbeingwithinme.

v

ABSTRACT

Detectingmovingobjectsisakeycomponentofanautomaticvisualsurveillance andtrackingsystem.Previousmotionbasedmovingobjectdetectionapproachesoften usebackgroundsubtractionandinterframedifferenceorthreeframedifference,which are complicated and takes long time. In this paper, we proposed a simple and fast method to detect a moving object using Cellular Neural Network. The main idea in CellularNeuralNetworkisthatconnectionisallowedbetweenadjacentunitsonly.This papercomprisestheimplementationofthebasictemplatesavailableinCellularNeural Network.ThetemplatesareprogrammedinMATLAB.TherearefewrulesinCellular NeuralNetworkthathastobeimplementedwhenprogrammingthetemplates,suchas thestateequation,outputequation,boundaryconditionandalsotheinitialvalue.These templatesarecombinedtocreatethemostidealtodetectamovingobjectin animage.Avideoofabouncingballisrecordedusingastaticcamera.Thevideothen are segmented into images using SC Video Developer. Ten images are selected to be usedinthisproject.Thealgorithmcreatedisusedtodetecttheballintheimages.This paperalsoincludestheuseofImageProcessingToolboxinMATLAB.Ananalysisis conductedbycomparingtheball’spositionineachimageaccordingtothetime.This analysisindicateswhethertheobjecthasshiftedpositionormovedintheimages.The efficiencyoftheresultforthispaperis85%.

vi

ABSTRAK

Mengesan pergerakan objek ialah satu komponen yang penting dalam sistem pengawasan automatik dan sistem pengesanan pergerakan. Kaedah pengesanan pergerakanobjekyangsediaadaseringmenggunakancarapenyingkiranlatarbelakang danperbezaanantaralapisandimanakaedahtersebutrumitdanmengambilmasayang lama. Untuk projek ini, kaedah yang lebih mudah dan pantas dicadangkan untuk mengesan pergerakan objek dengan menggunakan Cellular Neural Network. Sifat CellularNeuralNetworkyangutamaialahkebolehanselselbersebelahanatausetempat berkomunikasiatauberinteraksidenganselseljiran.Projekinimengaplikasikanmodel klon asas yang terdapat di dalam Cellular Neural Network. Model klon tersebut diprogramkan dengan menggunakan perisian MATLAB. Terdapat beberapa peraturan yangharusdiambilkiradandipatuhisemasamembuatpemprogramanuntukmodelklon sepertipersamaankeadaan,persamaanhasil,keadaansempadandannilaiawal.Model modelklonyangdihasilkandigabungkanbersamauntukmenciptasatualgoritmayang sesuai untuk mengesan pergerakan objek di dalam imej. Satu rakaman video yang menunjukkanpergerakanbolayangmelantundirekodkandenganmenggunakankamera statik.RakamanvideoinikemudiandisegmentasikandenganmenggunakanperisianSC Video Developer. Sepuluh imej dipilih untuk digunakan dalam projek ini. Algoritma yang dicipta digunakan untuk mengesan pergerakan bola dalam imejimej tersebut. Projek ini juga mengaplikasikan Image Processing Toolbox yang terdapat di dalam perisian MATLAB. Analisis yang menunjukkan perbandingan kedudukan atau koordinatboladidalamimejimejtersebutdihasilkan.Tahapketepatankeputusanuntuk projekiniialah85%.

vii

TABLE OF CONTENTS

CHAPTER TITLE PAGE Declaration ii Dedication iii Acknowledgement iv Abstract v Abstrak vi Tableofcontent vii Listoftable xi Listoffigure xii Listofappendix xiii

I INTRODUCTION 1.1 Overview 1 1.2 Objectives 2 1.3 Scope 3 1.4 ProblemStatement 4 1.5 Thesisoutline 5

viii II LITERATURE REVIEW 2.1 CellularNeuralNetwork 6 2.2 BasicNotationsandDefinition 9 2.2.1 StandardCNNArchitecture 9 2.2.2 SphereofInfluenceofCell 10 2.2.3 RegularandBoundaryCells10 2.2.4 StandardCNN 10 2.3 Applications 13 2.4 Templates 16 2.4.1 EdgeDetectionTemplate 17 2.4.2 ConvexCornerDetectionTemplate18 2.4.3 LogicNOTTemplate 19 2.4.4 LogicORTemplate20 2.4.5 LogicANDTemplate 21 2.5 MovingObjectDetection 22 III METHODOLOGY 3.1 OverviewofCellularNeuralNetworkfor 24 MovingObjectDetection 3.2 ResearchMethodology 26 3.3 SystemDesign 27 3.4 StepbystepCNNprocedure inMATLAB 28 3.4.1 Imageinitialization 28 3.4.2 Changingpixelvalue 31 3.4.3 InitializationofOutputMatrix 32 3.4.4 ofStateEquation 33 ix 3.4.5 Displayresult 35 3.4.6 CalculationofFeedbackTermand InputTerminFunctionFile 36 3.5 Stepbystepimagesegmentationprocedure inMATLAB 37 IV RESULT AND DISCUSSION 4.1 DiscussionandAnalysis 42 4.2 VideoClipSegmentation 43 4.3 ConversionofImageTypes 45 4.3.1 RGBtoGrayscale 45 4.3.2 GrayscaletoBinary 46 4.4 ResultofTemplates 47 4.5.1 EdgeDetectionTemplate 47 4.5.2 ConvexCornerDetectionTemplate 48 4.5.3 LogicNOTTemplate 49 4.5.4 LogicORTemplate 50 4.5.5 LogicANDTemplate 51 4.5 Algorithm 52 4.6 ResultofAlgorithm 53 4.7 Object’sCoordinates 54 4.8 PixelInformation 55

V CONCLUSION AND FUTURE DEVELOPMENT 5.1 Conclusion 57 5.2 Futuredevelopment 58 5.3 CostandCommercialization 59 x REFERENCES 60

APPENDICES A-G 62

xi

LIST OF TABLE

TABLE NO TITLE PAGE 3.1 StandardFileExtensionforImages 26 3.2. ImageTypesConversionFunction 27 4.1 Object’sCoordinates 54 4.2 PixelInformation 55

xii

LIST OF FIGURE

FIGURE NO TITLE PAGE 2.1 StandardCNN5X5Architecture 9 2.2 StandardNonlinearity 11 3.1 ProjectFlowchart 26 3.2 SystemDesign 27 3.3 ImageInitialization 30 3.4 ChangingPixelValue 31 3.5 InitializationofOutputMatrix 32 3.6 ComputationofStateEquation 34 3.7 Displayresult 35 3.8 FunctionFile 36 3.9 Step1ofImageSegmentation 38 3.10 Step2ofImageSegmentation 39 3.11 Step3ofImageSegmentation 40 3.12 Step4ofImageSegmentation 41 4.1 VideoSegmentationImages 43 4.2 VideoSegmentationImages 44 4.3 RGBtoGrayscaleconversionresult 45 4.4 GrayscaletoBinaryconversionresult46 4.5ResultofEdgeDetectionTemplate 47 4.6ResultofConvexCornerTemplate 48 4.7 ResultofLogicNotTemplate 49 4.8 ResultofLogicORtemplate 50 4.9 ResultofLogicANDtemplate 51 4.10 Algorithm 52 4.11 ResultsofAlgorithm 53

xiii

LIST OF APPENDICES

APPENDIX TITLE PAGE A SoftwareprogrammingforEdgeDetectionTemplate 62 B SoftwareprogrammingforConvexCornerDetection 65 Template C SoftwareprogrammingforLogicNOTTemplate 68 D SoftwareprogrammingforLogicORTemplate 71 E SoftwareprogrammingforLogicANDTemplate 74 F SoftwareprogrammingforFunctionFile 77 G SoftwareprogrammingforImageSegmentation 78

CHAPTER I

INTRODUCTION

1.1 Overview

Movingobjectdetectionisalwaysanimportanttaskinthisworldoftechnology. Moving object detection plays an important role in automatic visual surveillance, trackingsystemandalsotoavoidcollision. Cellular Neural Network was invented by Leon O. Chun and Lin Yang in Berkeleyin1988.InCellularNeuralNetwork,thetimeiscontinuousandtheinteraction valuesarerealvalues.Eachprocessingcellinteractsorcommunicateswithitsnearest neighbouringcellsthroughaprogramoranalgorithm.Cellsareonlyconnectedwithina certainneighbourhoodbutnottotheentirenetwork,thusitiseasyforextensionwithout readjusting the whole network. Due to this, Cellular Neural Network can be used in applications such as high speed target recognition, realtime visual inspection of manufacturingprocessandalsoanybrainlikeinformationprocessingtasks.

This thesis implements the basic templates from Cellular Neural Network in creatinganalgorithmusingMATLABastheprogrammingplatform.Theprocessstarts by recoding a moving ball or bouncing ball video using stationary camera. Then, the imagesareeditedusingImageProcessingToolboxinMATLAB.Templatesarecreated usingMATLABandthenanidealalgorithmisselectedtodetectthemovingobject.An analysiscomparingtheobjectpreviousandnewpositionisdone. 2 1.2 Objectives

Theobjectivesofthisprogramare: i. TounderstandtheconceptofCellularNeuralNetworkanditsapplication. Inthisproject,theconceptofCellularNeuralNetworkmustbeunderstoodin ordertoapplyit.TheconceptofCellularNeuralNetworkisitscharacteristic and the way it works in certain condition. The characteristic of Cellular Neural Network is elaborated in detail in the literature review. Cellular NeuralNetworkhasalotofapplicationsanditcanbeusedinmostofelectric andelectronicprojectsinsteadofthetraditionalmethodsusedbefore.

ii. To detect a moving object captured by static camera using an algorithm developedinCellularNeuralNetwork. Inthisproject,themainideaistodetectthemovingobjectorthemotionof anobject.Astaticcamerawillcaptureorinanotherword,recordamoving object.ThemovingobjectisthendetectedusingCellularNeuralNetwork.In detail,analgorithmisdevelopedusingCellularNeuralNetworktemplates whichcanbeused to detect a motion. This algorithm is actually a combinationofseveraltemplatesavailableinCellularNeuralNetwork.This templatesanditsapplicationisexplainedintheliteraturereview. 3 1.3 Scope

i. An algorithm is developed based on templates in Cellular Neural Network andsimulatestheprogramminginMATLABtodetectmovingobject. AnalgorithmisdevelopedusingthetemplatesinCellularNeuralNetwork. ThisalgorithmisappliedthroughMATLABtodetectamovingobject.The programmingisdoneisMATLABandbysimulatingtheprogramming,the movingobjectwillbedetected.

ii. Ananalyzeoftheobject’spositionsintheimagesaccordingtothetime. To make image segmentation and analyze the object’s position in each imagesusingMATLAB.Theobjectisidentifiedusingcoordinatesystem.A comparisonoftheobject’spreviousandcurrentcoordinateswillbedoneto indicatethemovementoftheobjectintheimages.

4

1.4 Problem Statement

i. Moving object detection requires real time processing, which is fast, thus CellularNeuralNetworkisexcellentchoiceasitisaparallelparadigmwhich providesfastprocessing.

ii. Compared to existing method, such as spatiotemporal constraints, it takes longer time to detect moving object and more complicated than Cellular NeuralNetwork. 5 1.5 Thesis Outline

Thisthesisconsistsoffivechapters.ChapterIcoverontheintroductionofthe project,objectivesofproject,scopesofprojectandalsotheproblemstatement.Chapter IIismainlyabouttheliteraturereviewdoneforthisproject.Thischapterdiscussesthe Cellular Neural Network, its basic notation and definitions, application of Cellular Neural Network in different areas, and also the main or basic templates in Cellular NeuralNetwork.ChapterIIIfocusesonthemethodologyforthewholeprojectandalso methodology on the Cellular Neural Network template programming architecture. ChapterIVshowstheresultsobtainedfromthisproject,analysisandalsothediscussion. Thelastchapter,ChapterVconsistsoftheconclusionoftheproject,recommendation forfurtherdevelopmentandalsocostandcommercializationofthisproject.

CHAPTER II

LITERATURE REVIEW

2.1 Cellular Neural Network

CellularNeuralNetworkisalsoknownasNonlinearNeuralNetworkorCNNs. TheCellularNeuralNetworkwasinventedbyLeonO.ChuaandLinYanginBerkeley in 1988. Cellular Neural Network is an array of analog dynamic processors or cells. CellularNeuralNetworkhostprocessorsacceptandgenerateanalogsignals.Otherthan that, the interaction values are also real values. Moreover, the input of the Cellular Neural Network array plays an important role as Cellular Neural Network becomes rigorousframeworkforcomplexsystemsexhibitingemergentbehaviorandthevarious formsofemergent.

The Cellular Neural Network Universal Chip is a milestone in information technologybecauseitisthefirstoperational,fullyprogrammableindustrialsizebrain like storedprogram dynamic array computer in the world. Each Cellular Neural Networkcellisinterfacedwithitsnearestneighboursandthismassivelyparallelfocal arraycomputeriscapableofprocessing3trillionequivalentdigitalperoperationsper second(inanalogmode),aperformancewhichcanbematchedonlyby. IntermsofSPA(power,speed,area)measures,thisCellularNeuralNetworkUniversal chip is far superior to any equivalent DSP implementation by at least three orders of magnitude.Theapplicationsincludehighspeedtracktargetrecognitionandtracking, realtimevisualinspectionofmanufacturingprocesses,intelligencevisioncapableof 7 recognizingcontextsensitiveandmovingscenes,aswellasapplicationsrequiringreal time fusing of multiple modalities, such as multispectral images involving visible, infrared,longwaveinfrared,andpolarizedlights[1]. CellularNeuralNetworkisaparallelcomputingparadigmdefinedindiscreteN dimensional spaces. Cellular Neural Network is an Ndimensional regular array of elementsorcells.AstandardCellularNeuralNetworkarchitectureconsistsofanMxN rectangular cells (C(i, j)) with Cartesian coordinates (i, j). The cell grid can be for example,aplanararraywithrectangular,triangularorhexagonal,a2Dor3 Dtorus,a3Dfinitearray,ora3Dsequenceof2Darrays.Cellsaremultipleinput singleoutputprocessors,alldescribedbyoneorjustsomefewparametricfunctional.A cellischaracterizedbyaninternalstatevariable,sometimesnotdirectlyobservablefrom outsidethecellitself.Morethanoneconnectionnetworkcanbepresent,withdifferent neighbourhoodsizes.

CellularNeuralNetworkisasystemofcellsdefinedonanormalizedspace.In thesystem,cellisthebasiccircuitunitcontaininglinearandnonlinearcircuitelement, whicharelinearcapacitors,linearresistors,linearandnonlinearcontrolledsourcesand independentsources.Themainideaisthattheconnectionisallowedbetweenadjacent unitsonly.AnycellintheCellularNeuralNetworkisconnectedtoonlyitsneighbour cells. But cells can affect each other indirectly. The propagation effects of the continuous time dynamics of the Cellular Neural Network provides the interaction betweencellsinspace.

A Cellular Neural Network dynamical system can operate both in continuous (CTCNN)ordiscretetime(DTCNN).CellularNeuralNetworkdataandparameters are typically continuous values. Cellular Neural Network operate typically with more than one iteration, they are recurrent networks. Cellular Neural Network main characteristicisthelocalityoftheconnectionsbetweentheunits.Infactthemain 8 difference between Cellular Neural Network and other Neural Networks paradigms is the fact that information is directly exchanged just between neighbouring units. This characteristic allows also obtaining global processing. Communications between non directly(remote)connectedunitsareobtainedpassingthroughotherunits. ItispossibletoconsidertheCellularNeuralNetworkparadigmasanevolution ofCellularAutomataparadigm.MoreoverithasbeendemonstratedthatCellularNeural Networkparadigmisuniversal,beingequivalenttotheTuringMachine. 9 2.2 Basic Notations and Definition

2.2.1 Standard CNN architecture

AstandardCNNarchitectureconsistsofanM×Nrectangulararrayofcells (C(i,j))withCartesiancoordinates(i,j),i=1,2,…M,j=1,2…N

Column (j)

Boundary cells

Row (i) Corner cells Figure2.1:StandardCNN5X5Architecture

10

2.2.2 Sphere of Influence of Cell C(i, j)

Thesphereofinfluence,Sr(i,j),oftheradiusr ofcellC(i,j)isdefinedtobethe setofalltheneighbourhoodcellssatisfyingthefollowingproperty. Sr i,( j) = {C(k,l |) max{| k − i ||, l − j |} ≤ r} 1 ≤ k ≤ M 1, ≤ l ≤ N whererisapositiveinteger 2.2.3 Regular and Boundary Cells

A cell C(i, j) is called regular cell with respect to Sr(i, j) if and only if all neighbourhoodcellsC(k,l) ∈ Sr i,( j ) exist.Otherwise,C(i,j)iscalledaboundarycell.

2.2.4 Standard CNN

Aclass1M×NstandardCNNisdefinedbyM×Nrectangulararrayofcells C(i,j) located at side (i, j), i = 1, 2,…M, j = 1, 2…N. Each cell C(i, j) is defined mathematicallyby: Definition1:Stateequation

&ijx = − xij + ∑ Α i,( j;k,l)ykl + ∑Β i,( j;k,l)ukl + Ζij C(k,l) ∈ Sr i,( j ) C(k,l) ∈ Sr i,( j ) 11 wherexij ∈ R , ykl ∈ R, ukl ∈ R and Ζij ∈ R arecalledstate,output,inputandthreshold ofcellC(i,j)respectively.Α i,( j;k,l ) andΒ i,( j;k,l ) arecalledthefeedback. Definition2:Outputequation 1 1 yij = f (xij) = | xij + |1 − | xij − |1 2 2 Thisiscalledthestandardnonlinearity.

yij

1

xij 1 1

1

Figure2.2:StandardNonlinearity Definition3:BoundaryConditions

Theboundaryconditionsarethosespecifying ykl and ukl foreachcells belongingto Sr i,( j) ofedgecellsbutlyingoutsideofMxNarray. 12 Definition4:Initialstate

xij 0( ), i = 1,..., M , j = 1,..., N 13

2.3 Applications

TherearemanyapplicationsofCellularNeuralNetworkespeciallyinhealthcare. For example, Cellular Neural Network is used in clinical diagnosis known as Papnet. PapnetisacommercialCellularNeuralNetworkbasedcomputerprogramforassisting screening of Pap (cervical) smears. In this Pap smear test, cells taken from uterine cervixareexaminedforsignsofprecancerousandcancerouschanges.Ifdetectedearly, cervicalcancerhasanalmost100%chanceofcure.Thetraditionalmethod,whichis relying on human eyes to detect abnormal cells under microscope, has difficulty in detecting cancer in early stage. Since a patient with a serious abnormality can have fewerthanadozenabnormalcellsamongthe30,00050,000normalcellsonherPap smear, it is very difficult to detect all cases of early cancer by this "needleina haystack"search[2].UsingCellularNeuralNetworkresultsinmoreaccuratescreening processthus,leadingtoanearlierandmoreeffectivedetectionofprecancerouscellsin thecervix.

Other than that, Cellular Neural Network is also used in image analysis and interpretationparticularlyinmedicine.Patternrecognitioniswidelyusedtoidentifyand extractimportantfeaturesinradiographies,ECTsorMRIs.Filtering,segmentationand edgedetectiontechniquesusingCellularNeuralNetworkimprovesresolutioninbrain tomographies, and also improves global frequency correction for the detection of microcalcifications in mammograms. Furthermore, under healthcare, Cellular Neural Networkisalsousedinsignalanalysisandinterpretationanddrugdevelopment.

CellularNeuralNetworkisalsousedinotherapplicationsbesidehealthcare.For instance Cellular Neural Network is used in lip reading. The three main parts of the systemincludeafacetracker,lipmodelingandspeechprocessing.Automaticspeech 14 readingisbasedonarobustlipimageanalysis.Theanalysisisbasedontruecolorvideo images. The system allows for realtime tracking and storage of the lip region and robustofflinelipmodelmatching.A neuralclassifierdetectsvisibilityofteethedges andotherattributes.Atthisstageoftheapproach,theedgeclosedlipsisautomatically modeledifapplicableisbasedonneuralnetwork’sdecision.

To achievehigh flexibility duringlipmodel development,a model description languagehasbeendefinedandimplemented.Thelanguageallowsthedefinitionofedge models(ingeneral)basedonknotsandedgefunctions.Innermodelforcesstabilizethe overallmodelshape.Userdefinedimageprocessingfunctionsmaybeappliedalongthe model edges. These functions and the inner forces contribute to an overall energy function.Adaptationofthemodelisdonebygradientdescentorsimulatedannealing like .

Another application of Cellular Neural Network is detecting and tracking of movingtargets.Themovingtargetdetectionandtrackmethodshereare"trackbefore detect" methods. They correlate sensor data versus time and location, based on the natureofactualtracks.Comparedtoconventionalfixedmatchedfiltertechniques,these methodshavebeenshowntoreducefalsealarmratesbyuptoafactorof1000basedon simulated SBIRS data for very weak ICBM targets against cloud and nuclear backgrounds,withphoton,quantization,andthermalnoise,andsensorjitterincluded.

Themethodsaredesignedtoovercometheweaknessesofotheradvancedtrack beforedetectmethods,suchas3+Dmatchedfiltering,dynamicprogramming(DP),and multihypothesis tracking (MHT). Loosely speaking, 3+D matched filtering requires too many filters in practice for longterm track correlation. DP cannot realistically exploit the nonMarkovian nature of real tracks, and strong targets mask out weak targets,andMHTcannotsupportthelowpredetectionthresholdsrequiredforvery 15 weaktargetsinhighclutter.Theyhavedevelopedandtestedversionsoftheabove(and other)methodsintheirresearch,aswellasKalmanfilterprobabilisticdataassociation (KF/PDA) methods, which they use for postdetection tracking. Spacetimeadaptive methodsareusedtodealwithcorrelated,nonstationary,nonGaussianclutter,followed by a multi -stage filter sequence and softthresholding units that combine current and priorsensordata,plusfeedbackofprioroutputs,toestimatetheprobabilityoftarget presence.

CellularNeuralNetworkisalsousedinrealtimetargetidentificationbasedfor security application. The system localizes and tracks peoples' faces as they move throughascene.Itintegratesthetechniquessuchasmotiondetection,trackingpeople baseduponmotionandtrackingfacesusinganappearancemodel.Facesaretracked robustlybyintegratingmotionandmodelbasedtracking.CellularNeuralNetworkis also used in ATM network, noise reduction, finger print match, face recognition, biomedicalandwordsporting.

Highspeeddetectionandclassificationoftheobjects,symbols,andcharacters withanacceptableerrorrateisataskwhichisalwaysconsideredwhennewcomputing architecture,suitableforimageprocessingandpatternrecognition.InCellularNeural Network concept, the research area of these is locally connected, regularly repeated analogarrayshaveshownremarkablegrowth.Recently,basedontheCellularNeural Network paradigm, a universal hardware architecture has been designed, called the CellularNeuralNetworkUniversalMachine.Thisnewalgorithmicallyprogrammable analog array computer is an ideal environment for "dual computing" for example to execute complex Cellular Neural Network analogic algorithms. In these algorithms, analog operations which are controlled by various Cellular Neural Network templates arecombinedwithlocallogiconthecelllevel.Usingthisconcept,complexdecisions can be made on images without reading out the Cellular Neural Network chip which makesthismethodextremelytimeeffective. 16 2.4 Templates

DifferentroleofthecontrolandfeedbackmatricesinCellularNeuralNetwork templatesisalsoappliedtodetectmotion.Inthepastfewyears,severalresearchersalso attemptedcharacterrecognitionbyincorporatingtheCellularNeuralNetworkconcept. T. Matsumoto presents some simple Cellular Neural Network templates for binary image processing. Later, these templates (horizontal, vertical, diagonal CCD and ShadowDetector)wereusedbySuzukitointroduceanewcharacterrecognitionmethod by Cellular Neural Network preprocessing and a back propagation classification. T. SzirányiandJ.CsicsváricompletedtheabovementionedtemplatesbytheHoleFiller oneandusedanoveltypeofCNNDarchitecture.K.NakayamaandY.Chigawaused CNN for extracting line segment features (middle point, length and angle of the line segment) and for character recognition combined it with modified selforganizing featuremapping.Mostofthemturnedouttobeveryefficientinrecognitionofdistorted andtranslatedpatterns.

Eachtemplatehasitsownfeedback,inputsynaptic,thresholdvalues,boundary conditionsandinitialstatesthatneedtobefulfilledtoobtaintheresults.Theinputand thresholdarecontinuousfunctionsoftimeaccordingtotheuniquenesstheorem.

17

2.4.1 EDGE: Binary Edge Detection Template

A =0 0 0 B = 1 1 1 z= 1 0 0 0 1 8 1 0 0 0 1 1 1

Global Task Given :staticbinaryimage P Input : U(t)= P

Initialstate : X(0)=Arbitrary(inexampleswechoose xij (0)=0)

Boundaryconditions :Fixedtype, uij =0, yij =0forallvirtualcells,denotedby [U] = [Y] =[0] Output : Y(t) ⇒ Y(∞)=Binaryimageshowingalledgesof Pin black

Remark TheEdgeCNNtemplateisdesignedtoworkcorrectlyforbinaryinputimages only.If P isagrayscaleimage, Y(∞)willbeingeneralbegrayscalewhereblackpixels correspondtosharpedges,nearblackpixelscorrespondtofuzzyedges,andnearwhite pixelscorrespondtonoise. 18 2.4.2 CORNER: Convex Corner Detection Template

A =0 0 0 B = 1 1 1 z= 8.5 0 2 0 1 8 1 0 0 0 1 1 1

Global Task Given :staticbinaryimage P Input : U(t)= P Initialstate : X(0)=0 Output : Y(t) ⇒ Y(∞)=Binaryimage,whereblackpixels correspondtoconvexcornersin P(where,roughly speaking,ablackpixelisaconvexcornerifitisapartof aconvexcornerboundarylineoftheinputimage).

19 2.4.3 LOGNOT: Logic NOT and set complementation ( Ρ → Ρ = Pc) template

A =0 0 0 B = 0 0 0 z= 0 0 1 0 0 2 0 0 0 0 0 0 0

Global Task Given :staticbinaryimage P Input : U(t)= P Initialstate : X(0)=0 Output : Y(t) ⇒ Y(∞)=Binaryimagewhereeachpixelin P becomeswhite,andviceversa.Insettheoreticorlogic notation: Y(∞)=Pc= Ρ ,wherethebardenotesthe “Complement”or“Negation”operator. 20 2.4.4 LOGOR: Logic OR and set union ∪ (disjunction ∨ ) template

A =0 0 0 B = 0 0 0 z= 2 0 3 0 0 3 0 0 0 0 0 0 0

Global Task

Given :twostaticbinaryimage P1 and P 2

Input : U(t)= P1

Initialstate : X(0)= P2 Output : Y(t) ⇒ Y(∞)=Binaryoutputofthelogicoperation OR

between P1 and P 2.Inlogicnotation, Y(∞)= P1∨ P2, where ∨ denotesthe“disjunction”operator.In settheoretic, Y(∞)= P1 ∪ P2,where ∪ denotesthe “setunion”operator. 21 2.4.5 LOGAND: Logic AND and set intersection ∩ (conjunction ∧ ) template

A =0 0 0 B = 0 0 0 z= 1.5 0 1.5 0 0 1.5 0 0 0 0 0 0 0

Global Task

Given :twostaticbinaryimage P1 and P 2

Input : U(t)= P1

Initialstate : X(0)= P2 Output : Y(t) ⇒ Y(∞)=Binaryoutputofthelogicoperation

“AND” between P1 and P 2.Inlogicnotation,

Y(∞)= P1 ∧ P2, where ∧ denotesthe“conjunction”

operator.Insettheoreticnotation, Y(∞)= P1 ∩ P2, where

∩ denotesthe“intersection”operator. 22

2.5 Moving Object Detection

Identifying moving object is a critical task in image and video segmentation, which is used in many computer vision applications such as remote sensing, video surveillance and traffic monitoring. In the research done, there are some common methodsusedtodetecta movingobject.Oneofthepopularmethods isusingspatio temporalconstraints.

Inspatiotemporalconstraintsmethod,therearemanystepstobedonebeforewe can actually detect the object. Steps such as background removal or background subtraction, colour analysis, image depth, and object’s shape analysis are necessary. Spatiotemporaldatabasesdealwithobjectsthatchangetheirlocationorshapeovertime. AtypicalexampleofspatiotemporaldatabasesismovingobjectsintheDdimensional space. Moving objects learn about their own location via location detection devices, such as GPS devices. Then, the objects report their locations to the server using the underlying communication network, like the wireless networks. The server stores the updatesfromthemovingobjectsandkeepsahistoryofthespatiotemporalcoordinates of each moving object. In addition, the server stores additional information to help predictthefuturepositionsofmovingobjects.Ascanbeseenabove,thespatiotemporal constraintsmethodisverycomplicatedastherearemanystepsinvolved.

Inrecentyears,usingCellularNeuralNetworkinmovingobjectdetectionhas gained much popularity. In the research done for moving object detection, there are many ways to detect a moving object using Cellular Neural Network. The most commonlyusedtypeofCellularNeuralNetworkisDelayedCellularNeuralNetwork and Analogic Cellular Neural Network. Delayed Cellular Neural Network was first introducedin1993whereitinvolves2Dimages.Movingobjectdetectionisthemost appealingtaskinthefieldofimageprocessing.InthisDelayedCellularNeural 23 Network,thestudywasfocusedontwoparts,firstiswithoutconsideringmotionandthe secondpartdetectionofmovingobject.BesidesCellularNeuralNetwork,processingof movingimagesrequirestheintroductionofdelayinthesignalstransmittedamongthe cells. In the Delayed Cellular Neural Network, the delay τ is introduced in the state equation.

IntheAnalogicCellularNeuralNetwork,theringcodingisusedfordetectionof movingobject.Anobjectcanbedescribedbydrawingafewcirclesaroundafewinitial pointscalledacentralpoint(o)andintegratingthegraynessinthecreatedrings(g1,g2, g3)accordingtotheformulawheretheobjectisplacedinthe(x,y)plane.Thismapping ofafewrealnumbersleadstoitsrotationinvariantdescription.Butbeforeapplyingthe ringcodingmethod,thereareafewruleshavetobeclarifiedsuchasthemaximumsize of object considered, the amount of rings needed for the description, and how to calculatetheinnerandouterradiusofindividualrings.

Relyingonthetemplatesandmethods,amorecomplexCellularNeuralNetwork canbecreatedtodetectthecolour,sizeandrotationshapeoftheobject.Furthermore, thespeed,directionanddepthofthemotioncanalsobeclassified.

CHAPTER III

METHODOLOGY

3.1 Overview of Cellular Neural Network for moving object detection

Detectingmovingobjectsisakeycomponentinautomaticvisualsurveillance and tracking system. Besides that, moving object detection is also used to avoid collision. In the development of technology, moving object detection has become an importanttaskinmanydifferentareasofapplication. Inthisproject,themostvitalpartistodevelopthetemplatesavailableinCellular NeuralNetwork.Then,analgorithmcreatedfromthesetemplatesisdesignedtodetect the motion of an object, in this case, it is a bouncing ball. In order to create the programming for the algorithm, there are several other processes to be learnt beforehand.ThisincludestheprocessofunderstandingtheCellularNeuralNetworkand its notations, basic knowledge of image processing and also basic programming language,CorC++. Thevideoofabouncingballisrecordedusingstationarycamera,inthisprojecta digital camera is placed at certain point. Then, the video recorded is segmented into imagesorframesusingSCVideoDeveloper.Theseimagesarethenusedastheinput forCellularNeuralNetworktemplates.Butbeforeusingitasaninput,theimageshave tobeeditedusingtheImageProcessingToolbox.Theoriginalimagesarebiginsizeand inWindowsBitmap(bmp)format. 25 Theimagesareresizedandchangedtobinaryimagesasmostoftheinputfor CellularNeuralNetworktemplatesarebinaryimages.Theimagesareresizedbecause the time taken to run the templates will be effected by the image size. Then some CellularNeuralNetworktemplatesarecreatedforexperiment.Thesetemplatesinclude the Edge Detection Template, Convex Corner Detection Template, Logic NOT Template,LogicORTemplateandLogicANDTemplate.Butonlycertaintemplatesare chosen to create the ideal algorithm. The Cellular Neural Network template are programmed considering the initial state, boundary condition, pixel value, sphere of influence,feedbacksynaptic,inputsynapticandthethresholdvalue. Finally, the analysis is done by image segmentation. This image segmentation heremeansthesegmentationoftheoutputimagesfromthealgorithm.Theobjectorball intheimageisidentifiedusingcoordinatesystemtoindicateanymovementoftheball. As the last step of analysis, pixel counting is done to clearly show the object in the images.Inthispart,thepixeloftheareascontainingtheobjectwillbedifferentwhen comparedtotheimagebackground. This chapter discusses the methodology of the project step by step from the programmingoftemplatesuntiltheimagesegmentation.