enum cv::DistanceTypes

Overview

Distance types for Distance Transform and M-estimators

#include <imgproc.hpp>

enum DistanceTypes
{
    DIST_USER   = -1,
    DIST_L1     = 1,
    DIST_L2     = 2,
    DIST_C      = 3,
    DIST_L12    = 4,
    DIST_FAIR   = 5,
    DIST_WELSCH = 6,
    DIST_HUBER  = 7,
};

Detailed Documentation

Distance types for Distance Transform and M-estimators

See also:

cv::distanceTransform, cv::fitLine

Enum Values

DIST_USER

User defined distance.

DIST_L1

distance = |x1-x2| + |y1-y2|

DIST_L2

the simple euclidean distance

DIST_C

distance = max(|x1-x2|,|y1-y2|)

DIST_L12

L1-L2 metric: distance = 2(sqrt(1+x*x/2) - 1))

DIST_FAIR

distance = c^2(|x|/c-log(1+|x|/c)), c = 1.3998

DIST_WELSCH

distance = c^2/2(1-exp(-(x/c)^2)), c = 2.9846

DIST_HUBER

distance = |x|<c ? x^2/2 : c(|x|-c/2), c=1.345