As with the perception of sound, visual perception groups incoming sensory data according to a number of principles:
objects that are spatially close together in the visual field tend to be grouped together.
objects that are similar in colour, shape, size or texture are grouped together.
Objects are grouped along lines of smooth and progressive flow. In this image, the dots of the continuous curve are grouped together even through the intersecting curve of dots is in closer proximity to the right half of the curve.
Objects that move together in a similar manner are grouped together. If you click on the image below, you will see this in action.
We tend to perceive complete figures even when information is missing. Our vision system invents a plausible solution and we experience the solution rather than the less complete, but more literally sensory input
You will no doubt have noticed that these grouping principles are very similar to those for sound perception.