Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

brct_plane_sweeper Class Reference

#include <brct_plane_sweeper.h>

Inheritance diagram for brct_plane_sweeper:

Inheritance graph
[legend]
List of all members.

Detailed Description

Definition at line 42 of file brct_plane_sweeper.h.

Public Member Functions

 brct_plane_sweeper (brct_plane_sweeper_params const &sp)
 ~brct_plane_sweeper ()
vil1_memory_image_of< unsigned
char > 
z_corr_image (const int i)
 Accessors.
vcl_vector< vsol_point_2d_sptrharris_corners (const int cam)
bool set_image (const int cam, vil1_image const &image)
 Mutators.
bool read_homographies (vcl_string const &homography_file)
 Read the homographies for two parallel planes to each camera plane.
bool compute_harris ()
 compute harris corners for each image.
vil1_memory_image_of< unsigned
char > 
project_image_to_plane (const int plane, const int cam)
 Project the camera image to the world plane.
bool map_image_to_image (const int from_cam, const double z, vil1_memory_image_of< unsigned char > &mapped_to_image, vil1_memory_image_of< unsigned char > &orig_to_image)
 Map the camera image (cam) to the other image plane.
bool overlapping_projections (const int plane, vcl_vector< vil1_memory_image_of< float > > &imgs)
 Construct images corresponding to the overlap in the two cam projections.
bool overlapping_projections (const double z, vcl_vector< vil1_memory_image_of< float > > &imgs)
 Construct images corresponding to the overlap in the two cam projections.
bool overlapping_projections (const double z, vcl_vector< vil1_memory_image_of< float > > &imgs, vcl_vector< vcl_vector< vsol_point_2d_sptr > > &corners)
 Construct images and corners corresponding to the overlap.
vil1_memory_image_of< unsigned
char > 
cross_correlate_projections (const int plane)
 Compute the cross correlation between overlapping projections for plane.
vil1_memory_image_of< unsigned
char > 
cross_correlate_projections (const double z)
 Compute the cross correlation between overlapping projections for z pos.
bool cross_correlate_proj_corners (const double z, vil1_image &back, vcl_vector< vsol_point_2d_sptr > &matched_cnrs, vcl_vector< vsol_point_2d_sptr > &back_prj_cnrs, vcl_vector< vsol_point_2d_sptr > &orig_cnrs0)
 Compute the cross correlation at corresponding Harris corners.
bool depth_image (vil1_memory_image_of< unsigned char > &depth_out, vil1_memory_image_of< unsigned char > &coor_out)
 Compute a depth image based on max cross-correlation.
bool harris_depth_match (vcl_vector< vsol_point_3d_sptr > &points_3d, vcl_vector< vsol_point_2d_sptr > &proj_points)
 Compute Harris point matches by plane sweeping.
void corr_vals (const int col, const int row, vcl_vector< float > &z, vcl_vector< float > &corr)
 Correlation values by depth.
vsol_point_2d_sptr map_point (vsol_point_2d_sptr const &p, const int cam, const double z)
 Correlation values by depth.
bool map_harris_corners (const int from_cam, const double z, vcl_vector< vsol_point_2d_sptr > &mapped_to_points, vcl_vector< vsol_point_2d_sptr > &orig_to_points)
 Map harris corners from one image to the other via plane at z.
void init_harris_match (const int from_cam)
 init harris matcher.
bool match_harris_corners (const int from_cam, const double z, vcl_vector< vsol_point_2d_sptr > &matched_points, vcl_vector< vsol_point_2d_sptr > &orig_to_points)
 Map and match harris corners from one image to the other via plane at z.
bool harris_sweep (const int from_cam)
vcl_vector< vsol_point_2d_sptrmatched_points_at_z_index (int z_index)
vcl_vector< vsol_point_3d_sptrproj_points_3d ()
 get the matched corners as 3-d points with x-y in the matched image.
vcl_vector< vsol_point_3d_sptrworld_points_3d ()
 get the matched corners as 3-d points with world x-y coordinates.
bool save_world_points (vcl_string const &out_file)
bool SanityCheck ()
 Checks that parameters are within acceptable bounds.

Public Attributes

float zmin_
float zmax_
int nz_
float point_radius_
int corr_radius_
float corr_min_
float corr_max_
float corr_thresh_
float corr_sigma_
float intensity_thresh_
sdet_harris_detector_params hdp_

Protected Member Functions

bool overlapping_box (vcl_vector< vgl_h_matrix_2d< double > > const &homgs, vsol_box_2d_sptr &box)
bool overlapping_projections (vcl_vector< vgl_h_matrix_2d< double > > const &homgs, vcl_vector< vil1_memory_image_of< float > > &imgs, double &tx, double &ty)
 tx and ty shift the projections to the (0,0) image origin.
bool overlapping_projections (vcl_vector< vgl_h_matrix_2d< double > > const &homgs, vcl_vector< vil1_memory_image_of< float > > &imgs, vcl_vector< vcl_vector< vsol_point_2d_sptr > > &corners, double &tx, double &ty)
 compute overlapping projections of images and Harris corners.
void homographies_at_z (double z, vcl_vector< vgl_h_matrix_2d< double > > &homgs)
 compute homographies for each camera that project to the specified z plane.
vsol_box_2d_sptr depth_image_box (const double zmin, const double zmax)
vcl_vector< vsol_point_2d_sptrproject_corners (vgl_h_matrix_2d< double > const &H, vcl_vector< vsol_point_2d_sptr > const &corners)
bool correlate_corners (vcl_vector< vil1_memory_image_of< float > > const &imgs, vcl_vector< vcl_vector< vsol_point_2d_sptr > > const &cnrs, vcl_vector< vsol_point_2d_sptr > &matched_corners)
 match harris corners from image 1 to image 0 and return matches.
vil1_memory_image_of< vil1_rgb<
unsigned char > > 
overlay_matches (vcl_vector< vsol_point_2d_sptr >, vil1_memory_image_of< float > const &back)
vsol_point_2d_sptr map_point (vsol_point_2d_sptr const &p, vgl_h_matrix_2d< double > const &Hcomp)
bool map_points (const int from_cam, const double z, vcl_vector< vsol_point_2d_sptr > const &from_points, vcl_vector< vsol_point_2d_sptr > &to_points)
bool intersecting_bounding_box (vgl_h_matrix_2d< double > const &Hcomp, vsol_box_2d_sptr const &from_box, vsol_box_2d_sptr const &to_box, vsol_box_2d_sptr &box)
bool map_image (const int from_cam, const double z, vil1_memory_image_of< float > &mapped_image)
 Map an image from one camera to the other, assuming all the pixels lie on the plane at z.
void InitParams (float zmin, float zmax, int nz, float point_radius, int corr_radius, float corr_min, float corr_max, float corr_thresh, float corr_sigma, float intensity_thresh, const sdet_harris_detector_params &hdp)

Protected Attributes

bool harris_valid_
bool homographies_valid_
int n_planes_
int n_cams_
float del_
int to_cam_
vcl_vector< double > z_
vcl_vector< vcl_vector< vgl_h_matrix_2d<
double > > > 
homographies_
vcl_vector< vil1_imageimages_
vcl_vector< vil1_memory_image_of<
float > > 
smooth_images_
vcl_vector< vil1_memory_image_of<
float > > 
z_corr_images_
vcl_vector< vcl_vector< vsol_point_2d_sptr > > harris_corners_
vcl_vector< vcl_vector< vsol_point_2d_sptr > > matched_corners_
bsol_point_index_2d pindx_

Friends

vcl_ostream & operator<< (vcl_ostream &, const brct_plane_sweeper_params &sp)


Constructor & Destructor Documentation

brct_plane_sweeper::brct_plane_sweeper brct_plane_sweeper_params const &  sp  ) 
 

Definition at line 19 of file brct_plane_sweeper.cxx.

brct_plane_sweeper::~brct_plane_sweeper  ) 
 

Definition at line 25 of file brct_plane_sweeper.cxx.


Member Function Documentation

bool brct_plane_sweeper::compute_harris  ) 
 

compute harris corners for each image.

Definition at line 654 of file brct_plane_sweeper.cxx.

void brct_plane_sweeper::corr_vals const int  col,
const int  row,
vcl_vector< float > &  z,
vcl_vector< float > &  corr
 

Correlation values by depth.

Definition at line 776 of file brct_plane_sweeper.cxx.

bool brct_plane_sweeper::correlate_corners vcl_vector< vil1_memory_image_of< float > > const &  imgs,
vcl_vector< vcl_vector< vsol_point_2d_sptr > > const &  cnrs,
vcl_vector< vsol_point_2d_sptr > &  matched_corners
[protected]
 

match harris corners from image 1 to image 0 and return matches.

Definition at line 695 of file brct_plane_sweeper.cxx.

bool brct_plane_sweeper::cross_correlate_proj_corners const double  z,
vil1_image back,
vcl_vector< vsol_point_2d_sptr > &  matched_cnrs,
vcl_vector< vsol_point_2d_sptr > &  back_prj_cnrs,
vcl_vector< vsol_point_2d_sptr > &  orig_cnrs0
 

Compute the cross correlation at corresponding Harris corners.

Definition at line 423 of file brct_plane_sweeper.cxx.

vil1_memory_image_of< unsigned char > brct_plane_sweeper::cross_correlate_projections const double  z  ) 
 

Compute the cross correlation between overlapping projections for z pos.

Definition at line 399 of file brct_plane_sweeper.cxx.

vil1_memory_image_of< unsigned char > brct_plane_sweeper::cross_correlate_projections const int  plane  ) 
 

Compute the cross correlation between overlapping projections for plane.

Definition at line 376 of file brct_plane_sweeper.cxx.

bool brct_plane_sweeper::depth_image vil1_memory_image_of< unsigned char > &  depth_out,
vil1_memory_image_of< unsigned char > &  coor_out
 

Compute a depth image based on max cross-correlation.

Definition at line 500 of file brct_plane_sweeper.cxx.

vsol_box_2d_sptr brct_plane_sweeper::depth_image_box const double  zmin,
const double  zmax
[protected]
 

Definition at line 469 of file brct_plane_sweeper.cxx.

vcl_vector< vsol_point_2d_sptr > brct_plane_sweeper::harris_corners const int  cam  ) 
 

Definition at line 752 of file brct_plane_sweeper.cxx.

bool brct_plane_sweeper::harris_depth_match vcl_vector< vsol_point_3d_sptr > &  points_3d,
vcl_vector< vsol_point_2d_sptr > &  proj_points
 

Compute Harris point matches by plane sweeping.

Definition at line 581 of file brct_plane_sweeper.cxx.

bool brct_plane_sweeper::harris_sweep const int  from_cam  ) 
 

Definition at line 969 of file brct_plane_sweeper.cxx.

void brct_plane_sweeper::homographies_at_z double  z,
vcl_vector< vgl_h_matrix_2d< double > > &  homgs
[protected]
 

compute homographies for each camera that project to the specified z plane.

For now assume two cameras.

Definition at line 182 of file brct_plane_sweeper.cxx.

void brct_plane_sweeper::init_harris_match const int  from_cam  ) 
 

init harris matcher.

Definition at line 924 of file brct_plane_sweeper.cxx.

void brct_plane_sweeper_params::InitParams float  zmin,
float  zmax,
int  nz,
float  point_radius,
int  corr_radius,
float  corr_min,
float  corr_max,
float  corr_thresh,
float  corr_sigma,
float  intensity_thresh,
const sdet_harris_detector_params hdp
[protected, inherited]
 

Definition at line 50 of file brct_plane_sweeper_params.cxx.

bool brct_plane_sweeper::intersecting_bounding_box vgl_h_matrix_2d< double > const &  Hcomp,
vsol_box_2d_sptr const &  from_box,
vsol_box_2d_sptr const &  to_box,
vsol_box_2d_sptr box
[protected]
 

Definition at line 893 of file brct_plane_sweeper.cxx.

bool brct_plane_sweeper::map_harris_corners const int  from_cam,
const double  z,
vcl_vector< vsol_point_2d_sptr > &  mapped_to_points,
vcl_vector< vsol_point_2d_sptr > &  orig_to_points
 

Map harris corners from one image to the other via plane at z.

Definition at line 908 of file brct_plane_sweeper.cxx.

bool brct_plane_sweeper::map_image const int  from_cam,
const double  z,
vil1_memory_image_of< float > &  mapped_image
[protected]
 

Map an image from one camera to the other, assuming all the pixels lie on the plane at z.

Put the result into the coordinate frame of the target camera (to camera).

Definition at line 848 of file brct_plane_sweeper.cxx.

bool brct_plane_sweeper::map_image_to_image const int  from_cam,
const double  z,
vil1_memory_image_of< unsigned char > &  mapped_to_image,
vil1_memory_image_of< unsigned char > &  orig_to_image
 

Map the camera image (cam) to the other image plane.

Assumes that the world is a plane at z.

Definition at line 878 of file brct_plane_sweeper.cxx.

vsol_point_2d_sptr brct_plane_sweeper::map_point vsol_point_2d_sptr const &  p,
vgl_h_matrix_2d< double > const &  Hcomp
[protected]
 

Definition at line 792 of file brct_plane_sweeper.cxx.

vsol_point_2d_sptr brct_plane_sweeper::map_point vsol_point_2d_sptr const &  p,
const int  cam,
const double  z
 

Correlation values by depth.

Definition at line 802 of file brct_plane_sweeper.cxx.

bool brct_plane_sweeper::map_points const int  from_cam,
const double  z,
vcl_vector< vsol_point_2d_sptr > const &  from_points,
vcl_vector< vsol_point_2d_sptr > &  to_points
[protected]
 

Definition at line 822 of file brct_plane_sweeper.cxx.

bool brct_plane_sweeper::match_harris_corners const int  from_cam,
const double  z,
vcl_vector< vsol_point_2d_sptr > &  matched_points,
vcl_vector< vsol_point_2d_sptr > &  orig_to_points
 

Map and match harris corners from one image to the other via plane at z.

Definition at line 940 of file brct_plane_sweeper.cxx.

vcl_vector< vsol_point_2d_sptr > brct_plane_sweeper::matched_points_at_z_index int  z_index  ) 
 

Definition at line 1034 of file brct_plane_sweeper.cxx.

bool brct_plane_sweeper::overlapping_box vcl_vector< vgl_h_matrix_2d< double > > const &  homgs,
vsol_box_2d_sptr box
[protected]
 

Definition at line 243 of file brct_plane_sweeper.cxx.

bool brct_plane_sweeper::overlapping_projections vcl_vector< vgl_h_matrix_2d< double > > const &  homgs,
vcl_vector< vil1_memory_image_of< float > > &  imgs,
vcl_vector< vcl_vector< vsol_point_2d_sptr > > &  corners,
double &  tx,
double &  ty
[protected]
 

compute overlapping projections of images and Harris corners.

Definition at line 311 of file brct_plane_sweeper.cxx.

bool brct_plane_sweeper::overlapping_projections vcl_vector< vgl_h_matrix_2d< double > > const &  homgs,
vcl_vector< vil1_memory_image_of< float > > &  imgs,
double &  tx,
double &  ty
[protected]
 

tx and ty shift the projections to the (0,0) image origin.

Definition at line 268 of file brct_plane_sweeper.cxx.

bool brct_plane_sweeper::overlapping_projections const double  z,
vcl_vector< vil1_memory_image_of< float > > &  imgs,
vcl_vector< vcl_vector< vsol_point_2d_sptr > > &  corners
 

Construct images and corners corresponding to the overlap.

Definition at line 360 of file brct_plane_sweeper.cxx.

bool brct_plane_sweeper::overlapping_projections const double  z,
vcl_vector< vil1_memory_image_of< float > > &  imgs
 

Construct images corresponding to the overlap in the two cam projections.

Definition at line 348 of file brct_plane_sweeper.cxx.

bool brct_plane_sweeper::overlapping_projections const int  plane,
vcl_vector< vil1_memory_image_of< float > > &  imgs
 

Construct images corresponding to the overlap in the two cam projections.

Definition at line 336 of file brct_plane_sweeper.cxx.

vil1_memory_image_of<vil1_rgb<unsigned char> > brct_plane_sweeper::overlay_matches vcl_vector< vsol_point_2d_sptr ,
vil1_memory_image_of< float > const &  back
[protected]
 

vcl_vector< vsol_point_3d_sptr > brct_plane_sweeper::proj_points_3d  ) 
 

get the matched corners as 3-d points with x-y in the matched image.

Definition at line 1045 of file brct_plane_sweeper.cxx.

vcl_vector< vsol_point_2d_sptr > brct_plane_sweeper::project_corners vgl_h_matrix_2d< double > const &  H,
vcl_vector< vsol_point_2d_sptr > const &  corners
[protected]
 

Definition at line 70 of file brct_plane_sweeper.cxx.

vil1_memory_image_of< unsigned char > brct_plane_sweeper::project_image_to_plane const int  plane,
const int  cam
 

Project the camera image to the world plane.

Definition at line 214 of file brct_plane_sweeper.cxx.

bool brct_plane_sweeper::read_homographies vcl_string const &  homography_file  ) 
 

Read the homographies for two parallel planes to each camera plane.

Definition at line 86 of file brct_plane_sweeper.cxx.

bool brct_plane_sweeper_params::SanityCheck  )  [inherited]
 

Checks that parameters are within acceptable bounds.

Note that msg << ends seems to restart the string and erase the previous string. We should only use it as the last call, use vcl_endl otherwise.

Definition at line 82 of file brct_plane_sweeper_params.cxx.

bool brct_plane_sweeper::save_world_points vcl_string const &  out_file  ) 
 

Definition at line 1091 of file brct_plane_sweeper.cxx.

bool brct_plane_sweeper::set_image const int  cam,
vil1_image const &  image
 

Mutators.

Definition at line 156 of file brct_plane_sweeper.cxx.

vcl_vector< vsol_point_3d_sptr > brct_plane_sweeper::world_points_3d  ) 
 

get the matched corners as 3-d points with world x-y coordinates.

Definition at line 1068 of file brct_plane_sweeper.cxx.

vil1_memory_image_of< unsigned char > brct_plane_sweeper::z_corr_image const int  i  ) 
 

Accessors.

Definition at line 762 of file brct_plane_sweeper.cxx.


Friends And Related Function Documentation

vcl_ostream& operator<< vcl_ostream &  os,
const brct_plane_sweeper_params sp
[friend, inherited]
 

Definition at line 93 of file brct_plane_sweeper_params.cxx.


Member Data Documentation

float brct_plane_sweeper_params::corr_max_ [inherited]
 

Definition at line 60 of file brct_plane_sweeper_params.h.

float brct_plane_sweeper_params::corr_min_ [inherited]
 

Definition at line 59 of file brct_plane_sweeper_params.h.

int brct_plane_sweeper_params::corr_radius_ [inherited]
 

Definition at line 58 of file brct_plane_sweeper_params.h.

float brct_plane_sweeper_params::corr_sigma_ [inherited]
 

Definition at line 62 of file brct_plane_sweeper_params.h.

float brct_plane_sweeper_params::corr_thresh_ [inherited]
 

Definition at line 61 of file brct_plane_sweeper_params.h.

float brct_plane_sweeper::del_ [protected]
 

Definition at line 199 of file brct_plane_sweeper.h.

vcl_vector<vcl_vector<vsol_point_2d_sptr> > brct_plane_sweeper::harris_corners_ [protected]
 

Definition at line 211 of file brct_plane_sweeper.h.

bool brct_plane_sweeper::harris_valid_ [protected]
 

Definition at line 193 of file brct_plane_sweeper.h.

sdet_harris_detector_params brct_plane_sweeper_params::hdp_ [inherited]
 

Definition at line 64 of file brct_plane_sweeper_params.h.

vcl_vector< vcl_vector<vgl_h_matrix_2d<double> > > brct_plane_sweeper::homographies_ [protected]
 

Definition at line 204 of file brct_plane_sweeper.h.

bool brct_plane_sweeper::homographies_valid_ [protected]
 

Definition at line 194 of file brct_plane_sweeper.h.

vcl_vector<vil1_image> brct_plane_sweeper::images_ [protected]
 

Definition at line 206 of file brct_plane_sweeper.h.

float brct_plane_sweeper_params::intensity_thresh_ [inherited]
 

Definition at line 63 of file brct_plane_sweeper_params.h.

vcl_vector<vcl_vector<vsol_point_2d_sptr> > brct_plane_sweeper::matched_corners_ [protected]
 

Definition at line 213 of file brct_plane_sweeper.h.

int brct_plane_sweeper::n_cams_ [protected]
 

Definition at line 198 of file brct_plane_sweeper.h.

int brct_plane_sweeper::n_planes_ [protected]
 

Definition at line 197 of file brct_plane_sweeper.h.

int brct_plane_sweeper_params::nz_ [inherited]
 

Definition at line 56 of file brct_plane_sweeper_params.h.

bsol_point_index_2d brct_plane_sweeper::pindx_ [protected]
 

Definition at line 214 of file brct_plane_sweeper.h.

float brct_plane_sweeper_params::point_radius_ [inherited]
 

Definition at line 57 of file brct_plane_sweeper_params.h.

vcl_vector<vil1_memory_image_of<float> > brct_plane_sweeper::smooth_images_ [protected]