OpenCV Mat(比较)运算 rune 档

标签 opencv operator-overloading

你知道在哪里可以找到 cv::Mat 运算符的文档吗,比如 < , <= ETC?我目前的疑问是知道 < 是否运算符返回一个或 ~0值(=255 用于 uint8_t 图像,=65535 用于 uint16_t 图像等等)。读书here , 这意味着预期的行为是由等效的 compare 给出的称呼。但我很难在 OpenCV 文档中找到引用。

我试着用谷歌搜索:

opencv mat operator documentation

最佳答案

正确的搜索词是 Matrix Epressions。

来自 OpenCV 2 Documentation :

Comparison: A cmpop B, A cmpop alpha, alpha cmpop A, where cmpop is one of : >, >=, ==, !=, <=, <.

The result of comparison is an 8-bit single channel mask whose elements are set to 255 (if the particular element or pair of elements satisfy the condition) or 0.

在 OpenCV 3 中,关于矩阵表达式的文档分散在页面 Operations on arrays 中.这里有一个矩阵表达式的集合,但是文档是空的!特别想知道什么<运算符(operator)确实如此,必须检查 cv::compare 的文档:

When the comparison result is true, the corresponding element of output array is set to 255. The comparison operations can be replaced with the equivalent matrix expressions:

Mat dst1 = src1 >= src2; 
Mat dst2 = src1 < 8;
...

关于OpenCV Mat(比较)运算 rune 档,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30030565/

相关文章:

python - OpenCV python 裁剪图像

c++ - Reduce 函数计算每列的总和

c++ - 为同一对象管理多个流运算符(operator<<, >>)

c++ - 运算符重载并出现友元函数错误

c++ - 这个赋值运算符重载会出现什么问题

python - 如何使用 OpenCV 删除小的连接对象

python - 如何在python中使用opencv在图像上显示轴

c++ - 重载运算符 - () 作为自由函数而不是成员函数的意义?

C++ 成员与非成员运算符+

python - FFMpeg 命令在命令行中工作,但在 python 脚本中图像偏蓝? (半解决)