I have images with 6 letters and I wish to separte it into 6 images with 1 letter each. I was using 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 the letters are touching each other and this make the function recognize the 2 letters as a single one. Is there a way to improve my function or create a better one?
This is an example of image that is giving wrong result:
The function is giving me 2 images instead of 6.
Image 1 :
Image 2:
You can try to use clustering methods as a start.
A quick test with python's scikit spectral clustering gives me this result:
I don't know what exists in C# though.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With