A highly efficient postprocessing technique which enables the result of edge detection to be used for image segmentation is proposed. The method starts from an edge map obtained by a standard edge detection tool, e.g., Canny edge detector, and corrects it to obtain an edge map in which every edge point belongs to a closed boundary of an image region. The correction of the original edge map assumes removing some of the existing edge points as well as inserting virtual edge points. The proposed edge map correction procedure consists of two stages: (1) edge linking, which closes the gaps in edge contours by inserting virtual edge elements, and (2) edge pruning, which rejects spurious contours thereby avoiding over-segmentation. The edge pruning procedure performs an iterative greedy minimization of a correction cost function, while keeping all contours of the edge map closed. The proposed approach is evaluated using a set of standard test images.