Page 67
KIPR Link Vision Library Functions
camera_close [Category: Vision]
Format:
void
camera_close();
Cleanup the current camera instance. See also
camera_open
,
camera_open_device
.
camera_load_config [Category: Vision]
Format:
int
camera_load_config(
char
name[]);
Loads a config file on the KIPR Link in place of the default config file. You
must
append
.config
to the file name for this function to locate it. Returns 1 on success, 0 on failure. See also
camera_open
,
camera_open_device
.
camera_open [Category: Vision]
Format:
int
camera_open(
int
res_numb);
Opens the KIPR Link's default channel configuration. The default configuration is selected
from among the channel configurations defined on the KIPR Link using its
Settings .. Channels
menu. A resolution of one of
LOW_RES
,
MED_RES
,
HIGH_RES
needs to be specified. Returns
1 on success, 0 on failure. See also
camera_open_device
,
camera_close
.
camera_open_device [Category: Vision]
Format:
int
camera_open_device(
int
number,
int
res_numb);
If more than 1 camera is plugged in, 0 is the first camera, 1 is the second camera, etc. Only 1
camera at a time can be used, and the default configuration is selected. A resolution of one of
LOW_RES
,
MED_RES
,
HIGH_RES
needs to be specified. Returns 1 on success, 0 on failure. See
also
camera_open
,
camera_close
.
camera_update [Category: Vision]
Format:
int
camera_update();
Pulls a new image from the camera for processing. Returns 1 on success, 0 on failure.
get_channel_count [Category: Vision]
Format:
int
get_channel_count();
Returns the number of channels in the current configuration. See also
get_object_count
.
get_code_num [Category: Vision]
Format:
int
get_code_num(
int
channel,
int
object);
Returns the data associated with the given channel and object as an integer. If the given
channel or object doesn't exist, -1 is returned. See also
get_object_data
.
get_object_area [Category: Vision]
Format:
int
get_object_area(
int
channel,
int
object);
Returns the object's bounding box area. -1 is returned if the channel or object doesn't exist.
get_object_bbox [Category: Vision]
Format:
rectangle
get_object_bbox(
int
channel,
int
object);
Returns the bounding box of the given object on the given channel as a
rectangle
data type.
For example,
rectangle
mybox;
mybox = get_object_bbox(0,2);
printf(
"x coord %d y coord %d\n"
, mybox.x, mybox.y);
displays the x and y coordinates of bounding box 2 for channel 0.