Correction bug sur no-data + stats "forest managment"

This commit is contained in:
François Merciol 2018-07-18 14:42:21 +02:00
parent 29b9443206
commit 6aafd77873
6 changed files with 13 additions and 6 deletions

View File

@ -22,13 +22,13 @@ PRF_OUT = $(patsubst %, $(OUT_DIR)/%, $(PRF_PRG))
## FLAGS ###############################
# fast and no control
DFLAGS = -O2 -DNDEBUG -DNO_OTB -DINTEL_TBB_THREAD -DBOOST_DISABLE_ASSERTS
#DFLAGS = -O2 -DNDEBUG -DNO_OTB -DINTEL_TBB_THREAD -DBOOST_DISABLE_ASSERTS
# fast but control
#DFLAGS = -O2 -DNDEBUG -DNO_OTB -DINTEL_TBB_THREAD
# debug multi-threaded
#DFLAGS = -g -DENABLE_LOG -DNO_OTB
# debug one thread
#DFLAGS = -g -DENABLE_LOG -DNO_OTB -DTHREAD_DISABLE -DENABLE_SMART_LOG
DFLAGS = -g -DENABLE_LOG -DNO_OTB -DTHREAD_DISABLE -DENABLE_SMART_LOG
IFLAGS = $(DFLAGS) -MMD -I$(HPP_DIR) -I/usr/include/gdal
LFLAGS = -L$(LIB_DIR) -ltriskele -lstdc++ -lpthread -lboost_system -lboost_chrono -lboost_thread -lboost_program_options -lboost_date_time -lboost_serialization -lboost_filesystem -lboost_unit_test_framework -lgdal -ltbb

View File

@ -188,6 +188,7 @@ ArrayTreeBuilder<WeightT, PixelT>::buildTree (Tree &tree, const WeightFunct &wei
// SMART_LOG ("compWeights:" << endl
// << printMap (compWeights, size, 0) << endl << endl
// << tree.printTree (2*leafCount-1));
auto startForest = high_resolution_clock::now ();
if (graphWalker.border.exists ()) {
// merge comp forest
DimImg rootId = 0;
@ -267,7 +268,8 @@ ArrayTreeBuilder<WeightT, PixelT>::buildTree (Tree &tree, const WeightFunct &wei
auto end = high_resolution_clock::now ();
globalTreeStats.addTime (buildSetupStats, duration_cast<duration<double> > (startParent-start).count ());
globalTreeStats.addTime (buildParentsStats, duration_cast<duration<double> > (startMerge-startParent).count ());
globalTreeStats.addTime (buildMergeStats, duration_cast<duration<double> > (startIndex-startMerge).count ());
globalTreeStats.addTime (buildMergeStats, duration_cast<duration<double> > (startForest-startMerge).count ());
globalTreeStats.addTime (buildForestStats, duration_cast<duration<double> > (startIndex-startForest).count ());
globalTreeStats.addTime (buildIndexStats, duration_cast<duration<double> > (startCompress-startIndex).count ());
globalTreeStats.addTime (buildCompressStats, duration_cast<duration<double> > (end-startCompress).count ());
}
@ -417,11 +419,13 @@ ArrayTreeBuilder<WeightT, PixelT>::connectLeaf (DimImg a, DimImg b, const Weight
SMART_LOG ("same parents for: " << a << ", " << b);
return;
}
if (parA == DimImg_MAX) {
if (parB == DimImg_MAX) {
// XXX 20180776 bug fixed parA => parB
swap (a, b);
swap (parA, parB);
SMART_LOG ("swap: " << printComp (parA) << " " << printComp (parB));
}
// XXX parB =? DimImg_MAX
if ((parA == DimImg_MAX || weightFunct.isWeightInf (weight, compWeights[parA])) &&
weightFunct.isWeightInf (weight, compWeights[parB])) {
// upW1 & upW2 : upper

View File

@ -37,6 +37,7 @@ namespace otb {
buildParentsStats,
buildFromTilesStats,
buildMergeStats,
buildForestStats,
buildIndexStats,
buildCompressStats,
buildChildrenStats,

View File

@ -14,5 +14,5 @@ otb::triskele::arrayTree::tileItemName[] = {
std::string
otb::triskele::arrayTree::treeTypeLabels[] = {
"min", "max", "tos"
"min", "max", "tos", "alpha"
};

View File

@ -16,6 +16,7 @@ static string timeTypeLabels [TimeTypeCard] = {
" parents ",
" from tiles ",
" merge ",
" forest mgt. ",
" index ",
" compress ",
" children ",

View File

@ -78,13 +78,14 @@ void apGenerator (Option &option) {
Raster<PixelT> raster;
if (option.border) {
DimChanel bandCount (option.inputImage.getBandCount ());
DimChanel bandCount (option.inputImage.getBandCount ()); // -1); // XXX sans NDVI
for (DimChanel band = 0; band < bandCount; ++band) {
option.inputImage.readBand (raster, band, option.topLeft, option.size);
for (DimImg idx = 0; idx < leafCount; ++idx)
if (raster.getValue (idx))
border.clearBorder (idx);
}
//cerr << "XXX border: " << border.borderCount () << endl;
}
DimChanel chanel = 0;