next up previous contents
Next: Rectification Functions Up: Camera Geometry Previous: Parallel Stereo Camera Geometry   Contents

Camera Functions

Camera *cam_alloc(int type);

Camera *cam_make(unsigned int type, Transform3 * transf, double f,
                 double pix, double ax, double ay,
                 double cx, double cy, int width, int height);

Camera *cam_copy(Camera * cam);

void *(*distort_param_copy_func)(double *a);

void    cam_free(Camera * cam);
Camera allocation, make, copy and free functions.

Bool    cam_scale_to_image(Camera * cam, Imrect * im);
Scale current camera to match image, and return true on success. The image height and width must be in the same integer ratio with respect to the existing camera width and height.

Parcam *parcam_alloc(unsigned int type);

Parcam *parcam_make(Camera * cam1, Camera * cam2, unsigned int type);

Parcam *parcam_scaled_make(Camera * cam1, Camera * cam2, double scale,
                           unsigned int type);
void    pcam_free(Parcam * pcam);
Parallel camera allocation and make functions. parcam_make constructs a standard form of parallel camera from the arbitary (but sensible) camera geometries defined by cam1 and cam2. The rectification functions are set to map between standard image coordinates of the non parallel cameras and camera based image coordinates for the parallel cameras. The image plane of the later and the focal length ield of the parcam struvture are set to the focal lenght of cam1 as this simplifies the transformation of edge data prior to stereo matching.

Vec2    cam_proj(Camera * cam, Vec3 v);
 
void    cam_ray(Camera * cam, Vec2 u, Vec3 * p, Vec3 * v);

Use cam to relate image and world coorinate frames. cam_proj projects the point v in world coordinates into the standard image coordinates associated with cam. cam_ray computes in world coordinates a ray (specified by a point p and unit direction vector v) that passes through the standard image location u. The point p is actually the location of the optic centre and hence identical for all image points associated with the same camera.


next up previous contents
Next: Rectification Functions Up: Camera Geometry Previous: Parallel Stereo Camera Geometry   Contents
root 2017-11-22