How to plot the PSNR vs BITRATE for a single image?

3 visualizaciones (últimos 30 días)
DEEPIKA
DEEPIKA el 29 de Mayo de 2017
Comentada: Image Analyst el 30 de Dic. de 2018
Hi,
I have a doubt on how to plot PSNR vs BITRATE for a single image(lossless image). I have tried following code
for i=1:100
imwrite(bit_rate,'image.jpg','compression ratio',i,'mode,'lossless')
end
plot(bit_rate,PSNR,'b-','LineWidth',3)
but i am getting following error:
Error using imwrite
Too many output arguments.
Error in calic_enc (line 355)
a=imwrite(psnr_err_dec,'1.jpg','cr_ac',i,'mode','lossless')
Thank you in advance, please any one response as soon as possible.
  2 comentarios
no ur
no ur el 30 de Dic. de 2018
PSNR and MSE according to bitrate???? code matlab
Image Analyst
Image Analyst el 30 de Dic. de 2018
no, see Walter's answer below. You should save a bunch of images, noting the number of bits, and PSNR for each. Then you'll have points where you can make up a PSNR vs. bits plot. I'm not sure what you mean by "rate". The way I described will only work on saved images, not streaming videos "live" in "real time".

Iniciar sesión para comentar.

Respuestas (1)

Walter Roberson
Walter Roberson el 29 de Mayo de 2017
imwrite() writes to a file; it never returns any value, so you cannot assign the result to something.
There is no option named 'cr_ac' for imwrite()
There is no option named 'compression ratio' for imwrite(). However, JPEG2000 images support an option 'compressionratio'. Regular JPEG images do not support that option, but do support an option 'Quality'.
You could consider looping, using imwrite() with 'Quality', i, then imread() the resulting file, calculating the psnr against the original image and storing that.

Community Treasure Hunt

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

Start Hunting!

Translated by