High-speed image acquisition technology based on USB camera

Publisher:CrystalSparkleLatest update time:2013-05-18 Source: 现代电子技术 Keywords:USB camera Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
0 Introduction
   
Image acquisition system, modern computer systems widely use bus structure. With the application of GUI (Graphical User Interface), multimedia and other technologies on PC, the traditional PC bus can no longer meet the requirements of system work. The emergence of USB universal serial bus has made a qualitative leap in image acquisition technology. Faster transmission and response speed, convenient image acquisition system installation process and lower energy consumption have made image acquisition technology widely used in life. USB camera plays the role of the machine's eye. Not only that, the development of computers has given new vitality to image acquisition technology-image acquisition, processing and recognition functions. This function makes many mechanized products more fully automated. The gradual maturity of image system technology makes it easier for us to obtain external information and add it to other intelligent program control systems. However, the low-cost USB simple and portable image processing program that can perform efficient image processing and transmission is still worth studying and discussing.

1 Research direction and goal
   
USB2.0 is increasingly used in data acquisition systems due to its advantages such as ease of use, easy expansion and fast speed. In the process of video signal acquisition, the amount of signal data is relatively large, and the real-time requirements are also relatively high. This project designed a video data acquisition system based on USB2.0 bus. It used Logitech's QuickCam 5000 camera to communicate with the GUI of MATLAB program, and wrote code instructions on the PC to better control the acquisition and processing of images. This project studied the high-speed image acquisition system based on USB camera, and analyzed the design ideas of the acquisition system in detail: with high-speed image acquisition, optimized processing and high-speed transmission as the main direction, configured MATLAB program to obtain the best image acquisition and processing effect, and assisted the computer in subsequent image processing.
    This project mainly carried out the following research work around the above aspects:
    (1) High-speed image acquisition. Using the programming method of GUI in MATLAB, the network camera can realize the image acquisition of high-speed video data.
    (2) Image storage. The function of storing USB bus data on PC is realized, and the data is stored in the form of binary files on the hard disk of PC.

2 Construction of high-speed image acquisition system
   
This system is divided into two modules: image acquisition preprocessing and image histogram equalization. The goal is to select suitable images for processing and analysis, filter images with substandard resolution and perform preliminary optimization of images. Its essence is to use the method of digital image processing, perform the evaluation function of discrete cosine transform in MATLAB and perform image optimization by histogram equalization. The image processing flow of this article is:

a.JPG



3 Specific application characteristics
3.1 USB characteristics
   
Compared with the old PC interface, USB has the following characteristics:
    (1) Low cost. The design function of USB is very powerful, but the components are very cheap, which is suitable for small equipment image acquisition and processing.
    (2) Plug and play. After loading the driver on the device to be connected, it can be initialized and start working in a few seconds, and it supports hot plugging.
    (3) Small size. The design of the USB interface takes up less space, and only one USB data cable is needed to meet the needs of bidirectional data transmission and power supply. The product size is further reduced.
3.2 Evaluation function based on discrete cosine transform (DCT)
    b.JPG
    DCT transform has a good separation ability for high-frequency components. In the clarity evaluation function, the high-frequency component is separated and retained as the evaluation scale of image clarity. Since the DC component reflects the overall brightness and overall information of the image to a certain extent, the ratio of the high-frequency component to the DC component is used as the relative high-frequency component of the image for judgment. The image corresponding to the maximum value of G is the clearest in the sample image. Using clear pictures for storage and processing can improve the efficiency and accuracy of subsequent programs for image processing. [page]

    Figures 1 and 2 are the effects of using MATLAB to evaluate the DCT function.

c.JPG


3.3 Image contrast and enhancement
   
The basic idea of ​​histogram equalization is to transform the histogram of the original image into a uniformly distributed form, thereby increasing the dynamic range of the pixel grayscale value, thereby achieving the effect of enhancing the overall contrast of the image. Use MATLAB to implement histogram equalization. Suppose the grayscale of the original image at (x, y) is f, and the changed image is g. The method of image enhancement can be expressed as mapping the grayscale f at (x, y) to g. In the grayscale histogram equalization process, the mapping function of the image can be defined as: g = EQ (f). This mapping function EQ (f) must meet two conditions (where L is the grayscale level of the image):
    (1) EQ (f) is a single-valued single-increasing function in the range of 0 ≤ f ≤ L-1. This is to ensure that the enhancement process does not disrupt the grayscale arrangement order of the original image, and the grayscale levels of the original image still maintain the arrangement from black to white (or from white to black) after the transformation.
    (2) For 0≤f≤L-1, 0≤g≤L-1 exists. This condition ensures the consistency of the dynamic range of grayscale values ​​before and after the transformation.
    An RGB image is an M×N×3 array, where each pixel corresponds to the red, green, and blue components of a color image at a specific position. Let a color image be Zrgb, which can be expressed as:
    d.JPG
    Where Zr, Zg, and Zb represent the red component image, green component image, and blue component image, respectively. In fact, each component image can be regarded as a grayscale image.

e.JPG


    program:
    f.JPG

[page]

  g.JPG
    Figures 3 and 4 are the effect diagrams before and after histogram equalization is implemented using MATLAB.

h.JPG



4 Conclusion
    MATLAB is a good programming tool for real-time image acquisition and processing, with powerful matrix operation functions and easy entry. By taking advantage of MATLAB's image processing toolbox in operation and algorithm verification, combined with the fast transmission speed of the USB serial port, the requirements of USB high-speed image acquisition and processing can be met. Image preprocessing can significantly improve the requirements of other image systems for real-time image acquisition. Different USB image acquisition cameras have different data adjustment parameters and driver optimizations for different functions. When selecting a camera, you should have a detailed understanding of the basic parameters of the camera and the function functions that can be automatically adjusted according to the environment. According to the subsequent processing needs of the overall image acquisition system, select the most suitable camera device. In MATLAB, make full use of various functions for adjustment, and can cooperate with the GUI user interface to design a user-friendly parameter management and visual image high-speed acquisition monitoring system. Optimize image acquisition.

Keywords:USB camera Reference address:High-speed image acquisition technology based on USB camera

Previous article:Technological Advances in Optical and Video Measurement Instruments
Next article:Application of machine vision in automatic flaw detection of large workpieces

Latest Test Measurement 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号