Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/opencv/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# OpenCV:Sobel过滤器不具有旋转不变性_C#_Opencv_Image Manipulation_Emgucv_Sobel - Fatal编程技术网

C# OpenCV:Sobel过滤器不具有旋转不变性

C# OpenCV:Sobel过滤器不具有旋转不变性,c#,opencv,image-manipulation,emgucv,sobel,C#,Opencv,Image Manipulation,Emgucv,Sobel,我正在使用sobel操作符检测带有EmguCV 3.0(OpenCV的.NET包装)的灰度图像中的边缘 我使用的代码是 Image<Gray, byte> gray = new Image<Gray, byte>(@"C:\gray.bmp"); Image<Gray, float> sobel = gray.Sobel(0, 1, 3).Add(gray.Sobel(1, 0, 3)).AbsDiff(new Gray(0.0)); Image gray=

我正在使用sobel操作符检测带有EmguCV 3.0(OpenCV的.NET包装)的灰度图像中的边缘

我使用的代码是

Image<Gray, byte> gray = new Image<Gray, byte>(@"C:\gray.bmp");
Image<Gray, float> sobel = gray.Sobel(0, 1, 3).Add(gray.Sobel(1, 0, 3)).AbsDiff(new Gray(0.0));
Image gray=新图像(@“C:\gray.bmp”);
Image sobel=gray.sobel(0,1,3).Add(gray.sobel(1,0,3)).AbsDiff(新灰度(0.0));
这是经过预处理的图像(灰色)

这就是我要说的(索贝尔)

如您所见,右上角和左下角的边非常弱。我首先想到,它可能与原始图像有关,所以我将其旋转180度,再次运行sobel过滤器。结果在右上角和左下角仍然有非常弱的边缘(不幸的是,我不能在这里发布两个以上的链接,所以我不能向您展示)


所以我的问题是:这是一个bug,还是我使用的sobel过滤器是错误的?当在二维中运行时,它不应该是旋转不变的吗?我该如何修复它,才能看到这两条边与其他边一样牢固?

对不起,我已经找到了解决方案: 我现在使用的代码是:

Image<Gray, float> sobel = 
    gray.Sobel(1, 0, 3).AbsDiff(new Gray(0.0))
        .Add(gray.Sobel(0, 1, 3).AbsDiff(new Gray(0.0)));
Image sobel=
灰色.Sobel(1,0,3).AbsDiff(新灰色(0.0))
.Add(gray.Sobel(0,1,3)、AbsDiff(newgray(0.0));

这将通过| Gxy |=|Gx |+| Gy |来近似范数,结果是一个具有良好干净边缘的良好图像:

应用于旋转图像的sobel操作符:(右上角和左下角仍然很弱的边缘)为什么不制作自己的过滤器?