NAME

sum_sq_distance - Compute sum of square distance

SYNOPSIS

#include "g/g_chamfer.h"

Example compile flags (system dependent):
  -DLINUX_X86_64 -DLINUX_X86_64_OPTERON  -DGNU_COMPILER 
   -I/home/kobus/include
   -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 sum_sq_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
);

DESCRIPTION

Compute the sum of square distances distance to the between template edge points and the nearest input edge point. I.e. \sum_1^n d(e_i)^2. Compare this to chamfer distance wich is 1/n \sum_1^n d(e_i). 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.

DISCLAIMER

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

AUTHOR

Kyle Simek

DOCUMENTER

Kobus Barnard

SEE ALSO

chamfer_transform , chamfer_transform_2 , chamfer_distance , oriented_sum_sq_distance , oriented_chamfer_distance