def find_label(frame_labeled, rc, cc):
    """
    Returns the label for the object with the given centroid coordinates.
    Typically, this is just the value of the labeled frame at the integer
    values of the centroid coordinates, but for concave object shapes, the
    integer values of the centroid coordinates might not designate a pixel
    that is inside the object. This algortihm continues the search to find
    a pixel that is indeed inside the object and get its label.

    Parameters
    ----------
    frame_labeled : (M x N) numpy array of uint8
        Image of objects labeled by 1-indexed integers (background is 0)
    rc : float
        Row of the centroid of the object whose label is desired.
    cc : float
        Column of centroid of the object label is desiredRIPTION.

    Returns
    -------
    label : int
        Label of the image with centroid at (rc, cc). -1 indicates failure.

    """
    # extracts number and rows and columns of frame
    num_rows, num_cols = frame_labeled.shape
    # lists steps to take from centroid to find pixel in the labeled object
    steps = [(0,0), (0,1), (1,0), (1,1)]
    # searches around centroid for a labeled point
    for step in steps:
        label = frame_labeled[min(int(rc)+step[0], num_rows-1),
                                min(int(cc)+step[1], num_cols-1)]
        if label != 0:
            return label

    # failed to find non-zero label--returns -1 to indicate failure
    return -1