def is_pixel_inside(dim, coord):
    """
    Check if the pixel coordinate is inside the image
    """

    if (len(dim)<2) or (len(coord)<2):
        raise Exception("Dimensions should be >= 2! Check!")
    if (0<=coord[0]<=dim[0]) and (0<=coord[1]<=dim[1]):
        return True
    else:
        return False