Commit 9f8abd77 authored by remicres's avatar remicres

ADD: implementation of the baatzSegmenter node memory computation

parent 3a0877d5
......@@ -94,6 +94,7 @@ namespace lsrm
float ComputeMergingCost(NodePointerType n1, NodePointerType n2);
void UpdateSpecificAttributes(NodePointerType n1, NodePointerType n2);
void InitFromImage();
unsigned int GetNodeMemory(unsigned int nEdges);
};
} // end of namespace lsrm
......
......@@ -129,6 +129,21 @@ namespace lsrm
this->m_Complete = !prev_merged;
}
}
template<class TImage>
unsigned int
BaatzSegmenter<TImage>::GetNodeMemory(unsigned int nEdges)
{
unsigned int nBands = this->m_InputImage->GetNumberOfComponentsPerPixel();
long long unsigned int memory = 0;
memory += sizeof(NodePointerType); // size of the node pointer
memory += sizeof(NodeType); // size of the node
memory += 4 * nBands * sizeof(float); // size of the 4 attributes, multiplied by the nb. of bands
memory += nEdges * sizeof(EdgeType); // size of the edges
return memory;
}
} // end of namespace lsrm
#endif
......
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