Regarding the replacement of matrix elements

Sir,
I have an image matrix with 80x1024 conatin with DN numbers 0 to 255, i.e. 8 bit image. Now i want to replace the 8 bit numbers with 11 bit corresponding numbers. 11 bit corresponding values are given in a 1x256 matrics. Now i need to replace all the 8 bit values in the image with the given 11 bit values. how may i replace it.

 採用された回答

Walter Roberson
Walter Roberson 2021 年 6 月 28 日

0 投票

DN = sort(randi([0 255],80,1024,'uint8'));
imshow(DN)
Lookup_Table = randperm(2048,256)-1;
TranslatedImage = Lookup_Table(double(DN)+1);
size(TranslatedImage)
ans = 1×2
80 1024
imshow(TranslatedImage, [])

1 件のコメント

jyotirmoy kalita
jyotirmoy kalita 2021 年 6 月 28 日
Thank you so much walter .....the code is working filne

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeRead, Write, and Modify Image についてさらに検索

製品

リリース

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by