def quality(depth): delta = 0 y, x = ac.size(depth) y, x = y / 2, x / 2 q = 0 i, j, ref = x-1, x, depth[y, x] while i > 0: if WallAlign.dist(depth[y, i], ref) <= delta: depth[y, i] = 0 depth[y + 1, i] = 229 depth[y - 1, i] = 229 q += 1 else: break i -= 1 while j < x * 2: if WallAlign.dist(depth[y, j], ref) <= delta: depth[y, j] = 229 depth[y + 1, j] = 0 depth[y - 1, j] = 249 q += 1 else: break j += 1 return q
def quality2(depth): y, x = ac.size(depth) y, x = y / 2, x / 2 return q