Python 3: I am trying to find find all green pixels in an image by traversing all pixels using an np.array, but can’t get around index error
In direct answer to your question, the y axis is given first in numpy arrays, followed by the x axis, so interchange your indices. Less directly, you will find that for loops are very slow in Python and you are generally better off using numpy vectorised operations instead. Also, you will often find it easier … Read more