我试图在labview中创建一个用于使用openCV的dll包装器。我和他们两个人(openCV& Labview)也很新。我想使用labview的cvTriangulatePoints。现在我已经创建了一个hpp文件
#ifndef __OPENCV_PRECOMP_H__
#define __OPENCV_PRECOMP_H__
#include "cvconfig.h"
#include "opencv2/calib3d/calib3d.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/imgproc/imgproc_c.h"
#include "opencv2/core/internal.hpp"
#include "opencv2/features2d/features2d.hpp"
#include <vector>
#ifdef HAVE_TEGRA_OPTIMIZATION
#include "opencv2/calib3d/calib3d_tegra.hpp"
#else
#define GET_OPTIMIZED(func) (func)
#endif
#endif
(这是precomp.hpp,它包含在文件triangulate.cpp opencv \ sources \ modules \ calib3d \ src中)然后是我自己的hpp文件:
#ifdef WRAPPEROPENCV_EXPORTS
#define WRAPPEROPENCV_API __declspec(dllexport)
#else
#define WRAPPEROPENCV __declspec(dllimport)
#endif
#include "precomp.hpp"
namespace WrapperOpenCv
{
class WrapperOpenCv
{
public:
WRAPPEROPENCV_API void cvTriangulatePoints(CvMat* projMatr1, CvMat* projMatr2, CvMat* projPoints1, CvMat* projPoints2, CvMat* points4D);
WRAPPEROPENCV_API void cvCorrectMatches(CvMat *F_, CvMat *points1_, CvMat *points2_, CvMat *new_points1, CvMat *new_points2);
static WRAPPEROPENCV_API void triangulatePoints( InputArray _projMatr1, InputArray _projMatr2, InputArray _projPoints1, InputArray _projPoints2, OutputArray _points4D )
};
}
有了这个,我应该能够在labview中导出这些方法。(我知道我仍然需要在cpp文件中实现这些功能)。问题:我在InputArray和OutputArray上有错误:
Error: identifier "InputArray" is undefined
有谁知道我该怎么做才能解决这个问题?谢谢你的帮助
答案 0 :(得分:0)
问题在于命名空间:
cv::InputArray
或
...
using namespace cv;
namespace WrapperOpenCv
{
...
一切都很好nox