Another way if you need more raw speed might be to move the code into a shader:
https://processing.org/tutorials/pshader/
More details would be helpful. Are you trying to track multiple beads like objects – e.g. blob detection, OpenCV? Are you trying to track multiple objects by detecting individual colors, or are you tracking blobs, then checking the colors where the blobs are found? Knowing that the whole region occupied by a black bead is “black” depends a lot on things like scale and lighting conditions – as it can look gray, have a darker hole in the middle, reflect patches of white glare, and also reflect colors from things around it, et cetera. All of the individual pixels of a bead will almost never match its single color.