简体   繁体   English

filter2D在RGB图像的图像处理中如何工作以手动计算矩阵输出?

[英]how does filter2D works in image processing for RGB image to calculate matrix output manually?

I'm newbie in image processing, i have tried to implement filter2D to reduce noise image with RGB color recently, and it works well. 我是图像处理方面的新手,最近我尝试实现filter2D以减少具有RGB颜色的噪点图像,并且效果很好。 But i don't understand how it works manually in image matrix. 但是我不明白它如何在图像矩阵中手动工作。 Anybody can help me to explain how it works manually? 有人可以帮助我解释一下它是如何手动运行的吗? This is the input matrix and output matrix i get. 这是我得到的输入矩阵和输出矩阵。 Input Image Matrix Output Image Matrix 输入图像矩阵 输出图像矩阵

Thanks for your help. 谢谢你的帮助。 :) :)

as a short answer, filtering an image means apply a filter (or kernel) to it, ie; 简而言之,过滤图像意味着对其应用过滤器(或内核),即; convolving the image by this kernel. 通过该内核对图像进行卷积。 For that, you take each pixel on your image and consider a neighbourhood around it. 为此,您需要获取图像上的每个像素并考虑其周围的邻域。 You apply the kernel to the neighbourhood by multiplying each pixel of the neighbourhood with the corresponding kernel coefficient and sum all these values. 通过将邻域的每个像素与相应的内核系数相乘,将内核应用于邻域,然后将所有这些值求和。 For a pixel, this can be summarized by this figure ( source ) : 对于一个像素,可以通过此图( )进行总结: 卷积图

For example, by setting all the coefficients to 1/N (where N is the number of elements in your kernel), you compute the average intensity of your neighbourhood. 例如,通过将所有系数设置为1 / N(其中N是内核中元素的数量),可以计算出邻居的平均强度。 You can see https://en.wikipedia.org/wiki/Multidimensional_discrete_convolution for more information about image convolutions. 您可以查看https://en.wikipedia.org/wiki/MultiDimension_discrete_convolution了解有关图像卷积的更多信息。

OpenCV's documentation gives some practical examples of image smoothing. OpenCV的文档提供了一些图像平滑的实际示例。

Hope it helps 希望能帮助到你

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM