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 ############################### ## FLAGS ###############################
# fast and no control # 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 # fast but control
#DFLAGS = -O2 -DNDEBUG -DNO_OTB -DINTEL_TBB_THREAD #DFLAGS = -O2 -DNDEBUG -DNO_OTB -DINTEL_TBB_THREAD
# debug multi-threaded # debug multi-threaded
#DFLAGS = -g -DENABLE_LOG -DNO_OTB #DFLAGS = -g -DENABLE_LOG -DNO_OTB
# debug one thread # 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 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 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 // SMART_LOG ("compWeights:" << endl
// << printMap (compWeights, size, 0) << endl << endl // << printMap (compWeights, size, 0) << endl << endl
// << tree.printTree (2*leafCount-1)); // << tree.printTree (2*leafCount-1));
auto startForest = high_resolution_clock::now ();
if (graphWalker.border.exists ()) { if (graphWalker.border.exists ()) {
// merge comp forest // merge comp forest
DimImg rootId = 0; DimImg rootId = 0;
@ -267,7 +268,8 @@ ArrayTreeBuilder<WeightT, PixelT>::buildTree (Tree &tree, const WeightFunct &wei
auto end = high_resolution_clock::now (); auto end = high_resolution_clock::now ();
globalTreeStats.addTime (buildSetupStats, duration_cast<duration<double> > (startParent-start).count ()); globalTreeStats.addTime (buildSetupStats, duration_cast<duration<double> > (startParent-start).count ());
globalTreeStats.addTime (buildParentsStats, duration_cast<duration<double> > (startMerge-startParent).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 (buildIndexStats, duration_cast<duration<double> > (startCompress-startIndex).count ());
globalTreeStats.addTime (buildCompressStats, duration_cast<duration<double> > (end-startCompress).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); SMART_LOG ("same parents for: " << a << ", " << b);
return; return;
} }
if (parA == DimImg_MAX) { if (parB == DimImg_MAX) {
// XXX 20180776 bug fixed parA => parB
swap (a, b); swap (a, b);
swap (parA, parB); swap (parA, parB);
SMART_LOG ("swap: " << printComp (parA) << " " << printComp (parB)); SMART_LOG ("swap: " << printComp (parA) << " " << printComp (parB));
} }
// XXX parB =? DimImg_MAX
if ((parA == DimImg_MAX || weightFunct.isWeightInf (weight, compWeights[parA])) && if ((parA == DimImg_MAX || weightFunct.isWeightInf (weight, compWeights[parA])) &&
weightFunct.isWeightInf (weight, compWeights[parB])) { weightFunct.isWeightInf (weight, compWeights[parB])) {
// upW1 & upW2 : upper // upW1 & upW2 : upper

View File

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

View File

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

View File

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

View File

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