39

Click here to load reader

Camera Document

Embed Size (px)

Citation preview

Page 1: Camera Document

P a g e | 1

Camera Document

By Kristin Tanaka & Carlos Terrazas

Table of Contents Camera Document .................................................................................................................................................................. 1

Executive Summary ................................................................................................................................................................. 3

Project and System Level Requirements ................................................................................................................................ 3

System Level Task Descriptions .............................................................................................................................................. 3

Cost ......................................................................................................................................................................................... 4

Technical Divisions .................................................................................................................................................................. 5

Color Tracking and Edge Detection Track ............................................................................................................................... 5

Read articles on image processing .......................................................................................................................................... 5

Research Processing as a language and download environment to PC.................................................................................. 6

How to Download and Install Processing............................................................................................................................ 7

Example of Processing Development Environment ............................................................................................................ 9

Proceed with using examples and/or modifying code........................................................................................................ 9

Edge Detection example code ........................................................................................................................................ 9

Edge Detection example shows edges of leaves of jpeg file: ....................................................................................... 11

Simple color tracking example code: ............................................................................................................................ 11

Simple color tracking example shows tracking of blue color in center using webcam: ............................................... 12

Blob Detection example code ....................................................................................................................................... 13

Blob Detection example shows the detection of darker areas of image using webcam .............................................. 16

Edge Detection Background .............................................................................................................................................. 16

Types of edge detection .................................................................................................................................................... 17

Canny ............................................................................................................................................................................ 17

Prewitt ........................................................................................................................................................................... 17

Sobel .............................................................................................................................................................................. 17

Laplacian ....................................................................................................................................................................... 17

Edge Detection Simulation in Matlab using webcam (Prewitt Method): ..................................................................... 17

Edge Detection example shows an image taken from webcam: .................................................................................. 18

Page 2: Camera Document

P a g e | 2

Image Capture Track ............................................................................................................................................................. 19

SD card breakout board .................................................................................................................................................... 20

File Allocation Table (FAT)................................................................................................................................................. 21

Connecting Camera to Arduino (shown below)Figure 21. ................................................................................................ 22

Schematic of camera and breakout board with Arduino (shown below)Figure 22. ......................................................... 22

Connections ...................................................................................................................................................................... 23

Connecting Camera and Arduino .................................................................................................................................. 23

Connecting SD breakout board and Arduino ................................................................................................................ 23

Power Supply Connection ............................................................................................................................................. 23

Getting Started ...................................................................................................................................................................... 23

Software Needed: ............................................................................................................................................................. 23

Libraries Needed: .............................................................................................................................................................. 23

Testing Components Individually .......................................................................................................................................... 24

Testing SD card .................................................................................................................................................................. 24

Testing Camera ................................................................................................................................................................. 24

Store photo data into SD card ........................................................................................................................................... 26

Putting It All Together ........................................................................................................................................................... 30

Step One ............................................................................................................................................................................ 30

Step Two ........................................................................................................................................................................... 32

Future Considerations ........................................................................................................................................................... 36

Survey .................................................................................................................................................................................... 37

Processing ......................................................................................................................................................................... 37

Cameras ............................................................................................................................................................................ 37

NTSC/PAL .......................................................................................................................................................................... 38

Android ............................................................................................................................................................................. 38

Future Research .................................................................................................................................................................... 39

Page 3: Camera Document

P a g e | 3

Executive Summary The Camera group is responsible for measuring distance to and tracking a target using a low cost CCD camera.

The current onboard data subsystem is to be designed around an Atmega328P Arduino Uno microcontroller board. The

group must use a camera during mission to track targets using edge detection.

Project and System Level Requirements The top level requirement is to have the robot be completely autonomous using the camera to complete

mission.

System Level Task Descriptions Phase ONE

- Research articles on image processing (w/ edge detection) and color tracking

- Run through processing tutorials with jpg files

- Get camera to communicate to Arduino

Phase TWO

- Use video from camera to demonstrate edge detection and color tracking

Phase THREE

- Write color tracking and edge detection algorithms in C++ targeting the Arduino Uno microcontroller

board

Page 4: Camera Document

P a g e | 4

Cost

Qty. Product Description Source/Link Price Each Price Total

Current Products for 400D

1 LinkSprite JPEG Color Camera TTL Interface

capture and output JPEG images through UART

https://www.sparkfun.com/products/10061

- complete datasheet available

$44.95

$44.95

1 Arduino Duemilanove Board

Microcontroller board based on the ATmega168

http://www.amazon.com/Arduino-Duemilanove-Board/dp/B004A7L3NC/ref=pd_sim_pc_2/175-6461241-7454258

$19.95

FREE

1 SD Breakout Board

does the 3.3V to 5V translation

http://www.bing.com/images/search?q=SD+Card+Breakout+Board&view=detail&id=CBEFE685D401083CBBCFBC4441BB71B32539C7BC

$3.99

$3.99

TOTAL:

~ $50

Future Products for 400D

1 Arduino Due

512 kB flash memory, 96 kB SRAM, 84 MHz clock speed,

3.3V device

http://www.mouser.com/ProductDetail/Arduino/A000062/?qs=%2fha2pyFaduiZABvG4cWGliztKnOI%252bnXJLcGrUqiduMw%3d

- complete datasheet available

$47.50

$47.50

1 CMOS Video Camera - 640x480

5V to 15V input, 50mA (@12V), switchable NTSC

and PAL output using a jumper

http://store.diydrones.com/Mini_high_resolution_CCD_camera_ideal_for_FPV_day_p/cm-26n.htm

- Full spec sheet available

$31.95

$31.95

Two products = $80 || ~$20 for shipping TOTAL :

~ $100.00

Page 5: Camera Document

P a g e | 5

Technical Divisions

Color Tracking and Edge Detection Track 1. Read articles on image processing (w/ edge detection) and color tracking previously mentioned.

2. Run through processing tutorials with jpg files. Test your knowledge by introducing color tracking algorithm

written in processing.

3. Using video from our hobby cameras demonstrate edge detection and color tracking.

Read articles on image processing Color tracking is described in this article as isolating a single color to obtain useful information about that object.

Maintaining six color thresholds for each of the scanned pixels allows an upper and lower allowed value for each of the

Red, Green, and Blue values that make up a single pixel’s color. RGB color channels have values with a range from 0 to

255. Any single colored pixel will have a mixture of these three channels with each having a single value. For example,

white is 255/255/255 and black is 0/0/0. Having six thresholds allows a range of colors for slight variation in the color

you are tracking due to lighting and shadows in an image. In this example, an algorithm goes through the image once,

searching for these specified pixels one by one and creates a bounding box and a centroid. A noise filter is also used to

improve accuracy.

http://www.cmucam.org/projects/cmucam4/wiki/Color-tracking_Explanation

Figure 1. CMUcam4-color tracking.

Images and Pixels, the title of this article, are discussed in a simple explanation and introduction to help with

their understanding and coding. Processing is the language this article refers to. How to load, display and filter images

are discussed. Image pixels are shown to be in arrays and are easily accessed individually as well as by groups to

produce different kinds of filters, such as edge detecting, sharpening and blurring images. These are merely simple ideas

but show you how they can be built upon or improved with time and experience. Figure below shows a sharpened area

of an image done with convolution using a 3x3 matrix, where the eight weighted pixels that surround a center pixel are

at a negative one value, and the center pixel value is nine.

Page 6: Camera Document

P a g e | 6

http://processing.org/learning/pixels/

Figure2. Processing-tutorial on images and pixels.

Research Processing as a language and download environment to PC Processing is a programming language developed at MIT for nonprogrammers interested in visual arts. It is

based on the Java Programming Language. In 2001, Ben Fry and Casey Reas founded Processing while students at MIT.

It can be used on Windows, Mac, and GNU/Linux platforms. Software is free to use and download. It is open source

which makes it popular amongst professionals and students alike. Online community support continues to grow, along

with the number of libraries available.http://www.csulb.edu/~hill/ee444/Lectures/Software.pdf

The link below takes you to an edge detection example shown in the figure below. It can also be reached by

clicking on the Learning tab from the Processing homepage, and clicking on Topics. From there you have a choice of

many examples. This edge detection code will be discussed later on in the paper. Libraries are accessed under the

Reference tab while Tutorials and Basics (basic examples) are also under the Learning tab.

http://processing.org/learning/topics/edgedetection.html

Figure 3. Processing-edge detection example.

Page 7: Camera Document

P a g e | 7

While learning and becoming more familiar with Processing and edge detection I studied this simple edges

example from the link below. If you take the difference in brightness of two neighboring pixels you shall get a simple

form of edge detection. Differences in brightness will be due to an edge, whereas a very small difference lends to no

edge or discontinuity. The figure shows how edges are found on an image of a sunflower.

http://www.learningprocessing.com/examples/chapter-15/example-15-12/

Figure 4. Sunflower edges example for processing.

How to Download and Install Processing

In this section I will provide you with step-by-step instructions for installing Processing on your computer. The

link to the home page is provided below.

http://processing.org/

The first step is going to the Processing.org homepage. From there you can access the Download page by

clicking on Download or Download Processing, shown below.

Figure 5. Processing home page - Access to download, tutorials, etc.

Click here

Page 8: Camera Document

P a g e | 8

The second step is once you are on the download page you can choose your operating system. Click on your

choice of platforms and begin to download.

http://processing.org/download/

Figure 6. Download Processing to your PC.

Step three is to figure out how to get started with simple examples to verify everything is working properly. You

can access Tutorials under the Learning tab or straight from the Download page. Once there you can click on the Getting

Started tutorial shown below. This tutorial will guide you through extracting files if necessary and running a simple

example. It also introduces you to the Processing Development Environment functions. There is a troubleshooting page

if necessary.

http://processing.org/learning/

Figure 7. Under Learning Tab- Different tutorials and examples on basics, topics, and getting started. Getting Started

tutorial helps to get processing running on your PC.

Download

Getting Started Tutorial

Page 9: Camera Document

P a g e | 9

Example of Processing Development Environment

Below is an example of the Processing Development Environment you would work with in Processing. From top

to bottom you see the name of your sketch, the menus, the toolbar, tabbed sketches, text editor, a one line message

area, followed by a console for technical details.

Figure 8. Processing Development Environment (PDE) example .

Proceed with using examples and/or modifying code

Edge Detection example code

The following code provides an edge detection example of a branch of leaves. By manipulating the code

somewhat we are able to see a before and after shot of the leaves. The kernel values are adjustable and can be tinkered

with to provide better results for each image. Originally, the center value in the kernel is a positive 9. This is a general

sharpening kernel. The first for loop goes through the rows while the second for loop goes through the columns. The

third and fourth loop go through the kernel’s rows and columns and sharpen the image. The original code can be found

here: http://processing.org/learning/topics/edgedetection.html

Page 10: Camera Document

P a g e | 10

/**

* Edge Detection. * * A high-pass filter sharpens an image. This program analyzes every * pixel in an image in relation to the neighboring pixels to sharpen * the image. This example is currently not accurate in JavaScript mode. */ // The next line is needed if running in JavaScript Mode with Processing.js /* @pjs preload="moon.jpg"; */ float[][] kernel = {{ -1, -1, -1}, { -1, 7.99, -1}, { -1, -1, -1}}; PImage img; void setup() { size(640, 360); img = loadImage("leaves.jpg"); // Load the original image noLoop(); } void draw() { image(img, 0, 0); // Displays the image from point (0,0) img.loadPixels(); // Create an opaque image of the same size as the original PImage edgeImg = createImage(img.width, img.height, RGB); // Loop through every pixel in the image. for (int y = 1; y < img.height-1; y++) { // Skip top and bottom edges for (int x = 1; x < img.width-1; x++) { // Skip left and right edges float sum = 0; // Kernel sum for this pixel for (int ky = -1; ky <= 1; ky++) { for (int kx = -1; kx <= 1; kx++) { // Calculate the adjacent pixel for this kernel point int pos = (y + ky)*img.width + (x + kx); // Image is grayscale, red/green/blue are identical float val = red(img.pixels[pos]); // Multiply adjacent pixels based on the kernel values sum += kernel[ky+1][kx+1] * val; } } // For this pixel in the new image, set the gray value // based on the sum from the kernel edgeImg.pixels[y*img.width + x] = color(sum, sum, sum); } } // State that there are changes to edgeImg.pixels[] edgeImg.updatePixels(); image(edgeImg, width/2, 0); // Draw the new image }

A Kernel is a 3x3 matrix that has

different weights for each pixel.

Through a process, each center pixel

in this example is sharpened.

Here is the algorithm used to sharpen

each pixel. A convolution process

takes place as each of the kernel values

are used to calculate each pixel. Four

for loops go through the kernel column

by column, row by row.

Page 11: Camera Document

P a g e | 11

Edge Detection example shows edges of leaves of jpeg file:

Figure 9. Original jpeg image is shown on left and filtered image on right shows the process of edge detection.

Simple color tracking example code:

The following code initially tracks a chosen color and can be changed by the user clicking on a particular colored

pixel. This code captures video and in this example uses a laptop webcam. Two for loops go through each row, column

by column. The distance function is used to compare each pixel with the tracked color, frame by frame. Once the

algorithm finds a colored pixel within a specified range of the color being tracked it will draw a specified sized shape

around that pixel and thus track that color being targeted. The original code can be found here:

http://www.learningprocessing.com/examples/chapter-16/example-16-11/

// Learning Processing

// Daniel Shiffman

// http://www.learningprocessing.com

// Example 16-11: Simple color tracking

import processing.video.*; // tutorial: http://www.silentlycrashing.net/p5/libs/video/

// Variable for capture device

Capture video;

// A variable for the color we are searching for.

color trackColor;

void setup() {

size(320,240);

video = new Capture(this,width,height);

// Start off tracking for any color you input below

video.start();

trackColor = color(10,10,10);

smooth();

}

void draw() {

// Capture and display the video

if (video.available()) {

video.read();

}

video.loadPixels();

image(video,0,0);

// Before we begin searching, the "world record" for closest color is set to a high number that is easy for

the first pixel to beat.

float worldRecord = 500;

// XY coordinate of closest color

int closestX = 0;

int closestY = 0;

// Begin loop to walk through every pixel

Page 12: Camera Document

P a g e | 12

for (int x = 0; x < video.width; x ++ ) {

for (int y = 0; y < video.height; y ++ ) {

int loc = x + y*video.width;

// What is current color

color currentColor = video.pixels[loc];

float r1 = red(currentColor);

float g1 = green(currentColor);

float b1 = blue(currentColor);

float r2 = red(trackColor);

float g2 = green(trackColor);

float b2 = blue(trackColor);

// Using euclidean distance to compare colors

float d = dist(r1,g1,b1,r2,g2,b2); // We are using the dist( ) function to compare the current color with

the color we are tracking.

// If current color is more similar to tracked color than

// closest color, save current location and current difference

if (d < worldRecord) {

worldRecord = d;

closestX = x;

closestY = y;

}

}

}

// We only consider the color found if its color distance is less than 10.

// This threshold of 10 is arbitrary and you can adjust this number depending on how accurate you require the

tracking to be.

if (worldRecord < 10) {

// Draw a rectangle at the tracked pixel

fill(trackColor,100);

strokeWeight(1.0);

stroke(0,255,0,200);

rect(closestX-18,closestY-18,36,36);

}

}

void mousePressed() {

// Save color where the mouse is clicked in trackColor variable

int loc = mouseX + mouseY*video.width;

trackColor = video.pixels[loc];

}

Simple color tracking example shows tracking of blue color in center using webcam:

Figure 10. Click on the video feed to track that particular color. Here is a snapshot taken as the sketch continuously

tracks a shade of blue on a hat.

In this simple color

tracking algorithm the

chosen color is compared

to the current pixel color.

A value of 10 is chosen to

accurately recognize the current

color as acceptable within range

of the tracked color.

Page 13: Camera Document

P a g e | 13

Blob Detection example code

The following code is able to detect certain levels of brightness based off of a threshold chosen. First, it is

necessary to download the library. Off the Libraries page in Processing, under Computer Vision/Video, there is a

BlobDetection link that takes you to the following website: http://www.v3ga.net/processing/BlobDetection/. From

there you are able to browse the site or download from the download tab. Once you download and import the library

you have access to it via the File Menu under Examples. With this code a live video feed is used to detect blobs and

computes a bounding box for these blobs.

// - Super Fast Blur v1.1 by Mario Klingemann <http://incubator.quasimondo.com>

// - BlobDetection library

import processing.video.*;

import blobDetection.*;

Capture cam;

BlobDetection theBlobDetection;

PImage img;

boolean newFrame=false;

// ==================================================

// setup()

// ==================================================

void setup()

{

// Size of applet

size(640, 480);

// Capture

cam = new Capture(this, 40*4, 30*4);

// Comment the following line if you use Processing 1.5

cam.start();

// BlobDetection

// img which will be sent to detection (a smaller copy of the cam frame);

img = new PImage(80,60);

theBlobDetection = new BlobDetection(img.width, img.height);

theBlobDetection.setPosDiscrimination(true);

theBlobDetection.setThreshold(0.2f); // will detect bright areas whose luminosity > 0.2f;

}

// ==================================================

// captureEvent()

// ==================================================

void captureEvent(Capture cam)

{

cam.read();

newFrame = true;

}

// ==================================================

// draw()

// ==================================================

void draw()

{

if (newFrame)

{

newFrame=false;

image(cam,0,0,width,height);

img.copy(cam, 0, 0, cam.width, cam.height,

0, 0, img.width, img.height);

fastblur(img, 2);

theBlobDetection.computeBlobs(img.pixels);

drawBlobsAndEdges(true,true);

}

}

// ==================================================

// drawBlobsAndEdges()

// ==================================================

void drawBlobsAndEdges(boolean drawBlobs, boolean drawEdges)

{

noFill();

Blob b;

A fourth input is deleted

here from original code

in order to run properly.

Brightness threshold is input

here. Blobs will be detected

above this threshold.

Page 14: Camera Document

P a g e | 14

EdgeVertex eA,eB;

for (int n=0 ; n<theBlobDetection.getBlobNb() ; n++)

{

b=theBlobDetection.getBlob(n);

if (b!=null)

{

// Edges

if (drawEdges)

{

strokeWeight(3);

stroke(0,255,0);

for (int m=0;m<b.getEdgeNb();m++)

{

eA = b.getEdgeVertexA(m);

eB = b.getEdgeVertexB(m);

if (eA !=null && eB !=null)

line(

eA.x*width, eA.y*height,

eB.x*width, eB.y*height

);

}

}

// Blobs

if (drawBlobs)

{

strokeWeight(1);

stroke(255,0,0);

rect(

b.xMin*width,b.yMin*height,

b.w*width,b.h*height

);

}

}

}

}

// ==================================================

// Super Fast Blur v1.1

// by Mario Klingemann

// <http://incubator.quasimondo.com>

// ==================================================

void fastblur(PImage img,int radius)

{

if (radius<1){

return;

}

int w=img.width;

int h=img.height;

int wm=w-1;

int hm=h-1;

int wh=w*h;

int div=radius+radius+1;

int r[]=new int[wh];

int g[]=new int[wh];

int b[]=new int[wh];

int rsum,gsum,bsum,x,y,i,p,p1,p2,yp,yi,yw;

int vmin[] = new int[max(w,h)];

int vmax[] = new int[max(w,h)];

int[] pix=img.pixels;

int dv[]=new int[256*div];

for (i=0;i<256*div;i++){

dv[i]=(i/div);

}

yw=yi=0;

for (y=0;y<h;y++){

rsum=gsum=bsum=0;

for(i=-radius;i<=radius;i++){

p=pix[yi+min(wm,max(i,0))];

rsum+=(p & 0xff0000)>>16;

gsum+=(p & 0x00ff00)>>8;

bsum+= p & 0x0000ff;

getBlobNb () gives the

number of blobs detected.

Runs through to draw blobs.

getEdgeNb () gives the

number of edges detected.

Runs through to draw edges.

Draws the shape of a

rectangle with certain

parameters.

Performs super fast blur!!! Blurs

the image of each frame.

Algorithm adds a pixel and drops

a pixel instead of recalculating

the kernel for each pixel.

Page 15: Camera Document

P a g e | 15

}

for (x=0;x<w;x++){

r[yi]=dv[rsum];

g[yi]=dv[gsum];

b[yi]=dv[bsum];

if(y==0){

vmin[x]=min(x+radius+1,wm);

vmax[x]=max(x-radius,0);

}

p1=pix[yw+vmin[x]];

p2=pix[yw+vmax[x]];

rsum+=((p1 & 0xff0000)-(p2 & 0xff0000))>>16;

gsum+=((p1 & 0x00ff00)-(p2 & 0x00ff00))>>8;

bsum+= (p1 & 0x0000ff)-(p2 & 0x0000ff);

yi++;

}

yw+=w;

}

for (x=0;x<w;x++){

rsum=gsum=bsum=0;

yp=-radius*w;

for(i=-radius;i<=radius;i++){

yi=max(0,yp)+x;

rsum+=r[yi];

gsum+=g[yi];

bsum+=b[yi];

yp+=w;

}

yi=x;

for (y=0;y<h;y++){

pix[yi]=0xff000000 | (dv[rsum]<<16) | (dv[gsum]<<8) | dv[bsum];

if(x==0){

vmin[y]=min(y+radius+1,hm)*w;

vmax[y]=max(y-radius,0)*w;

}

p1=x+vmin[y];

p2=x+vmax[y];

rsum+=r[p1]-r[p2];

gsum+=g[p1]-g[p2];

bsum+=b[p1]-b[p2];

yi+=w;

}

}

}

Page 16: Camera Document

P a g e | 16

Blob Detection example shows the detection of darker areas of image using webcam

Figure 11. The following image is a snapshot of a live video feed using a webcam. Code is run to detect blobs, boundary

areas of brightness and darkness. A bounding box in this case surrounds the darker areas.

Edge Detection Background

Edge detection is a fundamental operation in image processing. It reduces unnecessary data to be processed

while maintaining structural integrity of an image. Uses include tracking and recognition. Edge detection determines

where intensity levels in brightness dramatically change, therefore likely being an edge.

For example, in a one dimensional image the first derivative taken of a brightness intensity curve will give you a

peak at the steepest slope (fastest change in intensity) which represents an edge. An image changes its brightness over

a series or range of pixels. This is considered to be the image gradient and is what this edge detection is based on.

Image gradient shows the direction of the intensity change from lighter to darker areas in a 2D image. A gradual

horizontal gradient from white to black would show smaller arrows pointing to the right. Larger arrows would indicate a

greater rate of change and the likelihood of an edge. The image gradient is only approximated when doing edge

detection.

Kernels, or masks, are 3x3, 5x5, etc. matrices, used to give an approximation of a derivative when convolved

with the image pixels. The larger the matrix is made the better the approximation of the derivative. A matrix when

following this form has a center which is used for a better convolution of the image. For example, the 3x3 matrix kernel

processes a center pixel with eight surrounding pixels. Two kernels can be used to approximate derivatives, one for the

horizontal and the other for the vertical direction. The strength of the edge, or gradient magnitude, is then calculated as

the square root of the sum of the two squares (x and y-direction). Alternatively, it can also be the absolute value of the

sum of the absolute values of each. The orientation angle gives you the approximate angle of the edge and is calculated

by the arctangent of the vertical divided by the horizontal.

Noise will definitely cause false edges, so to eliminate as much noise as possible there shall be a threshold to

what is acceptable as an edge. Using the second order derivative, you can also find zero crossings to pinpoint where

edges are located. Such detectors are considered Laplacian edge detectors.

Page 17: Camera Document

P a g e | 17

Types of edge detection

Canny

The Canny edge detector was developed by John F. Canny in 1986. It runs the image through a Gaussian blur to

filter out some noise and allow for a better image gradient. A Sobel, or other algorithm is used to find edges. Based on

the angle and magnitude, two thresholds are used to further filter for edges. Values above the highest threshold are

edges, below are not, and anything in between are dependent on the angle and magnitude of each pixel and others

surrounding it. It figures out whether or not there are edges by the level of proximity to other edges.

Prewitt

Prewitt edge detector is based on first derivatives and has two kernels to approximate edges. It also uses a

threshold to produce the edges. In general, Prewitt uses 3x3 kernels, one for horizontal and the other for vertical.

Figure 12. Shows the Prewitt Kernels.

Sobel

Sobel edge detection is based off the first order derivatives but approximated with convolution of two kernels,

one for horizontal and the other for vertical to obtain the gradient of each point. With this information it is possible to

find the magnitude of the edge and the orientation angle of the edge. In general, Sobel uses 3x3 kernels.

Figure 13. Shows the Sobel Kernels.

Laplacian

Laplacian edge detector uses only one kernel and calculates the second derivative.

Edge Detection Simulation in Matlab using webcam (Prewitt Method):

In this demo, the Video and Image Processing Blockset software is used in a Simulink simulation to detect edges

in a live video feed using the Prewitt Edge Detection method. By clicking on the Edge Detection Block you have the

option of using different edge detection methods along with the ability to set the threshold for the amount of edges

detected. Along with changing the threshold values, it was necessary to adjust the From Video Device Block. Set the

Ports Mode to separate color signals in order to run. Use the following link to open and run, or search in the help

section in Matlab: http://www.mathworks.com/help/vision/examples/edge-detection-using-live-video-acquisition.html

Page 18: Camera Document

P a g e | 18

Figure 14. Matlab Demo of Edge detection using Simulink.

Edge Detection example shows an image taken from webcam:

Figure 15. In a classroom environment this snapshot of a live video feed was taken. Edge detection shows the abrupt

changes of brightness levels (edges) as a white line.

Page 19: Camera Document

P a g e | 19

Image Capture Track After an extensive review of the literature, (i.e., the internet and past projects/documents) discussed in Table 1.

We chose the LinkSprite JPEG Color Camera TTL Interface (Figure 16). The Linksprite camera meets our objectives for a

low cost CCD camera and also has a beneficial background with tutorials and research reports to reference. This camera

will capture and output JPEG images through UART (TTL interface) and store the picture into a SD card. Given that we

are using the ATmega328P which is a low-power CMOS 8-bit microcontroller with a memory size of 32Kbytes of Flash

Memory, 1Kbytes of EEPROM and 2 Kbytes of SRAM memory. To capture and process a picture, an SRAM external

memory module is required (SD card) since each JPEG image ranges from 4Kbytes to 47 Kbytes. In order to use the SD

card, a SD card breakout board (Figure 20) is required which can be plugged directly to the Arduino because it does the

5V to 3.3V translation.

Figure 16 - LinkSprite JPEG Color Camera TTL Interface

• Camera allows you to capture and

output JPEG images through UART

• The camera requires a 3.3 or 5V power

supply with a current consumption of 80

– 100mA.

• Default baud rate of serial port 38400 Hz

• Default baud rate for storing data in

memory card is 9600 Hz

• VGA/QVGA /320x240 resolution

Table 1 - Tutorials and Research Reports

www.sparkfun.com/datasheets/Sensors/Imaging/1274419957.pdf

Here is a manual on the camera provided by LinkSprite.

www.evola.fr/product_info.php/en/linksprite-jpeg-color-camera-ttl-interface-p-172

Specific tutorial

http://itp.nyu.edu/physcomp/sensors/Reports/Linkspritejpegcolorcamera

Download the JPEG Camera library

www.csulb/edu/~hill/ee400d/Reference Folder/Camera/

Here are past projects from previous semesters.

Page 20: Camera Document

P a g e | 20

As Figure 17 shows how small the camera is by comparing it to a US quarter, this camera has a dimension size of

32mm x 32mm (Figure 18). The camera is placed onto an OV706 chip that contains a Vimicro VC0706 chip (underneath

the QC passed sticker) placed behind the camera as illustrated in Figure 19. QC passed means that a Quality Control

Engineer approved the product before it was shipped out. The VC0706 is a digital processor specifically designed for

image capturing and processing. It contains JPEG embedded code which allows it to make real time coding for the

capture image and its external control read the M-JPEG more convenient.

Figure 17 Figure 18 Figure 19

SD card breakout board

Secure-Digital (SD) card is used as a storage device. Using this board will do the power translation of 5V to 3.3V.

The Vcc of this board is 5V so we can plug it directly to the Arduino. We must use this board because the Arduino has

512 bytes EEPROM which does not lose its contents at power off and 2048 bytes SRAM which contents are lost at power

off. The SD card and the SD module works on an SPI interface and only read/write single sectors (one sector means a

512 bytes block).

This board contains only four pins that we will use in our module. To not damage the SD card logic, the following

three output pins should not output more than 3.3V.

- MISO (master in, slave out) – connected to pin 12 (this is the only input pin)

- SCK (slave clock input, master clock output) – connect to pin 13

- SS (slave select, active low) – connected to pin 10

- MOSI (master out, slave in) – connected to pin 11

- GND (ground) – connected to ground pin on Arduino

- VCC (Voltage connected between ground and the collector) – connected to 5V on Arduino

Page 21: Camera Document

P a g e | 21

Figure 20 – SD Card Breakout Board

There are many different types of SD card to use, but two that have no problem communicating are:

- SanDisk 2GB SD2 Card

- Apacer 60X 1GB SD Card.

Note: SD Card San Disk 16MB DOES NOT work.

File Allocation Table (FAT)

File Allocation Tab le (FAT) is the name of a computer file system and a family of industry standard file systems

utilizing it. The SD standard specifies that 2GB and smaller should be formatted FAT16. Cards that are larger than 2GB

must be FAT 32. It is best to format SD cards with the SD Association’s formatter which will align file structures with the

internal flash chips for optimum performance. Use FAT16 when possible because the process is pretty straightforward.

https://www.sdcard.org/downloads/formatter_3/

Right click on the card’s directory and choose “Format” from the drop down menu and be sure to choose FAT as

the filesystem.

Page 22: Camera Document

P a g e | 22

Connecting Camera to Arduino (shown below)Figure 21.

Schematic of camera and breakout board with Arduino (shown below)Figure 22.

Page 23: Camera Document

P a g e | 23

Connections

Connecting Camera and Arduino

- TV out is not connected to anything

- RXD (Receiving Data) - connected to pin 4 on Arduino

- TXD (Transmitting Data) is connected to pin 5 on Arduino

- GND (Ground) is connected to GND on Arduino

- VCC (Voltage connected between ground and the collector) is connected to 5V on Arduino

Connecting SD breakout board and Arduino

- MISO (master in, slave out) – connected to pin 12 (this is the only input pin) on Arduino

- SCK (slave clock input, master clock output) – connect to pin 13 on Arduino

- SS (slave select, active low) – connected to pin 10 on Arduino

- MOSI (master out, slave in) – connected to pin 11 on Arduino

- GND (ground) – connected to ground pin on Arduino

- VCC (Voltage connected between ground and the collector) – connected to 5V on Arduino

Power Supply Connection

- Power connected directly to 5V and GND pin on Arduino and the other connect to breadboard

- Supply power for SD breakout board and camera

Getting Started

Software Needed:

http://arduino.cc/en/Main/Software

Download Arduino 1.0.2

Libraries Needed:

www.cutedigi.com/breakout-board/sd-card-breakout-board.html

Download Arduino Code for breakout board

www.evola.fr/product_info.php/en/linksprite-jpeg-color-camera-ttl-interface-p-172

Download Arduino Code and Library (Take a picture and save to SD card)

Page 24: Camera Document

P a g e | 24

Testing Components Individually

Testing SD card

Arduino 1.0.2 has examples to run to see if the SD card is connected properly. Select File, then Examples, then

SD which will show a list of example programs and select CardInfo. When the CardInfo example is ran, the output on the

Serial Monitor will show the properties of the SD being used:

Initializing SD card...Wiring is correct and a card is present.

Card type: SD2

Volume type is FAT16

Testing Camera

Using this code will show that the camera is connected properly. Run the program and then upload. Select Tools,

then Serial Monitor and verify on the bottom right of the box is reading the default baud rate (38400). Lastly, check the

hex code printed starts at FF D8 and ends with FF D9.By checking these values are printed helps confirms a JPEG file is

being created. If so then connection with camera is valid (Figure 23).

#include <SoftwareSerial.h>

byte incomingbyte;

SoftwareSerial mySerial(4,5); //Configure pin 4 and 5 as soft serial port

int address=0x0000,j=0,k=0,count=0; //Read Starting address

boolean EndFlag=0;

void SendResetCmd();

void SendTakePhotoCmd();

void SendReadDataCmd();

void StopTakePhotoCmd();

void setup()

{

Serial.begin(38400);

mySerial.begin(38400);

}

void loop()

{

SendResetCmd();

delay(4000); //After reset, wait 2-3 second to send take

SendTakePhotoCmd();

while(mySerial.available()>0)

{

incomingbyte=mySerial.read();

}

byte a[32];

while(!EndFlag)

{

j=0;

k=0;

count=0;

SendReadDataCmd();

delay(25);

while(mySerial.available()>0)

{

incomingbyte=mySerial.read();

k++;

if((k>5)&&(j<32)&&(!EndFlag))

{

a[j]=incomingbyte;

if((a[j-1]==0xFF)&&(a[j]==0xD9)) //Check if the picture is over

EndFlag=1;

j++;

count++;

}

Initiates a serial communication at the

default baud rate of 38400 bps

Send reset command to camera and

wait for four seconds to send take

picture command

Checks if the picture is done by ending in

HEX values (FF D9)

Page 25: Camera Document

P a g e | 25

}

for(j=0;j<count;j++)

{

if(a[j]<0x10)

Serial.print("0");

Serial.print(a[j],HEX);

Serial.print(" ");

} //Send jpeg picture over the serial port

Serial.println();

}

while(1);

}

//Send Reset command

void SendResetCmd()

{

mySerial.print((char)0x56);

mySerial.print((char)0x00);

mySerial.print((char)0x26);

mySerial.print((char)0x00);

}

//Send take picture command

void SendTakePhotoCmd()

{

mySerial.print((char)0x56);

mySerial.print((char)0x00);

mySerial.print((char)0x36);

mySerial.print((char)0x01);

mySerial.print((char)0x00);

}

//Read data

void SendReadDataCmd()

{

uint8_t MH,ML;

MH=address/0x100;

ML=address%0x100;

mySerial.print((char)0x56);

mySerial.print((char)0x00);

mySerial.print((char)0x32);

mySerial.print((char)0x0c);

mySerial.print((char)0x00);

mySerial.print((char)0x0a);

mySerial.print((char)0x00);

mySerial.print((char)0x00);

mySerial.print((char)MH);

mySerial.print((char)ML);

mySerial.print((char)0x00);

mySerial.print((char)0x00);

mySerial.print((char)0x00);

mySerial.print((char)0x20);

mySerial.print((char)0x00);

mySerial.print((char)0x0a);

address+=0x20; //address increases 32 bytes according to buffer size

}

void StopTakePhotoCmd()

{

mySerial.print((char)0x56);

mySerial.print((char)0x00);

mySerial.print((char)0x36);

mySerial.print((char)0x01);

mySerial.print((char)0x03);

}

These are the HEX commands that are

sent from the Arduino to the camera to:

- Reset

- Take picture

- Read data

- Stop camera

Page 26: Camera Document

P a g e | 26

Figure 23 – Serial Monitor

Store photo data into SD card

After verifying that both the SD card and Camera are working. It is now time to integrate both to work together.

Run the following code provided and compile to make sure there are no errors. Repeat same steps mentioned in testing

the Camera to verify hex code is printed (Figure 24). Then take SD card out and put into computer to see if the picture

uploaded as a JPEG file (Figure 25).

#include <SoftwareSerial.h>

#include <byteordering.h>

#include <fat.h>

#include <FAT16.h>

#include <fat_config.h>

#include <partition.h>

#include <partition_config.h>

#include <sd-reader_config.h>

#include <sd_raw.h>

#include <sd_raw_config.h>

byte incomingbyte;

SoftwareSerial mySerial(4,5); //Configure pin 4 and 5 as soft serial port

long int address=0x0000,j=0,k=0,count=0, i=0;//Read Starting address

uint8_t MH,ML;

boolean EndFlag=0;

FAT TestFile;

void SendResetCmd();

void SetBaudRateCmd();

void SetImageSizeCmd();

void SendTakePhotoCmd();

void SendReadDataCmd();

void StopTakePhotoCmd();

void setup()

{

Serial.begin(38400);

mySerial.begin(38400);

if(!sd_raw_init())

{

This will be the file we

manipulate into the sketch

Checks if the picture is done by ending in

HEX values (FF D9)

Check default baud rate is

being used

Page 27: Camera Document

P a g e | 27

while(1);

}

TestFile.initialize();

TestFile.create_file("FiNAllY.jpg"); // create a new jpeg file

}

void loop()

{

SendResetCmd();

delay(4000); //After reset, wait 2-3 second to send take picture command

SendTakePhotoCmd();

while(mySerial.available()>0)

{

incomingbyte=mySerial.read();

}

byte a[32];

TestFile.open();

while(!EndFlag)

{

j=0;

k=0;

count=0;

SendReadDataCmd();

delay(20);

while(mySerial.available()>0)

{

incomingbyte=mySerial.read();

k++;

if((k>5)&&(j<32)&&(!EndFlag))

{

a[j]=incomingbyte;

if((a[j-1]==0xFF)&&(a[j]==0xD9)) //Check if the picture is over

EndFlag=1;

j++;

count++;

}

}

for(j=0;j<count;j++)

{

if(a[j]<0x10)

Serial.print("0");

Serial.print(a[j],HEX);

Serial.print(" ");

} //Send jpeg picture over the serial port

TestFile.write((char*)a);

Serial.println();

i++;

}

TestFile.close();

Serial.print("Finished writing data to file");

while(1);

}

//Send Reset command

void SendResetCmd()

{

mySerial.print((char)0x56);

mySerial.print((char)0x00);

mySerial.print((char)0x26);

mySerial.print((char)0x00);

}

void SetImageSizeCmd()

{

mySerial.print((char)0x56);

mySerial.print((char)0x00);

mySerial.print((char)0x31);

mySerial.print((char)0x05);

mySerial.print((char)0x04);

mySerial.print((char)0x01);

Initializes the SD card and the FAT file

system then creates a JPEG file on

the SD card

Since the file was created, we can

open and write to it

Using .write will always write to the

beginning of the file

Once HEX values are completed and

printed out on Serial Monitor,

serial.print will show us the file is

done writing.

Page 28: Camera Document

P a g e | 28

mySerial.print((char)0x00);

mySerial.print((char)0x19);

mySerial.print((char)0x11);

}

void SetBaudRateCmd()

{

mySerial.print((char)0x56);

mySerial.print((char)0x00);

mySerial.print((char)0x24);

mySerial.print((char)0x03);

mySerial.print((char)0x01);

mySerial.print((char)0xAE);

mySerial.print((char)0xC8);

}

//Send take picture command

void SendTakePhotoCmd()

{

mySerial.print((char)0x56);

mySerial.print((char)0x00);

mySerial.print((char)0x36);

mySerial.print((char)0x01);

mySerial.print((char)0x00);

}

//Read data

void SendReadDataCmd()

{

//uint8_t MH,ML;

MH=address/0x100;

ML=address%0x100;

mySerial.print((char)0x56);

mySerial.print((char)0x00);

mySerial.print((char)0x32);

mySerial.print((char)0x0c);

mySerial.print((char)0x00);

mySerial.print((char)0x0a);

mySerial.print((char)0x00);

mySerial.print((char)0x00);

mySerial.print((char)MH);

mySerial.print((char)ML);

mySerial.print((char)0x00);

mySerial.print((char)0x00);

mySerial.print((char)0x00);

mySerial.print((char)0x20);

mySerial.print((char)0x00);

mySerial.print((char)0x0a);

address+=0x20; //address increases 32 bytes according to buffer size

}

void StopTakePhotoCmd()

{

mySerial.print((char)0x56);

mySerial.print((char)0x00);

mySerial.print((char)0x36);

mySerial.print((char)0x01);

mySerial.print((char)0x03);

}

These are the HEX commands that are

sent from the Arduino to the camera to:

- Reset

- Take picture

- Set Image Size

- Set Baud Rate

- Read data

- Stop camera

Page 29: Camera Document

P a g e | 29

Figure 24 – Checking Serial Monitor for Completion

Figure 25 - Final Output of the JPEG Image from SD Card

Page 30: Camera Document

P a g e | 30

Putting It All Together Now that we have tested the SD, the Camera and validated that a JPEG file is on the SD card. It is time to put

everything together using Arduino and Processing to upload the file directly to the computer.

Step One

Compile and upload this code into Arduino

/*

From Sparkfun.com

Modified by Adam Harvey Dec. 25, 2010

*/

#include <MemoryCard.h>

#include <SdFat.h>

#include <JPEGCamera.h>

#include <NewSoftSerial.h>

//Create an instance of the camera

JPEGCamera camera;

//Create a character array to store the cameras response to commands

char response[32];

//Count is used to store the number of characters in the response string.

unsigned int count=0;

//Size will be set to the size of the jpeg image.

int size=0;

//This will keep track of the data address being read from the camera

int address=0;

//while reading the file data from the camera.

int eof=0;

int takeNewPhoto = 0;

boolean takingPhoto = 0;

boolean sendingPhoto = 0;

char filename[] = "/Images/IMG_01.TXT";

void setup()

{

Serial.begin(115200);

camera.begin();

count=camera.reset(response);

delay(3000); // necessary?

//Reset the camera

MemoryCard.begin();

//establishContact(); // send a byte to establish contact until receiver responds

}

void loop()

{

if (Serial.available() > 0) {

// get incoming byte:

int inByte = Serial.read();

if(inByte == 'S')

{

sendPhoto(filename);

}

else if(inByte == 'T'){

takeAndSendPhoto();

}

}

}

void takeAndSendPhoto(){

if(takingPhoto)return;

address = 0;

eof = 0;

size = 0;

count = 0;

takingPhoto = true;

- Must have all

libraries included in

Arduino

- Send a byte to

establish contact

until receiver

responds

Page 31: Camera Document

P a g e | 31

//Take a picture

count=camera.takePicture(response);

//Get the size of the picture

count = camera.getSize(response, &size);

// IMG

char *imgDir = "/Images/";

if (!MemoryCard.exists(imgDir))

MemoryCard.makeDir("/Images/");

int c;

int filenum = 0;

MemoryCard.open(filename, true);

while(address < size)

{

//Read the data starting at the current address.

count=camera.readData(response, address);

//Store all of the data that we read to the SD card

for(int i=0; i<count; i++){

if((response[i] == (char)0xD9) && (response[i-1]==(char)0xFF))eof=1;

//Save the data to the SD card

MemoryCard.file.print(response[i], BYTE);

Serial.print( (char) response[i] , BYTE);

//If we found the eof character, get out of this loop and stop reading data

if(eof==1)break;

}

address+=count;

if(eof==1){

Serial.print('EOF');

break;

}

}

MemoryCard.close();

takingPhoto = false;

count=camera.reset(response);

delay(3000);

}

void sendPhoto(char filename[]){

if(sendingPhoto)return;

sendingPhoto = true;

MemoryCard.open(filename);

int b;

while((b = MemoryCard.file.read()) >= 0) {

Serial.print( (char) b , BYTE);

}

Serial.print('EOF');

MemoryCard.close();

sendingPhoto = false;

}

void setImageName(int a, int b){

filename[12] = (char) (a+48);

filename[13] = (char) (b+48);

}

void establishContact() {

while (Serial.available() <= 0) {

Serial.print('A', BYTE); // send a capital A

delay(300);

}

}

- If we found the eof

character, then get out

of this loop and stop

reading the data

- Address starts at 0,

keeps reading data until

we have read ‘size’ data

EOF is a flag for the sketch to

determine when the end of a

file has been detected

Page 32: Camera Document

P a g e | 32

Step Two

Upload this code into Processing. Select Run, a separate window will open (Figure 26) , hit any key on the

keyboard to start capturing your image(Figure 26), when you see that the image has stopped, hit any key on the

keyboard to output the final image (Figure 27) . When completed, the output image has completed Edge Detection

(Figure 27).

import processing.serial.*;

Serial myPort;

String filename = "photo.jpg";

byte[] photo = {};

Boolean readData = false;

boolean done = false;

boolean loaded = false;

boolean edgeDetection = false;

// Variables for Edge Detection

PImage img;

PImage edgeImg;

float[][] kernel = {{ -1, -1, -1},

{ -1, 9, -1},

{ -1, -1, -1}};

void setup()

{

size(320, 240);

println( Serial.list() );

myPort = new Serial( this, Serial.list()[0],115200 );

myPort.buffer(10);

}

void draw()

{

byte[] buffer = new byte[64];

if( readData )

{

while( myPort.available() > 0 )

{

int readBytes = myPort.readBytes( buffer );

print( "Read " );

print( readBytes );

println( " bytes ..." );

for( int i = 0; i < readBytes; i++ )

{

photo = append( photo, buffer[i] );

}

}

}

else

{

while( myPort.available() > 0 )

{

print( "COM Data: " );

println( myPort.readString() );

}

}

if(done) {

// Check to see if image is loaded

if (!loaded) {

img = loadImage("./photo.jpg");

loaded = true;

} else {

// Check to see if we edge detected the image

if(!edgeDetection) {

edgeDetect();

edgeDetection = true;

} else {

image(edgeImg, 0, 0);

}

// image(img, 0, 0);

}

Variables for Edge Detection

Runs this code when picture

has been taken

Page 33: Camera Document

P a g e | 33

}

}

// KEYBOARD CONTROLLER

void keyPressed()

{

if( photo.length > 0 ) {

readData = false;

print( "Writing to disk " );

print( photo.length );

println( " bytes ..." );

saveBytes( filename, photo );

println( "DONE!" );

done = true;

}

else {

myPort.write('T');

readData = true;

myPort.clear();

println( "Waiting for data ..." );

}

}

// EDGE DETECTION FUNCTION (from Processing website)

void edgeDetect()

{

img.loadPixels();

// Create an opaque image of the same size as the original

edgeImg = createImage(img.width, img.height, RGB);

// Loop through every pixel in the image.

for (int y = 1; y < img.height-1; y++) { // Skip top and bottom edges

for (int x = 1; x < img.width-1; x++) { // Skip left and right edges

float sum = 0; // Kernel sum for this pixel

for (int ky = -1; ky <= 1; ky++) {

for (int kx = -1; kx <= 1; kx++) {

// Calculate the adjacent pixel for this kernel point

int pos = (y + ky)*img.width + (x + kx);

// Image is grayscale, red/green/blue are identical

float val = red(img.pixels[pos]);

// Multiply adjacent pixels based on the kernel values

sum += kernel[ky+1][kx+1] * val;

}

}

// For this pixel in the new image, set the gray value

// based on the sum from the kernel

edgeImg.pixels[y*img.width + x] = color(sum, sum, sum);

}

}

// State that there are changes to edgeImg.pixels[]

edgeImg.updatePixels();

}

This code will run when key

on keyboard has been

entered

Edge Detection Code

provided from the

Processing website

Page 34: Camera Document

P a g e | 34

Figure 26 – Processing – Separate Window to Capture Image

Figure 27 – Final Output of Image

A separate window

appears

Press any key to start

capturing image

Verify that picture is

DONE!

After a key has been

pressed, the Final

Image will print out

Page 35: Camera Document

P a g e | 35

Figure 28- The JPEG file and the Output on Processing

Figure 29 – The Plaque

Page 36: Camera Document

P a g e | 36

Future Considerations For future camera groups, we recommend having a strong leader who understands how the camera works and

has a thorough knowledge on image processing. The semester should start with clear direction just like what we

received in week nine.

Camera: http://store.diydrones.com/Mini_high_resolution_CCD_camera_ideal_for_FPV_day_p/cm-26n.htm $31.95

Microelectronic: Arduino Due $45.70 (availability is a real concern here).

Shield: Your chip. The Due operates at 3.3v so depending on the operating voltages of your chip we may or may not

need some level shifters. May also want to add First Person View (FPV) On Screen Display (OSD) support.

http://nootropicdesign.com/ve/

Project done with Arduino and video camera using the video experimenter shield/strong background

Page 37: Camera Document

P a g e | 37

Survey Here we have provided and categorized helpful links and research we discovered throughout the semester.

Processing

http://vimeo.com/12251298

Arduino forum on blob detection

Cameras

https://www.sparkfun.com/products/9334

c328 camera info, retired http://www.sparkfun.com/datasheets/Sensors/Imaging/C328.pdf

Data sheet for c328 camera

http://www.sparkfun.com/datasheets/Sensors/Imaging/C328_UM.pdf

User manual for c328 camera

http://www.ebay.com/itm/New-Mini-Wired-Pinhole-Color-CCTV-Security-Surveillance-SPY-Hidden-Nanny-Camera-

/150930775367?_trksid=p2047675.m1850&_trkparms=aid%3D222002%26algo%3DSIC.FIT%26ao%3D1%26asc%3D11%2

6meid%3D3017466659087745656%26pid%3D100011%26prg%3D1005%26rk%3D2%26sd%3D110718181469%26

Support/tutorials

http://www.ebay.com/itm/4LED-Mini-Wired-Camera-Pinhole-Hidden-Spy-Nanny-Color-CMOS-Video-Audio-CCTV-Cam-

/261038889820?_trksid=p2047675.m1850&_trkparms=aid%3D222002%26algo%3DSIC.FIT%26ao%3D1%26asc%3D11%2

6meid%3D3017466659087745656%26pid%3D100011%26prg%3D1005%26rk%3D3%26sd%3D110718181469%26

Same camera that was provided at the beginning of semester, just with LED lights around the edges to see in the

dark, but cannot use this camera to get to our final goal

http://www.cmucam.org/projects/cmucam4

Has everything, but cannot use due to price and basically too easy to get to ultimate goal since everything is

provided

https://www.sparkfun.com/products/8667

We used this camera, but unsuccessful with it

https://www.sparkfun.com/products/10061

Are currently in process of getting this camera to work

http://embeddedeye.com/profiles/blogs/ardueyemini-4-gram-sensor-prototype

Page 38: Camera Document

P a g e | 38

Found by the president. We tried to network with this guy, but did not reply back to any emails or messages to

find out where and how much the camera would be. Unsuccessful.

https://www.sparkfun.com/products/637?

Simple cmos camera old/retired

http://www.societyofrobots.com/electronics_blackfin_camera.shtml

Cool project with a well written document

NTSC/PAL

The two predominant worldwide formats are NTSC (National Television Systems Committee) and PAL (Phase

Alternating Line). PAL is higher in resolution (576 horizontal lines) and updates on-screen images at 25 times per second.

While NTSC has 480 horizontal lines, but updates images more frequently at 30 times per second. PAL video has a

tendency to flicker, while motion is performed better in NTSC video. When you convert NTSC to PAL, 480 lines of

resolution has to convert up to 576 lines of resolution and 30 images per second down to 25 images per second, then

vice versa when converting PAL to NTSC.

http://store.diydrones.com/Mini_high_resolution_CCD_camera_ideal_for_FPV_day_p/cm-26n.htm

Can’t use. Must figure out how to convert analog video stream into a digital video stream

http://www.makershed.com/TTL_Serial_JPEG_Camera_with_NTSC_Video_p/mkad23.htm

Has great tutorials provided, but did not use this camera

http://www.fatshark.com/pages/cmos/cmos-spec.pdf

Camera with output (NTSC/PAL)

http://www.davidchatting.com/arduinoeyeshield/

Project with documentations

Android

http://code.google.com/p/android-object-tracking/

Website useful for tutorials on how to use an android and do object tracking

Page 39: Camera Document

P a g e | 39

Future Research Here is the solution which I believe gives us the most interesting camera with onboard processing support for the future.

Camera: http://store.diydrones.com/Mini_high_resolution_CCD_camera_ideal_for_FPV_day_p/cm-26n.htm $31.95

Microelectronic: Arduino Due $45.70 (availability is a real concern here).

Shield: Your chip. The Due operates at 3.3v so depending on the operating voltages of your chip we may or may not

need some level shifters. May also want to add First Person View (FPV) On Screen Display (OSD) support.

Total will be around $100.00”

Could not order Arduino Due because it was a brand new product and every website listed on

http://arduino.cc/en/Main/Buy was sold out or on back order until mid December.