Embed watermark in background of an document image

조회 수: 1 (최근 30일)
Balkar Singh
Balkar Singh 2020년 1월 25일
댓글: Balkar Singh 2021년 3월 7일
I need code to embed and extract watermark in background of a document image.
  댓글 수: 13
Walter Roberson
Walter Roberson 2021년 2월 22일
Which algorithm did you decide upon? What error did you encounter in your MATLAB implementation of the algorithm?
Balkar Singh
Balkar Singh 2021년 3월 7일
clear all;
a1=imread('Marksheet1.png');
a2=imresize(a1, [256 256]);
a = a2(1:256,1:256,1);
blk1 = our_blkproc(a,blksize1);
cover_img = zeros(8,8,size(blk1,3));
for i=1:size(blk1,3)
cover_img(:,:,i) = dct2(blk1(:,:,i));
end
% cover_img1 = cover_img/2;
b1 = imread('logo.png');
b2 = imresize(b1, [128 128]);
blksize2=[8,8];
b = b2(1:128,1:128,1);
blk2 = our_blkproc(b,blksize2);
water_img = zeros(8,8,size(blk2,3));
for i=1:size(blk2,3)
water_img(:,:,i) = dct2(blk2(:,:,i));
end
%water_img = water_img/2;
%final_value = zeros(8,8,size(blk1,3));
final_value = cover_img;
cnt1=0;
for i = 1:size(water_img,3)
final_value(1,1,i) = water_img(1,1,i);
cnt1=cnt1+1;
end
dct_inv = zeros(8,8,size(final_value,3));
cnt2=0;
for i=1:size(final_value,3)
dct_inv(:,:,i) = idct2(final_value(:,:,i));
cnt2=cnt2+1;
end
output = our_blkproc_rev(dct_inv);
imshow(uint8(output))
Sir, I tried this code

댓글을 달려면 로그인하십시오.

답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by