From 8fc5c1abe58eff656fa785ed5cdc2dd37ce39bb6 Mon Sep 17 00:00:00 2001 From: Laurens Valk Date: Tue, 4 Jul 2023 16:15:09 +0200 Subject: [PATCH] pybricks/util_pb: Drop s and v adjustment hacks. The newly introduced color cost function intrinsically deals with low s and v, so we don't need to artificially suppress them here. --- pybricks/util_pb/pb_color_map.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/pybricks/util_pb/pb_color_map.c b/pybricks/util_pb/pb_color_map.c index c2caa9936..6e8b506d2 100644 --- a/pybricks/util_pb/pb_color_map.c +++ b/pybricks/util_pb/pb_color_map.c @@ -32,16 +32,6 @@ void pb_color_map_rgb_to_hsv(const pbio_color_rgb_t *rgb, pbio_color_hsv_t *hsv) // Standard conversion pbio_color_rgb_to_hsv(rgb, hsv); - // For very low values, saturation is not reliable - if (hsv->v <= 3) { - hsv->s = 0; - } - - // For very low values, hue is not reliable - if (hsv->s <= 3) { - hsv->h = 0; - } - // Slight shift for lower hues to make yellow somewhat more accurate if (hsv->h < 40) { uint8_t offset = ((hsv->h - 20) << 8) / 20;