Skip to content
Snippets Groups Projects
Commit 7cf3d06d authored by Guillaume Pasero's avatar Guillaume Pasero
Browse files

BUG: Mantis-942: missing rounding when translating continuous index to index

parent ff662637
No related branches found
No related tags found
No related merge requests found
......@@ -39,7 +39,7 @@ PolyLineImageConstIterator<TImage, TPath>
IndexType source, target;
for (unsigned int i = 0; i < ImageType::ImageDimension; ++i)
{
source[i] = static_cast<unsigned int> (m_InternalVertexIterator.Value()[i]);
source[i] = static_cast<unsigned int> (vcl_floor(m_InternalVertexIterator.Value()[i] + 0.5));
}
++m_InternalVertexIterator;
if (m_InternalVertexIterator != m_Path->GetVertexList()->End())
......@@ -47,7 +47,7 @@ PolyLineImageConstIterator<TImage, TPath>
for (unsigned int i = 0; i < ImageType::ImageDimension; ++i)
{
target[i] = static_cast<unsigned int> (m_InternalVertexIterator.Value()[i]);
target[i] = static_cast<unsigned int> (vcl_floor(m_InternalVertexIterator.Value()[i] + 0.5));
}
}
else
......@@ -78,7 +78,7 @@ PolyLineImageConstIterator<TImage, TPath>
IndexType source, target;
for (unsigned int i = 0; i < ImageType::ImageDimension; ++i)
{
source[i] = static_cast<unsigned int> (m_InternalVertexIterator.Value()[i]);
source[i] = static_cast<unsigned int> (vcl_floor(m_InternalVertexIterator.Value()[i] + 0.5));
}
++m_InternalVertexIterator;
if (m_InternalVertexIterator != m_Path->GetVertexList()->End())
......@@ -86,7 +86,7 @@ PolyLineImageConstIterator<TImage, TPath>
for (unsigned int i = 0; i < ImageType::ImageDimension; ++i)
{
target[i] = static_cast<unsigned int> (m_InternalVertexIterator.Value()[i]);
target[i] = static_cast<unsigned int> (vcl_floor(m_InternalVertexIterator.Value()[i] + 0.5));
}
}
else
......@@ -110,7 +110,7 @@ PolyLineImageConstIterator<TImage, TPath>
IndexType source;
for (unsigned int i = 0; i < ImageType::ImageDimension; ++i)
{
source[i] = static_cast<unsigned int> (m_InternalVertexIterator.Value()[i]);
source[i] = static_cast<unsigned int> (vcl_floor(m_InternalVertexIterator.Value()[i] + 0.5));
}
// otbMsgDebugMacro(<<"Source: "<<source);
++m_InternalVertexIterator;
......@@ -119,7 +119,7 @@ PolyLineImageConstIterator<TImage, TPath>
IndexType target;
for (unsigned int i = 0; i < ImageType::ImageDimension; ++i)
{
target[i] = static_cast<unsigned int> (m_InternalVertexIterator.Value()[i]);
target[i] = static_cast<unsigned int> (vcl_floor(m_InternalVertexIterator.Value()[i] + 0.5));
}
// otbMsgDebugMacro(<<"Target: "<<target);
m_InternalImageIterator = InternalImageIteratorType(const_cast<ImageType *> (m_Image.GetPointer()), source,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment