Individual letters in a C # image

I have images with 6 letters, and I want to move it to 6 images by 1 letter. I used this function:

public static List<UnmanagedImage> ApplyBlobExtractor (UnmanagedImage unmanaged)
        {
            // Extract blobs
            BlobCounter blobCounter  = new BlobCounter ();
            blobCounter.ObjectsOrder = ObjectsOrder.XY;
            blobCounter.ProcessImage (unmanaged);

            // Add blobs into list
            Blob[] blobs = blobCounter.GetObjects (unmanaged, false);
            List<UnmanagedImage> unmanagedList = new List<UnmanagedImage> (blobs.Length);
            foreach (Blob blob in blobs)
                unmanagedList.Add (blob.Image);

            return unmanagedList;
        }

The problem is that sometimes letters touch each other, and this makes the function recognize two letters as one. Is there a way to improve my function or create a better one?

This is an example image that gives the wrong result: enter image description here

The function gives me 2 images instead of 6.

Image 1: enter image description here

Image 2: enter image description here

+4
source share
1 answer

As a start, you can try using clustering methods.

A quick test with python scikit spectral clustering gives me this result:

enter image description here

I do not know what exists in C #.

0
source

Source: https://habr.com/ru/post/1660939/


All Articles