Thank you for the reply @Koepel! Sadly I'm afraid none of the suggested solutions will work.
A raspberry will not reach below 50ms latency due to the driver. Since only a single pixel row needs to be monitored, this should be possible with an arduino, provided I can find the right camera module.
The ESP32-CAM (which uses the OV2640 camera module) maxes out at 60fps, and defining a narrow window (Region Of Interest) will not result in higher framerates, according to the datasheet.
@wmarle: I do care about velocity too, the idea is to monitor two or more rows. But I'm starting with one row as a first proof-of-concept :-)
While the project is possible to do with mechanical or electromagnetic sensors, a visual approach is less invasive and easier to install.