Beginning Arduino ov7670 Camera Development-Robert Chin(2015).pdf

(5604 KB) Pobierz
i
Beginning Arduino ov7670 Camera
Development
Robert Chin
Copyright © 2015 Robert Chin All rights reserved. ii
Copyright © 2015 Robert Chin All rights reserved. iii
Table of Contents
About the Author
…………………………………………………………………………..iv
Introduction …………………………………………………………………………………
v
Chapter 1: Introducing the Omnivision OV7670 Camera ………………………………1
Chapter 2: Introducing the Arduino ……………………………………………………..19
Chapter 3: Arduino Programming Language Basics ………………………………….39
Chapter 4: Digital Design Review ……………………………………………………….53
Chapter 5: Taking Photos with the Omnivision ov7670 Camera – Part 1 …………..77
Chapter 6: Taking Photos with the Omnivision ov7670 Camera – Part 2 …………185
Appendix A: Camera Register Defines ………………………………………………..225
Appendix B: Image Capture Program Variables ……………………………………..238 iv
About the Author:
Robert Chin has a Bachelor of Science degree in computer engineering and is
experienced in Arduino camera development, C/C++, Unreal Script, Java, DirectX,
OpenGL, and OpenGL ES 2.0. He has written 3d games for the Windows, and Android
platforms. He is the author of “Beginning Android 3d Game Development”, and
“Beginning IOS 3d Unreal Games Development” both published by Apress and was the
technical reviewer for “UDK Game Development” published by Course Technology
CENGAGE Learning.
v
Introduction
This book is meant to be a quick start guide to using the Omnivision ov7670 digital
camera. I show you in a detailed step by step hands on example how to take photos with
the ov7670 camera using an Arduino Mega 2560 and how to use a SD card reader/writer
to save these images to an SD card. Then, I show you how to transfer these images to your
computer and convert them to a common image format that is easily viewable. This book
would also be beneficial to those that want to develop Arduino programs for cameras
other than the ov7670 since much of the information presented here can also be applied to
other digital cameras.
Note: Chapter 6: Taking Photos with the Omnivision ov7670 Camera – Part 2 is the
chapter you want to read if you want to quickly put together a working camera system.
A summary of the content of the book’s chapters follows.
Chapter 1: “Introducing the Omnivision OV7670 Camera” – In this chapter I discuss in
detail the ov7670 camera in terms of its features, operation, and steps needed in order to
take a photo.
Chapter 2: “Introducing the Arduino” – Here I start by giving some background
information about the Arduino. I then give an in depth discussion of the Arduino Mega
2560 board, and then I guide the reader through a hands on example where I show you
how to setup your Arduino and how to get a simple program that controls the blinking of a
light working.
Chapter 3: “Arduino Programming Language Basics” – In this chapter I discuss the
basics of the Arduino programming language.
Chapter 4: “Digital Design Review” – In this chapter I cover how the ov7670 works at a
chip level. I cover the main camera chip, the frame buffer memory chip, and how these
two chips are connected together. I discuss the general procedure to capture a video frame
to the camera’s frame buffer memory and how to read the image data from the camera’s
frame buffer memory.
Chapter 5: “Taking Photos with the Omnivision ov7670 Camera – Part 1” – In this
chapter I discuss the SD card reader/writer, the I2C interface, and the Arduino program or
“sketch” I wrote to capture an image from the camera and then to save it on a SD card. I
also cover ffmpeg which is used to convert the images produced by the camera into
common easily viewable images.
Chapter 6: “Taking Photos with the Omnivision ov7670 Camera – Part 2” – In this
chapter I present a hands on example where I show you step by step how to take a photo
with the camera and save it to an SD card using the image capture software I developed.
This chapter explains everything from the connections required, how to use the image
capture software, and how to convert the final images to an easily viewable format. This is
the chapter you want to read if you just want to quickly put together a working camera
system.
Appendix A: “Camera Register Defines” – This appendix lists all the important camera
registers and values
Appendix B: “Image Capture Program Variables” – This appendix lists all the variables
Zgłoś jeśli naruszono regulamin