使用 OpenCV 的 C++ 中两个图像的元素最小值 [英] Elementwise minimum of two images in C++ using OpenCV

查看:77
本文介绍了使用 OpenCV 的 C++ 中两个图像的元素最小值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有 2 张 OpenCV 的 Mat 数据类型的图像.我想获得另一个 Mat 中两个图像的元素明智的最小值(两个图像中给定索引的最小值).除了比较两个索引的值并遍历整个图像之外,是否还有一种快速的方法可以做到这一点?我不确定如何在 C++ 中做到这一点.

I have 2 images of the Mat datatype of OpenCV. I wanted to get the element wise minimum(minimum value for a given index among both images) of both the images in another Mat. Is there a fast way of doing that other than comparing values at both indexes and iterating through the whole image? I am unsure on how to do this in C++.

推荐答案

我想你在找这个:MatExpr min(const Mat& a, const Mat& b):

I think you're looking for this: MatExpr min(const Mat& a, const Mat& b):

计算两个数组或一个数组和一个标量的每个元素的最小值.

Calculates per-element minimum of two arrays or an array and a scalar.

这篇关于使用 OpenCV 的 C++ 中两个图像的元素最小值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆