Raster segmentation. More...
#include <Segmenter.h>
  
 Classes | |
| class | InputParameters | 
| Segmenter Input Parameters.  More... | |
| class | OutputParameters | 
| Segmenter Output Parameters.  More... | |
| class | SegmenterThreadEntryParams | 
| The parameters passed to the Segmenter::segmenterthreadEntry method.  More... | |
Public Member Functions | |
| bool | execute (AlgorithmOutputParameters &outputParams) throw ( te::rp::Exception ) | 
| Executes the algorithm using the supplied parameters.  More... | |
| bool | initialize (const AlgorithmInputParameters &inputParams) throw ( te::rp::Exception ) | 
| Initialize the algorithm instance making it ready for execution.  More... | |
| bool | isInitialized () const | 
| Returns true if the algorithm instance is initialized and ready for execution.  More... | |
| void | reset () throw ( te::rp::Exception ) | 
| Clear all internal allocated objects and reset the algorithm to its initial state.  More... | |
| Segmenter () | |
| ~Segmenter () | |
Protected Types | |
| typedef te::rp::Matrix < SegmenterSegmentsBlock >  | SegmentsBlocksMatrixT | 
Protected Member Functions | |
| bool | calcBestBlockSize (const unsigned int totalImageLines, const unsigned int totalImageCols, const unsigned int minBlockPixels, const unsigned int maxBlockPixels, const double blocksHOverlapSizePercent, const double blocksVOverlapSizePectent, unsigned int &blockWidth, unsigned int &blockHeight, unsigned int &blocksHOverlapSize, unsigned int &blocksVOverlapSize) const | 
| Calc the best sub-image block size for each thread to process.  More... | |
| bool | createCutOffLinesTiff (const std::vector< std::vector< unsigned int > > &imageHorizontalProfiles, const std::vector< unsigned int > &imageHorizontalProfilesCenterLines, const std::vector< std::vector< unsigned int > > &imageVerticalProfiles, const std::vector< unsigned int > &imageVerticalProfilesCenterLines, const std::string &filename) | 
| bool | genImageHCutOffProfile (const unsigned int profileCenter, const te::rst::Raster &inRaster, const std::vector< unsigned int > &inRasterBands, const unsigned int pixelNeighborhoodSize, const unsigned int tileNeighborhoodSize, const unsigned int profileAntiSmoothingFactor, std::vector< unsigned int > &profile) const | 
| Generate the horizontal cutOff prifles for the entire image..  More... | |
| bool | genImageVCutOffProfile (const unsigned int profileCenter, const te::rst::Raster &inRaster, const std::vector< unsigned int > &inRasterBands, const unsigned int pixelNeighborhoodSize, const unsigned int tileNeighborhoodSize, const unsigned int profileAntiSmoothingFactor, std::vector< unsigned int > &profile) const | 
| Generate the vertical cutOff prifles for the entire image..  More... | |
| bool | updateBlockCutOffProfiles (const std::vector< std::vector< unsigned int > > &imageHorizontalProfiles, const std::vector< std::vector< unsigned int > > &imageVerticalProfiles, SegmenterSegmentsBlock &segmentsBlock) const | 
| Update the block cutOff profiles using the full image profiles.  More... | |
Static Protected Member Functions | |
| static void | segmenterThreadEntry (SegmenterThreadEntryParams *paramsPtr) | 
| Segmenter thread entry.  More... | |
Protected Attributes | |
| Segmenter::InputParameters | m_inputParameters | 
| Segmenter execution parameters.  More... | |
| bool | m_instanceInitialized | 
Raster segmentation.
Raster segmentation following the choosed segmentation strategy.
Definition at line 72 of file Segmenter.h.
      
  | 
  protected | 
Segments blocks matrix type definition
Definition at line 189 of file Segmenter.h.
| te::rp::Segmenter::Segmenter | ( | ) | 
Definition at line 197 of file Segmenter.cpp.
References m_instanceInitialized.
| te::rp::Segmenter::~Segmenter | ( | ) | 
Definition at line 202 of file Segmenter.cpp.
      
  | 
  protected | 
Calc the best sub-image block size for each thread to process.
| totalImageLines | The total original full image lines. | 
| totalImageCols | The total original full image columns. | 
| minBlockPixels | The minimun allowed pixels number for each block (expanded block). | 
| maxBlockPixels | The maximum allowed pixels number for each block (expanded block). | 
| blocksHOverlapSizePercent | The blocks horizontal overlap size percentual related to the non-expanded block horizontal size - valid range[0,1]. | 
| blocksVOverlapSizePectent | The blocks vertical overlap size percentual related to the non-expanded block vertial size - valid range[0,1]. | 
| blockWidth | The calculated block width (non-expanded block). | 
| blockHeight | The calculated block height (non-expanded block). | 
| blocksHOverlapSize | The calculated block horizontal overlap size. | 
| blocksVOverlapSize | The calculated block vertical overlap size. | 
Definition at line 744 of file Segmenter.cpp.
Referenced by execute().
      
  | 
  protected | 
Definition at line 1655 of file Segmenter.cpp.
References te::rst::Raster::getBand(), te::rst::Raster::getGrid(), te::rst::Band::getProperty(), te::rst::GrayIdxCInt, m_inputParameters, te::rp::Segmenter::InputParameters::m_inputRasterBands, te::rp::Segmenter::InputParameters::m_inputRasterPtr, te::rst::RasterFactory::make(), TERP_TRUE_OR_RETURN_FALSE, TERP_TRUE_OR_THROW, and te::dt::UCHAR_TYPE.
      
  | 
  virtual | ||||||||||||||
Executes the algorithm using the supplied parameters.
| outputParams | Output parameters. | 
Implements te::rp::Algorithm.
Definition at line 206 of file Segmenter.cpp.
References te::rp::SegmenterSegmentsBlock::BlockNotProcessed, te::rp::SegmenterSegmentsBlock::BlockSegmented, calcBestBlockSize(), genImageHCutOffProfile(), genImageVCutOffProfile(), te::rst::Raster::getBand(), te::rp::Matrix< TemplateElementType >::getColumnsNumber(), te::rst::Raster::getGrid(), te::rp::Matrix< TemplateElementType >::getLinesNumber(), te::rst::Raster::getNumberOfColumns(), te::rst::Raster::getNumberOfRows(), te::common::GetPhysProcNumber(), te::rst::Band::getProperty(), te::rp::Segmenter::InputParameters::getSegStrategyParams(), te::common::GetTotalPhysicalMemory(), te::common::GetTotalVirtualMemory(), te::common::GetUsedVirtualMemory(), te::rst::Band::getValue(), te::rst::GrayIdxCInt, te::rp::Segmenter::SegmenterThreadEntryParams::m_abortSegmentationFlagPtr, te::rp::Segmenter::SegmenterThreadEntryParams::m_blockProcessedSignalMutexPtr, te::rp::Segmenter::SegmenterThreadEntryParams::m_blockProcessedSignalPtr, te::rp::Segmenter::InputParameters::m_enableBlockMerging, te::rp::Segmenter::InputParameters::m_enableBlockProcessing, te::rp::Segmenter::InputParameters::m_enableProgress, te::rp::Segmenter::SegmenterThreadEntryParams::m_enableStrategyProgress, te::rp::Segmenter::InputParameters::m_enableThreadedProcessing, te::rp::Segmenter::SegmenterThreadEntryParams::m_generalMutexPtr, te::rp::SegmenterSegmentsBlock::m_height, m_inputParameters, te::rp::Segmenter::SegmenterThreadEntryParams::m_inputParametersPtr, te::rp::Segmenter::InputParameters::m_inputRasterBands, te::rp::Segmenter::SegmenterThreadEntryParams::m_inputRasterGainsPtr, te::rp::Segmenter::SegmenterThreadEntryParams::m_inputRasterIOMutexPtr, te::rp::Segmenter::SegmenterThreadEntryParams::m_inputRasterOffsetsPtr, te::rp::Segmenter::InputParameters::m_inputRasterPtr, m_instanceInitialized, te::rp::Segmenter::InputParameters::m_maxBlockSize, te::rp::Segmenter::InputParameters::m_maxSegThreads, te::rp::Segmenter::SegmenterThreadEntryParams::m_outputParametersPtr, te::rp::Segmenter::SegmenterThreadEntryParams::m_outputRasterIOMutexPtr, te::rp::Segmenter::OutputParameters::m_outputRasterPtr, te::rp::Segmenter::SegmenterThreadEntryParams::m_progressPtr, te::rp::Segmenter::OutputParameters::m_rInfo, te::rp::Segmenter::OutputParameters::m_rType, te::rp::Segmenter::SegmenterThreadEntryParams::m_runningThreadsCounterPtr, te::rp::Segmenter::SegmenterThreadEntryParams::m_segmentsIdsManagerPtr, te::rp::SegmenterSegmentsBlock::m_segmentsMatrixXIndex, te::rp::SegmenterSegmentsBlock::m_segmentsMatrixYIndex, te::rp::Segmenter::SegmenterThreadEntryParams::m_segsBlocksMatrixPtr, te::rp::SegmenterSegmentsBlock::m_startX, te::rp::SegmenterSegmentsBlock::m_startY, te::rp::SegmenterSegmentsBlock::m_status, te::rp::Segmenter::InputParameters::m_strategyName, te::rp::SegmenterSegmentsBlock::m_width, te::rst::RasterFactory::make(), te::common::AbstractFactory< te::rp::SegmenterStrategy, std::string, std::less< std::string > >::make(), MAX, MIN, te::rp::Matrix< TemplateElementType >::RAMMemPol, te::rp::Matrix< TemplateElementType >::reset(), segmenterThreadEntry(), TERP_DEBUG_TRUE_OR_THROW, TERP_TRUE_OR_RETURN_FALSE, te::dt::UINT32_TYPE, and updateBlockCutOffProfiles().
Referenced by te::qt::widgets::SegmenterWizardPage::apply(), te::qt::widgets::SegmenterDialog::on_okPushButton_clicked(), and te::idl::rp::RegionGrowingSegmenter().
      
  | 
  protected | 
Generate the horizontal cutOff prifles for the entire image..
| profileCenter | The profile center line. | 
| inRaster | The input raster. | 
| inRasterBands | The input raster bands. | 
| pixelNeighborhoodSize | The pixel neighborhood size over the line transverse to each tile line. | 
| tileNeighborhoodSize | The buffer size around each tile. | 
| profileAntiSmoothingFactor | A positive profile anti-smoothing factor. | 
| profile | The generated profile (each element is a inRaster line index ). | 
Definition at line 1249 of file Segmenter.cpp.
References ABS, te::rst::Raster::getNumberOfBands(), te::rst::Raster::getNumberOfColumns(), te::rst::Raster::getNumberOfRows(), te::rst::Raster::getValue(), MAX, MIN, and TERP_DEBUG_TRUE_OR_THROW.
Referenced by execute().
      
  | 
  protected | 
Generate the vertical cutOff prifles for the entire image..
| profileCenter | The profile center column. | 
| inRaster | The input raster. | 
| inRasterBands | The input raster bands. | 
| pixelNeighborhoodSize | The pixel neighborhood size over the line transverse to each tile line. | 
| tileNeighborhoodSize | The buffer size around each tile. | 
| profileAntiSmoothingFactor | A positive profile anti-smoothing factor. | 
| profile | The generated profile (each element is a inRaster column index ) | 
Definition at line 1385 of file Segmenter.cpp.
References ABS, te::rst::Raster::getNumberOfBands(), te::rst::Raster::getNumberOfColumns(), te::rst::Raster::getNumberOfRows(), te::rst::Raster::getValue(), MAX, MIN, and TERP_DEBUG_TRUE_OR_THROW.
Referenced by execute().
      
  | 
  virtual | ||||||||||||||
Initialize the algorithm instance making it ready for execution.
| inputParams | Input parameters. | 
Implements te::rp::Algorithm.
Definition at line 706 of file Segmenter.cpp.
References te::rst::Raster::getAccessPolicy(), te::rst::Raster::getNumberOfBands(), m_inputParameters, te::rp::Segmenter::InputParameters::m_inputRasterBands, te::rp::Segmenter::InputParameters::m_inputRasterPtr, m_instanceInitialized, te::common::RAccess, reset(), and TERP_TRUE_OR_RETURN_FALSE.
Referenced by te::qt::widgets::SegmenterWizardPage::apply(), te::qt::widgets::SegmenterDialog::on_okPushButton_clicked(), and te::idl::rp::RegionGrowingSegmenter().
      
  | 
  virtual | 
Returns true if the algorithm instance is initialized and ready for execution.
Implements te::rp::Algorithm.
Definition at line 739 of file Segmenter.cpp.
References m_instanceInitialized.
      
  | 
  virtual | |||||||||||||
Clear all internal allocated objects and reset the algorithm to its initial state.
Implements te::rp::Algorithm.
Definition at line 700 of file Segmenter.cpp.
References m_inputParameters, m_instanceInitialized, and te::rp::Segmenter::InputParameters::reset().
Referenced by initialize(), te::rp::Segmenter::InputParameters::InputParameters(), te::rp::Segmenter::InputParameters::operator=(), te::rp::Segmenter::OutputParameters::operator=(), te::rp::Segmenter::OutputParameters::OutputParameters(), te::rp::Segmenter::InputParameters::~InputParameters(), and te::rp::Segmenter::OutputParameters::~OutputParameters().
      
  | 
  staticprotected | 
Segmenter thread entry.
| paramsPtr | A pointer to the segmenter thread parameters. | 
Definition at line 790 of file Segmenter.cpp.
References te::rp::SegmenterSegmentsBlock::BlockNotProcessed, te::rp::SegmenterSegmentsBlock::BlockSegmented, te::rp::SegmenterSegmentsBlock::BlockUnderSegmentation, te::rst::Raster::getBand(), te::rp::Matrix< TemplateElementType >::getColumnsNumber(), te::rst::Raster::getGrid(), te::rp::Matrix< TemplateElementType >::getLinesNumber(), te::rst::Raster::getNumberOfColumns(), te::rst::Raster::getNumberOfRows(), te::rst::Grid::getResolutionX(), te::rst::Grid::getResolutionY(), te::rp::Segmenter::InputParameters::getSegStrategyParams(), te::rst::Grid::getSRID(), te::rst::Band::getValue(), te::rst::GrayIdxCInt, te::rst::Grid::gridToGeo(), te::common::TaskProgress::isActive(), te::rp::Segmenter::SegmenterThreadEntryParams::m_abortSegmentationFlagPtr, te::rp::Segmenter::SegmenterThreadEntryParams::m_blockProcessedSignalMutexPtr, te::rp::Segmenter::SegmenterThreadEntryParams::m_blockProcessedSignalPtr, te::rp::SegmenterSegmentsBlock::m_bottomCutOffProfile, te::rst::BandProperty::m_colorInterp, te::rp::Segmenter::InputParameters::m_enableBlockMerging, te::rp::Segmenter::InputParameters::m_enableBlockProcessing, te::rp::Segmenter::SegmenterThreadEntryParams::m_enableStrategyProgress, te::rp::Segmenter::SegmenterThreadEntryParams::m_generalMutexPtr, te::rp::SegmenterSegmentsBlock::m_height, te::rp::Segmenter::SegmenterThreadEntryParams::m_inputParametersPtr, te::rp::Segmenter::InputParameters::m_inputRasterBands, te::rp::Segmenter::SegmenterThreadEntryParams::m_inputRasterGainsPtr, te::rp::Segmenter::SegmenterThreadEntryParams::m_inputRasterIOMutexPtr, te::rp::Segmenter::SegmenterThreadEntryParams::m_inputRasterOffsetsPtr, te::rp::Segmenter::InputParameters::m_inputRasterPtr, te::rp::SegmenterSegmentsBlock::m_leftCutOffProfile, te::rst::BandProperty::m_noDataValue, te::rp::Segmenter::SegmenterThreadEntryParams::m_outputParametersPtr, te::rp::Segmenter::SegmenterThreadEntryParams::m_outputRasterIOMutexPtr, te::rp::Segmenter::OutputParameters::m_outputRasterPtr, te::rp::Segmenter::SegmenterThreadEntryParams::m_progressPtr, te::rp::SegmenterSegmentsBlock::m_rightCutOffProfile, te::rp::Segmenter::SegmenterThreadEntryParams::m_runningThreadsCounterPtr, te::rp::Segmenter::SegmenterThreadEntryParams::m_segmentsIdsManagerPtr, te::rp::Segmenter::SegmenterThreadEntryParams::m_segsBlocksMatrixPtr, te::rp::SegmenterSegmentsBlock::m_startX, te::rp::SegmenterSegmentsBlock::m_startY, te::rp::SegmenterSegmentsBlock::m_status, te::rp::Segmenter::InputParameters::m_strategyName, te::rp::SegmenterSegmentsBlock::m_topCutOffProfile, te::rp::SegmenterSegmentsBlock::m_width, te::rst::RasterFactory::make(), te::common::AbstractFactory< te::rp::SegmenterStrategy, std::string, std::less< std::string > >::make(), te::common::TaskProgress::pulse(), te::rst::Band::setValue(), TERP_DEBUG_TRUE_OR_THROW, TERP_TRUE_OR_THROW, and te::dt::UINT32_TYPE.
Referenced by execute().
      
  | 
  protected | 
Update the block cutOff profiles using the full image profiles.
| imageVerticalProfiles | The generated horizontal profiles (empty profiles also will be accepted). | 
| horizontalProfiles | The generated vertical profiles (empty profiles also will be accepted). | 
| segmentsBlock | The block to update. | 
Definition at line 1521 of file Segmenter.cpp.
References te::rp::SegmenterSegmentsBlock::m_bottomCutOffProfile, te::rp::SegmenterSegmentsBlock::m_height, te::rp::SegmenterSegmentsBlock::m_leftCutOffProfile, te::rp::SegmenterSegmentsBlock::m_rightCutOffProfile, te::rp::SegmenterSegmentsBlock::m_segmentsMatrixXIndex, te::rp::SegmenterSegmentsBlock::m_segmentsMatrixYIndex, te::rp::SegmenterSegmentsBlock::m_startX, te::rp::SegmenterSegmentsBlock::m_startY, te::rp::SegmenterSegmentsBlock::m_topCutOffProfile, te::rp::SegmenterSegmentsBlock::m_width, MAX, MIN, and TERP_DEBUG_TRUE_OR_THROW.
Referenced by execute().
      
  | 
  protected | 
Segmenter execution parameters.
Definition at line 249 of file Segmenter.h.
Referenced by createCutOffLinesTiff(), execute(), initialize(), and reset().
      
  | 
  protected | 
Definition at line 247 of file Segmenter.h.
Referenced by execute(), initialize(), isInitialized(), reset(), and Segmenter().