C++ 结合使用BOOST::UBLAS和FFTW进行图像处理

C++ 结合使用BOOST::UBLAS和FFTW进行图像处理,c++,boost,fftw,C++,Boost,Fftw,是否有可能沿FFTW使用升压矩阵?如果是,你怎么做? 我基本上拥有的是 QPixmap pixmap("lena.bmp"); // resize input image pixmap = pixmap.copy(512,512,128,128); pixmap = pixmap.scaled(128,128); QImage image = pixmap.toImage(); QRgb col; int g; int width = pixmap.width(); int height =

是否有可能沿FFTW使用升压矩阵?如果是,你怎么做? 我基本上拥有的是

QPixmap pixmap("lena.bmp");
// resize input image
pixmap = pixmap.copy(512,512,128,128);
pixmap = pixmap.scaled(128,128);
QImage image = pixmap.toImage();
QRgb col;

int g;
int width = pixmap.width();
int height = pixmap.height();
matrix<double> m(width,height);
for (int j = 0; j < m.size2(); j++)
{
    for (int i = 0; i < m.size1(); i++)
    {
        m(i,j) = 0;

        m(i,j) = qGray(image.pixel(i,j));

    }
}
QPixmap pixmap(“lena.bmp”);
//调整输入图像的大小
pixmap=pixmap.copy(512512128128);
pixmap=pixmap.scaled(128128);
QImage image=pixmap.toImage();
QRgb-col;
int g;
int width=pixmap.width();
int height=pixmap.height();
矩阵m(宽度、高度);
对于(int j=0;j

我想对矩阵“m”执行FFTW,然后重新显示图像的fft。如何执行此操作?

您可以先将图像读取到阵列中,然后根据需要在此阵列上应用FFTW,然后将此阵列填充到boost ublas矩阵中,然后使用它

int a[width][height];
for (int j = 0; j < width; j++)
{
    for (int i = 0; i < height; i++)
    {
    a[i][j] = qGray(image.pixel(i,j));

    }
}
//apply fftw

matrix<double> m(width,height);
for (int j = 0; j < width; j++)
{
    for (int i = 0; i < height; i++)
    {
    m(i,j) = fft_a[i][j];

    }
}
inta[宽度][高度];
对于(int j=0;j
我希望这能奏效