Commit 9ef7c889 authored by remi cresson's avatar remi cresson

FIX: Raffaele's patch to handle first empty edge

parent c4115e48
......@@ -145,7 +145,10 @@ namespace grm
typename GraphOperations<TSegmenter>::NodePointerType
GraphOperations<TSegmenter>::CheckLMBF(NodePointerType a, float t)
{
if(a->m_Valid)
// TO FIX: if no-data are present within the image, an edgeless node is possible
// Here we check if the list of edges is empty prior to cost check.
// if(a->m_Valid)
if(a->m_Valid && a->m_Edges.size() > 0)
{
float cost = a->m_Edges.front().m_Cost;
......@@ -174,7 +177,10 @@ namespace grm
typename GraphOperations<TSegmenter>::NodePointerType
GraphOperations<TSegmenter>::CheckBF(NodePointerType a, float t)
{
if(a->m_Valid)
// TO FIX: if no-data are present within the image, an edgeless node is possible
// Here we check if the list of edges is empty prior to cost check.
// if(a->m_Valid)
if(a->m_Valid && a->m_Edges.size() > 0)
{
float cost = a->m_Edges.front().m_Cost;
......
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