Effacer les filtres
Effacer les filtres

How to retrieve an embedded image from a .png image?

6 vues (au cours des 30 derniers jours)
Ahmad Al Hamdan
Ahmad Al Hamdan le 30 Mai 2020
Commenté : Ahmad Al Hamdan le 3 Juin 2020
Hello, I have a university steganography project where I need to retreive a hidden image from a .png RGB image. The embedded image is hidden in the LSBs of the original .png image. I am having problems extracting the hidden information from the image, does anyone have a code that does a similar function?
Thank you

Réponse acceptée

Abhisek Pradhan
Abhisek Pradhan le 3 Juin 2020
Considering it as an 16-bit image. The primary image is stored in the most significant byte, while the secondary image is stored in the least significant byte.
Decomposing the image :
imdata = imread('image.png');
Converting RGB 3-D Array to a Vector and typecasting to unit8 (in case the hidden image is stored in the 8 LSBs ).
pixelVals = imData(:);
pixelValsConv = typecast(pixelVals, 'uint8');
Separating both the images:
% This generates a 2D array with first column denoting the most significant digit and the second column
% denoting least significant digit.
pixelValsConv = reshape(pixelValsConv, 2, [])';
imDataPrimary = reshape(pixelValsConv(:, imOrder(1)), size(imData));
imDataSecondary = reshape(pixelValsConv(:, imOrder(2)), size(imData));
Displaying both the images:
figure;imshow(imDataPrimary);
figure;imshow(imDataSecondary);

Plus de réponses (0)

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by