title: How to select a specific color from an image using this command?
body: <p>I have been given an image where the words have been correctly segmented and represented via different colors.</p>
  
  <p>Here is the image: </p>
  
  <p><img src="https://i.stack.imgur.com/0T0jm.png" alt="enter image description here"></p>
  
  <p>I was told that without even having the source file I can select specific words/color from that image and save it for further processing. This can be done by creating a new image, <code>v</code>, such that </p>
  
  <pre><code>v=r+g*256+b*256*256+1
  </code></pre>
  
  <p>where r, g and b are the red, blue and green channels respectively.</p>
  
  <p>I tried to use this but all it created was a white blank image</p>
  
  <pre><code>img = imread('color_test.bmp');
  r = img(:,:,1);
  g = img(:,:,2);
  b = img(:,:,3);
  
  v=r+g*256+b*256*256+1;
  </code></pre>
  
  <p>I dont understand how the above v image would allow me to select individual colors?</p>