Introduction - If you have any usage issues, please Google them yourself
Principle is that Gonzalez " Digital Image Processing (Second Edition)" Binary Image Processing: Basic global threshold method, dual-threshold method. And the neighborhood to deal with the border width in the single-point detection algorithm for testing connectivity.