|
OTB
9.0.0
Orfeo Toolbox
|
Go to the documentation of this file.
20 #ifndef otbTrainImagesBase_h
21 #define otbTrainImagesBase_h
67 class TrainFileNamesHandler;
92 const std::vector<std::string>& statisticsFileNames);
109 void ComputeSamplingRate(
const std::vector<std::string>& statisticsFileNames,
const std::string& ratesFileName,
long maximum);
118 const std::vector<std::string>& sampleValidationFileNames);
130 std::string ratesFileName,
SamplingStrategy strategy, std::string selectedField =
"");
154 const std::vector<std::string>& validationVectorFileList = std::vector<std::string>());
174 std::string sampleValidFileName, std::string ratesTrainFileName);
196 if (dedicatedValidation)
206 for (
unsigned int i = 0; i < nbInputs; i++)
208 std::ostringstream oss;
210 std::string strIndex(oss.str());
211 if (dedicatedValidation)
217 sampleOutputs.push_back(outModel +
"_samplesTrain_" + strIndex +
".shp");
223 sampleOutputs.push_back(outModel +
"_samples_" + strIndex +
".shp");
266 if (itksys::SystemTools::FileExists(filePath))
268 size_t posExt = filePath.rfind(
'.');
269 if (posExt != std::string::npos && filePath.compare(posExt, std::string::npos,
".shp") == 0)
271 std::string shxPath = filePath.substr(0, posExt) + std::string(
".shx");
272 std::string dbfPath = filePath.substr(0, posExt) + std::string(
".dbf");
273 std::string prjPath = filePath.substr(0, posExt) + std::string(
".prj");
278 res = itksys::SystemTools::RemoveFile(filePath);
292 #ifndef OTB_MANUAL_INSTANTIATION
296 #endif // otbTrainImagesBase_h
Extracts sample position from an image using a persistent filter.
std::vector< std::string > sampleTrainOutputs
CompositeApplication Superclass
void TrainModel(FloatVectorImageListType *imageList, const std::vector< std::string > &sampleTrainFileNames, const std::vector< std::string > &sampleValidationFileNames)
void ShareClassificationParams()
std::vector< std::string > sampleOutputs
void ComputePolygonStatistics(FloatVectorImageListType *imageList, const std::vector< std::string > &vectorFileNames, const std::vector< std::string > &statisticsFileNames)
std::vector< std::string > sampleValidOutputs
void InitClassification()
void ConnectSamplingParameters()
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
void SelectAndExtractSamples(FloatVectorImageType *image, std::string vectorFileName, std::string sampleFileName, std::string statisticsFileName, std::string ratesFileName, SamplingStrategy strategy, std::string selectedField="")
std::vector< std::string > polyStatTrainOutputs
std::vector< std::string > tmpVectorFileList
itk::SmartPointer< Self > Pointer
bool RemoveFile(std::string &filePath)
This class is a base class for composite applications.
std::map< std::string, TripletType > MapRateType
Base class for the TrainImagesClassifier.
std::vector< std::string > ratesTrainOutputs
SamplingRates ComputeFinalMaximumSamplingRates(bool dedicatedValidation)
void SplitTrainingAndValidationSamples(FloatVectorImageType *image, std::string sampleFileName, std::string sampleTrainFileName, std::string sampleValidFileName, std::string ratesTrainFileName)
void ComputeSamplingRate(const std::vector< std::string > &statisticsFileNames, const std::string &ratesFileName, long maximum)
void CreateTemporaryFileNames(std::string outModel, vcl_size_t nbInputs, bool dedicatedValidation)
otb::OGRDataToSamplePositionFilter< FloatVectorImageType, UInt8ImageType, otb::PeriodicSampler > PeriodicSamplerType
itk::SmartPointer< const Self > ConstPointer
This class is a generic all-purpose wrapping around an std::vector<itk::SmartPointer<ObjectType> >.
void SplitTrainingToValidationSamples(const TrainFileNamesHandler &fileNames, FloatVectorImageListType *imageList)
void ShareSamplingParameters()
std::vector< std::string > polyStatValidOutputs
void SelectAndExtractTrainSamples(const TrainFileNamesHandler &fileNames, FloatVectorImageListType *imageList, std::vector< std::string > vectorFileNames, SamplingStrategy strategy, std::string selectedFieldName="")
Creation of an "otb" vector image which contains metadata.
void SelectAndExtractValidationSamples(const TrainFileNamesHandler &fileNames, FloatVectorImageListType *imageList, const std::vector< std::string > &validationVectorFileList=std::vector< std::string >())
void ConnectClassificationParams()
std::vector< std::string > ratesValidOutputs
otb::SamplingRateCalculator::MapRateType MapRateType