Better: cast the image to HSL (hue, saturation, and luminance) and use the color threshold to select only the pixels that match the ball. The result is a binary image that will be zero everywhere except where the color matches your criteria. Send that image to Particle Report to the the location of the matching regions, as well as other information, like their size, that you can use to determine which objects are balls. The Vision White Paper should be helpful here, although it is mostly about finding the reflective targets above the baskets:
https://decibel.ni.com/content/docs/DOC-20173
You may also find this tutorial helpful:
https://decibel.ni.com/content/docs/DOC-14726. It's all about picking out specific colored objects in an image. (It uses Vision Assistant, which I don't like, but may be helpful if you are new to image processing. Once you are more experienced, you will probably find it faster to write the code directly.)