class cv::ShapeDistanceExtractor

Overview

Abstract base class for shape distance algorithms. Moreā€¦

#include <shape_distance.hpp>

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

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

// direct descendants

class HausdorffDistanceExtractor;
class ShapeContextDistanceExtractor;

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);

protected:
    // methods

    void
    writeFormat(FileStorage& fs) const;

Detailed Documentation

Abstract base class for shape distance algorithms.

Methods

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

Compute the shape distance between two shapes defined by its contours.

Parameters:

contour1 Contour defining first shape.
contour2 Contour defining second shape.