基于CMOS摄像头的智能车路径识别与方向控制 毕业论文外文翻译.docx_第1页
基于CMOS摄像头的智能车路径识别与方向控制 毕业论文外文翻译.docx_第2页
基于CMOS摄像头的智能车路径识别与方向控制 毕业论文外文翻译.docx_第3页
基于CMOS摄像头的智能车路径识别与方向控制 毕业论文外文翻译.docx_第4页
基于CMOS摄像头的智能车路径识别与方向控制 毕业论文外文翻译.docx_第5页
已阅读5页,还剩5页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

英文原文Route Identification and Direction Control of Smart Car Based on CMOS Image SensorAbstractThis paper is designed for the 2nd Freescale Cup National Undergraduate Smart Car Competition. With MC9S12DG128 single chip and smart car model supplied by the committee, a CMOS image sensor is applied to detect the black track on white raceway, which extends the detection range and is helpful to predict the forward path. In this paper, ten-line pixels in an image are analyzed to locate the black track, and the PD algorithm based on PID is employed to control the direction and angle of the steering gear respectively. By repeated testing, the smart car can run stably on the given raceway at a high speed.Keywords: route identification, direction control, smart car, MC9S12DG128 single chip, image sensor, PIDalgorithm.1. IntroductionThe rules of 2nd Freescale Cup National Undergraduate Smart Car Competition 1 may be summarized as follows: the raceway consists of a lot of white boards on which a black track is attached; the smart car designed by participants runs along the black track;every car runs two circles in this game and the best times of two circles will be the final score of this car, and apparently the team whose car takes the best times will bear the palm. According to the rules, we should ensure that the car can distinguish the black track from white board in order to make the smart car run stably. There are two common methods for route identification: one is using infrared diode as the sensor, and another is using CCD/CMOS image sensor 2. This paper using CMOS image sensor as route identification sensor, the reasons for which are as follows: (1) The range which is covered by a infrared diode sensor is much smaller than a CMOS image sensor covers, and only we can do is to use several diode sensors, but the maximum number of diode sensors used in the smart car is 16; (2) The working voltage of a CMOS image sensor(3.3V) is less than a CCD(12V) or 16 infrared diodes. Apparently, using CMOS image sensor can not only reduce the power consumption but also extend the visible range of the smart car, and also enable the car to predict the forward path. This paper presents a systemic solution for identifying the raceway and controlling the direction of smart car. 2. CMOS cameraThere are several kinds of CMOS image sensors in the market. In comparison with other CMOS image sensors, the OV6130 CMOS image sensor 3 made by OmniVision Technologies Inc. is the best choice for us to design a CMOS camera for smart car whether from the viewpoint of cost and performance or power consumption. The OV6130 is a black and white sensor which has a 1/4 inch CMOS imaging device containing approximately 101,376 pixels (352288). This sensor includes a 356292 resolution image array, an analog signal processor, dual 8-bit A/D converters, analog video multiplexer, digital data formatter, video port, SCCB interface, registers, and digital controls that include timing block, exposure control, black level control, and white balance.By assembling the experimental circuit we test the OV6130 output ports timing (VSYNC, FODD, HERF). Figure 1 shows the experimental timing diagrams. (a) VSYNC-FODD timing (b) FODD-HERF timingFigure 1 OV6130 experimental timing diagramsFigure 2 Structure of the image capturing and displaying systemReferring to the OV6130 datasheet, these timing diagrams match well with those given in datasheet, thus we produce the OV6130 CMOS camera based on the experimental circuit. In order to check whether the images captured by camera have clear definition and sharp contrast or not, and also to confirm the visible range of the camera, we design a VB program for capturing the images and displaying them on computer screen. This program bases on three hardware devices: CMOS camera, MCU or single chip, PC. Figure 2 presents how these three devices work together.Figure 3 compares the original image of a snake line of raceway with the image captured by CMOS camera and then displayed on screen by VB program. It can be seen that the captured image has clear definition and sharp contrast, and this lays a foundation for route identification to be discussed later.(a) Smart car ready to scan the raceway(b) Captured image by CMOS cameraFigure 3 Comparison between original image and captured image3. Route identificationRoute identification aims at helping the smart car to recognize the forward track by a method which picks up the black line from the image captured by CMOS camera,and in fact, this method works well in the following cases:straight line, curving line and snake line. By repeated testing, we decide to analyze 10 lines of a whole image to predict the forward condition of smart car. Figure 4 illustrates how we analyze the 10-line pixels of an image. Figure 4 Route identification diagramThe detailed algorithm is introduced as follows:Step 1: Calculate coordinates of the black pixel for each line ready to be analyzed. As is illustrated in figure 4, the lines (L0, L1, , L8, L9) are to be analyzed, and the white points (P0, P1, , P8, P9) are black pixels for each line. The origin O is superposed by P9, which means there is no black pixel in line L9. Assumed that P(x) and P(y) indicate x-coordinate and y-coordinate of point P,respectively, here both P9(x) and P9(y) equal 0.The key of this step is to find the black pixel of each line. Here, by taking the following datum which shows the gray values of all pixels in a line as example, we introducea new approach:195 210 207 215 208 228 236 243 238 234 238 235 231 233 230 235 230 222 196 207 204 208 209 129 160 65 17 15 19 18 79 151 172 153 173 150 147 159 141 153 147 154 137 139 156 136 141 9 141 133 138 4 127 110 141 112 104(1) Assumed that P is the black pixel of this line, G(i)denotes a pixel and i indicates its position in this line, V(i) is the gray value of G(i), j is the position of the first black pixel appearing in the line from left to right. Here both P(x) and P(y) are initiated to 0, and j is 0 from the start.(2) As for each pixel in this line from left to right,comparing its gray value with the black value B, here we set B as 30, G(i) is a black pixel on condition that V(i) is less than B. In the line above, the pixels underlined in bold, whose gray values are 17,15,16,18, are component points of the black track, and the pixels underlined both in bold and italic, whose gray values are 9,4, are invalid or interferential pixels. If V(i) is less than B, set j as i. Then compare V(j+1) and V(j+2) with B respectively, results go to two sides: If both V(j+1) and V(j+2) are less than B, check the gray value for each pixel from G(j+3) to the end pixel of this line. If the total number of white pixels whose gray values are greater than B surpasses or equals to 3, then set P as G(j+1). Otherwise, go to (3); If not, repeat this way from the point G(j+3) on.(3) If there is no black pixel in this line, set both P(x) and P(y) as 0.Step 2: Calculate the average coordinates of 10 black pixels. As is showed in Figure 4, M is the average point, M(x) and M(y) are expressed as follows:Step 3: According to the position of M in the image,we can decide in which direction (ahead, left, or right) the smart car should turn. In Figure 4, the smart car should turn right obviously.Step 4: Calculate how many angles the car should turn.Further descriptions is illustrated in Figure 5, where is the very angle by which the car should turn right, F is the central point of two front wheels, M is the average point mentioned previously (see Figure 4), D and L1 indicate the width and height of the visible range of CMOS camera respectively, L2 is the distance between visible range and front wheels, L3 is a half of front wheels diameter, L2+L3 means the distance between visible range and the axis of front wheels. Referring to Figure 5, it is very easy to calculate the angle .Figure 5 Calculating the angle for turning4. Direction controlThe central unit for direction control of smart car is steering gear, its input signal is PWM (Pulse-Width Modulation) pulse, and it outputs corresponding angle in radian. This paper uses the PWM output port of MC9S12DG128 single chip 4 as the input signal of steering gear. By inputting the given discrete width of pulse, we test the relationship between the input and the output. The formula below expresses it:where X is tangential value of the output angle, Y is width of the input pulse, y0 is the corresponding value when the output angel equals 0 and k is slope. Using this linear relationship we can operate the smart car simply just by inputting the target angel, thus the width of pulse which is the input signal of steering gear can be computed easily,this method, however, doesnt work well in the following cases: curving line and snake track. Therefore we apply the PID 5 (Proportional, Integral, and Differential) controller which is very popular in fields of automation and control technology. The kernel theory of PID is to do proportional, integral and differential operations on the input difference respectively, then join the three results as the final output value. In practice, it is very flexible for us to use according to features and demands of the object to be controlled. We may choose one or two or all of PID modules, for example, we can use proportional and integral modules to make up of PI controller.As for the smart car, it is no necessary to consider the tracks which have been gone across, so we only use proportional and differential modules as PD adjuster, and P adjuster has been described previously (see Formula(2), and the following formula shows the D adjuster:where enew , eold define the differences of this time and last time when the angle is computed (here difference means the angel by which the steering gear should turn), t is scanning period of CMOS camera, kd is differential coefficient which runs from 0.5 to 1.5, D_out is the output of D adjuster.5. ConclusionsThe challenge of this work is a systemic solution for identifying the black route and controlling the direction of smart car. The performance of CMOS camera is apparently superior to infrared diode whether in scanning range or whether in power consumption, and the clear definition and sharp contrast of image are also important for the further recognition and control. By repeated testing, it is proved that the PD adjuster works well whenthe car runs whether on curving line or on snake track at a high speed, and the stability of smart car is also promoted.中文译文基于CMOS摄像头的智能车路径识别与方向控制摘要本文是为第二届飞思卡尔杯全国大学生智能车大赛而设计的。用单片机MC9S12DG128和由组委会提供的智能车模型,一个用于检查白色底板上的黑线的CMOS图像传感器,增大了检测范围和前瞻距离。本文,每帧图像数据采集10行进行分析,确定黑线位置,用基于PID算法的PD控制器应用于舵机的方向和角度控制。通过反复测试,智能车能以高速稳定的巡线。关键字:路径识别,方向控制,智能车,MC9S12DG128单片机,图像传感器,PID1、引言第二届飞思卡尔杯全国大学生智能车大赛规则可归纳如下:赛道由多个白色底板并在上面粘上黑色胶带构成;由参赛队员设计的只能车需沿黑线运行;每辆车在赛道上跑两圈,两圈中的最好成绩算作最终得分,显然哪支队伍取得的成绩最好则赢得比赛。根据规则,我们可以确定的是车必须能从白色底板上识别出黑线才能让智能车稳定运行。一般有两种方式检测路径:一种是用红外对管作为传感器,另外一种就是用CCD/CMOS图像传感器。本文使用CMOS图像传感器作为路径识别传感器,原因有以下几点:(1)红外对管检测范围远小于CMOS图像传感器,众所周知,要想增大红外对管检测范围只有增加红外对管数量才能达到目标,但是传感器使用的最大数目不得超过16个;(2)CMOS图像传感器的工作电压(3.3V)远小于CCD(12V)或者16个红外对管。很明显,用CMOS图像传感器不仅会减小功耗而且还能增加智能车的视野,另外也提高了智能车的前瞻性。本文提出了一种智能车的路径识别和方向控制的系统性解决方案。2、CMOS摄像头市场上有多种CMOS图形传感器。与其他CMOS图像传感器相比,由OmniVision科技有限公司制造的OV6130 CMOS传感器,无论从价格或者是性能、功耗方面都是我们设计智能车的最好选择。OV6130是一个黑白图像传感器,内部有1/4英寸的CMOS感光设备,包含了101376个像素点(352288)。此传感器包含了一个356292分辨率的图像阵列,一个模拟信号处理器,双8位精度A/D转换器,模拟信号多路复用器,二进制数据格式器,视频输出口,SCCB接口,寄存器和数字控制寄存器,该寄存器包括时钟模块,曝光控制,黑色电平控制和白平衡。通过连接实验性电路,我们开始测试OV6130输出口的时序(VSYNC, FODD,HERF)。图1表示了实验得到的时序表(a) VSYNC-FODD 时序图(b) FODD-HERF 时序图图1 OV6130实验所得时序图图2 图像采集和现实系统结构根据OV6130的数据手册,这些时序图与手册上给出的数据非常吻合,因此,我们开发了基于实验电路的OV6130电路板。为了核实摄像头获得的图像是否有较高清晰度和对比度,以及确认摄像头的可视区域,我们为拍摄到的图像设计了VB上位机程序以方便在计算机屏幕上显示所得数据。此程序基于三个硬件设备:CMOS摄像头,单片机,PC。图2表示了三个设备是如何同时在一起工作的。图3比较了CMOS摄像头获得的弯道原始图像,之后用VB程序将其显示在计算机上。从它可以看出获得的图像有较高清晰度和对比度,这为以后的路径识别奠定了基础。(a)智能车准备扫面赛道(b)由CMOS摄像头拍摄到的图像图3 原始图像与拍摄到的图像对比3、路径识别路径识别的目的是通过从获得的图像中提取一条黑线帮助智能车感知前方路径信息。事实上,这种方法用在以下几种赛道上都工作的很好:直到,弯道,S道。通过重复测试,我们觉定每幅图像提取10行来预知智能车前方的路况信息。图4说明了我们如何分析一幅图像中的10行数据。图4 路径识别示意图详细的算法介绍如下:Step1:计算每行中黑点的坐标准备分析。如同图4所示,每行(L0,L1,L8,L9)都要分析。图中的白点(P0,P1,P8,P9)表示每行测得的黑点。原点O与P9叠加,意味着字L9没有黑点。假定P(x)和P(y)表示P点的x坐标和y坐标,故此,知P9(x)和P9(y)均等0。本步的关键在于如何找到各行的黑色像素点。这里,以一行的灰度值为例我们介绍一种新方法:195 210 207 215 208 228 236 243 238 234 238 235 231 233 230 235 230 222 196 207 204 208 209 129 160 65 17 15 19 18 79 151 172 153 173 150 147 159 141 153 147 154 137 139 156 136 141 9 141 133 138 4 127 110 141 112 104(1)假定P是此行的黑色像素点,G(i)表示一个像素点,i表示该像素点在此行的位置,V(i)是点G(i)的灰度值,j就是此行从左到右出现的第一个黑色像素点。这里P(x)和P(y)均是从0开始,j也是从0开始。(2)对于此行从左到右的每个像素点,用阈值B比较他的灰度值,

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论