Can anybody tell me what is the problem in this code…
Basically I am trying to compute the dft of the image and show it as an image on my screen.
Image<Gray, float> GreyOriginalImage = new Image<Gray, float>(strFileName);
Matrix<float> imageMat = new Matrix<float>( CvInvoke.cvGetOptimalDFTSize( GreyOriginalImage.Rows ) , CvInvoke.cvGetOptimalDFTSize( GreyOriginalImage.Cols ) );
GreyOriginalImage.CopyTo( imageMat.GetSubRect( GreyOriginalImage.ROI ) );
CvInvoke.cvDFT( imageMat , imageMat , Emgu.CV.CvEnum.CV_DXT.CV_DXT_FORWARD , imageMat.Rows );
GreyFourierImage = new Image<Gray, float>( imageMat.Rows , imageMat.Cols );
imageMat.CopyTo( GreyFourierImage );
ImageBox2.Image = GreyFourierImage;
imageBox2.Show();
The problem is that the code hangs up while executing and no image gets shown….
I am using Visual studio 2010 with emgu cv.
Well I’ve gone over your code and debugged it the problem line is here:
You are trying to copy imageMat which is a float[,] array to an image float[,,*] I’m sure you can figure out that this just doesn’t work and is why the program hangs.
Here is the code that splits the Imaginary and Real parts from cvDFT:
Cheers,
Chris