Need to apply some rapid conversion on the color channels of a image.
1)I have stored in a list the corresponding output value:
ListaVred = [0]*255
for i in range(0,255):
ListaVred[i]=i*127 / 255 + 128
2)I get the color input value from 0 to 255 from the image
3)should replace in the image the input values with the output
i.e. red[45]= 0
ListaVred0] = 128
red[45]= 128
I've looked at cv2.LUT(src,dst) function but not sure about it's use, http://docs.opencv.org/trunk/modules/core/doc/operations_on_arrays.html#cv2.LUT
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) && lut.total() == 256 && lut.isContinuous() && (src.depth() == CV_8U || src.depth() == CV_8S) in function LUT