PiStorms  4.015
PiStorms Library Reference by mindsensors.com
 All Classes Namespaces Files Functions Variables
MsDevices.NXTCam5 Class Reference

NXTCam5 : this class provides PiStorms specific interface for NXTCam5 http://www.mindsensors.com/pages/317. More...

Inheritance diagram for MsDevices.NXTCam5:

Public Member Functions

def __init__
 Initialize the class with the i2c address of your device. More...
 
def command
 Writes a value to the command register. More...
 
def trackLine
 Track a line. More...
 
def trackObject
 Track Object (this is default mode of NXTCam5) More...
 
def trackFace
 Track Face. More...
 
def trackEye
 Track Eye. More...
 
def captureImage
 Capture Image. More...
 
def captureShortVideo
 Capture Short Video. More...
 
def captureContinuousVideo
 Capture Continuous Video. More...
 
def getNumberObjects
 Read the number of objects detected (0-8) More...
 
def getBlobs
 Reads data of the tracked object(s) More...
 

Static Public Attributes

int CAM_ADDRESS = 0x02
 Default I2C Address.
 
int CAM_COMMAND = 0x41
 Command Register.
 
int NumberObjects = 0x42
 
int Color = 0x43
 First Register Containing Tracked Object Data. More...
 
int X_Top = 0x44
 X-axis Top Register.
 
int Y_Top = 0x45
 Y-axis Top Register.
 
int X_Bottom = 0x46
 X-axis Bottom Register.
 
int Y_Bottom = 0x47
 Y-axis Bottom Register.
 

Detailed Description

NXTCam5 : this class provides PiStorms specific interface for NXTCam5 http://www.mindsensors.com/pages/317.

Constructor & Destructor Documentation

def MsDevices.NXTCam5.__init__ (   self,
  port,
  address = CAM_ADDRESS 
)

Initialize the class with the i2c address of your device.

Parameters
selfThe object pointer.
portThe PiStorms bank.
addressAddress of your device
Remarks

Member Function Documentation

def MsDevices.NXTCam5.captureContinuousVideo (   self)

Capture Continuous Video.

Parameters
selfThe object pointer. Capture a continuous Video, the recording is stopped when different command is received. the resultimg video file is stored on the SD card attached to NXTCam5. the file forma is MJPEG you can use VLC player by www.videolan.org to view these files
def MsDevices.NXTCam5.captureImage (   self)

Capture Image.

Parameters
selfThe object pointer. the resultimg image is stored on the SD card attached to NXTCam5. the file forma is JPEG
def MsDevices.NXTCam5.captureShortVideo (   self)

Capture Short Video.

Parameters
selfThe object pointer. Capture a short Video (about 10 seconds) the resultimg video file is stored on the SD card attached to NXTCam5. the file forma is MJPEG you can use VLC player by www.videolan.org to view these files
def MsDevices.NXTCam5.command (   self,
  command 
)

Writes a value to the command register.

Parameters
selfThe object pointer.
commandValue to write to the command register.
def MsDevices.NXTCam5.getBlobs (   self,
  blobNum = 1 
)

Reads data of the tracked object(s)

Parameters
selfThe object pointer.
blobNumThe number of the tracked object.
Remarks
To use this function in your program:
1 from mindsensors import NXTCAM
2 ...
3 cam = NXTCAM()
4 cam.startTracking()
5 cam.trackObject()
6 b = cam.getBlobs(1)
7 print "Color: " + str(b.color)
8 print "Left: " + str(b.left)
9 print "Top: " + str(b.top)
10 print "Right: " + str(b.right)
11 print "Bottom: " + str(b.bottom)
def MsDevices.NXTCam5.getNumberObjects (   self)

Read the number of objects detected (0-8)

Parameters
selfThe object pointer.
def MsDevices.NXTCam5.trackEye (   self)

Track Eye.

Parameters
selfThe object pointer.
def MsDevices.NXTCam5.trackFace (   self)

Track Face.

Parameters
selfThe object pointer.
def MsDevices.NXTCam5.trackLine (   self)

Track a line.

Parameters
selfThe object pointer.
def MsDevices.NXTCam5.trackObject (   self)

Track Object (this is default mode of NXTCam5)

Parameters
selfThe object pointer.

Member Data Documentation

int MsDevices.NXTCam5.Color = 0x43
static

First Register Containing Tracked Object Data.

This is to be read in an array


The documentation for this class was generated from the following file: