I'm trying to remove noise from image, i'm trying to make white pixel if certain condition met but i'm struggling to make that happen.
This is my image and i want to remove all gray color lines only want high intensity color like blue red and green . Sorry for my editing
This is my code where i have tried to check the condition which succeed then i'll change the pixel to white
height, width = image.shape[0:2]
for i in range(0, height): # looping at python speed...
for j in range(0, width):
# print(image)
if ((image[i][j][1] * 255 == image[i][j][2] * 255 == image[i][j][3] * 255) or (
(image[i][j][0] * 255 == image[i][j][1] * 255) and (
image[i][j][3] * 255 >= 245))):
# print(image[i][j][2] * 255)
image[i][j] = 0
plt.imshow(image)
plt.savefig("filename.png")
plt.show()