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

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

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