title: How to get the pixel indices of a specific RGB value of a image in python?
body: <p>I have imported a color image using openCV imread function.</p>
  
  <pre><code>im = cv2.imread('test.jpg')
  </code></pre>
  
  <p>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].</p>
  
  <pre><code>&gt;&gt;&gt; print im[0,0]
  [255 255 255]
  
  &gt;&gt;&gt; print im[0,0,0]
  255
  </code></pre>
  
  <p>So my questions are:</p>
  
  <ol>
  <li>What is the difference between [255 255 255] and [255, 255, 255]?</li>
  <li>How can I get the indices of all withe pixels? What search algorithm should I use?</li>
  </ol>