在用python进行图像处理时,有时需要遍历numpy数组,下面是遍历数组的方法:
[rows, cols] = num.shape for i in range(rows - 1): for j in range(cols-1): print(num[j, i])
在用python进行图像处理时,有时需要遍历numpy数组,下面是遍历数组的方法:
[rows, cols] = num.shape for i in range(rows - 1): for j in range(cols-1): print(num[j, i])