watermark Embedding in Blocks
Mostra commenti meno recenti
hello everyone i want to embed watermark in image of size 512*512 & watermark size is 64*64. first of all i am converting original image into 8*8 block. then i want to convert watermark also into 8*8 block and embed it into four block only[16*4 = 64(its my watermark size)]. As i am converting original image into total 4096 block.i want to embed watermark into 64 blocks only. can any one elaborate the coding part for it.my part is as follows
%embedding watermark
for R22=1:64
Block2(:,:,xx:yy)=Block2(:,:,xx:yy)+ aa*Block5(:,:,1:64);
xx=64*(R22)+1;
yy=xx+63;
end;
Here consider Block2 as the blocked original image. aa is the embedding constant and Block5 is named to the watermark image. as here clear that its start embedding again after 64 block. but i want it should embed only first 64 block, not in whole image. thanx in advance
Risposta accettata
Più risposte (2)
Saira Khalid
il 3 Lug 2018
0 voti
can you tell what is the initial value of xx and yy? @ amitesh kumar
5 Commenti
Walter Roberson
il 3 Lug 2018
xx = 1; yy = 64;
Saira Khalid
il 5 Lug 2018
Modificato: Saira Khalid
il 5 Lug 2018
I have tried. My code is given below. It's giving an error. Index exceeds matrix dimensions.
Error in block_wise_embedd (line 9) Block2(:,:,xx:yy)=Block2(:,:,xx:yy)+ aa*Block5(:,:,1:64);
Block2=imread('lena.jpg');
Block2=im2double(Block2);
Block2=imresize(Block2,[512 512]);
Block5=imread('logo.jpg');
Block5=im2double(Block5);
Block5=imresize(Block5,[64 64]);
xx = 1; yy = 64; aa=1;
for R22=1:64
Block2(:,:,xx:yy)=Block2(:,:,xx:yy)+ aa*Block5(:,:,1:64);
xx=64*(R22)+1;
yy=xx+63;
end
Please check it how to resolve.
Walter Roberson
il 5 Lug 2018
The original poster appears to have converted the image into an 8 x 8 x (blocks) array. Also I am fairly sure the original poster was working with grayscale rather than RGB (you are almost certainly working with RGB, as you are using JPEG and very few JPEG files are really grayscale -- grayscale JPEG image are almost always RGB images that have all three planes the same value.)
Saira Khalid
il 5 Lug 2018
Modificato: Saira Khalid
il 5 Lug 2018
I have also tried with png . "Index exceeds matrix dimensions." Error
Block2=imread('erd.png');
Block2=im2double(Block2);
Block2=imresize(Block2,[512 512]);
Block2=rgb2gray(Block2);
imshow(Block2);
Block5=imread('logo.png');
Block5=im2double(Block5);
Block5=imresize(Block5,[64 64]);
xx = 1; yy = 64;aa=1;
for R22=1:64
Block2(:,:,xx:yy)=Block2(:,:,xx:yy)+ aa*Block5(:,:,1:64);
xx=64*(R22)+1;
yy=xx+63;
end
Walter Roberson
il 6 Lug 2018
You have not converted your image into an 8 x 8 x (number of blocks) array. For example you could use https://www.mathworks.com/matlabcentral/fileexchange/25763-tile and then
Block2 = cat(3, tiles{:})
xingxingcui
il 13 Set 2021
Modificato: xingxingcui
il 27 Apr 2024
0 voti
see here: add watermark to image
-------------------------Off-topic interlude, 2024-------------------------------
I am currently looking for a job in the field of CV algorithm development, based in Shenzhen, Guangdong, China,or a remote support position. I would be very grateful if anyone is willing to offer me a job or make a recommendation. My preliminary resume can be found at: https://cuixing158.github.io/about/ . Thank you!
Email: cuixingxing150@gmail.com
Categorie
Scopri di più su Watermarking in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!