Python faster pixel access
I'm using a double for loop to iterate over an image, and it's very slow:
for j in range(0, hsv_frame.shape[0]):
for i in range(0, hsv_frame.shape[1]):
h = frame[j, i, 0]
s = frame[j, i, 1]
v = frame[j, i, 2]
Is there any other way to iterate over the image?
try to avoid per-pixel operations in general. both numpy and opencv are very fast, when you use vectorized functions. the problem is usually more: finding out, if there's something builtin for your case already, and how it is called.
I understand parallelization. Thanks for the insight!