OpenCV派生Vec4i并在HoughLinesP

时间:2015-05-01 13:37:24

标签: c++ opencv inheritance derived-class

我试图在OpenCV中使用自定义类来获取从Vec4i派生的行,但是在运行时我得到了一个丑陋的断言:

 OpenCV Error: Assertion failed (mtype == type0 || (CV_MAT_CN(mtype) == CV_MAT_CN (type0) && ((1 << type0) & fixedDepthMask) != 0)) in cv::_OutputArray::create, file C:\builds\2_4_PackSlave-win32-vc12-shared\opencv\modules\core\src\matrix.cpp, line 1486

线类:

class Line : public cv::Vec4i
{
    public:
        cv::Point2i firstPoint();
        cv::Point2i secondPoint();

        float slope();
        float length();

        float intersectionAngle(Line &b);
};

功能调用:

vector<Line> lines;

HoughLinesP(
    source,
    lines,
    resolution_x,
    deg2rad(degrees),
    min_intersections,
    min_line_length,
    max_line_gap);

有没有办法在不发送矢量的情况下实现这一点&lt; cv :: Vec4i&gt;进入HoughLinesP,然后复制一切?

0 个答案:

没有答案