Ask Your Question

VoodooCode's profile - activity

2013-02-06 04:55:47 -0500 asked a question Image Convolution returns black or strange images


I use two different methods to calculate the convolution of two images, both methods should return the same result, but they are different and both results don't seem right.

I wanted to auto correlate an image and therefore I convolve the image with a flipped version of itself. In theory it should work, but in reality, there is some bug.

Any idea why this method always returns a black image:

void AutoCorrelation1(Mat *image)
    cv::Mat flippedImage;

    //Flipped around the x - axis
    cv::flip(*image, flippedImage, 0);

    //Convolved both images
    cv::filter2D(*image, *image, -1, flippedImage, Point(-1,-1), 0.0, 0);

And this is the one with the strange results:

void AutoCorrelation2(Mat *image)
    cv::Mat flippedImage;

    //Flipped around the x - axis
    flip(*image, flippedImage, 0);

    //Increase depth
    flippedImage.convertTo(flippedImage, CV_64F);
    image->convertTo(*image, CV_64F);

    //DFT Both images

    //Per element multiplication
    multiply(*image, flippedImage, *image);
    *image = *image/ 500;

    //Inverse DFT Result

    //Transform Image Back
    image->convertTo(*image, CV_8U);

PS: DFT and DFTInverse work properly, already checked that.

Regards, VoodooCode

2013-01-25 07:45:38 -0500 received badge  Supporter (source)
2013-01-25 07:44:32 -0500 received badge  Critic (source)
2013-01-24 08:40:06 -0500 asked a question Using the laplacian filter with different border types


why does the following program work only for the border types: 0,1,2,4,16?

The bordertypes 3(Wrap) and 5(Transparent) cause a crash.

image = cv::imread("demo.png");

Laplacian(image, image, -1, 1, 1.0, 0.0, BORDER_ISOLATED);

imshow("Test", image);

Regards, VoodooCode

2012-10-27 13:31:06 -0500 received badge  Editor (source)
2012-10-27 13:25:33 -0500 asked a question GTKMM3.0 and OpenCV

Hi, I'm trying execute c++ code using the GTKMM3.0 and OpenCV libraries. I', able to compile it without any error, but when I want to execute it, the following error occurs and the program crashes:

Gtk-ERROR **: GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported

What can I do to avoid this problem? Is this something I did wrong or is it a general bug/missing feature ...