def crop(im, r, c, target_r, target_c):
    """
    Crops an image
    :param im: input image
    :param r: start row coord
    :param c: start column coord
    :param target_r: end row coord
    :param target_c: end column coord
    :return: cropped image
    """
    return im[r:r + target_r, c:c + target_c]