您好,欢迎来到化拓教育网。
搜索
您的当前位置:首页python如何去除非常扁的图像,采用离心率计算

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

来源:化拓教育网

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.

参考的连接

Copyright © 2019- huatuo9.cn 版权所有 赣ICP备2023008801号-1

违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务