Nelson banner
Image Processing functions

The Image Processing module provides operations for manipulating images and volumes, including type conversion, color conversion, contrast adjustment, filtering, morphology, connected components, region measurements, geometric transforms, resizing, rotation, feature detection, foundational 3-D processing, and image registration.

Help pages are grouped into topic chapters: image basics, image analysis and segmentation, and geometry, registration, and 3-D processing.

Image Basics

Functions for image classes, color spaces, contrast adjustment, thresholding, filtering, padding, and edge detection.

Image Types and Color

Functions for image type conversion, color space conversion, and indexed image conversion.

  • hsv2rgb
    Convert HSV color values to RGB color values.
  • im2double
    Convert image to double precision.
  • im2gray
    Convert RGB image to grayscale and pass grayscale images through.
  • im2single
    Convert image to single precision.
  • im2uint16
    Convert image to 16-bit unsigned integer.
  • im2uint8
    Convert image to 8-bit unsigned integer.
  • ind2gray
    Convert indexed image to grayscale using a colormap.
  • ind2rgb
    Convert indexed image to RGB using a colormap.
  • rgb2gray
    Convert RGB image to grayscale.
  • rgb2hsv
    Convert RGB color values to HSV color values.
  • rgb2ind
    Convert RGB image to indexed image.
  • rgb2ycbcr
    Convert RGB color values to YCbCr color values.
  • ycbcr2rgb
    Convert YCbCr color values to RGB color values.
Contrast and Thresholding

Functions for contrast adjustment, threshold selection, histogram analysis, and binary image creation.

Filtering and Edges

Functions for spatial filtering, Gaussian and median filtering, padding, filter kernels, and edge detection.

  • edge
    Find edges in a grayscale image.
  • fspecial
    Create predefined 2-D image filters.
  • imboxfilt
    Apply box filtering to an image.
  • imfilter
    Filter an image with a 2-D kernel.
  • imgaussfilt
    Apply Gaussian filtering to an image.
  • medfilt2
    Apply 2-D median filtering.
  • padarray
    Pad an array before image filtering or morphology.
    Image Analysis and Segmentation

    Functions for morphology, connected components, boundary tracing, region measurements, reconstruction, and segmentation.

    Morphology

    Functions for binary and grayscale morphological operations, object cleanup, border cleanup, and structuring elements.

    • bwareaopen
      Remove small connected components from a binary image.
    • bwmorph
      Apply morphological operations to binary images.
    • bwperim
      Find perimeter pixels of binary objects.
    • imbothat
      Bottom-hat filtering of an image.
    • imclearborder
      Remove binary image components connected to the image border.
    • imclose
      Close an image by dilation followed by erosion.
    • imdilate
      Dilate a binary or grayscale image or volume.
    • imerode
      Erode a binary or grayscale image or volume.
    • imfill
      Fill holes in binary images.
    • imopen
      Open an image by erosion followed by dilation.
    • imtophat
      Top-hat filtering of an image.
    • strel
      Create a structuring element.
    Regions and Boundaries

    Functions for connected components, labels, region measurements, selection, and boundary tracing.

    • bwboundaries
      Find boundary pixels of binary regions.
    • bwconncomp
      Find connected components in a binary image or volume.
    • bwlabel
      Label connected components in a binary image.
    • bwselect
      Select connected binary objects.
    • bwtraceboundary
      Trace boundary pixels of a binary object.
    • labelmatrix
      Create label matrix from connected components.
    • regionprops
      Measure properties of image regions.
    Segmentation

    Functions for segmenting images using region growing, active contours, morphological reconstruction, h-minima/maxima, regional extrema, imposed minima, and watershed transforms.

    • activecontour
      Segment an image from an initial contour mask.
    • grayconnected
      Select a connected grayscale region from a seed pixel.
    • imextendedmax
      Find extended maxima in a 2-D image.
    • imextendedmin
      Find extended minima in a 2-D image.
    • imhmax
      Suppress shallow maxima using the h-maxima transform.
    • imhmin
      Suppress shallow minima using the h-minima transform.
    • imimposemin
      Impose regional minima at marker pixels.
    • imreconstruct
      Perform morphological reconstruction by dilation.
    • imregionalmax
      Find regional maxima in a 2-D image.
    • imregionalmin
      Find regional minima in a 2-D image.
    • watershed
      Compute watershed regions of a 2-D image or 3-D volume.
    Feature Detection

    Functions for corner metrics and local feature point detection.

      Geometry, Registration, and 3-D

      Functions for geometric transforms, spatial referencing, image registration, volumetric filtering, resizing, and 3-D measurements.

      Geometric Transforms

      Functions and objects for cropping, resizing, rotation, translation, spatial referencing, and geometric transforms in 2-D and foundational 3-D workflows.

      • affine2d
        Create a 2-D affine transformation structure.
      • affine3d
        Create a 3-D affine transformation structure.
      • fitgeotrans
        Fit a 2-D geometric transformation from control points.
      • imcrop
        Crop an image using a rectangle.
      • imref2d
        Create a 2-D spatial reference structure.
      • imref3d
        Create a 3-D spatial reference structure.
      • imregconfig
        Create default image registration optimizer and metric structures.
      • imregcorr
        Estimate a 2-D image registration transform by phase correlation.
      • imregister
        Register a moving image to a fixed image.
      • imregtform
        Estimate a 2-D registration transformation from images.
      • imresize
        Resize image by scale or output size
      • imrotate
        Rotate image by specified angle
      • imtranslate
        Translate an image in 2-D.
      • imwarp
        Warp an image or volume using a numeric transform matrix.
      • intrinsicToWorld
        Convert intrinsic image coordinates to world coordinates.
      • projective2d
        Create a 2-D projective transformation structure.
      • sizesMatch
        Determine whether a spatial reference matches an image size.
      • transformPointsForward
        Apply a forward geometric transformation to points.
      • transformPointsInverse
        Apply an inverse geometric transformation to points.
      • worldToIntrinsic
        Convert world coordinates to intrinsic image coordinates.
      • worldToSubscript
        Convert world coordinates to image subscripts.
      3-D Volumes

      Functions for filtering and processing volumetric image data.

      Image Registration

      Guides and entry points for aligning images, estimating registration transforms, and applying registered outputs.