GoogleImage2array: GoogleImage2array: create array from image thumbnails.

Description Usage Arguments Value Author(s) Examples

View source: R/GoogleImage2array.R

Description

This function is to create the R array/tensor from 2D image obtained from Google image search. This function provides an array consisted of 20 images per run.

Usage

1
2
3
4
5
6
7
8
GoogleImage2array(
  Query,
  wh = 64,
  Col = TRUE,
  Save = FALSE,
  file_path = NULL,
  gl = "us"
)

Arguments

Query

a character vector to search images

wh

a value of pixels in height and width.

Col

a logical. Whether to handle color or gray images. if TRUE, use color mode.

Save

a logical. Whether to save images locally or not. if TRUE, save locally.

file_path

a character. a directory to save the image file.

gl

a character to show a region information. ex. us, ja etc

Value

array

Author(s)

Satoshi Kume

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
library(EBImage)

# Simple examples
query <- "persian cat"
CatImg <- GoogleImage2array(query)

#show info
str(CatImg)

query <- "Shiba inu"
DogImg <- GoogleImage2array(query)

#show info
str(DogImg)

#Bind arrays
ImgDat <- EBImage::abind(CatImg$array, DogImg$array, along=1)

#show info
str(ImgDat)

GoogleImage2Array documentation built on Sept. 29, 2021, 9:08 a.m.