单片机论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 2161|回复: 0
收起左侧

基于AVR单片机的图像采集与处理系统 毕设翻译

[复制链接]
杨晨123 发表于 2017-5-10 10:07 | 显示全部楼层 |阅读模式
毕设翻译  希望能帮助大家
毕业设计(论文)外文资料翻译

学   院:
            电子工程学院                     
专业班级:
   电气工程及其自动化  G电气132                  
学生姓名:

学  号:

指导教师:
        韩晓春(高级实验师)                             
外文出处:
(外文)Image Acquisition Technology with AVR Single Chip Microcomputer                                   
附   件:
1.外文资料翻译译文;  2.外文原文

指导教师评语:








签名:

年    月    日




        基于AVR单片机的图像采集与处理系统

摘要


图像采集系统是数字图像中一种不可缺少的应用系统。在本文中,我们开发了一种基于AVR单片机的图像采集与处理系统。该系统采用了AVR单片机在低功耗时数字存储器的消耗和数据处理的主控单元。首先,受光侧C3088相机模块通过I2C接口完成了CMOS的初始化。然后,它被用来从LCD上实时显示C3088和获取图像的采集状态。最后,利用单片机串行通信接口发送数据到电脑,在经过数据处理后显示图像。设计了硬件电路和该系统的软件程序。

关键词:图像采集;单片机;AVR串行通信;视频采集

一、简介

随着社会的进步和科学的发展,科技,技术与经济,无论是组织还是个人都倡导得到更多工作和生活环境的安全,其中对防盗措施提出新的要求。作为安全保障的有效手段,在社会治安领域中视频监控发挥着重要的作用,已经越来越受到广泛关注[1-4]。目前,视频监控已经进入所有域名,我们几乎每天可以看到它的应用。图像采集系统在各种数字图像应用系统中是不可或缺的部分。

AVR单片机是基于可编程GSI和计算机技术的大规模集成电路芯片[5-9]。它采集数据和处理功能快速,将各功能模块集成到芯片在各种丰富的便利场合提供其应用软件。与CCD相比,CMOS 图像传感器整合的时间序列处理电路,前端图像信号和数字部分放大器成一个芯片上,所以它的发展在工业界一直有很高的关度。目前,随着技术和工艺的发展,CMOS图像噪声传感器已被有效地改善,其解决能力也明显增强。因为其价格便宜,适用于图像质量,高集成度和相对较少的权力消费,CMOS图像传感器将广泛应用于视频采集域。因此,在本文中,我们发展实施基于AVR单片机方案的视频数据采集系统。该计划驱动器通过单芯片相机C3088[10]单片机数字存储器获取由相机获得的数据原始图像,并通过接口协议实现数据传输和相机初始化。该电路有许多优点,例如结构简单,方便传输和低CPU占用率,可以降低系统的总成本。

二 、系统结构

它可以实现数字化和自动化的平安装数据的电器零件进程传统的光学采集系统。数据的原则处理单元包括数据运算速度快,丰富的外设接口和低功耗。根据这些原则,我们采用AVR单片机微机与设计,高性能的可以结合数据所获得的资料购置仪器的CMOS前端图像传感器,其结构示意图见图1。该系统采用单片机作为微控制器,驱动摄像头通过I2C总线,主要是初始化一些寄存器撰写摄像机的图像传感器。当初始化完成后,相机输出三个符号,包括像素时钟,原料同步信号和垂直同步信号。单片机读取原始数据的图像并从相机数据总线通过测试这三个标志信号,暂时存储数据到数据存储器在单片机,然后通过串行通信传输数据到计算机。

          1.002.jpg

                            图1.  系统结构

三、硬件

执行选择硬件仪器对整个系统的性能是非常重要。我们可以选择高速、高性价比的单片机,我们可以同时选择功能强大、速度快的DSP,多个接口和核心芯片稳定性好,我们还可以选择ARM微处理器。作为视频采集系统、图像系统中使用的传感器的速度可以由单片机控制。在设计过程中,当我们第一次用51系列单片机时,我们发现它无法满足数据庞大的吞吐量所需的视频采集。因此,我们使用ATmega16系统中可以满足设计要求的系统。单片机被广泛应用于爱特梅尔公司的许多领域如工业生产控制、智能仪器、数据采集和家用电器。这种单片机具有RISC结构。由于其先进的指令集和单时钟周期指令执行时间。当它工作达到16 MIPS16兆赫时,它可以减少能耗之间的冲突加快处理速度。执行一个指令只需要一个时钟周期,且速度比传统的单片机快很多,所以它可以胜任高速条件下的A/D采样的控制。但当我们使用DSP,ARM和FPGA/CPLD,它会浪费资源,使系统变得越来越复杂,成本和性能是不合理的。

对于视频采集设备,无论是CCD或CMOS全部采用光接收作为捕获图像的基本措施。核心的CCD / CMOS光接收组件是一个光接收二极管,产生输出电流时,接收光的照射。电流的强度对应光的照射强度。对于周边设备,光接收元件CCD与光接收元件不同,除了光接收二极管。光接收的前部分还包括一个存储单元,用于控制相邻电荷。光接收二极管占多数的面积,即有效的受光面积,CCD光接收组件更大,它可以在相同的条件下获得更强的光信号,并使输出相应的电信号更清楚。由于CMOS图像传感器技术发展很快,每一个光接收元件可以直接集成在CMOS传感器放大器并完成逻辑模数转换。当光接收二极管接收光的照射而产生的模拟电信号,并模拟电信号放大在光接收元件之前转换成相应的数字信号。换句话说,在CMOS传感器,每个光接收组件产品都有最终的数字输出。由于集成度高,体积小,使用方便,内容丰富,图像捕获快速,我们采用CMOS传感器组成的相机模块C3088(OV6620)作为设计的采集设备。

默认的分辨率的摄像头是356×292,所以它非常适合于单芯片微型计算机的操作能力。

该相机模块C3088工作电压为5V,它的引脚20和引脚22与电源连接,和引脚31连接数字地球,与引脚21,引脚15和引脚17连接模拟地球。数据线连接~ Y0Y7PA0 ~ PA7单片机的数据线,和uv0 ~ uv7连接PB0 ~ PB7的单片机,和PCLK与PD2,和超链接与PD3,和垂直同步连接PD4。SDA和SCL与PC1,接PC0。现场可编程逻辑器件包括356×292分辨率的图像阵列,模拟信号处理器,双8位模拟数字转换,模拟视频多路转接器,数字格式输出端口,一个模拟视频接口,I2C总线接口及寄存器。该传感器采用基于完整图像的电子曝光控制算法。

在单片机选择RS232串行通信与计算机通信。它的电路结构非常简单,它可以保证稳定的制度和满足该系统的设计要求。RS232 是个人的电脑通信接口之 一,它是异步传输标准接口构成的电子工业协会(EIA)的。该系统采用 RS232 转连接电脑和传送视频数据。数次存储器采用 8 位数据字节,1 字节停止位和 0 校验位,其速度可以达到 230400bps,和串行端口的速度只有 115200bps 的计算 机中进行选择,它可以实现系统的设计要求。

由于单片机的电压TTL5V,而 RS232 的电压是12V,双方需要进行电平转换来识别。该系统需要与单片机通过MAX232芯片如图2所示连接。

         1.003.jpg

                             图2.电压匹配电路

该液晶显示器采用了真正的智能ZT018彩色液晶显示器。该模块采用的通常 小型公共汽车作为接口,具有基本的绘图功能,因此它可以节省开发时间,并为 开发和转让提供了大量的方便。它的接口模式包括SPI和I2C,只需要两根数据线。

四、软件

软件 C3088 是由 CMOS 图像传感器 OV6620 组成的,它的初始化主要取决于通过I2C对内部寄存器的写入操作。通过软件的初始化设置,视频数字输出可以使用不同的格式并和其他寄存器进行初始化。因为最初的时钟频率的C3088相机模块是17.73 mhz,当它工作在16位数据输出模式,其PCLK时钟周期是112 ns和当它工作在8位数据输出模式,其PCLK时钟周期是56 ns。晶体振荡所采用的单片机是16兆赫和单周期是62.5 ns。因此,单片机不能跟上视频的速度。它必 须通过写频寄存器 0x11 减少 PCLK 钟,并设置“1”寄存器低 5 位才可以减少 PCLK 至 69.25KHz,这样才可适合单芯片微型计算机低速加工。

一般的CMOS图像数据输出格式是原始数据输出格式。由于的CMOS光学传感器单元3种颜色具有不同的反应敏感性,并且反应不是线性。它是相对于亮度,加强和材料。因此图像传感器的原始数据应该被修改和完善。该产品补偿曲线由于工厂的不同而不同,所以我们应该设计不同的补偿算法。OV6620不仅可以输出的R,G和B原始数据格式,并整合芯片色彩补偿算法,它可以根据CCIR601标准输出YUV和YCrCb视频输出格式。

相机通过初始化在最低频率工作。该单片机可在数据存储器阅读时存储数据,它将程序所获得的数据转换为BMP格式,并将数据传送给计算机进行存储和显示。

串行通信是一种沟通的排序传输模式,可以通过位二进制数据,因此该输电线路所需的数量是非常少,这是非常适合分级控制系统,层处控制系统,分布式控制系统和远程沟通。由于分布式控制系统广泛应用于现代计算机控制系统,因此它往往需要一个主要的计算机来控制多个从属计算机,因此通信之间的计算机和单片机成为重要的问题。单片机程序流程如图3所示,该计算机程序流程图如图4。
















附:外文原文

Image Acquisition Technology with AVR Single Chip Microcomputer

小陈

电子信息工程系

南京信息工程大学

中国,南京,210044

rainofsun@netease.com


AbstractThe image acquisition system is one of indispensable parts in various kinds of digital image application system. In this article, we developed a sort of video camera compact image acquisition and processing system based on AVR single chip microcomputer. The system utilises AVR single chip microcomputer ATmega16 with low power consumption and high performance as the data processing main control unit. Firstly, it completes the initialisation of CMOS light-receiving camera module C3088 through I2C interface. Then it is used to acquire image from C3088 and the acquisition states are displayed on LCD real time. Finally, thesingle chip microcomputer utilises serial communication interface to send data to the computer, which displays the image after data processing. The hardware circuit and the software programs of the system are designed.

KeywordsImage acquisition; single chip microcomputer;AVR; serial communication;video surveillance


I. INTRODUCTION

   With the progress of society and the development of science, technology and economy, the demands for more security in working and living environment has beenadvocated by both organizations and individuals, which puts forward new requirements for anti-theft measures. As an effective means of security protection, video monitoring plays an important role in fields of public security, etc., and has drawn increasing and extensive attentions [1-4]. At present, Video supervision and control has entered into all domains, and we can see its applications almost everyday. The image acquisition system is one of indispensable parts in various kinds of digital image application system.

   AVR single chip microcomputer is the integrated chip based on programmable GSI and computer technology [5-9]. Its quick data acquisition and processing function and various function modules integrated in the chip offer abundant conveniences for its applications in various occasions. Comparing with CCD, the CMOS image sensor could integrate the time sequence processing circuit, the front-end amplifier of image signals and digital part into one chip, so its development is highly emphasised by the

industry all along. At present, with the development of technology and technique, the yawp of CMOS image sensor has been improved effectively and its resolvingcapability has been obviously enhanced. CMOS image sensor will be extensively applied in the video acquisition domain because of its cheap price, applied image quality, high integration degree and relatively little power consumption. Therefore, in this article, we develop the implementation program of video data acquisition system

based on AVR single chip microcomputer. The program drives the camera C3088 [10] through single chip microcomputer ATmega16 to obtain the original imagedata acquired by the camera, and implement data transmission and initialisation of camera through I2C interface protocol. This circuit has many advantages such as simple structure, convenient transfer and low CPU occupation rate, and it can reduce the total cost of the System.

          1.004.jpg

II. SYSTEM STRUCTURE

    It can realize the digitalization and automatization of leveling to install the electric parts of data process in traditional optical acquisition system. The principles of data processing unit include quick data operation speed,abundant peripheral interfaces and low power consumption.According to these principles, we adopt AVR single chip microcomputer with high performance in the design, which can combine with the information acquired by the data acquisition apparatus CMOS image sensor in the front end, and its structure sketch is seen in Fig. 1. The system adopt single chip microcomputer as the micro-controller to drive the camera through I2C bus, which mainly initializes some registers which composes the image sensor of the camera.When the initialization of camera is completed, the camera outputs three symbol signals including pixel clock, raw synchronous signal and vertical synchronous signal. The single chip microcomputer read the original data of image

from the camera data bus through testing these three symbol signals and temporarily stores the data into the data memorizer in single chip microcomputer, and then transmit the data to the computer through serial communication.

III. HARDWARE

    The selection of apparatus in the implementation of hardware is very important for the performance of the whole system. We can select the single chip microcomputer with high cost performance and high speed, and we can also select the DSP with powerful function, quick speed,multiple interfaces and good stability as the core chip, and we can also select ARM microprocessor. As the video acquisition system, the image sensor speed used in the system can be controlled by the single chip microcomputer.When we first used 51 series ingle chip microcomputer in the design process, we found it couldn't fulfill the throughput of large data needed by the video acquisition.So we use ATmega16 in the system which can fulfill the design requirement of the system. The single chip microcomputer of ATMEL Company is extensively applied in many domains such as industrial production control,intelligent instruments, data acquisition and home electric appliances. This kind of single chip microcomputer has the structure of RISC. Because of its advanced instruction set and single clock period instruction execution time, the performance of AVR single chip microcomputer can achieve 16 MIPS when it works in 16MHz, which can reduce the conflict between power consumption and processing speed. The execution of one instruction only needs one clock cycle, and the speed is much quicker than traditional single chip microcomputer, so it can be competent for the control of A/D sampling under the condition of high speed. But when we use DSP, ARM or FPGA/CPLD, it will waste the resources and make the system become more complex, and the cost performance is not so reasonable.

    For the video capture equipments,whether CCD or CMOS all adopt the light-receiving component as the basic measure to capture images. The core of CCD/CMOS light receiving component is a light-receiving diode which can produce output current when receiving light irradiation.The intensity of the current is corresponding to the intensity of the irradiation. For the peripheral equipments, the light receiving component of CCD is different to the light receiving component of CMOS, and except for the light receiving diode. The light-receiving component of the former also includes one storage unit which is used to control the neighboring charge. The light-receiving diode occupies most areas, i.e. the effective light-receiving area of the CCD light-receiving component is bigger, and it can receive stronger light signal under same condition, and the corresponding output electric signals are more clear. Because the CMOS image sensor technology develops veryquickly, every light-receiving component in CMOS sensor can directly integrate the amplifier and the analog-to-digital conversion logic. When the light-receiving diode receives light irradiation and produces analog electric signals, and the signals are amplified by the amplifier in the light receiving component firstly and then converted into corresponding digital signals. In another words, in the CMOS sensor, every light-receiving component can product final digital output. Because of high integration degree, small volume, convenient use and abundant image content effect captured, we adopt the camera C3088 module composed by CMOS sensor (OV6620) as the acquisition equipment in the design. The default resolving capability of the camera is 356*292, so it is very fit for the single chip microcomputer with low operation ability.

The work voltage of the camera module C3088 is 5V, and its pin 20 and pin 22 connect with the power supply, and the pin 31 connects with the digital earth, and the pin 21, pin 15 and pin 17 connect with the analog earth. Data lines Y0~Y7 connect PA0~PA7 of the single chip microcomputer, and data lines UV0~UV7 connect with PB0~PB7 of the single chip microcomputer, and PCLK connects with PD2, and HREF connects with PD3, and VSYNC connects with PD4. SDA connects with PC1, and SCL connects with PC0. OV6620 includes the image array with the resolving capability of 356*292, an analog signal processor, double 8bits analog-to-digital conversion, analog video multiple routes commutator, digital output format port, an analog video port, I2C bus interface and its register. The sensor uses the electric exposal control algorithm based on complete image.

The single chip microcomputer selects RS232 serial communication to communicate with the computer. Its circuit structure is very simple, which can ensure thestability of the system and fulfill the design requirement of the system. RS232 is one of communication interfaces on personal computer, and it is the asynchronous transmission standard interface constituted by the Electronic Industries Association (EIA). This system adopts RS232 to connect with computer and transmit video data. The ATmega16 adopts 8bits data bit, 1bit stop bit and 0 parity bit, and its speed can achieve 230400bps, and speed of the serial port of the computer is only 115200bps, which can fulfill the design requirement of the system.

Because the voltage of the SCM is TTL5V and the voltage of the RS232 is -12V, so both sides need level conversion to identify the other. The system needs toconnect with single chip microcomputer through the chip MAX232 as shown in Fig. 2.

         1.005.jpg

The display of LCD adopts ZT018 intelligent true color LCD. This module possesses basic plotting function which adopts usual microbus as the interface, so it can save development time and offer large convenience for the development and transfer. Its interface modes include SPI and I2C, and this system adopts I2C interface which only needs two data lines.

IV. SFOTWARE

    C3088 is composed by CMOS image sensor OV6620, and its initialization mainly depends on the write-operation to interior registers through I2C. Through the initialization setting of the software, the video digital output can use different formats and initialize other registers. Because the initial clock frequency of the C3088 camera module is 17.73MHz, when it works in the 16bits data output mode, its PCLK clock cycle is 112ns and when it works in the 8bits data output mode, its PCLK clock cycle is 56ns. The crystal oscillation adopted by the single chip microcomputer is 16MHz and the single order cycle is 62.5ns. So the single chip microcomputer can not follow

the speed of the video. It must reduce the PCLK clock frequency through writing the register 0x11, and to set the low 5bits of the register in "1" can reduce PCLK to 69.25KHz, which can fit for the single chip microcomputer processing with low speed.

The data output format of the usual CMOS image sensor is the original data output format. Because the CMOS optical sensor unit has different responsesensitivities to three sorts of color, and the response is nonlinear.It is relative to the brightness, plus and materials. So the original data of the image sensor should be emendated and compensated. The product compensation curves of different factories are different, so we should design different compensation algorithms. OV6620 can not only output original data formats of R, G and B, and integrate color compensate algorithms in the chip, and it can output the video output formats of YUV and YCrCb according with the standard of CCIR601.

The camera works in the lowest frequency through initialization. The single chip microcomputer can store the data in the data memorizer of single chip microcomputer when it read a raw of data, and it converts the data acquired by the program into the format of BMP, and transmits the data to the computer for storage and display.

The serial communication is a sort of communication mode which can transmit binary system data by bit, so the quantity of the transmission lines needed by it is very few, and it is very fit for grading control system, layer-division control system, distributed control system and remote communication. Because the distributed control system is extensively applied in the modern computer control system, so it often needs one main computer to control multiple slave-computers, and the communication between the computer and single chip microcomputer becomes into an important problem. The program flow chart of single chip microcomputer is shown in Fig. 3. The program flow chart of computer is shown in Fig. 4.


杨晨 G电气132 翻译中文.docx

119.03 KB, 下载次数: 4, 下载积分: 黑币 -5

翻译

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|小黑屋|单片机论坛 |51Hei单片机16群 联系QQ:125739409;技术交流QQ群7344883

Powered by 单片机教程网

快速回复 返回顶部 返回列表