Ask Your Question
0

Gabor filter (Real and imaginary images)

asked 2013-11-14 11:56:48 -0600

balasubramaniyan94 gravatar image

Hi to everyone,

As surfing through net, i got that gabor filter can be used for texture analysis.  And the output of the gabor filter will be real and imaginary image.

I have used the following code from opencv for gabor filter.

void Process(int , void *)
{
    const CvArr* m;
    std::vector<int> qualityType;
    qualityType.push_back(CV_IMWRITE_JPEG_QUALITY);
    qualityType.push_back(90);
    double sig = pos_sigma;
    double lm = 0.5+pos_lm/100.0;
    double th = pos_th;
    double ps = pos_psi;
    cv::Mat kernel = mkKernel(kernel_size, sig, th, lm, ps);
    cv::filter2D(src_f, dest, CV_32F, kernel);
    cv::Mat Lkernel(kernel_size*20, kernel_size*20, CV_32F);
    cv::resize(kernel, Lkernel, Lkernel.size());
    Lkernel /= 2.;
    Lkernel += 0.5;
    cv::imshow("Kernel", Lkernel);
    cv::Mat mag;
    cv::pow(dest, 2.0, mag);
    imwrite( "Templatemag.bmp", dest );
    cv::imshow("Mag", mag); 
}

int main(int argc, char** argv)
{
    src_f = cv::imread("sample.bmp",0);
    unsigned char *temp;
    if (!kernel_size%2)
    {
        kernel_size+=1;
    }
    cv::namedWindow("Process window", 1);
    cv::createTrackbar("Sigma", "Process window", &pos_sigma, kernel_size, Process);
    cv::createTrackbar("Lambda", "Process window", &pos_lm, 100, Process);
    cv::createTrackbar("Theta", "Process window", &pos_th, 180, Process);
    cv::createTrackbar("Psi", "Process window", &pos_psi, 360, Process);
    Process(0,0);
    cv::waitKey(0);
    return 0;
}

And the output of the above coding is as attached with this post.

We are unable to understand the real and imaginary image from the attached output.

Helps us to proceed further.  Share us any link which describes details about the real and imaginary image.
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2013-11-15 00:20:38 -0600

kook gravatar image

a kernel with parameter 'psi + pi/2' will be the imaginary part. I think this will help you - http://matlabserver.cs.rug.nl/edgedetectionweb/web/index.html make the kernel in the frequency domain will get better performance - http://www.csse.uwa.edu.au/~pk/Research/MatlabFns/index.html

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2013-11-14 11:56:48 -0600

Seen: 2,299 times

Last updated: Nov 15 '13