Design of Embedded Video Surveillance System

Publisher:pengbinyyyLatest update time:2013-02-19 Source: dzsc Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

    Introduction
  
    Compared with traditional video surveillance systems, embedded video surveillance systems have the advantages of small size, strong real-time performance, high cost performance, high reliability, convenient networking, and remote monitoring, so they are more suitable for industrial control, banking, and government security systems. The system provided in this article uses s3C2440, which has a higher cost performance, and builds a network based on B/S architecture for data transmission. Users can access it directly through a browser. Compared with C/S architecture, this system is more in line with customers' requirements for networking.

    1 Embedded Video Surveillance System Solution

    The modular design method is adopted to divide the system into three functional modules, namely: front-end video acquisition and alarm module, embedded Web server module, and back-end user monitoring module. The front-end video acquisition and alarm module is responsible for video acquisition, storage, processing and transmission, and real-time monitoring of the on-site ambient temperature to provide fire risk warning. The embedded Web server module is responsible for processing requests from the monitoring end and providing real-time monitoring data for users; the back-end user monitoring module realizes real-time remote monitoring and interacts with the web server. The entire system structure block diagram is shown in Figure 1.

    2 Implementation of the front-end part of the system

    2.1 Construction of front-end software platform

    First, establish a cross-development environment on the PC. Then port the Boot-loader. This system uses U-Boot-1.16, which supports 10 processors and 214 development boards. However, it does not directly support the S3C2440 development board selected by this system. However, since it supports the S3C24lo development board, only a small amount of code modification is required to support this system. The main work includes modifying the SDRAM configuration; frequency division ratio (FCLK, HCLK, PCLK); system clock acquisition function (get'PCLK(), get_HCLK(), get-PLLCLK(), etc.); supporting NAND Flash and yaffs file system burning, etc. After completing the porting of the Boot-loader, the Linux kernel can be ported. Its main task is to add the drivers of the hardware related to this system, such as USB, network card, etc., and modify them accordingly to support the S3C2440 platform, and then statically compile them into the kernel. The camera driver of this system is dynamically loaded. When configuring the kernel, you need to select the "L0adable modulesupport" option. Finally, use Busybox to build the root file system.

    To realize the on-site alarm function, the temperature sensor Dsl8820 is used to collect the on-site temperature in real time. The temperature warning value is set to 50℃. When the temperature exceeds the warning value, the buzzer on the front-end machine is immediately driven to remind on-site personnel that the environment is abnormal and there may be a fire.

    2.2 Implementation of front-end video acquisition

    Video04"nux (V4L for short) is the kernel driver for video devices in Ljnux. It provides a series of interface functions for application programming for video devices. This system uses a USB camera to collect video data. First, we need to develop the corresponding driver, that is, to design the program for video image acquisition for the USB camera device /dev/videoo. To complete the USB video data acquisition based on V4L, we must first obtain the device information of the video device, initialize the acquisition window, chroma mode, and frame status, and then we can collect the video image. The video acquisition process is shown in Figure 2.

    After obtaining the device information and setting the camera parameters, data collection can be performed. This system uses mmap() to map the device file to the memory, thereby bypassing the kernel buffer and accelerating the I/O access speed. The specific operations are as follows:

    First, use the ioctl(vide->fd, VIDIocGMBuF, &(vide->videombuf) function to obtain the frame information of the camera storage buffer (where , , id∞ is struct vdIn*), and then modify the settings in , ...

    2.3 Implementation of video stream network transmission

    The network transmission of the video in this system is based on the connection-oriented TCP protocol. TCP/IP protocol data transmission can be divided into three stages: establishing a connection, transmitting data, and disconnecting the connection [6]. First, the server creates a socket through the socket() function, uses the bind() function to bind the created socket to the port, and then calls the listen() function to put the server in a listening state, waiting for the connection request from the client application. The client application uses the TCP service by opening a socket. When the server receives the user's connection request, the server calls the accept() function to establish a connection between the two parties, responds to the client's request, and creates a new thread, which is responsible for sending data to the user.

    3 Design of Embedded Web Server

    At present, the B/S mode network structure has become the most popular application mode because of its advanced development technology, superior manageability and maintainability, and simple and convenient mode. This system adopts this structure, so users can remotely access embedded devices through the embedded Web server and use IE browser to realize remote monitoring of the site.

    Boa is one of the web servers supported by Linux. It is a single-task http server with the advantages of simple code structure, support for dynamic CGI, "p service, and open source code. Therefore, it is particularly suitable for use as a web server in embedded systems [n]. Download its source code Boa-o.94.13.tar.gz from the Internet. Its transplantation on this system mainly includes two parts: file modification under src and config file modification.

    Modification of boa-o.94.13/src file: First, set the compiler variables in boa-o.94/Makefile file: CC=/arm-1inux-gcc, CPP=/arnl_linux-gcc_E; and modify the compilation mode: LDFLAGS=-g-static. Then find the macro definition #defineTIMEZONE_OFFSET(foo)foo##->tm-gmtoff in the file compat.h and modify it to #define TIMEZONE_OFFSET(foo)f00->tm-gmtoff. Then, execute make under boa-o.94/src/ to compile, and the executable program obtained is boa, which can be downloaded to the target machine using the serial port to complete the transplantation.

    boa-0.94/boa.conf file. Since boa must be started as root, change User nobody to User mot and Groupnogroup to Group r00t, that is, grant administrator privileges. Change the server name, that is, change ServerName www.your.org.here to serverName sm2440. Change DocumentRoot/var/www to
DocumentRoot/home/web, that is, set the main directory of HTML documents to /home/web. Finally, specify the location of nime.types files as Mime-Types/etc/milne.types. Other settings can be used by default. Finally, copy boa-0.94/boa.conf to the /etc/boa/directory. After configuring the Web server, you can access it remotely.

    4 Implementing the client video data receiving application

    The web client of this system uses Java Applet to provide users with a management and display interface. The Java Applet program is embedded in the HTML document and can be displayed and run in a standard browser. This method does not require special development software and network interfaces, and is an ideal choice for web-based network applications. This system needs to embed a player program in the display page to play the surveillance video obtained by the front end in real time. Among them, video data reception is the key to the client software design, and its implementation is as follows:

    First, establish network communication, that is, create a socket, input and output streams. Then allocate a receive buffer, that is: byte[]buffer—new byte[5 12*1024];

    Then read the header information of the image and confirm the correctness of the image data, that is: int n = in. r∞d(bu“er, O, HDRLEN);

    HDRLEN is the length of the header, which is set to 50 B. By judging the agreed characters contained in the header information, it is determined whether to receive further image data or re-receive the header information. If the image header information can be read correctly, it proves that the video data stream received this time is correct. Then the image data after the header information can be written into the buffer for playback and display:
n=HDRLEN;

    r—in. read(buffer, n, buffer.length-n); Since the static image data received in the video stream buffer contains the image header information, it is necessary to copy the image data to another buffer to obtain separate image data:

    byte[]buffeLimage=new byte[n];.
    for(int i一0;i    buffer.image[i]=buffer[i+HDRLEN]I

    Then read the human data from the buffer buffer-image:

    BufferedImage imagedata=
    Imagel0.read(new ByteArrayInputStream(buffer—image)),
    ImageIcon image—icon=new Image Icon(imageedate m-label.set Icon(image—icon),

    The system continuously reads and displays image data through a loop. Users can then obtain real-time video surveillance data collected by the front end from the main page. The picture is smooth, without obvious delay or stagnation, thus achieving the monitoring purpose.

    5 Conclusion

    At present, embedded products are in the ascendant. The embedded video surveillance system design proposed in this paper combines the cost-effective ARM processor with the open source operating system Linux. It has many advantages such as high stability, low cost, and low power consumption. It is based on the B/S mode and directly connected to the Ethernet, which saves a lot of cable expenses. It is plug-and-play and realizes cross-platform monitoring, which provides great convenience for users. This system well embodies the advantages of intelligence, integration, networking, and cross-platform. It can be widely used in smart homes, smart transportation, factories and other manufacturing units and places that require real-time monitoring.

Reference address:Design of Embedded Video Surveillance System

Previous article:Design of Touch Screen Based on S3C2410 Microprocessor
Next article:Design and implementation of Bragg fiber grating sensor signal processing system based on S3C44B0

Recommended ReadingLatest update time:2024-11-16 19:33

Detailed explanation of S3C2440 clock
C code about clock in ADS1.2: ChangeMPllValue((mpll_val>>12)&0xff, (mpll_val>>4)&0x3f, mpll_val&3); ChangeClockDivider(key, 12);     1) The relationship between FLCK, HCLK and PCLK           S3C2440 has three clocks: FLCK, HCLK and PCLK. The official manual of s3C2440 says P7-8: FCLK is used by ARM920T, HCLK is
[Microcontroller]
【s3c2440】Lesson 3: Code Relocation
What is relocation? Simply put, it copies the program from one location in memory to another. The importance of relocation If s3c2440 uses Nand Flash to boot, the CPU will copy the first 4k of Nand Flash to the SRAM inside the s3c2440 soc. If the program does not have relocation code, only the first 4k of Nand Flash
[Microcontroller]
【s3c2440】Lesson 3: Code Relocation
uboot-2011.12 ported to S3C2440 (Part 3) - Hardware initialization: watchdog, interrupt, clock
/* * turn off dog, see C18P3 */ ldr r0, =pWTCON mov r1, #0x0 str r1,   /* * C14 * mask all IRQs by setting all bits in the INTMR - default */ mov r1, #0xffffffff ldr r0, =INTMSK str r1, ldr r1, =0x7fff ldr r0, =INTSUBMSK str r1,   /* * FCLK:HCLK:PCLK = 1:4:8 * because
[Microcontroller]
Difference between NOR flash boot and NAND flash boot on s3c2440
1) Interface difference: NOR FLASH address line and data line are separated, and data comes out when address and control signal are received. NAND Flash address line and data line are together, and need to be controlled by program to output data. In layman's terms, it is not enough to just give address, you need to gi
[Microcontroller]
S3C2440 bare metal --- touch screen _ calibration principle
The so-called calibration is to find a formula to convert the voltage value into the coordinate value. Our touch screen is covered on the LCD. When we get the voltage value of the output point, we can get the coordinates of the LCD through the proportional formula. But in reality we don't choose the boundary points,
[Microcontroller]
S3C2440 bare metal --- touch screen _ calibration principle
12864 LCD driver based on s3c2440
12864 is the abbreviation of the dot matrix number of 128*64 dot matrix LCD module, which is a commonly used abbreviation in the industry. 1. Overview of LCD Display Module 12864A-1 Chinese character graphic dot matrix LCD display module, can display Chinese characters and graphics, built-in 8192 Chinese characters
[Microcontroller]
S3C2440 development tool realview MDK4.22 library usage
1. Forced linking with the C library If you write a C program, it will be linked to the C library, even if you do not use the C library functions directly. This is because the compiler may implicitly generate calls to C library functions in order to improve the program. Even if your program does not have a main() fu
[Microcontroller]
S3C2440 development tool realview MDK4.22 library usage
Learning and using the S3C2440 development board (I) ---- serial port installation
Serial port connection 1. There is a USB to UART chip PL2303HX on the board, which can be connected to the laptop through the MINI USB port using a USB to MINI USB cable. 2. Install the USB to serial port driver PL2303_Prolific_DriverInstaller_v1.5.0.exe under Windows. 3. Download the serial port tool software S
[Microcontroller]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号