Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Analyst WebApp
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Insights
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
fidentis
Analyst WebApp
Commits
12421b53
There was an error fetching the commit references. Please try again later.
Commit
12421b53
authored
3 years ago
by
Daniel Schramm
Browse files
Options
Downloads
Patches
Plain Diff
Computation of feature point weights corrected (weighted average used)
parent
0d5d262c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Comparison/src/main/java/cz/fidentis/analyst/visitors/face/HausdorffDistancePrioritized.java
+21
-16
21 additions, 16 deletions
...s/analyst/visitors/face/HausdorffDistancePrioritized.java
with
21 additions
and
16 deletions
Comparison/src/main/java/cz/fidentis/analyst/visitors/face/HausdorffDistancePrioritized.java
+
21
−
16
View file @
12421b53
...
...
@@ -29,8 +29,8 @@ import javax.vecmath.Point3d;
* points separately</li>
* <li>Priorities of the faces' vertices with respect to all the given types
* of feature points merged together</li>
* <li>
Average weighted
Hausdorff distance
with respect to the given types of featu
re
*
point
s for each of the faces' mesh facets</li>
* <li>
Weighted average of
Hausdorff distance
of all vertices within the priority sphe
re
*
of feature points of the given type
s for each of the faces' mesh facets</li>
* </ul>
* This visitor is instantiated with a single k-d tree (either given as the input
* parameter, or automatically created from the triangular mesh).
...
...
@@ -238,24 +238,24 @@ public class HausdorffDistancePrioritized extends HumanFaceVisitor {
}
/**
* For all visited faces' mesh facets, the method returns the
average
weighted Hausdorff distance
*
with respect to the given types of feature points (i.e. the sum of weighted distanc
es
* of the mesh facet's vertices to the source facets
divided by the number of vertices
*
located within the feature point's priority sphere
).
* The
average
weighted
distances are
calculated for each type of feature point separately.
* For all visited faces' mesh facets, the method returns the weighted
average of
Hausdorff distance
*
of all vertices within the priority sphere of feature points of the given typ
es
*
(i.e. the sum of weighted distances
of the mesh facet's vertices to the source facets
*
divided by the sum of their priorities
).
* The weighted
average is
calculated for each type of feature point separately.
*
* Keys in the map contain human faces whose mesh facets were measured with the
* source facets.
* For each human face, there is a map of examined types of feature points.
* Each feature point type then stores a map of the face's mesh facets together with
* the
average
weighted distance
s
of their vertices to the source facets.
* The
average
weighted distance
s are
calculated with respect to the face's feature point
* the weighted
average of
distance of their vertices to the source facets.
* The weighted
average of
distance
is
calculated with respect to the face's feature point
* of the corresponding type.
* <i>If there is no vertex within the priority sphere of a feature point,
* the value of the average weighted Hausdorff distance is {@link Double#NaN}</i>
*
* @return
Average weighted Hausdorff distances with respect to the given types
* of feature points
* @return
Weighted average of Hausdorff distance of all vertices within the priority sphere
* of feature points
of the given types
*/
public
Map
<
HumanFace
,
Map
<
FeaturePointType
,
Map
<
MeshFacet
,
Double
>>>
getFeaturePointWeights
()
{
return
Collections
.
unmodifiableMap
(
featurePointWeights
);
...
...
@@ -370,19 +370,24 @@ public class HausdorffDistancePrioritized extends HumanFaceVisitor {
synchronized
(
this
)
{
/*
* Calculate the average weighted Hausdorff distance for the feature point.
* Calculate the weighted average of Hausdorff distance
* of all vertices within the feature point's priority sphere.
*/
final
List
<
Double
>
facetDistances
=
hausdorffDistances
.
get
(
facet
);
featurePointWeights
.
computeIfAbsent
(
humanFace
,
face
->
new
HashMap
<>())
.
computeIfAbsent
(
featurePointType
,
fPointType
->
new
HashMap
<>())
.
put
(
facet
,
IntStream
.
range
(
0
,
facetDistances
.
size
())
.
filter
(
i
->
facetPriorities
.
get
(
i
)
>
0
)
// Filter out vertices that are outside of the priority sphere
.
mapToDouble
(
i
->
facetDistances
.
get
(
i
)
*
facetPriorities
.
get
(
i
))
.
average
()
.
orElse
(
Double
.
NaN
));
// If there is no vertex in the priority sphere
.
boxed
()
.
collect
(
WeightedAverageCollector
.
toWeightedAverage
(
facetDistances:
:
get
,
facetPriorities:
:
get
))
);
/*
* Merge priorities computed for the current feature point type with the priorities of already computed feature point types.
* Merge priorities computed for the current feature point type
* with the priorities of already computed feature point types.
*/
final
List
<
Double
>
storedFacetPriorities
=
mergedPriorities
.
computeIfAbsent
(
humanFace
,
face
->
new
HashMap
<>())
...
...
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