Matlab script to detect balls in picture