【问题标题】:Is it possible to read EXIF data with R?是否可以用 R 读取 EXIF 数据?
【发布时间】:2018-01-20 14:35:21
【问题描述】:

我需要根据它们的 EXIF 数据来处理一些图像文件。可以在 R 中完成这样的事情吗?我还没有看到任何可以直接读取 EXIF 数据的 R 函数。

【问题讨论】:

标签: r exif


【解决方案1】:

adimpro 包可能很有用。它在导入的图像上将 EXIF 数据维护为comment()。 (虽然我自己没用过。)

【讨论】:

    【解决方案2】:

    我也找不到原生的 R 包,所以我在 https://github.com/cmartin/EXIFr 实现了自己的包

    到目前为止,它只读取我用于项目的标签子集,但我可以轻松扩展它以满足您的需求。

    例如读取光圈值:

    read_exif_tags(image_path)[["ApertureValue"]]
    

    【讨论】:

      【解决方案3】:

      使用 exiftool (http://www.sno.phy.queensu.ca/~phil/exiftool/) 可能更快、更通用

      system("/usr/local/bin/exiftool pathimagename.img")

      【讨论】:

        【解决方案4】:

        我尝试了 adimpro(对我来说太复杂了 - 需要其他软件包等)和 EXIFr(出现错误)。 exiftool 有效,但我必须想办法将系统调用的结果输入 R。方法如下(您必须添加 , intern = TRUE):

        1) install (http://www.sno.phy.queensu.ca/~phil/exiftool/) for your OS
        2) use this in R: varName <- system("/usr/local/bin/exiftool path/example.jpg", intern = TRUE)
        

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2014-06-15
          • 1970-01-01
          • 2012-05-16
          • 1970-01-01
          • 2011-06-25
          • 1970-01-01
          相关资源
          最近更新 更多