Path: news.mathworks.com!not-for-mail
From: "ABUTALA " <love.scream1@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: I need to help?
Date: Mon, 22 Sep 2008 19:22:03 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 68
Message-ID: <gb8r8r$asd$1@fred.mathworks.com>
References: <gb0kj5$ov3$1@fred.mathworks.com> <e7ea5034-2104-4ba0-8820-104944d5d5a3@f36g2000hsa.googlegroups.com> <95fd5329-1f60-4e26-9749-9f14566c5ac3@m45g2000hsb.googlegroups.com> <gb137u$n54$1@fred.mathworks.com> <j7VAk.522$zk7.162@newsfe06.iad> <gb1e8d$3q1$1@fred.mathworks.com> <xJnBk.11462$Il.5926@newsfe09.iad> <gb584e$mb5$1@fred.mathworks.com> <Z_uBk.16998$wr1.9977@newsfe02.iad> <gb64t3$aib$1@fred.mathworks.com> <6TRBk.14$Cl1.13@newsfe01.iad>
Reply-To: "ABUTALA " <love.scream1@gmail.com>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1222111323 11149 172.30.248.37 (22 Sep 2008 19:22:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 22 Sep 2008 19:22:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1482948
Xref: news.mathworks.com comp.soft-sys.matlab:491383


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)