Proximity-based, or pairwise, data clustering techniques are gaining increasing popularity due to their versatility and their ability to easily integrate information of different nature. Despite this, most applications to image segmentation incorporate only region-based information, mainly color and texture similarity. In this paper we propose a general approach for integrating boundary information in a pairwise segmentation framework. To this end we propose a measure of distance between pair of pixels that integrates the value of an edge-response function along a path joining the two pixels. Experiments performed using the dominant sets framework show that the proposed approach is competitive with the state of the art pairwise segmentation algorithms even while using boundary information only. Furthermore, we show that the approach can effectively be used when adopting an out of sample approach to pairwise segmentation.