I want to implement watermarking algorithm based on Intermediate Significant Bit replacement

1 次查看(过去 30 天)
Hi everyone
I want to implement watermarking algorithm based on Intermediate Significant Bit replacement, it's for a project.
How to create ranges for each bitplane ?

回答(1 个)

Rahul
Rahul 2025-6-18
I understand that you wish to implement watermarking algorithm based on Intermediate Significant Bit replacement.
Here are some steps you can follow:
  • Use the 'bitget' function to extract the 'kth' bit plan from the image.
  • You can choose which bit plane to change to add the watermark.
  • The watermark can be of random values within certain limits, can be adjusted according to requirements.
  • The 'bitset' function can be used to add the watermark values in the desired bit plane.
Here is an example:
img = imread('cameraman.png');
img = uint8(img);
% Extract each bitplane
bitplanes = zeros([size(img), 8], 'logical');
for k = 1:8
bitplanes(:,:,k) = bitget(img, k); % Extract k-th bitplane
end
% Replacing bitplane 4 with a watermark
watermark = randi([0 1], size(img)); % Example binary watermark
watermarked_img = bitset(img, 4, watermark); % Embed in bitplane 4
imshow(watermarked_img),
The following MathWorks documentations can be referred:
Thanks.

产品


版本

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by