Classical Machine Learning

Remove the tray's isolated speck

The changed foreground is a thin real candidate

The tray mask contains a broad seed region and a speck. Botie's opening can remove small structures, including some that might be real.

BOTIE

The changed mask contains a one-pixel-thick line and uses a 3 by 3 footprint. How would you decide whether this opening is suitable for a tray-analysis task?
The inputs we are comparing

Threshold mask

Broad seed and speck

10000
01110
01110
01110
00000

A thin region disappears

000
111
000

Symmetric footprint

Same in both cases

111
111
111
Result for broad seed and speck
00000
01110
01110
01110
00000
Choose an explanation to test
A cross-shaped seed and an isolated speck

This check uses the pieces from “Open the mask with the same footprint twice”.

BOTIE

Use the supplied cross footprint for opening. Predict which foreground pixels survive erosion followed by dilation under the existing zero-padding rule.
Threshold mask
10000
00100
01110
00100
00000
Symmetric footprint
010
111
010

Use a number, text, or an array matching the requested result. For a matrix, put each row in brackets. Saving your prediction runs your current construction on these inputs and checks the earlier examples too.

Build a construction in the workspace above first. This case will test those pieces.

Why can dilation restore the broad square after erosion but fail to restore the thin line, and what should guide footprint selection?

Judge a mask-cleaning operation by which real structures it must preserve as well as which artefacts it should remove.

Both operations use zero outside the image and centrally symmetric odd-sized footprints. Opening can remove real thin objects too.

Work through the Python challenges →
Continue the courseConnected Components →
← Image Thresholding