80
Security Camera Project Graduation

Project Graduation. Prepared by: 1- Omar ahmed Nasser ail alhumikany 2- Aram jalal Abdullah mohsen 3- Ali gamal ail almansori 4- Mustafa Abdullah Omar

Embed Size (px)

Citation preview

  • Slide 1
  • Project Graduation
  • Slide 2
  • Prepared by: 1- Omar ahmed Nasser ail alhumikany 2- Aram jalal Abdullah mohsen 3- Ali gamal ail almansori 4- Mustafa Abdullah Omar 5- Haia ahmed albidani 6- Anar Khalid Omar Supervisor : Supervisor : Dr. Adel Sallam Haidar.
  • Slide 3
  • Slide 4
  • In this chapter will explain the system in general Explain the idea of this project, what problems they solve, as well as the desired goals of the system and also to know the physical and software tools.
  • Slide 5
  • Introduction Problems to be solved Project Objectives Tools used
  • Slide 6
  • Introduction The idea of the project is a security system that monitors the sensitive areas to prevent or security to alert when a penetration anywhere (E.g.: banks, corporate banking, safe home, etc....) outside working hours.
  • Slide 7
  • Problems to be solved The following are the problems that the system works to solve: The lack of effective security system (such as security guards). Difficulty with the security guard at the facility to monitor the place at the same time and alert to the presence of a security breach.
  • Slide 8
  • PPPProject Objectives 1- To provide a security system that monitors the occurrence of any movement in front of the camera and alarm, especially outside working hours. 2- Facilitate the task of the security guard in the process of monitoring and protection facility.
  • Slide 9
  • 3- Facilitate the process of storing images and provide space used instead of video.
  • Slide 10
  • Tools used 1 - Physical tools: PC. Camera USB. Wires connected to USB. Modem Wi-Fi.
  • Slide 11
  • 2- Software tools: Operating system Windows 7. The programming language that will be built by the system (C Sharp Dot Net) in order to force its dealings with external devices. Utility (PowerPoint _ Word).
  • Slide 12
  • Slide 13
  • Surveillance systems Surveillance systems is a set of processes is concerned with monitoring the behavior of people Surveillance cameras Before about 20 years old was surveillance systems with cameras are very complex and you need to effortlessly human large to keep track of the monitoring process
  • Slide 14
  • TTTTypes of surveillance systems
  • Slide 15
  • 1- analog surveillance systems Registration system in monitoring analog Video Cassette Recording (VCR(. The only way you can show where more than one camera on the TV screen is in the case of a split screen, which you must use a divider signals (Multiplexer) for receiving the signals from each camera and the allocation of part of the screen to them.
  • Slide 16
  • ( Video Multiplexer )
  • Slide 17
  • The benefits and advantages of analog surveillance systems : systems, low-cost and easy to use. You do not need any computational skills to operate it.
  • Slide 18
  • RRestrictions for analog surveillance systems: low-quality video compared to digital systems. must change the video every day. no ability to watch or remote control. less than the quality of the video with the passage of time.
  • Slide 19
  • 2-surveillance systems, computer-based cards DVR Computer control systems that rely on DVR cards lets you connect any camera to the computer. Available surveillance systems, computer-based DVR cards in the following capacities: DVR card for the four channels (four cameras max). DVR card to eight channels (eight cameras max). DVR Card for sixteen channel (sixteen camera max). DVR Card for thirty-two channels (Thirty-two cameras max).
  • Slide 20
  • Control systems computer-based cards (DVR(
  • Slide 21
  • The benefits of computerized surveillance systems: high resolution for recording. Ease of use and upgrade. Easy user interface multiple options. A standard for video compression. High storage capacity include days and perhaps months. Easy to connect to any network, internal or external.
  • Slide 22
  • RRestrictions on surveillance systems Computerized: Sensitivity to viruses and crashes because it is required to run most of the cards on the Windows operating system. Must owning the skills of computerized medium to deal with the system.
  • Slide 23
  • 3-system of digital recording devices independent DVR Recording devices digital Independent is one of the optimal solutions for those who do not know how to use a computer. A digital recording Independent includes a copy of the operating system (Linux), (Unix) or other operating systems.
  • Slide 24
  • TThe benefits of digital recording system hardware Independent DVR high resolution video. Ease of use. Withstand extreme climatic conditions and ease of maintenance. Storage capacity is enormous. Easy to connect to any network, internal or external. RRestrictions on the system of digital recording devices Independent DVR Non-can be developed and Improvement.
  • Slide 25
  • ( system of digital recording devices independent DVR )
  • Slide 26
  • 4-Systems Network Cameras (IP Cameras( Network cameras or what is referred to as (IP Cameras) are a type of cameras allocated to operations viewing, these cameras constitute a particularly attractive option for companies that are currently using CCTV. Remote access. Security surveillance. Remote monitoring.
  • Slide 27
  • TThe benefits Systems Network Camera ( IP Camera ) High resolution video. Ease of use. Can access all the camera alone. Unlimited number of cameras. High reliability and low maintenance cost. Low-cost cables. Possibility to update and upgrade. DDisadvantages of the network camera IP Camera The high cost of the camera. Weakening (Bandwidth) to connect to the Internet. Must possess the skills of computerized medium to deal with the system.
  • Slide 28
  • Network Camera (IP Camera(
  • Slide 29
  • Slide 30
  • Introduction In this chapter we discuss the important stages in this system and includes a description of the problem and the feasibility study for the new system (technical feasibility _ economic feasibility).
  • Slide 31
  • Description of the problem Feasibility Study At this stage, will conduct a feasibility study of the system,feasibility study for this system is done through the following: Technical Feasibility Economic Feasibility
  • Slide 32
  • -T-The following table shows the operating costs of the new system:- TotalvalueNumberTypePart 1000 $ 1 CPU core i7 HDD 500gb PC 15 $ 1USBCamera 5 $ 1USB CableCable 15 $ 1SoundExternal speakers 200 $ 1WI-FIModem 1235 $Total
  • Slide 33
  • Analysis of Algorithms At this stage will be mentioned mechanism,and ways in which help accelerate the algorithm steps least possible time: capture the first image of the place and the image is considered safe. capture images periodically between each period of time (seconds). comparison between the captured image and the image of safe, and be the comparison between the two images in pixels. If there is any difference between the two images is launching alerts and save the image on your computer. send the image via e-mail to the mobile phone. steps are used to accelerate the algorithm: - - Reduce the image size when saved to reduce the transmission time via the Internet to speed up the algorithm.
  • Slide 34
  • Motion Detection The main concept behind the motion detection is used in the pictures is a relatively simple image. This as a basis to determine whether there has been any error. The camera will be constantly takes pictures and compares them against a reference image. In case of a difference is so Aletbih. Motion detection algorithms will also use a threshold value. Threshold values allow you to fine tune a particular motion detection algorithm for most needs.
  • Slide 35
  • Alternatives Security guard Traditional surveillance systems (use recording devices and linked to normal cameras). Type of comparison Security guard Traditional systems New system Efficiencymedium High Protectionmedium High CostHighmediumLow (Compare alternatives with the new system )
  • Slide 36
  • Project design Project design
  • Slide 37
  • Introduction In this chapter will be put interfaces for the system, which was designed and made by the algorithm of the system. Interface Design The following figure shows the interface of the system in all actions:-
  • Slide 38
  • 1-The main interface when you start the program without action.
  • Slide 39
  • 2-The main interface when you turn on the camera for live monit
  • Slide 40
  • 3- The main interface when you take the picture Secure, where the software will take pictures every two seconds and compare it with the picture Secure.
  • Slide 41
  • 4- When a difference when you compare the pictures, it saves the image and compressed and sent via e-mail.
  • Slide 42
  • 5-Has a loss of internet connection or unavailability show us this message, so that alerts us not to provide Internet connection, but the program continues to work normally without sending the image via e-mail.
  • Slide 43
  • algorithms & code for the system
  • Slide 44
  • Algorithm explanation: Run the program. Choose a camera from which you want to surveillance. Take a picture secure. Capture images every two seconds to compare it with the picture Secure. Make sure there is a difference when comparing or not.Turn on audio alarm. Save the image in hard drive.Image compression to reduce the size. Make sure there is effective communication to the Internet. Send the image via email to the owner of the facility.
  • Slide 45
  • CCode explanation: 1-The definition of public libraries for the camera AForge.NET: AForge.NET is a C# framework for computer vision and artificial intelligence. using AForge.Video; using AForge.Video.DirectShow; using AForge; 2-The definition of the public library for input and output: using System.IO;
  • Slide 46
  • 3-The definition of the public libraries for the e-mail: using System.Net.Mail; using System.Net; 4-The definition of the public library for graphics and image compression. using System.Drawing.Drawing2D;
  • Slide 47
  • 5-This function to load the cameras associated with the computer and dedicated to selecting the camera from which you want to surveillance. private void Form1_Load(object sender, EventArgs e) { try { videocapturedivces = new FilterInfoCollection(FilterCategory.VideoInputDevice); foreach (FilterInfo videocapture in videocapturedivces) { comboBox1.Items.Add(videocapture.Name); } comboBox1.SelectedIndex = 0; } catch (Exception ex) { MessageBox.Show(ex.Message);} }
  • Slide 48
  • 6- This function to display the image of the direct monitoring on the screen. void finalvideo_NewFrame(object sender, NewFrameEventArgs eventArgs) { Bitmap img = (Bitmap)eventArgs.Frame.Clone(); pictureBox1.Image = img; }
  • Slide 49
  • 7-This function is intended to start a camera that has been selected. private void button1_Click(object sender, EventArgs e) { if (comboBox1.SelectedIndex == 0) { finalvideo = new VideoCaptureDevice(videocapturedivces[comboBox1.SelectedIndex].MonikerSt ring); finalvideo.NewFrame += new NewFrameEventHandler(finalvideo_NewFrame); finalvideo.Start(); } }
  • Slide 50
  • 8- This function is intended to turn off the camera and close the program. private void Form1_FormClosed(object sender, FormClosedEventArgs e) { finalvideo.Stop(); Application.Exit(); } 9- This function is intended to capture the image secure. private void button4_Click(object sender, EventArgs e) { pictureBox3.Image = pictureBox1.Image; }
  • Slide 51
  • 10- This function is intended for comparison, when capturing the image secure. private void timer1_Tick(object sender, EventArgs e) { if (pictureBox1.Image != null && pictureBox3.Image != null) { compare(); } }
  • Slide 52
  • 11- This function is dedicated to a comparison between the two images and run voice alarm. public void compare() { string soundfile = @"f:\ALARM.wav"; byte[] bt = File.ReadAllBytes(soundfile); var sond = new System.Media.SoundPlayer(soundfile); pictureBox2.Image = pictureBox1.Image; n += 1; textBox4.Text = n.ToString(); textBox1.Text = ""; textBox2.Text = ""; textBox3.Text = ""; string img1_ref, img2_ref; Bitmap img1, img2; count1 = 1; count2 = 1; Image t1 = pictureBox2.Image; Image t2 = pictureBox3.Image;
  • Slide 53
  • img1 = new Bitmap(t1); img2 = new Bitmap(t2); if (img1.Width == img2.Width && img1.Height == img2.Height) { for (int i = 0; i < img1.Width; i++) { for (int j = 0; j < img1.Height; j++) { j += 2; img1_ref = img1.GetPixel(i, j).ToString(); img2_ref = img2.GetPixel(i, j).ToString(); if (img1_ref != img2_ref) { if (count1 > v) { flag = false; } count2++; count1++; } } }
  • Slide 54
  • if (flag == false && count2 >= v) { textBox2.Text = count2.ToString(); sond.Play(); pictureBox4.Image = pictureBox2.Image; alert(); sond.Stop(); } else textBox3.Text = count2.ToString(); } else MessageBox.Show("can not compare this images"); }
  • Slide 55
  • 12- This function is intended to save the image, compressed and sent via e-mail. public void alert() { a = pictureBox4.Image; Bitmap im = new Bitmap(a); im.Save("f:/aaa" + n + ".png"); im = new Bitmap(100, 100); using (Graphics graphics = Graphics.FromImage(im)) { graphics.CompositingQuality = CompositingQuality.HighQuality; graphics.InterpolationMode = InterpolationMode.HighQualityBicubic; graphics.SmoothingMode = SmoothingMode.HighQuality; graphics.DrawImage(a, 0, 0, 100, 100); im.Save("f:/ssaaa" + n + ".png"); textBox1.Text = "saved"; }
  • Slide 56
  • try { //textBox1.Text = "send"; MailMessage mail = new MailMessage(); SmtpClient smtpserver = new SmtpClient("smtp.gmail.com"); mail.From = new MailAddress("[email protected]"); mail.To.Add("[email protected]"); mail.Subject = "Test Mail - 1"; mail.Body = "mail with item"; Attachment att; att = new Attachment("f:/ssaaa" + n + ".png"); //att = new Attachment("d:/saaa" + n + ".png"); mail.Attachments.Add(att);
  • Slide 57
  • smtpserver.Port = 587; smtpserver.Credentials = new NetworkCredential("[email protected]", "a3o1m1h1"); smtpserver.EnableSsl = true; smtpserver.Send(mail); } catch { MessageBox.Show(" there is no internet connection "); }
  • Slide 58
  • Project application
  • Slide 59
  • Introduction In this chapter will be implemented and tested system that has been configured and verify the currency.
  • Slide 60
  • RRequirements for implementation of the system We need to implement the system to the following requirements : A computer. Windows 7 or higher. USB camera. Cable USB. Speakers Alert. Wi-Fi modem.
  • Slide 61
  • EExplanation of System Interfaces The main interface of the system: - 1- Combo box: - used to select the camera to be selected for monitoring. 2- Start: - is used to start the camera, but without control. 3- Take picture: - is used to capture the image of safe and begin monitoring system. 4- The upper screen: - the camera is turned on by setting the display and take pictures of them. 5- Central screen: - display image secure. 6- Screen left: - the captured image is stored on a regular basis and comparing them with the picture safe central screen.
  • Slide 62
  • 7- The screen right: - when there is a difference between the two images, which screen Central and screen left, image is saved inside the screen right. 8- The first text box: - displays the number of captured images. 9- The second text box: - gives us confirmation when you save the image. 10- The third text box: - shows the percentage difference when penetration. 11- The fourth text box: - shows us the percentage of natural difference.
  • Slide 63
  • Slide 64
  • Slide 65
  • Conclusion After the implementation and testing of the system was found to meet all the objectives that established for it,where can this system monitoring all movements or intrusions that get in front of the camera and alarm occurrence.
  • Slide 66
  • FFuture work 1- The system can follow to achieve visible through direct observation from the security room by the computer using the cameras. 2- The system supports the identification from surveillance camera to be through. 3- Supports display all the events on the screens available interface system. 4- The system is characteristic of the image capture when a movement in front of the camera only. 5- As we used to capture images instead of video we have of reducing the space required for storage. 6- Through this system to achieve property warning so that if there is a penetration firing warning system to alert the security guard. 7- Supports sending pictures taken at the time of penetration to e-mail via mobile phone to the beneficiary of the system. 8- Supports the possibility of reviewing all the images that have been captured.
  • Slide 67
  • Some of the proposals that we recommend for the future development of the system: 1- make the system met to deal with more than one camera. 2- make the system met to send the messages (SMS). References 1.http://www.smartsecurityest.com/ar/index.html ( Smart Security).http://www.smartsecurityest.com/ar/index.html 2. http://www.shamelatec.ly/index.html ( Shamela Tech ).http://www.shamelatec.ly/index.html 3. http://www.codeproject.com/ ( Code Project ).http://www.codeproject.com/ 4.http://arabteam2000-forum.com/ ( Arab Team ).http://arabteam2000-forum.com/ 5. http://www.aforgenet.com/framework/ ( Aforg.Net ).http://www.aforgenet.com/framework/ 6.http://msdn.microsoft.com/enus/library/618ayhy6%28v=vs.71%29.aspx ( Microsoft C# language ).http://msdn.microsoft.com/enus/library/618ayhy6%28v=vs.71%29.aspx
  • Slide 68
  • Appendix
  • Slide 69
  • Codes Appendix using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using AForge.Video; using AForge.Video.DirectShow; using AForge; using System.IO; using System.Net.Mail; using System.Net; using System.Drawing.Drawing2D; namespace Security_Camera_2014
  • Slide 70
  • { Public partial class Form1 : Form { ////////public int v = 91450; //public int v = 102000; public int v = 101800; //public int v = 101950; int count1 = 1, count2; Boolean flag = true; int n = 1; Image a; // private FilterInfoCollection videocapturedivces; // private VideoCaptureDevice finalvideo; public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e)
  • Slide 71
  • { try { videocapturedivces = new FilterInfoCollection(FilterCategory.VideoInputDevice); foreach (FilterInfo videocapture in videocapturedivces) { comboBox1.Items.Add(videocapture.Name); } comboBox1.SelectedIndex = 0; } catch (Exception ex) { MessageBox.Show(ex.Message); }
  • Slide 72
  • void finalvideo_NewFrame(object sender, NewFrameEventArgs eventArgs) { Bitmap img = (Bitmap)eventArgs.Frame.Clone(); pictureBox1.Image = img; } private void button1_Click(object sender, EventArgs e) { if (comboBox1.SelectedIndex == 0) { finalvideo = new VideoCaptureDevice(videocapturedivces[comboBox1.SelectedIndex].MonikerStri ng); finalvideo.NewFrame += new NewFrameEventHandler(finalvideo_NewFrame); finalvideo.Start(); }
  • Slide 73
  • private void Form1_FormClosed(object sender, FormClosedEventArgs e) { finalvideo.Stop(); Application.Exit(); } private void button4_Click(object sender, EventArgs e) { pictureBox3.Image = pictureBox1.Image; }
  • Slide 74
  • private void timer1_Tick(object sender, EventArgs e) { if (pictureBox1.Image != null && pictureBox3.Image != null) { compare(); } public void compare() { string soundfile = @"f:\ALARM.wav"; byte[] bt = File.ReadAllBytes(soundfile); var sond = new System.Media.SoundPlayer(soundfile); pictureBox2.Image = pictureBox1.Image; n += 1; textBox4.Text = n.ToString(); ///////////////////////////////////////////////////////////////////////////////// textBox1.Text = ""; textBox2.Text = ""; textBox3.Text = "";
  • Slide 75
  • string img1_ref, img2_ref; Bitmap img1, img2; count1 = 1; count2 = 1; Image t1 = pictureBox2.Image; Image t2 = pictureBox3.Image; img1 = new Bitmap(t1); img2 = new Bitmap(t2); if (img1.Width == img2.Width && img1.Height == img2.Height) { for (int i = 0; i < img1.Width; i++) { for (int j = 0; j < img1.Height; j++)
  • Slide 76
  • { j += 2; img1_ref = img1.GetPixel(i, j).ToString(); img2_ref = img2.GetPixel(i, j).ToString(); if (img1_ref != img2_ref) { if (count1 > v) { flag = false; } count2++; count1++; }
  • Slide 77
  • if (flag == false && count2 >= v) { textBox2.Text = count2.ToString(); sond.Play(); pictureBox4.Image = pictureBox2.Image; alert(); sond.Stop(); } else textBox3.Text = count2.ToString(); } else MessageBox.Show("can not compare this images"); }
  • Slide 78
  • public void alert() { a = pictureBox4.Image; Bitmap im = new Bitmap(a); im.Save("f:/aaa" + n + ".png"); im = new Bitmap(100, 100); using (Graphics graphics = Graphics.FromImage(im)) { graphics.CompositingQuality = CompositingQuality.HighQuality; graphics.InterpolationMode = InterpolationMode.HighQualityBicubic; graphics.SmoothingMode = SmoothingMode.HighQuality; graphics.DrawImage(a, 0, 0, 100, 100); im.Save("f:/ssaaa" + n + ".png"); textBox1.Text = "saved"; }
  • Slide 79
  • try { //textBox1.Text = "send"; MailMessage mail = new MailMessage(); SmtpClient smtpserver = new SmtpClient("smtp.gmail.com"); mail.From = new MailAddress("[email protected]"); mail.To.Add("[email protected]"); mail.Subject = "Test Mail - 1"; mail.Body = "mail with item"; Attachment att; att = new Attachment("f:/ssaaa" + n + ".png"); //att = new Attachment("d:/saaa" + n + ".png"); mail.Attachments.Add(att); smtpserver.Port = 587; smtpserver.Credentials = new NetworkCredential("[email protected]", "a3o1m1h1"); smtpserver.EnableSsl = true; smtpserver.Send(mail); }
  • Slide 80
  • catch { MessageBox.Show(" there is no internet connection "); } private void panel1_Paint(object sender, PaintEventArgs e) { }