Skip to content

Image Processing

Image Processing

pupil covers 2D image processing: the building-block operations you compose before and after perception - bitwise math, cropping, geometric transforms, color conversion, enhancement, filtering, morphology, and measurement. Pick the group that matches the operation you need.

Bitwise Operations

Bitwise operations combine or invert images and binary masks pixel by pixel. Use them to intersect, union, subtract, or complement masks when composing detection and segmentation results.

Cropping & Padding

Crop an image down to a region of interest - centered, by bounding boxes, or by an arbitrary polygon - or pad it out to a target size. Use these to prepare fixed-size model inputs or to isolate detected objects.

Geometric Transforms

Resize, rotate, shift, or rescale an image while controlling aspect ratio and border handling. Pyramid up/down-sampling gives you clean multi-scale versions of the same image.

Color & Channels

Convert between color spaces, split an image into its individual channels or merge channels back together, and blend two images with a weighted overlay.

Enhancement & Normalization

Correct exposure, contrast, and color casts, and normalize intensity so downstream steps see consistent images across varying lighting conditions.

Smoothing & Noise Reduction

Reduce noise before thresholding or edge detection. Choose fast averaging (box, blur), edge-preserving smoothing (bilateral, Gaussian), or impulse-noise removal (median).

Edge Detection

Extract edges and gradients using first- and second-order derivative operators. Sobel and Scharr give directional gradients; the Laplacian catches fine detail and zero-crossings.

Ridge & Texture Filters

Enhance thin, tubular, or oriented structures - vessels, fibers, cracks, PCB traces, textures - using multi-scale ridge and texture filters.

Morphological Operations

Reshape binary regions: grow or shrink them (dilate/erode), clean up noise and holes (open/close), extract boundaries or fine features (gradient, top-hat, black-hat), or reduce shapes to their skeleton (thinning).

Filter Image Using Morphological Dilation 0Filter Image Using Morphological Dilation 1
Pupil

Filter Image Using Morphological Dilation

Apply morphological dilation to expand bright regions and fill small gaps or holes, useful for mask expansion, object connection, and feature enhancement.

View →
Filter Image Using Morphological Erosion 0Filter Image Using Morphological Erosion 1
Pupil

Filter Image Using Morphological Erosion

Apply morphological erosion to shrink bright regions and remove small noise, useful for binary image cleanup, object separation, and feature removal.

View →
Filter Image Using Morphological Open 0Filter Image Using Morphological Open 1
Pupil

Filter Image Using Morphological Open

Apply morphological opening (erosion followed by dilation) to remove small noise while preserving object size, effective for binary image cleanup and segmentation refinement.

View →
Filter Image Using Morphological Close 0Filter Image Using Morphological Close 1
Pupil

Filter Image Using Morphological Close

Apply morphological closing (dilation followed by erosion) to fill holes and connect nearby objects while preserving overall shape, ideal for segmentation cleanup and feature completion.

View →
Filter Image Using Morphological Gradient 0Filter Image Using Morphological Gradient 1
Pupil

Filter Image Using Morphological Gradient

Apply morphological gradient to extract object boundaries by computing the difference between dilation and erosion, useful for robust edge detection in binary or grayscale images.

View →
Filter Image Using Morphological Tophat Filter 0Filter Image Using Morphological Tophat Filter 1
Pupil

Filter Image Using Morphological Tophat Filter

Apply morphological top-hat transform to extract or enhance small bright features in images, useful for background correction, small object detection, and detail enhancement.

View →
Filter Image Using Morphological Blackhat 0Filter Image Using Morphological Blackhat 1
Pupil

Filter Image Using Morphological Blackhat

Apply morphological black-hat transform to extract small dark features, cracks, or holes on bright backgrounds, ideal for defect and surface inspection.

View →
Filter Image Using Morphological Thinning Filter 0Filter Image Using Morphological Thinning Filter 1
Pupil

Filter Image Using Morphological Thinning Filter

Apply skeletonization (thinning) to binary images to reduce objects to their skeletal structure while preserving connectivity and topology.

View →

Measurement & Geometry

Measure properties of a mask - its centroid and principal axes - or project a pixel into 3D camera coordinates using camera intrinsics.

Where to Go Next?

Continue to the next tutorial.

Point Cloud Processing

3D point cloud filtering, downsampling, and processing with Vitreous.

Next tutorial →

Support