ImageCollection
- class machinevisiontoolbox.Sources.ImageCollection(filename=None, loop=False, **kwargs)[source]
Iterate images from a collection of files
- Parameters:
filename (str) – wildcard path to image files
loop (bool, optional) – Endlessly loop over the files, defaults to False
kwargs – options applied to image frames, see
convert
The resulting object is an iterator over the image files that match the wildcard description. The iterator returns
Imageobjects where thenameattribute is the name of the image fileIf the path is not absolute, the video file is first searched for relative to the current directory, and if not found, it is searched for in the
imagesfolder of themvtb-datapackage, installed as a Toolbox dependency.Example:
>>> from machinevisiontoolbox import FileColletion >>> images = FileCollection('campus/*.png') >>> len(images) >>> for image in images: # iterate over images >>> # process image
alternatively:
>>> img = files[i] # load i'th file from the collection
- References:
Robotics, Vision & Control for Python, Section 11.1.2, P. Corke, Springer 2023.
- Seealso:
Methods