对OpenCV中的图像应用蒙版? [英] Apply Mask to image in OpenCV?

查看:385
本文介绍了对OpenCV中的图像应用蒙版?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个二进制掩码,我想永久应用于彩色图像,我该怎么做?
二进制掩码应该是永久的 - 因为我不想在每次调用函数时将掩码重新应用到图片。

I have a binary mask that I want to be permanently applied to a colour image how would I do this? The binary mask should be preferably permanent- as in I don't want to reapply the mask to the image every time I call a function.

基本代码实施例将被理解。

Basic Code Examples would be appreciated. If you use code, please explain the code instead of just posting it.

谢谢

推荐答案

您不会对图像应用二进制掩码。您(可选)在处理函数调用中使用二进制掩码,以告知函数要处理的图像的哪些像素。如果我完全误解你的问题,你应该添加更多的细节来澄清。

You don't apply a binary mask to an image. You (optionally) use a binary mask in a processing function call to tell the function which pixels of the image you want to process. If I'm completely misinterpreting your question, you should add more detail to clarify.

这篇关于对OpenCV中的图像应用蒙版?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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