struct cv::HOGDescriptor

Overview

#include <objdetect.hpp>

struct HOGDescriptor
{
    // enums

    enum
    {
        L2Hys = 0,
    };

    enum
    {
        DEFAULT_NLEVELS = 64,
    };

    // fields

    Size blockSize;
    Size blockStride;
    Size cellSize;
    int derivAperture;
    float free_coef;
    bool gammaCorrection;
    int histogramNormType;
    double L2HysThreshold;
    int nbins;
    int nlevels;
    UMat oclSvmDetector;
    bool signedGradient;
    std::vector<float> svmDetector;
    double winSigma;
    Size winSize;

    // construction

    HOGDescriptor();

    HOGDescriptor(
        Size _winSize,
        Size _blockSize,
        Size _blockStride,
        Size _cellSize,
        int _nbins,
        int _derivAperture = 1,
        double _winSigma = -1,
        int _histogramNormType = HOGDescriptor::L2Hys,
        double _L2HysThreshold = 0.2,
        bool _gammaCorrection = false,
        int _nlevels = HOGDescriptor::DEFAULT_NLEVELS,
        bool _signedGradient = false
        );

    HOGDescriptor(const String& filename);
    HOGDescriptor(const HOGDescriptor& d);

    // methods

    bool
    checkDetectorSize() const;

    virtual
    void
    compute(
        InputArray img,
        std::vector<float>& descriptors,
        Size winStride = Size(),
        Size padding = Size(),
        const std::vector<Point>& locations = std::vector<Point>()
        ) const;

    virtual
    void
    computeGradient(
        const Mat& img,
        Mat& grad,
        Mat& angleOfs,
        Size paddingTL = Size(),
        Size paddingBR = Size()
        ) const;

    virtual
    void
    copyTo(HOGDescriptor& c) const;

    virtual
    void
    detect(
        const Mat& img,
        std::vector<Point>& foundLocations,
        std::vector<double>& weights,
        double hitThreshold = 0,
        Size winStride = Size(),
        Size padding = Size(),
        const std::vector<Point>& searchLocations = std::vector<Point>()
        ) const;

    virtual
    void
    detect(
        const Mat& img,
        std::vector<Point>& foundLocations,
        double hitThreshold = 0,
        Size winStride = Size(),
        Size padding = Size(),
        const std::vector<Point>& searchLocations = std::vector<Point>()
        ) const;

    virtual
    void
    detectMultiScale(
        InputArray img,
        std::vector<Rect>& foundLocations,
        std::vector<double>& foundWeights,
        double hitThreshold = 0,
        Size winStride = Size(),
        Size padding = Size(),
        double scale = 1.05,
        double finalThreshold = 2.0,
        bool useMeanshiftGrouping = false
        ) const;

    virtual
    void
    detectMultiScale(
        InputArray img,
        std::vector<Rect>& foundLocations,
        double hitThreshold = 0,
        Size winStride = Size(),
        Size padding = Size(),
        double scale = 1.05,
        double finalThreshold = 2.0,
        bool useMeanshiftGrouping = false
        ) const;

    virtual
    void
    detectMultiScaleROI(
        const cv::Mat& img,
        std::vector<cv::Rect>& foundLocations,
        std::vector<DetectionROI>& locations,
        double hitThreshold = 0,
        int groupThreshold = 0
        ) const;

    virtual
    void
    detectROI(
        const cv::Mat& img,
        const std::vector<cv::Point>& locations,
        std::vector<cv::Point>& foundLocations,
        std::vector<double>& confidences,
        double hitThreshold = 0,
        cv::Size winStride = Size(),
        cv::Size padding = Size()
        ) const;

    size_t
    getDescriptorSize() const;

    double
    getWinSigma() const;

    void
    groupRectangles(
        std::vector<cv::Rect>& rectList,
        std::vector<double>& weights,
        int groupThreshold,
        double eps
        ) const;

    virtual
    bool
    load(
        const String& filename,
        const String& objname = String()
        );

    virtual
    bool
    read(FileNode& fn);

    void
    readALTModel(String modelfile);

    virtual
    void
    save(
        const String& filename,
        const String& objname = String()
        ) const;

    virtual
    void
    setSVMDetector(InputArray _svmdetector);

    virtual
    void
    write(
        FileStorage& fs,
        const String& objname
        ) const;

    static
    std::vector<float>
    getDaimlerPeopleDetector();

    static
    std::vector<float>
    getDefaultPeopleDetector();
};

Detailed Documentation

Methods

virtual
void
detect(
    const Mat& img,
    std::vector<Point>& foundLocations,
    std::vector<double>& weights,
    double hitThreshold = 0,
    Size winStride = Size(),
    Size padding = Size(),
    const std::vector<Point>& searchLocations = std::vector<Point>()
    ) const

with found weights output

virtual
void
detect(
    const Mat& img,
    std::vector<Point>& foundLocations,
    double hitThreshold = 0,
    Size winStride = Size(),
    Size padding = Size(),
    const std::vector<Point>& searchLocations = std::vector<Point>()
    ) const

without found weights output

virtual
void
detectMultiScale(
    InputArray img,
    std::vector<Rect>& foundLocations,
    std::vector<double>& foundWeights,
    double hitThreshold = 0,
    Size winStride = Size(),
    Size padding = Size(),
    double scale = 1.05,
    double finalThreshold = 2.0,
    bool useMeanshiftGrouping = false
    ) const

with result weights output

virtual
void
detectMultiScale(
    InputArray img,
    std::vector<Rect>& foundLocations,
    double hitThreshold = 0,
    Size winStride = Size(),
    Size padding = Size(),
    double scale = 1.05,
    double finalThreshold = 2.0,
    bool useMeanshiftGrouping = false
    ) const

without found weights output

virtual
void
detectMultiScaleROI(
    const cv::Mat& img,
    std::vector<cv::Rect>& foundLocations,
    std::vector<DetectionROI>& locations,
    double hitThreshold = 0,
    int groupThreshold = 0
    ) const

evaluate specified ROI and return confidence value for each location in multiple scales

virtual
void
detectROI(
    const cv::Mat& img,
    const std::vector<cv::Point>& locations,
    std::vector<cv::Point>& foundLocations,
    std::vector<double>& confidences,
    double hitThreshold = 0,
    cv::Size winStride = Size(),
    cv::Size padding = Size()
    ) const

evaluate specified ROI and return confidence value for each location

void
readALTModel(String modelfile)

read/parse Dalal’s alt model file