otsu.py 文件源码

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

项目:sparks 作者: ImpactHorizon 项目源码 文件源码
def accumulated_histogram(images, args):
    histogram = args[0]
    try:
        image, x, y = images.get(timeout=0.3)
    except:
        return
    hsv = cv2.cvtColor(np.array(image, dtype=np.uint8), cv2.COLOR_RGB2HSV)
    current_histogram = histogram.get()    
    new_histogram = list(map(lambda x: cv2.calcHist([hsv[:,:,x]], 
                                                [0], 
                                                None, 
                                                [256], 
                                                [0, 256], 
                                                hist=current_histogram[x], 
                                                accumulate=True), 
                    range(3)))
    histogram.put(new_histogram)
    images.task_done()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号