OpenCV  3.4.4
Open Source Computer Vision
samples/cpp/distrans.cpp

An example on using the distance transform