Skip to content

Commit

Permalink
pybricks/util_pb: Drop s and v adjustment hacks.
Browse files Browse the repository at this point in the history
The newly introduced color cost function intrinsically deals with low s and v, so we don't need to artificially suppress them here.
  • Loading branch information
laurensvalk committed Jul 4, 2023
1 parent f63af76 commit 8fc5c1a
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions pybricks/util_pb/pb_color_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8fc5c1a

Please sign in to comment.