HOW TO PERFORM 3 LSB AND 4 LSB REPLACEMENT
3 ビュー (過去 30 日間)
古いコメントを表示
SUPPOSE I HAVE AN ARRAY OF 512*512 PIXEL ELEMENTS. I ALSO HAVE ANOTHER ARRAY 'DATA' OF O AND 1 VALUES. I HAVE TO REPLACE THE LAST 3 OR 4 LSB BITS OF EACH PIXEL WITH THE VALUES OF DATA ARRAY VALUES BASED ON SOME CONDITION. LET THE CONDITION IS
IF X==0
THEN I WILL APPLY 3 LSB REPLACEMENT
ELSE IF X==1
4 LSB REPLACEMENT
KINDLY SUGGEST ME ...HOW CAN I PROCEED...THANK YOU
0 件のコメント
回答 (2 件)
Geoff Hayes
2017 年 2 月 11 日
aditya - to replace the least significant bits of your pixel, you can use bitset. For example, suppose that X is zero, and we want to replace the last three bits with 101. We would do
X = uint8(0);
X = bitset(X,1,1);
X = bitset(X,2,0);
X = bitset(X,3,1);
and X is now five which what we expect with 00000101.
2 件のコメント
Geoff Hayes
2017 年 2 月 12 日
aditya - please note the above is just an example of how to set specific bits and is meant only to indicate how you might do this. It is up to you to incorporate it into your main program...
参考
カテゴリ
Help Center および File Exchange で Image Processing Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!