System Overview
The intelligent car system is mainly composed of functional modules such as path recognition, speed acquisition, steering control and vehicle speed control. The path recognition function uses a CMOS camera to decode the analog video signal, and then convert it into 18×90pix image data after binarization and send it to the MCU for processing; the steering control is adjusted based on the fuzzy control algorithm; and the vehicle speed control uses the classic PID algorithm, which sets different given speeds based on the judgment results of different shapes of the track. The system continuously collects real-time road conditions and speed at a frequency of 50Hz to achieve closed-loop control of the entire system, as shown in Figure 1.
Image acquisition and storage of smart cars
Image acquisition module design
After the CMOS camera is powered normally, it can output the signal waveform of the original image, which is an analog signal of the PAL format, including line synchronization, line blanking, field synchronization, field blanking and other signals as shown in Figure 2. However, this form of signal cannot be used directly by the CPU, and 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 generate various synchronization signals. The CPU uses this synchronization signal to store the digital signal of the image in an external FIFO chip AL422, which constitutes a basic path detection module, as shown in Figure 3.
Image data storage
SAA7111 is an enhanced video input processor chip from 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 port through the buffer for monitoring, and the other channel generates digital chrominance signal and brightness signal after A/D, and performs brightness signal processing and chrominance signal processing respectively. The result of brightness signal processing is sent to the chrominance signal processor for comprehensive processing to generate Y, U, and V signals, which are formatted and output from VPO. The output signal format includes 422YUV or CCIR-656 (8 bits), etc.; the other channel enters the synchronization separator, and generates corresponding line and field synchronization signals HS, VS and pixel clock signals LLC and LLC2 through digital PLL. These signals are the basis for realizing video data acquisition. The size of each frame of image output by SAA7111 can be set to 720×286. Its data volume is relatively large compared to the processing speed of the single-chip microcomputer. The ideal image size is 18×45, and the compressed data volume is only 0.394% of the original image. In order to effectively compress the image data, the digital signal of the image can be stored in FIFO. After a certain frequency division process, the image size can be compressed. The FIFO chip used in 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 by the decoding chip SAA7111 to divide the read clock before performing the actual read operation. The disadvantage of this method is that the frequency division work needs to occupy the microcontroller resources, affecting the real-time performance of the system; for hardware frequency division, it is necessary to add a special frequency division processing circuit to realize the image compression without the need for microcontroller control, thereby fundamentally reducing the amount of data processed by the microcontroller and shortening the time to read the image. Therefore, the system adopts the hardware frequency division method. The specific signal frequency division mode is shown in Figure 4. CREF represents the pixel clock, and the frequency division results in the write clock WCK of AL422B. HREF represents the line reference signal, and the signal obtained after the frequency division is used as the write enable signal of AL422B.
Image denoising and feature extraction
Image Binarization
Image binarization is a basic technology in digital image processing. In this system, since the track is composed of black and white, and the background color is basically white, the system's task is to identify the position of the black lead line. Since the interference of its image is not very strong, the binarization technology can be used as the system's image preprocessing. After binarization, the original white pixels are represented by 0, and the black pixels are represented by 1. The key to image binarization technology lies in how to select the threshold. Generally speaking, commonly used methods include global threshold method, local threshold method and dynamic threshold method. Since 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 this system, which can achieve the effect of simple algorithm and high execution efficiency.
Binarization threshold selection
In the analysis of the track environment, we can find that the brightness of the black line is relatively fixed, and its fluctuation range is very small, less than 20 (the maximum brightness value is 255), while the brightness value of the white background changes relatively more, but it can still ensure that there is a large gradient between it and the brightness value of the black line. Therefore, the histogram statistical method can be used to automatically set its threshold, and 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 th brightness value. The result will be a double-peak graph, as shown in Figure 5. This will be able to directly compare the area where the brightness value is concentrated, and use the midpoint value of the center position 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, this is only an initialization operation before the car starts running, and has no effect on the speed of the car after it starts running. Therefore, this solution can be adopted.
Image Denoising
During the movement of the vehicle, the image does not have too much noise after binarization, but only a small amount of salt and pepper noise appears locally. The typical image is shown in Figure 6. In the design of this system, 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 center coordinate recursion method can be used.
After the black lines of the track are divided into coordinates of each row, the difference between the center coordinates of two adjacent rows is relatively small. According to experimental tests, the difference is generally no more than 5, which has good recursiveness. Therefore, we can use the center coordinates of the previous row to recursively solve it. The specific steps are as follows.
(1) Since the black line near the camera has a better shooting effect, not only is the width of the black line relatively large, but there is basically no noise, it is a very good choice to use it as the reference point for recursion. Since this is the reference point of the entire image, its accuracy is required to be relatively high. When calculating the center coordinate value of the first row, the black line continuous counting method is used, that is, only when 3 or more "1"s are read continuously, it is considered a valid black line, and the number of black line blocks is recorded, otherwise it is cleared to zero, and finally check whether the number of black line blocks in this row is 1. If it is not 1, the second row of image data is used for judgment, and the number is incremented in this way until the only black line is found.
(2) Using the center coordinates found for the first time as a reference, search for the position of the black line in the interval of 10 points on its left and right sides in the upper row. Then, use the centroid method to calculate the center coordinate value of the black point in the interval and use it as the center coordinate reference point of this row.
(3) Follow step (2) and recursively move up one row at a time. If a row with all 0s is encountered, stop searching for black lines. The image shown in FIG6 is processed by the algorithm and the image obtained is shown in FIG7. It can be seen that this method can effectively eliminate image noise.
Previous article:Design of automatic bus stop announcement system based on GPS/GPRS
Next article:Research on sensor layout of line-finding car based on magnetic field detection
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- 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
- [Lazy self-care fish tank control system] BLE_MESH fish tank light peripheral production
- Verilog001
- Inter-core Communication Method of TMS320C6678 Multi-core DSP
- Direct imaging digital exposure technology "prints" the innovative future
- RC π type filter resistor and capacitor value -------
- About the role of capacitors in suppressing differential mode interference and common mode interference
- [Raspberry Pi Pico Review] WS2812B full-color LED light strip/ring display driver
- How to determine the optimal size of a residential energy storage system?
- Hobbylord Bumblebee ST550 Foldable Carbon Fiber Quadcopter
- MM32F103 BUG reminder to avoid falling into the pit 2? Please answer