Following function solves the problem, but I don't understand how to call it, especially "out List ImgLetters" part.
public static bool ApplyBlobExtractor (Bitmap SourceImg, int LettersCount, out List<Bitmap> ImgLetters)
{
ImgLetters = null;
ImgLetters = new List<Bitmap> ();
BlobCounter blobCounter = new BlobCounter ();
// Sort order
blobCounter.ObjectsOrder = ObjectsOrder.XY;
blobCounter.ProcessImage (SourceImg);
Blob[] blobs = blobCounter.GetObjects (SourceImg, false);
// Adding images into the image list
UnmanagedImage currentImg;
foreach (Blob blob in blobs)
{
currentImg = blob.Image;
ImgLetters.Add (currentImg.ToManagedImage ());
}
return ImgLetters.Count == LettersCount;
}
Now lets look at this:
public static bool ApplyBlobExtractor (Bitmap SourceImg, int LettersCount, out List<Bitmap> ImgLetters)
Bitmap SourceImg - picture, where blobs will be found
int LettersCount - blob that we are going to extract (number)
out List ImgLetters - ???
What does 3rd parameter do (how to call this function)?
Bitmap image1 = new Bitmap(@"C:\1.png");
..
ApplyBlobExtractor (image1, 1, ??? )
..
image2.save(@"C:\2.png")