Selecting groups of objects is a frequent task in graphical user interfaces since it precedes all manipulation operations. Current selection techniques such as lasso become time-consuming and error-prone in dense configurations or when the area covered by targets is large or hard to reach. Perceptual-based selection techniques can considerably improve the selection task when the targets have a perceptual structure, driven by Gestalt principles of proximity and good continuity. However, current techniques use ad hoc grouping algorithms that often lack evidence from perception science. Moreover, they do not allow selecting arbitrary groups (i.e. without a perceptual structure) or modifying a selection. This paper presents a domain-independent perceptual-based selection technique that addresses these issues. It is built upon an established group detection model from perception research and provides intuitive interaction techniques for selecting (whole or partial) groups with curvilinear or random structures. Our user study shows that this technique not only outperforms rectangle selection and lasso techniques when targets have perceptual structure, but also it is competitive when targets have arbitrary arrangements.