I’m trying to recognize the bounds of distinct digits in Swift, not sure the right approach.
I can think of:
- Connected component labeling (iterate over the pixels of the image and see if neighbors are black)
- K-means clustering (take the points of that make up the lines of the drawing and try to detect clusters. not ideal since you need to know the number of clusters.
- Some sort of built in Vision method like VNTextObservation.
For example: I’d like to get the bounding rects of each digit in this “11”. I can turn it into a raster image, or use an array of points used to draw the “11”.