I'm looking for an implementation of thickening and thinning of 1-bit color bitmaps such that the topology, or connectivity, of the images is not altered. That is, if you do thickening just using dilation, two blobs that are near to each other may be joined into a single blob: the type of thickening operation I am looking for would never do this.
Does OpenCV have this out of the box or is there a way to implement it with what OpenCV does offer?
I believe this operation is implemented in Leptonica but would rather not add an additional dependency beyond OpenCV if I do not need to.
I'm using OpenCV from C++ if that matters.