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

Linux Cross Reference
Tina4/src/vision/corner/st_mat_cnr.c

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

  1 /**@(#)
  2 **/
  3 #include <stdio.h>
  4 #include <math.h>
  5 #include <tina/sys.h>
  6 #include <tina/sys_types.h>
  7 #include <tina/sysfuncs.h>
  8 #include <tina/math.h>
  9 #include <tina/mathfuncs.h>
 10 #include <tina/tina_types.h>
 11 #include <tina/vision.h>
 12 #include <tina/visionfuncs.h>
 13 
 14 static FILE *fp = NULL;
 15 
 16 void    set_st_corner_matches(Imrect * er)
 17 {
 18     void   *data = NULL;
 19     Rindex *fx;
 20 
 21     if ((fx = prop_get(er->props, ER_TINDEX)) == NULL)
 22         return;
 23 
 24     fp = fopen("temp.dump", "w");
 25     apply_func_to_windex(fx, (void *(*) ())set_st_corner_match, data);
 26     (void) fclose(fp);
 27 }
 28 
 29 /* Starting from the current left hand edgel can we go back to any
 30  * previous stereo matching and check that the current stereo match is
 31  * consistent */
 32 /* ARGSUSED quieten lint */
 33 /* BUGFIX JB 22/11/93 was: void   *set_st_corner_match(Edgel * ledge,
 34  * void *data) */
 35 
 36 void    set_st_corner_match(Edgel * ledge, void *data /* unused */ )
 37 {
 38     List   *left_matches;
 39     Match  *best_left_match;
 40     Edgel  *redge;
 41     List   *back_matches_left;
 42     List   *back_matches_right;
 43     List   *for_matches_left;
 44     List   *for_matches_right;
 45     Match  *back_match_left;
 46     Match  *back_match_right;
 47     Edgel  *back_edge_left;
 48     Edgel  *back_edge_right;
 49     List   *sold_matches_left;
 50     Match  *sold_match_left;
 51     Edgel  *sold_edge_right;
 52 
 53     /* current stereo match is redge */
 54     if ((left_matches = (List *) prop_get(ledge->props, MLIST)) == NULL
 55         || (left_matches->type < GOOD_MATCH)
 56         || (best_left_match = (Match *) left_matches->to) == NULL
 57         || (redge = (Edgel *) best_left_match->to2) == NULL)
 58         return;
 59 
 60     if ((back_matches_left = (List *) prop_get(ledge->props, BACKTEMP)) == NULL
 61 
 62     /* if the temporal match type is already better than GOOD_MATCH
 63      * then the FORTEMP and BACKTEMP matches are already known to be
 64      * identical */
 65         || (back_matches_left->type < GOOD_MATCH)
 66         || (back_match_left = (Match *) back_matches_left->to) == NULL
 67         || (back_edge_left = (Edgel *) back_match_left->to2) == NULL)
 68         return;
 69 
 70     if ((back_matches_right = (List *) prop_get(redge->props, BACKTEMP)) == NULL
 71 
 72     /* if the temporal match type is already better than GOOD_MATCH
 73      * then the FORTEMP and BACKTEMP matches are already known to be
 74      * identical */
 75         || (back_matches_right->type < GOOD_MATCH)
 76       || (back_match_right = (Match *) back_matches_right->to) == NULL
 77         || (back_edge_right = (Edgel *) back_match_right->to2) == NULL)
 78         return;
 79 
 80     /* old stereo match is sold_edge_right */
 81     if ((sold_matches_left = (List *) prop_get(back_edge_left->props, MLIST)) == NULL
 82         || (sold_match_left = (Match *) sold_matches_left->to) == NULL)
 83         return;
 84     sold_edge_right = sold_match_left->to2;
 85 
 86     if (sold_edge_right == back_edge_right)
 87     {
 88         back_matches_left->type = FIXED_MATCH;
 89         back_matches_right->type = FIXED_MATCH;
 90         for_matches_left = (List *) prop_get(back_edge_left->props, FORTEMP);
 91         for_matches_right = (List *) prop_get(back_edge_right->props, FORTEMP);
 92         if (for_matches_left != NULL)
 93             for_matches_left->type = FIXED_MATCH;
 94         if (for_matches_right != NULL)
 95             for_matches_right->type = FIXED_MATCH;
 96         if (fp != NULL)
 97             (void) fprintf(fp, "%3.2f %3.2f %3.2f %3.2f %3.2f %3.2f %3.2f %3.2f\n",
 98                  back_edge_left->pos.el[0], back_edge_left->pos.el[1],
 99                back_edge_right->pos.el[0], back_edge_right->pos.el[1],
100                            ledge->pos.el[0], ledge->pos.el[1],
101                            redge->pos.el[0], redge->pos.el[1]);
102     }
103 }
104 
105 Match  *find_temporal_match(Match * match)
106 {
107     void   *get_fixed_match();
108     Edgel  *ledge;
109     Edgel  *foredge;
110     Match  *formatch;
111     int     data = FORTEMP;
112 
113     ledge = (Edgel *) match->to1;
114     if ((formatch = (Match *) get_fixed_match(ledge, &data)) != NULL)
115     {
116         foredge = (Edgel *) formatch->to1;
117         data = MLIST;
118         return ((Match *) get_fixed_match(foredge, &data));
119     } else
120         return (NULL);
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.