
- Scikit Image – Introduction
- Scikit Image - Image Processing
- Scikit Image - Numpy Images
- Scikit Image - Image datatypes
- Scikit Image - Using Plugins
- Scikit Image - Image Handlings
- Scikit Image - Reading Images
- Scikit Image - Writing Images
- Scikit Image - Displaying Images
- Scikit Image - Image Collections
- Scikit Image - Image Stack
- Scikit Image - Multi Image
- Scikit Image - Data Visualization
- Scikit Image - Using Matplotlib
- Scikit Image - Using Ploty
- Scikit Image - Using Mayavi
- Scikit Image - Using Napari
- Scikit Image - Color Manipulation
- Scikit Image - Alpha Channel
- Scikit Image - Conversion b/w Color & Gray Values
- Scikit Image - Conversion b/w RGB & HSV
- Scikit Image - Conversion to CIE-LAB Color Space
- Scikit Image - Conversion from CIE-LAB Color Space
- Scikit Image - Conversion to luv Color Space
- Scikit Image - Conversion from luv Color Space
- Scikit Image - Image Inversion
- Scikit Image - Painting Images with Labels
- Scikit Image - Contrast & Exposure
- Scikit Image - Contrast
- Scikit Image - Contrast enhancement
- Scikit Image - Exposure
- Scikit Image - Histogram Matching
- Scikit Image - Histogram Equalization
- Scikit Image - Local Histogram Equalization
- Scikit Image - Tinting gray-scale images
- Scikit Image - Image Transformation
- Scikit Image - Scaling an image
- Scikit Image - Rotating an Image
- Scikit Image - Warping an Image
- Scikit Image - Affine Transform
- Scikit Image - Piecewise Affine Transform
- Scikit Image - ProjectiveTransform
- Scikit Image - EuclideanTransform
- Scikit Image - Radon Transform
- Scikit Image - Line Hough Transform
- Scikit Image - Probabilistic Hough Transform
- Scikit Image - Circular Hough Transforms
- Scikit Image - Elliptical Hough Transforms
- Scikit Image - Polynomial Transform
- Scikit Image - Image Pyramids
- Scikit Image - Pyramid Gaussian Transform
- Scikit Image - Pyramid Laplacian Transform
- Scikit Image - Swirl Transform
- Scikit Image - Morphological Operations
- Scikit Image - Erosion
- Scikit Image - Dilation
- Scikit Image - Black & White Tophat Morphologies
- Scikit Image - Convex Hull
- Scikit Image - Generating footprints
- Scikit Image - Isotopic Dilation & Erosion
- Scikit Image - Isotopic Closing & Opening of an Image
- Scikit Image - Skelitonizing an Image
- Scikit Image - Morphological Thinning
- Scikit Image - Masking an image
- Scikit Image - Area Closing & Opening of an Image
- Scikit Image - Diameter Closing & Opening of an Image
- Scikit Image - Morphological reconstruction of an Image
- Scikit Image - Finding local Maxima
- Scikit Image - Finding local Minima
- Scikit Image - Removing Small Holes from an Image
- Scikit Image - Removing Small Objects from an Image
- Scikit Image - Filters
- Scikit Image - Image Filters
- Scikit Image - Median Filter
- Scikit Image - Mean Filters
- Scikit Image - Morphological gray-level Filters
- Scikit Image - Gabor Filter
- Scikit Image - Gaussian Filter
- Scikit Image - Butterworth Filter
- Scikit Image - Frangi Filter
- Scikit Image - Hessian Filter
- Scikit Image - Meijering Neuriteness Filter
- Scikit Image - Sato Filter
- Scikit Image - Sobel Filter
- Scikit Image - Farid Filter
- Scikit Image - Scharr Filter
- Scikit Image - Unsharp Mask Filter
- Scikit Image - Roberts Cross Operator
- Scikit Image - Lapalace Operator
- Scikit Image - Window Functions With Images
- Scikit Image - Thresholding
- Scikit Image - Applying Threshold
- Scikit Image - Otsu Thresholding
- Scikit Image - Local thresholding
- Scikit Image - Hysteresis Thresholding
- Scikit Image - Li thresholding
- Scikit Image - Multi-Otsu Thresholding
- Scikit Image - Niblack and Sauvola Thresholding
- Scikit Image - Restoring Images
- Scikit Image - Rolling-ball Algorithm
- Scikit Image - Denoising an Image
- Scikit Image - Wavelet Denoising
- Scikit Image - Non-local means denoising for preserving textures
- Scikit Image - Calibrating Denoisers Using J-Invariance
- Scikit Image - Total Variation Denoising
- Scikit Image - Shift-invariant wavelet denoising
- Scikit Image - Image Deconvolution
- Scikit Image - Richardson-Lucy Deconvolution
- Scikit Image - Recover the original from a wrapped phase image
- Scikit Image - Image Inpainting
- Scikit Image - Registering Images
- Scikit Image - Image Registration
- Scikit Image - Masked Normalized Cross-Correlation
- Scikit Image - Registration using optical flow
- Scikit Image - Assemble images with simple image stitching
- Scikit Image - Registration using Polar and Log-Polar
- Scikit Image - Feature Detection
- Scikit Image - Dense DAISY Feature Description
- Scikit Image - Histogram of Oriented Gradients
- Scikit Image - Template Matching
- Scikit Image - CENSURE Feature Detector
- Scikit Image - BRIEF Binary Descriptor
- Scikit Image - SIFT Feature Detector and Descriptor Extractor
- Scikit Image - GLCM Texture Features
- Scikit Image - Shape Index
- Scikit Image - Sliding Window Histogram
- Scikit Image - Finding Contour
- Scikit Image - Texture Classification Using Local Binary Pattern
- Scikit Image - Texture Classification Using Multi-Block Local Binary Pattern
- Scikit Image - Active Contour Model
- Scikit Image - Canny Edge Detection
- Scikit Image - Marching Cubes
- Scikit Image - Foerstner Corner Detection
- Scikit Image - Harris Corner Detection
- Scikit Image - Extracting FAST Corners
- Scikit Image - Shi-Tomasi Corner Detection
- Scikit Image - Haar Like Feature Detection
- Scikit Image - Haar Feature detection of coordinates
- Scikit Image - Hessian matrix
- Scikit Image - ORB feature Detection
- Scikit Image - Additional Concepts
- Scikit Image - Render text onto an image
- Scikit Image - Face detection using a cascade classifier
- Scikit Image - Face classification using Haar-like feature descriptor
- Scikit Image - Visual image comparison
- Scikit Image - Exploring Region Properties With Pandas
Scikit Image - Image Collections
In computer vision and image processing, an image collection is a term used to describe a group or set of images that are considered together as a single entity for the purpose of managing and processing multiple images simultaneously.
It can be used to store and manage a group of related images, such as a sequence of frames from a video, or a collection of images from various sources. And it simplifies the management and processing of multiple images, making it easier to handle image processing and computer vision tasks.
ImageCollection class in skimage
In the scikit-image library, the image collection is represented by an ImageCollection class that provides functionality for loading, managing, and manipulating a collection of image files.
It allows you to specify a pattern or a list of filenames, load the corresponding images into memory, and access them conveniently. Following is the syntax of this class −
class skimage.io.ImageCollection(load_pattern, conserve_memory=True, load_func=None, **load_func_kwargs)
Here are the parameters of the class −
- load_pattern − A string or a list of strings representing the pattern of the file name to load. The filename path can be absolute or relative.
- conserve_memory (optional) − A boolean value. If set to True, only one image will be kept in memory at a time. If set to False, images will be cached after loading to improve subsequent access speed.
- load_func (optional) − A callable object that is used to read the image files. By default, it uses the imread function from the scikit-image library. However, you can specify a different function if needed.
- **load_func_kwargs (optional) − Additional keyword arguments that are passed to the load_func function.
It creates an ImageCollection object that allows you to perform various operations on the loaded images, such as iterating over the collection, accessing individual images, and applying operations to the entire collection.
Example 1
The following example will demonstrate how to load all the JPEG files in the specified directory. And the resulting ImageCollection object will be stored in the collection variable.
from skimage import io # Load all the JPEG files in a directory collection = io.ImageCollection('Images_/*.jpg') print('Type:',type(collection)) print('Total loaded JPEG files are',len(collection))
Output
The output shows the type of the collection object and the number of loaded JPEG files.
Type: < class 'skimage.io.collection.ImageCollection'> Total loaded JPEG files are 5
Example 2
The following example demonstrate how to access the expanded file names using the files attribute of the ImageCollection object.
from skimage import io # Load all the JPEG and PNG files in a directory collection = io.ImageCollection(['Images_/*.jpg', 'Images_/*.png']) # Access the expanded file list file_list = collection.files # Print the list of files one by one print("Files:") for image in file_list: print(image)
Output
Files: Images_\Blank.png Images_\Blank_img.png Images_\ColorDots.png Images_\Trees.jpg Images_\WhiteDots2.jpg Images_\WhiteDots4.jpg Images_\Zoo.jpg Images_\balloons_noisy.png Images_\binary image.png Images_\tree.jpg
You can also use a direct function called io.imread_collection() in the skimage.io module for reading the collection of images.
The imread_collection() function
The imread_collection() function is used to load a collection of images. and it will return an ImageCollection object, representing the loaded image collection.
Here's the syntax and the parameters of the function −
skimage.io.imread_collection(load_pattern, conserve_memory=True, plugin=None, **plugin_args)
Following are the parameters of this function −
- load_pattern − A string or a list of strings representing the pattern of the file name to load. The filename path can be absolute or relative.
- conserve_memory (optional) − A Boolean value. If set to True, only one image will be kept in memory at a time. If set to False, images will be cached after loading to improve subsequent access speed.
- plugin_args (optional) − Additional keyword arguments that will be passed to the chosen plugin.
The imread_collection() is a convenient wrapper function that internally creates an ImageCollection object for loading a collection of images. Other than using the ImageCollection class directly, It is good to use the imread_collection() function for simple use cases when you need to quickly load images based on a pattern or a list of filenames.
Example 1
The following example demonstrates how to load all the tiff files in a specific directory.
from skimage import io # Load all the tiff images collection = io.imread_collection('Images_/*.tiff', plugin='tifffile') print('Dipaly the tifffile collection:') print(collection)
Output
Dipaly the tifffile collection: ['Images_\\file_example_TIFF_1MB.tiff', 'Images_\\file_example_TIFF_10MB.tiff']
Example 2
The following example will load a collection of tiff and JPEG images by specifying the list of strings(patterns).
from skimage import io # Load a collection of JPEG and tifffile images collection = io.imread_collection(['Image Collection/*.jpg', 'Image Collection/*.tiff']) print('Dipaly the JPEG and tifffile collection:') print(collection)
Output
Dipaly the JPEG and tifffile collection: ['Image Collection\\Trees.jpg', 'Image Collection\\WhiteDots2.jpg', 'Image Collection\\WhiteDots4.jpg', 'Image Collection\\Zoo.jpg', 'Image Collection\\file_example_TIFF_1MB.tiff', 'Image Collection\\file_example_TIFF_10MB.tiff', 'Image Collection\\tree.jpg']
The Imread_collection_wrapper() function
The imread_collection_wrapper is a decorator function, that is used to create a custom version of the imread_collection() function. This wrapper function encapsulates the logic of creating an ImageCollection object with the specified image reading function.
Following is the syntax of this Function −
skimage.io.imread_collection_wrapper(imread)
The imshow_collection() function
The imshow_collection() function is used to display a collection of images. It takes an ImageCollection object as input and displays the images contained in the collection.
Here, the syntax and the parameters of the function −
skimage.io.imshow_collection(ic, plugin=None, **plugin_args)
Following are the parameters −
- ic − An ImageCollection object representing the collection of images to display.
- plugin (optional) − A string specifying the name of the plugin to use for image display. By default, different plugins are attempted until a suitable one is found.
- plugin_args − Additional keyword arguments that are passed to the selected plugin for image display.
Example
The following example demonstrates how to use the imshow_collection() function to display a collection of images.
from skimage import io # Load all the JPEG and PNG files in a directory collection = io.ImageCollection('Images_/*.jpg') # Access the expanded file list file_list = collection.files # Print the list of files one by one print("Files:") for image in file_list: print(image) # Display the collection of images io.imshow_collection(collection) io.show()
Output
Running the above code gives us the following result −
