Moving object detection system based on embedded Linux

Publisher:丝路老君Latest update time:2013-12-27 Source: 21icKeywords:Linux Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

With the development of society and the advancement of science and technology, people's security awareness is getting stronger and stronger, and the increasing maturity of computer network technology, communication technology, and digital video coding technology has made computer-based multimedia video surveillance systems possible. However, traditional video surveillance systems are very complex, have high power consumption and cost, and require on-duty monitoring, so they cannot be applied to places such as homes or private offices. For this reason, this paper designs a system with ARM11 as the core processor and embedded Linux as the operating system. On the basis of traditional video surveillance, the target detection algorithm is added and combined with the GSM module to achieve the purpose of unattended operation.

1 System Overall Design
The moving target detection system adopts the S/B (server/browser) working mode, which is generally divided into server monitoring module, SMS notification module (GSM) and customer viewing module. The server monitoring module adopts Samsung's ARM11 (S3C6410) microprocessor, open source Linux operating system, and the GSM module adopts Q2403A chip. When the monitored picture changes, that is, when a moving target is detected, the server will store the changed image in the format of a picture and send it to the client. At the same time, 2403A will notify the client by SMS, and the client can view the image change results through the IE browser. The overall design of the system is shown in Figure 1.

c.JPG



2 Hardware Structure
This paper adopts the Tiny6410 development board of Guangzhou Friendly Arm Company. Tiny6410 is an embedded board with ARM11 (Samsung S3C6410) as the main processor. The CPU is designed based on the ARM11-76JZF-S core and integrates a powerful multimedia processing unit. The hardware architecture is shown in Figure 2. The Q2403A of the SMS notification module is a GSM GPRS module launched by WAVECOM. It is small in size and light in weight. It mainly consists of a RF antenna, internal FLASH, SRAM and GSM baseband processor, matching power supply and a 40-pin ZIF socket. The GSM baseband processor is the core component, which is equivalent to a coprocessor to process AT commands sent by the external system through the serial port.

3 Software Platform
The system software platform is based on the Linux operating system. First, a cross-compilation environment is established on the host machine, and the cross-compiler arm-Linux-gcc is installed. Secondly, complete the transplantation and compilation of U-Boot and Linux 2.6.33 kernel, and build a root file system based on busy-box1.13.3. Due to the limitations of embedded server resources, including memory size, CPU
processing power, etc. Therefore, it is necessary to tailor the kernel during the design process to improve system performance while reducing system resource usage. Write motion detection applications and SMS alarm programs on the tailored Linux operating system.
3.1 Moving target detection algorithm under embedded Linux
At present, there are two main research directions for the detection of moving objects and the measurement of motion parameters, namely: using artificial neural networks and using image processing methods. Most experts and scholars focus on using image processing methods to detect and track moving targets. The current more effective methods for image moving target detection are mainly optical flow method and differential image method. Generally speaking, the time overhead of optical flow is very large, and its real-time and practicality are limited. On the contrary, the image differential method is relatively simple and easy to implement. The image differential method can be divided into two categories: background image differential method and inter-frame differential method. The background image differential method is the most direct and simplest method in the traditional moving target detection method. The current frame of the sequence image is subtracted from the background image. Since there are differences in grayscale or color between the moving object and the background, the value of each pixel in the result obtained after subtraction is compared with a pre-set threshold. If the value of this pixel is greater than the set threshold, it is determined that there is a moving object in the monitored scene, and the moving target is obtained. The principle of the background image difference method is simple in design, but it is also greatly affected by changes in external conditions such as light and weather. The inter-frame difference method is a method that obtains the contour of a moving target by performing a difference operation on two adjacent frames in a video image sequence. It can be well applied to situations where there are multiple moving targets and camera movement. When abnormal object movement occurs in the monitoring scene, there will be a more obvious difference between frames. The two frames are subtracted to obtain the absolute value of the brightness of the two frames. It is determined whether it is greater than the threshold to analyze the motion characteristics of the video or image sequence and determine whether there is object movement in the image sequence. The frame-by-frame difference of the image sequence is equivalent to high-pass filtering of the image sequence in the time domain. The inter-frame difference method is not very sensitive to scene changes such as light, can adapt to various dynamic environments, and has good stability. Its disadvantages are: it cannot extract the complete area of ​​the object, but can only extract the boundary. When the object is almost completely overlapped in the previous and next frames, the moving object cannot be detected. In view of the advantages and disadvantages of the background difference method and the inter-frame difference method, the two methods are combined to make their advantages complement each other. In the video image sequence, the existing background difference method and inter-frame difference method are used as inspiration, and the difference images of two consecutive frames in the dynamic image and the background difference image are directly operated, and then the result is binarized to obtain the motion result. [page]

3.2 Algorithm Description
The algorithm description is as follows:
(1) Perform 3x3 median filter preprocessing on the sequence image to remove random noise of the image. Reduce the complexity of subsequent operations and overcome the interference of noise on the image processing results;
(2) Select the background image Bk(x, y) from the video image sequence so that it only contains a fixed background image;
(3) Select two consecutive frames of images in the video image sequence, of which the previous frame image Pk-1(x, y);
(4) Calculate the difference between the current frame and the background frame to get FD(x, y), and extract the complete target from the image;
(5) Calculate the difference between the current frame and the previous frame to get FD(x, y), and get the change of the target;
(6) Find the intersection of the frame difference FD(x, y) and FG(x, y) to get a rough moving area image of the moving target;
(7) Mathematical morphological operations make the moving area closed, continuous and complete, and remove the noise in the background.
Where:
d.JPG
T is the threshold. For a given video sequence, assuming that there is no motion at pixel k, its frame difference also obeys the Gauss distribution N(O, σ2) with a mean of 0 and a variance of σ2:
e.JPG
Where: H0 represents the no motion assumption; σ2 is the statistical variance of the frame difference, which is generally considered to be equal to twice the variance of the camera noise. According to the "3σ" rule of probability statistics hypothesis testing and the principle that "the correct threshold T should be able to eliminate most of the noise". The threshold T tested by the experiment can be selected between 5 and 15 in the application context of this system. Based on the above algorithm, the specific implementation of the system is shown in Figure 3.

a.JPG


3.3 SMS notification of GSM module
For GSM module, all operations are implemented through AT commands (AT commands are a set of commands issued by the terminal or computer connected to MODEM, starting with "AT" (except two immediate execution commands) and ending with carriage return). When programming, first send the AT command as data to the GSM module through the data serial port. The GSM module interprets the received data as AL commands and then executes the corresponding operation according to the command. The specific operations are: including the header file required for serial port operation, opening the serial port. Under Linux, the serial port related files are located under /dev. The serial port is opened by using the standard file open function: fd=open("/dev/ttySO", O_RDWR); setting the serial port. The most basic settings of the serial port include baud rate, check bit and stop bit settings. The settings of the serial port are mainly to set the values ​​of each member of the struct termios structure; set the SMS sending format (O_PDU, 1_text); send short messages. For example, if the content of the short message is hello, the AT command should be AT+CMGS="139#####2312">hello^z(^z means ctrl+z); close the serial port close(fd).
3.4 Image transmission
There are many ways to implement streaming media network transmission. HyperText Transfer Protocol (HTTP) is a transmission protocol used to transmit hypertext from the WWW server to the local browser. It belongs to the application communication layer protocol between the client browser and the Web server. It can make the browser more efficient and reduce network transmission. The HTTP protocol adopts the request/response mode. The specific implementation process is: an embedded Web server is implanted in the embedded development board S3C6410. After completing the configuration, the user first enters the URL address in the address bar. At this time, the client browser opens a Socket file, indicating that the connection is successfully established. Through the Socket, the client browser IE submits a request to the Web server. After receiving the request, the Web server processes the request and sends the result back to the client browser IE through HTTP. When the browser IE establishes a connection with the server, the images stored on the development board are packaged and copied to the main directory of the Web server through system ("tar") and system ("cp"), and the Hypertext Marked Language (HTML) in the main directory is written. It is a simple markup language used to create hypertext documents. The Hypertext Transfer Protocol specifies the rules and operations that the browser follows when running HTML documents. The most advanced browser in the HTML file can access the images stored in the main directory of the server. The specific format is: hyperlink name , the tag indicates the beginning of a link, and indicates the end of a link.

4 Experimental Results
The whole system was tested in a simulated environment. The system was started. After the system was stable, an object in the camera's field of view was moved to change the monitored image. At this time, the system would send a text message to the user. When the user received the text message, he opened the browser, entered the URL in the address bar, downloaded the image stored in the main directory of the Web server, and then he could view the experimental results. The displayed image result is shown in Figure 4. The system would frame the moving object in the camera's field of view and record the time when the moving object was found.

b.JPG

5 Conclusion
This paper designs a motion detection system with ARM11 as the core chip, embedded Linux as the operating system, and a combination of background difference method and frame difference method as the core algorithm. Combined with the GSM module, it has achieved the purpose of unattended monitoring. The experimental results have achieved the expected purpose. The system has the characteristics of small size, low power consumption, low cost, convenient and flexible use, and expandable functions. It can be used in home environments or private offices and other places. It has a good market prospect.

Keywords:Linux Reference address:Moving object detection system based on embedded Linux

Previous article:Design of wireless multi-band WSN gateway based on Linux kernel
Next article:Research and Implementation of Linux System Transplantation Based on ARM

Latest Microcontroller Articles
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号