Need some advice please

Hello everyone,

I want to embark on the openCV adventure!
I have a project in mind, but I have a few questions…
Could someone try to answer it please?

imagine a camera vertical to a soccer ball.
this ball is on a lawn (green in principle!)
I can impose the color of the ball eventually.

the goal would be to detect as quickly as possible when a person shoots the ball.
the precise moment when the ball disappears from its initial position.
when the detection is made, activate a logic output.

the system could be on an SBC card such as Nvidia Jetson, Raspberry PI 4, or any other.
the camera can be a fast model (more than 25 frames/seconds).
she could zoom in on the balon in order to see only this one or almost (if necessary).

1/ what would be the reaction time of such a system?
2/ would a POC be feasible in PYTHON with the libraries available in openCV?
3/ a standard camera will provide 25 images/second. i.e. 1 image every 40ms.
by choosing a faster camera, can we obtain a reaction time of the order of a millisecond, or even less?
4/ can you recommend a performing SBC compatible with openCV?
5/ can you recommend a fast USB3 camera compatible with openCV?

thanks for any advice, regards

1 Like


nobody to help me to clarify my doubts ?

thanks for any tips, regards

more than 60 readings and no feedback…?
am I wrong in using openCV ?

thanks, regards

It’s very specific, and has many sub questions, some of which would probably just need to be tested. OpenCV is a very powerful tool, and it can definitely do this, find the ball using whatever logic you propose (X,Y) (green ball may be a bad idea because grass) and check each frame if the ball has moved (X,Y will change).

  1. Theoretically with a 25 frame per second camera you could get reaction times of up to 0.04s or 40 milliseconds, not inclusive of processing time, which, with good enough hardware, should be fast depending on your operations, easily sub 10 milliseconds. If we account for some error here and there, I’d be confident in saying you could detect if the ball has moved within 100ms of it actually moving.

  2. You can definitely create a proof of concept in Python for this.

  3. Incredibly unlikely, would require serious optimization, and most likely using C++ rather than Python (faster). The most limiting factor will be the FPS of the camera.

  4. RaspPi 4B, can run OpenCV with Python, though definitely not the ideal solution, may not be quick enough for your application.

  5. You’ll just have to look around–



you ask questions that have no clear answers.

you also ask questions that can be answered with research (googling) and/or simply doing it (experiments).

if you want to detect a ball getting kicked, use proper sensors for that, not cameras. there you have a chance to react in milliseconds or even microseconds. “proper” would be electronics based on an accelerometer, or photoelectric barriers/reflectors, or radio/radar.

do you know what reaction time you require? do you even have that requirement?

please look up the difference between “soft” real-time and “hard” real-time. you seem to have a soft real-time situation, so you need to figure out what reaction time is how (un)acceptable.

(1) depends on A LOT of things. the data path MAY OR MAY NOT introduce latency of a frame or more. obviously the sensor needs to be exposed first. if you had the money to spend on high performance systems, you could start processing the frame as soon as it is transmitted. usually, no, you have to wait for it to be done transmitting, and then you can process.

(2) yes.

(3) assuming no needless buffering, frame rate doesn’t matter, except for the interval between frames in which you don’t get any update about the world, if you know what I mean. data transmission rate matters, a little. so, no, higher frame rate does not magically make things better, it just increases the amount of data you have to process. it’s not magic. please research this. do not cargocult this.

(4) get something in the raspberry pi class of SBCs. that’s sufficient. that’s the best option for beginners. doesn’t have to be an rpi 4B. any rpi or similar device would do. Nvidia Jetson is fine too, probably better.

(5) you don’t need it. if you needed it, you wouldn’t have asked the previous questions. get any decent USB (2) webcam. logitech c270 are usually cheap and they’re okay. C920 are overrated. if you have a RPI, get an arducam or whatever they call themselves. those are smartphone cameras on a PCB, with a CSI ribbon. they sell them for less than a logitech C920

thank’s a lot guys for your reply.

so i understand that the reaction time will not be proportionnal to the FPS of the camera.
then no chance to go under 1ms of reaction time, even with a faster camera and a a powerfull SBC.

even with a camera that give me 100 frames/sec, i will not acheive that reaction time i need.

as i have no experience with openCV, i asked before trying any POC !