Image segmentation is used to cluster pixels in the image into multiple segments with similar characteristics. These segments represent some objects defined within detected contours and can be further used for object detection.