Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Cresson Remi
LSGRM
Commits
b10ece1b
Commit
b10ece1b
authored
Sep 01, 2016
by
remicres
Browse files
FIX: compute remaining number of iterations
parent
ce05ae95
Changes
1
Hide whitespace changes
Inline
Side-by-side
include/lsgrmController.txx
View file @
b10ece1b
...
...
@@ -96,9 +96,6 @@ void Controller<TSegmenter>::RunSegmentation()
m_TileHeight,
isFusion);
// Update the given number of iterations
numberOfIterationsRemaining -= m_NumberOfFirstIterations;
#ifdef OTB_USE_MPI
// Gathering useful variables
GatherUsefulVariables(accumulatedMemory, isFusion);
...
...
@@ -107,20 +104,9 @@ void Controller<TSegmenter>::RunSegmentation()
// Time monitoring
ShowTime(t);
std::cout << "accumulatedMemory=" << accumulatedMemory << std::endl;
while(accumulatedMemory > m_Memory && isFusion)
{
if (numberOfIterationsRemaining < numberOfIterationsForPartialSegmentations)
{
numberOfIterationsForPartialSegmentations = numberOfIterationsRemaining;
numberOfIterationsRemaining = 0;
}
else
{
numberOfIterationsRemaining -= numberOfIterationsForPartialSegmentations;
}
isFusion = false;
accumulatedMemory = RunPartialSegmentation<TSegmenter>(
m_SpecificParameters,
...
...
@@ -134,6 +120,9 @@ void Controller<TSegmenter>::RunSegmentation()
m_InputImage->GetNumberOfComponentsPerPixel(),
isFusion);
std::cout << "accumulatedMemory=" << accumulatedMemory << std::endl;
#ifdef OTB_USE_MPI
// Gathering useful variables
GatherUsefulVariables(accumulatedMemory, isFusion);
...
...
@@ -142,8 +131,15 @@ void Controller<TSegmenter>::RunSegmentation()
// Time monitoring
ShowTime(t);
if (numberOfIterationsRemaining == 0)
// Update number of remaining iterations
if (numberOfIterationsRemaining < numberOfIterationsForPartialSegmentations)
{
break;
}
else
{
numberOfIterationsRemaining -= numberOfIterationsForPartialSegmentations;
}
}
#ifdef OTB_USE_MPI
...
...
@@ -196,7 +192,7 @@ void Controller<TSegmenter>::RunSegmentation()
TSegmenter segmenter;
segmenter.SetParam(m_SpecificParameters);
segmenter.SetThreshold(m_Threshold);
segmenter.SetDoFastSegmentation(
tru
e);
segmenter.SetDoFastSegmentation(
fals
e);
segmenter.SetNumberOfIterations(m_NumberOfIterations);
segmenter.SetInput(m_InputImage);
segmenter.Update();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment