home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
vis-ftp.cs.umass.edu
/
vis-ftp.cs.umass.edu.tar
/
vis-ftp.cs.umass.edu
/
pub
/
Software
/
ASCENDER
/
ascender.tar.Z
/
ascender.tar
/
Epipolar
/
epidefs.lisp
< prev
next >
Wrap
Lisp/Scheme
|
1996-02-20
|
4KB
|
133 lines
;;; EPIDEFS.LISP
;;;
;;; Global variable and function definitions for the epipolar matcher
;;;
;;; Author: Robert T. Collins
;;; Date: Mar 1, 1995
;;; based on my earlier epipolar.lisp, written Dec 28, 1993
;;;
;-----------------------------------------------------------------
; (c) Copyright 1995 by The University of Massachusetts
;------------------------------------------------------------------
(in-package 'epipolar :nicknames '(epi))
(defvar *RCDE* nil "tells whether we are running under RCDE")
(defvar *demo-mode* nil "tells whether to display things while processing")
(defvar *debug-mode* nil "tells whether to print informational messages")
(defvar *pause-mode* nil "either :views, :lines, or nil")
(defvar *topdown-line-finder* t ;;BobC 2/20/96 - default is topdown
"whether to use the topdown line finder rather than the ISR")
(defvar *num-z-buckets* 24 "default number of histogram buckets")
(defvar *current-histogram* nil "height histogram for this image")
(defvar *accum-histogram* nil "accumulated height histogram")
;;; The following values must be set for each site.
(defvar *lowz* nil)
(defvar *highz* nil)
(defvar *midz* nil)
(defun set-global-height-range (lowz highz)
"Set the global height range used by the epipolar matching system"
(setf *lowz* lowz)
(setf *highz* highz)
(setf *midz* (+ *lowz* (/ (- *highz* *lowz*) 2.0)))
(list *lowz* *highz*))
;;;----------------------------------------------------------------
;;; Display windows (only used when *demo-mode* is t)
(defvar *epipolar-display-frame* nil "Frame containing epipolar matching demo")
(defvar *reference-pane* nil "reference view")
(defvar *other-pane* nil "other view")
(defvar *current-hist-pane* nil "shows current height histogram")
(defvar *accum-hist-pane* nil "shows accumulated height histogram")
;;;----------------------------------------------------------------
;;; Color and thickness settings when displaying (*demo-mode* is t)
;;color/thickness of histogram plot
(defvar *histogram-color* "GREEN")
(defvar *histogram-thickness* 3)
;;color/thickness of epipolar region boundaries
(defvar *epipolar-color* "CYAN")
(defvar *epipolar-thickness* 3)
;;color/thickness of data lines
(defvar *line-color* "GREEN")
(defvar *line-thickness* 1)
;;color/thickness of potential matches
(defvar *match-color* "YELLOW")
(defvar *match-thickness* 3)
;;;----------------------------------------------------------------
;;; Projection structures (for non-RCDE use)
(defstruct projection
(projmat nil) ;;3x4 projection matrix
(inverse-projmat nil) ;;3x4 inverse projection matrix
)
;;;----------------------------------------------------------------
;;; View structure
(defstruct view
(label nil) ;;identifying label
(image nil) ;;full resolution image
(projection nil) ;;camera projection
(projfile nil) ;;projection read filename (for rcde)
(line-tokenset nil) ;;isr2 line tokenset
(line-grid nil) ;;isr2 grid (for fast spatial access)
(topdown-linelist nil) ;;when using topdown line finder
(topdown-edgels nil) ;;when using topdown line finder
(window nil) ;;where/how to display
)
;;;----------------------------------------------------------------
;;; Manipulating homogeneous coordinate vectors for point and lines
(defsubst pt-to-nvec (x y)
(la:normalize x y 1.0))
(defsubst nvec-to-pt (nvec)
(list (/ (first nvec) (third nvec)) (/ (second nvec) (third nvec))))
(defsubst nvec-to-pt-values (nvec)
(values (/ (first nvec) (third nvec)) (/ (second nvec) (third nvec))))
(defsubst nvec-to-line (nvec)
(la:normalize2 nvec))
(defsubst endpoints-to-line (pt1 pt2)
(nvec-to-line (la:cross-product (list (car pt1) (cadr pt1) 1.0)
(list (car pt2) (cadr pt2) 1.0))))
(defsubst pt-vec-to-line (pt vec)
(nvec-to-line (la:cross-product (list (car pt) (cadr pt) 1.0) vec)))
(defsubst line-intersection-pt (nvec1 nvec2)
(nvec-to-pt (la:cross-product nvec1 nvec2)))
;;;----------------------------------------------------------------
;;; miscellaneous development tools
(defvar *%%lastfilename* nil)
(defun cl (&optional (filename *%%lastfilename*))
(let ((path (merge-pathnames user::*epipolar-directory* filename)))
(setf *%%lastfilename* filename)
(load (compile-file path))))