Image processing using chaotic map

The chaotic tent map is given by:
xi+1 = f (xi,μ)
(f (xi,μ)= μxi, if xi < 0.5
μ(1−xi), otherwise;) ……………… Eq.1
where xi ∈[ 0,1], for i ≥ 0. This map transforms an interval [0, 1] onto itself and contains only one control parameter μ, respectively, where μ ∈[ 0,2].
Steps:
(1) Read plain-images (original image) (Ma×b), get size of M, e.g., use [a, b, c] to save the size of M, a = 256, b = 256, c = 3, let N = a∗b∗c, and initiate control parameter (μ) of the chaotic tent map.
(2) Input the secret (encryption) key x0 into the algorithm. Iterate the chaotic tent map N times using equation 1, and obtain the key array x(n), the size of x(n) is N;
(3) Encrypt each element of matrix (Ma×b) using the key array x(n), that is, mix the original image M(a×b) components with the key array x(n);
(4) The resulting image of step (3) is the ciphered image.
Coding:
M=imread('cameraman.tif');
[a,b] = size(M);
N=a*b;
u=1.999;
x(1)=0.5;
for i=1:N
if x(i) < 0.5 %and condition
x(i+1)=u*x(i); %is it right
else
if x(i) >= 0.5 %and this condition
x(i+1)=u*(1-x(i)); %is it right
end
end
end
r=xor(x(i+1),M);
I wrote this code by following the steps mentioned above(research paper attached). I also attached the required output but i am getting a full white or full black image. Can someone help me identify the problem.

1 件のコメント

Karbala'a Unvi. Science
Karbala'a Unvi. Science 2020 年 6 月 15 日
Dear Sir,
will you send me the final code to look at it and find how did you get the result..
Thanks in advance
Your
Dr.Zeyad

サインインしてコメントする。

 採用された回答

Walter Roberson
Walter Roberson 2019 年 7 月 23 日

0 投票

Your final r is a scalar double. You will not get much from it.
Your x will be a vector double. You would need to reshape it and uint8 it.

3 件のコメント

Nazish
Nazish 2019 年 7 月 24 日
Thank you.. stay blessed
Shankar R
Shankar R 2021 年 3 月 29 日
Wts wrong in above code.. ? I am not getting output?? Can you explain?
Walter Roberson
Walter Roberson 2021 年 3 月 29 日
r = bitxor(im2uint8(reshape(x(2:end),a,b)),M);

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeDisplay Image についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by