Thread Subject: PSNR ?

Subject: PSNR ?

From: ABUTALA

Date: 31 Oct, 2008 14:15:04

Message: 1 of 7

Can anyone reply with the sample code to calculate PSNR of two
images in MATLAB?

thanks

Subject: PSNR ?

From: Adam

Date: 31 Oct, 2008 14:26:01

Message: 2 of 7

"ABUTALA" <love.scream1@gmail.com> wrote in message <gef3t8$r8q$1@fred.mathworks.com>...
> Can anyone reply with the sample code to calculate PSNR of two
> images in MATLAB?
>
> thanks

Did you even try this yourself? Programming doesn't get much easier than this.

Post what you did and if it's not Matlab optimal people will happily help out. I'm sure someone will post the answer anyway...

~Adam

Subject: PSNR ?

From: ABUTALA

Date: 31 Oct, 2008 15:48:02

Message: 3 of 7

"Adam" <not.real@email.com> wrote in message <gef4hp$5rn$1@fred.mathworks.com>...
> "ABUTALA" <love.scream1@gmail.com> wrote in message <gef3t8$r8q$1@fred.mathworks.com>...
> > Can anyone reply with the sample code to calculate PSNR of two
> > images in MATLAB?
> >
> > thanks
>
> Did you even try this yourself? Programming doesn't get much easier than this.
>
> Post what you did and if it's not Matlab optimal people will happily help out. I'm sure someone will post the answer anyway...
>
> ~Adam

If you have answer, you reply or we dont need comment?

if i have answer , why i ask you?

Subject: PSNR ?

From: Adam

Date: 31 Oct, 2008 16:08:01

Message: 4 of 7

"ABUTALA" <love.scream1@gmail.com> wrote in message <gef9bi$7gj$1@fred.mathworks.com>...
> "Adam" <not.real@email.com> wrote in message <gef4hp$5rn$1@fred.mathworks.com>...
> > "ABUTALA" <love.scream1@gmail.com> wrote in message <gef3t8$r8q$1@fred.mathworks.com>...
> > > Can anyone reply with the sample code to calculate PSNR of two
> > > images in MATLAB?
> > >
> > > thanks
> >
> > Did you even try this yourself? Programming doesn't get much easier than this.
> >
> > Post what you did and if it's not Matlab optimal people will happily help out. I'm sure someone will post the answer anyway...
> >
> > ~Adam
>
> If you have answer, you reply or we dont need comment?
>
> if i have answer , why i ask you?

Nope. I have answer, I'm just not telling, AND I'm commenting.

People come in here everyday asking for code without putting forth any indication they did any work themself. If you had googled PSNR you would see it's one equation and would already have your code instead of waiting for someone else to come along and maybe/maybe not answer your question.

Good luck,
~Adam

Subject: PSNR ?

From: ABUTALA

Date: 31 Oct, 2008 19:26:02

Message: 5 of 7

"Adam" <not.real@email.com> wrote in message <gefah1$m7c$1@fred.mathworks.com>...
> "ABUTALA" <love.scream1@gmail.com> wrote in message <gef9bi$7gj$1@fred.mathworks.com>...
> > "Adam" <not.real@email.com> wrote in message <gef4hp$5rn$1@fred.mathworks.com>...
> > > "ABUTALA" <love.scream1@gmail.com> wrote in message <gef3t8$r8q$1@fred.mathworks.com>...
> > > > Can anyone reply with the sample code to calculate PSNR of two
> > > > images in MATLAB?
> > > >
> > > > thanks
> > >
> > > Did you even try this yourself? Programming doesn't get much easier than this.
> > >
> > > Post what you did and if it's not Matlab optimal people will happily help out. I'm sure someone will post the answer anyway...
> > >
> > > ~Adam
> >
> > If you have answer, you reply or we dont need comment?
> >
> > if i have answer , why i ask you?
>
> Nope. I have answer, I'm just not telling, AND I'm commenting.
>
> People come in here everyday asking for code without putting forth any indication they did any work themself. If you had googled PSNR you would see it's one equation and would already have your code instead of waiting for someone else to come along and maybe/maybe not answer your question.
>
> Good luck,
> ~Adam

So I ask because i dont have answer ans i googled but i didnt get my answer?

Subject: PSNR ?

From: Justin Abbott

Date: 1 Nov, 2008 21:10:04

Message: 6 of 7

"ABUTALA" <love.scream1@gmail.com> wrote in message <gefm4a$gj9$1@fred.mathworks.com>...
> "Adam" <not.real@email.com> wrote in message <gefah1$m7c$1@fred.mathworks.com>...
> > "ABUTALA" <love.scream1@gmail.com> wrote in message <gef9bi$7gj$1@fred.mathworks.com>...
> > > "Adam" <not.real@email.com> wrote in message <gef4hp$5rn$1@fred.mathworks.com>...
> > > > "ABUTALA" <love.scream1@gmail.com> wrote in message <gef3t8$r8q$1@fred.mathworks.com>...
> > > > > Can anyone reply with the sample code to calculate PSNR of two
> > > > > images in MATLAB?
> > > > >
> > > > > thanks
> > > >
> > > > Did you even try this yourself? Programming doesn't get much easier than this.
> > > >
> > > > Post what you did and if it's not Matlab optimal people will happily help out. I'm sure someone will post the answer anyway...
> > > >
> > > > ~Adam
> > >
> > > If you have answer, you reply or we dont need comment?
> > >
> > > if i have answer , why i ask you?
> >
> > Nope. I have answer, I'm just not telling, AND I'm commenting.
> >
> > People come in here everyday asking for code without putting forth any indication they did any work themself. If you had googled PSNR you would see it's one equation and would already have your code instead of waiting for someone else to come along and maybe/maybe not answer your question.
> >
> > Good luck,
> > ~Adam
>
> So I ask because i dont have answer ans i googled but i didnt get my answer?

try googling:
psnr wiki
the first result should be useful.
-Justin

Subject: PSNR ?

From: malin198409@gmail.com

Date: 26 Nov, 2008 06:45:29

Message: 7 of 7

On Oct 31, 10:15=A0pm, "ABUTALA" <love.scre...@gmail.com> wrote:
> Can anyone reply with the sample code to calculate PSNR of two
> images in MATLAB?
>
> thanks

Matlab Sorce code is listed in the following. and the range of the
value of the two image A and B is 0~255:

function PSNR(A,B)

if A =3D=3D B
   error('Images are identical: PSNR has infinite value')
end

max2_A =3D max(max(A));
max2_B =3D max(max(B));
min2_A =3D min(min(A));
min2_B =3D min(min(B));

if max2_A > 255 || max2_B > 255 || min2_A < 0 || min2_B < 0
  error('input matrices must have values in the interval [0,255]')
end

error_diff =3D A - B;
decibels =3D 20*log10(255/(sqrt(mean(mean(error_diff.^2)))));
disp(sprintf('PSNR =3D +%5.2f dB',decibels))

Tags for this Thread

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.

rssFeed for this Thread
 

MATLAB Central Terms of Use

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 Terms prior to use.

Contact us at files@mathworks.com