Thursday, December 23, 2010

Linux-based design of embedded network camera (1)

This embedded network camera with high-performance ARM9 chip microprocessor, built the embedded Web server.

Through the embedded multi-task operating system acquisition camera video data; acquisition of digital video signals through the MJPEG compression algorithm, and then through the internal bus to the built-in Web Server; users can direct a browser to view Web camera image on the server; through the common gateway interface, CGI, authorized users can also control the camera, pan/tilt and lens movements or directly through the Web page to configure the system.

Introduction

Coaxial cable-based video surveillance system complex structures, poor stability, reliability and low and expensive, thus appeared embedded network camera, remote Web video surveillance system.

This embedded webcam, high-performance ARM9 chip for microprocessors, built the embedded Web server — Boa, through embedded multi-task operating system — Linux acquisition camera video data; camera acquisition of digital video signals through the MJPEG compression algorithm, the compressed video stream and then through the internal bus to the built-in Web server; in a Web page embedding the image viewer, users can directly through your browser to view Web camera image on the server; through the common gateway interface, CGI, authorized users can also control the camera, pan/tilt and lens movements or directly through the Web implementation to configure the system.

1 embedded network camera systems principle and composition

Embedded webcam basic principle: in embedded Linux operating system, built-in Web server Boa, camcorder video signal and digital, MJPEG compressed and transmitted to the built-in Web server, Web page video information is published to the Internet.

Because the embedded IP camera is a video capture terminals and Web server integration, therefore, the user can directly through your browser to watch the cameras of video image, the aim of reaching remote monitoring.

The entire system consists of video acquisition module, video compression module, Web server, the common gateway interface, Web pages, and other five parts.

Its hardware structure as shown in Figure 1:

  

  

Figure 1 embedded webcams hardware charts

Video acquisition module includes the Central S3C2410X control and data processing centre, as well as USB Camera data acquisition unit.

Central control and data processing Center main complete video acquisition Terminal control and video image compression; Web server to complete the basic server functionality, is responsible for responding to http requests with video capture, compression module complete image information publishing; common gateway interface-CGI, you can according to user-entered data information, control cameras, PTZ and camera motion or directly through the Web implementation to configure the system.

Embedded microprocessor is embedded system "hard core".

Microprocessor select the entire embedded system cost and performance have a decisive impact. At present, the more popular processor: Power PC and Intel, MIPS, ARM, etc. ARM (Advanced RISC Machines) Corporation is a global leader in embedded microprocessor IP (Intellectual Property) core provider, it has designed a series of high-performance, low power, low cost and high reliability of RISC processor core and peripheral components and system-on-chip solutions. Currently, ARM Series microprocessor core widely portable communications devices, hand-held terminals, multimedia digital consumer products, embedded systems solutions. This design choice to ARM920T core S3C2410X 32-bit microprocessors, the processors with integrated LCD controller, USB Host, USB Slave, NAND controller, interrupt controller, power control, UART, SPI, MMC, SDI/IIS, GPIO, RTC, TIMER/PWM, ADC and a wealth of resources.

The operating system is an embedded system of "soft".

Early embedded system, because at that time not yet operating system concepts, the primary function of the system is implemented in Assembly language, its compatibility, interoperability and extensibility are very poor. As hardware performance continues to improve, in embedded system using a general-purpose operating system has become a reality. In embedded system into the operating system, use software engineering guide embedded system development, its development efficiency and resource reusable rate will be greatly improved. Currently more popular there: VxWorks embedded operating system, Neculeus, WindowsCE, Linux, etc. Compared to other commercial operating systems, Linux this open source network operating system has the following unique advantages:

(1) prices are low.

To ensure that product performance, price will always be system design must consider one of the factors of reuse. Due to the open source community Linux source, relative to other commercial operating systems, its price is almost zero.

(2) documents.

The world of Linux programmers is a technology consultant, anyone can get the open source community whose system documentation and help.

(3) a network of good performance.

And Unix Linux supports a variety of the same network protocol, and the ability to make long-term stable operation of the system.

(4) knowledge creation.

In domestic operating systems, embedded operating system is supposed to be the only operating system and catching up with foreign peers. But Linux is the operating system leader, anyone can follow the GPL rules publication contains its own intellectual property products, you can efficiently knowledge and innovation, small walkDetours.

To this end, the design of high performance ARM9 chip and embedded Linux operating system.

2 video acquisition module design and implementation

Video acquisition module is embedded network camera and one of the core module.

It uses embedded Linux operating system scheduling V4L (video4linux) and imaging device driver to do video capture. V4L is Linux imaging system and the embedded image is the Linux kernel, based on the support of imaging equipment in a set of APIs that tie in with the appropriate video capture card and video capture card driver, you can implement image acquisition V4L, AM/FM radio, video CODEC, channel switching and other features. At present, the main application in image V4L streaming system and the embedded image system, its fairly wide range of applications, such as: distance learning, telemedicine, video conferencing, video surveillance, video phone, etc. V4L 2-tier architecture, top for V4L drivers, the lower is the imaging device driver.

In the Linux operating system, the external device as device files to process, therefore, on an external equipment operation is turned into actions on the device file.

Video files are located in the/dev/directory, typically as video0. When the camera via a USB interface to connect to the video Terminal, in a program called V4L APIs on the device file video0 read for camera video data acquisition. The main process is as follows:

1) open device file: int v4l_open (char * dev, v4l_device * vd) {} open image source device files;

Picture 2) initialization: int v4l_get_picture (v4l_device * vd) {} gets image information entered;

3) initialize channel: int v4l_get_channels (v4l_device * vd) {} Gets the information for each channel;

Set on channel 4) norm: int v4l_set_norm (v4l_device * vd, int norm) {} to all channel settings norm;

5) device address mapping: v4l_mmap_init (v4l_device * vd) {} return the address of the store image data;

6) initializes the mmap buffer: int v4l_grab_init (v4l_device * vd, int width, int height) {};

7) video capture sync: int v4l_grab_sync (v4l_device * vd) {};

8) video capture: int device_grab_frame () {}.

This set of instructions that can be camera video data collection into memory.

Acquisition to the memory of the video data can be saved with the file, or it can be compressed by the network is published to the Internet. This design uses the latter approach, namely: the acquisition of video data generated by the MJPEG compression, video streaming and published to the Internet.

3 video compression module design

Since the camera acquisition to the amount of video data, if handled it directly into the video that will give the video processing and network data transmission a significant burden.

Therefore, this design uses high-performance ARM9 processor on the collected data for MJPEG compression.

JPEG (Joint Photographic Experts Group)-Joint Photographic Experts Group short name, its main objective is to study with continuous-tone images (including grayscale and color images) compression algorithm, which is the basis for MJPEG.

JPEG algorithm identified as static digital image compression by international standards, not only for still image compression, but also applies to television image sequence of frames in image compression. JPEG compression is a full color image standard, the main process including: the colour model conversions, discrete cosine-DCT, rearrange DCT results, quantitative, encoding, etc.

MJPEG is the abbreviation of Motion JPEG, JPEG is dynamic.

It will be combined with animation, according to the JPEG 25 frames/sec speed using the JPEG algorithm pressure [1] [2]

No comments:

Post a Comment