Watermarking and pseudo random generator

2 ビュー (過去 30 日間)
sreenivas
sreenivas 2012 年 10 月 23 日
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

回答 (2 件)

Matt J
Matt J 2012 年 10 月 23 日
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 2012 年 10 月 23 日
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