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

Linux Cross Reference
Tina4/src/vision/match/match_es.c

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

  1 /**@(#)
  2 **/
  3 /* match_es.c
  4  * 
  5  * generic functions that relate edge strings and matches */
  6 
  7 #include <math.h>
  8 #include <tina/sys.h>
  9 #include <tina/sysfuncs.h>
 10 #include <tina/math.h>
 11 #include <tina/mathfuncs.h>
 12 #include <tina/vision.h>
 13 
 14 /* initialise match list of an edge string */
 15 void    es_init_mlist(Tstring * es)
 16 {
 17     if (es == NULL)
 18         return;
 19     (void) prop_set(es->props, NULL, MLIST, true);
 20 }
 21 
 22 /* get the list of matches at a meta string level from the union
 23  * implied by matches between epipolar edge subs-trings
 24  * 
 25  * 
 26  * the resulting match list is unique wrt ->to2 field (what they match to)
 27  * 
 28  * meta edge strings may be a composite made from copies of smaller edge
 29  * strings
 30  * 
 31  * hence it follows that: 1. edge strings and substrings may not share
 32  * list elements 2. edge strings and substrings do reference the same
 33  * edgels 3. edge strings and substrings may not preserve the local
 34  * order of edges */
 35 List   *es_get_list_of_matches(Tstring * es)
 36 {
 37     List *ptr;
 38     List *end;
 39     Tstring *sub, *sub_last = NULL;
 40     List   *matches = NULL;
 41 
 42     if (es == NULL)
 43         return (NULL);
 44 
 45     end = es->end;
 46     for (ptr = es->start;; ptr = ptr->next)
 47     {
 48         Edgel  *edge;
 49         List   *mlist;
 50 
 51         if (ptr->type != EDGE)
 52             continue;
 53 
 54         edge = DD_EDGE(ptr);
 55         sub = (Tstring *) prop_get(edge->props, SINDEX);
 56         if (sub != NULL && sub != sub_last)
 57         {
 58             mlist = (List *) prop_get(sub->props, MLIST);
 59 
 60             for (; mlist != NULL; mlist = mlist->next)
 61             {
 62                 Match  *m = (Match *) mlist->to;
 63 
 64                 if (link_get_by_ref(matches, m->to2) == NULL)
 65                     matches = ref_addtostart((List *) matches, (void *) m, MATCH);
 66             }
 67         }
 68         sub_last = sub;
 69         if (ptr == end)
 70             break;
 71     }
 72     return (matches);
 73 }
 74 

~ [ 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.