- Main Page
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

# Chamfer2D_3x3 Class Reference

Borgefors' Chamfer distance using a 3x3 window. More...

`#include <Chamfer2D_3x3.h>`

Inheritance diagram for Chamfer2D_3x3:

List of all members.

## Public Member Functions
| Chamfer2D_3x3 (const int xSize, const int ySize, const bool unload=true)
void | doTransform (const unsigned char *const I)
void | doTransform (const unsigned char *const I, const int dx, const int dy, const int dxy, const bool halfIsZero)
int | iterateTransform (const unsigned char *const I)
int | iterateTransform (const unsigned char *const I, const int dx, const int dy, const int dxy, const bool halfIsZero)
template<class T>
bool | check2 (T *d, const int center, const int X, const int Y, const T Delta)

## Detailed Description

Borgefors' Chamfer distance using a 3x3 window.

## Member Function Documentation

void Chamfer2D_3x3::doTransform | ( | const unsigned char *const | I,
|  | const int | dx,
|  | const int | dy,
|  | const int | dxy,
|  | const bool | halfIsZero
| ) |

| This method performs the distance transform. I is the 2D binary input image. dx & dy are the distances in the x and y directions (they need not be the same). dxy is the distance in the diagonal direction. If halfIsZero is true, then border elements (elements of the immediate interior and exterior are initialized with values of 0. If halfIsZero is false, then border elements are initialized with dx/2 if the border is in the x direction, dy/2 if the border is in the y direction, or min(dx/2, dy/2) for both.

void Chamfer2D_3x3::doTransform | ( | const unsigned char *const | I | ) | `[virtual]`

| This method simply calls the other doTransform method with the following arguments: doTransform(I, 3, 3, 4, true). Arguments of (2,3) have been used to replace (3,4) as well. Implements DistanceTransform.

int Chamfer2D_3x3::iterateTransform | ( | const unsigned char *const | I,
|  | const int | dx,
|  | const int | dy,
|  | const int | dxy,
|  | const bool | halfIsZero
| ) |

| This method is similar to the doTransform method except that it repeats the forward and backward passes of the distance transform algorithm until no more distance updates occur (until convergence, in effect).

int Chamfer2D_3x3::iterateTransform | ( | const unsigned char *const | I | ) |

| This method simply calls the other iterateTransform method with the following arguments: iterateTransform(I, 3, 3, 4, true). Arguments of (2,3) have been used to replace (3,4) as well.

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

- Chamfer2D_3x3.h
- Chamfer2D_3x3.cpp