EmguCV中图像的傅立叶变换 [英] Fourier transform of an image in EmguCV

查看:282
本文介绍了EmguCV中图像的傅立叶变换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以告诉我emgucv 2.3中是否存在用于查找图像的傅立叶变换的内置函数?

Can anyone tell me if there is an inbuilt function present in emgucv 2.3 for finding out fourier transform of images ?

预先感谢

推荐答案

从我的回答 Fourier转换+ emgucv

您追求的功能是CvInvoke.cvDFT,它在技术上调用了opencv方法,但应该是您追求的功能

The function you are after is CvInvoke.cvDFT it is technically calling the opencv method but it should be what your after

下面是将cvDFT中的虚部和实部分开的代码:

Here is the code that splits the Imaginary and Real parts from cvDFT:

Image<Gray, float> image = new Image<Gray, float>(open.FileName);
IntPtr complexImage = CvInvoke.cvCreateImage(image.Size, Emgu.CV.CvEnum.IPL_DEPTH.IPL_DEPTH_32F, 2);

CvInvoke.cvSetZero(complexImage);  // Initialize all elements to Zero
CvInvoke.cvSetImageCOI(complexImage, 1);
CvInvoke.cvCopy(image, complexImage, IntPtr.Zero);
CvInvoke.cvSetImageCOI(complexImage, 0);

Matrix<float> dft = new Matrix<float>(image.Rows, image.Cols, 2);
CvInvoke.cvDFT(complexImage, dft, Emgu.CV.CvEnum.CV_DXT.CV_DXT_FORWARD, 0);

//The Real part of the Fourier Transform
Matrix<float> outReal = new Matrix<float>(image.Size);
//The imaginary part of the Fourier Transform
Matrix<float> outIm = new Matrix<float>(image.Size);
CvInvoke.cvSplit(dft, outReal, outIm, IntPtr.Zero, IntPtr.Zero);

//Show The Data       
CvInvoke.cvShowImage("Real", outReal);
CvInvoke.cvShowImage("Imaginary ", outIm);

干杯,

Chris

这篇关于EmguCV中图像的傅立叶变换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆