Right now, I have code that basically looks like:
for x in range(img.shape[0]):
for y in range(image.shape[1]):
output[x,y] = map[ input[x,y] ]
where output
, input
and map
are all numpy arrays (map is size 256, all are type uint8).
This works, but it's slow. Loops like this should be in C. That's what numpy is for.
Is there a numpy function (or a cv2 function, I'm already importing that anyway) that will do this?