Wireless Sensor Networks Lab - Stanford University
WiSNAP
Wireless Image Sensor Network Application Platform

  Go to function:

    Index    Contents 

[ DOWNLOAD ]

 

 

Image Sensor API: Functions

WiSNAP's Image Sensor API provides the following functions to interface with image sensors.

 


Function: open

Opens a communications session with the image sensor.

Syntax

handle = image_sensor_api(device,'open',port)

Input(s)

device

Image sensor device (string):
'ADCM-1670': Agilent ADCM-1670 camera module.
'ADNS-3060': Agilent ADNS-3060 mouse sensor.

port

Communications port (string).

Output(s)

handle

Device handle (positive integer).

Example(s)

shandle = image_sensor_api('ADCM-1670','open','COM1')
shandle = image_sensor_api('ADNS-3060','open','0378')

 


Function: init

Initializes the image sensor.

Syntax

status = image_sensor_api(device,'init',handle)

Input(s)

device

See function open.

handle

Device handle (positive integer).

Output(s)

status

Success status (-1 = error, +1 = success).

Example(s)

status = image_sensor_api('ADCM-1670','init',shandle)
status = image_sensor_api('ADNS-3060','init',shandle)

 


Function: frame

Captures the current frame from the image sensor.

Syntax

imager = image_sensor_api(device,'frame',handle)

Input(s)

device

See function open.

handle

Device handle (positive integer).

Output(s)

imager

Image array NxM, color depth D (NxMxD matrix).

Example(s)

imager = image_sensor_api('ADCM-1670','frame',shandle)
imager = image_sensor_api('ADNS-3060','frame',shandle)

 


Function: close

Closes the communications session with the image sensor.

Syntax

status = image_sensor_api(device,'close',handle)

Input(s)

device

See function open.

handle

Device handle (positive integer).

Output(s)

status

Success status (-1 = error, +1 = success).

Example(s)

status = image_sensor_api('ADCM-1670','close',shandle)
status = image_sensor_api('ADNS-3060','close',shandle)

 


[ Previous | Contents | Next ]