BiocStyle::markdown()

Last modified: r file.info("HowToUse.Rmd")$mtime
Compiled: r date()

Load packages

library(GoogleImage2Array)

Get images via Google Image Search

GoogleImage2array function provide a 4-dimensional array of images via google image search.

#Search by persian cat
query <- "persian cat"
CatImg <- GoogleImage2array(query)

#show info
str(CatImg)

Multi-byte characters (e.g. Japanese) can also be used.

#Search by ペルシャ猫
query <- "ペルシャ猫"
CatImgJpn <- GoogleImage2array(query)

#show info
str(CatImgJpn)

Display images with display.array

display.array show a result as a tiled image.

#display CatImg
display.array(CatImg)

Get and Display images (Display = TRUE option)

The images are displayed in tiles by the option of GoogleImage2array function.

#Search by Shiba inu (One line execution)
DogImg <- GoogleImage2array("Shiba inu", Display = TRUE)

#show info
str(DogImg)

Search via GoogleImage2array.world function

This function retrieves images from 10 regions of the world and returns them as a single array data.

This allows more than 20 images to be acquired at a time.

query <- "Shiba inu"
DogImgw <- GoogleImage2array.world(query)

str(DogImgw)

Combine two arrays together

#Bind two arrays to one array
ImgDat <- bind.array(CatImg, DogImg)

#show info
str(ImgDat)

Display images as a spiral image

#show images
display.spiral(CatImg)
library(GoogleImage2Array)
library(EBImage)
options(EBImage.display = "raster")
img <- system.file("images", "spiral.png", package="GoogleImage2Array")
EBImage::display(EBImage::readImage(files = img))

Session information {.unnumbered}

sessionInfo()


kumeS/GoogleImage2Array documentation built on Aug. 27, 2023, 4:44 a.m.