Exemplo n.º 1
0
 public HeuristicSet GetLetterHeuristics(BoundedCharacter ch)
 {
     var rect = ch.Bounds.ToGdi();
     int midpoint = rect.X + (int)Math.Round(rect.Width / 2d);
     Rectangle smallerRect = new Rectangle(midpoint - Segmentator.PointerOffset, 0, Segmentator.WidthOfCanvas, Segmentator.HeightOfCanvas);
     HeuristicSet heursitics = new HeuristicSet { Bounds = rect, Label = ch.Character.ToString() };
     heursitics.GoThroughBoards(Boards, smallerRect);
     Bitmap b = Boards.First().Matrix.ExtractRectangularContentArea(smallerRect).ConvertDoubleArrayToBitmap(Color.White);
     b.Log(ch.Character.ToString(), smallerRect);
     return heursitics;
 }
Exemplo n.º 2
0
 public HeuristicSet GetSpaceHeuristics(BoundedCharacter ch1, BoundedCharacter ch2)
 {
     var rect1 = ch1.Bounds.ToGdi();
     var rect2 = ch2.Bounds.ToGdi();
     int midpoint = rect1.Right + (rect2.X - rect1.Right) / 2;
     Rectangle smallerRect = new Rectangle(midpoint - Segmentator.PointerOffset, 0, Segmentator.WidthOfCanvas, Segmentator.HeightOfCanvas);
     HeuristicSet heursitics = new HeuristicSet { Bounds = smallerRect, Label = "whitespace" };
     heursitics.GoThroughBoards(Boards, smallerRect);
     Bitmap b = Boards.First().Matrix.ExtractRectangularContentArea(smallerRect).ConvertDoubleArrayToBitmap(Color.White);
     b.Log("whitespace", smallerRect);
     return heursitics;
 }