Population
Image processing library in C++
Classes

Matrix In -> Matrix Out (FFT) More...

Classes

class  pop::Representation
 Working with representation. More...
 

Detailed Description

Matrix In -> Matrix Out (FFT)

In general, an matrix is a space-domain, a paving of a domain of the Euclidean space containing an information in each cell. This space-domain representation is usually the direct matrix obtained by a microscopy. However, there is different kinds of representations of the information (see Representation). The Fourier transform allows the correspondence between the space-domain and the frequency-domain. The wavelet transform allows the correspondence between the space-domain and the scale-space-domain. The choice of the representation depends on the particular problem. For instance, the noise can be seen as fluctuation with a short length correlation. In the Fourier space, this noise corresponds to high frequency and it is removed easily with a low pass.

Mat2UI8 img;//2d grey-level image object
img.load((std::string(POP_PROJECT_SOURCE_DIR)+"/image/Lena.bmp").c_str());//replace this path by those on your computer
Mat2F32 noisemap;
DistributionNormal d(0,20);
Processing::randomField(img.getDomain(),d,noisemap);
Mat2F32 imgf = Mat2F32(img) +noisemap;
Mat2ComplexF32 imgcomplex;
Mat2ComplexF32 fft(imgcomplex);
fft = Representation::FFT(fft,FFT_FORWARD);
Mat2ComplexF32 filterlowpass = Representation::lowPass(fft,60);
imgcomplex = Representation::FFT(filterlowpass,FFT_BACKWARD);
Representation::scale(imgcomplex);
Mat2F32 imgd;
Convertor::toRealImaginary(imgcomplex,imgd);
img = Processing::greylevelRange(imgd,0,255);
img.display();
lenanoise.jpg
noisy image
lenalowpass.jpg
filter image with low pass