필터 지우기
필터 지우기

How to XOR the pixel values of image with a matrix containing decimal numbers?

조회 수: 1 (최근 30일)
Sri Lakshmi
Sri Lakshmi 2018년 2월 16일
편집: Abubakar Abba 2021년 8월 2일
I am performing image encryption using key values of chaotic maps. I have converted the key values from vector into a matrix. The matrix size is 32*96 and the image is of size 32*96. I have to XOR each pixel of the image with the key present in the matrix. I am using color image. Thanks in advance

답변 (1개)

Shounak Shastri
Shounak Shastri 2018년 2월 16일
편집: Shounak Shastri 2018년 2월 16일
_"I am using color image."_
Lets say your input image is I.
I = imread ('image.tif');
If you check the workspace after you execute this line, you would have
size (I) = [32 96 3];
The last 3 represents the Red, Green and Blue components of the image. You can use rgb2gray to convert it into a grayscale image. If you want to xor the colour image, then you would either need more chaos coordinates or you would have to use the same coordinates three times on the three planes saperately.
_"I am performing image encryption using key values of chaotic maps."_
Now, your chaos coordinates might be floating point numbers. So you can sort them by
[a, ind] = sort (chaosCoordinates);
Once you do this, you would have the chaotic values in "a" and their indices in "ind". You can now convert the vector of indices in a matrix of the size you need. This is easier than converting the chaos coordinates to integer values.
now you can simply do bitxor to get the encrypted image.
  댓글 수: 1
Abubakar Abba
Abubakar Abba 2021년 8월 2일
편집: Abubakar Abba 2021년 8월 2일
Nice. How about decrypting it to get back the original image using bitxor after applying the bitxor as stated?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Encryption / Cryptography에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by