Blob analysis is a computer vision technique that detects and analyzes connected groups of pixels—called blobs—in a binary image to extract quantitative properties such as area, perimeter, centroid, and circularity. It operates on images that have been segmented into foreground (defect) and background regions through binarization, enabling precise measurement of discrete features for quality inspection.
Glossary
Blob Analysis

What is Blob Analysis?
A foundational computer vision technique for detecting and measuring connected groups of pixels in binary images to quantify defect size, shape, and position.
The algorithm scans the binary image pixel by pixel, applying a connected-component labeling process to group adjacent foreground pixels into distinct objects. For each detected blob, the system calculates morphological descriptors that can be compared against tolerance thresholds to classify defects by size or shape, making it a deterministic and computationally efficient method for automated optical inspection on high-speed production lines.
Key Properties Extracted by Blob Analysis
Once a binary image is segmented, blob analysis quantifies the geometric properties of connected components. These scalar measurements transform raw pixel clusters into actionable quality metrics for pass/fail decisions.
Area
The total number of pixels constituting a single connected component. Area is the most fundamental scalar property, directly correlating to the physical size of a defect or feature.
- Zero-order moment: Computed as the sum of all white pixels in the blob.
- Calibration: Converted to real-world units (mm²) using the camera's spatial calibration factor.
- Application: Used to reject parts where a scratch or void exceeds a maximum allowable area threshold.
Centroid
The geometric center of mass of the blob, calculated as the average (x, y) coordinate of all pixels in the region. The centroid provides precise spatial localization.
- First-order moments: The x-coordinate is M10/Area; the y-coordinate is M01/Area.
- Sub-pixel accuracy: Computed as floating-point values, enabling precision beyond the discrete pixel grid.
- Application: Guides robotic pick-and-place systems to the exact center of a part or defect for further action.
Perimeter
The length of the boundary contour enclosing the blob. Perimeter quantifies the complexity of the shape's outline and is sensitive to edge roughness.
- Chain code tracing: Calculated by traversing the boundary pixels and summing the distances between consecutive points.
- Compactness ratio: Often combined with area to derive form factors like circularity.
- Application: Distinguishes a smooth, circular void from an irregular, jagged crack, even if both have identical areas.
Bounding Box
The minimal axis-aligned rectangle that fully encloses the blob. The bounding box provides the object's extreme dimensions.
- Parameters: Defined by (x_min, y_min) as the top-left corner and (x_max, y_max) as the bottom-right corner.
- Derived metrics: Width = x_max - x_min; Height = y_max - y_min.
- Application: Used to measure the maximum length and width of a defect, which is critical for standards that specify linear tolerances rather than area.
Convex Hull & Solidity
The convex hull is the smallest convex polygon that contains all points of the blob. Solidity is the ratio of the blob's area to its convex hull area.
- Solidity formula: Area / Convex_Hull_Area. A value of 1.0 indicates a perfectly convex shape.
- Concavity detection: A low solidity score reveals a shape with deep indentations or a highly branched structure.
- Application: Differentiates a solid particle of contamination (high solidity) from an agglomerate of smaller particles (low solidity).
Orientation & Major/Minor Axes
The angle of the principal axis of the blob relative to the horizontal, along with the lengths of the major and minor axes of the best-fit ellipse.
- Second-order moments: The orientation is derived from the central moments, finding the axis of minimum inertia.
- Elongation: The ratio of major axis length to minor axis length quantifies how stretched a blob is.
- Application: Determines the directional alignment of a fiber or the dominant angle of a scratch, which can indicate a systematic process error.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Frequently Asked Questions
Concise answers to the most common technical questions about blob analysis, a foundational computer vision technique for detecting and measuring connected pixel regions in binary images for industrial quality inspection.
Blob analysis is a computer vision technique that detects and analyzes connected groups of pixels—called blobs—in a binary image to extract quantitative properties such as area, perimeter, centroid, and circularity. The process begins with binarization, where a grayscale image is converted to pure black and white based on a threshold value, separating foreground objects from the background. A connected-component labeling algorithm then scans the binary image pixel by pixel, assigning a unique identifier to each contiguous region of foreground pixels. Once labeled, each blob is measured: the system calculates its area (total pixel count), centroid (center of mass), bounding box, perimeter, and derived shape descriptors like convexity and elongation. In manufacturing, this enables rapid quantification of defect size, particle contamination, or missing features without requiring a trained neural network, making it computationally lightweight and deterministic for high-speed production lines.
Related Terms
Blob analysis is a foundational technique that connects to a broader ecosystem of computer vision and quality inspection concepts. These related terms provide essential context for understanding how blob analysis integrates into modern automated optical inspection pipelines.
Binarization
The critical preprocessing step that converts a grayscale image into a binary black-and-white image based on a threshold value. Without proper binarization, blob analysis cannot function, as the algorithm requires a clear separation between foreground objects (defects) and background. Common techniques include:
- Global thresholding: A single intensity cutoff for the entire image
- Adaptive thresholding: Local thresholds that adjust for uneven illumination
- Otsu's method: Automatic threshold selection by minimizing intra-class variance
Connected Component Labeling
The core algorithm underlying blob analysis that scans a binary image and assigns a unique identifier to each connected group of foreground pixels. This process transforms a raw pixel map into discrete, analyzable objects. Two primary approaches exist:
- Two-pass algorithm: Scans the image twice, first assigning provisional labels and then resolving equivalences
- One-pass algorithm: Uses a union-find data structure to track connected regions in a single traversal
- Connectivity rules: 4-connected (edges only) or 8-connected (edges and corners) define what constitutes a connected region
Morphological Operations
Pre- and post-processing operations that refine binary images before or after blob analysis. These operations use a structuring element to probe and modify the shape of connected regions:
- Erosion: Shrinks foreground regions to eliminate small noise pixels
- Dilation: Expands foreground regions to close small gaps within a blob
- Opening: Erosion followed by dilation, removes small noise while preserving overall shape
- Closing: Dilation followed by erosion, fills small holes within blobs These operations are essential for cleaning up thresholding artifacts.
Blob Feature Extraction
The quantitative measurement phase where geometric and statistical properties are computed for each labeled blob. Standard features include:
- Area: Total pixel count, directly correlating to defect size
- Perimeter: Length of the blob boundary, useful for shape complexity
- Centroid: Center of mass coordinates for precise defect localization
- Bounding box: Minimum enclosing rectangle for region of interest cropping
- Circularity: Ratio of area to perimeter squared, distinguishing round defects from irregular ones
- Convexity: Ratio of blob area to its convex hull area, identifying concave defect shapes
- Orientation: Angle of the major axis, relevant for directional scratches or cracks
Automated Optical Inspection (AOI)
The hardware and software system that serves as the deployment environment for blob analysis in manufacturing. AOI systems integrate:
- Illumination: Controlled lighting (LED arrays, structured light) to maximize defect contrast
- Imaging: High-resolution cameras or line scan sensors capturing the device under test
- Processing pipeline: Binarization → blob analysis → feature extraction → classification
- Pass/fail gating: Decision logic that compares extracted blob features against tolerance thresholds Blob analysis is often the first analytical stage in an AOI pipeline, identifying candidate defect regions for downstream deep learning classification.
Gage Repeatability and Reproducibility (GR&R)
A statistical validation methodology used to certify the measurement precision of a blob analysis system. GR&R quantifies two sources of variation:
- Repeatability: Variation when the same operator measures the same part multiple times (equipment variation)
- Reproducibility: Variation when different operators measure the same part (appraiser variation) For a blob analysis system measuring defect dimensions, a GR&R study ensures that area and perimeter measurements are consistent and trustworthy, typically requiring a total GR&R value below 10% for the system to be considered acceptable for production metrology.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us