title: Python Opencv cv2.LUT() how to use
body: <p>Need to apply some rapid conversion on the color channels of a image.</p>
  
  <p>1)I have stored in a list the corresponding output value:</p>
  
  <pre><code>ListaVred = [0]*255
  
  for i in range(0,255):
      ListaVred[i]=i*127 / 255 + 128
  </code></pre>
  
  <p>2)I get the color input value from 0 to 255 from the image</p>
  
  <p>3)should replace in the image the input values with the output</p>
  
  <pre><code>i.e. red[45]= 0 
       ListaVred0] = 128
       red[45]= 128
  </code></pre>
  
  <p>I've looked at cv2.LUT(src,dst) function but not sure about it's use, 
  <a href="http://docs.opencv.org/trunk/modules/core/doc/operations_on_arrays.html#cv2.LUT" rel="nofollow">http://docs.opencv.org/trunk/modules/core/doc/operations_on_arrays.html#cv2.LUT</a></p>
  
  <pre><code>cv2.LUT(ListaVred,red)
  TypeError: src is not a numpy array, neither a scalar
  
  
  ListaVred = np.array(ListaVred)
  cv2.LUT(ListaVred,red)
  cv2.error: /build/opencv-Ai8DTy/opencv-2.4.6.1+dfsg/modules/core/src/convert.cpp:1195: error: (-215) (lutcn == cn || lutcn == 1) &amp;&amp; lut.total() == 256 &amp;&amp; lut.isContinuous() &amp;&amp; (src.depth() == CV_8U || src.depth() == CV_8S) in function LUT
  </code></pre>