Image acquisition, recovery and application based on embedded Linux

Publisher:breakthrough2Latest update time:2012-11-26 Source: 21IC Keywords:Linux Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1. Introduction

With the advent of the post-PC era and the booming development of embedded systems, the use of embedded systems to achieve remote data acquisition has become a trend in social demand. This paper uses embedded systems to collect image data to achieve remote measurement of processed parts, replacing traditional manual inspection. Its characteristics are: networking, high accuracy, and saving manpower and material resources.

2. System hardware and software platform

Due to the limited resources of embedded devices, the software part of the embedded system development needs to be implemented on the host platform, and the host resources are used to compile the software that can be run on the target platform. The host platform of this system is Redhat 9.0, cross-compilation environment: ARM-Linux-Gcc; target platform: UBOOT 1.1, Linux 2.4.18 and YAFFS root file system.

The processor of the system hardware platform is Samsung's S3C2410 processor with an integrated ARM920T core. The processor is rich in resources, with 16KB instruction cache and 16KB data cache, MMU virtual memory manager, LCD controller, support for NAND Flash system boot, RAM controller, 3-channel UART, 4-channel DMA, 4-channel PWM timer, RTC, parallel I/O port, 8-channel 10-bit ADC, touch screen interface, IIC interface, IIS interface, 2 USB interface controllers, 2-channel SPI and internal PLL clock multiplier, with a main frequency of up to 203MHz. In addition, based on the rich resources of the processor, relevant configuration and expansion are also carried out, with 64MB Flash and 64MB SDRAM configured, and two HOST USB interfaces are introduced. The camera Webeye V 2000 with a USB port is connected to the USB interface. Two software modules, image acquisition and image recovery, are established on the embedded Linux operating system. The development board has a CS8900A-CQ3 chip with 10~100M adaptive network communication capability. It can realize the remote transmission of image data. The hardware overview of the whole system is shown in Figure 1:


Figure 1 System hardware structure diagram

3. Collection of RGB data stream

The Webeye V 2000 camera has ov7620, ov511 and a storage chip inside. Since the driver of the ov511 chip is embedded in the Linux operating system, the ov511 driver needs to be loaded when compiling the Linux operating system. The main steps are:

①(*) Select Multimedia device->Video for linux. Load the video4linux module, which provides a programming interface;

② Under USB Support->Catalog (*), select Support for USB and USB Camera OV511 Support. Driver support for USB digital cameras using the OV511 interface chip has been added.

Drive the camera on the embedded Linux operating system platform, and control the camera parameters, image format, window size, etc. through the Video4Linux interface. Video4Linux is the kernel driver for video devices in Linux. It provides a series of interface functions for application programming for video devices. The USB port camera driver needs to provide the implementation of basic I/O operation interface functions open, read, write, and close. The interrupt processing implementation, memory mapping function, and the implementation of the control interface function ioctl for the I/O channel are defined in struct file_operations. This system uses memory mapping, namely mmap(), to capture image or video data. The mmap() function call enables processes to share memory by mapping the same ordinary file. The mapped content area is readable and writable and can be shared between different processes without the need for any data copying. [page]


Function, which is used in user programs to control I/O channels. fd represents the device file descriptor, cmd represents the user program's control command for the device, and the ellipsis generally indicates a parameter of type and length, which may also be absent.

4. Image Restoration

The previous section has introduced the system's acquisition of RGB image data streams. In order to satisfy users' viewing of the acquired image data and corresponding tests, it is necessary to convert the RGB stream into a BMP format image that can be browsed under both Linux and Windows systems. BMP format images are divided into two parts: the file description area and the image storage area. The header file information contains two parts: the information area and the palette area. The information area can be further divided into the file information area and the image information area. The key to restoring BMP images is to first manually generate the header file of the BMP file, and then fill the acquired RGB data stream into the data area of ​​the BMP file. The object photographed is a processed circular part, and its processing is checked to see if it is qualified, the center point position, etc. The following will introduce the data structure and header file of the BMP file, and the image recovery is shown in Figure 2:



[page]


5. Image transmission and processing

The system uses the network (FTP) method to read BMP files. The remote terminal establishes an FTP server to establish a connection between the system and the FTP server, and places the BMP file on the server. The specific command is: FTP open server IP address Put command to place the BMP file on the FTP server. The terminal can obtain the BMP file on the FTP server through the network. The Matlab7.1 application is installed on the terminal, and Matlab7.1 is used for image processing to obtain the median filtering, edge detection, binarization and center point coordinates of the processed parts to check whether the parts are qualified. The specific commands and results are as follows:


The following is the command to extract the center point coordinates:



6. Conclusion

This paper implements image acquisition software and hardware based on embedded platform, conversion of RGB image data stream to BMP file and image processing (median filtering, edge detection, binarization and center point coordinates). Experimental results show that networked detection of processed parts is highly accurate and saves manpower and material resources. It lays a certain foundation for completing robot positioning in the future.


The author's innovation: The embedded Linux platform integrates image acquisition software and hardware, RGB stream and BMP conversion, and the remote terminal processes the part image, realizing a remote detection system with the characteristics of miniaturization, graphics, convenience and economy.

References:

[1]. ARM920T datasheet http://www.dzsc.com/datasheet/ARM920T+_139814.html.
[2]. CS8900A-CQ3 datasheet http://www.dzsc.com/datasheet/CS8900A-CQ3+_593569. html.
[3]. 100M datasheet http://www.dzsc.com/datasheet/100M+_2509927.html.
[4]. ov7620 datasheet http://www.dzsc.com/datasheet/ov7620_525855.html.

Keywords:Linux Reference address:Image acquisition, recovery and application based on embedded Linux

Previous article:Design of sensor network gateway based on Linux
Next article:Design of PCB drilling machine controller based on I²C and dual ARM

Recommended ReadingLatest update time:2024-11-16 21:35

Linux2.6.32.2 ported to ARM platform (mini2440)
1. Specify cross-compilation variables That is, modify the top-level Makefile file, open it with vim, and modify it as follows: Original  export KBUILD_BUILDHOST := $(SUBARCH)    ARCH ?= $(SUBARCH)  CROSS_COMPILE ?=  Change to  export KBUILD_BUILDHOST := $(SUBARCH)  ARCH ?= arm //Specify the target platform as
[Microcontroller]
Linux platform device driver - button device driver
A previous blog briefly introduced the platform device driver model (http://www.cnblogs.com/ape-ming/p/5107641.html). Now, based on the template listed in that blog, we will modify the example in the previous blog (http://www.cnblogs.com/ape-ming/p/5110996.html) into the platform device driver model. 1. P
[Microcontroller]
Linux2.6.32 kernel porting s3c2440 - DM9000 network card driver porting
reference: http://caiming1987612.blog.163.com/blog/static/118556676200961752714307/ http://blog.chinaunix.net/u1/34474/showart_401078.html http://hi.baidu.com/%D3%F3%C4%E0%C4%EA%B8%E2/blog/item/6256fea7bfceac98d0435819.html Timing diagram and pin connection: http://blog.chinaunix.net/u1/57901/sho
[Microcontroller]
skyeye simulates s3c2410 program under linux
On the basis of the previous ones, let’s start using the resources in skyeye’s own testsuites to run our own programs. 1. First download skyeye-1.2.5_REL.tar.gz, and then unzip the file 2. Use skyeye to simulate the board s3c2410 to run a certain linux First go to the unzipped directory, and then cd ./linux/s3c2410/s3
[Microcontroller]
S3C2410 clock and timer
Connect an external crystal oscillator and then generate a clock source through the internal circuit Directly use the external clock source Select by setting the pin   FCLK  cpu HCLK  AHB PCLK  APB   PLL increases the system clock speed through the clock control logic PLL   UPLL  USB MPLL  FCLK H
[Microcontroller]
S3C2410 DMA driver development under Linux
There are numerous examples of general driver development under LINUX on the Internet, but perhaps because they are simple, there are very few introductions to DMA drivers. Recently, Zhaoyang spent several days developing a driver for DMA communication of a certain device under Linux on the S3C2410 processor due to wor
[Microcontroller]
Changes in power management methods in the new version of Linux system device architecture of linux driver power management
Changes in power management methods in the new version of Linux system device architecture based on linux-2.6.32   1. Power management part of each data structure of the device model   The Linux device model is jointly described through many structures, such as struct device, struct device_type, struct class, struct d
[Microcontroller]
Design and implementation of a general industrial control platform based on ARM and Linux
With the advancement of industrial control technology and the intensification of market competition, developers usually need to design a measurement and control system that meets user requirements in the shortest possible time. In view of the characteristics of embedded systems, this paper uses the cost-effective 32
[Microcontroller]
Design and implementation of a general industrial control platform based on ARM and Linux
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号