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

조회 수: 3 (최근 30일)
DEEPIKA
DEEPIKA 2017년 5월 29일
댓글: Image Analyst 2018년 12월 30일
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
no ur
no ur 2018년 12월 30일
PSNR and MSE according to bitrate???? code matlab
Image Analyst
Image Analyst 2018년 12월 30일
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".

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2017년 5월 29일
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