2 weixin 30278365 weixin_30278365 于 2017.09.11 08:46 提问

在使用重载函数时出现的问题

class IPM {

private:

    // Sizes
    cv::Size m_origSize;
    cv::Size m_dstSize;

    // Points
    std::vector<cv::Point2f> m_origPoints;
    std::vector<cv::Point2f> m_dstPoints;

    // Homography
    cv::Mat m_H;
    cv::Mat m_H_inv;

    // Maps
    cv::Mat m_mapX, m_mapY;
    cv::Mat m_invMapX, m_invMapY;

    void createMaps();

public:

    IPM( const cv::Size& _origSize, const cv::Size& _dstSize, const std::vector<cv::Point2f>& _origPoints, const std::vector<cv::Point2f>& _dstPoints );

    // Apply IPM on points
    cv::Point2d applyHomography(const cv::Point2d& _point, const cv::Mat& _H);
    cv::Point3d applyHomography( const cv::Point3d& _point, const cv::Mat& _H);
    cv::Point2d applyHomography(const cv::Point2d& _point);
    cv::Point3d applyHomography( const cv::Point3d& _point);
    cv::Point2d applyHomographyInv(const cv::Point2d& _point);
    cv::Point3d applyHomographyInv( const cv::Point3d& _point);
    void applyHomography( const cv::Mat& _origBGR, cv::Mat& _ipmBGR, int borderMode = cv::BORDER_CONSTANT);
    void applyHomographyInv( const cv::Mat& _ipmBGR, cv::Mat& _origBGR, int borderMode = cv::BORDER_CONSTANT);

    // Draw
    void drawPoints( const std::vector<cv::Point2f>& _points, cv::Mat& _img ) const;

    //********************************************************************************************
    //* SETTERS AND GETTERS
    //********************************************************************************************
    cv::Mat getH() const { return m_H; }

    cv::Mat getHinv() const { return m_H_inv; }

    void getPoints(std::vector<cv::Point2f>& _origPts, std::vector<cv::Point2f>& _ipmPts);

};
IPM::IPM( const Size& _origSize, const Size& _dstSize, const vector& _origPoints, const vector& _dstPoints ): m_origSize(_origSize), m_dstSize(_dstSize), m_origPoints(_origPoints), m_dstPoints(_dstPoints){
m_H = getPerspectiveTransform( m_origPoints, m_dstPoints );
m_H_inv = m_H.inv();

createMaps();

}
IPM::IPM ipm( Size(imgG.cols, imgG.rows), Size(imgG.cols, imgG.rows), orgPts, dstPts ); // IPM object

ipm.applyHomography( imgG, imgIpm );
鼠标放在IPM::IPM ipm时会出现无法确定需要哪个重载函数
    错误提示“IPM::{ctor}”:  函数调用缺少参数列表;请使用“&IPM::{ctor}”创建指向成员的指针
    “ipm”:  找不到标识符
Csdn user default icon
上传中...
上传图片
插入图片