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

Linux Cross Reference
Tina5/tina-libs/tina/vision/visPgh_var.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/visPgh_var.c,v $
 23  * Date    :  $Date: 2003/11/12 15:44:37 $
 24  * Version :  $Revision: 1.4 $
 25  * CVS Id  :  $Id: visPgh_var.c,v 1.4 2003/11/12 15:44:37 neil Exp $
 26  *
 27  * Author  : Legacy TINA
 28  *
 29  */
 30 /**
 31  * @file Access functions for storing the intermediate results from PGH processsing.
 32  * @brief Image interpretation is done as a blackboard paradigm. Data is globally
 33  *        accessible to anywhere in TINA via these access functions providing it 
 34  *        is has been computed.
 35  *        Goes completely against modern coding practices (for example not thread safe)
 36  *        but is extremely useful.
 37  *
 38 */
 39 #include "visPgh_var.h"
 40 
 41 #include <stdio.h>
 42 #include <tina/sys/sys_LstPro.h>
 43 
 44 static Pairs_hist_def  *hist_def = NULL;
 45 static Pairs_scale_def *pairs_scale_def = NULL;
 46 static Pairs_hough_def *hough_def = NULL;
 47 static Match_cut_def   *match_cut_def = NULL;
 48 
 49 static List            *model_poly_list = NULL;
 50 static List            *scene_pairs_list = NULL;
 51 static List            *model_pairs_list = NULL;
 52 static List            *matched_models_list = NULL;
 53 static Line2           *matched_line;
 54 static List            *picked_geom = NULL;
 55 
 56 static List            *model_geom = NULL;
 57 static List            *segmented_lines = NULL;
 58 
 59 /* ---------- Functions ---------- */
 60 
 61 void pairs_hist_def_set(Pairs_hist_def *def)
 62 {
 63     hist_def = def;
 64 }
 65 
 66 Pairs_hist_def *pairs_hist_def_get(void)
 67 {
 68     return hist_def;
 69 }
 70 
 71 void pairs_scale_def_set(Pairs_scale_def *def)
 72 {
 73     pairs_scale_def = def;
 74 }
 75 
 76 Pairs_scale_def *pairs_scale_def_get()
 77 {
 78     return pairs_scale_def;
 79 }
 80 
 81 void pairs_hough_def_set(Pairs_hough_def *def)
 82 {
 83     hough_def = def;
 84 }
 85 
 86 Pairs_hough_def *pairs_hough_def_get(void)
 87 {
 88     return hough_def;
 89 }
 90 
 91 void pairs_match_cut_def_set(Match_cut_def *def)
 92 {
 93     match_cut_def = def;
 94 }
 95 
 96 Match_cut_def *pairs_match_cut_def_get(void)
 97 {
 98     return match_cut_def;
 99 }
100 
101 void pairs_model_poly_list_set(List *list)
102 {
103     model_poly_list = list;
104 }
105 
106 List *pairs_model_poly_list_get(void)
107 {
108     return model_poly_list;
109 }
110 
111 void pairs_scene_pairs_list_set(List *list)
112 {
113     scene_pairs_list = list;
114 }
115 
116 List *pairs_scene_pairs_list_get(void)
117 {
118     return scene_pairs_list;
119 }
120 
121 void pairs_model_pairs_list_set(List *list)
122 {
123     model_pairs_list = list;
124 }
125 
126 List *pairs_model_pairs_list_get(void)
127 {
128     return model_pairs_list;
129 }
130 
131 void pairs_matched_models_list_set(List *list)
132 {
133     matched_models_list = list;
134 }
135 
136 List *pairs_matched_models_list_get(void)
137 {
138     return matched_models_list;
139 }
140 
141 void pairs_matched_line_set(Line2 *line)
142 {
143     matched_line = line;
144 }
145 
146 Line2 *pairs_matched_line_get(void)
147 {
148     return matched_line;
149 }
150 
151 void pairs_picked_geom_set(List *geom)
152 {
153     picked_geom = geom;
154 }
155 
156 List *pairs_picked_geom_get(void)
157 {
158     return picked_geom;
159 }
160 
161 /****************************/
162 /*interface functions*/
163 /*OG july 2003*/
164 
165 void pairs_model_geom_set(List *list)
166 {
167     model_geom = list;
168 }
169 
170 List * pairs_model_geom_get(void)
171 {
172     return model_geom;
173 }
174 
175 void get_model_pair_list(int *points_x, int *points_y)
176 {
177          List *ptr;
178          int i;
179          Line2 *line;
180        
181      /*get the points*/
182          i=0;
183      for (ptr = model_geom; ptr != NULL; ptr = ptr->next)
184          {
185           line = (Line2 *) ptr->to;
186                   points_x[i]=line->p1.el[0];
187                   points_y[i]=line->p1.el[1];
188 
189                   points_x[i+1]= (int)line->p2.el[0];
190                   points_y[i+1]= (int)line->p2.el[1];
191 
192                   i=i+2;
193          }
194 
195 }
196 
197 
198 int get_model_pair_list_dimension()
199 {
200         List *ptr=model_geom;
201     int n;
202         /*number of points*/
203     n = list_length(ptr);
204  
205     return n;
206 }
207 
208 void segmented_lines_set(List *list)
209 {
210     segmented_lines = list;
211 }
212 
213 List * segmented_lines_get(void)
214 {
215     return segmented_lines;
216 }
217 
218 void get_matched_model_list(int *points_x, int *points_y)
219 {
220          List *ptr;
221          int i;
222          Line2 *line;
223        
224      /*get the points*/
225          i=0;
226      for (ptr = matched_models_list; ptr != NULL; ptr = ptr->next)
227          {
228           line = (Line2 *) ptr->to;
229                   points_x[i]=line->p1.el[0];
230                   points_y[i]=line->p1.el[1];
231 
232                   points_x[i+1]= (int)line->p2.el[0];
233                   points_y[i+1]= (int)line->p2.el[1];
234 
235                   i=i+2;
236          }
237 
238 }
239 
240 
241 int get_match_model_list_dimension()
242 {
243         List *ptr=matched_models_list;
244     int n;
245         /*number of points*/
246     n = list_length(ptr);
247  
248     return n;
249 }
250 

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