I have an image as a matrix (ndarray) of shape (720, 1280, 3) with RGB pixels (variable: original) and another ndarray of shape (720, 1280) which is made of booleans (variable: im).
for every True value in im I want original's corresponding pixel to be of color [0, 0, 255].
I tried (with both arrays flattened)
for i in range(im.size):
if(im[i] == True):
original[i] = [0, 0, 255]
but its too slow to have it as a video output.
Any ideas how I can speed this up?