There's more...
There are many thresholding algorithms for binary segmentation; the scikit-image library provides implementations of some of them. You can also evaluate the algorithms and select the one that gives the best result for your image. For each of the algorithms, you must specify a radius if you want to use the local version; otherwise, the global version will be invoked by default. The following figure shows how different (global) thresholding functions perform on an input grayscale blackboard image from a statistics course at MIT. Implement it on your own; maybe also try using different radii to implement the local versions for different algorithms and see the impact of the radius on the binary output image. As you can see from ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access