Learn R Programming

recogito (version 0.2.1)

ocv_read_annotorious: Extract the areas of interests of an image

Description

Extract the areas of interests of an image

Usage

ocv_read_annotorious(data, image)

Value

a list of ocv images with the extracted areas of interest

Arguments

data

an object as returned by read_annotorious

image

an ocv image object

Examples

Run this code
# \dontshow{
if(require(opencv) && require(magick))
{
# }
library(opencv)
library(magick)
data(openseadragon_areas)
# \dontshow{
  url <- system.file(package = "recogito", "examples",
                     "Cat_and_dog_standoff_(3926784260).jpg")
  attr(openseadragon_areas, "src") <- url
# }
url  <- attr(openseadragon_areas, "src")
img  <- ocv_read(url)

areas <- ocv_read_annotorious(data = openseadragon_areas, image = img)
areas[[1]]
areas[[2]]
img <- lapply(areas, FUN = function(x) image_read(ocv_bitmap(x)))
img <- do.call(c, img)
img <- image_append(img, stack = FALSE)
image_resize(img, "x200")
# \dontshow{
}
# }

Run the code above in your browser using DataLab