Application of image acquisition and processing in intelligent vehicle system

Application of image acquisition and processing in intelligent vehicle system

The intelligent car system is mainly composed of function modules such as path recognition, speed acquisition, steering control and vehicle speed control. The path recognition function adopts a CMOS camera, decodes its analog video signal, converts it into 18 × 90pix image data after binarization, and sends it to the MCU for processing; the steering control is adjusted based on the fuzzy control algorithm; The speed control uses the classic PID algorithm, which sets different given speeds by judging the results of different shapes of the track. The system achieves closed-loop control of the entire system by continuously collecting real-time traffic information and speed at a frequency of 50 Hz, as shown in Figure 1.

Image collection and storage of smart car

Design of image acquisition module

After the CMOS camera is normally powered, it can output the signal waveform of the original image. It is an analog signal of the PAL system, including line synchronization, line blanking, field synchronization, field blanking and other signals as shown in Figure 2. However, this form of signal cannot be directly used by the CPU. A video decoding chip such as SAA7111 needs to be added. Its function is to convert the analog signal output by the camera into a digital signal, and at the same time generate various synchronization signals. The digital signal is stored in an external FIFO chip AL422, which constitutes the basic path detection module, as shown in Figure 3.

Image data storage

SAA7111 is an enhanced video input processor chip of Philips, which is often used in highly integrated circuits for embedded video applications. When working, the analog video image is input from one of the four input ports of SAA7111. After analog processing, one channel is output from the analog output terminal through the buffer for monitoring, and the other channel generates digital chrominance signals after A / D. The luminance signal is processed by luminance signal processing and chrominance signal processing, respectively. The results of the luminance signal processing are sent all the way to the chrominance signal processor for comprehensive processing to generate Y, U, V signals, which are formatted and output from the VPO. The output signal format is 422YUV or CCIR-656 (8-bit), etc .; The other way enters the sync separator and generates corresponding line and field sync signals HS, VS and pixel clock signals LLC and LLC2 via digital PLL. These signals are the basis for video data collection. The image size of each frame output by SAA7111 can be set to 720 × 286, and its data volume is relatively large compared to the processing speed of the microcontroller. The ideal image size is 18 × 45, and the compressed data volume is only the original image. 0.394%. In order to effectively compress the image data, the digital signal of the image can be stored in the FIFO, and the image size can be compressed after a certain frequency division processing. The FIFO chip used by the system is AL422B.

In order to realize the frequency division processing of the image digital signal, it can be divided into two implementation methods, one is software frequency division, and the other is hardware frequency division. For software frequency division, the system does not need an additional frequency division circuit, but the microcontroller uses the control signal output from the decoding chip SAA7111 to divide the read clock before performing the actual read operation. The disadvantage of this method is frequency division The work needs to occupy the resources of the single chip and affect the real-time performance of the system. For hardware frequency division, special frequency division processing circuits need to be added to compress the image without the control of the single chip, thereby fundamentally reducing the single chip The amount of data processed and shorten the time to read the image. Therefore, the system uses hardware frequency division. The specific signal division mode is shown in Figure 4. CREF represents the pixel clock. After division, the AL422B write clock WCK is obtained. HREF represents the line reference signal. The signal is used as the AL422B write enable signal.

Image denoising and feature extraction

Binary image

Image binarization is a basic technology in digital image processing technology. In this system, because the track is composed of black and white colors, and the background color is basically white, the task of the system is to identify the black lead The position of the running line is not very strong due to the interference of the image, so the binarization technique can be used as the image preprocessing of the system. After the binarization process, the original white pixels are represented by 0, and the black pixels are represented by 1. The key of image binarization technology is how to select the threshold. Generally speaking, commonly used methods include global threshold method, local threshold method and dynamic threshold method. Because the light on the track is relatively uniform and the background color around the track is basically white, the global threshold method is used in the design of the system to achieve the effect of simple algorithm and high execution efficiency.

Selection of binary threshold

In the analysis of the track environment, we can find that the brightness of the black line is relatively fixed, and the fluctuation range is very small, less than 20 (the maximum brightness value is 255), and the brightness value of the white bottom plate changes relatively Some, but still can guarantee a large gradient with the brightness value of the black line. Therefore, the histogram statistical method can be used to automatically set its threshold, the specific method is as follows.

First store all the data of an original image, then count the first pixel of the entire image, and finally count the number of pixels corresponding to the first brightness value, and a double-peak shape will appear as a result, as shown in the figure 5 shows. This will directly compare the areas where the brightness values ​​are concentrated, and take the midpoint value of the center positions of the two peaks as the binarization threshold of the track. The algorithm has high calculation accuracy and can find an ideal threshold point. Although it takes a long time to execute, it is only an initialization operation performed before the car starts, and it has no effect on the speed of the car after the start. Therefore, this The scheme can be adopted.

Image Denoising

During the movement of the car body, the image does not appear too much noise after binarization, but only a small part of the salt and pepper noise appears locally. The typical image is shown in Figure 6. In the system design, the purpose of image processing is to accurately find the center position of the black line. Since the area of ​​noise in the image is very small, and generally appears far away from the black line, there are many processing methods, and the central coordinate recursion method can be used.

Because the black line of the track is subdivided into the coordinates of each row, the difference between the center coordinate values ​​of the adjacent two rows is relatively small, and the difference between the two is generally not more than 5 after experimental testing, which has a good delivery Push. Therefore, the center coordinates of the previous line can be used to recurse down to solve, the specific steps are as follows.

(1) Because the black line near the camera has a good shooting effect, not only the width of the black line is relatively large, but basically no noise will appear. Using it as a reference point for recursion is a very good choice. Since this is the reference point of the entire image, its accuracy is relatively high. When calculating the center coordinate value of the first line, the black line continuous notation is used, that is, only 3 or more "1" s are read continuously. Only the black line is counted as effective, and record the number of black line blocks, otherwise clear it, and finally check whether the number of black line blocks in the line is 1, if it is not 1, then use the second line of image data for judgment. This increments until the only black line is found.

(2) Based on the coordinates of the center found for the first time, search for the position of the black line in the interval of 10 points on the left and right sides of the upper line, and then use the center of gravity method to find the center of the black point in the interval Coordinate value, and use it as the center coordinate reference point of this line.

(3) Follow step (2) to gradually recurse to the previous line, and stop the black line search if a line with all zeros is encountered. The image shown in Figure 6 is processed by this algorithm and the image obtained is shown in Figure 7. It can be seen that this method can effectively eliminate the image noise.

references:

[1] Zhuo Qing, Huang Kaisheng, Shao Beibei. Learning to be a smart car—Challenging the Freescale Cup [M]. Beijing: Beijing University of Aeronautics and Astronautics Press, 2007: 1-18

[2] Yu Xiaolin, Zhang Chong, Deng Changjun. Application of SAA7111A in real-time image acquisition system [J]. World of Electronic Products, 2005, 1: 97-99

[3] Zhao Yongzhi, Peng Guohua. An effective image binarization method. Science and Technology and Engineering. 2007.7 (1): 139-141

[4] Rafael CG, Richard EW, Ruan Qiuqi (translation). Digital Image Processing (Second Edition) [M]. Beijing: Electronic Industry Press, 2004: 27-48

[5] Wang Mingshun, Shen Mouquan. Sensor and intelligent vehicle path recognition [J]. World of Electronic Products, 2007, 4: 142-143

SATA Cable

Sata Cable,Sata ssd,Sata data cable,Sata cable for laptop,Sata 7pin cable,6Gbps

Dongguan Aiqun Industrial Co.,Ltd , https://www.gdoikwan.com