【发布时间】:2019-02-05 15:36:14
【问题描述】:
我需要将来自 google_streetview API 的结果保存为图像(.jpg、.png)
我正在一个小项目中测试图像识别算法。我正在从 google street 下载一些图片,我需要将这些图片保存为 .jpg 或 .png 格式。
library(googleway)
p <- google_streetview(location = c(centerlat,centerlng),
size = c(500,500),
panorama_id = NULL,
output = "plot",
heading = 0,
fov = 15,
pitch = 0,
response_check = FALSE,
key = key)
我曾尝试使用 download.file 和 library imager:
第一:
download.file(p, destfile="test.jpg")
if (stringr::str_count(imagePath, "http") > 0) { 中的错误: 参数长度为零
第二:
library(imager)
imager::save.image(p,"test.jpeg")
imager::save.image(p, "test.jpeg") 中的错误: 第一个参数应该是一张图片
如何自动保存这些图像?
【问题讨论】:
标签: r google-street-view googleway