dehaze_pro.py 文件源码

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

项目:DeHaze 作者: XierHacker 项目源码 文件源码
def getDarkMap(img,pitchSize=9):
    darkMap=np.zeros(shape=(img.shape[0],img.shape[1]),dtype=np.uint8)
    #padding,and darkMap has the same shape with the img
   # print ("shape of darkmap",darkMap.shape[0],darkMap.shape[1])
    padSize=(pitchSize-1)//2
    #print ("type of pitchsize",type(padSize))
    pad=cv2.copyMakeBorder(img,padSize,padSize,padSize,padSize,cv2.BORDER_CONSTANT,value=255)
    for i in range(darkMap.shape[0]):
        for j in range(darkMap.shape[1]):
            darkMap[i,j]=pad[i:i+pitchSize,j:j+pitchSize].min()

    return pad,darkMap
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号