Selection.py 文件源码

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

项目:dataArtist 作者: radjkarl 项目源码 文件源码
def _createMaskFromSelection(self):
        img = self.display.widget.image
        assert img is not None, 'need image defined'

        out = np.zeros(img.shape[1:3], dtype=np.uint8)
        for n, p in enumerate(self.paths):
            assert isinstance(
                p, FreehandItem), 'TODO: make work for other items as well'
            cv2.fillPoly(out, np.array([p.elements()], dtype=np.int32), n + 1)

        self.handleOutput([out.T], title='selection')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号