Skip to content
Snippets Groups Projects
Commit 51774932 authored by Sacha Percot-Tétu's avatar Sacha Percot-Tétu
Browse files

Some ajdustments to FFT operations outputs

parent ba39fdcc
No related branches found
No related tags found
No related merge requests found
......@@ -59,6 +59,7 @@ void FFTOp::operator()(const imagein::Image* image, const map<const imagein::Ima
}
FFT2D(data, width, height, 1);
for(unsigned int j = 0; j < height; ++j) {
for(unsigned int i = 0; i < width; ++i) {
const double real = data[i][j].real();
......@@ -77,8 +78,10 @@ void FFTOp::operator()(const imagein::Image* image, const map<const imagein::Ima
}
}
this->outDoubleImage(phaseImg, " - FFT (phase)", true, false);
this->outDoubleImage(magnitudeImg, " - FFT (magnitude)", true, true);
this->outDoubleImage(phaseImg, "FFT (phase)", true, false);
this->outDoubleImage(magnitudeImg, "FFT (magnitude)", true, true);
// this->outDoubleImage(realImg, "FFT (real)", true, true);
// this->outDoubleImage(imagImg, "FFT (imag)", true, true);
// result.push_back(new DoubleImgWidget(phaseImg, " - FFT : phase", true, false));
// result.push_back(new DoubleImgWidget(magnitudeImg, " - FFT : magnitude", true, true));
// result.push_back(new DoubleImgWidget(realImg, " - FFT : real", true, true));
......
......@@ -70,8 +70,8 @@ void IFFTOp::operator()(const imagein::Image_t<double>*, const map<const imagein
unsigned int channels = min(magnitudeImg->getNbChannels(), phaseImg->getNbChannels());
Image* resImg = new Image(width, height, channels);
// Image_t<double>* realImg = new Image_t<double>(width, height, image->getNbChannels());
// Image_t<double>* imagImg = new Image_t<double>(width, height, image->getNbChannels());
// Image_t<double>* realImg = new Image_t<double>(width, height, channels);
// Image_t<double>* imagImg = new Image_t<double>(width, height, channels);
complex<double>** data = new complex<double>*[width];
for(unsigned int i = 0; i < width; ++i) data[i] = new complex<double>[height];
......@@ -94,14 +94,18 @@ void IFFTOp::operator()(const imagein::Image_t<double>*, const map<const imagein
FFT2D(data, width, height, -1);
for(unsigned int j = 0; j < height; ++j) {
for(unsigned int i = 0; i < width; ++i) {
// const double real = data[i][j].real();
// const double imag = data[i][j].imag();
Image::depth_t value = floor(data[i][j].real()+0.5);
value = min(255, max(0, value));
const double real = data[i][j].real();
const double imag = data[i][j].imag();
double value = floor(data[i][j].real()+0.5);
value = min(255.0, max(0.0, value));
resImg->setPixel(i, j, c, value);
// realImg->setPixel(i, j, c, real);
// imagImg->setPixel(i, j, c, imag);
}
}
}
this->outImage(resImg, "DFT-reconstructed image");
// this->outDoubleImage(realImg, "DFT-reconstructed image (real)");
// this->outDoubleImage(imagImg, "DFT-reconstructed image (imag)");
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment