OpenCV:了解内核 [英] OpenCV: Understanding Kernel
问题描述
我的书说明了OpenCV中的图像内核概念
My book says this about the Image Kernel concept in OpenCV
当在像素邻域上进行计算时,通常会
用内核矩阵表示。该内核描述了计算中涉及的
像素如何组合以获得
所需结果。
When a computation is done over a pixel neighborhood, it is common to represent this with a kernel matrix. This kernel describes how the pixels involved in the computation are combined in order to obtain the desired result.
在图像模糊技术中,我们使用内核大小。
In image blur techniques, we use the kernel size.
cv::GaussianBlur(inputImage,outputImage,Size(1,1),0,0)
所以,如果我说内核大小是大小(1,1)
这是否意味着内核只有1个像素?
So, if I say the kernel size is Size(1,1)
does that mean the kernel got only 1 pixel?
请看下面的图像
< img src =https://i.stack.imgur.com/nxCjv.pngalt =在此处输入图像描述>
在这里,内核是什么尺寸? 尺寸(3,3)
?如果我在这张图片中说尺寸尺寸(1,1)
,那是否意味着内核只有1个像素且像素值为0(图像中的第一个值) ?
In here, what's the Kernel size? Size(3,3)
? If I say size Size(1,1)
in this image, does that mean the kernel got only 1 pixel and the pixel value is 0 (The first value in the image)?
推荐答案
您发布的图像是3x3内核,由 cv :: Size指定(3,3)
。你是正确的说 cv :: Size(1,1)
对应一个像素,但是说 cv :: Size(1, 1)
参考图像没有意义。 1x1内核的值只有 [1]
。
The image you post is a 3x3 kernel, which would be specified by cv::Size(3,3)
. You are correct in saying that cv::Size(1,1)
corresponds to a single pixel, but saying "cv::Size(1,1)
" in reference to the image is not meaningful. A 1x1 kernel would simply have the value [1]
.
这篇关于OpenCV:了解内核的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!