How to plot the PSNR vs BITRATE for a single image?
조회 수: 3 (최근 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
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
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.
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!