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

Linux Cross Reference
Tina4/src/tools/corner/cnr_tool.c

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

  1 #include <stdio.h>
  2 #include <values.h>
  3 #include <tina/all_tina.h>
  4 
  5 static double   sigma = 1.0, precision = 0.01, thres = 6.0;
  6 static double   lowd = -0.5, upd = 0.5, width = 3.0;
  7 static double   disp = 0;
  8 static double   uniqueness = 0.004, correlate = 0.985, asymetry= 0.85;
  9 static double   tuniqueness = 0.001, tcorrelate = 0.980, tasymetry = 0.85;
 10 static double   theight = 20.0, twidth = 60.0;
 11 static double   patch_sigma = 3.0;
 12 static int      stereo_images = 1;
 13 static int      fixed_matches = 0;
 14 static int      good_matches = 0;
 15 
 16 static Imrect   *mono_im1=NULL,*mono_im2=NULL;
 17 
 18 extern Tv_pick  mono_corner_matches(void);
 19 extern Imrect  *stored_mono_corners();
 20 extern void     mono_corners_store(Imrect * er);
 21 
 22 
 23 static void     add_patch(Edgel *edge, int type, void * im)
 24 {
 25     Matrix *patch;
 26 
 27         /* patches are 5*5 , so i (sam) have chosen a default sigma of 3.0 */
 28     patch = add_patch_to_props(edge, im, patch_sigma);
 29 }
 30 
 31 static  void    mono_show_stored_corners(void)
 32 {
 33         Tv      *tv = mono_tv_get();
 34         int     j,i;
 35         Imrect  *sc = stored_mono_corners();
 36         Imregion *region;
 37 
 38         if (!sc)
 39                 return;
 40         region = sc->region;
 41 
 42         tv_set_color(tv, red);
 43         for (j=region->ly;j<region->uy;j++)
 44         {
 45                 for (i=region->lx;i<region->ux;i++)
 46                 {
 47                         Ipos    op;
 48                         Edgel   *ej;
 49 
 50                         ej = IM_PTR( sc, j,i );
 51                         if (!ej)        continue;
 52 
 53                         op = tv_proj2( tv, vec2( (double) i, (double) j));
 54                         tv_point( tv, op);
 55                 }
 56         }
 57 
 58 }
 59 
 60 static void             flip_mono_im(void)
 61 {
 62         Imrect  *temp_ptr;
 63         Imrect  *mono_corners_get();
 64         Tv              *tv = mono_tv();
 65         Imrect  *new_mono;
 66 
 67         temp_ptr = mono_im2;
 68         mono_im2 = mono_im1;
 69         mono_im1 = temp_ptr;
 70         new_mono = im_copy(mono_im1);
 71         mono_image_set( new_mono );
 72 
 73 /*
 74         temp_ptr = mono_corners_get();
 75         mono_corners_set( stored_mono_corners() );
 76         mono_corners_store( temp_ptr );
 77 */
 78         mono_corners_on(true);
 79         mono_init(tv);
 80         mono_show_stored_corners();
 81     tv_flush(tv);
 82 
 83 }
 84 
 85 static void     mono_corner_proc()
 86 {
 87     Tv             *tv;
 88     Imrect         *im;
 89     void            mono_corners_null();
 90 
 91     tv = mono_tv();
 92     im = mono_image();
 93         
 94         im_free( mono_im2 );
 95         mono_im2 = mono_im1;
 96         mono_im1 = im_copy( im );
 97 
 98     if (tv != NULL )    /* get roi from tv */
 99                 im = im_subim(im, tv_get_im_roi(tv));
100     er_free(stored_mono_corners());
101     mono_corners_store(mono_corners_get());
102     mono_corners_null();
103     mono_corners_set(corner(im, sigma, precision, thres));
104 
105         /* make a patch list and attach to the corner image - this will
106          * be used by the temporal matcher util 
107          */
108     tv_edges_conn(tv, mono_corners_get());
109     er_apply_to_all_edges(mono_corners_get(), add_patch,
110                          (void*) mono_image());
111         mono_show_stored_corners();
112     tv_flush(tv);
113 }
114 
115 void            stereo_corner_proc(Imrect *left_im, Imrect *right_im)
116 {
117     Tv             *tv;
118     Imrect         *im;
119     Imrect         *er;
120     Vec2            ul, lr;
121     Imregion       *roi;
122     Imrect         *stored_left_corners(), *stored_right_corners();
123 
124     if (left_im == NULL || right_im == NULL)
125         return;
126 
127     tv = left_tv();
128     er_free(stored_left_corners());
129     left_corners_store(left_corners_get());
130     left_corners_null();
131     left_corners_set(corner(left_im, sigma, precision, thres));
132     if ((er = left_corners_get()) != NULL)
133     {
134         if ((roi = er->region) != NULL)
135         {
136             lr.el[0] = roi->lx;
137             lr.el[1] = roi->ly;
138             ul.el[0] = roi->ux;
139             ul.el[1] = roi->uy;
140             tv_edges_conn(tv, left_corners_get());
141             tv_set_overlay(tv);
142             tv_rect2(tv, ul, lr);
143             tv_reset_draw(tv);
144             tv_flush(tv);
145         }
146     }
147 
148     tv = right_tv();
149     er_free(stored_right_corners());
150     right_corners_store(right_corners_get());
151     right_corners_null();
152     right_corners_set(corner(right_im, sigma, precision, thres));
153     if ((er = right_corners_get()) != NULL)
154     {
155         if ((roi = er->region) != NULL)
156         {
157             lr.el[0] = roi->lx;
158             lr.el[1] = roi->ly;
159             ul.el[0] = roi->ux;
160             ul.el[1] = roi->uy;
161             tv_edges_conn(tv, right_corners_get());
162             tv_set_overlay(tv);
163             tv_rect2(tv, ul, lr);
164             tv_reset_draw(tv);
165             tv_flush(tv);
166         }
167     }
168 
169     disp = 0;
170 }
171 
172 
173 static void     corner_proc()
174 {
175     Tv             *tvl, *tvr;
176     Imrect         *left_im, *right_im;
177     Imregion       *leftroi, *rightroi;
178 
179     if (stereo_images)
180     {
181         tvl = left_tv();
182         left_im = left_image();
183         if (tvl != NULL)        /* get roi from tv */
184         {
185             leftroi = tv_get_im_roi(tvl);
186             left_im = im_subim(left_im, leftroi);
187             rfree(leftroi);
188         }
189         else
190             if (left_im) left_im = im_copy(left_im);
191 
192         tvr = right_tv();
193         right_im = right_image();
194         if (tvr != NULL)        /* get roi from tv */
195         {
196             rightroi = tv_get_im_roi(tvr);
197             right_im = im_subim(right_im, rightroi);
198             rfree(rightroi);
199         }
200         else
201             if (right_im) right_im = im_copy(right_im);
202 
203         stereo_corner_proc(left_im, right_im);
204         if (left_im != NULL)
205             im_free(left_im);
206         if (right_im != NULL)
207             im_free(right_im);
208     }
209     else
210     {
211         mono_corner_proc();
212     }
213 }
214 
215 void            rectify_corners_proc()
216 {
217     Imrect         *left_er, *right_er;
218     Camera         *lcam, *rcam;
219     Parcam         *pcam, *pcam_get();
220     Vec2            cleft, cright;
221     Imregion       *lregion, *rregion;
222     float           lcx, lcy, rcx, rcy;
223 
224     if (!stereo_images)
225     {
226         error("edge tool: not in stereo mode", non_fatal);
227         return;
228     }
229 
230     left_er = left_corners_get();
231     right_er = right_corners_get();
232     lcam = left_camera();
233     rcam = right_camera();
234 
235     if (left_er == NULL || right_er == NULL)
236     {
237         error("no corners", non_fatal);
238         return;
239     }
240 
241     lregion = left_er->region;
242     rregion = right_er->region;
243     lcx = (lregion->lx + lregion->ux) / 2.0;
244     rcx = (rregion->lx + rregion->ux) / 2.0;
245     lcy = (lregion->ly + lregion->uy) / 2.0;
246     rcy = (rregion->ly + rregion->uy) / 2.0;
247     cleft = vec2(lcx, lcy);
248     cright = vec2(rcx, rcy);
249 
250     pcam = pcam_get();
251     if (pcam == NULL)
252     {
253         disp = vec2_x(cright) - vec2_x(cleft);
254         error("no camera data", non_fatal);
255     }
256     else
257     {
258         er_apply_to_all_edges(left_er, edge_save_pos_prop, (void*) IMPOS);
259         er_apply_to_all_edges(right_er, edge_save_pos_prop, (void *)IMPOS);
260         er_correct(left_er, lcam);
261         er_correct(right_er, rcam);
262         er_add_rectpos_prop(left_er, pcam->rect1);
263         er_add_rectpos_prop(right_er, pcam->rect2);
264         er_apply_to_all_edges(left_er, edge_get_pos_prop, (void*) IMPOS);
265         er_apply_to_all_edges(right_er, edge_get_pos_prop, (void*)IMPOS);
266         cleft = cam_correct(cleft,lcam);
267         cright = cam_correct(cright,rcam);
268         cleft = rectify_pos(pcam->rect1, cleft);
269         cright = rectify_pos(pcam->rect2, cright);
270         disp = vec2_x(cright) - vec2_x(cleft);
271         er_set_findex(left_er, ER_FINDEX, rectpos);
272         er_set_findex(right_er, ER_FINDEX, rectpos);
273     }
274 }
275 
276 static void   display_stereo_match(Edgel *ledge, int type, void *data, int i, int j)
277 {
278     Edgel          *redge;
279     List           *left_matches;
280     List           *right_matches;
281     Match          *best_left_match;
282     Match          *best_right_match;
283     void            pick_match_draw();
284     void            print_cnrmatch();
285     Tv             *tvl = left_tv(), *tvr = right_tv();
286 
287     if ((left_matches = (List *) prop_get(ledge->props, MLIST)) == NULL)
288         return;
289     if ((best_left_match = (Match *) left_matches->to) == NULL)
290         return;
291 
292     if ((redge = (Edgel *) best_left_match->to2) == NULL)
293         return;
294 
295     if ((right_matches = (List *) prop_get(redge->props, MLIST)) == NULL)
296         return;
297     if ((best_right_match = (Match *) right_matches->to) == NULL)
298         return;
299 
300     if (left_matches->type == FIXED_MATCH)
301     {
302          fixed_matches++;
303          tv_save_draw(tvl);
304          tv_save_draw(tvr);
305          tv_set_color(tvl, green);
306          tv_set_color(tvr, green);
307          tv_cross2(tvl, ((Edgel *) (best_left_match->to1))->pos, 7);
308          tv_cross2(tvr, ((Edgel *) (best_left_match->to2))->pos, 7);
309          tv_reset_draw(tvl);
310          tv_reset_draw(tvr);
311          if (data!=NULL) print_cnrmatch(best_left_match);
312     }
313     if (left_matches->type == GOOD_MATCH)
314     {
315          good_matches++;
316     }
317 }
318 
319 void stereo_corner_disp_proc()
320 {
321     void            display_stereo_match();
322     void            print_cnrmatch();
323 
324     er_apply_to_all_edges(left_corners_get(),display_stereo_match,(void *)print_cnrmatch);
325 }
326 
327 void stereo_corner_match_proc()
328 {
329     void corner_rem_proj_3d();
330     void corner_par_proj_3d();
331     void *data = NULL;
332 
333     if (!stereo_images)
334     {
335         error("edge tool: not in stereo mode", non_fatal);
336         return;
337     }
338 
339     stereo_corner_match( left_image(), right_image(), 
340                         left_corners_get(), right_corners_get(),
341                         disp, lowd, upd, width, correlate, uniqueness, asymetry);
342     fixed_matches = 0.0;
343     good_matches = 0.0;
344     er_apply_to_all_edges(left_corners_get(), display_stereo_match, data);
345     format("fixed matches found %d good matches found %d \n",fixed_matches,good_matches);
346 }
347 
348 /*
349 void sem_corner_match_proc()
350 {
351     Imrect         *left_er, *right_er;
352     void            semcnr_match();
353     Vec2            cleft, cright;
354     Imregion       *lregion, *rregion;
355     float           lcx, lcy, rcx, rcy;
356 
357 
358     left_er = left_corners_get();
359     right_er = right_corners_get();
360     lregion = left_er->region;
361     rregion = right_er->region;
362     lcx = (lregion->lx + lregion->ux) / 2.0;
363     rcx = (rregion->lx + rregion->ux) / 2.0;
364     lcy = (lregion->ly + lregion->uy) / 2.0;
365     rcy = (rregion->ly + rregion->uy) / 2.0;
366     cleft = vec2(lcx, lcy);
367     cright = vec2(rcx, rcy);
368 
369     semcnr_match(left_er,right_er,cleft,cright);
370 }
371 */
372 
373 void temporal_corner_match_proc()
374 {
375     Imrect         *mono_im,*old_mono_im,*stored_mono_im();
376     Imrect         *mono_er;
377     Imrect         *old_mono_er, *stored_mono_corners(); 
378 
379     mono_er = mono_corners_get();
380     old_mono_er = stored_mono_corners();
381     if (mono_er == NULL || old_mono_er == NULL) return;
382     temporal_corner_match(mono_er, old_mono_er, 0.0, 0.0,
383                           theight, twidth, tcorrelate,
384                           tuniqueness, tasymetry);
385 
386 }
387 
388 void stereo_temporal_corner_match_proc()
389 {
390     Imrect         *left_er, *left_corners_get();
391     Imrect         *old_left_er, *stored_left_corners();
392     Imrect         *right_er, *right_corners();
393     Imrect         *old_right_er, *stored_right_corners();
394     Imregion       *region, *old_region;
395     double          cx, cy, old_cx, old_cy, xdispl, ydispl, xdispr, ydispr;
396 
397     if (!stereo_images)
398     {
399         error("corner tool: matching temporal mono images", non_fatal);
400         temporal_corner_match_proc();
401         return;
402     }
403     left_er = left_corners_get();
404     old_left_er = stored_left_corners();
405     if (left_er == NULL || old_left_er == NULL)
406         return;
407     region = left_er->region;
408     old_region = old_left_er->region;
409     cx = (region->lx + region->ux) / 2.0;
410     old_cx = (old_region->lx + old_region->ux) / 2.0;
411     cy = (region->ly + region->uy) / 2.0;
412     old_cy = (old_region->ly + old_region->uy) / 2.0;
413     xdispl = cx - old_cx;
414     ydispl = cy - old_cy;
415 
416     right_er = right_corners_get();
417     old_right_er = stored_right_corners();
418     if (right_er == NULL || old_right_er == NULL)
419         return;
420     region = right_er->region;
421     old_region = old_right_er->region;
422     cx = (region->lx + region->ux) / 2.0;
423     old_cx = (old_region->lx + old_region->ux) / 2.0;
424     cy = (region->ly + region->uy) / 2.0;
425     old_cy = (old_region->ly + old_region->uy) / 2.0;
426     xdispr = cx - old_cx;
427     ydispr = cy - old_cy;
428     stereo_temporal_corner_match(xdispl,ydispl,xdispr,ydispr);
429 
430 }
431 
432 stereo_temporal_corner_match(double xdispl,double ydispl,double xdispr,
433                                                         double ydispr)
434 {
435     Imrect         *left_er, *left_corners_get();
436     Imrect         *old_left_er, *stored_left_corners();
437     Imrect         *right_er, *right_corners();
438     Imrect         *old_right_er, *stored_right_corners();
439 
440     if (!stereo_images)
441     {
442         error("edge tool: not in stereo mode", non_fatal);
443         return;
444     }
445     left_er = left_corners_get();
446     old_left_er = stored_left_corners();
447     if (left_er == old_left_er)
448         return;
449 
450     temporal_corner_match(left_er, old_left_er, xdispl, ydispl, theight, twidth, tcorrelate, tuniqueness, tasymetry);
451 
452     right_er = right_corners_get();
453     old_right_er = stored_right_corners();
454     if (right_er == old_right_er)
455         return;
456 
457     temporal_corner_match(right_er, old_right_er, xdispr, ydispr, theight, twidth, tcorrelate, tuniqueness, tasymetry);
458     set_st_corner_matches(left_er);
459  
460 }
461 
462 static void geom_init()
463 {
464     threed_geom_set(NULL);
465 }
466 
467 
468 static void     geom_proc()
469 {
470     Parcam         *pcam = pcam_get();
471     Transform3     trans;
472     List           *threed_list_get();
473     List           *cor_geom = NULL;
474     Tv             *tv = threed_tv();
475     void            corner_rem_proj_3d();
476     void            corner_par_proj_3d();
477     void            geom_list_point3();
478 
479 /*  remove any previous 3D data (must be done here if we are to be able
480     to recompute geometry without re-matching) NAT 16/5/96  */
481     er_apply_to_all_edges(left_corners_get(), corner_rem_proj_3d, NULL);
482     er_apply_to_all_edges(left_corners_get(), corner_par_proj_3d, NULL);
483     er_apply_to_all_edges(left_corners_get(), geom_list_point3, &cor_geom);
484 /*  transform to base coordinates for head combination
485     trans = trans3_inverse(*(pcam->rcam1->transf));
486     reclist_list_apply(cor_geom, geom_transform, NULL, &trans);
487 */
488     cor_geom = list_append(cor_geom,threed_list_get());
489     threed_geom_null();
490     threed_geom_set(cor_geom);
491 }
492 
493 void            corner_par_proj_3d(Edgel *corner, int type, void *data,
494                                                                 int i, int j)
495 /* add 3d coordinates in rectified frame to corner proplist */
496 {
497     Match          *cor_match;
498     Edgel          *left_cor, *right_cor;
499     Vec2           *left_rect, *right_rect;
500     Vec3            disp, *pos;
501     int             matchlist = MLIST;
502 
503     if (corner == NULL)
504         return;
505     if (cor_match = (Match *) get_fixed_match(corner, &matchlist))
506     {
507         left_cor = cor_match->to1;
508         right_cor = cor_match->to2;
509         left_rect = (Vec2 *) prop_get(left_cor->props, RECTPOS);
510         right_rect = (Vec2 *) prop_get(right_cor->props, RECTPOS);
511         if (left_rect && right_rect)
512         {
513             disp.el[0] = left_rect->el[0];
514             disp.el[1] = (left_rect->el[1] + right_rect->el[1]) / 2.0;
515             disp.el[2] = right_rect->el[0] - left_rect->el[0];
516             pos = vec3_alloc();
517             *pos = vec3_par_proj_3d(disp);
518             corner->props = proplist_addifnp(corner->props, (void *) pos, POINT3, vec3_free, true);
519         }
520     }
521 }
522 
523 void            corner_rem_proj_3d(Edgel *corner, int type, void *data,
524                                                                 int i, int j)
525 /* remove 3d coordinates from corner proplist */
526 {
527     if (corner == NULL)
528         return;
529     corner->props = proplist_free(corner->props, POINT3);
530 }
531 
532 
533 void            geom_list_point3(Edgel *corner, int type,
534                                                                 List ** geomlist,
535                                                                 int i,
536                                                                 int j)
537 {
538     Vec3           *pos;
539     Point3         *point;
540     double          point3_get_z();
541     int             k;
542 
543     if (corner && (pos = prop_get(corner->props, POINT3)))
544     {
545         point = point3_alloc(POINT3);
546         point->p = *pos;
547         *geomlist = list_add_sorted(*geomlist, link_alloc(point, POINT3), point3_get_z);
548     }
549 }
550 
551 double          point3_get_z(Point3 *point)
552 {
553     if (point)
554         return (point->p.el[2]);
555     else
556         return (MAXDOUBLE);
557 }
558 
559 static void     clear_proc()
560 {
561     if (mono_image())
562     {
563         mono_image_set(NULL);
564     }
565 
566     if (left_image())
567     {
568         left_image_set(NULL);
569     }
570 
571     if (right_image())
572     {
573         right_image_set(NULL);
574     }
575 
576     if (mono_corners_get())
577     {
578         mono_corners_set(NULL);
579     }
580 
581     if (left_corners_get())
582     {
583         left_corners_set(NULL);
584     }
585 
586     if (right_corners_get())
587     {
588         right_corners_set(NULL);
589     }
590 
591     if (stored_mono_corners())
592     {
593         er_free(stored_mono_corners());
594         mono_corners_store(NULL);
595     }
596 
597     if (stored_left_corners())
598     {
599         er_free(stored_left_corners());
600         left_corners_store(NULL);
601     }
602 
603     if (stored_right_corners())
604     {
605         er_free(stored_right_corners());
606         right_corners_store(NULL);
607     }
608 }
609 
610 /**** Image choice callback ****/
611 
612 static void     image_choice_proc(value)
613 int             value;
614 {
615     switch (value)
616     {
617       case 0:
618         stereo_images = 1;
619         break;
620       case 1:
621         stereo_images = 0;
622         break;
623     }
624 }
625 
626 /** Pick function callbacks **/
627 
628 static void     mono_pick_proc(Tv_pick(*func) ())
629 {
630     tv_set_pick(mono_tv(), (*func) ());
631 tv_set_activity(mono_tv(), PICK);
632 }
633 
634 static void     left_pick_proc(Tv_pick(*func) ())
635 {
636     tv_set_pick(left_tv(), (*func) ());
637 tv_set_activity(left_tv(), PICK);
638 }
639 
640 static void     right_pick_proc(Tv_pick(*func) ())
641 {
642     tv_set_pick(right_tv(), (*func) ());
643 tv_set_activity(right_tv(), PICK);
644 }
645 
646 static void     threed_pick_proc(Tv_pick(*func) ())
647 {
648     tv_set_pick(threed_tv(), (*func) ());
649 tv_set_activity(threed_tv(), PICK);
650 }
651 
652 /** Mouse function callbacks **/
653 
654 static void     mono_mouse_proc(Tv_mouse(*func) ())
655 {
656     tv_set_mouse(mono_tv(), (*func) ());
657 tv_set_activity(mono_tv(), MOUSE);
658 }
659 
660 static void     left_mouse_proc(Tv_mouse(*func) ())
661 {
662     tv_set_mouse(left_tv(), (*func) ());
663         tv_set_activity(left_tv(), MOUSE);
664 }
665 
666 static void     right_mouse_proc(Tv_mouse(*func) ())
667 {
668     tv_set_mouse(right_tv(), (*func) ());
669         tv_set_activity(right_tv(), MOUSE);
670 }
671 
672 static void     threed_mouse_proc(Tv_mouse(*func) ())
673 {
674     tv_set_mouse(threed_tv(), (*func) ());
675         tv_set_activity(threed_tv(), MOUSE);
676 }
677 
678 /*** Paramter dialog callbacks ***/
679 
680 static void     corner_param_dialog()
681 {
682     static int      dialog = 0;
683 
684     if (dialog)
685     {
686         tw_show_dialog(dialog);
687         return;
688     }
689 
690     dialog = tw_dialog("Corner Parameters");
691 
692     tw_fglobal("Sigma        :", &sigma, 20);
693     tw_newrow();
694     tw_fglobal("Precision    :", &precision, 20);
695     tw_newrow();
696     tw_fglobal("Threshold    :", &thres, 20);
697         tw_newrow();
698         tw_fglobal("Patch sigma  :", &patch_sigma, 20);
699                 
700     tw_end_dialog();
701 }
702 
703 static void     stereo_param_dialog()
704 {
705     static int      dialog = 0;
706 
707     if (dialog)
708     {
709         tw_show_dialog(dialog);
710         return;
711     }
712 
713     dialog = tw_dialog("Stereo Parameters");
714 
715     tw_fglobal("Low disp   :", &lowd, 20);
716     tw_newrow();
717     tw_fglobal("Upper disp :", &upd, 20);
718     tw_newrow();
719     tw_fglobal("Band width :", &width, 20);
720     tw_newrow();
721     tw_fglobal("Corr thres :", &correlate, 20);
722     tw_newrow();
723     tw_fglobal("Uniqueness :", &uniqueness, 20);
724     tw_newrow();
725     tw_fglobal("Asymetry :", &asymetry, 20);
726 
727     tw_end_dialog();
728 }
729 
730 static void     temp_param_dialog()
731 {
732     static int      dialog = 0;
733 
734     if (dialog)
735     {
736         tw_show_dialog(dialog);
737         return;
738     }
739 
740     dialog = tw_dialog("Temporal Parameters");
741 
742     tw_fglobal("Height     :", &theight, 20);
743     tw_newrow();
744     tw_fglobal("Width      :", &twidth, 20);
745     tw_newrow();
746     tw_fglobal("Correlate  :", &tcorrelate, 20);
747     tw_newrow();
748     tw_fglobal("Uniqueness :", &tuniqueness, 20);
749     tw_newrow();
750     tw_fglobal("Asymetry :", &tasymetry, 20);
751 
752     tw_end_dialog();
753 }
754 
755 /********** Tool creation **********/
756 
757 void            corner_tool(int x, int y)
758 {
759     static int      tool = 0;
760 
761     if (tool)
762     {
763         tw_show_tool(tool);
764         return;
765     }
766 
767     tool = tw_tool("Corner Tool", x, y);
768 
769     tw_menubar("Pick: ",
770         "mono",
771         "null", mono_pick_proc, null_pick,
772         "corner", mono_pick_proc, mono_print,
773         "c match", mono_pick_proc, mono_corner_matches,
774         NULL,
775         "left",
776         "null", left_pick_proc, null_pick,
777         "corner", left_pick_proc, left_print_cor,
778         "c match", left_pick_proc, left_corner_matches,
779         NULL,
780         "right",
781         "null", right_pick_proc, null_pick,
782         "corner", right_pick_proc, right_print_cor,
783         "c match", right_pick_proc, right_corner_matches,
784         NULL,
785         "threed",
786         "null", threed_pick_proc, null_pick,
787         "print", threed_pick_proc, threed_print,
788         "choose", threed_pick_proc, threed_choose,
789         "delete", threed_pick_proc, threed_delete,
790         NULL,
791         NULL);
792 
793     tw_newrow();
794     tw_menubar("Mouse:",
795         "mono",
796         "null", mono_mouse_proc, null_mouse,
797         NULL,
798         "left",
799         "null", left_mouse_proc, null_mouse,
800         "epi", left_mouse_proc, left_epi_mouse,
801         "rast", left_mouse_proc, left_raster_mouse,
802         NULL,
803         "right",
804         "null", right_mouse_proc, null_mouse,
805         "epi", right_mouse_proc, right_epi_mouse,
806         "rast", right_mouse_proc, right_raster_mouse,
807         NULL,
808         "threed",
809         "null", threed_mouse_proc, null_mouse,
810         NULL,
811         NULL);
812 
813     tw_newrow();
814     tw_choice("Image Select:",
815         image_choice_proc, 0, "stereo images", "mono image", NULL);
816 
817     tw_button("clear", clear_proc, NULL);
818     tw_newrow();
819     tw_button("corner", corner_proc, NULL);
820     tw_button("rectify", rectify_corners_proc, NULL);
821     tw_button("stereo", stereo_corner_match_proc, NULL);
822     tw_button("temporal", stereo_temporal_corner_match_proc, NULL);
823     tw_button("init geom3", geom_init, NULL);
824     tw_button("geom3", geom_proc, NULL);
825 
826     tw_newrow();
827     tw_button("Corner Params", corner_param_dialog, NULL);
828     tw_button("Stereo Params", stereo_param_dialog, NULL);
829     tw_button("Temporal Params", temp_param_dialog, NULL);
830 
831     tw_newrow();
832     tw_button("show stored cnrs", mono_show_stored_corners, NULL);
833     tw_button("show stereo cnrs", stereo_corner_disp_proc, NULL);
834     tw_button("flip mono", flip_mono_im, NULL);
835     tw_help_button("corner_tool");
836     tw_end_tool();
837 }
838 

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