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

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

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

  1 /**@(#)
  2 **/
  3 /* support.c
  4  * 
  5  * generic stereo functions for support match support accumulation and
  6  * exchange
  7  * 
  8  * match support structures are associated with match structures used to
  9  * identify mathes during generic forms of stereo processing support
 10  * and match structures have access to each other on their property
 11  * lists in a mutual fashion using the keys MATCH_SUPPORT and plain old
 12  * MATCH respectively */
 13 
 14 #include <tina/sys.h>
 15 #include <tina/sysfuncs.h>
 16 #include <tina/math.h>
 17 #include <tina/mathfuncs.h>
 18 #include <tina/vision.h>
 19 
 20 /* allocate and initialise support data structure */
 21 Support *supp_alloc(void)
 22 {
 23     Support *sup = ts_ralloc(Support);
 24 
 25     return (sup);
 26 }
 27 
 28 /* functions at match level to acess support structure and return
 29  * various matching strength support values */
 30 
 31 double  match_strength(Match * match)
 32 {
 33     Support *sup;
 34 
 35     sup = (Support *) prop_get(match->props, MATCH_SUPPORT);
 36 
 37     return ((sup == NULL || sup->type <= BAD_MATCH) ? 0.0 : sup->matching_strength);
 38 }
 39 
 40 double  match_total_string_strength(Match * match)
 41 {
 42     Support *sup;
 43 
 44     sup = (Support *) prop_get(match->props, MATCH_SUPPORT);
 45 
 46     return ((sup == NULL || sup->type <= BAD_MATCH) ? 0.0 : sup->total_string);
 47 }
 48 
 49 double  match_local_string_strength(Match * match)
 50 {
 51     Support *sup;
 52 
 53     sup = (Support *) prop_get(match->props, MATCH_SUPPORT);
 54 
 55     return ((sup == NULL || sup->type <= BAD_MATCH) ? 0.0 : sup->local_string);
 56 }
 57 
 58 double  match_local_area_strength(Match * match)
 59 {
 60     Support *sup;
 61 
 62     sup = (Support *) prop_get(match->props, MATCH_SUPPORT);
 63 
 64     return ((sup == NULL || sup->type <= BAD_MATCH) ? 0.0 : sup->local_area);
 65 }
 66 
 67 /* set matching strength field of support structure for a list of
 68  * matches */
 69 void    match_set_strength_from_weight(Match * match)
 70 {
 71     Support *sup;
 72 
 73     sup = (Support *) prop_get(match->props, MATCH_SUPPORT);
 74     if (sup == NULL)
 75         return;
 76     sup->matching_strength = match->weight;
 77 }
 78 
 79 /* set matching strength field of support structure for a list of
 80  * matches */
 81 /* ARGSUSED quieten lint */
 82 void    match_set_match_strength(Match * match, int type, double *strength)
 83 {
 84     Support *sup;
 85 
 86     sup = (Support *) prop_get(match->props, MATCH_SUPPORT);
 87     if (sup == NULL)
 88         return;
 89     sup->matching_strength = (float)*strength;
 90 }
 91 
 92 /* set total string field of support structure for a list of matches */
 93 /* ARGSUSED quieten lint */
 94 void    match_set_total_string(Match * match, int type, double *strength)
 95 {
 96     Support *sup;
 97 
 98     sup = (Support *) prop_get(match->props, MATCH_SUPPORT);
 99     if (sup == NULL)
100         return;
101     sup->total_string = (float)*strength;
102 }
103 
104 /* set the support type field of a list of matches to type */
105 void    mlist_set_supp_type(List * mlist, int type)
106 {
107     while (mlist != NULL)
108     {
109         Match  *match = (Match *) mlist->to;
110         Support *sup;
111 
112         sup = (Support *) prop_get(match->props, MATCH_SUPPORT);
113         if (sup != NULL)
114             sup->type = type;
115         mlist = mlist->next;
116     }
117 }
118 

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