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

Linux Cross Reference
Tina4/src/vision/matcher/mat_con.c

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

  1 /**@(#)
  2 **/
  3 /* matches consistent with match list clique */
  4 
  5 #include <tina/sys.h>
  6 #include <tina/sysfuncs.h>
  7 #include <tina/math.h>
  8 #include <tina/mathfuncs.h>
  9 #include <tina/vision.h>
 10 #include <tina/visionfuncs.h>
 11 
 12 Bool    smm_con_with_mlist(Match * match, List * list)
 13 {
 14     List   *ptr;
 15 
 16     for (ptr = list; ptr != NULL; ptr = ptr->next)
 17         if (smm_consistent_matches(match, (Match *) ptr->to) == false)
 18             return (false);
 19 
 20     return (true);
 21 }
 22 
 23 List   *smm_mats_con_with_mlist(List * model, List * scene, List * matches)
 24 {
 25     List   *new_matches = NULL;
 26     List   *m;
 27     List   *s;
 28     List   *ptr;
 29     Match   test = {Match_id};
 30 
 31     test.props = NULL;
 32 
 33     model = list_copy(model, (void *(*) ()) NULL, NULL);
 34     scene = list_copy(scene, (void *(*) ()) NULL, NULL);
 35 
 36     for (ptr = matches; ptr != NULL; ptr = ptr->next)
 37     {
 38         Match  *mat = (Match *) ptr->to;
 39 
 40         model = list_rm_ref(model, mat->to1, (void (*) ()) NULL);
 41         scene = list_rm_ref(scene, mat->to2, (void (*) ()) NULL);
 42     }
 43 
 44     for (m = model; m != NULL; m = m->next)
 45     {
 46         int     type;
 47 
 48         test.type = type = m->type;
 49         test.to1 = m->to;
 50         for (s = scene; s != NULL; s = s->next)
 51         {
 52             if (s->type != type || !smm_reasonable_match(m->to, s->to, type))
 53                 continue;
 54 
 55             test.to2 = s->to;
 56             if (smm_con_with_mlist(&test, matches) == false)
 57                 continue;
 58 
 59             if (smm_con_with_mlist(&test, matches) == false)
 60                 continue;
 61 
 62             test.weight = (float)smm_match_strength(&test);
 63             test.label = new_label();
 64             new_matches = ref_addtostart((List *) new_matches, (void *) match_copy(&test), MATCH);
 65         }
 66     }
 67     list_rm_links(model);
 68     list_rm_links(scene);
 69 
 70     return (list_append(matches, new_matches));
 71 }
 72 

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