Detecting a moving ball in images
In a first step, a time series of images are resized to a smaller dimension, and the smaller images are fed into a first classifier that is trained to classify as a ball any objects in the smaller images that resemble a ball. In a second step, the smaller images are mapped back to the series of images, and regions in the series of images that contain the mapped ball are cropped from the series of images. The mapped ball is shifted based on a velocity of the mapped ball in the cropped regions, and the second classifier regresses center coordinates and a radius of the shifted ball, classifies whether the shifted ball is the ball based on a confidence score, and updates the shifted ball in the cropped regions based on the regressed center coordinates and radius.
1 . A method comprising:
capturing a time series of images;
resizing the time series of images;
detecting a moving object in the resized time series of images;
mapping the moving object in the resized time series of images to the time series of images;
cropping regions in the time series of images that include the mapped moving object;
classifying, with a trained first neural network, the moving object as a ball based on the resized time series of images;
shifting the ball in the time series of images based on a velocity of the ball in the cropped regions:
regressing, with a trained second neural network, center coordinates and a radius of the shifted ball;
classifying, with the trained second neural network, whether the shifted ball is the ball, based on a confidence score; and
updating the shifted ball in the cropped regions based on the regressed center coordinates, radius and confidence score.
2 . The method of claim 1 , wherein resizing includes resizing the time series of images to a dimension smaller than the time series of images.
3 . The method of claim 1 , wherein the velocity of the ball is based on a change in center coordinates of the ball.
4 . The method of claim 1 , wherein the first and second neural networks are trained using synthetic training data comprising images of balls augmented with at least one of shadows, sunshine, non-uniform lighting, complex background, artifacts, static balls, different ball sizes, moving background or dirty balls.
5 . The method of claim 1 , wherein the ball is a cricket ball.
6 . The method of claim 1 , wherein the time series of images includes at least two image frames.
7 . A system comprising:
at least one camera configured to capture a time series of images;
at least one processor configured to:
resize the time series of images; and
detect a moving object in the resized time series of images;
map the moving object in the resized time series of images to the time series of images; and
crop regions in the time series of images that include the mapped moving object;
a first neural network trained to classify the moving object as a ball based on the resized time series of images; and
a second neural network trained with a second set of training images, and the at least one processor is configured to:
shift the ball in the time series of images based on a velocity of the ball in the cropped regions;
regress, with the second neural network, center coordinates and a radius of the shifted ball;
classify, with the second neural network, whether the shifted ball is the ball, based on a confidence score; and
update the shifted ball in the cropped regions based on the regressed center coordinates, radius and confidence score.
8 . The system of claim 7 , wherein the time series of images is resized to a dimension smaller than the time series of images.
9 . The system of claim 7 , wherein the velocity of the ball is based on a change in center coordinates of the ball.
10 . The system of claim 7 , wherein the first and second neural networks are trained using synthetic training data comprising images of balls, wherein the images of balls are augmented with at least one of shadows, sunshine, non-uniform lighting, complex background, artifacts, static balls, different ball sizes, moving background or dirty balls.
11 . The system of claim 7 , wherein the ball is a cricket ball.
12 . The system of claim 7 , wherein the time series of images includes at least two image frames.