【问题标题】:Meaning of tilde operator in OpenCVOpenCV中波浪号运算符的含义
【发布时间】:2015-03-07 09:48:15
【问题描述】:

考虑

cv::Mat A;
cv::Mat B;   
//read images A and B 

OpenCV/C++中以下语句是什么意思

 A &= ~B ;

【问题讨论】:

标签: c++ opencv


【解决方案1】:

OpenCV 中的表达式 (A &= ~B) 可用于在连续图像序列中查找运动/移动的对象

例如

1. Image A

2。 Image B - circle moves left

3. Inverse of B => ~B

4. A&=~B => movement or difference of sequenced images

【讨论】:

    【解决方案2】:

    它有普通的意思。 OpenCV 文档确实不清楚,operators 列在"Matrix expressions"

    【讨论】:

      【解决方案3】:
      A = A BitwiseAnd (BitwiseNot B)
      

      例子:

      A = 1100
      B = 0101

      ~B = 1010

      A&~B = 1000

      【讨论】:

        猜你喜欢
        • 2012-01-08
        • 2011-11-04
        • 2019-05-17
        • 2021-09-15
        • 2017-07-15
        相关资源
        最近更新 更多