1 #ifndef TIL_CHAMFERDISTANCE_H 2 #define TIL_CHAMFERDISTANCE_H 13 template <
typename TImage >
17 const std::vector<typename TImage::value_type> &mask,
18 typename TImage::value_type foreground,
19 typename TImage::value_type background
22 typedef typename TImage::value_type value_type;
34 for (; !iIm.isAtEnd(); ++iIm)
36 if (*iIm == foreground)
41 else if (*iIm == background)
49 *iIm = k_doNotProcess;
58 value_type x = mask[0];
59 value_type y = mask[1];
60 value_type z = mask[2];
64 for (; !iIm.isAtEnd(); ++iIm)
A trait class to assign iterators to image types.
Belongs to package Box Do not include directly, include til/Box.h instead.
General macros, definitions and functions.
TImage::value_type max(const TImage &im)
Returns the maximum intensity of the input image.
void chamferDistance_3(TImage &im, const std::vector< typename TImage::value_type > &mask, typename TImage::value_type foreground, typename TImage::value_type background)