Grouping by proximity and multistability in dot lattices: A quantitative Gestalt theory