Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!news2.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post01.iad.highwinds-media.com!newsfe02.iad.POSTED!7564ea0f!not-for-mail
From: Walter Roberson <roberson@hushmail.com>
User-Agent: Thunderbird 2.0.0.16 (Windows/20080708)
MIME-Version: 1.0
Newsgroups: comp.soft-sys.matlab
Subject: Re: I need to help?
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>
In-Reply-To: <gb584e$mb5$1@fred.mathworks.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 62
Message-ID: <Z_uBk.16998$wr1.9977@newsfe02.iad>
NNTP-Posting-Host: 24.79.146.116
X-Complaints-To: internet.abuse@sjrb.ca
X-Trace: newsfe02.iad 1222016057 24.79.146.116 (Sun, 21 Sep 2008 16:54:17 UTC)
NNTP-Posting-Date: Sun, 21 Sep 2008 16:54:17 UTC
Date: Sun, 21 Sep 2008 11:54:47 -0500
Xref: news.mathworks.com comp.soft-sys.matlab:491199


ABUTALA wrote:
> Thank Walter Roberson
> 
> Please run program and show me how can calculate quality at different
>  &#8216;strength&#8217; 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.