Skip to content

Commit 0f5d08d

Browse files
committed
Glottal outline fits to x subdivs, neighbor based outlier detection
1 parent 5b86b8e commit 0f5d08d

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

source/GUI/MainMenuWidget.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def __init__(self, viewer_palette, parent=None):
2424
"Tensor Product M5",
2525
[
2626
("Z Subdivisions", "field", 10),
27-
("X Subdivisions", "field", 2),
27+
("X Subdivisions", "field", 4),
2828
("R_0", "field", 0.1), # Again from Scherer, for Silicone: 1.0, 2.5 is good
2929
("T", "field", 0.3),
3030
("psi", "field", 0.0),

source/SurfaceReconstruction.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def generateARAPAnchors(vertices, points, nPointsU, glottalOutlinePoints, x_subd
154154
# Fit glottal out and midline
155155
if glottalOutlinePoints.size != 0:
156156
for i in range(nPointsV):
157-
for j in range(x_subdivisions + 2):
157+
for j in range(x_subdivisions + 3):
158158
controlPointIndex = (x_subdivisions + 2) + j + i*nPointsU
159159
controlPoint = vertices[controlPointIndex]
160160

source/Triangulation.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,14 @@ def triangulationMatNew(camera, laser, laser_correspondences, points_2d, minInte
4343

4444
#Filter NaNs and badly estimated 3-D Positions
4545
worldPositions = worldPositions[distances < 5.0]
46+
47+
# Filter points that have a large distance from neighboring points of the same frame
48+
diff = np.expand_dims(worldPositions, 1) - np.expand_dims(worldPositions, 0)
49+
dist = np.linalg.norm(diff, axis=2)
50+
np.fill_diagonal(dist, np.inf)
51+
sorted_indices = np.argsort(dist, axis=1)
52+
closest_distances = np.take_along_axis(dist, sorted_indices[:, 0:1], axis=1).flatten()
53+
worldPositions = worldPositions[closest_distances < 3.0]
4654

4755
points3D.append((aPoints + ((bPoints - aPoints) / 2.0)))
4856

0 commit comments

Comments
 (0)