¡@

Home 

python Programming Glossary: lut

Using numpy.take for faster fancy indexing

http://stackoverflow.com/questions/14491480/using-numpy-take-for-faster-fancy-indexing

have an array img of shape planes rows and another array lut of shape planes 256 and you want to use them to create a new.. create a new array out of shape planes rows where out p j lut p img p j . This can be achieved with fancy indexing as follows.. can be achieved with fancy indexing as follows In 4 timeit lut np.arange planes .reshape 1 1 img 1000 loops best of 3 471 us..

Using numpy.take for faster fancy indexing

http://stackoverflow.com/questions/14491480/using-numpy-take-for-faster-fancy-indexing

advantage ORIGINAL QUESTION I have a set of look up tables LUTs that I want to use on an image. The array holding the LUTs.. LUTs that I want to use on an image. The array holding the LUTs is of shape planes 256 n and the image has shape planes rows.. . Both are of dtype 'uint8' matching the 256 axis of the LUT. The idea is to run the p th plane of the image through each..