I have imported a color image using openCV imread function.
im = cv2.imread('test.jpg')
I am looking to find the indices of white pixels, which have a pixel value of [255, 255, 255]. I know im is actually a 3D array. But what is weird is the value of im[0,0] is [255 255 255], rather than [255, 255, 255]. And im[0,0,0] is 255. So [255 255 255] seems like a list or something, but actually not equivalent to [255, 255, 255].
>>> print im[0,0]
[255 255 255]
>>> print im[0,0,0]
255
So my questions are:
- What is the difference between [255 255 255] and [255, 255, 255]?
- How can I get the indices of all withe pixels? What search algorithm should I use?