import math


def centroid_distance(image_centroid, object_centroid, row):
    """computes distance between an object centroid and image centroid"""
    X1 = image_centroid[0]
    Y1 = image_centroid[1]
    X2 = object_centroid[row][0]
    Y2 = object_centroid[row][1]
    distance = math.sqrt((X1-X2)**2+(Y1-Y2)**2)
    return distance