I want to identify all the yellow pixels that lie between two colours, for example [255, 255, 0] is bright yellow, and [200, 200, 50] is a mid yellow.
c = color_array = np.array([
[255, 255, 0], # bright yellow
[200, 200, 50]]) # mid yellow
So the rgb ranges could be represented as :
(min, max) tuple...
r (200, 255)
g (200, 255)
b (0, 50)
I have a 2D (height of image x width of image) [r, g, b] array:
image = np.random.randint(0, 255, (5, 4, 3))
array([[[169, 152, 65],
[ 46, 123, 39],
[116, 190, 227],
[ 95, 138, 243]],
[[120, 75, 156],
[ 94, 168, 139],
[131, 0, 0],
[233, 43, 28]],
[[195, 65, 198],
[ 33, 161, 231],
[125, 31, 101],
[ 56, 123, 151]],
[[118, 124, 220],
[241, 221, 137],
[ 71, 65, 23],
[ 91, 75, 178]],
[[153, 238, 7],
[ 2, 154, 45],
[144, 33, 94],
[ 52, 188, 4]]])
I'd like to produce a 2D array with True if the r,g,b values are in the range between the 2 color values in the color arrays.
[[T, F, F, T],
[T, F, F, T],
... ]]
I've been struggling to get the indexing right.