Binary Image Library
Functions
C:/Users/Malcolm/Documents/temp/binaryimagelibrary/hausdorff.c File Reference
#include <stdlib.h>
#include <string.h>

Functions

int binaryhausdorff (unsigned char *imagea, unsigned char *imageb, int width, int height, int *halfa, int *halfb)
 

Detailed Description

Binary Hausdorff routine

Function Documentation

int binaryhausdorff ( unsigned char *  imagea,
unsigned char *  imageb,
int  width,
int  height,
int *  halfa,
int *  halfb 
)

Binary Hausdorff distance.

The Hausforff distance is the maximum distance from the pixels in A not in B to the nearest pixel in B, and vice versa. So it is a measure of image similarity. The half-Hausdorff distance just considers A to B or B to A, and the Hausdorff distance is trivally the maximum of the two.

Parameters
[in]imagea- the first image
[in]imageb- the second image
width- image width
height- image height
[out]halfa- return for half-Hausdorff distance a to b
[out]halfb- return for half-Hausdorff distance b to a
Returns
The Hausdorff distance between image a and image b.
Note
Diagonal steps = 1, not Euclidean distance.
return -1 if either image empty.