Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
otb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Youssefi
otb
Commits
fbb9403c
Commit
fbb9403c
authored
15 years ago
by
Emmanuel Christophe
Browse files
Options
Downloads
Plain Diff
MRG
parents
805e5dca
750e74d6
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Code/Common/otbLabelObjectToPolygonFunctor.h
+3
-1
3 additions, 1 deletion
Code/Common/otbLabelObjectToPolygonFunctor.h
Code/Common/otbLabelObjectToPolygonFunctor.txx
+19
-19
19 additions, 19 deletions
Code/Common/otbLabelObjectToPolygonFunctor.txx
with
22 additions
and
20 deletions
Code/Common/otbLabelObjectToPolygonFunctor.h
+
3
−
1
View file @
fbb9403c
...
...
@@ -66,7 +66,7 @@ public:
* \param labelObject the label object to vectorize
* \return The vectorized label object as a polygon.
*/
inline
Polygon
Pointer
Type
operator
()(
const
LabelObjectType
*
labelObject
);
inline
PolygonType
*
operator
()(
const
LabelObjectType
*
labelObject
);
private:
/// Internal structures
...
...
@@ -109,6 +109,8 @@ private:
/// Walk right to update the finite states machine.
inline
void
WalkRight
(
unsigned
int
line
,
const
IndexType
&
startPoint
,
const
IndexType
&
endPoint
,
PolygonType
*
polygon
,
const
StateType
state
);
PolygonPointerType
m_Polygon
;
// Internal structure to store runs
RunsPerLineVectorType
m_InternalDataSet
;
...
...
This diff is collapsed.
Click to expand it.
Code/Common/otbLabelObjectToPolygonFunctor.txx
+
19
−
19
View file @
fbb9403c
...
...
@@ -43,7 +43,7 @@ LabelObjectToPolygonFunctor<TLabelObject,TPolygon>
template<class TLabelObject, class TPolygon>
inline typename LabelObjectToPolygonFunctor<TLabelObject,TPolygon>
::Polygon
Pointer
Type
::PolygonType
*
LabelObjectToPolygonFunctor<TLabelObject,TPolygon>
::operator()(const LabelObjectType * labelObject)
{
...
...
@@ -52,7 +52,7 @@ LabelObjectToPolygonFunctor<TLabelObject,TPolygon>
m_PositionFlag = LEFT_END;
m_InternalDataSet.clear();
PolygonPointerType p
olygon = PolygonType::New();
m_P
olygon = PolygonType::New();
// Get the internal container
LineContainerType lcontainer = labelObject->GetLineContainer();
...
...
@@ -118,7 +118,7 @@ LabelObjectToPolygonFunctor<TLabelObject,TPolygon>
m_CurrentRun = secondCandidateRun;
m_CurrentState = DOWN_RIGHT;
m_PositionFlag = LEFT_END;
WalkRight(m_CurrentLine-1,m_CurrentPoint,LeftEnd(m_CurrentRun),
p
olygon, m_CurrentState);
WalkRight(m_CurrentLine-1,m_CurrentPoint,LeftEnd(m_CurrentRun),
m_P
olygon, m_CurrentState);
}
else
...
...
@@ -128,7 +128,7 @@ LabelObjectToPolygonFunctor<TLabelObject,TPolygon>
m_CurrentRun = firstCandidateRun;
m_CurrentState = UP_RIGHT;
m_PositionFlag = RIGHT_END;
WalkRight(m_CurrentLine,m_CurrentPoint,RightEnd(m_CurrentRun),
p
olygon, m_CurrentState);
WalkRight(m_CurrentLine,m_CurrentPoint,RightEnd(m_CurrentRun),
m_P
olygon, m_CurrentState);
}
}
...
...
@@ -141,7 +141,7 @@ LabelObjectToPolygonFunctor<TLabelObject,TPolygon>
// Up-Left Case
m_CurrentState = UP_LEFT;
m_PositionFlag = RIGHT_END;
WalkLeft(m_CurrentLine,m_CurrentPoint,RightEnd(secondCandidateRun),
p
olygon, m_CurrentState);
WalkLeft(m_CurrentLine,m_CurrentPoint,RightEnd(secondCandidateRun),
m_P
olygon, m_CurrentState);
m_CurrentLine--;
m_CurrentRun = secondCandidateRun;
}
...
...
@@ -150,7 +150,7 @@ LabelObjectToPolygonFunctor<TLabelObject,TPolygon>
// Down-Left case
m_CurrentState = DOWN_LEFT;
m_PositionFlag = LEFT_END;
WalkLeft(m_CurrentLine,m_CurrentPoint,LeftEnd(m_CurrentRun),
p
olygon, m_CurrentState);
WalkLeft(m_CurrentLine,m_CurrentPoint,LeftEnd(m_CurrentRun),
m_P
olygon, m_CurrentState);
}
}
break;
...
...
@@ -171,7 +171,7 @@ LabelObjectToPolygonFunctor<TLabelObject,TPolygon>
m_CurrentRun = secondCandidateRun;
m_CurrentState = UP_LEFT;
m_PositionFlag = RIGHT_END;
WalkLeft(m_CurrentLine+1,m_CurrentPoint,RightEnd(m_CurrentRun),
p
olygon, m_CurrentState);
WalkLeft(m_CurrentLine+1,m_CurrentPoint,RightEnd(m_CurrentRun),
m_P
olygon, m_CurrentState);
}
else
{
...
...
@@ -180,7 +180,7 @@ LabelObjectToPolygonFunctor<TLabelObject,TPolygon>
m_CurrentRun = firstCandidateRun;
m_CurrentState = DOWN_LEFT;
m_PositionFlag = LEFT_END;
WalkLeft(m_CurrentLine,m_CurrentPoint,LeftEnd(m_CurrentRun),
p
olygon, m_CurrentState);
WalkLeft(m_CurrentLine,m_CurrentPoint,LeftEnd(m_CurrentRun),
m_P
olygon, m_CurrentState);
}
}
...
...
@@ -195,7 +195,7 @@ LabelObjectToPolygonFunctor<TLabelObject,TPolygon>
m_CurrentLine++;
m_CurrentState = DOWN_RIGHT;
m_PositionFlag = LEFT_END;
WalkRight(m_CurrentLine,m_CurrentPoint,LeftEnd(m_CurrentRun),
p
olygon, m_CurrentState);
WalkRight(m_CurrentLine,m_CurrentPoint,LeftEnd(m_CurrentRun),
m_P
olygon, m_CurrentState);
}
else
...
...
@@ -203,7 +203,7 @@ LabelObjectToPolygonFunctor<TLabelObject,TPolygon>
// Up-Right case
m_CurrentState = UP_RIGHT;
m_PositionFlag = RIGHT_END;
WalkRight(m_CurrentLine,m_CurrentPoint,RightEnd(m_CurrentRun),
p
olygon, m_CurrentState);
WalkRight(m_CurrentLine,m_CurrentPoint,RightEnd(m_CurrentRun),
m_P
olygon, m_CurrentState);
}
}
...
...
@@ -223,7 +223,7 @@ LabelObjectToPolygonFunctor<TLabelObject,TPolygon>
m_CurrentState = UP_LEFT;
m_PositionFlag = RIGHT_END;
m_CurrentRun = secondCandidateRun;
WalkLeft(m_CurrentLine+1,m_CurrentPoint,RightEnd(m_CurrentRun),
p
olygon, m_CurrentState);
WalkLeft(m_CurrentLine+1,m_CurrentPoint,RightEnd(m_CurrentRun),
m_P
olygon, m_CurrentState);
}
else
...
...
@@ -233,7 +233,7 @@ LabelObjectToPolygonFunctor<TLabelObject,TPolygon>
m_CurrentRun = firstCandidateRun;
m_CurrentState = DOWN_LEFT;
m_PositionFlag = LEFT_END;
WalkLeft(m_CurrentLine,m_CurrentPoint,LeftEnd(m_CurrentRun),
p
olygon, m_CurrentState);
WalkLeft(m_CurrentLine,m_CurrentPoint,LeftEnd(m_CurrentRun),
m_P
olygon, m_CurrentState);
}
}
...
...
@@ -248,14 +248,14 @@ LabelObjectToPolygonFunctor<TLabelObject,TPolygon>
m_CurrentRun = secondCandidateRun;
m_CurrentState = DOWN_RIGHT;
m_PositionFlag = LEFT_END;
WalkRight(m_CurrentLine,m_CurrentPoint,LeftEnd(m_CurrentRun),
p
olygon, m_CurrentState);
WalkRight(m_CurrentLine,m_CurrentPoint,LeftEnd(m_CurrentRun),
m_P
olygon, m_CurrentState);
}
else
{
// Up-Right case
m_CurrentState = UP_RIGHT;
m_PositionFlag = RIGHT_END;
WalkRight(m_CurrentLine,m_CurrentPoint,RightEnd(m_CurrentRun),
p
olygon, m_CurrentState);
WalkRight(m_CurrentLine,m_CurrentPoint,RightEnd(m_CurrentRun),
m_P
olygon, m_CurrentState);
}
}
...
...
@@ -275,7 +275,7 @@ LabelObjectToPolygonFunctor<TLabelObject,TPolygon>
m_CurrentRun = secondCandidateRun;
m_CurrentState = DOWN_RIGHT;
m_PositionFlag = LEFT_END;
WalkRight(m_CurrentLine-1,m_CurrentPoint,LeftEnd(m_CurrentRun),
p
olygon, m_CurrentState);
WalkRight(m_CurrentLine-1,m_CurrentPoint,LeftEnd(m_CurrentRun),
m_P
olygon, m_CurrentState);
}
else
...
...
@@ -285,7 +285,7 @@ LabelObjectToPolygonFunctor<TLabelObject,TPolygon>
m_CurrentRun = firstCandidateRun;
m_CurrentState = UP_RIGHT;
m_PositionFlag = RIGHT_END;
WalkRight(m_CurrentLine,m_CurrentPoint,RightEnd(m_CurrentRun),
p
olygon, m_CurrentState);
WalkRight(m_CurrentLine,m_CurrentPoint,RightEnd(m_CurrentRun),
m_P
olygon, m_CurrentState);
}
}
else
...
...
@@ -297,7 +297,7 @@ LabelObjectToPolygonFunctor<TLabelObject,TPolygon>
// Up-Left case
m_CurrentState = UP_LEFT;
m_PositionFlag = RIGHT_END;
WalkLeft(m_CurrentLine,m_CurrentPoint,RightEnd(secondCandidateRun),
p
olygon, m_CurrentState);
WalkLeft(m_CurrentLine,m_CurrentPoint,RightEnd(secondCandidateRun),
m_P
olygon, m_CurrentState);
m_CurrentLine--;
m_CurrentRun = secondCandidateRun;
...
...
@@ -307,7 +307,7 @@ LabelObjectToPolygonFunctor<TLabelObject,TPolygon>
// Down-Left case
m_CurrentState = DOWN_LEFT;
m_PositionFlag = LEFT_END;
WalkLeft(m_CurrentLine,m_CurrentPoint,LeftEnd(m_CurrentRun),
p
olygon, m_CurrentState);
WalkLeft(m_CurrentLine,m_CurrentPoint,LeftEnd(m_CurrentRun),
m_P
olygon, m_CurrentState);
}
}
...
...
@@ -317,7 +317,7 @@ LabelObjectToPolygonFunctor<TLabelObject,TPolygon>
goesOn = m_CurrentPoint != m_StartingPoint;
}
return
p
olygon;
return
m_P
olygon;
}
template<class TLabelObject, class TPolygon>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment