Skip to content

Commit 6eb8937

Browse files
authored
Fix body contour panic when looking up (#439)
1 parent 3192eef commit 6eb8937

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

  • yggdrasil/src/vision/body_contour

yggdrasil/src/vision/body_contour/mod.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,6 @@ impl BodyContour {
147147
}
148148

149149
fn is_part_of_chest(chest_points: &ChestPoints, image_coordinate: Point2<f32>) -> bool {
150-
if image_coordinate.x <= chest_points.first().unwrap().x
151-
|| image_coordinate.x >= chest_points.last().unwrap().x
152-
{
153-
return false;
154-
}
155-
156150
for (left_point, right_point) in chest_points.iter().zip(chest_points.iter().skip(1)) {
157151
if image_coordinate.x < right_point.x {
158152
let a = (right_point.y - left_point.y) / (right_point.x - left_point.x);
@@ -161,7 +155,7 @@ impl BodyContour {
161155
}
162156
}
163157

164-
unreachable!();
158+
false
165159
}
166160

167161
// # TODO: This might be too simple for a body part that's not static.

0 commit comments

Comments
 (0)