accuracy_measure.py 文件源码

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

项目:Computer-Vision 作者: PratikRamdasi 项目源码 文件源码
def processContoursinGt(path):
    folder = sort_files(path)
    length_cont_gt = []
    for i in range(20,len(folder)):
        newPath = path + "/0 (" + str(i) + ")" + ".png"
        img = cv2.imread(newPath,cv2.CV_LOAD_IMAGE_COLOR)
    #print "Image in processContour: ",img
        gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
        gray = cv2.GaussianBlur(gray, (31, 31), 0)
        thresh = cv2.threshold(gray, 25, 255, cv2.THRESH_BINARY)[1]
        thresh = cv2.dilate(thresh, None, iterations=2)
        (cnts, _) = cv2.findContours(thresh.copy(), cv2.RETR_EXTERNAL,cv2.CHAIN_APPROX_SIMPLE)
        length_cont_gt.append(len(cnts))
    return length_cont_gt
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号