简体   繁体   English

波浪号运算符在OpenCV中的含义

[英]Meaning of tilde operator in OpenCV

Consider 考虑

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

What is the meaning of following statement in OpenCV/C++ OpenCV / C ++中的以下语句是什么意思

 A &= ~B ;

That expression( A &= ~B ) in OpenCV could be used to find movement/moved objects in a continuous sequence of images. OpenCV中的表达式( A &= ~B 〜B)可用于查找连续图像序列中的运动/运动对象

Eg 例如

1. Image A 1. Image A

图片A

2. Image B - circle moves left 2. Image B - circle moves left

图片B

3. Inverse of B => ~B 3. Inverse of B => ~B

Inv B

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

运动

It's got the ordinary meaning. 它具有一般意义。 The OpenCV documentation indeed is unclear, the operators are listed under "Matrix expressions " OpenCV文档确实不清楚, 运算符“矩阵表达式 ”下列出

A = A BitwiseAnd (BitwiseNot B)

Example: 例:

A = 1100 A = 1100
B = 0101 B = 0101

~B = 1010 〜B = 1010

A&~B = 1000 A&〜B = 1000

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM