Some inspections do not need to match a taught template - they just need to answer questions like how many holes are drilled, whether a part is present, or how much dark contamination is on a surface. Blob analysis is the classic vision technique for exactly those jobs: separate the image into foreground and background, then measure the connected regions that result. This guide explains how thresholding produces blobs, what properties the tool measures, and why blob analysis suits problems where you are looking for unknown shapes rather than a known pattern.
Blob Analysis in one line: Blob analysis is a machine vision technique that first thresholds an image into foreground and background, then finds connected groups of foreground pixels - blobs - and measures each one by properties such as area, count, centroid, perimeter, and shape. It is the standard tool for counting parts or holes, detecting a missing or extra feature, and filtering by size to reject contamination, because it identifies regions by their measurable characteristics rather than by matching them to a taught model.
Blob analysis begins by turning a grayscale image into two classes of pixel. A threshold sets an intensity cutoff so that pixels darker than the cutoff become foreground and lighter ones become background, or the reverse, depending on the scene. The result is a binary image in which the features of interest are, ideally, solid regions of foreground against an empty background. Getting this separation clean is the make-or-break step, which is why blob applications depend so heavily on consistent lighting that keeps the contrast between feature and background stable from part to part.
Once the image is binary, the tool groups touching foreground pixels into connected components - the blobs. Two pixels belong to the same blob if they are adjacent, so a single drilled hole, a single spot of dirt, or a single printed dot each become one blob. The tool then walks through the image finding every such region and treats each as a distinct object it can measure. Small stray blobs from noise can be discarded by a minimum-area filter so that only meaningful regions survive to be counted and analyzed.
For each surviving blob the tool computes a set of properties. Area is the pixel count of the region; the centroid is its center of mass, useful as a location; the perimeter traces its boundary length; and shape descriptors capture how round, elongated, or irregular it is. Because every blob carries these numbers, an inspection can be written as simple logic - accept a part only if there are exactly four blobs each within an expected area range, for example - without ever teaching the tool what the correct part looks like as an image.
The bread-and-butter use is counting. If a part should have a fixed number of holes, slots, pins, or printed marks, blob analysis counts the blobs and compares to the expected number, flagging a part with too few or too many. Because each blob is measured independently, the same inspection can also confirm that each counted feature is the right size, catching a hole that is present but drilled undersize or a pin that is bent into a different footprint. This makes it a natural fit for verifying that an assembly step happened correctly.
The second common use is presence and contamination checking. A missing component leaves a gap where a blob should be, and an extra piece of debris shows up as an unexpected blob, so blob analysis catches both by watching for the wrong count or a blob in the wrong place. Filtering by area is what makes contamination detection practical: real contamination is dark and large enough to matter, so setting a minimum-area threshold lets the tool ignore trivial specks and alarm only on blobs big enough to reject the part. The same size filter keeps sensor noise from being mistaken for a defect.
The strength that ties these uses together is that blob analysis finds shapes it was never shown. It does not need a taught template because it discovers regions purely from the image and describes them by their properties. That makes it ideal when the exact appearance of what you are looking for is unpredictable - a scratch, a stain, or a chip has no fixed shape to teach, but it does have measurable area and darkness that a threshold plus a blob filter can catch.
The cleanest way to choose between blob analysis and pattern matching is to ask whether you know what you are looking for. Pattern matching needs a taught model and answers where is this specific known thing and at what angle; it excels at locating a defined part so other tools can run in the right place. Blob analysis needs no model and answers how many regions are there and what are their sizes and shapes; it excels at counting unknown or variable features and at flagging anything that appears where it should not. Many real stations use both - pattern matching to locate the part, then blob analysis inside that located region to count features or check for contamination.
Whichever tool decides the outcome, the useful result is a set of numbers per cycle - a blob count, a total contaminated area, a largest-blob size - and those numbers are worth watching over time, not just against a single pass or fail. A slowly rising average contamination area, for instance, is an early warning that an upstream process is getting dirty, long before any single part crosses the reject limit.
Merobix is a cloud SCADA platform that reads live tags from field devices over Modbus, DNP3, OPC UA, and MQTT, and a vision station's blob-derived metrics can be surfaced as tags the same as any flow, level, or temperature. Historizing a contamination-area trend or a defect-count rate lets an operator watch a whole line of vision stations from one place and catch a drifting process across sites, turning what would otherwise be a local reject count into a monitored, alarmable production signal.
Blob analysis finds unknown regions by thresholding the image and measuring connected pixel groups by properties like area, count, and shape, so it needs no taught model. Pattern matching searches for a specific taught template and reports where it is and at what angle. Use blob analysis to count features or catch contamination whose exact shape you cannot predict, and pattern matching to locate a known part precisely. The two are frequently combined in one inspection.
Because the whole technique rests on thresholding the image into foreground and background, and a threshold only works if the contrast between the feature and its surroundings stays consistent. If lighting drifts, the same threshold that cleanly separated a good part on one cycle can merge or split blobs on the next, corrupting the count and the measured areas. Stable, controlled illumination is what keeps the binary image reliable, which is why lighting design is usually the hardest part of a blob application.
Yes. Once a defect appears as a blob, the tool reports its area in pixels, and with a calibration relating pixels to real units that area can be expressed in square millimeters. This lets an inspection accept small cosmetic marks but reject any blob whose area exceeds a limit, and it lets the total contaminated area be trended over time. Reliable size measurement still depends on clean thresholding, so a defect with weak contrast may be undersized or missed.
This page references the protocol specifications published by the organizations below. Editions, product capabilities, and documentation change over time - confirm current requirements and specifications directly with the source.
Last reviewed: July 27, 2026. Merobix is not affiliated with, endorsed by, or sponsored by these organizations; their names are used only to identify the standards and products discussed.
Merobix reads your field devices into a cloud SCADA - the real thing behind these terms, live in days from any browser.