From c72e8f4fc5e5ebb4a823c3a836ff8b431ebc1c09 Mon Sep 17 00:00:00 2001 From: Raffaele Gaetano <raffaele.gaetano@cirad.fr> Date: Wed, 11 Apr 2018 20:17:37 +0200 Subject: [PATCH] FIX: first object had label zero (now labeling starts from one) --- include/otbStreamingGraphToImageFilter.txx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/otbStreamingGraphToImageFilter.txx b/include/otbStreamingGraphToImageFilter.txx index 0332f54..431f7d9 100644 --- a/include/otbStreamingGraphToImageFilter.txx +++ b/include/otbStreamingGraphToImageFilter.txx @@ -135,7 +135,7 @@ StreamingGraphToImageFilter<TGraph, TLabelImage> try { index[0] = (unsigned int)(pix % (std::size_t)(m_OutputSize[0])); index[1] = (unsigned int)(pix / (std::size_t)(m_OutputSize[0])); - labelImage->SetPixel(index, res.second); + labelImage->SetPixel(index, res.second + 1); } catch (std::exception e) { std::cout << "Pixel ID: " << pix << std::endl; std::cout << "Derived index: " << index[0] << "," << index[1] << std::endl; -- GitLab