OpenCV中cv :: Mat类中的布尔运算符

时间:2012-11-01 08:55:37

标签: c++ opencv operators boolean computer-vision

我正在尝试编写一个大的测试宏,对我的类行为(包括构造函数,析构函数)进行一些健全性检查。我的代码(部分)如下所示:

  TEST(basic_getters_setters_contructors) { // Macro name)

  myNameSpace::myClass mc(cv::Mat::ones(1,2,CV_32S),cv::Mat::zeros(4,8,CV_32S));
  CHECK_EQUAL(false, mc.item1 == NULL);
  //.......Rest of the checks

TEST(basic_getters_setters_contructors) { // Macro name) myNameSpace::myClass mc(cv::Mat::ones(1,2,CV_32S),cv::Mat::zeros(4,8,CV_32S)); CHECK_EQUAL(false, mc.item1 == NULL); //.......Rest of the checks

当我构建它时,我收到编译器错误:

error C2678: binary '!': no operator found which takes a left-hand operand of type   
'cv::MatExpr' (or there is no acceptable conversion)

我很确定错误来自那条线而不是其他地方。我尝试使用intellisense,发现error C2678: binary '!': no operator found which takes a left-hand operand of type 'cv::MatExpr' (or there is no acceptable conversion) 评估为个对象。在mc.item1 == NULL课程中有一个名为cv::MatExpr的公共成员。这是我应该检查的,看它是0(假)还是1(真)?或者还有其他(和具体)方法吗?

如果这是一个愚蠢的问题,请不要投票给我:( ... 亲切的问候,

0 个答案:

没有答案