Neighborhood and Block Processing
Certain image processing operations involve processing an image in sections, rather than processing the entire image at once. A sliding neighborhood operation processes an image one pixel at a time, by applying an algorithm to each pixels neighborhood. In distinct block processing, an image is divided into equally-sized blocks without overlap, and the algorithm is applied to each distinct block. The neighborhoods and blocks are then reassembled to form the output image.
Functions
blockproc | Distinct block processing for image |
bestblk | Determine optimal block size for block processing |
nlfilter | General sliding-neighborhood operations |
col2im | Rearrange matrix columns into blocks |
colfilt | Column-wise neighborhood operations |
im2col | Rearrange image blocks into columns |
blockedImage | Big or multiresolution image made from discrete blocks (Since R2021a) |
apply | Process blocks of blocked image (Since R2021a) |
Topics
- Neighborhood or Block Processing: An Overview
Divide an image into sections, called blocks or neighborhoods, to reduce the memory needed to process the image.
- Sliding Neighborhood Operations
A sliding neighborhood operation is performed one pixel at a time using information about the pixel’s neighborhood.
- Distinct Block Processing
Distinct block processing divides an image into nonoverlapping rectangular sections that can be processed individually.
- Block Size and Performance
Using larger block sizes reduces overall computation time but requires more memory to process each block.
- Use Column-wise Processing to Speed Up Sliding Neighborhood or Distinct Block Operations
Reshape sliding neighborhoods and distinct blocks to reduce the execution time of processing an image.
- Perform Block Processing on Image Files in Unsupported Formats
To work with image data in file formats not supported by block processing functions, construct a class that manages files based on region.
- Parallel Block Processing on Large Image Files
If you have a Parallel Computing Toolbox™ license, you can take advantage of multiple processor cores on your machine to improve the performance of
blockproc
.