1 Introduction
Imaging products help you sample and analyze video information carried by video signals. Electronic sampling is accomplished through video capture devices such as capture cards, which operate within a host platform (such as a PC). The capture card converts the image provided by the video signal source into a data array, which can be digitized, processed, enhanced, and then analyzed or displayed on a video monitor.
2. Video Basics
When electronically sampling a video signal (often referred to as image acquisition), the first step is to identify the type of video signal being used. This section introduces some basic knowledge about video signals.
2.1 Signal Types and Video Formats
Video signals come from various sources, including: video cameras, portable camcorders, video recorders, television broadcasts, X-ray equipment, scanning electron microscopes, CT scanners, and so on. These signal sources either provide composite video signals (which contain video data and clock information) or non-standard video signals (whose video and clock can be in various different formats).
Standard composite video signals have the following formats:
(1)rs-170
Used in North America and Japan. This black-and-white composite video signal has a spatial resolution of 640×480, and the RS-170 operates at 60Hz, or 30fps.
(2)ntsc/rs-330
Used in North America and Japan. This video signal is identical to RS-170 except for the addition of color information. This signal type was standardized by the National Television Systems Committee (NTSC) in the 1950s.
(3)ccir
This composite signal was first used in Northern Europe and is named after an international standards organization—the International Committee of the Advisory Committee on Radiological Reduction (CCIR). This black-and-white video signal has a spatial resolution of 768×576 and operates at 50Hz, or 25fps.
(4)pal
Used in Northern Europe. This video signal, except for the added color information, is otherwise identical to CCIR. PAL is one of the technologies used in its application: phase alteration.
Abbreviation for line.
(5)secam
Used in France, Russia, etc. Its parameters are the same as PAL.
Non-standard video signals do not have fixed spatial resolution, signal clock, or signal characteristics. These parameters can only be determined by consulting the technical documentation provided by the signal source.
2.2 Spatial Resolution
Spatial resolution defines the number of rows and columns of elements in an image. Rows define the length of the image, described by the number of lines; columns define the width of the image, described by the number of pixels. For a standard RS-170/NTSC image, the spatial resolution is 640×480; for a standard CCIR/PAL image, the spatial resolution is 768×576. See Figure 1:
Figure 1 Block diagram of an image acquisition system based on PCI bus
Depending on the signal source or camera used, spatial resolution can range from 256×256 to 4096×4096 or even higher. Since spatial resolution directly affects image size, most applications use only the resolution that meets the requirements. Fast image transmission and processing are crucial for industrial inspection applications, where the spatial resolution is typically 512×512. For applications requiring higher spatial resolution, such as high-precision calibration and measurement, resolutions of 1024×1024 or higher are frequently used.
2.3 Aspect Ratio
Aspect ratio refers to the ratio of the width to the height of a single pixel. Ideally, we want an aspect ratio of 1 : 1, meaning the width and height of each pixel are equal. Some input signal sources, cameras, or capture cards cannot generate or convert video data into square pixels. This often results in images that are bead-shaped or rectangular.
Aspect ratio is important for certain processing steps, such as when you're trying to determine the area of a region by the number of pixels within it. If the aspect ratio is not 1 : 1, you must compensate for it during image processing or correct it using software.
2.4 brightness resolution
When video data is generated or converted, its luminance resolution (sometimes also called digital depth resolution) must also be determined. Luminance resolution defines the number or gradient of colors in an image. These gradients primarily refer to gray levels (for monochrome images) or the number of colors (for color images). For a standard RS-170 image, its luminance resolution is 8 bits or 256 gray levels (the terminology is often 640×480×8). Commonly used resolutions are 8 bits (256 gray levels), 10 bits (1024 gray levels), 16 bits (65536 gray levels), or higher. The amount of data in an image increases with luminance resolution. For example, a standard RS-170 image is approximately 307 kb, while a 16-bit image with the same spatial resolution is approximately 614 kb, and a 24-bit image is approximately 922 kb.
2.5 Interlaced and Non-interlaced Formats
A video signal contains several lines of pixels. A horizontal sync pulse separates the lines. All composite video signal sources, including RS-170/NTSC, CCIR/PAL, and non-standard sources, transmit data interlacedly. Interlacing means that video data is transmitted in two separate parts called "fields." The fields of the odd-numbered lines are transmitted first, followed by the fields of the even-numbered lines. A complete image containing both odd and even fields is called a frame.
When each scene is displayed sequentially, it feels like each frame is displayed at twice the normal speed. Field synchronization determines when a scene ends and when a scene begins.
When displaying certain types of images, such as graphics or thin lines, interlaced formatting can cause the image to flicker.
Some non-standard video signal sources transmit data in an interlaced format. This process is sometimes called progressive scan. The interlaced format transmits all lines (odd and even lines) of the video signal in one field.
Note that when observing a moving object, progressive scan is usually more suitable. This is because interlaced format often causes blurring or frequency confusion due to misalignment between two fields.
2.6 frames per second
Frame rate refers to the speed at which frames are transmitted or displayed, usually expressed in fps (frames per second). RS170/NTSC images typically run at 30 fps, while CCIR/PAL images typically run at 25 fps. Frame rates below this level will produce a jerky effect similar to that seen in older films.
3. Basic Principles of Data Acquisition Cards
There are various types and specifications of image acquisition cards. However, despite their differences in design and features, most acquisition cards share the same basic principle. Here, we will take an analog image acquisition card based on the PCI bus as an example for explanation.
In recent years, digital video products have achieved significant development. Digital video products typically require real-time acquisition and processing of moving images, therefore, product performance is greatly influenced by the performance of the image acquisition card. Early image acquisition cards were based on frame buffers, requiring reading and writing to the frame buffer during image processing, and also necessitating "freezing" images for moving scenes. Furthermore, due to limitations in data transmission rates, image processing speed was slow. In the early 1990s, Intel proposed the PCI (Peripheral Component Interconnect) local bus specification. The PCI bus has a data transmission width of 32/64 bits, allowing system devices to connect directly or indirectly to it. Devices can quickly transfer data through the local bus, thus effectively solving the bottleneck problem of data transmission.
Due to the high speed of the PCI bus, the digital video signal after A/D conversion only needs to pass through a simple buffer to be directly stored in the computer's memory for image processing. The acquired image signal can also be transmitted to the computer's graphics card for display; even the digital video signal output from the A/D converter can be directly sent to the graphics card via the PCI bus for real-time display of moving images on the computer terminal. A block diagram of a PCI bus-based image acquisition system is shown in Figure 1. In the figure, the buffer (data latch) replaces the frame memory. This buffer is a small-capacity, simple-to-control FIFO (First-In-First-Out) memory that plays a role in speed matching when the image card transmits video data to the PCI bus. The image card is inserted into the computer's PCI slot, establishing a data transfer mechanism with the computer's memory, CPU, and graphics card.
Due to the aforementioned advantages of the PCI bus, many image board companies have successively launched image acquisition cards based on the PCI bus.
4. Technical terms related to image acquisition cards
4.1dma
DMA (Direct Memory Access) is a bus control method that can replace the CPU's control over the bus. During data transmission, it completes data access based on the logical and physical address mapping relationship between the data source and destination, which can greatly reduce the CPU's burden during data transmission.
4.2 scatter/gather table
The scatter/gather table is essentially a dynamic mapping table between logical and physical addresses used during DMA transmission. Depending on the board design, this table can reside directly within a buffer module of the acquisition card, known as hardware scatter/gather, which can achieve a maximum transmission speed of 120 MB/s during PCI transmission; alternatively, it can reside in a segment of the host's memory, known as software scatter/gather, with a typical maximum transmission speed of 80 bps. Most PC-based acquisition cards use hardware scatter/gather.
4. 3LUT (look-uptable)
For image acquisition cards, a LUT (look-uptable) is essentially a mapping table of pixel grayscale values. It transforms the actual sampled pixel grayscale values through transformations such as thresholding, inversion, binarization, contrast adjustment, and linear transformation, into another corresponding grayscale value. The right image shows an 8-bit look-uptable. This helps highlight useful information in the image and enhance its light contrast. Many PC series cards have 8/10/12/16 or even 32-bit LUTs; the specific transformations performed within the LUT are defined by the software, as shown in Figure 2.
4.4 planar converter
The planar converter can extract the r, g, and b components from color pixel values represented in 4 bits, and then send them to three independent buffers in the host memory during PCI transmission. This facilitates the storage and retrieval of color information in subsequent processing. In some acquisition cards (such as PC2Vision), it can also be used to store the pixel values of three monochrome cameras in three independent buffers in the host during simultaneous acquisition.
As shown in Figure 3 below:
Figure 3 Planar Converter
4.5 decimation
Decimation essentially involves subsampling the original image, such as taking a row (column) every 2, 4, 8, or 16 rows (columns) to form a new image. Decimation can significantly reduce the data size of the original image, but it also reduces the resolution, somewhat similar to camera binning. (See Figure 4 below.)
Figure 4 decimation
Figure 5 programmable window generator
4.6pwg
PWG (Programmable Window Generator) refers to opening a window of interest on the acquired raw camera image, storing and displaying only the contents of that window at a time. This can reduce the amount of data to some extent without reducing the resolution.
Most data acquisition cards have dedicated registers to store data related to window size, start point, and end point coordinates, all of which can be set via software. The window size of PC series cards can vary within a wide range; for example, the PC-DIG can range from a maximum of 64k×64k to a minimum of 1×1. See Figure 5 below:
4.7 resequencing
Resequencing can be considered as the ability to reassemble data output from cameras with multiple channels or different data scanning methods, that is, to recombine data from different regions or pixels of the CCD target into a complete image.
4.8 non-destructive overlay
Overlay refers to non-video data such as graphics (e.g., pop-up menus, dialog boxes) or characters superimposed on a video display window. Non-destructive overlay is the opposite of destructive overlay. Destructive overlay means that the video information and overlay information in the display window are stored in the same memory location within the video memory, while non-destructive overlay means that the video information and overlay information are stored in two separate memory locations within the video memory, and the information displayed in the window is the superposition of the data stored in these two memory locations. If destructive overlay is used, the overlay information in the video memory is refreshed by the CPU, which consumes CPU time and can cause flickering due to asynchrony during real-time display. Non-destructive overlay eliminates these disadvantages.
4. 9pll, xtal, and vscan are three different operating modes of the analog data acquisition card.
(1) pll(phase lock) Loop mode: The camera provides the A/D conversion clock signal to the capture card. This clock signal comes from the video signal output by the camera. The HS and VS synchronization signals can have three sources: composite , evideo, composite , sync, separate , sync.
(2) XTAL mode: The image acquisition card provides the camera with a clock signal and an HD/VD signal, and uses the provided clock signal as the clock for A/D conversion, but the synchronization signal can still be the HD/VD output from the camera;
(3 ) vscan mode: The camera provides pixel , clock, hs and vs signals to the card respectively.
5 Key Considerations When Choosing a Capture Card
5.1 Interface standard and data format
Interface standards include digital (camera) The standard analog (link, lvds/rs422), analog (pal, ntsc, ccir, rs170/eia, non-standard analog) format must be consistent with the camera selected for the vision system. If a digital format is chosen, the camera's digital depth must also be considered.
5.2 Analog acquisition cards should consider digitization accuracy.
The digitization accuracy of analog data acquisition cards mainly includes two aspects:
(1) Pixel dithering jitter
Pixel jitter is a tiny error in pixel position caused by the sampling clock error of the A/D converter in the image acquisition card, which leads to errors in distance measurement. (See Figure 6.)
Figure 6 Pixel jitter
2) Grey-scale noise
The digitization process of an image acquisition card involves amplifying the analog video signal and measuring its brightness (grayscale value). During this process, some noise and dynamic fluctuations are generated by the image acquisition card's circuitry.
Similar to pixel jitter, grayscale noise will cause errors in distance measurement. Typical grayscale noise is 0.7 grayscale units, expressed as 0.7 lsb.
5.3 The data rate of the digital acquisition card must be considered.
The following formula can be used to calculate whether the data rate of the digital acquisition card meets the system requirements:
data , rate(grabber)>1 . 2×datarate(camera)
data , rate(camera) = r × f × d / 8
In the formula , data and rate(grabber) represent the data rate of the data acquisition card.
rate(camera) is the camera's data rate, r is the camera's resolution, f is the camera's frame rate, and d is the camera's digital depth (or grayscale level).
5.4 memory size, PCI bus transfer rate
The PCI bus supports data transmission at a burst rate of 132 Mbps for both bus and master devices. Its average sustained data transfer rate is typically between 50 and 90 Mbps.
Data from the camera is always transmitted at a fixed rate. If the PCI bus could maintain an average continuous data transfer rate greater than the video data rate, the problem would seem solved. However, it's not that simple. PCI bus devices can only transmit data to the bus in bursts. The image acquisition card must store the continuous image data between each burst. The solution is to use on-board memory. Some manufacturers, for economic reasons, eliminate memory and use a data buffer queue (FIFO). The size of the FIFO is generally limited to enough to store one line of image data. However, the FIFO becomes ineffective when the image data rate exceeds the continuous data transfer rate of the PCI bus.
5.5 Camera control signals and external trigger signals
To synchronize the timing circuit of the image acquisition card with the timing circuit of the external video signal, a phase-locked loop circuit or a digital clock synchronization circuit is required.
(1) External trigger: The process of data collection is initiated by an external event.
(2) Synchronous triggering: Without changing the synchronization relationship between the camera and the board, the acquisition starts from the next valid field signal.
(3) Asynchronous triggering: Change the synchronization relationship between the camera and the board to start collecting the first valid field signal after the camera is reset.
When a vision system needs to detect moving targets, the camera and the acquisition card must have the function of asynchronous triggering.
5.6 Reliability of the hardware system
Hardware reliability is crucial in production systems; losses due to equipment failure and downtime far outweigh the losses caused by the equipment itself. Many circuit board manufacturers do not specify reliability metrics such as mean time between failures (MTBF).
Here are two empirical tips for assessing the reliability of different boards: the number of components on the board and the power consumption.
Try to choose a data acquisition card with lower power consumption. All else being equal, a more complex card with more components will dissipate more heat than a card with fewer components. Good designs use more ASICs (application - specific , integrated circuits) and programmable components to reduce the number of electronic components while achieving higher functionality. You can also choose a card with fewer unnecessary functions to reduce unnecessary complexity.
Overvoltage protection is an important indicator of reliability. Approaching high voltage can cause a strong surge in video cables. Adding overvoltage protection circuits to the video input terminals and I/O ports can protect the data acquisition card from high voltage breakdown caused by electromagnetic interference in industrial environments.
5.7 Support for software functions
Most capture card manufacturers bundle their capture cards with their dedicated image processing software. Therefore, when choosing a capture card, it is essential to consider its compatibility with the software required for the vision system. For example, Dalsacoreco's image processing software such as WIT, SAPRA, and MVTools can only be used on its Bandit, PC, x64, and Viper series capture cards, while Cognex's Vision Pro can only run on its 8100 and 8500 series capture cards.
6. Conclusion
With the continuous development of machine vision technology, the technology of data acquisition cards is also constantly improving, and their functions are continuously being updated. Choosing the right data acquisition card for a vision system plays a crucial role in ensuring the proper functioning of that system.