chamfer_distance - Compute the chamfer distance between an input image and an edge template.


#include "g/g_chamfer.h"

Example compile flags (system dependent):
   -L/home/kobus/misc/load/linux_x86_64_opteron -L/usr/lib/x86_64-linux-gnu
  -lKJB                               -lfftw3  -lgsl -lgslcblas -ljpeg  -lSVM -lstdc++                    -lpthread -lSLATEC -lg2c    -lacml -lacml_mv -lblas -lg2c      -lncursesw 

int chamfer_distance
	const Matrix *chamfer_image,
	const Edge_set *tmplate,
	int offset_row,
	int offset_col,
	double dist_bound,
	double *distance_out,
	size_t *point_count_out


Image must be input as a chamfer transformed image output by chamfer_transform(). Template must be input as an Edge_point linked list like that output by detect_edge_points. Offset_{x,y} is the position of the top-left of the template. dist_bound truncates overly large distances so edge pixels missing due to noise don't overly affect the distance measure. Setting dist_bound to 0 disables truncation. Distance_out is the chamfer distance. If dist_bound > 0, the result is homogenized to [0, dist_bound] Point_count_out is the number of edge points used to compute the distance. Useful if you'll be taking an average later on. Passing NULL ignores this argument.


This software is not adequatedly tested. It is recomended that results are checked independantly where appropriate.


Kyle Simek


Kobus Barnard


chamfer_transform , chamfer_transform_2 , sum_sq_distance , oriented_sum_sq_distance , oriented_chamfer_distance