Skip to content

Commit

Permalink
Better settings for cropping level code image before OCR
Browse files Browse the repository at this point in the history
  • Loading branch information
dram55 committed Jul 28, 2019
1 parent 60b17f0 commit 29351e4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion MarioMaker2OCR/OCRLibrary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ private static List<Mat> segmentCharacters(Image<Gray, byte> image)
image._Not();

// Get rid of extra space around the text
Mat structuringElement = CvInvoke.GetStructuringElement(ElementShape.Rectangle, new Size(20, 3), new Point(-1,-1));
Mat structuringElement = CvInvoke.GetStructuringElement(ElementShape.Rectangle, new Size(390, 40), new Point(-1,-1));
Mat dilation = new Mat();
CvInvoke.Dilate(image, dilation, structuringElement, new Point(-1, -1), 1, BorderType.Default, new MCvScalar());
CvInvoke.FindContours(dilation, contours, hier, RetrType.External, ChainApproxMethod.ChainApproxNone);
Expand Down

0 comments on commit 29351e4

Please sign in to comment.