Commit e0fe8022 authored by remicres's avatar remicres

FIX: Use grm::GraphToOTBImage, and fix polygon re-ordering

parent b4326671
......@@ -102,6 +102,13 @@ MergeAllGraphsAndAchieveSegmentation(
LabelImageIterator it(labelImage, labelImage->GetLargestPossibleRegion());
const typename TSegmenter::LabelImageType::InternalPixelType noDataLabel = 0;
typename TSegmenter::LabelImageType::InternalPixelType label = 1;
// Get the maximum label value
for(it.GoToBegin();!it.IsAtEnd(); ++it)
if (it.Get() > label)
label = it.Get();
// Compute LUT
vnl_vector<typename TSegmenter::LabelImageType::InternalPixelType> lut(label,noDataLabel);
for(it.GoToBegin();!it.IsAtEnd(); ++it)
{
......@@ -112,6 +119,8 @@ MergeAllGraphsAndAchieveSegmentation(
label++;
}
}
// Apply LUT
for(it.GoToBegin();!it.IsAtEnd(); ++it)
it.Set(lut[it.Get()]);
......
......@@ -21,7 +21,6 @@
#include "macro-generator.h"
#include "grmSegmenter.h"
#include "lsgrmGraphToOtbImage.h"
namespace lsgrm
{
template<class TSegmenterType>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment