美文网首页
python如何去除非常扁的图像,采用离心率计算

python如何去除非常扁的图像,采用离心率计算

作者: 美环花子若野 | 来源:发表于2018-10-16 14:12 被阅读46次

    labels = [2,3,7] 

    # or whatever you have 

    good_labels = []

    for label in labels: m = matrix == label

    non_empty_columns = sum(sum(m)>0)    

    non_empty_rows = sum(sum(m.transpose())>0)   

     if 1.0 * non_empty_rows / (non_empty_columns+0.001) > threshold:       

        good_labels.append(label)

    That will remove very long (vertically) blobs, turn rows and columns around to remove horizontally stretched blobs.

    参考的连接

    https://stackoverflow.com/questions/8158647/eccentricity-estimation-in-python

    相关文章

      网友评论

          本文标题:python如何去除非常扁的图像,采用离心率计算

          本文链接:https://www.haomeiwen.com/subject/ttlhzftx.html