Extract a hidden message from image

조회 수: 1 (최근 30일)
Nemo
Nemo 2016년 5월 3일
편집: Image Analyst 2020년 10월 19일
I'm trying to write a matlab code to extract a hidden message from a given image. The hidden message is the first half of the odd part of this image. Whenever I run my code I get a black image. Any suggestions?
image=imread('hidden.png');
new=fliplr(image);
odd=(image-new)/2 ;
imshow(odd);
  댓글 수: 3
Nemo
Nemo 2016년 5월 4일
O.K I researched the problem more and I realized this: If the image is made up of 3 elements n for (width) x1[n] for height and x2[n] for color then the odd part means (x1[n]-x1[-n]/2) .
Nemo
Nemo 2016년 5월 4일
편집: Nemo 2016년 5월 4일
I actually realized something else the above code doesn't give a black image like I thought. It gives the hidden image for half of the width of the original picture. However the hidden image is too dark that I couldn't see it. So now I have two questions? 1.How to make the image brighter 2.How to read only half of the image width?

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

채택된 답변

Image Analyst
Image Analyst 2016년 5월 4일
Make the image brighter by using [] in imshow():
imshow(odd, []);
  댓글 수: 2
Nemo
Nemo 2016년 5월 4일
I tried it. Still the same.
Image Analyst
Image Analyst 2016년 5월 5일
I do this and the image shows up. granted, it's a bit dark but considering what you're doing to it, that's not unexpected.
rgbImage = imread('peppers.png');
subplot(2,2,1);
imshow(rgbImage);
fontSize = 18;
title('Original Image', 'FontSize', fontSize);
new = fliplr(rgbImage);
subplot(2,2,2);
imshow(new);
title('New Image', 'FontSize', fontSize);
odd = (rgbImage - new)/2 ;
subplot(2,2,3);
imshow(odd);
title('Odd Image', 'FontSize', fontSize);

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

추가 답변 (2개)

Walter Roberson
Walter Roberson 2016년 5월 4일
I am going to guess here:
wid = size(YourImage,2);
hwid = floor(wid/2);
odd = (double(YourImage(:,1:hwid)) - double( fliplr(YourImage(:,end-hwid+1:end)) )) / 2;
shifted_odd = odd - min(odd(:));
scaled_odd = shifted_odd ./ max(shifted_odd(:));
imshow(scaled_odd);
  댓글 수: 2
Nemo
Nemo 2016년 5월 4일
The above code displayed the correct dimension (half of the image width) but the picture is now black and white and I still can't see the hidden message which is a coloured image. But thank you anyway for trying to help
Walter Roberson
Walter Roberson 2016년 5월 4일
You might need
imshow(scaled_odd, [])
Remember, though, that the hidden image cannot be a colored image, because colored images require 3 dimensional arrays but you are working with two dimensional arrays.

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


Ashton M Spillman
Ashton M Spillman 2020년 10월 18일
bro idk
  댓글 수: 1
Image Analyst
Image Analyst 2020년 10월 19일
편집: Image Analyst 2020년 10월 19일
Then don't feel compelled to post an answer.
Anyway, I posted a full complete demo 4 and a half years ago for Nemo, which worked despite him not accepting any answer.

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

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by