Watermarking and pseudo random generator

2 visualizzazioni (ultimi 30 giorni)
sreenivas
sreenivas il 23 Ott 2012
Hi I want to access 8x8 matrix from the the 512x512 main matrix.Can I access the block through the blockproc function from the image toolbox?Do we get the indexing of these blocks?
I also tried doing it in the different way by writing the following code for one dimension.
a=rand(512);
y=zeros;
for i=2:64
m=1;
y(i)=a(m+8:8*i);
m=m+1;
%i=i+1;
end
But I am getting the below mentioned error.
"In an assignment A(I) = B, the number of elements in B and I must be the same."
What wrong am I doing and also could somebody tell me about the pseudo random number system where we can control the seed and get the key.
Thx, Sreeni

Risposte (2)

Matt J
Matt J il 23 Ott 2012
You can use MAT2TILES, available here, to break the image into 8x8 cells
y=mat2tiles(a,[8,8]);
Then you can get the (i,j)-th block just by doing y{i,j}.

Walter Roberson
Walter Roberson il 23 Ott 2012
Change
y(i)=a(m+8:8*i);
to
y{i} = a(m+8:8*i);
If you are using a relatively recent version of MATLAB, see the documentation for rng()

Community Treasure Hunt

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

Start Hunting!

Translated by