Question: ```
def yesno(endwhat):
    end = False
    while not end:
        ok = input("<Y/N>")
        if ok.upper == 'Y' or ok.upper == 'N':
            if ok.upper == 'Y':
                end = True
                endwhat = True
        else:
            print("Enter only <Y/N>")
    return(ok)

```

This Doesn't Work, It Just Repeats even when I put Y or N.
I think the problem is when I enter a var in 'endwhat' it doesn't change it to True.
Any Help is Truly Appreciated.
Thanks...

Answer: 
For this specific image you can just use numpy:

```
import numpy as np
import matplotlib.pyplot as plt

data = np.load('running_man.npy')
data[data > 1] = 0
plt.xticks([])
plt.yticks([])
plt.imshow(data)

```

[![enter image description here](https://i.stack.imgur.com/NsQzx.png)](https://i.stack.imgur.com/NsQzx.png)
For a method that preserves the corners better, we can use median filters, but force the preservation of corners.

Masked Image

[![enter image description here](https://i.stack.imgur.com/lpYED.png)](https://i.stack.imgur.com/lpYED.png)

Mask after filtering

[![enter image description here](https://i.stack.imgur.com/lmp49.png)](https://i.stack.imgur.com/lmp49.png)

Recolored

[![enter image description here](https://i.stack.imgur.com/vAC0z.png)](https://i.stack.imgur.com/vAC0z.png)

```py
import cv2
import numpy as np

# load image
img = cv2.imread("run.png");
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY);

# make mask
_, thresh = cv2.threshold(gray, 0, 255, cv2.THRESH_BINARY+cv2.THRESH_OTSU);

# median filter
med = cv2.medianBlur(thresh, 11);
med[thresh == 255] = 255;

# inverse filter
mask = cv2.bitwise_not(med);
med = cv2.medianBlur(mask, 3);
med[mask == 255] = 255;

# recolor
color = np.zeros_like(img);
color[med == 0] = (66, 239, 245);
color[med == 255] = (92, 15, 75);

# show
cv2.imshow("colored", color);
cv2.waitKey(0);

```