离散傅里叶变化

傅里叶变换

对傅里叶变换了解不是很清楚的朋友推荐一下这个帖子,讲得很详细 傅里叶变换

源码

先看源码链接

#include "opencv2/core.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui.hpp"
 
#include <iostream>
 
using namespace cv;
using namespace std;
 
static void help(char ** argv)
{
   
    cout << endl
         << "This program demonstrated the use of the discrete Fourier transform (DFT). " << endl
         << "The dft of an image is taken and it's power spectrum is displayed." << endl << endl
         << "Usage:" << endl
         << argv[0] << " [image_name -- default lena.jpg]" << endl << endl;
}
 
int main(int argc, char ** argv)
{
   
    help(argv);

    const char* filename = argc >=2 ? argv[1] : "lena.jpg";

    // 读取灰度图像
    Mat I = imread(samples::findFile(filename), IMREAD_GRAYSCALE);
    if(I.empty()){
   
        cout << "Error opening image" << endl;
        return EXIT_FAILURE;
    }

    // 扩展输入图像到最优尺寸
    Mat padded; 
    int m = getOptimalDFTSize(I.rows);
    int n = getOptimalDFTSize(I.cols); 
    copyMakeBorder
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值