I am trying to isolate objects of a certain color in an image. Looking at this image, you can see that I have extracted the hue channel, and have filtered these values so that the closer a pixel's hue is to a specified target hue, the brighter the pixel is (0 degrees difference = 255, and 180 degrees difference = 0). However, the results I am getting are not what I expected when comparing it against the source capture in the lower-right corner of the linked image. It seems that if picking green as a target hue, that certain pixels on the orange tape are closer to the target hue, than some pixels on the green tape.
So, I am wondering if I misunderstand what "hue" is, and if there is some other colorspace I should be leveraging, or if there are methods/algorithms out there to detect specific colors. The "banding" that is seen in the image makes me wonder if the camera hardware is doing some sort of compression that is affecting the output. I thought the black pixels might be n/a values in cases where the saturation was 0, however when I isolated the saturation channel to check, this was not the case.