フィルターのクリア

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

7 ビュー (過去 30 日間)
Ahmad Al Hamdan
Ahmad Al Hamdan 2020 年 5 月 30 日
コメント済み: Ahmad Al Hamdan 2020 年 6 月 3 日
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

採用された回答

Abhisek Pradhan
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);
  1 件のコメント
Ahmad Al Hamdan
Ahmad Al Hamdan 2020 年 6 月 3 日
Thank you that was really helpful

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

その他の回答 (0 件)

製品

Community Treasure Hunt

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

Start Hunting!

Translated by