FrequencyFilterMask example for Delphi
procedure TForm1.Button1Click(Sender: TObject);
begin
LEADImage1.InitFourierTransformationData ( );
LEADImage1.Load ( 'e:\Noisy.jpg', 0, 0, 1 );
LEADImage2.Load ( 'e:\Noisy.jpg', 0, 0, 1 );
LEADImage1.DiscreteFourierTransformation ( 0, 0, 0, 0, DFT_DFT + DFT_GRAY );
LEADImage1.Load ( 'e:\Mask.jpg', 0, 0, 1 );
// filter frequencies
LEADImage1.FrequencyFilterMask( True );
LEADImage1.Bitmap:= LEADImage2.Bitmap;
// apply inverse DFT
// After this call, the image should be clean
LEADImage1.DiscreteFourierTransformation ( 0, 0, 0, 0, DFT_IDFT + DFT_ALL + DFT_IDFT_SCL );
LEADImage1.FreeFourierTransformationData ( );
end;