Thread Subject: I need to help?

Subject: I need to help?

From: love

Date: 19 Sep, 2008 16:39:01

Message: 1 of 21

Hello all

run program in Matlab and try to understand the program:

1- find the quality at different ‘strength’ value. Plot a graph of the quality of the stego image and the reconstructed image vs ‘strength’.

--------------------program------------------
clear all
close all
[InputFileName, InputPathName] = uigetfile('c:\images\256\*.tif', 'Select Input Image');
   InputImageName = strcat(InputPathName,InputFileName)
    cover=imread(InputImageName);
    
% if(~isgray(cover))
% cover=rgb2gray(cover);
% end
    
    figure
    imshow(cover,[]) %Display the cover image
   
    [InputFileName, InputPathName] = uigetfile('c:\images\256\*.tif', 'Select Image to hide');
   InputImageName = strcat(InputPathName,InputFileName)
    hidden=imread(InputImageName);
    
    figure(1), title('Original image');
% if(~isgray(hidden))
% hidden=rgb2gray(hidden);
% end
    figure, imshow(hidden,[])
   figure(2), title('To be hidden');
    
    strength = input('Robustness of the watermark? (least = 1 to most = 50) ');
    alpha = .01; %Strength of the hidden information
    
    stego = (1-alpha) * cover + alpha * hidden;
    
    figure, imshow(stego, []);
    title('watermarked original');
    reconstructed = (stego - (1-alpha) * cover)./alpha;
    figure, imshow(reconstructed, []);
    title('Extracted')
    
    %%%See the difference between reconstructed and hidden
    diff = hidden - reconstructed;
------------------------------

thanks

Subject: I need to help?

From: ImageAnalyst

Date: 19 Sep, 2008 16:54:08

Message: 2 of 21

On Sep 19, 12:39=A0pm, "love " <love.scre...@gmail.com> wrote:
> Hello all
>
> run program in Matlab and try to understand the program:
>
> 1- find the quality at different ‘strength’ value. Plot a gra=
ph of the quality of =A0the stego image and the reconstructed image vs R=
16;strength’.
>
> --------------------program------------------
> clear all
> close all
> [InputFileName, InputPathName] =3D uigetfile('c:\images\256\*.tif', 'Sele=
ct Input Image');
> =A0 =A0InputImageName =3D strcat(InputPathName,InputFileName)
> =A0 =A0 cover=3Dimread(InputImageName);
>
> % =A0 =A0 if(~isgray(cover))
> % =A0 =A0 =A0 =A0 cover=3Drgb2gray(cover);
> % =A0 =A0 end
>
> =A0 =A0 figure
> =A0 =A0 imshow(cover,[]) =A0 %Display the cover image
>
> =A0 =A0 [InputFileName, InputPathName] =3D uigetfile('c:\images\256\*.tif=
', 'Select =A0Image to hide');
> =A0 =A0InputImageName =3D strcat(InputPathName,InputFileName)
> =A0 =A0 hidden=3Dimread(InputImageName);
>
> =A0 =A0 figure(1), title('Original image');
> % =A0 =A0 if(~isgray(hidden))
> % =A0 =A0 =A0 =A0 hidden=3Drgb2gray(hidden);
> % =A0 =A0 end
> =A0 =A0 figure, imshow(hidden,[])
> =A0 =A0figure(2), =A0title('To be hidden');
>
> =A0 =A0 strength =3D input('Robustness of the watermark? (least =3D 1 to =
most =3D 50) ');
> =A0 =A0 alpha =3D .01; %Strength of the hidden information
>
> =A0 =A0 stego =3D (1-alpha) * cover + alpha * hidden;
>
> =A0 =A0 figure, imshow(stego, []);
> =A0 =A0 title('watermarked original');
> =A0 =A0 reconstructed =3D (stego - (1-alpha) * cover)./alpha;
> =A0 =A0 figure, imshow(reconstructed, []);
> =A0 =A0 title('Extracted')
>
> =A0 =A0 %%%See the difference between reconstructed and hidden
> =A0 =A0 diff =3D hidden - reconstructed;
> ------------------------------
>
> thanks
---------------------------------------------------------------------------=
-----------
"love":
I didn't need to run it - I can tell just from reading the code.
Basically it blends two images together and asks you to give a
subjective rating on the "robustness" (whatever that is) of the
watermark. You'd need to define "robustness" better and then, after
you've plotted robustness vs. blending percentage, make some kind of
subjective call about which blending factor is "best." This is a very
simple to construct and very visible type of watermark. It's not
really steganography because it's not hidden. There are so many ways
to hide one image in another that can't be detected as easily as your
method and can only be found with knowledge of how it was
constructed. You could think up your own with a little thought, but
this blending method is not a very effective one.
You're welcome.
Did I win?
Regards,
ImageAnalyst

Subject: I need to help?

From: ABUTALA

Date: 19 Sep, 2008 17:04:04

Message: 3 of 21


> "love":
> I didn't need to run it - I can tell just from reading the code.
> Basically it blends two images together and asks you to give a
> subjective rating on the "robustness" (whatever that is) of the
> watermark. You'd need to define "robustness" better and then, after
> you've plotted robustness vs. blending percentage, make some kind of
> subjective call about which blending factor is "best." This is a very
> simple to construct and very visible type of watermark. It's not
> really steganography because it's not hidden. There are so many ways
> to hide one image in another that can't be detected as easily as your
> method and can only be found with knowledge of how it was
> constructed. You could think up your own with a little thought, but
> this blending method is not a very effective one.
> You're welcome.
> Did I win?
> Regards,
> ImageAnalyst

Thank ImageAnalyst

I want to know the quality between images by PSNR(A,B)?

THANKS

Subject: I need to help?

From: ImageAnalyst

Date: 19 Sep, 2008 17:36:11

Message: 4 of 21

On Sep 19, 1:04=A0pm, "ABUTALA " <love.scre...@gmail.com> wrote:
> > "love":
> > I didn't need to run it - I can tell just from reading the code.
> > Basically it blends two images together and asks you to give a
> > subjective rating on the "robustness" (whatever that is) of the
> > watermark. =A0You'd need to define "robustness" better and then, after
> > you've plotted robustness vs. blending percentage, make some kind of
> > subjective call about which blending factor is "best." =A0This is a ver=
y
> > simple to construct and very visible type of watermark. =A0It's not
> > really steganography because it's not hidden. =A0There are so many ways
> > to hide one image in another that can't be detected as easily as your
> > method and can only be found with knowledge of how it was
> > constructed. =A0You could think up your own with a little thought, but
> > this blending method is not a very effective one.
> > You're welcome.
> > Did I win?
> > Regards,
> > ImageAnalyst
>
> Thank ImageAnalyst
>
> I want to know the quality between images by PSNR(A,B)?
>
> THANKS- Hide quoted text -
>
> - Show quoted text -

------------------------------------------------------------------------
ABUTALA:
MATLAB has a defnition of PSNR at
http://www.mathworks.com/access/helpdesk/help/toolbox/vipblks/ref/psnr.html
So you're going to plot psnr vs. human_visual_grade?
By the way, is this related to love's question or is this some
completely separate question? How are you related to love?
Regards,
ImageAnalyst

Subject: I need to help?

From: ABUTALA

Date: 19 Sep, 2008 18:51:02

Message: 5 of 21

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <5e356f60-dbfd-46b3-9034-0e72a4a0e71e@x35g2000hsb.googlegroups.com>...
> On Sep 19, 1:04=A0pm, "ABUTALA " <love.scre...@gmail.com> wrote:
> > > "love":
> > > I didn't need to run it - I can tell just from reading the code.
> > > Basically it blends two images together and asks you to give a
> > > subjective rating on the "robustness" (whatever that is) of the
> > > watermark. =A0You'd need to define "robustness" better and then, after
> > > you've plotted robustness vs. blending percentage, make some kind of
> > > subjective call about which blending factor is "best." =A0This is a ver=
> y
> > > simple to construct and very visible type of watermark. =A0It's not
> > > really steganography because it's not hidden. =A0There are so many ways
> > > to hide one image in another that can't be detected as easily as your
> > > method and can only be found with knowledge of how it was
> > > constructed. =A0You could think up your own with a little thought, but
> > > this blending method is not a very effective one.
> > > You're welcome.
> > > Did I win?
> > > Regards,
> > > ImageAnalyst
> >
> > Thank ImageAnalyst
> >
> > I want to know the quality between images by PSNR(A,B)?
> >
> > THANKS- Hide quoted text -
> >
> > - Show quoted text -
>
> ------------------------------------------------------------------------
> ABUTALA:
> MATLAB has a defnition of PSNR at
> http://www.mathworks.com/access/helpdesk/help/toolbox/vipblks/ref/psnr.html
> So you're going to plot psnr vs. human_visual_grade?
> By the way, is this related to love's question or is this some
> completely separate question? How are you related to love?
> Regards,
> ImageAnalyst

thank you

i did but i need to run program and i see thr result?

love-- it is nickname only

Subject: I need to help?

From: ImageAnalyst

Date: 19 Sep, 2008 19:37:27

Message: 6 of 21

On Sep 19, 2:51=A0pm, "ABUTALA " <love.scre...@gmail.com> wrote:
> ImageAnalyst <imageanal...@mailinator.com> wrote in message <5e356f60-dbf=
d-46b3-9034-0e72a4a0e...@x35g2000hsb.googlegroups.com>...
> > On Sep 19, 1:04=3DA0pm, "ABUTALA " <love.scre...@gmail.com> wrote:
> > > > "love":
> > > > I didn't need to run it - I can tell just from reading the code.
> > > > Basically it blends two images together and asks you to give a
> > > > subjective rating on the "robustness" (whatever that is) of the
> > > > watermark. =3DA0You'd need to define "robustness" better and then, =
after
> > > > you've plotted robustness vs. blending percentage, make some kind o=
f
> > > > subjective call about which blending factor is "best." =3DA0This is=
 a ver=3D
> > y
> > > > simple to construct and very visible type of watermark. =3DA0It's n=
ot
> > > > really steganography because it's not hidden. =3DA0There are so man=
y ways
> > > > to hide one image in another that can't be detected as easily as yo=
ur
> > > > method and can only be found with knowledge of how it was
> > > > constructed. =3DA0You could think up your own with a little thought=
, but
> > > > this blending method is not a very effective one.
> > > > You're welcome.
> > > > Did I win?
> > > > Regards,
> > > > ImageAnalyst
>
> > > Thank ImageAnalyst
>
> > > I want to know the quality between images by PSNR(A,B)?
>
> > > THANKS- Hide quoted text -
>
> > > - Show quoted text -
>
> > -----------------------------------------------------------------------=
-
> > ABUTALA:
> > MATLAB has a defnition of PSNR at
> >http://www.mathworks.com/access/helpdesk/help/toolbox/vipblks/ref/psn...
> > So you're going to plot psnr vs. human_visual_grade?
> > By the way, is this related to love's question or is this some
> > completely separate question? =A0How are you related to love?
> > Regards,
> > ImageAnalyst
>
> thank you
>
> i did but i need to run program and i see thr result?
>
> love-- it is nickname only- Hide quoted text -
>
> - Show quoted text -

-----------------------------------------------------
Well . . . Yeah! How else are things going to happen?
Good luck,
ImageAnalyst

Subject: I need to help?

From: ABUTALA

Date: 19 Sep, 2008 20:49:02

Message: 7 of 21

Thank

I run program :
[


clear all
close all




[InputFileName, InputPathName] = uigetfile('*.tif', 'Select Input Image');
   InputImageName = strcat(InputPathName,InputFileName)
    cover=imread(InputImageName);
    
    if(~isgray(cover))
        cover=rgb2gray(cover);
    end
    
    figure, imshow(cover,[]) %Display the cover image
    
    [InputFileName, InputPathName] = uigetfile('*.tif', 'Select Image to hide');
   InputImageName = strcat(InputPathName,InputFileName)
    hidden=imread(InputImageName);
    
    if(~isgray(hidden))
        hidden=rgb2gray(hidden);
    end
    figure, imshow(hidden,[])
    alpha = .02; %Strength of the hidden information
    stego = (1-alpha) * cover + alpha * hidden;
    
    figure, imshow(stego, []);
    reconstructed = (stego - (1-alpha) * cover)./alpha;
    figure, imshow(reconstructed, []);
    
    %%%See the difference between reconstructed and hidden
    diff = hidden - reconstructed;
  
if reconstructed == hidden
   error('Images are identical: PSNR has infinite value')
end

max2_A = max(max(reconstructed));
max2_B = max(max(hidden));
min2_A = min(min(reconstructed));
min2_B = min(min(hidden));


er = reconstructed - hidden;
decibels = 20*log10(255/(sqrt(mean(mean(er.^2)))))
plot(stego,reconstructed)

]

the result :

>> f

InputImageName =

E:\MatLAB\work\NewFolder1\demi256.tif

Warning: isgray is obsolete and may be removed in the future.
See product release notes for more information.
> In isgray at 27 % what is this?
  In f at 14 %what is this?Error or no ,i got it when i run.

InputImageName =

E:\MatLAB\work\NewFolder1\demi256.tif

Warning: isgray is obsolete and may be removed in the future.
See product release notes for more information.
> In isgray at 27
  In f at 24

decibels =

   30.3911 % this is difference between images or no?



Please help me?

Subject: I need to help?

From: Walter Roberson

Date: 19 Sep, 2008 21:49:22

Message: 8 of 21

ABUTALA wrote:

> cover=imread(InputImageName);
> if(~isgray(cover))
> cover=rgb2gray(cover);
> end

Replace those lines with:

  cover = imread(InputImageName);
  if ndims(cover) == 3
    cover = rgb2gray(cover);
  end


> hidden=imread(InputImageName);
> if(~isgray(hidden))
> hidden=rgb2gray(hidden);
> end

Replace those lines with:

  hidden = imread(InputImageName);
  if ndims(hidden) == 3
    hidden = rgb2gray(hidden);
  end

 
> Warning: isgray is obsolete and may be removed in the future.
> See product release notes for more information.
>> In isgray at 27 % what is this?

27 is the line number in the isgray() function at which the warning
was issued. If you want more information about -why- isgray() is
being made obsolete, following the instructions given in the
warning message by reading the product release notes.

> In f at 14 %what is this?Error or no ,i got it when i run.

14 is the line number in f which contained the call to isgray()
that issued the warning.

If this had been an error, the message would have started with
'Error:'. But it starts with 'Warning:' so it is a warning,
not an error.

> decibels =
> 30.3911 % this is difference between images or no?

The -difference- between picture C and picture D is that picture C
is an image of a cat, and picture D is an image of a dog.
What you see printed out is a -measurement- of certain mathematical
properties.

"Ceci, n'est pas une pipe."
http://en.wikipedia.org/wiki/The_Treachery_of_Images

Subject: I need to help?

From: ABUTALA

Date: 19 Sep, 2008 23:57:01

Message: 9 of 21

Walter Roberson <roberson@hushmail.com> wrote in message <j7VAk.522$zk7.162@newsfe06.iad>...
> ABUTALA wrote:
>
> > cover=imread(InputImageName);
> > if(~isgray(cover))
> > cover=rgb2gray(cover);
> > end
>
> Replace those lines with:
>
> cover = imread(InputImageName);
> if ndims(cover) == 3
> cover = rgb2gray(cover);
> end
>
>
> > hidden=imread(InputImageName);
> > if(~isgray(hidden))
> > hidden=rgb2gray(hidden);
> > end
>
> Replace those lines with:
>
> hidden = imread(InputImageName);
> if ndims(hidden) == 3
> hidden = rgb2gray(hidden);
> end
>
>
> > Warning: isgray is obsolete and may be removed in the future.
> > See product release notes for more information.
> >> In isgray at 27 % what is this?
>
> 27 is the line number in the isgray() function at which the warning
> was issued. If you want more information about -why- isgray() is
> being made obsolete, following the instructions given in the
> warning message by reading the product release notes.
>
> > In f at 14 %what is this?Error or no ,i got it when i run.
>
> 14 is the line number in f which contained the call to isgray()
> that issued the warning.


Thank you so much, I run program again after replaced the lines and i didnt see error.
the result:


>> f

InputImageName =

E:\MatLAB\work\NewFolder1\kids.tif


InputImageName =

E:\MatLAB\work\NewFolder1\kids.tif


decibels =

   29.4771

What is this number because i want to know (find the quality at different ‘strength’ value. Plot a graph of the quality of the stego image and the reconstructed image vs ‘strength’.)
Can you help to answer this?

regards
>
> If this had been an error, the message would have started with
> 'Error:'. But it starts with 'Warning:' so it is a warning,
> not an error.
>
> > decibels =
> > 30.3911 % this is difference between images or no?
>
> The -difference- between picture C and picture D is that picture C
> is an image of a cat, and picture D is an image of a dog.
> What you see printed out is a -measurement- of certain mathematical
> properties.
>
> "Ceci, n'est pas une pipe."
> http://en.wikipedia.org/wiki/The_Treachery_of_Images

Subject: I need to help?

From: ABUTALA

Date: 21 Sep, 2008 03:13:09

Message: 10 of 21

No one help me?

Subject: I need to help?

From: Walter Roberson

Date: 21 Sep, 2008 08:38:17

Message: 11 of 21

ABUTALA wrote:

> decibels =
>
> 29.4771
 
> What is this number

The number is an arbitrary value calculated by the program for no apparent
reason and accidentally printed out because the line that calculates it
has a missing semi-colon at the end.

> because i want to know (find the quality at different ‘strength’ value.
> Plot a graph of the quality of the stego image and the reconstructed image
> vs ‘strength’.)
> Can you help to answer this?

I would say that to answer that, you are going to have to choose a precise
definition for "quality", and you are going to have to choose a value
range for "strength". At least the code -mentions- "strength" (in one of
the comments) so you have a fighting chance of figuring out what the
valid range is for "strength". Unfortunately there is no scientific definition
for "quality" when it comes to images built from mathematical arrays.
What is the "quality" associated with an image of a cat? What is the "quality"
associated with an image of a dog? How does the image of the cat differ from
the cat itself?

Subject: I need to help?

From: ABUTALA

Date: 21 Sep, 2008 10:37:02

Message: 12 of 21

Thank Walter Roberson

Please run program and show me how can calculate quality at different ‘strength’ value?
and
Plot a graph of the quality of the stego image and the reconstructed image vs ‘strength’?

yours

Subject: I need to help?

From: ImageAnalyst

Date: 21 Sep, 2008 13:34:32

Message: 13 of 21

On Sep 21, 4:38=A0am, Walter Roberson <rober...@hushmail.com> wrote:
> ABUTALA wrote:
> > decibels =3D
>
> > =A0 =A029.4771
> > What is this number
>
> The number is an arbitrary value calculated by the program for no apparen=
t
> reason and accidentally printed out because the line that calculates it
> has a missing semi-colon at the end.
>
> > because i want to know (find the quality at different ‘strength&#=
8217; value.
> > Plot a graph of the quality of =A0the stego image and the reconstructed=
 image
> > =A0vs ‘strength’.)
> > Can you help to answer this?
>
> I would say that to answer that, you are going to have to choose a precis=
e
> definition for "quality", and you are going to have to choose a value
> range for "strength". At least the code -mentions- "strength" (in one of
> the comments) so you have a fighting chance of figuring out what the
> valid range is for "strength". Unfortunately there is no scientific defin=
ition
> for "quality" when it comes to images built from mathematical arrays.
> What is the "quality" associated with an image of a cat? What is the "qua=
lity"
> associated with an image of a dog? How does the image of the cat differ f=
rom
> the cat itself?

---------------------------------------------------------------------------=
----
Walter's right again as usual. PSNR is not really a quality metric in
the context that you're using it. It's meant to be used to determine
how close a reconstructed image is to the original image, For example
if you take an image and then compress it and decompress it, and then
compare that to the original. I don't think it really makes too much
sense in watermarking. PSNR will be max for no watermark at all and
get less as the watermark gets bigger or more contrasty, neither of
which is related to the "quality" ro effectiveness of the watermark in
doing its job. I think you should use a different criteria to assess
the effectiveness of your watermarking.
Regards,
ImageAnalyst

Subject: I need to help?

From: Walter Roberson

Date: 21 Sep, 2008 16:54:47

Message: 14 of 21

ABUTALA wrote:
> Thank Walter Roberson
>
> Please run program and show me how can calculate quality at different
> ‘strength’ value?

Well, since you have left it to me to define what "quality" is, I suggest
that you simply add

quality = -8.3156;

near the beginning of your program. The plot of quality versus strength
would then of course be simply a horizontal line, trivial to plot.


If you were feeling particularly creative, instead of using a constant
for quality, you could put

tic

after you read the second image

and then

quality = toc;

after you finish reconstructing the image. That would define "quality" as
the amount of time required to do the image processing, which is at
least a better random definition of "quality" than many of the other
possibilities.


But if I were you, I would go back to the beginning of the chapter and re-read
the text (or course notes) looking for references to "quality" and seeing
how it is defined -for the purposes of your assignment-.


But you are clearly lost on another aspect of your assignment other than just
what "quality" means. In order to plot quality vs strength, after you read
in the two images, loop over the main part of your code, using a different
strength for each iteration, calculating the quality at that strength
and recording the. After the end of your loop, after having processed
all of the different strengths, plot the remembered qualities against
the strengths.

For example,

M=-8,MM=11,S=111;
Q=M(M~=M);
for strength=M:(MM-M)/S:MM
  %at this point, watermark the image with the current strength, and
  %calculate the quality of the resulting image. Then,
  Q(end+1)=quality;
end

plot(M:(MM-M)/S:MM,Q);


(Yes, this code -has- been deliberately written poorly: it is a brief
example to outline what has to be done, with the expectation that
once you have seen the bare concept, you will do whatever re-writing
is appropriate.

Subject: I need to help?

From: ABUTALA

Date: 21 Sep, 2008 18:48:03

Message: 15 of 21

Thank Walter Roberson.

Well, what is code that i add it to program and then program find the quality?


program :
clear all
close all
[InputFileName, InputPathName] = uigetfile('*.tif', 'Select Input Image');
   InputImageName = strcat(InputPathName,InputFileName)
    cover=imread(InputImageName);
    
    if ndims(cover) == 3
    cover = rgb2gray(cover);
  end
    
    figure, imshow(cover,[]) %Display the cover image
    
    [InputFileName, InputPathName] = uigetfile('*.tif', 'Select Image to hide');
   InputImageName = strcat(InputPathName,InputFileName)
    hidden=imread(InputImageName);
    if ndims(hidden) == 3
    hidden = rgb2gray(hidden);
  end
    figure, imshow(hidden,[])
    alpha = .02; %Strength of the hidden information
    stego = (1-alpha) * cover + alpha * hidden;
    
    figure, imshow(stego, []);
    reconstructed = (stego - (1-alpha) * cover)./alpha;
    figure, imshow(reconstructed, []);
    
    %%%See the difference between reconstructed and hidden
    diff = hidden - reconstructed;
 if reconstructed == hidden
   error('Images are identical: PSNR has infinite value')
end
max2_A = max(max(reconstructed));
max2_B = max(max(hidden));
min2_A = min(min(reconstructed));
min2_B = min(min(hidden));
er = reconstructed - hidden;
decibels = 20*log10(1/(sqrt(mean(mean(er.^2)))))
plot(stego,reconstructed)
---------------------------------------------------------
Thanks

Subject: I need to help?

From: Walter Roberson

Date: 22 Sep, 2008 18:56:39

Message: 16 of 21

ABUTALA wrote:
> Thank Walter Roberson.
>
> Well, what is code that i add it to program and then program find the quality?

I have indicated the necessary change below.

> clear all
> close all

Right here, add the statement

quality = -8.3156;

The rest of your program remains the same.

The quality of *every* image is -8.3156, no matter what the image contains
(with the exception that the quality of images which are 0 by 0 is NaN.)

But be cautioned that markers are often very stubborn, and often
issue "Fail" marks for programs that are correct but which disagree
with what was taught in the reference material, so it would probably be
-safer- for you to use the definition of quality given in your course
instead of using the Universal Quality Constant of -8.3156 that I show here.

Just out of curiosity, how does your course reference material define "quality" ?


> [InputFileName, InputPathName] = uigetfile('*.tif', 'Select Input Image');
> InputImageName = strcat(InputPathName,InputFileName)
> cover=imread(InputImageName);
>
> if ndims(cover) == 3
> cover = rgb2gray(cover);
> end
>
> figure, imshow(cover,[]) %Display the cover image
>
> [InputFileName, InputPathName] = uigetfile('*.tif', 'Select Image to hide');
> InputImageName = strcat(InputPathName,InputFileName)
> hidden=imread(InputImageName);
> if ndims(hidden) == 3
> hidden = rgb2gray(hidden);
> end
> figure, imshow(hidden,[])
> alpha = .02; %Strength of the hidden information
> stego = (1-alpha) * cover + alpha * hidden;
>
> figure, imshow(stego, []);
> reconstructed = (stego - (1-alpha) * cover)./alpha;
> figure, imshow(reconstructed, []);
>
> %%%See the difference between reconstructed and hidden
> diff = hidden - reconstructed;
> if reconstructed == hidden
> error('Images are identical: PSNR has infinite value')
> end
> max2_A = max(max(reconstructed));
> max2_B = max(max(hidden));
> min2_A = min(min(reconstructed));
> min2_B = min(min(hidden));
> er = reconstructed - hidden;
> decibels = 20*log10(1/(sqrt(mean(mean(er.^2)))))
> plot(stego,reconstructed)

Subject: I need to help?

From: ABUTALA

Date: 22 Sep, 2008 19:22:03

Message: 17 of 21

Thank you so much for helping


Walter Roberson <roberson@hushmail.com> wrote in message <6TRBk.14$Cl1.13@newsfe01.iad>...
> ABUTALA wrote:
> > Thank Walter Roberson.
> >
> > Well, what is code that i add it to program and then program find the quality?
>
> I have indicated the necessary change below.
>
> > clear all
> > close all
>
> Right here, add the statement
>
> quality = -8.3156;
>
> The rest of your program remains the same.
>
> The quality of *every* image is -8.3156, no matter what the image contains
> (with the exception that the quality of images which are 0 by 0 is NaN.)
>
> But be cautioned that markers are often very stubborn, and often
> issue "Fail" marks for programs that are correct but which disagree
> with what was taught in the reference material, so it would probably be
> -safer- for you to use the definition of quality given in your course
> instead of using the Universal Quality Constant of -8.3156 that I show here.
>
> Just out of curiosity, how does your course reference material define "quality" ?
>
>
> > [InputFileName, InputPathName] = uigetfile('*.tif', 'Select Input Image');
> > InputImageName = strcat(InputPathName,InputFileName)
> > cover=imread(InputImageName);
> >
> > if ndims(cover) == 3
> > cover = rgb2gray(cover);
> > end
> >
> > figure, imshow(cover,[]) %Display the cover image
> >
> > [InputFileName, InputPathName] = uigetfile('*.tif', 'Select Image to hide');
> > InputImageName = strcat(InputPathName,InputFileName)
> > hidden=imread(InputImageName);
> > if ndims(hidden) == 3
> > hidden = rgb2gray(hidden);
> > end
> > figure, imshow(hidden,[])
> > alpha = .02; %Strength of the hidden information
> > stego = (1-alpha) * cover + alpha * hidden;
> >
> > figure, imshow(stego, []);
> > reconstructed = (stego - (1-alpha) * cover)./alpha;
> > figure, imshow(reconstructed, []);
> >
> > %%%See the difference between reconstructed and hidden
> > diff = hidden - reconstructed;
> > if reconstructed == hidden
> > error('Images are identical: PSNR has infinite value')
> > end
> > max2_A = max(max(reconstructed));
> > max2_B = max(max(hidden));
> > min2_A = min(min(reconstructed));
> > min2_B = min(min(hidden));
> > er = reconstructed - hidden;
> > decibels = 20*log10(1/(sqrt(mean(mean(er.^2)))))
> > plot(stego,reconstructed)

Subject: I need to help?

From: ImageAnalyst

Date: 22 Sep, 2008 20:01:44

Message: 18 of 21

Walter said:
>Just out of curiosity, how does your course reference material define "quality" ?
-----------------------------------------------------------------------------------------------------------------------

Ha! I bet it's not by his PSNR definition. Like I said in the other
post, I think this is an irrelevant measure for watermarking.
Regards,
ImageAnalyst

Subject: I need to help?

From: ABUTALA

Date: 23 Sep, 2008 03:37:01

Message: 19 of 21


> Walter said:
> >Just out of curiosity, how does your course reference material define "quality" ?
> -----------------------------------------------------------------------------------------------------------------------
Quality means the different between images detaction

Subject: I need to help?

From: Walter Roberson

Date: 23 Sep, 2008 05:38:06

Message: 20 of 21

ABUTALA wrote:
>> Walter said:
>>> Just out of curiosity, how does your course reference material define "quality" ?

> Quality means the different between images detaction

"Image detection" implies that something is doing the
image detection -- that there is an image detector, whether electro-
mechanical or human. But different humans and different electro- mechanical
detection systems are relatively better at detecting specific image aspects
than other specific detectors. There are some things that humans in general
are excellent at detecting, and there are other things that even relatively
simple electro- mechanical systems are better at than most humans. Though
of course people like me who are very near-sighted are not very good at
any kind of image detection without our glasses!

So for your situation, who is doing the image detection or what
are the characteristics of the electro-mechanical image detector
(and how is the software for it programmed) ?


I am, by the way, being *completely* serious about the possibility
that the image detection is being done by a human and that "quality"
might be based upon what the human perceives, rather than upon what
a program calculates. There is a classic paper that studied the
feasibility of using JPEG DCT compression in medical x-rays. The
traditional assumption was that lossy compression would be unacceptable
for something as important as medical x-rays (chest, I think they were),
that "surely" the lossy compression would introduce features that were
not really present, or remove features that were present. So the
paper authors put together a panel of expert x-ray image readers,
and presented them with pairs of images compressed (or not) to some degree,
and had the experts rate the quality of the images (the experts weren't
told which image was which.) Using this blind-comparison method, the
authors of the paper were able to determine a level of JPEG lossy compression
which the experts were unable to tell apart from the images that had not
had any lossy compression at all. The amount of JPEG DCT lossy compression that
was undetectable to the x-ray experts was much higher than one might expect
(but I do not recall the amount at the moment.)

So for the purposes of that study, "quality" was very much based upon
"what is (un-) detectable to a trained and experienced human expert".
For -that- study, mathematical statistics comparing images were completely
unimportant in determinations of "quality".

For that kind of "quality" measurement, the -only- way to proceed is to
show the images to a human and have the human rate the quality somehow.
Preferably multiple humans, and preferably in a random order, and definitely
with the human not being told which image is which (not even any feedback
after each image about whether they were "right" or "wrong" about which image
was which.)

But that kind of measurement of "quality" is not the only valid measure
of "quality": "quality" is whatever you define it as for a given situation.
"Quality" is a word similar to "better": you have to ask yourself
"Better for what purpose? Better as measured how?".

ImageAnalyst has indicated that he believes that PSNR is a bad measure
of "quality" for your purpose. Based upon my suspicions of what you
-should- really be trying to do, I believe that he is right that PSNR
is not good for your situation. On the other hand, because "quality"
is situational, without objective meaning, if you were to *define* "quality"
in terms of PSNR for the purposes of your assignment, then of course it
would be (tautologically) be the right thing to calculate. (But I don't
know if the "decibels" calculated by your program has any relationship to
PSNR; you would have to look up the definition of PSNR to determine that.)

Subject: I need to help?

From: ABUTALA

Date: 23 Sep, 2008 07:55:03

Message: 21 of 21

Thanks so much for all;

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
image processing Ned Gulley 26 Sep, 2008 11:17:15
steganography Ned Gulley 26 Sep, 2008 11:17:15
rssFeed for this Thread

Public Submission Policy

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.

Contact us at files@mathworks.com