def contour_enclosed_area_py(verts):
    """
    Compute the area enclosed by a contour.  Copied from
    https://arachnoid.com/area_irregular_polygon/
    
    Parameters
    ----------
    verts : array_like
        2D shape (N,2) array of vertices. Uses scikit image convetions
        (j,i indexing)
        
    Returns
    ----------
    area : float
        Area of polygon enclosed by verts. Sign is determined by vertex
        order (cc vs ccw)
    """
    a = 0
    ox, oy = verts[0]

    for x, y in verts[1:]:
        a += (x * oy - y * ox)
        ox, oy = x, y

    return a / 2