Vision Lab
Presence/absence inspection you can poke at. Threshold the image, count the blobs, pass or fail the part — then sabotage the lighting and learn the lesson every vision engineer learns the hard way.
Part to inspect
Uploads are processed entirely in your browser — the image never leaves this page.
Inspection recipe
The teaching moment
Dial in a threshold that passes, then press the button and watch a perfectly good recipe fall apart under bad lighting.
Camera view
Boxes and crosshairs mark each detected blob (green when the count matches, red when it doesn't). Flip to the thresholded view to see exactly what the algorithm sees.
Most inspection problems are counting problems
Is the hole drilled? Is the insert seated? Did the label make it on? Before you reach for a neural network, notice that each of these reduces to: find the dark (or light) regions, ignore the specks, count what's left, compare to the drawing. This page runs that entire pipeline in your browser in plain TypeScript — no OpenCV, no server — precisely so you can see there's no magic in it. The threshold slider is the algorithm.
The sabotage button is the part I most want you to press. A recipe that passes a good part under good light will fail the same part under a lighting gradient — which is why production vision starts with the physics (lens, light, enclosure) and only then the code. When you're ready to do this for real, with adaptive thresholds and pixel-to-millimetre calibration, I wrote a step-by-step Python version in your first OpenCV part-inspection script. And if the measurement side of quality is your battle, the guard-band visualizer shows what your gauge's uncertainty does to your tolerance.
Frequently asked questions
How does presence/absence inspection actually work?+
Three steps, and this page runs all of them live: convert the image to grayscale, apply a threshold so every pixel becomes feature-or-background, then group neighboring feature pixels into connected blobs and filter out specks below a minimum area. If the blob count matches the expected feature count, the part passes. Most real-world 'is the hole drilled / is the clip present / is the label on' checks are exactly this, just with better cameras.
Why does everyone say lighting is 80% of the job?+
Because the algorithm never sees the part — it sees the light coming off it. Press the 'sabotage the lighting' button: the part is identical, the recipe is identical, and the verdict flips, purely because an illumination gradient moved half the image across the threshold. Production systems solve this with controlled lighting (ring lights, backlights, diffusers) and enclosures before anyone tunes a parameter, which is cheaper and more reliable than any software fix.
Rule-based vision vs. deep learning — which should I use?+
For 'is the feature there, and is it roughly the right size in a known place,' rule-based pipelines like this one win: they're explainable, they run in milliseconds on cheap hardware, they need zero training images, and when they fail you can see exactly why in the thresholded view. Deep learning earns its complexity when defects are subtle, variable, and hard to describe with rules — cosmetic scratches, weld quality, fabric flaws. Start rule-based; graduate only when the rules run out.
Would this exact code work for real inspection?+
The pipeline is real; the implementation is a teaching version. Production systems use a library like OpenCV for speed and for the tools this page deliberately leaves out — adaptive thresholding (which survives the lighting sabotage), morphological cleanup, calibration from pixels to millimetres, and position checks (this page counts blobs, so a mirrored part with the right count still passes). The concepts transfer one-to-one, and my OpenCV walkthrough linked below turns this exact recipe into a Python script.
What happens to images I upload?+
They're drawn onto a canvas in your browser tab, processed there in TypeScript, and never transmitted anywhere — there is no server-side processing, no storage, and no analytics on the image content. Close the tab and the image is gone.
Thinking about a vision check on your line?
Python, cameras, and shop-floor reality — that's my day job.