GridROI.py 文件源码

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

项目:dataArtist 作者: radjkarl 项目源码 文件源码
def getMask(self, shape):

        p = self.state['pos']
        s = self.state['size']
        center = p + s / 2
        a = self.state['angle']
        # opencv convention:
        shape = (shape[1], shape[0])
        arr = np.zeros(shape, dtype=np.uint8)
        # draw rotated rectangle:
        vertices = np.int0(cv2.boxPoints((center, s, a)))
        cv2.drawContours(arr, [vertices],
                         0,
                         color=1,
                         thickness=-1)
        return arr.astype(bool).T
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号