Main Content

read

(Not recommended) Read image at specified index

Thereadfunction of theimageSetobject is not recommended. Instead, use animageDatastoreobject and itsreadandreadimagefunctions. For more information, seeCompatibility Considerations.

Description

example

im= read(imgSet,idx)returns an image from the image set,imgSet, located at the indexidx.

Examples

collapse all

Create an image set.

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

Display the fourth image from the set.

imshow(read(imgSet, 4));

Figure contains an axes object. The axes object contains an object of type image.

Input Arguments

collapse all

Image set, specified as animageSetobject.

Image location index, specified as a positive integer.

Output Arguments

collapse all

Image, returned as a numeric array.

版本历史

Introduced in R2014b

expand all

Not recommended starting in R2016b