I developed tennis ball tracking project with using OOP concepts I use opencv for image processing and pyqt5 for interface. After that I implemented it for Raspberry pi and use GPIO pins. Deployment on Raspberry pi can be harder than pc because of additional libraries of project requirements.
There is a raspberry pi folder in project folder. There are 5 region represented by a led. In raspberry pi implementation turns on led which represents region of the tennis ball.