Mat fft2( Mat src)
{
Mat Fourier = new Mat();
int mat_type = (int)src.Depth;
if (mat_type>15)
{
Debug.Print("报错");
}
if (mat_type < 7)
{
VectorOfMat planes =new VectorOfMat( new Mat[]{
src, new Mat(src.Size, DepthType.Cv64F,1) });
CvInvoke.Merge(planes,Fourier);
CvInvoke.Dft(Fourier, Fourier, DxtType.Forward, Fourier.Rows);
}
else // 7<mat_type<15
{
Mat tmp=new Mat();
CvInvoke.Dft(src, tmp, DxtType.Forward, Fourier.Rows);
VectorOfMat planes=new VectorOfMat();
CvInvoke.Split(tmp, planes);
Image<Gray, Single> Ita