extract values from planes[0] of FFT application
Hello, I want to rearrange values from planes[0] after computing FFT in image in order to display amplitude image but how to browser it. Thanks.
Mat magI;
cv::Mat phase;
img->load(liste[0]);
*img = img->scaled(widget.imageLabel->width(), widget.imageLabel->height(),Qt::IgnoreAspectRatio,Qt::FastTransformation);
QPixmap pixmap=QPixmap(QPixmap::fromImage(*img));
int rows=pixmap.width();
int cols=pixmap.height();
cv::vector<int> pixels;
for(int i=0;i<rows;i++){
for(int j=0;j<cols;j++){
for(int k=0;k<liste.size();k++)
{
cv::Mat I = imread(liste[k].toStdString().c_str(), CV_LOAD_IMAGE_GRAYSCALE);
int fftp = I.at<uchar>(j,i);
pixels[k]=fftp; }
cv::Mat ff;
cv::dft(pixels, ff, cv::DFT_ROWS|cv::DFT_COMPLEX_OUTPUT);
cv::Mat planes[] = {cv::Mat::zeros(pixels.size(),1, CV_32F), cv::Mat::zeros(pixels.size(),1, CV_32F)};
cv::split(ff, planes);
magnitude(planes[0], planes[1], planes[0]);
int m = planes[0].cols;
for(int l=0;l<m;l++)
{
magI.at<uchar>(j,i) = planes[0].0;//ERROR Iwant to put the first value of planes[0] in the first point in the image HOW
}
}
}
Please, format your code properly