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

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