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

Linux Cross Reference
Tina5/tina-libs/tina/vision/visMatch_esupp.c

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

  1 /**********
  2  *
  3  * This file is part of the TINA Open Source Image Analysis Environment
  4  * henceforth known as TINA
  5  *
  6  * TINA is free software; you can redistribute it and/or modify
  7  * it under the terms of the GNU Lesser General Public License as
  8  * published by the Free Software Foundation.
  9  *
 10  * TINA is distributed in the hope that it will be useful,
 11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 13  * GNU Lesser General Public License for more details.
 14  *
 15  * You should have received a copy of the GNU Lesser General Public License
 16  * along with TINA; if not, write to the Free Software Foundation, Inc.,
 17  * 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 18  *
 19  **********
 20  *
 21  * Program :    TINA
 22  * File    :  $Source: /home/tina/cvs/tina-libs/tina/vision/visMatch_esupp.c,v $
 23  * Date    :  $Date: 2005/02/07 23:27:41 $
 24  * Version :  $Revision: 1.4 $
 25  * CVS Id  :  $Id: visMatch_esupp.c,v 1.4 2005/02/07 23:27:41 paul Exp $
 26  *
 27  * Author  : Legacy TINA
 28  *
 29  * Notes :
 30  * generic stereo functions for support match support accumulation and
 31  * exchange
 32  * 
 33  * match support structures are associated with match structures used to
 34  * identify mathes during generic forms of stereo processing support
 35  * and match structures have access to each other on their property
 36  * lists in a mutual fashion using the keys MATCH_SUPPORT and plain old
 37  * MATCH respectively 
 38  *
 39  *********
 40 */
 41 
 42 #include "visMatch_esupp.h"
 43 
 44 #if HAVE_CONFIG_H
 45   #include <config.h>
 46 #endif
 47 
 48 #include <tina/sys/sysDef.h>
 49 #include <tina/sys/sysPro.h>
 50 #include <tina/math/mathDef.h>
 51 #include <tina/math/mathPro.h>
 52 #include <tina/geometry/geomDef.h>
 53 #include <tina/geometry/geomPro.h>
 54 
 55 /* allocate and initialise support data structure */
 56 Support *supp_alloc(void)
 57 {
 58     Support *sup = ts_ralloc(Support);
 59 
 60     return (sup);
 61 }
 62 
 63 /* functions at match level to acess support structure and return
 64  * various matching strength support values */
 65 
 66 double  match_strength(Match * match)
 67 {
 68     Support *sup;
 69 
 70     sup = (Support *) prop_get(match->props, MATCH_SUPPORT);
 71 
 72     return ((sup == NULL || sup->type <= BAD_MATCH) ? 0.0 : sup->matching_strength);
 73 }
 74 
 75 double  match_total_string_strength(Match * match)
 76 {
 77     Support *sup;
 78 
 79     sup = (Support *) prop_get(match->props, MATCH_SUPPORT);
 80 
 81     return ((sup == NULL || sup->type <= BAD_MATCH) ? 0.0 : sup->total_string);
 82 }
 83 
 84 double  match_local_string_strength(Match * match)
 85 {
 86     Support *sup;
 87 
 88     sup = (Support *) prop_get(match->props, MATCH_SUPPORT);
 89 
 90     return ((sup == NULL || sup->type <= BAD_MATCH) ? 0.0 : sup->local_string);
 91 }
 92 
 93 double  match_local_area_strength(Match * match)
 94 {
 95     Support *sup;
 96 
 97     sup = (Support *) prop_get(match->props, MATCH_SUPPORT);
 98 
 99     return ((sup == NULL || sup->type <= BAD_MATCH) ? 0.0 : sup->local_area);
100 }
101 
102 /* set matching strength field of support structure for a list of
103  * matches */
104 void    match_set_strength_from_weight(Match * match)
105 {
106     Support *sup;
107 
108     sup = (Support *) prop_get(match->props, MATCH_SUPPORT);
109     if (sup == NULL)
110         return;
111     sup->matching_strength = match->weight;
112 }
113 
114 /* set matching strength field of support structure for a list of
115  * matches */
116 /* ARGSUSED quieten lint */
117 void    match_set_match_strength(Match * match, int type, double *strength)
118 {
119     Support *sup;
120 
121     sup = (Support *) prop_get(match->props, MATCH_SUPPORT);
122     if (sup == NULL)
123         return;
124     sup->matching_strength = (float)*strength;
125 }
126 
127 /* set total string field of support structure for a list of matches */
128 /* ARGSUSED quieten lint */
129 void    match_set_total_string(Match * match, int type, double *strength)
130 {
131     Support *sup;
132 
133     sup = (Support *) prop_get(match->props, MATCH_SUPPORT);
134     if (sup == NULL)
135         return;
136     sup->total_string = (float)*strength;
137 }
138 
139 /* set the support type field of a list of matches to type */
140 void    mlist_set_supp_type(List * mlist, int type)
141 {
142     while (mlist != NULL)
143     {
144         Match  *match = (Match *) mlist->to;
145         Support *sup;
146 
147         sup = (Support *) prop_get(match->props, MATCH_SUPPORT);
148         if (sup != NULL)
149             sup->type = type;
150         mlist = mlist->next;
151     }
152 }
153 
154 /* add support structure to property list of match structure using the
155  * key MATCH_SUPPORT */
156 List   *match_add_supp_prop(Match * m)
157 {
158     Support *sup;
159 
160     sup = supp_alloc();
161     sup->type = POT_MATCH;
162     sup->matching_strength = m->weight;
163     sup->match = m;
164     m->props = proplist_addifnp(m->props, (void *) sup, MATCH_SUPPORT, rfree, true);
165     /* Return value may be used in future */
166     return(NULL);
167 }
168 
169 /* add support structure to all matches of epipolar edge sub-string
170  * using match_add_supp_prop function */
171 void    es_add_supp_prop(Tstring * es)
172 /* epipolar edge string */
173 {
174     if (es == NULL)
175         return;
176 
177     list_apply_func((List *) prop_get(es->props, MLIST),
178                     (void (*) ()) match_add_supp_prop, NULL);
179 }
180 
181 

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