0

I would like to automate process of creating thumbnails / contact sheets for videos. They are usually m x n matrixes of pictures, eg 6x11 or 8x12 etc. Randomly selected pictures are sometimes bad quality: contains movement (blurry image), camera spans (blurry too), too dark or completely black, or completely white, no details, etc. Currently I am using the jpg image file size for image metric: bigger file size -> more details on the picture. Combined with number of colors (can be determined with ImageMagick "identify -format %k" command). I normalize both to 0.0-1.0 interval by dividing with the largest value in the group of the pictures and then I compute the following metric:

gamma*number_of_colors^2+(1-gamma)*file_size^2

Where gamma is a weighting parameter and can be in interval 0.0-1.0. What other approaches, image metrics can be used for this purpose?

4

1 回答 1

0

如果您对锐度/模糊度感兴趣,您可以转到灰度并运行边缘检测(例如 Canny),这将为您提供一般黑色的图像,其中检测到锐利边缘的白色区域。如果您采用此类图像的平均亮度(或计算白色像素并以像素为单位除以图像区域),则具有更高亮度的那些是具有更锐利边缘的那些。

convert image.jpg -colorspace gray -canny 0x1+10%+30% -format "%[fx:mean]" info:

所以,举例来说......使用这个清晰的图像:

在此处输入图像描述

我测试锐度:

convert sharp.jpg -colorspace gray -canny 0x1+10%+30% -format "%[fx:mean]" info:
0.00485202

现在,有一个模糊的版本:

在此处输入图像描述

我现在明白了:

convert blurred.jpg -colorspace gray -canny 0x1+10%+30% -format "%[fx:mean]" info:
0.00261855
于 2015-12-26T12:44:48.213 回答