Closed Circuit Television in Raspberry PI Using Open CV & Python
Total Page:16
File Type:pdf, Size:1020Kb
ITSI Transactions on Electrical and Electronics Engineering (ITSI-TEEE) _______________________________________________________________________________________________ Closed Circuit Television in Raspberry PI Using Open CV & Python 1Rajatha B, 2L Swarna Jyothi, 3UmaShankar Shetty C 1,2Dept of ECE, RRCE Bengaluru-74, India 3Manager-Services, Tenet Technetronics, Bengaluru, India Abstract- Designing an efficient and foolproof surveillance the type of background subtraction that will be used in system is a challenging task. The cost of sophisticated the system, the researchers considered the place where surveillance systems is very high. These factors made the system will be placed and also the processing speed researchers to think alternative for the existing system. of the RPI. According to one comparative study, the Raspberry Pi, a low cost, single board credit card sized basic background subtraction has the lowest processing computer is the heart of this work. The system is built on Open CV and the coding language used is Python. The speed requirement but it can't be implemented in a Open CV is released under BSD license. The BSD license complex background environment [3]. The researchers makes the Open CV software free for both academic and finally choose the basic background subtraction for commercial purpose. The Python is a script language. Face motion detection due to its low computational detection algorithm is used to precisely identify the human requirement. beings. The proposed surveillance system can be used in public places like Hotels, Coffee Shops, Malls, Offices etc. Moreover, in recent years, Motion Detection has attracted a great interest from computer vision Keywords- Raspberry Pi, Open CV, Python, Surveillance, researchers due to its promising applications in many BSD license areas, such as video surveillance, traffic monitoring or I. INTRODUCTION sign language recognition. To overcome storage spaces issue, we apply the Motion Detection algorithm for live Closed-circuit television [1] monitoring system has now camera streaming, this allows the system to analyze become indispensable in day to day life of human incoming images from cameras, and recognize when society. Supermarkets, factories, hospitals, hotels, movement occurs. The video system can collect and schools, and companies are having their own CCTV store images for the administrators review. Effective use system for 24/7 monitoring. Instead of using the of Motion Detection promotes an automated approach to traditional wireless CCTV surveillance cameras, video system reaction, and does not require an customers can now own their inexpensive security individual to start and stop recording sessions. So we systems with the tiny super computer called Raspberry can significantly decrease storage usage and save Pi. IP cameras can serve better as they can send and investment costs. receive data via computer network and internet based on internet protocol. Also resolution clarity of IP cameras is II. THEORETICAL FRAMEWORK far better than CCTV cameras. A camera module Figure 1 shows the block diagram of the whole system. connected to the Raspberry Pi will records all the The heart of the system is a single board credit card size happenings in the monitored area and live streaming can computer known as RPI (Raspberry Pi) . It is the central be viewed from any web browser, even from mobile in platform for image processing and signal alerting. An real-time. There are many problems in the video ordinary webcam captures the scene to be processed by surveillance system, such as: picture is indistinct, the RPI. The system has the capability of detecting anomalies cannot be identified automatically and a lot of motion of an object. When the moving object is storage spaces are needed to save the surveillance detected, the system can classify it as human. If there is information. detection, the system sends out alerting signal in the A. Background Subtraction form of sound and email to indicate fire or unauthorized invasion. Since the camera used is monitoring at a fixed location, background subtraction [3] algorithm can be used in In the block diagram there are components like detecting motion by the concept of frame differencing. Raspberry pi, Keyboard, Mouse, Webcam and monitor. Moving objects within a given background can be The peripherals connected to the Raspberry Pi will deduced from the difference of the current frame and a detect the motion using webcam and thus acts as a reference frame, often called the “background image”. surveillance system. There are several algorithms that can be used for motion detection like optical flow and edge analysis. One of the simplest forms of motion detection is using background subtraction. There are different types of background subtraction based from the different journals. The challenges in most of these algorithms are the illumination changes and processing speed. In choosing _______________________________________________________________________________________________ ISSN (PRINT) : 2320 – 8945, Volume -4, Issue -3, 2016 19 ITSI Transactions on Electrical and Electronics Engineering (ITSI-TEEE) _______________________________________________________________________________________________ Keyboard Webcam IV.OPEN CV The Open CV [2] (Open Source Computer Vision Library) is a Computer Vision library written in C and Monitor R Pi Mouse C++ compatible with Linux. The purpose of this library is that it provides a simple computer vision Fig.1. Block Diagram infrastructure to prototype quickly for sophisticated applications. It has over 2500 optimized algorithms, III. RASPBERRY PI includes both a set of classical algorithms and the state of the art algorithms in Computer Vision, which is used RPI [5] Model B was utilized in the researcher's project for image processing. The library is used extensively by and it has 512MHz SDRAM, and 700MHz CPU which companies like Google, Yahoo, Microsoft, Intel, IBM, allows a typical computing environment. The external Sony, Honda, Toyota, and startups area as Applied ports of RPI being used in this research are the GPIO Minds, Video Surf and Zeitera, and research groups and port, audio port and Ethernet port. GPIO and audio ports government. It provides better portability. Open Source are used for alarming system and Ethernet port was used Computer Vision Library, Open CV for short, is a cross- to connect RPI to the monitoring device or to the platform library computer vision based on open source networking device. Shown in Figure 2 is the picture of distribution. It can run on Linux, Windows and Mac OS RPI. operating system. It's lightweight and efficient-makes up of a series of C function and a small amount of C + + class, at the same time provides the Python, Ruby, MATLAB language interface. V. PYTHON Python is a high-level, interpreted, interactive and object-oriented scripting language. Python is designed to be highly readable. It uses English keywords frequently where as other languages use punctuation, and it has fewer syntactical constructions than other languages. Python is interpreted: Python is processed at Fig. 2. Raspberry Pi runtime by the interpreter. You do not need to The proposed system uses Raspberry Pi Model B+ compile your program before executing it. This is single board computer and offers these key features: similar to PERL and PHP. • Broadcom BCM2835 SoC processor with 700 Python is Interactive: You can actually sit at a MHz ARM1176JZF-S cores Python prompt and interact with the interpreter directly to write your programs. • 512MB RAM Python is Object-Oriented: Python supports • Video core 4 GPU supports up to 1920 x1200 Object-Oriented style or technique of programming resolution that encapsulates code within objects. • 5Mpix Camera module capable of full HD video @ Python is a Beginner's Language: Python is a great 30fps language for the beginner-level programmers and • Micro SD card slot, 10/100Mbps Ethernet port, 4 x supports the development of a wide range of USB applications from simple text processing to WWW browsers to games. • 2.0 ports, HDMI, audio/video jack, GPIO header, micro USB power port, DSI and CSI ports VI. FACE DETECTION • Dual step-down (buck) power supply for 3.3V and Face detection [4] is a computer technology being used 1.8V in a variety of applications that identifies human faces in During initial setup Raspberry Pi was configured as a digital images. Face detection also refers to the miniature desktop with USB configured camera module psychological process by which humans locate and and an external monitor or mobile for viewing the attend to faces in a visual scene. captured video. The Raspberry Pi runs Raspbian OS and Face detection can be regarded as a specific case of is programmed using GNU Octave and Python, which is object class detection. In object-class detection, the task an open source. The Dynamic host Protocol is obtained is to find the locations and sizes of all objects in an for Raspberry Pi, addressed IP is fetched. After image that belong to a given class. Examples include obtaining this the system can be configured and upper torsos, pedestrians, and cars. Face-detection controlled remotely. algorithms focus on the detection of frontal human _______________________________________________________________________________________________ ISSN (PRINT) : 2320 – 8945, Volume -4, Issue -3, 2016 20 ITSI Transactions on Electrical and Electronics Engineering (ITSI-TEEE) _______________________________________________________________________________________________