Classes | Functions
contrib/mul/fhs/tools/fhs_match_tree_model.cxx File Reference

Program using F&H method to locate matches on a pair of images given tree on one. More...

#include <vul/vul_arg.h>
#include <vimt/vimt_image_2d_of.h>
#include <vimt/vimt_gaussian_pyramid_builder_2d.h>
#include <vimt/vimt_image_pyramid.h>
#include <vimt/vimt_crop.h>
#include <mbl/mbl_read_props.h>
#include <vil/vil_load.h>
#include <vul/vul_string.h>
#include <vcl_algorithm.h>
#include <vil/vil_save.h>
#include <vil/vil_fill.h>
#include <vil/vil_crop.h>
#include <vil/vil_math.h>
#include <vil/vil_convert.h>
#include <vil/vil_resample_bilin.h>
#include <vnl/vnl_math.h>
#include <vgl/vgl_point_2d.h>
#include <vgl/vgl_vector_2d.h>
#include <fhs/fhs_searcher.h>
#include <vimt/algo/vimt_normalised_correlation_2d.h>
#include <mbl/mbl_draw_line.h>

Go to the source code of this file.

Classes

class  fhs_model_params

Functions

void print_usage ()
bool parse_param_file (const vcl_string &param_path, fhs_model_params &params)
bool fhs_load_points (const vcl_string &path, vcl_vector< vgl_point_2d< double > > &pts)
 Load in points in ISBE points format.
bool fhs_load_arcs (const vcl_string &path, vcl_vector< vcl_pair< int, int > > &pairs)
 Load in pairs of indices indicating connections between points.
void extract_normalised_patches (const vimt_image &image, const vcl_vector< vgl_point_2d< double > > &pts, int half_width, vcl_vector< vil_image_view< float > > &patch, vcl_vector< vgl_point_2d< double > > &ref_pts)
 Sample normalised patches around each point.
void draw_tree (vil_image_view< vxl_byte > &image, const vcl_vector< vgl_point_2d< double > > &pts, const vcl_vector< vcl_pair< int, int > > &pairs)
void vimt_resample (const vimt_image_2d_of< float > &src_im, int src_L, vimt_image_2d_of< float > &dest_im, int dest_L)
 Generate a new image with resolution suitable for dest_L.
int main (int argc, char *argv[])

Detailed Description

Program using F&H method to locate matches on a pair of images given tree on one.

Author:
Tim Cootes Example parameter file:
    image1_path: HandImages/Hand_1.jpg
    image2_path: HandImages/Hand_9.jpg
    points_path: hand_b.pts
    arcs_path: hand_b.arcs
    output_image1_path: output1.png
    output_image2_path: output_b9.png
    L_lo: 2
    L_hi: 2
    half_width: 7
    response_scale: 0.5
   

Definition in file fhs_match_tree_model.cxx.


Function Documentation

void draw_tree ( vil_image_view< vxl_byte > &  image,
const vcl_vector< vgl_point_2d< double > > &  pts,
const vcl_vector< vcl_pair< int, int > > &  pairs 
)

Definition at line 260 of file fhs_match_tree_model.cxx.

void extract_normalised_patches ( const vimt_image image,
const vcl_vector< vgl_point_2d< double > > &  pts,
int  half_width,
vcl_vector< vil_image_view< float > > &  patch,
vcl_vector< vgl_point_2d< double > > &  ref_pts 
)

Sample normalised patches around each point.

Extract patches with given half-width around each pts[i] When near an image edge, patch may be truncated ref_pts defines position of original point relative to the patch origin

Definition at line 225 of file fhs_match_tree_model.cxx.

bool fhs_load_arcs ( const vcl_string &  path,
vcl_vector< vcl_pair< int, int > > &  pairs 
)

Load in pairs of indices indicating connections between points.

File format: Each line contains two integers

Definition at line 193 of file fhs_match_tree_model.cxx.

bool fhs_load_points ( const vcl_string &  path,
vcl_vector< vgl_point_2d< double > > &  pts 
)

Load in points in ISBE points format.

eg: n_points: 12 { 1 2 3 4 .... }

Definition at line 133 of file fhs_match_tree_model.cxx.

int main ( int  argc,
char *  argv[] 
)

Definition at line 300 of file fhs_match_tree_model.cxx.

bool parse_param_file ( const vcl_string &  param_path,
fhs_model_params params 
)

Definition at line 67 of file fhs_match_tree_model.cxx.

void print_usage ( )

Definition at line 42 of file fhs_match_tree_model.cxx.

void vimt_resample ( const vimt_image_2d_of< float > &  src_im,
int  src_L,
vimt_image_2d_of< float > &  dest_im,
int  dest_L 
)

Generate a new image with resolution suitable for dest_L.

Requires dest_L>src_L, else dest_im is a (shallow) copy of src_im

Definition at line 280 of file fhs_match_tree_model.cxx.