library(magick)
f <- system.file("extdata", "cruise_boat.png", package = "image.dlib")
x <- image_read(f)
x
feats <- image_data(x, channels = "rgb")
feats <- as.integer(feats, transpose = FALSE)
feats <- image_fhog(feats, cell_size = 8)
str(feats)
## FHOG feature vector of pixel at HOG space position 1, 1
feats$fhog[1, 1, ]
## FHOG feature vector of pixel at HOG space position 4 (height), 7 (width)
feats$fhog[4, 7, ]
Run the code above in your browser using DataLab