Camera Tracking Gray Boulder

I’ve recently been tasked with making a program that can track the gray boulder in the 2016 game using Roborealm. I’ve been trying for the past three days to make a code that can track the gray ball but have had no success. I’ve gotten as far as finding the ball and highlighting it, but I can’t figure how to make the Center of Gravity center in on the ball. Any help would be greatly appreciated.

Are you doing your vision tracking on color images or depth map images from a device such as the Kinect or similar? I got a reliable boulder tracker working from a depth image using OpenCV on a Jetson. Finding the center of the boulder requires finding the moments of the contour in the image using this software, or a function like minEnclosingCircle. My code from 2014 could prove useful: https://github.com/rr1706/vision2014/blob/master/src/ball.cpp

I’ve been trying to do it on color images since that what we’ve done in the past, but I’ll look into Jetson and see if it can help us out. Thank you so much