FeatureExtraction.py 文件源码

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

项目:SummerProject_MacularDegenerationDetection 作者: WDongYuan 项目源码 文件源码
def CropLowerBoundary(img):
    # img_gray = ToGrayImage(path)
    _,img_bi = cv2.threshold(img,60,255,cv2.THRESH_BINARY)
    threshold_rate = 0.95
    threshold_row = -1
    row,col = img_bi.shape
    for tmp_r in range(row-1,-1,-1):
        tmp_sum = sum(img_bi[tmp_r])
        rate = float(tmp_sum)/255/col
        # print(rate)
        if rate>threshold_rate:
            threshold_row = tmp_r
            break
    img = img[0:threshold_row,:]
    # plt.imshow(img,"gray")
    # plt.show()
    return img
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号