You need to define the treshold in RGB and process the pixels in the image (hopefully not the whole image, but a smaller area of interest, possibly a moving foreground shape) that are suitable for definition. Something similar to what was discussed here .
I understand that you know the color (or colors) that you want to determine a priori.
Hope this helps.
source
share