LSB insertion on RGB image

1 回表示 (過去 30 日間)
Geboz Rent
Geboz Rent 2015 年 1 月 15 日
コメント済み: Image Analyst 2015 年 1 月 15 日
I would like to know how one would
  1. Check the value of the LSB for each channel (R,G,B)
  2. Change the value (1->0 or 0->1)
Using 24-bit image ( 8 bit for each channel)

採用された回答

Image Analyst
Image Analyst 2015 年 1 月 15 日
See this:
m=magic(5)
lowestBits = rem(m, 2)
m =
17 24 1 8 15
23 5 7 14 16
4 6 13 20 22
10 12 19 21 3
11 18 25 2 9
lowestBits =
1 0 1 0 1
1 1 1 0 0
0 0 1 0 0
0 0 1 1 1
1 0 1 0 1
So you'd do
% Extract the individual red, green, and blue color channels.
redChannel = rgbImage(:, :, 1);
greenChannel = rgbImage(:, :, 2);
blueChannel = rgbImage(:, :, 3);
% Get LSB's of each pixel.
redLsb = rem(redChannel, 2);
greenLsb = rem(greenChannel, 2);
blueLsb = rem(blueChannel, 2);
  2 件のコメント
Geboz Rent
Geboz Rent 2015 年 1 月 15 日
編集済み: Image Analyst 2015 年 1 月 15 日
That is exactly what I'm looking for appreciate your help Image Analyst,
How would one go on to reconstruct the image again?
My intended steps are
  1. Load the original image
  2. Manipulate the LSB
  3. Reconstruct the image again
Image Analyst
Image Analyst 2015 年 1 月 15 日
For (1), use imread().
For (2) - I don't know what you want to do. I showed you how to get the LSBs - you can do whatever you want with them after that.
For (3) you can just use a nested for loop to change the pixel based on the value of your LSB array.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Processing Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by