Skip to content

Commit 5383bc6

Browse files
committed
Swapped vent color and lowered area tresholds to handle overlapping arrows
1 parent 9614068 commit 5383bc6

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

joystick-mapper-among-us/src/vent.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ pub fn select_vent(
2828
let mut mask_emergency: Mat = Mat::default();
2929
let mut mask_all = Mat::default();
3030
// venting arrows have two colors, this will give us, half an arrow
31-
let target = (184, 179, 169);
31+
let target = (218, 215, 209); // the dark part of the arrow is 184, 179, 169
3232
// during an emergency the screen flashes red changing the color of the arrow
33-
let target_emergency = (116, 112, 201);
33+
let target_emergency = (137, 135, 226); // the dark part of the arrow is 116, 112, 201
3434
let delta = 1;
3535
let lower_color_mat = Mat::new_from_bytes(1, 4, CV_8UC1, &[target.0 - delta, target.1 - delta, target.2 - delta, 255]);
3636
let upper_color_mat = Mat::new_from_bytes(1, 4, CV_8UC1, &[target.0 + delta, target.1 + delta, target.2 + delta, 255]);
@@ -83,7 +83,7 @@ pub fn select_vent(
8383
vents.sort_by(|a, b| b.0.partial_cmp(&a.0).expect("NaN sorting vents by area"));
8484
let max_area = vents[0].0;
8585
for (i, vent) in vents.iter().enumerate() {
86-
if vent.0 / max_area < 0.9 {
86+
if vent.0 / max_area < 0.5 {
8787
vents.truncate(i);
8888
break;
8989
}

0 commit comments

Comments
 (0)