FrequencyFilterMask example for C++ Builder
void __fastcall TForm1::Button1Click(TObject *Sender)
{
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( );
}