CMUcam2 Emulation

Version 48 (Anthony Rowe, 04/01/2007 01:55 pm) → Version 49/77 (Adam Goode, 04/14/2007 04:05 pm)

= CMUcam2 Emulation =

The CMUcam2 has the following capabilities:
* Track user defined color blobs at up to 50 Frames Per Second (frame rate depends on resolution and window size settings)
* Track motion using frame differencing at 26 Frames Per Second
* Find the centroid of any tracking data
* Gather mean color and variance data
* Gather a 28 bin histogram of each color channel
* ~~Process Horizontally Edge Filtered Images~~
* Transfer a real-time binary bitmap of the tracked pixels in an image
* Arbitrary image windowing
* Image Down Sampling
* Adjust the camera's image properties
* Dump a raw image (single or multiple channels)
* Up to 176 x 255 Resolution
* Supports baudrates of: 115,200 57,600 38,400 19,200 9,600 4,800 2,400 1,200
* Control 5 servo outputs
* ~~Slave parallel image processing mode off of a single camera bus~~
* Automatically use servos to do two axis color tracking
* B/W Analog video output (PAL or NTSC, depending on camera module used)
* Flexible output packet customization
* Power Down Mode
* Multiple pass image processing on a buffered image

[attachment:cmucam2_lpc2106-cmucam3.hex Compiled Firmware Image (115,200 8N1)] (Right click and save) [[BR]]

[attachment:cmucam2.c Source File] (Right click and save) [[BR]]

There are several differences between the CMUcam2 emulation and the actual CMUcam2. Below is a list of all CMUcam2 functionality with non-supported features crossed off. Many crossed off features will be supported in the near future.

BM Buffer Mode[[BR]]
CR Camera Register[[BR]]
CP Camera Power[[BR]]
DC Difference Channel[[BR]]
DS Down Sample[[BR]]
FD Frame Difference[[BR]]
FS Frame Stream[[BR]]
GB Get Button[[BR]]
GH Get Histogram[[BR]]
GI Get Aux IO inputs[[BR]]
GM Get Mean[[BR]]
GS Get Servo Positions[[BR]]
GT Get Tracking Parameters[[BR]]
GV Get Version[[BR]]
GW Get Window[[BR]]
HC Historgram Configure[[BR]]
HD High Resolution Difference[[BR]]
HR Hi-Res Mode[[BR]]
~~HT Set Histogram Track[[BR]]~~
L0 Led Control[[BR]]
LF Load Frame to Difference[[BR]]
''LM Line Mode[[BR]]''
~~MD Mask Difference[[BR]]~~
NF Noise Filter[[BR]]
OM Output Packet Mask[[BR]]
~~PD Pixel Difference[[BR]]~~
PF Packet Filter[[BR]]
PM Poll Mode[[BR]]
RF Read Frame into Buffer[[BR]]
RM Raw Mode[[BR]]
RS Reset[[BR]]
SF Send Frame[[BR]]
SM Servo Mask[[BR]]
SO Servo Output[[BR]]
SP Servo Parameters[[BR]]
ST Set Track Command[[BR]]
SV Servo Position[[BR]]
TC Track Color[[BR]]
TI Track Inverted[[BR]]
TW Track Window[[BR]]
~~UD Upload Difference buffer[[BR]]~~
VW Virtual Window[[BR]]

'''The following commands will not be supported in the near future:'''[[BR]]
CT Set Camera Type[[BR]]
DM Delay Mode[[BR]]
L1 Led Control (look at SO instead)[[BR]]
PS Packet Skip[[BR]]
SD Sleep Deeply[[BR]]
SL Sleep Command[[BR]]

= CMUcam2 Emulation Differences =
* '''Servo Input Range'''
* Servos are now 0-255 8bit values.
* '''Jumpers'''
* Due to the lack of jumpers on the CMUcam3, baudrate and servo direction changes need to be done at compile time. These are controlled by #defines at the top of cmucam.c
* '''Set Input (SI ''pin'') Command'''
* sets the ''pin'' to be an input
* '''Software Color Space (CS ''value'') Command'''
* CS 0 sets the color space to the hardware default (RGB or YCrCb)
* CS 1 does a software conversion to the HSV color space
* Conversion assumes hardware is set to RGB for correct results
* HSV space is integer where all values are scaled between 16 and 240
* Note, this is only available in r504 Subversion Rev 504 and higher
* '''Set Output Can Control the Blue and Orange LEDs'''
* Servos 2 and 3 will stop working
* so 2 1 -> Blue on
* so 2 0 -> Blue off
* so 3 1 -> Orange on
* so 3 0 -> Orange off
* '''No Slave Mode.'''
* It is possible, but we currently don't support it.
* '''Output Mask (OM)'''
* only supports T and S packets (type 0 and 1)
* '''Line Mode (LM)'''
* only supports track color mode
* '''Send JPEG (SJ)'''
* sends a jpeg compressed frame, header and all
* '''Demo Mode'''
* Since holding down the programming button puts the CMUcam3 into programming mode, you need to press the button half a second after startup to enter demo mode.
* '''Hi-Res Frame Difference'''
* This now works the same as low-res frame differencing, just at a higher resolution.