How to scramble an image using Gyrator transform? matlab code?

16 ビュー (過去 30 日間)
Aberna P
Aberna P 2023 年 1 月 10 日
コメント済み: Aberna P 2023 年 4 月 21 日
Need to scramble the image using gyrator trnasform? Is their any tool for that?

採用された回答

Nayan
Nayan 2023 年 4 月 5 日
Hi
Though the gyrator transform is not directly available in MATLAB. You could use the FFT and permutation matrix.
Find the attached code to scramble an Image using the Gyrator transform.
Hope this helps!
% Read the input image
img = imread('1680714900716.jpg');
% Convert the input image to grayscale
if size(img, 3) == 3
img = rgb2gray(img);
end
% Generate a random permutation matrix
N = size(img, 1);
P = eye(N);
ind = randperm(N);
P = P(ind,:);
% Compute the Fourier transform of the input image
F = fft2(img);
% Compute the gyrator transform matrix
G = diag(exp(2*pi*1i*(0:N-1)/N));
G = P*G*P';
% Apply the gyrator transform to the Fourier coefficients of the input image
F_scrambled = G*F*G';
% Compute the inverse Fourier transform of the scrambled Fourier coefficients
img_scrambled = ifft2(F_scrambled);
% Display the input and scrambled images
figure;
subplot(1, 2, 1); imshow(img); title('Input image');
subplot(1, 2, 2); imshow(abs(img_scrambled),[]); title('Scrambled image');
  2 件のコメント
lse owen
lse owen 2023 年 4 月 11 日
Thanks! Is there any way to calculate the permutation matrix according to the rotation angle?
Aberna P
Aberna P 2023 年 4 月 21 日
Thank you so much nayan...how to perform inverse process of it?

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImages についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by