~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Linux Cross Reference
Tina4/src/vision/improc/canny.c

Version: ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /**@(#)
  2 **/
  3 #include <math.h>
  4 #include <tina/sys.h>
  5 #include <tina/sysfuncs.h>
  6 #include <tina/math.h>
  7 #include <tina/vision.h>
  8 #include <tina/visionfuncs.h>
  9 
 10 Imrect *canny(Imrect * im, double sigma, double precision, double lowthres, double upthres, int lengththres)
 11 {
 12     Imrect *gim;
 13     Imrect *edrect;
 14     Imrect *gradx;
 15     Imrect *grady;
 16     Imrect *gradsq;
 17     unsigned int label;         /* for blocked allocation */
 18 
 19     if (im == NULL)
 20         return (NULL);
 21 
 22     label = ralloc_end_blocked();
 23 
 24     if (sigma == 0.0)
 25         gim = im_copy(im);
 26     else
 27         gim = imf_gauss(im, sigma, precision);
 28     gradx = imf_grad_h(gim);
 29     grady = imf_grad_v(gim);
 30     im_free(gim);
 31     gradsq = imf_sumsq(gradx, grady);
 32 
 33     if (label)                  /* allocation was blocked */
 34         (void) ralloc_start_blocked(label);     /* re-start blocking */
 35 
 36     edrect = nonmaxsup(gradx, grady, gradsq, lowthres);
 37     im_free(gradx);
 38     im_free(grady);
 39     im_free(gradsq);
 40     er_find_edge_strings(edrect);
 41     er_rm_edges(edrect, EDGE_GET_CONN_MASK, EDGE_NOLINK);
 42     er_edge_strings_thres(edrect, lengththres, upthres);
 43     er_set_row_index(edrect);
 44     return (edrect);
 45 }
 46 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.