I need to get some pixels that are in range of RGB color values
I use inRange function:
mask = cv2.inRange(image, lower, upper)
Now I get this mask and I need to do some operations with this filtered pixels - i.e. find distance between two random pixels
How I can make this?
If I call print(image) I get following array:
[[[ 78 94 107]
[ 82 97 113]
[ 87 102 118]
...
[101 114 116]
[108 120 122]
[109 121 123]]
As I understand this is array where keys are x and y pixel position and value is RGB code. But If I call print(mask.nonzero()) I see
(array([126, 126, 126, ..., 168, 168, 168], dtype=int64),...)
And I don't really undestand what is in this array and in docs I didn't find type of returned value