Abstract: Based on the principle of real-time infrared thermal imaging system composed of PC and DSP digital signal processing board, the technology of data exchange between the host and DSP through PCI port and real-time image display under Windows is explained. Due to the fast data exchange speed through the PCI port and the use of direct screen writing and page turning technology when displaying data, the system can achieve ideal real-time image display effects.
Keywords: infrared image real-time DSP
With the rapid development of science and technology, infrared thermal imaging cameras are increasingly used in military, scientific research, industrial and agricultural production, medical and health and other fields. Due to the inherent non-uniformity of the infrared focal plane, in the process of infrared image processing, non-uniformity correction must be performed on each pixel in each frame to achieve better results. Therefore, the amount of data required for real-time processing of infrared images is very large. For example, an infrared focal plane array of 256×256 has 64K pixels. If each pixel is represented by 12 bits and 24 frames of images are displayed per second, then the number of pixels transmitted per second will be The amount of data is as high as 2.25Mbyte; if correction operations are to be performed, the calculation amount is even greater. At present, most domestic infrared thermal imaging systems use computers for data collection and software to achieve non-uniformity correction. Due to the slow processing speed of the software, it is difficult to achieve real-time imaging and can only process single-frame images.
This article introduces a master-slave imaging system composed of a PC and a basic DSP digital signal processing board (digital board). Since the typical algorithm for non-uniformity correction is multiplication and accumulation, the processing speed is relatively slow on ordinary computers. DSP has high-speed data processing capabilities. DSP is used to perform image processing calculations, and the computer is used to control the system and display data. This fully utilizes the strengths of software and hardware, thereby increasing the computing speed of the system.
1 System composition and basic principles
A complete infrared imaging system must not only have the function of collecting image signals, but also be able to display images in real time, and complete image signal analysis and processing algorithms (such as non-uniformity correction, etc.). Usually these algorithms have a large amount of calculations, and in addition to meeting the requirements of real-time display, high-speed DSP chips are used as the data core processing unit. In addition, while the system is required to be versatile, it is also required to improve and expand its functions for different applications and emerging new processing methods. To this end, we designed an infrared image processing system using a PC as the host computer and TI's DSP (TMS320C6201) as the auxiliary machine as the core of the digital signal processing board [1~2]. Figure 1 is the schematic diagram of a real-time infrared thermal imaging system based on DSP.
1.1 Advantages of TMS320C6201[3]
TMS320C6201 is a high-speed fixed-point digital processing chip in the TMS320C6x series. It is the latest generation DSP product of TI in the late 1990s. The maximum processing capacity per second is 1600MIPS, and it has a special VelociTI structure and a unique instruction set, thus ensuring its powerful computing power, high degree of parallelism and good flexibility. At the same time, its peripheral devices include DMA controller, host interface (HPI), and interrupt selector, which can easily and quickly exchange data with peripheral devices.
1.2 System composition principle
The system consists of three parts: analog signal board, digital signal processing board and PC. Analog signals are used for signal extraction, including IRFPA, drive signal sources, and preamplifiers. The IRFPA is driven by a signal drive source. According to the induction intensity of external infrared light, it outputs an analog signal of a window waveform, which is amplified by a preamplifier and connected to the digital signal processing board.
The digital signal computing board consists of two parts: data acquisition and data processing. The data acquisition part uses an FPGA to form a controller, which is used to control the time synchronization of the entire processing board, select memory, and image preprocessing. The data processing part includes a DSP, a dual-port RAM and two RAMs (SRAM and SBSRAM, used for the storage of static data and dynamic data respectively). In image acquisition, after the analog signal enters the A/D converter, the FPGA provides sampling control, and the converted digital signal is stored in the dual-port RAM, which provides data for the DSP. The correction parameters are placed in the main program to correct the image. At the same time, the main program also performs other operations to generate DSP-processed images. DRAM and SBSRAM provide storage space for DSP during data processing. The processed data can be exchanged with the host through the PCI interface.
The digital board is connected to the computer through a PCI card. Since the PCI bus has the advantage of high-speed data exchange (120Mbyte/S), it is sufficient to meet the requirements of real-time data processing. The data passes through the HPI port of the DSP and is connected to the PC via the PCI port. The PC reads the data on any memory on the digital board, and then the computer realizes real-time display. The running program of the DSP is loaded onto the DSP by the PC through the PCI port for running.
2 Data exchange and real-time display of data under Windows
In the master-slave structure system, the data exchange and data display between the host and the slave are very critical links. The following will focus on the implementation method. The Windows program of this system is developed under C++ Builder.
2.1 Exchange of data
2.1.1 Real-time
According to the visual characteristics of the human eye, the digital image imaging system must read and process at least 24 frames of images per second (assuming 256×256×8bit=64KByte), then real-time data processing requires data processing per second: 256× 256×8bit×24 frames=1.5Mbyte, and display it so that the image does not lose continuity. This requires that the time interval between reading and synthesizing image data of two consecutive frames cannot be too large, so it must satisfy "data reading time ≤ frame time interval". The host accesses the DSP chip through the PCI port, and the PCI bus can ensure high-speed data exchange. In order to achieve real-time display, the data reading interval is required to be as small as possible.
2.1.2 PCI card driver issues
In the Windows development environment, C++ Builder cannot directly access PCI devices and needs to use other software to achieve this. KRFTech's main product, WinDriver, is the preferred driver development tool for PCI interface program development. Generally speaking, there are two ways for users to access the digital signal processing card on the PCI port [4]: one is direct access, that is, using C++ Builder to directly access the interface function of the PCI device (this method requires relevant software support); the other is direct access. Indirect access is achieved by using C++ Builder to call the underlying driver module (generally encapsulated in the form of a dynamic link library DLL) written in other languages (such as assembly or C/C++, etc.). This system adopts the method of calling dynamic link library.
2.1.3 Process of reading data from DSP
This system encapsulates the underlying driver of the PCI card into a dynamic link library (evm6X.dll), and its header file is evm6xdll.h, so that other functions can be easily called. When calling a dynamic link library (DLL), you must first declare the DLL, and then you can use the functions in the dynamic link library just like calling C++ functions. C++ Builder allows calling dynamic link libraries written in other languages, but users generally do not know what language other functions are programmed in, so they should pay attention to function identifiers and parameter passing in order to solve the calling convention problem.
The modular program for reading digital board data from a CP machine written in C++ Builder is as follows:
#inchude "evm6xdll.h"
HANDLE hBd=NULL; //Board handle
Short iBd=0; //Board number
BOOL bExcl=1; //Exclusively open=TRUE
LPVOID hHpi=NULL; //HPI interface handle
short iMp; //Map selector=MAP0 //DSP startup mode
EVM6XDLL_CLOCK_MODE clkMode;
EVM6XDLL_ENDIAN_MODE ednMode;
ULONG ulDW[1024*16]; //Define data cache
Void ReadWordFromMem (LPVOID hHpi,ULONG ulDataAddr, ULONG ulDataWord,ULONG Ilength, ULONG *ulDW)
{
hBd=evm6x_open(iBd,bExcl); /Open the board
evm6x_reset_board(hBd); //Reset the target
evm6x_set_board_config(hBd,clkMode,ednMode,0xff); //Initialize the target board configuration
mode=iMp ? HPI_BOOT : HPI_BOOT_MAP0; //Set the startup mode
evm6x_reset_dsp(hBd,mode); //Reset DSP
hHpi=evm6x_hpi_open(hBd); //Establish a connection from the host to hpi
if(!evm6x_hpi_read(hHpi,ulDW,&ulLength,ulDataAddr)) //Read data from DSP
{ShowMessage("An error occurred while reading memory!");} //System reset operation
evm6x_hpi_close(hHpi);
evm6x_unreset_dsp(hBd);
evm6x_close(hBd);
}
Since the PCI port data exchange is fast (up to 120Mbyte/s) and can easily read the data in the digital board memory for data exchange, the exchange of data between the PC and the digital board through the PCI port facilitates the implementation of the real-time system. .
2.2 Real-time display of data
The data read through the PCI port is the brightness value of a single pixel in each frame. Therefore, to achieve real-time display under Windows, it not only needs to solve the color configuration problem, but also requires fast real-time image display speed. Therefore, this system uses writing under Windows. Screen technology realizes image display.
2.2.1 Color control
Since the infrared image sensor can only reflect the level of the outside temperature, during the processing process, each pixel of the focus plane is represented by 8 bits (256 grayscale). The colors in the color table under Windows use R, G, and B, which are the three primary colors of red, green, and blue. Each color ranges from 0 to 255. Various colors on the screen can be composed of these three primary colors (ie, 24-bit true color). If the RGB value of each pixel is set to the obtained pixel brightness value, the resulting color will be a grayscale image with only light and dark colors (256 levels of grayscale); if pseudo-color is performed according to its 256 levels of grayscale After processing, a pseudo-color image is obtained. In order to perform pseudo color processing, a pseudo color image is obtained. In order to enhance the display of pseudo-color images, only some colors in the 256 color table can be used to represent them. By selecting colors with large differences to represent the temperature range of the frame measurement target in the thermal image, the purpose of enhancing the image display effect can be achieved.
2.2.2 Implementation of real-time display
The frame end point flag (FLAG) read on the digital board is used to implement frame synchronization control to ensure the refresh of each frame of image and the delay of the interval in the image. Since the video memory cannot be accessed directly under Windows like DOS, the system adopts DirectDraw technology [5] and uses the DirectDraw API function provided under Win32 to implement it. DirectDraw in Win32 provides control of the screen and screen resolution without operating the SVGA chip, which can achieve extremely fast image display speed, linear memory and page turning. DirectDraw can also configure the screen resolution and color mode. Open the video storage space for two frames of images through the main surface (foreground Buffer) and auxiliary surface (background Buffer) of the device screen. Such direct access to video memory synthesizes graphics data into image code extremely quickly, increasing display speed. At the same time, when the image is written and displayed, the image is first written to the background, and then the image is transferred to the foreground when the frame mark comes (page turning technology). The use of this page turning technology can visually switch the entire frame image display instead of a single point switch, thereby achieving a smooth visual effect of real-time image display, and can also delay the reading time and achieve real-time processing. . Figure 2 is a flow chart of real-time image display processing.
3 Experimental results
Figure 3 is a 128×128 area array 256-level grayscale image obtained by the system through the PCI port to achieve reading and real-time display. Experiments show that this system can achieve ideal smooth image real-time display results, and the image is clear and the results are ideal.
Theoretical analysis and experimental research show that the DSP-based infrared thermal imaging system introduced in this article has high-speed data exchange capabilities due to the use of the PCI port of the PC for data exchange; through real-time display and processing of data, the grayscale of the image can be realized and pseudo-color processing; using DirectDraw technology under Windows, the video memory can be directly accessed to realize direct writing of image data to the screen and image flipping technology; using the frame end point as the frame synchronization signal can achieve smooth real-time display of infrared images. Achieve ideal image display visual effects.
Previous article:Application of μPD16305 in plasma displays
Next article:Development and Application of Optocouplers
- Popular Resources
- Popular amplifiers
- MathWorks and NXP Collaborate to Launch Model-Based Design Toolbox for Battery Management Systems
- STMicroelectronics' advanced galvanically isolated gate driver STGAP3S provides flexible protection for IGBTs and SiC MOSFETs
- New diaphragm-free solid-state lithium battery technology is launched: the distance between the positive and negative electrodes is less than 0.000001 meters
- [“Source” Observe the Autumn Series] Application and testing of the next generation of semiconductor gallium oxide device photodetectors
- 采用自主设计封装,绝缘电阻显著提高!ROHM开发出更高电压xEV系统的SiC肖特基势垒二极管
- Will GaN replace SiC? PI's disruptive 1700V InnoMux2 is here to demonstrate
- From Isolation to the Third and a Half Generation: Understanding Naxinwei's Gate Driver IC in One Article
- The appeal of 48 V technology: importance, benefits and key factors in system-level applications
- Important breakthrough in recycling of used lithium-ion batteries
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- T6963C does not display the problem
- [Telink's new generation of low-power, high-performance multi-protocol wireless kit B91 review] Home Assistant installation
- [Telink's new generation of low-power, high-performance, multi-protocol wireless kit B91 review] Run the Zigbee gateway
- [Repost] Detailed description of the five key points of MOS tube drive circuit
- How to achieve 0.125ns dynamic delay
- TSMC's 5nm wafer cost price exposed, Apple A14 and Huawei Kirin 9000 are destined to be expensive
- [Lazy self-care fish tank control system] I2C expansion peripherals under Keil environment
- Technologies required for Java backend development
- Circuit and MCU Problems
- About the use of gTI DSP integrated development environment CCS