Image real-time acquisition system

This solution is mainly aimed at solving the simulation experiment of algorithm correction of the image real-time acquisition system and the verification of the acquisition card receiving circuit.

Since the image real-time tracking and processing system requires a large number of external scene experiments, most of the time the algorithm can only be verified by collecting on-site images and reading pictures in computer software, and cannot jointly verify the system through capture card docking. of practicality. Calibration can only be carried out in the joint laboratory when there is an external environment, and the external scene is single. The design of this system can switch between different recorded outdoor scenes indoors, and can flexibly verify the correctness of the image real-time processing system.

The FPGA of this solution uses the K7 chip and is equipped with dual BASE mode CameraLink ports, which not only improves the data processing and transmission speed, but also facilitates the two machines to work at the same time. This solution has been successfully applied and verified in projects. In high and low temperature and thermal vacuum environmental tests, the photo group can be successfully transferred to the processing board quickly. The algorithm of the processing board performs real-time target tracking on the photo group in harsh environments.

In terms of hardware, the host computer transmits the data to the FPGA module, and then transmits the CameraLink signal through the NI PXIe-1082 adapter. In dual BASE mode, it is transmitted to its own processing board through the CameraLink protocol. After algorithm processing, it is transmitted to the display board and directly shown on the display. (figure 1)

Figure 1 Hardware composition schematic diagram

       Figure 2 is a picture of the entire system, which consists of NI image sending equipment, processing board, and display screen. FlexRIO's high-speed image simulation sending system sends the picture group in the hard disk to the processing board, and the pictures are processed and sent to the display screen.

Figure 2 Physical diagram of the system

  In terms of software, the user interface is simple and easy to understand. The software selects different locations by opening the folder where the pictures are located, and the camera simulation setting parameters are set according to the required requirements. The program is divided into two parts, namely FPGA code and host computer code. The FPGA code implements the standard CameraLink protocol part, while the host computer code determines the size, number of bits and TAP form of image transmission. In order to facilitate expansion, the FPGA code leaves room for modification of some parameters of CameraLink. It is precisely because of the flexibility of NI FPGA that not only the standard protocol of CameraLink can be well implemented, but also some timing data or intervals can be customized.

 FPGA code breakdown:

Figure 3 FPGA code decomposition:

The data is read from the DMA FIFO and placed into the FIFO of VI SCOPE to create a first-level data cache.

Figure 4

The state machine that implements the entire CameraLink function is also the main part of the program. This state machine is further subdivided into:

Figure 5

The implementation process is:

Figure 6 

       Generally, different applications only need to modify the host computer software. Before introducing the host computer, let’s take a look at the CameraLink protocol. CameraLink is divided into two formats: Base and Full. The Base format transmits images through 5 differential pairs. Excluding the clock differential pairs, there are a total of 4 pairs. In each clock cycle, these 4 differential pairs transmit 7 bits of data. That is to say, CameraLink can transmit 28 bits of data in one clock cycle. In fact, generally we will remove 4 of them, that is, only consider 24 bits, which is three bytes. When we write data, we extract all the data of a picture and splice it into U32 format, add the width and height of the image, and write them into the DMA FIFO together. At present, the host computer program has realized the sending of image data in a variety of different formats. After testing with the NI CameraLink receiving card, all can be successfully transmitted.

       The upper computer operation interface is simple and easy to use

Figure 7 PC software operation interface

The host computer loads the FPGA running file:

Figure 8

To read image files, you can read commonly used image formats, and you can also read custom image formats by reading data:

Figure 9

The read image data is parsed and spliced, conforms to the CameraLink format, and can send image depths of 8, 10, 12, 14, and 16, and correspondingly send them to the FPGA in the form of 1, 2, and 3 taps:

Figure 10

  In response to the needs of the laboratory, we need to send pictures in different formats to the processing board. The formats of some pictures are set by the laboratory. The existing picture control of LABVIEW cannot recognize custom picture attributes, and the memory of the pictures that need to be sent is very large. Through innovative design, we send custom-formatted pictures in the form of data, and the data will be sent regardless of the picture format. In order to solve the problem of large memory of the picture group, we used the producer/consumer model, which only requires the memory of one image, greatly reducing the required memory space and effectively solving this problem. The software program now designed is aimed at different Picture formats and different number of bits have different processing methods, and the speed is fast and the system is stable.

In the past, every time we did an experiment, we needed to use a camera to capture images and perform on-site experiments. This would require a lot of manpower and material resources. Some special environments do not allow repeated shooting, thus increasing the difficulty of the experiment. Use NI's simulated picture sending system to effectively simulate the functions of the camera and transmit photos of various experimental environments at any time. Compared with the previous systems, NI's products have many advantages, mainly in the great flexibility of NI software. In the graphical development environment of NI LABVIEW, there is no need for text code. Instead, data acquisition systems are developed through drag-and-drop icons. Intuitive flowcharts display code that is easy to develop, maintain, and understand, and with fast and flexible data storage options, the system is stable and reliable.

Guess you like

Origin blog.csdn.net/zhhk2005/article/details/134376063