|
int | camera_open () |
|
int | camera_open_black () |
|
int | camera_open_at_res (enum Resolution res) |
|
int | camera_open_device (int number, enum Resolution res) |
|
int | camera_open_device_model_at_res (int number, enum Model model, enum Resolution res) |
|
int | camera_load_config (const char *name) |
|
int | get_camera_width (void) |
|
int | get_camera_height (void) |
|
int | camera_update (void) |
|
pixel | get_camera_pixel (point2 p) |
|
int | get_channel_count (void) |
|
int | get_object_count (int channel) |
|
const char * | get_object_data (int channel, int object) |
|
int | get_object_data_length (int channel, int object) |
|
double | get_object_confidence (int channel, int object) |
|
int | get_object_area (int channel, int object) |
|
rectangle | get_object_bbox (int channel, int object) |
|
point2 | get_object_centroid (int channel, int object) |
|
point2 | get_object_center (int channel, int object) |
|
void | camera_close () |
|
void | set_camera_config_base_path (const char *const path) |
|
const unsigned char * | get_camera_frame_row (unsigned row) |
|
const unsigned char * | get_camera_frame () |
|
The functions here deal with the camera. Specifically, the functions here deal with object detection through the use of color.
Setup
To use the object detections, you'll first have to have a .conf
file. On a wombat, you can go to settings
, then channels
, then add a configuration. Next, edit that configuration and add a new channel (for the color object detection, it should be HSV Blob Tracking). Finally, configure that channel, selecting the color that you want the camera to detect when detecting objects on that channel.
Example object detection
Assuming you have a configuration file "botball.conf" and you have a Channel 0 on that file configured to detect red pom poms, then the following code would print 'red' when a red pom is seen.
#include <kipr/wombat.h>
#include <stdio.h>
int main(){
int i = 0;
for (i = 0; i < 10; i++){
}
int red_object_seen = 0;
while (!red_object_seen){
if (object_bounding_box.
width * object_bounding_box.
height != 0){
printf("red object seen!");
red_object_seen = 1;
}
}
return 0;
}
rectangle get_object_bbox(int channel, int object)
int camera_load_config(const char *name)
A rectangle object.
Definition: geometry.h:36
int width
the width of the rectangle
Definition: geometry.h:39
int height
the height of the rectangle
Definition: geometry.h:40