Skip to content Skip to sidebar Skip to footer

Numpy Change Array Values When Mask Is One

i'm new to numpy and i'm running into trouble. I've got two numpy arrays, img and thr: >>>img.shape (2448, 3264, 3) >>>thr.shape (2448, 3264) And i want to do so

Solution 1:

Using NumPy assignment to an indexed array:

img[thr != 0] = [255,255,255]

Post a Comment for "Numpy Change Array Values When Mask Is One"