Lookup table for 2D matrix

3 views (last 30 days)
manit chansuparp
manit chansuparp on 2 Jan 2019
Commented: Walter Roberson on 4 Jan 2019
Let say i have large matrix (data) of size 103680x10 uint8 which stores value range of 0-255.
And lookup Table (LUT) is 256x255 double, i want to replace each element in data matrix with row vector of LUT.
In current i do this with following code : result = LUT(data'+1,:);
But it took 0.8 second to do this one operation, Can it be faster i have to do this for all frames in my video?
I really appreciate any help you can provide.
  3 Comments
manit chansuparp
manit chansuparp on 4 Jan 2019
Yes, Mr.Walter the result i get is 1036800 * 255. I ever tried the both case data 103680 x 10 and dataTranspose 10 x 103680(without ' ), it give me a same time(0.8 sec).
Maybe i'm going to deal with some LUT function such as intlut. it can replaces each element much faster than "result = LUT(data'+1); " when LUT is array of size 256. It took only 0.005 sec while LUT(data'+1) took 0.1 sec. Unfortunately, intlut supports only array not matrix. I have to find any other solution about LUT function.
Walter Roberson
Walter Roberson on 4 Jan 2019
maybe loop doing 255 intlut, one for each column of your LUT ?

Sign in to comment.

Answers (0)

Products


Release

R2015a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!