Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

superpixel_bbox_subset

Bounding box for a subset of superpixel labels


Description

Bounding box for a subset of superpixel labels

Usage

superpixel_bbox_subset(superpixel_labels, superpixel_subset)

Arguments

superpixel_labels

a matrix. The superpixel_labels parameter corresponds to the output labels of the superpixels function

superpixel_subset

a numeric or integer vector specifying the subset of superpixel segments.

Details

This function should be utilized to return the bounding box for a subset of superpixel segments. To compute the bounding box for all superpixels use the superpixel_bbox function.

Examples

library(OpenImageR)


#-----------
# read image
#-----------

path = system.file("tmp_images", "slic_im.png", package = "OpenImageR")

im = readImage(path)

im = im[,, 1:3]


#--------------------
# compute superpixels
#--------------------

res = superpixels(input_image = im, method = "slic", superpixel = 200,

                  compactness = 20, return_labels = TRUE)


#-------------------------
# compute the bounding box   ( for subset of superpixels )
#-------------------------

bbox = superpixel_bbox_subset(res$labels, superpixel_subset = c(0, 10, 30))

OpenImageR

An Image Processing Toolkit

v1.1.8
GPL-3
Authors
Lampros Mouselimis [aut, cre] (<https://orcid.org/0000-0002-8024-1546>), Sight Machine [cph] (findHOGFeatures function of the SimpleCV computer vision platform), Johannes Buchner [cph] (average_hash, dhash and phash functions of the ImageHash python library), Mohammad Haghighat [cph] (Gabor Feature Extraction), Radhakrishna Achanta [cph] (Author of the C++ code of the SLIC and SLICO algorithms (for commercial use please contact the author))
Initial release
2021-05-04

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.