OpenCV中文网站

 找回密码
 立即注册
搜索
热搜: 安装 配置
查看: 4607|回复: 0

emgu 关于dft傅里叶变换 问题求助

[复制链接]
发表于 2015-10-28 17:05:23 | 显示全部楼层 |阅读模式

这个是用enmgu做的傅里叶变换的程序代码:
         Image<Gray, Single> srcImage = new Image<Gray, Single>(_bitmap);
            Image<Gray, Single> dftdes = new Image<Gray, Single>(srcImage.Size);

            Image<Gray, Single> imge_re = new Image<Gray, Single>(srcImage.Size);
            Image<Gray, Single> imge_im = new Image<Gray, Single>(srcImage.Size);


                int x = Emgu.CV.CvInvoke.GetOptimalDFTSize(srcImage.Rows);
                int y = Emgu.CV.CvInvoke.GetOptimalDFTSize(srcImage.Cols);
                Emgu.CV.CvInvoke.CopyMakeBorder(srcImage, dftdes, 0, x - srcImage.Rows, 0, y - srcImage.Cols, Emgu.CV.CvEnum.BorderType.Constant);

           Image<Gray, Single>[] planes={ new Image<Gray, Single>(dftdes.Bitmap), new Image<Gray, Single>(dftdes.Size)};

                CvInvoke.Merge(planes.,imge_pc);

                CvInvoke.Dft(srcImage, dftdes, Emgu.CV.CvEnum.DxtType.Forward, 0);
                Emgu.CV.CvInvoke.Split(dftdes, imge_re);
                Emgu.CV.CvInvoke.Log(imge_re, imge_re);
                imge_re = imge_re.Copy(new System.Drawing.Rectangle(0, 0, imge_re.Cols & -2, imge_re.Rows & -2));
                int cx = imge_re.Cols / 2;
                int cy = imge_re.Rows / 2;
                Image<Gray, Single> q0 = imge_re.Copy(new System.Drawing.Rectangle(0, 0, cx, cy));// new Image<Gray, Single>(imge_re, new Rect(0, 0, cx, cy));   // Top-Left - 为每一个象限创建ROI
                Image<Gray, Single> q1 = imge_re.Copy(new System.Drawing.Rectangle(cx, 0, cx, cy));  // Top-Right
                Image<Gray, Single> q2 = imge_re.Copy(new System.Drawing.Rectangle(0, cy, cx, cy));  // Bottom-Left
                Image<Gray, Single> q3 = imge_re.Copy(new System.Drawing.Rectangle(cx, cy, cx, cy)); // Bottom-Right
                Image<Gray, Single> tmp = new Image<Gray, Single>(imge_re.Size);                           // 交换象限 (Top-Left with Bottom-Right)
                q0.CopyTo(tmp);
                q3.CopyTo(q0);
                tmp.CopyTo(q3);
                q1.CopyTo(tmp);                  
                q2.CopyTo(q1);
                tmp.CopyTo(q2);
                CvInvoke.Normalize(tmp, tmp, 0, 1, Emgu.CV.CvEnum.NormType.MinMax);

程序运行到代码中红色部分, 程序报错, 参数不对,
我看了文档
public static void Merge(        IInputArrayOfArrays mv,        IOutputArray dst)Image<Gray, Single> 继承关系里边不是有IInputArrayOfArrays吗, 这里怎么还会报错--匹配的参数无效。


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|OpenCV中文网站

GMT+8, 2024-4-23 15:08 , Processed in 0.009559 second(s), 16 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表