Watermarking and pseudo random generator
2 views (last 30 days)
Show older comments
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
0 Comments
Answers (2)
Matt J
on 23 Oct 2012
y=mat2tiles(a,[8,8]);
Then you can get the (i,j)-th block just by doing y{i,j}.
0 Comments
Walter Roberson
on 23 Oct 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()
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!