UsefulUtils.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:FoundryDataBrowser 作者: ScopeFoundry 项目源码 文件源码
def draw_roi(x1, y1, x2, y2, **draw_params):
    codes = [Path.MOVETO, Path.LINETO, Path.LINETO, Path.LINETO, Path.CLOSEPOLY]

    ax = plt.gca()

    # Form a path
    verts = [(x1, y1),
             (x1, y2),
             (x2, y2),
             (x2, y1),
             (0, 0)]
    path = Path(verts, codes)

    # Draw the BG region on the image
    patch = patches.PathPatch(path, **draw_params)
    ax.add_patch(patch)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号