class cv::HausdorffDistanceExtractor

Overview

A simple Hausdorff distance measure between shapes defined by contours. More…

#include <shape_distance.hpp>

class HausdorffDistanceExtractor: public cv::ShapeDistanceExtractor
{
public:
    // methods

    virtual
    int
    getDistanceFlag() const = 0;

    virtual
    float
    getRankProportion() const = 0;

    virtual
    void
    setDistanceFlag(int distanceFlag) = 0;

    virtual
    void
    setRankProportion(float rankProportion) = 0;
};

Inherited Members

public:
    // methods

    virtual
    void
    clear();

    virtual
    bool
    empty() const;

    virtual
    String
    getDefaultName() const;

    virtual
    void
    read(const FileNode& fn);

    virtual
    void
    save(const String& filename) const;

    virtual
    void
    write(FileStorage& fs) const;

    template <typename _Tp>
    static
    Ptr<_Tp>
    load(
        const String& filename,
        const String& objname = String()
        );

    template <typename _Tp>
    static
    Ptr<_Tp>
    loadFromString(
        const String& strModel,
        const String& objname = String()
        );

    template <typename _Tp>
    static
    Ptr<_Tp>
    read(const FileNode& fn);

    virtual
    float
    computeDistance(
        InputArray contour1,
        InputArray contour2
        ) = 0;

protected:
    // methods

    void
    writeFormat(FileStorage& fs) const;

Detailed Documentation

A simple Hausdorff distance measure between shapes defined by contours.

according to the paper “Comparing Images using the Hausdorff distance.” by D.P. Huttenlocher, G.A. Klanderman, and W.J. Rucklidge. (PAMI 1993). :

Methods

virtual
void
setDistanceFlag(int distanceFlag) = 0

Set the norm used to compute the Hausdorff value between two shapes. It can be L1 or L2 norm.

Parameters:

distanceFlag Flag indicating which norm is used to compute the Hausdorff distance (NORM_L1, NORM_L2).
virtual
void
setRankProportion(float rankProportion) = 0

This method sets the rank proportion (or fractional value) that establish the Kth ranked value of the partial Hausdorff distance. Experimentally had been shown that 0.6 is a good value to compare shapes.

Parameters:

rankProportion fractional value (between 0 and 1).