二维离散傅里叶变换手算实例(加OpenCV实现) | 您所在的位置:网站首页 › 用matlab对图像进行哈达玛变换 › 二维离散傅里叶变换手算实例(加OpenCV实现) |
二维离散傅里叶变换手算实例(加OpenCV实现)
二维傅里叶原理及公式不做赘述,直接看图片理解吧 如图
要用opencv #include "opencv2/core.hpp" #include "opencv2/core/utility.hpp" #include "opencv2/imgproc.hpp" #include "opencv2/highgui.hpp" #include #include using namespace cv; using namespace std; int main(int argc, const char ** argv) { Mat img = Mat::zeros(4, 4, CV_32F); img.at(0, 0) = 0; img.at(0, 1) = 1; img.at(0, 2) = 0; img.at(0, 3) = 2; img.at(1, 0) = 0; img.at(1, 1) = 3; img.at(1, 2) = 0; img.at(1, 3) = 4; img.at(2, 0) = 0; img.at(2, 1) = 5; img.at(2, 2) = 0; img.at(2, 3) = 6; img.at(3, 0) = 0; img.at(3, 1) = 7; img.at(3, 2) = 0; img.at(3, 3) = 8; Mat planes[] = { Mat_(img), Mat::zeros(img.size(), CV_32F) }; Mat complexImg; merge(planes, 2, complexImg); dft(complexImg, complexImg, DFT_COMPLEX_OUTPUT); std::cout |
今日新闻 |
推荐新闻 |
专题文章 |
CopyRight 2018-2019 实验室设备网 版权所有 |