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

Linux Cross Reference
Tina6/tina-libs/tina/vision/visMatch_esel.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_esel.c,v $
 27  * Date    :  $Date: 2003/10/06 12:29:48 $
 28  * Version :  $Revision: 1.3 $
 29  * CVS Id  :  $Id: visMatch_esel.c,v 1.3 2003/10/06 12:29:48 neil Exp $
 30  *
 31  * Author  : Legacy TINA
 32  *
 33  * Notes :
 34  * generic stereo functions for selecting correct matches
 35  * 
 36  * selection involves the removal of alternative matches 
 37  *
 38  *********
 39 */
 40 
 41 #include "visMatch_esel.h"
 42 
 43 #if HAVE_CONFIG_H
 44   #include <config.h>
 45 #endif
 46 
 47 #include <tina/sys/sysDef.h>
 48 #include <tina/sys/sysPro.h>
 49 #include <tina/math/mathDef.h>
 50 #include <tina/math/mathPro.h>
 51 #include <tina/geometry/geomDef.h>
 52 #include <tina/vision/vis_MatchDef.h>
 53 
 54 /* for a matched edge string fix and select unique GOOD_MATCH matches
 55  * remove reference to all other matches */
 56 void    es_select_fix_matches(Tstring * es)
 57 {
 58     List   *list;
 59     List   *ptr;
 60     Support *selected = NULL;
 61 
 62     if (es == NULL)
 63         return;
 64 
 65     list = (List *) prop_get(es->props, MLIST);
 66 
 67     for (ptr = list; ptr != NULL; ptr = ptr->next)
 68     {
 69         Match  *match = (Match *) ptr->to;
 70         Support *sup;
 71 
 72         sup = (Support *) prop_get(match->props, MATCH_SUPPORT);
 73 
 74         if (sup->type < GOOD_MATCH)
 75             continue;
 76 
 77         if (selected != NULL)
 78             break;
 79         selected = sup;
 80     }
 81 
 82     if (selected != NULL && ptr == NULL)
 83     {
 84         List   *new;
 85 
 86         selected->type = FIXED_MATCH;
 87         if (list->next == NULL)
 88             return;             /* only one element in the list */
 89 
 90         list = list_rm_ref(list, (void *) selected->match, (void (*) ()) NULL);
 91         (void) prop_set(es->props, (void *) list, MLIST, false);        /* put the list back */
 92         new = link_alloc((void *) selected->match, MATCH);
 93         (void) prop_set(es->props, (void *) new, MLIST, true);  /* frees up the list */
 94     } else
 95         (void) prop_set(es->props, NULL, MLIST, true);
 96 }
 97 
 98 /* set matching strength to zero for matches < GOOD_MATCH reset support
 99  * type of all matches to to POT_MATCH */
100 void    es_supp_good_matches_only(Tstring * es)
101 {
102     List   *list;
103     List   *ptr;
104 
105     if (es == NULL)
106         return;
107 
108     list = (List *) prop_get(es->props, MLIST);
109 
110     for (ptr = list; ptr != NULL; ptr = ptr->next)
111     {
112         Match  *match = (Match *) ptr->to;
113         Support *sup;
114 
115         sup = (Support *) prop_get(match->props, MATCH_SUPPORT);
116 
117         if (sup->type < GOOD_MATCH)
118             sup->matching_strength = (float)0.0;
119         sup->type = POT_MATCH;
120     }
121 }
122 

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