Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Friends
brct_plane_sweeper Class Reference

#include <brct_plane_sweeper.h>

Inheritance diagram for brct_plane_sweeper:
Inheritance graph
[legend]

List of all members.

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_image > images_
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)

Detailed Description

Definition at line 43 of file brct_plane_sweeper.h.


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 648 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 770 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 689 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 417 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.

perform the cross-correlation of each pixel of the overlapping projection of the left and right images onto the specified plane.

Definition at line 370 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.

perform the cross-correlation of each pixel of the overlapping projection of the left and right images onto the specified world Z value.

Definition at line 393 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.

sweep the z plane and find positions of max cross-correlation.

Definition at line 494 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 463 of file brct_plane_sweeper.cxx.

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

Definition at line 746 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.

sweep the z plane and find positions of max cross-correlation.

Definition at line 575 of file brct_plane_sweeper.cxx.

bool brct_plane_sweeper::harris_sweep ( const int  from_cam)

Definition at line 958 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.

initialize the harris corner matching index.

Definition at line 913 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 885 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 897 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 842 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.

Map the image of the from_cam to the image space of the to_cam.

Assumes that the world is a plane at z.

Definition at line 870 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 796 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 786 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 816 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.

for debugging testing.

Definition at line 929 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 1023 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 ( const int  plane,
vcl_vector< vil1_memory_image_of< float > > &  imgs 
)

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

compute the projections of left and right images that overlap on the specified plane.

Definition at line 336 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.

compute the projections of left and right images that overlap on the plane at depth z.

Definition at line 346 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 356 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 ( 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.

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 1034 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 1080 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 1057 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 756 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

Definition at line 60 of file brct_plane_sweeper_params.h.

Definition at line 59 of file brct_plane_sweeper_params.h.

Definition at line 58 of file brct_plane_sweeper_params.h.

Definition at line 62 of file brct_plane_sweeper_params.h.

Definition at line 61 of file brct_plane_sweeper_params.h.

float brct_plane_sweeper::del_ [protected]

Definition at line 200 of file brct_plane_sweeper.h.

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

Definition at line 212 of file brct_plane_sweeper.h.

Definition at line 194 of file brct_plane_sweeper.h.

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 205 of file brct_plane_sweeper.h.

Definition at line 195 of file brct_plane_sweeper.h.

vcl_vector<vil1_image> brct_plane_sweeper::images_ [protected]

Definition at line 207 of file brct_plane_sweeper.h.

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 214 of file brct_plane_sweeper.h.

int brct_plane_sweeper::n_cams_ [protected]

Definition at line 199 of file brct_plane_sweeper.h.

Definition at line 198 of file brct_plane_sweeper.h.

Definition at line 56 of file brct_plane_sweeper_params.h.

Definition at line 215 of file brct_plane_sweeper.h.

Definition at line 57 of file brct_plane_sweeper_params.h.

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

Definition at line 208 of file brct_plane_sweeper.h.

int brct_plane_sweeper::to_cam_ [protected]

Definition at line 201 of file brct_plane_sweeper.h.

vcl_vector<double> brct_plane_sweeper::z_ [protected]

Definition at line 203 of file brct_plane_sweeper.h.

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

Definition at line 210 of file brct_plane_sweeper.h.

Definition at line 55 of file brct_plane_sweeper_params.h.

Definition at line 54 of file brct_plane_sweeper_params.h.


The documentation for this class was generated from the following files: