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

Linux Cross Reference
Tina6/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 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 General Public License for more details.
 14  *
 15  * You should have received a copy of the GNU 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  * ANY users of TINA who require exemption from the existing licence must
 20  * negotiate a new licence with Dr. Neil.A.Thacker, the sole agent for
 21  * the University of Manchester.
 22  *
 23  **********
 24  *
 25  * Program :    TINA
 26  * File    :  $Source: /home/tina/cvs/tina-libs/tina/vision/visMatch_esupp.c,v $
 27  * Date    :  $Date: 2005/02/07 23:27:41 $
 28  * Version :  $Revision: 1.4 $
 29  * CVS Id  :  $Id: visMatch_esupp.c,v 1.4 2005/02/07 23:27:41 paul Exp $
 30  *
 31  * Author  : Legacy TINA
 32  *
 33  * Notes :
 34  * generic stereo functions for support match support accumulation and
 35  * exchange
 36  * 
 37  * match support structures are associated with match structures used to
 38  * identify mathes during generic forms of stereo processing support
 39  * and match structures have access to each other on their property
 40  * lists in a mutual fashion using the keys MATCH_SUPPORT and plain old
 41  * MATCH respectively 
 42  *
 43  *********
 44 */
 45 
 46 #include "visMatch_esupp.h"
 47 
 48 #if HAVE_CONFIG_H
 49   #include <config.h>
 50 #endif
 51 
 52 #include <tina/sys/sysDef.h>
 53 #include <tina/sys/sysPro.h>
 54 #include <tina/math/mathDef.h>
 55 #include <tina/math/mathPro.h>
 56 #include <tina/geometry/geomDef.h>
 57 #include <tina/geometry/geomPro.h>
 58 
 59 /* allocate and initialise support data structure */
 60 Support *supp_alloc(void)
 61 {
 62     Support *sup = ts_ralloc(Support);
 63 
 64     return (sup);
 65 }
 66 
 67 /* functions at match level to acess support structure and return
 68  * various matching strength support values */
 69 
 70 double  match_strength(Match * match)
 71 {
 72     Support *sup;
 73 
 74     sup = (Support *) prop_get(match->props, MATCH_SUPPORT);
 75 
 76     return ((sup == NULL || sup->type <= BAD_MATCH) ? 0.0 : sup->matching_strength);
 77 }
 78 
 79 double  match_total_string_strength(Match * match)
 80 {
 81     Support *sup;
 82 
 83     sup = (Support *) prop_get(match->props, MATCH_SUPPORT);
 84 
 85     return ((sup == NULL || sup->type <= BAD_MATCH) ? 0.0 : sup->total_string);
 86 }
 87 
 88 double  match_local_string_strength(Match * match)
 89 {
 90     Support *sup;
 91 
 92     sup = (Support *) prop_get(match->props, MATCH_SUPPORT);
 93 
 94     return ((sup == NULL || sup->type <= BAD_MATCH) ? 0.0 : sup->local_string);
 95 }
 96 
 97 double  match_local_area_strength(Match * match)
 98 {
 99     Support *sup;
100 
101     sup = (Support *) prop_get(match->props, MATCH_SUPPORT);
102 
103     return ((sup == NULL || sup->type <= BAD_MATCH) ? 0.0 : sup->local_area);
104 }
105 
106 /* set matching strength field of support structure for a list of
107  * matches */
108 void    match_set_strength_from_weight(Match * match)
109 {
110     Support *sup;
111 
112     sup = (Support *) prop_get(match->props, MATCH_SUPPORT);
113     if (sup == NULL)
114         return;
115     sup->matching_strength = match->weight;
116 }
117 
118 /* set matching strength field of support structure for a list of
119  * matches */
120 /* ARGSUSED quieten lint */
121 void    match_set_match_strength(Match * match, int type, double *strength)
122 {
123     Support *sup;
124 
125     sup = (Support *) prop_get(match->props, MATCH_SUPPORT);
126     if (sup == NULL)
127         return;
128     sup->matching_strength = (float)*strength;
129 }
130 
131 /* set total string field of support structure for a list of matches */
132 /* ARGSUSED quieten lint */
133 void    match_set_total_string(Match * match, int type, double *strength)
134 {
135     Support *sup;
136 
137     sup = (Support *) prop_get(match->props, MATCH_SUPPORT);
138     if (sup == NULL)
139         return;
140     sup->total_string = (float)*strength;
141 }
142 
143 /* set the support type field of a list of matches to type */
144 void    mlist_set_supp_type(List * mlist, int type)
145 {
146     while (mlist != NULL)
147     {
148         Match  *match = (Match *) mlist->to;
149         Support *sup;
150 
151         sup = (Support *) prop_get(match->props, MATCH_SUPPORT);
152         if (sup != NULL)
153             sup->type = type;
154         mlist = mlist->next;
155     }
156 }
157 
158 /* add support structure to property list of match structure using the
159  * key MATCH_SUPPORT */
160 List   *match_add_supp_prop(Match * m)
161 {
162     Support *sup;
163 
164     sup = supp_alloc();
165     sup->type = POT_MATCH;
166     sup->matching_strength = m->weight;
167     sup->match = m;
168     m->props = proplist_addifnp(m->props, (void *) sup, MATCH_SUPPORT, rfree, true);
169     /* Return value may be used in future */
170     return(NULL);
171 }
172 
173 /* add support structure to all matches of epipolar edge sub-string
174  * using match_add_supp_prop function */
175 void    es_add_supp_prop(Tstring * es)
176 /* epipolar edge string */
177 {
178     if (es == NULL)
179         return;
180 
181     list_apply_func((List *) prop_get(es->props, MLIST),
182                     (void (*) ()) match_add_supp_prop, NULL);
183 }
184 
185 

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