How to retrieve an embedded image from a .png image?
18 ビュー (過去 30 日間)
古いコメントを表示
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
0 件のコメント
採用された回答
Abhisek Pradhan
2020 年 6 月 3 日
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);
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Encryption / Cryptography についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!