畢設翻譯 希望能幫助大家
畢業(yè)設計(論文)外文資料翻譯 | | | | |
| |
| | | | (外文)Image Acquisition Technology with AVR Single Chip Microcomputer | | |
基于AVR單片機的圖像采集與處理系統(tǒng) 摘要
圖像采集系統(tǒng)是數(shù)字圖像中一種不可缺少的應用系統(tǒng)。在本文中,我們開發(fā)了一種基于AVR單片機的圖像采集與處理系統(tǒng)。該系統(tǒng)采用了AVR單片機在低功耗時數(shù)字存儲器的消耗和數(shù)據(jù)處理的主控單元。首先,受光側C3088相機模塊通過I2C接口完成了CMOS的初始化。然后,它被用來從LCD上實時顯示C3088和獲取圖像的采集狀態(tài)。最后,利用單片機串行通信接口發(fā)送數(shù)據(jù)到電腦,在經(jīng)過數(shù)據(jù)處理后顯示圖像。設計了硬件電路和該系統(tǒng)的軟件程序。 關鍵詞:圖像采集;單片機;AVR串行通信;視頻采集 一、簡介 隨著社會的進步和科學的發(fā)展,科技,技術與經(jīng)濟,無論是組織還是個人都倡導得到更多工作和生活環(huán)境的安全,其中對防盜措施提出新的要求。作為安全保障的有效手段,在社會治安領域中視頻監(jiān)控發(fā)揮著重要的作用,已經(jīng)越來越受到廣泛關注[1-4]。目前,視頻監(jiān)控已經(jīng)進入所有域名,我們幾乎每天可以看到它的應用。圖像采集系統(tǒng)在各種數(shù)字圖像應用系統(tǒng)中是不可或缺的部分。 AVR單片機是基于可編程GSI和計算機技術的大規(guī)模集成電路芯片[5-9]。它采集數(shù)據(jù)和處理功能快速,將各功能模塊集成到芯片在各種豐富的便利場合提供其應用軟件。與CCD相比,CMOS 圖像傳感器整合的時間序列處理電路,前端圖像信號和數(shù)字部分放大器成一個芯片上,所以它的發(fā)展在工業(yè)界一直有很高的關度。目前,隨著技術和工藝的發(fā)展,CMOS圖像噪聲傳感器已被有效地改善,其解決能力也明顯增強。因為其價格便宜,適用于圖像質量,高集成度和相對較少的權力消費,CMOS圖像傳感器將廣泛應用于視頻采集域。因此,在本文中,我們發(fā)展實施基于AVR單片機方案的視頻數(shù)據(jù)采集系統(tǒng)。該計劃驅動器通過單芯片相機C3088[10]單片機數(shù)字存儲器獲取由相機獲得的數(shù)據(jù)原始圖像,并通過接口協(xié)議實現(xiàn)數(shù)據(jù)傳輸和相機初始化。該電路有許多優(yōu)點,例如結構簡單,方便傳輸和低CPU占用率,可以降低系統(tǒng)的總成本。 二 、系統(tǒng)結構 它可以實現(xiàn)數(shù)字化和自動化的平安裝數(shù)據(jù)的電器零件進程傳統(tǒng)的光學采集系統(tǒng)。數(shù)據(jù)的原則處理單元包括數(shù)據(jù)運算速度快,豐富的外設接口和低功耗。根據(jù)這些原則,我們采用AVR單片機微機與設計,高性能的可以結合數(shù)據(jù)所獲得的資料購置儀器的CMOS前端圖像傳感器,其結構示意圖見圖1。該系統(tǒng)采用單片機作為微控制器,驅動攝像頭通過I2C總線,主要是初始化一些寄存器撰寫攝像機的圖像傳感器。當初始化完成后,相機輸出三個符號,包括像素時鐘,原料同步信號和垂直同步信號。單片機讀取原始數(shù)據(jù)的圖像并從相機數(shù)據(jù)總線通過測試這三個標志信號,暫時存儲數(shù)據(jù)到數(shù)據(jù)存儲器在單片機,然后通過串行通信傳輸數(shù)據(jù)到計算機。
1.002.jpg (7.27 KB, 下載次數(shù): 118)
下載附件
2017-5-10 15:51 上傳
圖1. 系統(tǒng)結構 三、硬件 執(zhí)行選擇硬件儀器對整個系統(tǒng)的性能是非常重要。我們可以選擇高速、高性價比的單片機,我們可以同時選擇功能強大、速度快的DSP,多個接口和核心芯片穩(wěn)定性好,我們還可以選擇ARM微處理器。作為視頻采集系統(tǒng)、圖像系統(tǒng)中使用的傳感器的速度可以由單片機控制。在設計過程中,當我們第一次用51系列單片機時,我們發(fā)現(xiàn)它無法滿足數(shù)據(jù)龐大的吞吐量所需的視頻采集。因此,我們使用ATmega16系統(tǒng)中可以滿足設計要求的系統(tǒng)。單片機被廣泛應用于愛特梅爾公司的許多領域如工業(yè)生產控制、智能儀器、數(shù)據(jù)采集和家用電器。這種單片機具有RISC結構。由于其先進的指令集和單時鐘周期指令執(zhí)行時間。當它工作達到16 MIPS16兆赫時,它可以減少能耗之間的沖突加快處理速度。執(zhí)行一個指令只需要一個時鐘周期,且速度比傳統(tǒng)的單片機快很多,所以它可以勝任高速條件下的A/D采樣的控制。但當我們使用DSP,ARM和FPGA/CPLD,它會浪費資源,使系統(tǒng)變得越來越復雜,成本和性能是不合理的。 對于視頻采集設備,無論是CCD或CMOS全部采用光接收作為捕獲圖像的基本措施。核心的CCD / CMOS光接收組件是一個光接收二極管,產生輸出電流時,接收光的照射。電流的強度對應光的照射強度。對于周邊設備,光接收元件CCD與光接收元件不同,除了光接收二極管。光接收的前部分還包括一個存儲單元,用于控制相鄰電荷。光接收二極管占多數(shù)的面積,即有效的受光面積,CCD光接收組件更大,它可以在相同的條件下獲得更強的光信號,并使輸出相應的電信號更清楚。由于CMOS圖像傳感器技術發(fā)展很快,每一個光接收元件可以直接集成在CMOS傳感器放大器并完成邏輯模數(shù)轉換。當光接收二極管接收光的照射而產生的模擬電信號,并模擬電信號放大在光接收元件之前轉換成相應的數(shù)字信號。換句話說,在CMOS傳感器,每個光接收組件產品都有最終的數(shù)字輸出。由于集成度高,體積小,使用方便,內容豐富,圖像捕獲快速,我們采用CMOS傳感器組成的相機模塊C3088(OV6620)作為設計的采集設備。 默認的分辨率的攝像頭是356×292,所以它非常適合于單芯片微型計算機的操作能力。 該相機模塊C3088工作電壓為5V,它的引腳20和引腳22與電源連接,和引腳31連接數(shù)字地球,與引腳21,引腳15和引腳17連接模擬地球。數(shù)據(jù)線連接~ Y0Y7PA0 ~ PA7單片機的數(shù)據(jù)線,和uv0 ~ uv7連接PB0 ~ PB7的單片機,和PCLK與PD2,和超鏈接與PD3,和垂直同步連接PD4。SDA和SCL與PC1,接PC0。現(xiàn)場可編程邏輯器件包括356×292分辨率的圖像陣列,模擬信號處理器,雙8位模擬數(shù)字轉換,模擬視頻多路轉接器,數(shù)字格式輸出端口,一個模擬視頻接口,I2C總線接口及寄存器。該傳感器采用基于完整圖像的電子曝光控制算法。 在單片機選擇RS232串行通信與計算機通信。它的電路結構非常簡單,它可以保證穩(wěn)定的制度和滿足該系統(tǒng)的設計要求。RS232 是個人的電腦通信接口之 一,它是異步傳輸標準接口構成的電子工業(yè)協(xié)會(EIA)的。該系統(tǒng)采用 RS232 轉連接電腦和傳送視頻數(shù)據(jù)。數(shù)次存儲器采用 8 位數(shù)據(jù)字節(jié),1 字節(jié)停止位和 0 校驗位,其速度可以達到 230400bps,和串行端口的速度只有 115200bps 的計算 機中進行選擇,它可以實現(xiàn)系統(tǒng)的設計要求。 由于單片機的電壓TTL5V,而 RS232 的電壓是12V,雙方需要進行電平轉換來識別。該系統(tǒng)需要與單片機通過MAX232芯片如圖2所示連接。
1.003.jpg (14.83 KB, 下載次數(shù): 106)
下載附件
2017-5-10 15:51 上傳
圖2.電壓匹配電路 該液晶顯示器采用了真正的智能ZT018彩色液晶顯示器。該模塊采用的通常 小型公共汽車作為接口,具有基本的繪圖功能,因此它可以節(jié)省開發(fā)時間,并為 開發(fā)和轉讓提供了大量的方便。它的接口模式包括SPI和I2C,只需要兩根數(shù)據(jù)線。 四、軟件 軟件 C3088 是由 CMOS 圖像傳感器 OV6620 組成的,它的初始化主要取決于通過I2C對內部寄存器的寫入操作。通過軟件的初始化設置,視頻數(shù)字輸出可以使用不同的格式并和其他寄存器進行初始化。因為最初的時鐘頻率的C3088相機模塊是17.73 mhz,當它工作在16位數(shù)據(jù)輸出模式,其PCLK時鐘周期是112 ns和當它工作在8位數(shù)據(jù)輸出模式,其PCLK時鐘周期是56 ns。晶體振蕩所采用的單片機是16兆赫和單周期是62.5 ns。因此,單片機不能跟上視頻的速度。它必 須通過寫頻寄存器 0x11 減少 PCLK 鐘,并設置“1”寄存器低 5 位才可以減少 PCLK 至 69.25KHz,這樣才可適合單芯片微型計算機低速加工。 一般的CMOS圖像數(shù)據(jù)輸出格式是原始數(shù)據(jù)輸出格式。由于的CMOS光學傳感器單元3種顏色具有不同的反應敏感性,并且反應不是線性。它是相對于亮度,加強和材料。因此圖像傳感器的原始數(shù)據(jù)應該被修改和完善。該產品補償曲線由于工廠的不同而不同,所以我們應該設計不同的補償算法。OV6620不僅可以輸出的R,G和B原始數(shù)據(jù)格式,并整合芯片色彩補償算法,它可以根據(jù)CCIR601標準輸出YUV和YCrCb視頻輸出格式。 相機通過初始化在最低頻率工作。該單片機可在數(shù)據(jù)存儲器閱讀時存儲數(shù)據(jù),它將程序所獲得的數(shù)據(jù)轉換為BMP格式,并將數(shù)據(jù)傳送給計算機進行存儲和顯示。 串行通信是一種溝通的排序傳輸模式,可以通過位二進制數(shù)據(jù),因此該輸電線路所需的數(shù)量是非常少,這是非常適合分級控制系統(tǒng),層處控制系統(tǒng),分布式控制系統(tǒng)和遠程溝通。由于分布式控制系統(tǒng)廣泛應用于現(xiàn)代計算機控制系統(tǒng),因此它往往需要一個主要的計算機來控制多個從屬計算機,因此通信之間的計算機和單片機成為重要的問題。單片機程序流程如圖3所示,該計算機程序流程圖如圖4。
附:外文原文 Image Acquisition Technology with AVR Single Chip Microcomputer 小陳 電子信息工程系 南京信息工程大學 中國,南京,210044 rainofsun@netease.com
Abstract:The 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. Keywords:Image 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 (8.47 KB, 下載次數(shù): 94)
下載附件
2017-5-10 15:51 上傳
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 (16.76 KB, 下載次數(shù): 96)
下載附件
2017-5-10 15:51 上傳
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.
|