The Link Camera

Vision Processing with the Link OS and Camera

Link CameraVision Setup

Training the Link to use an HSV color model

Using QR codes (a separate channel can be set for QR code recognition)

• New library functions are required using the camera; e.g.,

    camera_open(<res>)        camera_close() – neither used on CBC

    camera_update() – not ‘track_update()’

    camera_load_config(<name>.conf)

    get_object_count(<ch>)  – not ‘track_count(<ch>)’          get_object_bbox(<ch>,<obj>)

    get_object_center(<ch>,<obj>)   or  get_object_centroid(<ch>,<obj>)  see manual for details

    get_object_data(<ch>,<obj>) use with QR codes

   Parameter notation is the same as for the CBC vision functions.

Here is an example of C code:

/***************** Vision Excercise#1 for Link - recognizing colored cards ****************
 //assumes color select channel 0 set for 'pink' and channel 1 set for 'green' tlg 9/8/2014*/
 int main() {
    camera_open(LOW_RES);
    display_clear(); // just <display_clear() > under KISS IDE for'Link'
    printf("Card Color Recognition\n");
    msleep(2000);
    while(1){//keep checking the vision frames forever 
       camera_update();
       if((get_object_count(0)>0)&&get_object_area(0,0)>20&&
          (get_object_area(0,0)>get_object_area(1,0))) {printf("pinkcard\n");}
       else{ 
            if((get_object_count(1)>0)&&get_object_area(1,0)>20&&
              (get_object_area(1,0)>get_object_area(0,0))) 
              {printf("green card\n");}
            else{printf("hold up colored card\n");} 
           } 
       msleep(200); // don't rush display print out 
     } //end while
    camera_close(); 
}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s