不同的< theta'用于Gabor滤镜的图像返回没有方向的图像 [英] Different 'theta' for Gabor Filter Returns Images with no Orientation

查看:48
本文介绍了不同的< theta'用于Gabor滤镜的图像返回没有方向的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对具有以下 theta 的图像应用了 Gabor过滤器-{0,45,90,135}.但是在相同的方位角下得到的图像完全相同!

I applied Gabor filter on images with the following theta- {0,45,90,135}. but the resultant images were exactly the same with the same orientation angle!

我希望应用 theta = 90 的Gabor过滤器的结果与使用 theat = 45 的Gabor过滤器的方向会有所不同,但是在使用具有不同特征的Gabor过滤器之后 theta ,我得到的图像的方向没有差异!

I expected that the results of applying Gabor filter with theta = 90 will be different in orientation than the one with theat = 45, but after using Gabor filter with different theta, I get images with no difference in orientation!

我使用Gabor过滤器错了吗?因为我希望根据Gabor滤镜中指定的方向角度,每个图像的方向都不同.

Am I using Gabor filter wrong? Because I expect every image to be of different orientation according to the orientation angel specified in the Gabor filter.

我为Gabor滤波器设置的参数如下:

The parameter I set for Gabor filter were as follows:

kernel size = Size(5,5);
theta = {0,45,90,135}
sigma = ,2
type = CVType.CV_32F
lambda = 100
gamma = ,5
psi = 5

代码:

public static void main(String[] args) {

    MatFactory matFactory = new MatFactory();
    FilePathUtils.addInputPath(path_Obj);
    Mat bgrMat = matFactory.newMat(FilePathUtils.getInputFileFullPathList().get(0));
    Mat gsImg = SysUtils.rgbToGrayScaleMat(bgrMat);
    double[] theta = new double[4];
    theta[0] = 0;
    theta[1] = 45;
    theta[2] = 90;
    theta[3] = 135;

    for (int i = 0; i < 4; i++) {
        Mat gaborCoeff = Imgproc.getGaborKernel(new Size(3,3), 2, theta[i], 4.1, 54.1, 0, CvType.CV_32F);
        Mat dest = new Mat();
        Imgproc.filter2D(gsImg, dest, CvType.CV_32F, gaborCoeff);
        ImageUtils.showMat(dest, "theta = " + theta[i]);
    }

}

图片_0度:

image_45度:

image_90度:

image_135度:

应用theta = 0,45,90,135的Gabor图像,但不进行平滑处理的图像:

推荐答案

也许问题出在这里:

Mat gaborCoeff = Imgproc.getGaborKernel(new Size(3,3), 2, theta[i], 4.1, 54.1, 0, CvType.CV_32F);

我认为应该是这样的:

Mat gaborCoeff = Imgproc.getGaborKernel(new Size(3,3), sigma, theta[i], lambda, psi, 0, CvType.CV_32F);

我不确定lambda和psi的值.也许您应该尝试查看具有不同值的结果图像.

And I'm not sure about the values of lambda and psi. Maybe you should try to see the resulting images with different values.

最后,Gabor结果就是您所说的image_0度,image_45度.即使它们之间没有显着变化,我还是会更改参数

Finally, Gabor result is what you called image_0 degree, image_45 degree. Even though there is no significant change between them, I would change the parameters

这篇关于不同的&lt; theta&amp;#39;用于Gabor滤镜的图像返回没有方向的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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