next up previous contents
Next: Geom2 Callback Up: Examples from Edge Tool Previous: Examples from Edge Tool   Contents

Canny Callback

The basic canny callback procedure is argument free and is as follows

static int stereo_images;

static void canny_proc()
{
    if (stereo_images)
         stereo_canny_proc();
    else
         mono_canny_proc():
}

The variable stereo_images is used to select the appropriate Tina interface module procedure. We shall consider the case of monocular image processing

static void mono_canny_proc(void)
{
    Tv     *tv;
    Imrect *im;

    tv = mono_tv_get();
    im = mono_image_get();
    if (tv != NULL && tv->tv_screen != NULL)    /* get roi from tv */
        im = im_subim(im, tv_get_im_roi(tv));
    mono_edges_set(canny(im, sigma, precision, low_edge_thres,
                         up_edge_thres, len_thres));
    if (tv != NULL && tv->tv_screen != NULL)
        im_free(im);
    tv_edges_conn(tv, mono_edges_get());
    tv_flush(tv);
    mono_geom_set((List *) NULL);       /* now out of date */
}

This function involves a call to the canny function (resident in -ltina library) on the current mono image and display (volatile) on the current mono tv (if any). As well as identifying edges the canny function also determines putative connectivity and forms a list of edge strings which is stored on the property list of the resulting imrect. The region of interest of the mono tv (if in use) is used to define the image region to be processed. The display function tv_edges_conn uses the connectivity of an edge to determine the colour of the pixel.


next up previous contents
Next: Geom2 Callback Up: Examples from Edge Tool Previous: Examples from Edge Tool   Contents
root 2017-11-18