平滑面具的浮法垫 [英] Smoothing Mat of float with mask

查看:188
本文介绍了平滑面具的浮法垫的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法将一个高斯或中值平滑滤波器应用到一堆浮点上,同时提供一个应该忽略的像素掩码?



帮我?

解决方案

您可以通过以下方式来完成此操作:


  1. 调整蒙版之外的区域

  2. 平滑图像和蒙版
  3. 将平滑图像中的每个像素与值的平滑面具


    在步骤3中的划分补偿由掩蔽引入的黑色像素。这是有效的,因为平滑的蒙版与平滑的蒙版图像一样变暗。


    Is there a way to apply a Gaussianblur or median smoothing filter to a mat of floating points while supplying a mask of pixels that should be ignored?

    could you please help me? ty.

    解决方案

    You can do this by:

    1. Zeroing out the regions outside the mask
    2. Smooth the image and the mask
    3. Divide each pixel in the smoothed image with the value of the smoothed mask

    The division in step 3 compensates for the black pixels introduced by masking. This works because the smoothed mask is darkened in the same way as the smoothed masked image.

    这篇关于平滑面具的浮法垫的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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