From 14dd7a3bb46201e40d53798aed502df845d3f4b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20S=C3=A1nchez?= Date: Thu, 5 Apr 2018 12:48:02 +0200 Subject: [PATCH] Add feature IMAGE_PROPERTIES --- R/googleVision-LIB.R | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/R/googleVision-LIB.R b/R/googleVision-LIB.R index 5971f6e..f47ca0a 100644 --- a/R/googleVision-LIB.R +++ b/R/googleVision-LIB.R @@ -51,6 +51,9 @@ extractResponse <- function(pp, feature){ if (feature == "LANDMARK_DETECTION") { return(pp$content$responses$landmarkAnnotations[[1]]) } + if (feature == "IMAGE_PROPERTIES") { + return(pp$content$responses$imagePropertiesAnnotation[[1]]$colors) + } } @@ -59,7 +62,7 @@ extractResponse <- function(pp, feature){ #' @description input an image, provide the feature type and maxNumber of responses #' #' @param imagePath path or url to the image -#' @param feature one out of: FACE_DETECTION, LANDMARK_DETECTION, LOGO_DETECTION, LABEL_DETECTION, TEXT_DETECTION +#' @param feature one out of: FACE_DETECTION, LANDMARK_DETECTION, LOGO_DETECTION, LABEL_DETECTION, TEXT_DETECTION, IMAGE_PROPERTIES #' @param numResults the number of results to return. #' @export #' @return a data frame with results