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

Linux Cross Reference
Tina4/src/vision/stereo/select.c

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

  1 /**@(#)
  2 **/
  3 /* select.c
  4  * 
  5  * generic stereo functions for selecting correct matches
  6  * 
  7  * selection involves the removal of alternative matches */
  8 
  9 #include <tina/sys.h>
 10 #include <tina/sysfuncs.h>
 11 #include <tina/math.h>
 12 #include <tina/mathfuncs.h>
 13 #include <tina/vision.h>
 14 
 15 /* for a matched edge string fix and select unique GOOD_MATCH matches
 16  * remove reference to all other matches */
 17 void    es_select_fix_matches(Tstring * es)
 18 {
 19     List   *list;
 20     List   *ptr;
 21     Support *selected = NULL;
 22 
 23     if (es == NULL)
 24         return;
 25 
 26     list = (List *) prop_get(es->props, MLIST);
 27 
 28     for (ptr = list; ptr != NULL; ptr = ptr->next)
 29     {
 30         Match  *match = (Match *) ptr->to;
 31         Support *sup;
 32 
 33         sup = (Support *) prop_get(match->props, MATCH_SUPPORT);
 34 
 35         if (sup->type < GOOD_MATCH)
 36             continue;
 37 
 38         if (selected != NULL)
 39             break;
 40         selected = sup;
 41     }
 42 
 43     if (selected != NULL && ptr == NULL)
 44     {
 45         List   *new;
 46 
 47         selected->type = FIXED_MATCH;
 48         if (list->next == NULL)
 49             return;             /* only one element in the list */
 50 
 51         list = list_rm_ref(list, (void *) selected->match, (void (*) ()) NULL);
 52         (void) prop_set(es->props, (void *) list, MLIST, false);        /* put the list back */
 53         new = link_alloc((void *) selected->match, MATCH);
 54         (void) prop_set(es->props, (void *) new, MLIST, true);  /* frees up the list */
 55     } else
 56         (void) prop_set(es->props, NULL, MLIST, true);
 57 }
 58 
 59 /* set matching strength to zero for matches < GOOD_MATCH reset support
 60  * type of all matches to to POT_MATCH */
 61 void    es_supp_good_matches_only(Tstring * es)
 62 {
 63     List   *list;
 64     List   *ptr;
 65 
 66     if (es == NULL)
 67         return;
 68 
 69     list = (List *) prop_get(es->props, MLIST);
 70 
 71     for (ptr = list; ptr != NULL; ptr = ptr->next)
 72     {
 73         Match  *match = (Match *) ptr->to;
 74         Support *sup;
 75 
 76         sup = (Support *) prop_get(match->props, MATCH_SUPPORT);
 77 
 78         if (sup->type < GOOD_MATCH)
 79             sup->matching_strength = (float)0.0;
 80         sup->type = POT_MATCH;
 81     }
 82 }
 83 

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