如何在OpenCV中对图像应用蒙版? [英] How to Apply Mask to Image in OpenCV?

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

问题描述

我要对彩色图像应用二进制蒙版
请提供一个基本的代码示例,并对代码的工作方式进行适当的说明。

I want to apply a binary mask to a color image. Please provide a basic code example with proper explanation of how the code works.

此外,是否存在一些永久应用掩码的选项,因此所有功能只能在掩码中运行?

Also, is there some option to apply a mask permanently so all functions operate only within the mask?

推荐答案

您不对图像应用二进制掩码。您(可选)在处理函数调用中使用二进制掩码,以告诉函数要处理图像的哪些像素。如果我完全误解了您的问题,则应添加更多详细信息进行澄清。

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天全站免登陆