Near-optimal detection of geometric objects by fast multiscale methods