main.py 文件源码

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

项目:ShadowRemoval 作者: Orcuslc 项目源码 文件源码
def __init__(self, img):
        self.img = np.asarray(img, np.float32) # The image to be handled;
        self.img2 = img # The real image;
        self.rows, self.cols = get_size(img)
        self.mask = np.zeros((self.rows, self.cols), dtype = np.uint) # In this class, we use just one mask to contain the Ms and Ml in the paper; In the mask, the places where the value = self._SHADOW belongs to Ms, and other pixels belongs to Ml;
        self.trimap = np.zeros((self.rows, self.cols), dtype = np.uint) # The trimap containing info that whether a pixel is inside the shadow, outside the shadow, or unknown;
        self.mask_shadow = np.zeros((self.rows, self.cols), dtype = np.uint) # The area where shadow removal is required;

        self._SHADOW = 1 # The flag of shadow;
        self._LIT = 0 # The flag of lit;
        self._UNKNOWN = -1 # The flag of unknown;
        self._threshold = 0.1;
        self._drawing = True # The flag of drawing;
        self._drawn = False # The status of whether seed initialise is finished;
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号