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... | |
| const std::string & | getErrorMessage () const |
| Return the current error message if there is any. 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 minExapandedBlockPixels, const unsigned int maxExapandedBlockPixels, unsigned int &blocksHOverlapSize, unsigned int &blocksVOverlapSize, unsigned int &nonExpandedBlockWidth, unsigned int &nonExpandedBlockHeight, unsigned int &expandedBlockWidth, unsigned int &expandedBlockHeight) 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... | |
| void | setErrorMessage (const std::string &newErrorMessage) |
| Set the current error message. 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 73 of file src/terralib/rp/Segmenter.h.
|
protected |
Segments blocks matrix type definition
Definition at line 194 of file src/terralib/rp/Segmenter.h.
| te::rp::Segmenter::Segmenter | ( | ) |
Definition at line 194 of file src/terralib/rp/Segmenter.cpp.
References m_instanceInitialized, and ~Segmenter().
|
default |
Referenced by Segmenter().
|
protected |
Calc the best sub-image block size for each thread to process.
| minBlockPixels | The minimun allowed pixels number for each block (expanded block). |
| maxBlockPixels | The maximum allowed pixels number for each block (expanded block). |
| blocksHOverlapSize | The blocks horizontal overlap size (number of columns). |
| blocksVOverlapSize | The blocks vertical overlap size (number of rows). |
| nonExpandedBlockWidth | The calculated non-expanded block width (non-expanded block). |
| nonExpandedBlockHeight | The calculated non-expanded block height (non-expanded block). |
| expandedBlockWidth | The calculated expanded block width (non-expanded block). |
| expandedBlockHeight | The calculated expanded block height (non-expanded block). |
Definition at line 845 of file src/terralib/rp/Segmenter.cpp.
References te::rst::Raster::getNumberOfColumns(), te::rst::Raster::getNumberOfRows(), te::rp::Segmenter::InputParameters::m_blocksOverlapPercent, m_inputParameters, te::rp::Segmenter::InputParameters::m_inputRasterPtr, and TERP_TRUE_OR_THROW.
Referenced by execute().
|
protected |
Definition at line 1570 of file src/terralib/rp/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 201 of file src/terralib/rp/Segmenter.cpp.
References band, te::rp::SegmenterSegmentsBlock::BlockNotProcessed, te::rp::SegmenterSegmentsBlock::BlockSegmented, calcBestBlockSize(), col, genImageHCutOffProfile(), genImageVCutOffProfile(), te::rst::Raster::getBand(), te::rst::Band::getBlockSize(), 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::rp::SegmenterStrategy::GradientMerging, 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_blocksOverlapPercent, te::rp::SegmenterSegmentsBlock::m_bottomCutOffProfile, te::rp::Segmenter::InputParameters::m_enableBlockProcessing, te::rp::Segmenter::InputParameters::m_enableProgress, te::rp::Segmenter::InputParameters::m_enableRasterCache, te::rp::Segmenter::SegmenterThreadEntryParams::m_enableStrategyProgress, te::rp::Segmenter::InputParameters::m_enableThreadedProcessing, te::rp::Segmenter::SegmenterThreadEntryParams::m_generalMutexPtr, te::rp::SegmenterSegmentsBlock::m_height, te::rp::Segmenter::SegmenterThreadEntryParams::m_inputParameters, m_inputParameters, te::rp::Segmenter::SegmenterThreadEntryParams::m_inputRasterBandMaxValues, te::rp::Segmenter::SegmenterThreadEntryParams::m_inputRasterBandMinValues, te::rp::Segmenter::InputParameters::m_inputRasterBands, te::rp::Segmenter::InputParameters::m_inputRasterNoDataValues, te::rp::Segmenter::SegmenterThreadEntryParams::m_inputRasterNoDataValues, te::rp::Segmenter::InputParameters::m_inputRasterPtr, te::rp::Segmenter::SegmenterThreadEntryParams::m_inputRasterSyncPtr, m_instanceInitialized, te::rp::SegmenterSegmentsBlock::m_leftCutOffProfile, te::rp::Segmenter::InputParameters::m_maxBlockSize, te::rp::Segmenter::SegmenterThreadEntryParams::m_maxInputRasterCachedBlocks, te::rp::Segmenter::InputParameters::m_maxSegThreads, te::rst::BandProperty::m_noDataValue, te::rp::Segmenter::SegmenterThreadEntryParams::m_outputParametersPtr, te::rp::Segmenter::OutputParameters::m_outputRasterPtr, te::rp::Segmenter::SegmenterThreadEntryParams::m_outputRasterSyncPtr, te::rp::SegmenterSegmentsBlock::m_rightCutOffProfile, 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::Segmenter::SegmenterThreadEntryParams::m_threadErrorMessagePtr, 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(), MIN, nCols, te::common::RAccess, te::rp::Matrix< TemplateElementType >::RAMMemPol, te::rp::Matrix< TemplateElementType >::reset(), segmenterThreadEntry(), te::rst::Band::setValue(), TERP_DEBUG_TRUE_OR_THROW, TERP_INSTANCE_TRUE_OR_RETURN_FALSE, te::dt::UINT32_TYPE, updateBlockCutOffProfiles(), and te::common::WAccess.
Referenced by te::qt::widgets::SegmenterWizardPage::apply(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_SUITE(), te::qt::widgets::SegmenterDialog::on_okPushButton_clicked(), te::idl::rp::RegionGrowingSegmenter(), Segmenter(), and SegmentImage().
|
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 1082 of file src/terralib/rp/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 1226 of file src/terralib/rp/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().
|
inherited |
Return the current error message if there is any.
Definition at line 44 of file rp/Algorithm.cpp.
References te::rp::Algorithm::m_errorMessage.
Referenced by te::qt::widgets::FilterDialogForm::applyPreview(), te::qt::widgets::PostClassificationWidget::execute(), te::qt::widgets::ClassifierWizard::execute(), te::qt::widgets::MixtureModelWizard::execute(), te::qt::widgets::ContrastDialogForm::execute(), te::qt::widgets::FilterDialogForm::execute(), te::qt::widgets::ArithmeticOpDialogForm::execute(), te::qt::widgets::MosaicWizard::executeGeoMosaic(), te::qt::widgets::FusionWizard::executeIHS(), te::qt::widgets::FusionWizard::executePCA(), te::qt::widgets::MosaicWizard::executeSequenceMosaic(), te::qt::widgets::MosaicWizard::executeTiePointMosaic(), and te::qt::widgets::FusionWizard::executeWisper().
|
virtual | ||||||||||||||
Initialize the algorithm instance making it ready for execution.
| inputParams | Input parameters. |
Implements te::rp::Algorithm.
Definition at line 801 of file src/terralib/rp/Segmenter.cpp.
References te::rst::Raster::getAccessPolicy(), te::rst::Raster::getNumberOfBands(), te::rp::Segmenter::InputParameters::m_blocksOverlapPercent, m_inputParameters, te::rp::Segmenter::InputParameters::m_inputRasterBands, te::rp::Segmenter::InputParameters::m_inputRasterNoDataValues, te::rp::Segmenter::InputParameters::m_inputRasterPtr, m_instanceInitialized, te::common::RAccess, te::rp::Segmenter::InputParameters::reset(), and TERP_INSTANCE_TRUE_OR_RETURN_FALSE.
Referenced by te::qt::widgets::SegmenterWizardPage::apply(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_SUITE(), te::qt::widgets::SegmenterDialog::on_okPushButton_clicked(), te::idl::rp::RegionGrowingSegmenter(), Segmenter(), and SegmentImage().
|
virtual |
Returns true if the algorithm instance is initialized and ready for execution.
Implements te::rp::Algorithm.
Definition at line 840 of file src/terralib/rp/Segmenter.cpp.
References m_instanceInitialized.
|
virtual | |||||||||||||
Clear all internal allocated objects and reset the algorithm to its initial state.
Reimplemented from te::rp::Algorithm.
Definition at line 793 of file src/terralib/rp/Segmenter.cpp.
References m_inputParameters, m_instanceInitialized, te::rp::Algorithm::reset(), and te::rp::Segmenter::InputParameters::reset().
|
staticprotected |
Segmenter thread entry.
| paramsPtr | A pointer to the segmenter thread parameters. |
Definition at line 893 of file src/terralib/rp/Segmenter.cpp.
References te::rp::SegmenterSegmentsBlock::BlockNotProcessed, te::rp::SegmenterSegmentsBlock::BlockSegmented, te::rp::SegmenterSegmentsBlock::BlockUnderSegmentation, te::rp::Matrix< TemplateElementType >::getColumnsNumber(), te::rp::Matrix< TemplateElementType >::getLinesNumber(), te::rp::Segmenter::InputParameters::getSegStrategyParams(), te::rp::Segmenter::SegmenterThreadEntryParams::m_abortSegmentationFlagPtr, te::rp::Segmenter::SegmenterThreadEntryParams::m_blockProcessedSignalMutexPtr, te::rp::Segmenter::SegmenterThreadEntryParams::m_blockProcessedSignalPtr, te::rp::Segmenter::SegmenterThreadEntryParams::m_enableStrategyProgress, te::rp::Segmenter::SegmenterThreadEntryParams::m_generalMutexPtr, te::rp::Segmenter::SegmenterThreadEntryParams::m_inputParameters, te::rp::Segmenter::SegmenterThreadEntryParams::m_inputRasterBandMaxValues, te::rp::Segmenter::SegmenterThreadEntryParams::m_inputRasterBandMinValues, te::rp::Segmenter::InputParameters::m_inputRasterBands, te::rp::Segmenter::SegmenterThreadEntryParams::m_inputRasterNoDataValues, te::rp::Segmenter::SegmenterThreadEntryParams::m_inputRasterSyncPtr, te::rp::Segmenter::SegmenterThreadEntryParams::m_maxInputRasterCachedBlocks, te::rp::Segmenter::SegmenterThreadEntryParams::m_outputParametersPtr, te::rp::Segmenter::SegmenterThreadEntryParams::m_outputRasterSyncPtr, te::rp::Segmenter::SegmenterThreadEntryParams::m_runningThreadsCounterPtr, te::rp::Segmenter::SegmenterThreadEntryParams::m_segmentsIdsManagerPtr, te::rp::Segmenter::SegmenterThreadEntryParams::m_segsBlocksMatrixPtr, te::rp::SegmenterSegmentsBlock::m_status, te::rp::Segmenter::InputParameters::m_strategyName, te::rp::Segmenter::SegmenterThreadEntryParams::m_threadErrorMessagePtr, te::common::AbstractFactory< te::rp::SegmenterStrategy, std::string, std::less< std::string > >::make(), TERP_DEBUG_TRUE_OR_THROW, and TERP_TRUE_OR_THROW.
Referenced by execute().
|
protectedinherited |
Set the current error message.
| newErrorMessage | New error message; |
Definition at line 49 of file rp/Algorithm.cpp.
References te::rp::Algorithm::m_errorMessage.
|
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 1370 of file src/terralib/rp/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, and MIN.
Referenced by execute().
|
protected |
Segmenter execution parameters.
Definition at line 260 of file src/terralib/rp/Segmenter.h.
Referenced by calcBestBlockSize(), createCutOffLinesTiff(), execute(), initialize(), reset(), and te::rp::Segmenter::SegmenterThreadEntryParams::SegmenterThreadEntryParams().
|
protected |
Definition at line 258 of file src/terralib/rp/Segmenter.h.
Referenced by execute(), initialize(), isInitialized(), reset(), and Segmenter().