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
Container Registry
Model registry
Operate
Environments
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
Main Repositories
otb
Commits
66b1018c
Commit
66b1018c
authored
13 years ago
by
Aurélien Bricier
Browse files
Options
Downloads
Patches
Plain Diff
ENH: prepared class for cost function interfacing + clean the code
parent
4956c4ce
No related branches found
Branches containing commit
No related tags found
Tags containing commit
Loading
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Code/Fuzzy/otbVectorDataToDSValidatedVectorDataFilter.h
+17
-2
17 additions, 2 deletions
Code/Fuzzy/otbVectorDataToDSValidatedVectorDataFilter.h
Code/Fuzzy/otbVectorDataToDSValidatedVectorDataFilter.txx
+4
-18
4 additions, 18 deletions
Code/Fuzzy/otbVectorDataToDSValidatedVectorDataFilter.txx
with
21 additions
and
20 deletions
Code/Fuzzy/otbVectorDataToDSValidatedVectorDataFilter.h
+
17
−
2
View file @
66b1018c
...
...
@@ -136,8 +136,18 @@ public:
if
(
model
.
size
()
!=
4
)
{
itkExceptionMacro
(
<<
"Wrong model!"
)
itkExceptionMacro
(
<<
"Wrong model! Size(="
<<
model
.
size
()
<<
") > 4"
)
}
else
if
(
model
[
0
]
<
0
||
model
[
1
]
<
model
[
0
]
||
model
[
2
]
<
model
[
1
]
||
model
[
2
]
>
1
)
{
itkExceptionMacro
(
<<
"Wrong model! Values have to be 0<=v1<=v2<=v3<=1"
)
}
else
if
(
model
[
3
]
<
.75
||
model
[
3
]
>
1
)
{
itkExceptionMacro
(
<<
"Wrong model! Values have to be 0.75<=v4<=1"
)
}
else
{
for
(
unsigned
j
=
0
;
j
<
nbDescriptor
;
j
++
)
...
...
@@ -152,7 +162,7 @@ public:
}
else
{
itkExceptionMacro
(
<<
"Wrong model!"
)
itkExceptionMacro
(
<<
"Wrong model!
Value must be between 0 and 1
"
)
}
}
}
...
...
@@ -171,6 +181,11 @@ public:
m_Hypothesis
=
hypothesis
;
}
unsigned
int
GetNumberOfParameters
()
{
return
(
m_DescriptorModels
.
size
()
*
4
);
}
protected
:
/** Triggers the Computation */
...
...
This diff is collapsed.
Click to expand it.
Code/Fuzzy/otbVectorDataToDSValidatedVectorDataFilter.txx
+
4
−
18
View file @
66b1018c
...
...
@@ -106,7 +106,6 @@ VectorDataToDSValidatedVectorDataFilter<TVectorData, TPrecision>
}
//Initialize parser
//std::cout << m_CriterionFormula << std::endl;
m_Parser->SetExpr(m_CriterionFormula);
m_Parser->DefineVar("Belief", &m_Bel);
m_Parser->DefineVar("Plausibility", &m_Plau);
...
...
@@ -154,12 +153,6 @@ VectorDataToDSValidatedVectorDataFilter<TVectorData, TPrecision>
mass->SetMass(H, m_FuzzyVars[i]->GetMembership(fuzName, currentGeometry->GetFieldAsDouble(fuzName)));
mass->SetMass(H_, m_FuzzyVars[i]->GetMembership(fuzName_, currentGeometry->GetFieldAsDouble(fuzName)));
/*
std::cout << fuzName << " : " << currentGeometry->GetFieldAsDouble(fuzName)
<< " " << m_FuzzyVars[i]->GetMembership(fuzName, currentGeometry->GetFieldAsInt(fuzName)) << std::endl;
std::cout << fuzName_ << " : " << currentGeometry->GetFieldAsDouble(fuzName)
<< " " << m_FuzzyVars[i]->GetMembership(fuzName_, currentGeometry->GetFieldAsDouble(fuzName)) << std::endl;
*/
mass->EstimateUncertainty();
jointMassFilter->PushBackInput(mass);
...
...
@@ -168,21 +161,14 @@ VectorDataToDSValidatedVectorDataFilter<TVectorData, TPrecision>
jointMassFilter->Update();
m_Bel = jointMassFilter->GetOutput()->GetBelief(m_Hypothesis);
m_Plau = jointMassFilter->GetOutput()->GetPlausibility(m_Hypothesis);
/*
std::cout << "Bel : " << m_Bel << std::endl;
std::cout << "Plau: " << m_Plau << std::endl;
*/
if (m_Parser->Eval())
if (m_Parser->Eval())
{
//std::cout << "Feature Validated : " << m_Parser->Eval() << std::endl;
currentGeometry->SetNodeId(this->GetNextID());
currentGeometry->SetFieldAsDouble("Belief", m_Bel);
currentGeometry->SetFieldAsDouble("Plausi", m_Plau);
this->GetOutput(0)->GetDataTree()->Add(currentGeometry, folder);
}
else
{
//std::cout << "Feature Rejected : " << m_Parser->Eval() << std::endl;
}
//itVector.GoToEnd(); //TEST ONLY###########################################
}
++itVector;
}
...
...
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