Welcome to the EyeBot  Version 7 - RPi1
A Controller For Various Hardware IO
Macros | Functions | Variables
camera.h File Reference

Camera routines for the Raspberry Pi 2, modded for the EyeBot. More...

#include <stdlib.h>
#include <opencv/cv.h>
#include <opencv2/highgui/highgui_c.h>
#include "types.h"

Go to the source code of this file.

Macros

#define CAM_SUCCESS   1
 
#define CAM_FAILURE   0
 

Functions

int CAMInit ()
 
int CAMSetMode (int mode)
 Set the camera mode (e.g. format and resolution). More...
 
int CAMGetMode ()
 Retrieves the current camera mode. More...
 
int CAMGet (BYTE *buf)
 Retrieve a camera frame into the provided buffer. More...
 
int CAMRelease (void)
 Stops and releases all camera structures. More...
 
int CAMGetGray (BYTE *buf)
 Grabs a gray image off the camera. More...
 

Variables

int CAMSIZE
 
int CAM_INITIAL
 

Detailed Description

Camera routines for the Raspberry Pi 2, modded for the EyeBot.

Author
Jeremy Tan & Marcus Pham

Macro Definition Documentation

#define CAM_FAILURE   0

Failure code

#define CAM_SUCCESS   1

Success code

Function Documentation

int CAMGet ( BYTE *  buf)

Retrieve a camera frame into the provided buffer.

Parameters
[in]bufThe buffer to copy the camera frame into. The supplied buffer must be large enough to acommodate the size of the image, as defined by the camera mode.
Returns
Nonzero on success, zero on failure. On failure, the contents of buf is undefined.

Retrieves the current camera frame and copies it into the supplied buffer. CAMInit must have been called previously.

int CAMGetGray ( BYTE *  buf)

Grabs a gray image off the camera.

Parameters
thebyte stream to store the image data, data in Gray format
Returns
0 iff initialised correctly, otherwise 1
int CAMGetMode ( void  )

Retrieves the current camera mode.

Returns
The camera mode, or CAM_NONE on error.

CAMInit must have been called previously.

int CAMRelease ( void  )

Stops and releases all camera structures.

Returns
Nonzero on success, zero on failure.

Releases all allocated memory and stops video capture.

int CAMSetMode ( int  mode)

Set the camera mode (e.g. format and resolution).

Parameters
[in]modeThe camera mode to be set to
Returns
Nonzero on success, zero on failure.

Sets the camera mode. CAMInit must have been called previously.