在上图中,如何获得一个干净的线块,移除上下围绕中长条宽带的线块?我试过投影,但失败了
def hProject(binary):
h, w = binary.shape
hprojection = np.zeros(binary.shape, dtype=np.uint8)
[red is the result][2]
h_h = [0]*h
for j in range(h):
for i in range(w):
if binary[j,i] == 255:
h_h[j] += 1
return h_h
Tags:
上面是我的代码,但速度太慢了
相关问题 更多 >
编程相关推荐