提取图像的一部分以进行识别

问题描述 投票:2回答:1

我尝试获取有关图像一部分的详细信息。我阅读了imageMagick的文档,据我所知,应该可以使用-extract选项调用identify。但是,当我调用它时,我收到一条错误消息:'unrecognized option: -extract'

这是我的命令行调用qazxsw poi

有谁知道,我的命令行呼叫有什么问题或有一个方便的解决方法?

提前致谢!西蒙

imagemagick imagemagick-identify
1个回答
2
投票

像这样创建一个测试图像:

identify -verbose -extract 20x20+0+20 ./mosaicTemplate.jpg

convert -size 500x500 gradient:red-blue image.png

现在查看左上角图像非常红的详细信息:

enter image description here

现在查看左下角更详细的蓝色细节:

convert image.png -crop 20x20+0+0 -verbose info:

Image: image.png
  Format: PNG (Portable Network Graphics)
  Mime type: image/png
  Class: DirectClass
  Geometry: 20x20+0+0
  Units: Undefined
  Type: Palette
  Endianess: Undefined
  Colorspace: sRGB
  Depth: 16-bit
  Channel depth:
    red: 16-bit
    green: 1-bit
    blue: 16-bit
  Channel statistics:
    Pixels: 400
    Red:
      min: 63040 (0.961929)
      max: 65535 (1)
      mean: 64287.3 (0.980962)                    <--- very red
      standard deviation: 757.295 (0.0115556)
      kurtosis: -1.20609
      skewness: 0.000125086
      entropy: 1
    Green:
      min: 0 (0)
      max: 0 (0)
      mean: 0 (0)
      standard deviation: 0 (0)
      kurtosis: 0
      skewness: 0
      entropy: nan
    Blue:
      min: 0 (0)
      max: 2495 (0.0380713)
      mean: 1247.65 (0.0190379)              <--- not very blue
      standard deviation: 757.295 (0.0115556)
      kurtosis: -1.20609
      skewness: -0.000125086
      entropy: 1
© www.soinside.com 2019 - 2024. All rights reserved.