2D baker map code implementation

8 次查看(过去 30 天)
I am trying to implement the discretized baker map for the shuffling of pixels,i am not able to understand the discretized version of it clearly.and neither am i able to implement it properly on matlab it always show index out of bounds error. here is the link http://link.springer.com/chapter/10.1007/978-3-540-95972-4_16 please can somebody help. I am a beginner and this is my effort at it i know it is pathetic but still.
for i=1:row
for j=1:col
if(1<=j<row/2)
newcord1=((2*(j-1))+mod(i-1,2));
newcord2=(floor(0.5*(i-mod(i-1,2))+1));
im(i,j)=im(newcord2,newcord1);
elseif(row/2 <=j <=row)
newcord1=((2*(j-64))+mod(i,2));
newcord2=floor(0.5*(i-mod(i,2))+63);
im(i,j)=im(newcord2,newcord1);
end
end
end
  5 个评论
Zeina Abdullah
Zeina Abdullah 2022-2-21
Hi , please can you help me i need a chaotic interleaver code using baker map . please tell any thing can help me in my problem . @Parveiz Lone @su su maung @Syahirah Rahim @myetceteramail myetceteramail @Walter Roberson
Zeina Abdullah
Zeina Abdullah 2022-2-22
@su su maung if the input 8*8 how dose the code will be change

请先登录,再进行评论。

回答(1 个)

Walter Roberson
Walter Roberson 2017-1-12
if(1<=j<row/2)
means
if ((1<=j)<row/2)
The first part, 1<=j, returns false (0) or true (1). That 0 or 1 is then compared to row/2.
You probably want
if 1<=j && j<row/2

类别

Help CenterFile Exchange 中查找有关 Image Processing and Computer Vision 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by