image processing - How to find and display a graph of mean square error as a function of quality factor using Matlab? -
our teacher wants print @ matlab graph plots, in x axis, quality factor, , on y axis mean square error. image known "lenna.jpg".
i've searched , found how find mse, didn't find helps me on how find quality factor.
so, can please tell me in matlab code, how find these 2 things , how display them in graph?
thanks in advance.
i don't have matlab available right now, think following should work:
original=imread('lena.jpg'); mse=zeros(1,100); q = 1:100 tempfile = sprintf('lena%03d.jpg', q); imwrite(original, tempfile, 'quality', q); thisone = imread(tempfile); mse(q) = sum((original - thisone).^2)/numel(thisone); end figure plot(1:100, mse) xlabel 'quality factor' ylabel 'mse' title 'degradation of lena.jpg quality factor'
Comments
Post a Comment