How to get the solution for FFT2 using opencv builtin method?

asked 2014-08-20 03:14:34 -0600

updated 2014-08-20 03:48:43 -0600

Mehdi. gravatar image

Code:

#include<stdio.h>
#include<stdlib.h>
#include<opencv\cv.h>
using namespace cv;
int main()
{
    int flag = 0;
    Mat* A = new Mat[4];
    A->create(2,2,CV_64FC2);
    A->at<double>(0,0)= 8;
    A->at<double>(0,1)= 4;
    A->at<double>(1,0)= 3;
    A->at<double>(1,1)= 4;
    Mat* B = new Mat[4];
    B->create(2,2,CV_64FC2);
    int n_chan = B->channels();
    printf("The matrix B channels : %d\n",n_chan);
    cvFFT(A,B,0,0);
    printf("%lf",B->at<double>(0,0));
    system("pause");
    return 0;
}

i'm getting below mentioned error while running this code

"OpenCV Error: Bad argument (Unknown array type) in unknown function, file ....\ ..\src\opencv\modules\core\src\matrix.cpp, line 697"

edit retag flag offensive close merge delete

Comments

2

This is probably more appropriate for an OpenCV forum.

tfoote gravatar image tfoote  ( 2014-08-20 03:15:57 -0600 )edit
lucasw gravatar image lucasw  ( 2014-08-21 10:03:59 -0600 )edit