Comparing Jpeg of images with different size and resolution?

2 ビュー (過去 30 日間)
Paolo Piazza
Paolo Piazza 2020 年 5 月 27 日
コメント済み: Rik 2020 年 9 月 2 日
Hi everyone,
for a project I need to compare the jpeg size of different images. The problem is that sometimes I have Images that I need to crop (I need only a particular area of the page and not the rest). So basically, I need to crop, resize and also adjust images and compare their jpeg size. Is it feasible to do it with matlab? or would I obtain biased results?
thanks in advance
  3 件のコメント
Paolo Piazza
Paolo Piazza 2020 年 5 月 27 日
Basically some researchers used the jpeg size as a measure for the complexity of an image. I just want to find a way to measure the jpeg size without creating any bias in my results.
Rik
Rik 2020 年 5 月 27 日
I would be really careful. If I recall correctly simply loading and saving with Matlab can change the values that are stored in a jpeg.

サインインしてコメントする。

回答 (1 件)

Pratheek Punchathody
Pratheek Punchathody 2020 年 9 月 2 日
Hi,
"size()" function will return number of pixel rows, number of pixel columns and number of colour channels present in the image.
%%Code starts here
%%testimage1.jpg and testimage2.jpg are the sample data
Imx = imread('testimage1.jpg');
Im2 = imread('testimage2.jpg');
%%crop testimage1.jpg
Im1 = imcrop(Im1,[75 68 130 112]);
[rowspx1 columnpx1 noColorChannels1] = size(Im1);
[rowspx2 columnpx2 noColorChannels2] = size(Im2);
if rowspx1 * columnpx1 == rowspx2 * columnpx2
disp("Testimages have same number of pixels");
elseif rowspx1 * columnpx1 > rowspx2 * columnpx2
disp("testimage1.jpg has larger number of pixels");
else
disp("testimage2.jpg has larger number of pixels");
end
%Code ends here
Please find more information for cropping the image please check this link
  1 件のコメント
Rik
Rik 2020 年 9 月 2 日
That isn't the question. The question was about meaasuring the file size for a fixed image size. That way you can measure the compression, which is inversely correlated with the image complexity.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeImage Processing Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by