mapping a matrix to array to new matrix (mapping image to tone image )
1 回表示 (過去 30 日間)
古いコメントを表示
i have a matrix A n*m for example A,3*3 = A[0,3,10;255,6,8;7,9,9] the values between 0 to 255 and i have array B 1*256 that includes all the numbers from 0 to 255 not sorted , (ex. [5,0,4,255,...]) i need to map the matrix A to B - for every value i in A i want to map it to B(i+1) i am required to do it in one line code !!!
in this example the first element in A 0 will convert to 5 index 1 in B and second element 3 will be 255 index 4 in B in the new matrix .
0 件のコメント
採用された回答
Image Analyst
2018 年 11 月 5 日
How about intlut()?
A = uint8([0,3,10;255,6,8;7,9,9])
B = uint8(randperm(256)-1)
output = intlut(A, B) % A and B must be integers
その他の回答 (1 件)
参考
カテゴリ
Help Center および File Exchange で Matrix Indexing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!