select

Class: imageSet

Select subset of images from image set

Syntax

imgSetOut = select(imgSet,idx)

Description

imgSetOut = select(imgSet,idx) returns a new image set, imgSetOut, using the selection of images specified by the index idx.

Input Arguments

expand all

Image set, specified as an array of imageSet objects.

Image location index, specified as a scalar, vector of linear indices, or a vector of logical indices. The function uses the idx index to select the subset of images.

Examples

expand all

Read images from a folder.

imgFolder = fullfile(matlabroot,'toolbox','vision','visiondata','stopSignImages');
imgSet  = imageSet(imgFolder);

Select images 2 and 4 from the image set.

imgSetOut = select(imgSet, [2, 4]);

Select every other image from the image set.

imgSetOut2 = select(imgSet, 1:2:imgSet.Count);