フィルターのクリア

Substitution of LSB of RGB component by other bits

1 回表示 (過去 30 日間)
sangeeta
sangeeta 2013 年 4 月 16 日
コメント済み: Vinsa 2014 年 6 月 4 日
I have extracted audio bits in a variable. These needs to be substituted in RGB components at various pixel positions. I have the pixel positions and 8 bit value of each RGB at that position. Want to know how last 2 LSB of, say, RED component can be replaced by first 2 bits of audio data.
Kindly share if a link is already available for same.
  2 件のコメント
sangeeta
sangeeta 2013 年 4 月 18 日
Let value of R component at position(x1,y1) is [10010000].
Audio data is [11010101......]
2 LSB of R = [00]
These needs to be replaced by first two bits of audio data[11]
So finally value of R at (x1,y1) becomes [10010011].
Is there any substitution/replace method available in Matlab? Kindly reply soon.
Vinsa
Vinsa 2014 年 6 月 4 日
i am doing steganography on line based cubism images..how this adaptive LSB substitution for smooth areas and two component lsb substitution for edge areas can be done? kindly give me reply.

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

回答 (1 件)

Walter Roberson
Walter Roberson 2013 年 4 月 18 日
bitset()
  2 件のコメント
sangeeta
sangeeta 2013 年 4 月 18 日
編集済み: sangeeta 2013 年 4 月 18 日
Thanks Walter.
Kindly look into this:
r is red component value, say, 11000010
bits is bits to be replaced, last three.
firstAudio contain the three bits of audio data, say,001
if true
bits = 1:3;
a = dec2bin(bitset(bin2dec(r),bits,firstAudio));
end
I get:
a = 11000010
11000000
11000110
I want the replacement in the same byte, instead of 3 outputs, that is 'a' should be 11000001
Walter Roberson
Walter Roberson 2013 年 4 月 18 日
Use 3 bitset() calls.
Or if you are already using dec2bin storage for both r and firstAudio, then with no loops,
a = r;
a(end-2:end) = firstAudio(end-2:end);

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

カテゴリ

Help Center および File ExchangeLarge Files and Big Data についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by