Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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&lt;cols;j++){" for(int="" k="0;k&lt;liste.size();k++)" {<="" p="">

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); // planes[0] = Re(DFT(I), planes[1] = Im(DFT(I))

//cv::cartToPolar (planes[0],planes[1],magI(i,j),phase(i,j),true); magnitude(planes[0], planes[1], planes[0]);// planes[0] = magnitude int m = planes[0].cols; for(int l=0;l<m;l++) {="" magi.at<uchar="">(j,i) = planes0;//errror I want to put the first value of planes[0] at the first point in magI }

  }
}

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. Thanks.

Mat magI;
  cv::Mat phase;
   img->load(liste[0]);
  img *img = img->scaled(widget.imageLabel->width(), widget.imageLabel->height(),Qt::IgnoreAspectRatio,Qt::FastTransformation);
   QPixmap pixmap=QPixmap(QPixmap::fromImage(img));
    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&lt;cols;j++){" for(int="" k="0;k&lt;liste.size();k++)" {<="" p="">

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); // planes[0] = Re(DFT(I), planes[1] = Im(DFT(I))

//cv::cartToPolar (planes[0],planes[1],magI(i,j),phase(i,j),true); magnitude(planes[0], planes[1], planes[0]);// planes[0] = magnitude int m = planes[0].cols; for(int l=0;l<m;l++) {="" magi.at<uchar="">(j,i) = planes0;//errror I want to put the first value of planes[0] at the first point in magI }

  }
}

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);

CV_LOAD_IMAGE_GRAYSCALE); int fftp = I.at<uchar>(j,i);

pixels[k]=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); // planes[0] = Re(DFT(I), planes[1] = Im(DFT(I))

//cv::cartToPolar (planes[0],planes[1],magI(i,j),phase(i,j),true); magnitude(planes[0], planes[1], planes[0]);// planes[0] = magnitude planes[0]); int m = planes[0].cols; for(int l=0;l<m;l++) {="" magi.at<uchar="">(j,i) = planes0;//errror I want 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] at in the first point in magI }

the image HOW
}

  }
}