It may be very difficult to measure the size of an obstacle, in detail when this object is ball-shaped. Eventually it helps to find the resonant frequency of the balls, to improve their detection. Get a sensor and find out yourself, whether your idea can work at all.