Algorithm to track HSV values