linux映像
How to detect whether a .jpg image is almost blank/black on Linux?
Here is a bash function that I used to detect whether an image is black on Linux:
这是我用来检测Linux上图像是否为黑色的bash函数:
function isBlank ()
{
mean=`convert $1 -format "%[mean]" info:`
echo "$mean"
}
It uses ImageMagic to generate formatted image characteristics (the mean).
它使用ImageMagic生成格式化的图像特征(均值)。
If the mean
is 0
, it is a black image.
如果mean
为0
,则为黑色图像。
Answered by Eric Z Ma.
埃里克·马(Eric Z Ma)回答。
翻译自: https://www.systutorials.com/how-to-detect-whether-an-image-is-almost-blank-on-linux/
linux映像