Looking for a camera for marble run photo finish

Hi there, I am currently building a cardboard marble run, and using Arduino to control sensors, motors, LEDs... to make it funnier. I would like to film a spot in the middle of the track using a camera, in order to determine which marble arrived first at that point. I'd like to use an algorithm to recognize the marbles on the images in the future, so the image should be as clear as possible.

For compactness, the camera should be about 20cm max away from the spot to film. I am planning to use as many white LEDs as needed to get sufficient lighting. Since the marbles run fast (few cm/s), the camera should be fast enough (at least 60Hz ?), and the field of view of 5*5cm is more than enough.

I have looked for some solutions such as the Raspberry Pi camera V2, but I'm wondering if it is fast enough to capture an image of a moving marble. My smartphone camera (Samsung A6) is producing only blurred images as well.

If somebody has suggestions, I'll be more than happy to read it! Thank you in advance for reading my topic, hopefully it complies with the forum rules.

You need some kind of sufficiently high speed camera. It's a simple as that, but I think you figured that part already. This has obviously nothing to do with Arduinos or related microcontrollers; they can't do much more with cameras than controlling their behaviour.

the key here is differentiation. if you have a blue and a red marble and you can tell the difference at the speeds on the track, then you have the ability to get the results you wanted.

google high speed rpi camera. 660fps frame rates are possible with 3rd party software. 100fps are listed in the specs of some cameras. I think the faster you go, the less color you can resolve. so the trade off is speed vs color.

dave-in-nj: I think the faster you go, the less color you can resolve. so the trade off is speed vs color.

True - some 10, 15 years ago slow motion video of a bullet leaving the barrel of a gun could be done but that was b/w only and required extremely bright lighting; technology has advanced so much nowadays that it can be done in colour. That's tens of thousands or even hundreds of thousands of images per second. In contrast a marble run is very slow.

Such high speed cameras no doubt cost a pretty penny, and are probably overkill for the problem at hand :-)

A camera triggered by a light barrier may be the more sensible solution.