Moving Object Detection Using Cellular Neural
Total Page:16
File Type:pdf, Size:1020Kb
View metadata, citation and similar papers at core.ac.uk brought to you by CORE provided by UMP Institutional Repository MOVING OBJECTDETECTION USING CELLULAR NEURAL NETWORK(CNN) PREMALATHASUBRAMANIAM Thisthesisissubmittedas partialfulfillmentoftherequirementsforthe awardofthe BachelorDegreeofElectricalEngineering(ControlandInstrumentation) FacultyofElectrical &ElectronicsEngineering UniversityMalaysiaPahang NOVEMBER,2008 “Iherebyacknowledgethatthe scopeandqualityofthisthesisisqualifiedfortheaward oftheBachelorDegreeofElectrical Engineering(Control andInstrumentation)” Signature : ____________________________________ Name :AMRANBINABDUL HADI Date :14NOVEMBER2008 ii “Allthe trademarkandcopyrightsusehereinare propertyoftheirrespectiveowner. References ofinformationfromothersourcesarequotedaccordingly;otherwisethe informationpresentedinthisreportissolelyworkoftheauthor.” Signature : ______________________________ Author :PREMALATHA SUBRAMANIAM Date :15NOVEMBER2008 iii Speciallydedicatedto mybelovedparents andbestfriends fortheirfullsupport andlovethroughoutmyjourneyofeducation. iv ACKNOWLEDGEMENT I wouldlike tothankmyparents for their love,support andpatience duringthe year of my study. I also would like to take this opportunity to express my deepest gratitude tomysupervisor,EnAmranbinAbdul Hadi for his patience andguidance in preparing this paper. Special thanks to all my friends who have directly or indirectly have contributedtomysuccess incompletingthis thesis.Last but not least,I wouldlike tothankGodfor beingwithinme. v ABSTRACT Detectingmovingobjects is a keycomponent of anautomatic visual surveillance andtracking system.Previous motionbasedmovingobject detectionapproaches often use backgroundsubtractionandinter-frame difference or three-frame difference,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 Cellular Neural Networkis that connection is allowedbetweenadjacent units only.This paper comprises the implementationof the basic templates available inCellular Neural Network.The templates are programmedinMATLAB.There are few rules in Cellular Neural Networkthat has tobe implementedwhenprogrammingthe templates,suchas the state equation,output equation,boundaryconditionandalsothe initial value.These templates are combinedtocreate the most ideal algorithm todetect a movingobject in animage.A videoof a bouncingball is recordedusinga static camera.The videothen are segmented into images using SC Video Developer. Ten images are selected to be usedinthis project.The algorithm createdis usedtodetect the ball inthe images.This paper alsoincludes the use of Image ProcessingToolboxinMATLAB.Ananalysis is conductedbycomparingthe ball’s position in eachimage accordingto the time.This analysis indicates whether the object has shifted positionor movedinthe images.The efficiencyoftheresultforthis paper is85%. vi ABSTRAK Mengesan pergerakan objek ialah satu komponen yang penting dalam sistem pengawasan automatik dan sistem pengesanan pergerakan. Kaedah pengesanan pergerakanobjekyangsedia ada seringmenggunakancara penyingkiranlatar belakang danperbezaanantara lapisandi mana kaedah tersebut rumit danmengambil masa yang lama. Untuk projek ini, kaedah yang lebih mudah dan pantas dicadangkan untuk mengesan pergerakan objek dengan menggunakan Cellular Neural Network. Sifat Cellular Neural Networkyangutama ialahkebolehansel-sel bersebelahanatausetempat berkomunikasi atauberinteraksi dengansel-sel jiran.Projekini mengaplikasikanmodel klon asas yang terdapat di dalam Cellular Neural Network. Model klon tersebut diprogramkan dengan menggunakan perisian MATLAB. Terdapat beberapa peraturan yangharus diambil kira dandipatuhi semasa membuat pemprogramanuntukmodel klon seperti persamaankeadaan,persamaanhasil, keadaansempadandannilai awal.Model- model klonyangdihasilkandigabungkanbersama untukmencipta satu algoritma yang sesuai untuk mengesan pergerakan objek di dalam imej. Satu rakaman video yang menunjukkanpergerakanbola yang melantundirekodkandenganmenggunakankamera statik.Rakamanvideoini kemudiandisegmentasikandenganmenggunakanperisian SC Video Developer. Sepuluh imej dipilih untuk digunakan dalam projek ini. Algoritma yang dicipta digunakan untuk mengesan pergerakan bola dalam imej-imej tersebut. Projek ini juga mengaplikasikan Image Processing Toolbox yang terdapat di dalam perisian MATLAB. Analisis yang menunjukkan perbandingan kedudukan atau koordinat bola di dalam imej-imej tersebut dihasilkan.Tahap ketepatankeputusanuntuk 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 Cellular Neural Network 6 2.2 Basic NotationsandDefinition 9 2.2.1 StandardCNNArchitecture 9 2.2.2 SphereofInfluenceofCell 10 2.2.3 RegularandBoundaryCells 10 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 Logic NOT Template 19 2.4.4 LogicORTemplate20 2.4.5 LogicAND Template 21 2.5 MovingObjectDetection 22 III METHODOLOGY 3.1 OverviewofCellular Neural Networkfor 24 MovingObjectDetection 3.2 ResearchMethodology 26 3.3 SystemDesign 27 3.4 Step bystepCNNsimulationprocedure inMATLAB 28 3.4.1 Imageinitialization 28 3.4.2 Changingpixelvalue 31 3.4.3 InitializationofOutputMatrix 32 3.4.4 ComputationofStateEquation 33 ix 3.4.5 Displayresult 35 3.4.6 CalculationofFeedbackTermand InputTerminFunctionFile 36 3.5 Step bystepimagesegmentationprocedure inMATLAB 37 IV RESULT AND DISCUSSION 4.1 DiscussionandAnalysis 42 4.2 VideoClip Segmentation 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 Logic NOT Template 49 4.5.4 LogicORTemplate 50 4.5.5 LogicAND Template 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 Grayscale toBinaryconversionresult 46 4.5ResultofEdge DetectionTemplate 47 4.6ResultofConvexCornerTemplate 48 4.7 ResultofLogic NotTemplate 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 Software programmingforEdgeDetectionTemplate 62 B Software programmingforConvexCornerDetection 65 Template C Software programmingforLogic NOTTemplate 68 D Software programmingforLogicORTemplate 71 E Software programmingforLogicANDTemplate 74 F Software programmingforFunctionFile 77 G Software programmingforImageSegmentation 78 CHAPTER I INTRODUCTION 1.1 Overview Movingobjectdetectionisalwaysanimportanttaskinthis worldoftechnology. 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 Berkeley in1988.InCellular Neural Network,the time is continuous andthe interaction values are real values. Eachprocessingcell interacts or communicates withits nearest neighbouringcells througha program or analgorithm.Cells are onlyconnectedwithina certainneighbourhoodbut not tothe entire network,thus it is easyfor extensionwithout readjusting the whole network. Due to this, Cellular Neural Network can be used in applications such as high speed target recognition, real-time visual inspection of manufacturingprocessandalsoanybrainlikeinformationprocessingtasks. This thesis implements the basic templates from Cellular Neural Network in creatingan algorithm usingMATLAB as the programming platform.The process starts by recoding a moving ball or bouncing ball video using stationary camera. Then, the images are editedusingImage ProcessingToolboxinMATLAB.Templates are created usingMATLAB andthenanideal algorithm is selectedtodetect the movingobject.An analysiscomparingthe object previousandnew positionis done. 2 1.2 Objectives Theobjectivesofthis programare: i. TounderstandtheconceptofCellular Neural Networkanditsapplication. Inthis project,the concept of Cellular Neural Networkmust be understoodin order toapplyit.The concept of Cellular Neural Networkis its characteristic and the way it works in certain condition. The characteristic of Cellular Neural Network is elaborated in detail in the literature review. Cellular Neural Networkhasalotofapplicationsandit canbeusedinmostofelectric andelectronic projectsinsteadofthetraditional methodsusedbefore. ii. To detect a moving object captured by