示例#1
0
image::Image* SeparableFilter::RunRowColumn( image::Image* pImageIn, double *filterTapX, double *filterTapY, int filterLengthX, int filterLengthY, GridExtender<double>::ExtensionType myType )
{
   int nrBands = pImageIn->GetNumberOfBands();
   int width = pImageIn->GetWidth();
   int height = pImageIn->GetHeight();

   Image* pImageOut = new Image(width, height);
   SeparableFilter sf;
   for (int i = 0; i < nrBands; i++)
   {
      ArrayGrid<double>* pGridOut = sf.RunRowColumn( pImageIn->GetBands()[i], filterTapX, filterTapY, filterLengthX, filterLengthY, myType );
      pImageOut->AddBand( pGridOut );
   }
   return pImageOut;
}
Image* AdaptiveEnhanceLuong::Run( Image* pSourceImage )
{
   Image* pOutImage = new Image( pSourceImage->GetWidth(), pSourceImage->GetHeight() );

   int nrbands = pSourceImage->GetNumberOfBands();

   for (int bandID = 0; bandID < nrbands; bandID ++ )
   {
      mpSourceGrid = pSourceImage->GetBands()[bandID];
      Initialize( );
      RunSingleGrid( );
      pOutImage->AddBand( mpNextStepGrid->Clone() );
      Cleanup();
   }
   return pOutImage;
}
Image* PyramidDenoise(Image* pImage, int nrScales, int nrOrientations, double noiseLevel)
{
   int nrBands = pImage->GetNumberOfBands();
   
   Image* pFilteredImage = new Image( pImage->GetWidth(), pImage->GetHeight() );
   for (int k =0; k < nrBands; k++)
   {
      PyramidReal np(pImage->GetBands()[k], nrScales, nrOrientations);
      np.Decompose();
      
      PyramidDenoiser pd( np.GetPyramid(), BIVARIATE, noiseLevel);
      pd.Run();
      
      np.Reconstruct();
      pFilteredImage->AddBand( np.GetCopyOfReconstructedGrid() );
   }

   return pFilteredImage;
}
示例#4
0
void ProcessManager::SlotSelectCreateFourierSpectrum()
{
   stira::fouriertools::FFT myFft;
  
   int nrBands = mpImage->GetNumberOfBands();
   int width   = mpImage->GetWidth();
   int height  = mpImage->GetWidth();
   
   Image* pImageOut = new Image( width, height );
   for (int i = 0; i < nrBands; i++)
   {
      ArrayGrid<double>* pSpectrumGrid = myFft.ComputeLogPowerSpectrum ( mpImage->GetBands() [i] );
      pImageOut->AddBand( pSpectrumGrid );
   }
   std::string outName = mpImage->GetImageName() + std::string("-FourierSpectrum");
   pImageOut->SetImageName(outName);

   ImageDataList::GetInstance()->AddImage( pImageOut );
}
示例#5
0
image::Image* MedianFilter::RunHybridMedian( image::Image* pImageIn, int size)
{
   Image* pImageInExtended = ImageTools::MirrorBorder( pImageIn, size, size );

   int nrBands = pImageInExtended->GetNumberOfBands();

   Image* pImageOutExtended = new Image( pImageInExtended->GetWidth(), pImageInExtended->GetHeight() );

   for (int bandNr = 0; bandNr < nrBands; bandNr++)
   {
      ArrayGrid<double>* pGridOut = RunHybridMedian( pImageInExtended->GetBands()[ bandNr ], size );
      pImageOutExtended->AddBand( pGridOut );
   }

   Image* pImageOut = ImageTools::CropBorder( pImageOutExtended, size, size );
   delete pImageInExtended;
   delete pImageOutExtended;
   std::string outName = pImageIn->GetImageName() + std::string("-HybridMedian");
   pImageOut->SetImageName(outName);
   return pImageOut;
}