Objective
Slice a grey image into foreground and background with a brightness threshold and watch one number split the image in two.
The idea
Thresholding turns a greyscale image binary: every pixel above the threshold becomes white, below becomes black. It is the simplest segmentation.
Try this
- 1Slide the threshold and watch the split move.
- 2Find the value that best separates object from background.
- 3Threshold an unevenly lit image and see the failure.
- 4Combine thresholding with morphology to clean the result.
Watch for
- One threshold divides pixels into two classes.
- The histogram valley is a good threshold location.
- Uneven lighting breaks a fixed threshold.
- Thresholding is the front end of most segmentation.