I've a basic image:
Is there a way to quickly get the list of pixels (a mask) that have the same r, g and b pixel value?
In the example this corresponds to the gray square in the center of the image because each pixel in the gray square has the value (100, 100, 100)
The resulting mask should be something like this:
I have no clue how to do this (fast), I've isolated the r,g,b channels but I have no ideas
This is my code so far:
import numpy as np
from matplotlib import pyplot as plt
#Make the test image
img = np.full((512,512,3), dtype = np.uint8, fill_value = (255,0,255))
img[200:300, 200:300] = (100,100,100)
#get r,g,b
red = img[...,0]
green = img[...,1]
blue = img[...,2]
plt.imshow(img)
plt.show()

