public void OcrParallelizationExperiment() { // Init Drive var relpath = Path.Combine(Dir.OcrDirectory, Dir.OcrParallelizationTesting); var drive = new Drive(relpath, Drive.Reason.Read); var regs = drive.Files("reg").ToList(); var revs = drive.Files("rev").ToList(); // Sort to ensure correct pairing regs.Sort(); revs.Sort(); // Concatenate and Recognize var images = regs.Concat(revs).Select(path => new Bitmap(path)).ToList(); int revStart = regs.Count; var datas = new List <OcrData>(OCR.ParallelRecognize(images, images.Count(), Accuracy.Low, "eng", true)); var regdata = datas.Take(revStart); var revdata = datas.Skip(revStart); var difference = regdata.Zip(revdata, (reg, rev) => { Console.WriteLine("-----------------------------------------------"); Console.WriteLine(OCR.StripNewLine(reg.Text + " vs " + rev.Text)); Console.WriteLine(reg.Cost + " vs " + rev.Cost); Console.WriteLine("Diff: " + (reg.Cost - rev.Cost)); Console.WriteLine("scantime: " + reg.ScanTime + "ms and " + rev.ScanTime + "ms"); Console.WriteLine(); return(reg.Cost - rev.Cost); }).ToList(); difference.ForEach(diff => Assert.IsTrue(diff < 0)); }
public void OcrParallelizationTest() { // Init Drive var relpath = Path.Combine(Dir.OcrDirectory, Dir.OcrParallelizationTesting); var drive = new Drive(relpath, Drive.Reason.Read); var currents = drive.Files("reg").Concat(drive.Files("rev")).Select(path => new Bitmap(path)).ToArray(); var opposites = currents.Select(Filter.Reverse).ToArray(); var regularCount = drive.FileCount("reg"); var results = OCR.ParallelDetectOrientation(currents, opposites, Accuracy.Low, "eng", true).ToList(); results.ToList().ForEach(result => { var current = result.Item2; var opposite = result.Item3; Console.WriteLine("-----------------------------------------------"); Console.WriteLine(OCR.StripNewLine(current.Text + " vs " + opposite.Text)); Console.WriteLine(current.Cost + " vs " + opposite.Cost); Console.WriteLine("Diff: " + (current.Cost - opposite.Cost)); Console.WriteLine("scantime: " + current.ScanTime + "ms and " + opposite.ScanTime + "ms"); Console.WriteLine(); }); results.Take(regularCount).ToList().ForEach(pair => Assert.IsTrue(pair.Item1 >= 0)); results.Skip(regularCount).ToList().ForEach(pair => Assert.IsTrue(pair.Item1 <= 0)); }
static void ScanIntoDB(string folderPath) { Console.WriteLine("Welcome to FIFA Statalyzer."); Console.WriteLine("Processing screenshots located in " + folderPath); string[] fileList = Directory.GetFiles(folderPath, "*.png"); SQLiteConnection dbConnection = DBManagement.InitializeDB(); foreach (string file in fileList) { string processedFile = ImageProcessing.ProcessScreenshot(file); Dictionary <string, int> statsDict = new Dictionary <string, int>(); string[] legend = File.ReadAllLines(@".\cfg\legend.txt"); string ocrResult = (OCR.ReadImage(processedFile)); string ocrClean = OCR.CleanUp(ocrResult); string[] ocrValues = ocrClean.Split(' '); for (int i = 0; i < ocrValues.Length; i++) { statsDict.Add(legend[i], (int.Parse(ocrValues[i]))); } int result = 0; statsDict.TryGetValue("hGoals", out int hGoals); statsDict.TryGetValue("aGoals", out int aGoals); if (hGoals == aGoals) { result = 0; } // Draw else if (hGoals > aGoals) { result = 1; } // Home win else if (hGoals < aGoals) { result = 2; } // Away win statsDict.Add("result", result); Console.WriteLine("Inserting these values into DB:"); foreach (var pair in statsDict) { Console.WriteLine("{0}: {1}", pair.Key, pair.Value); } StringBuilder commandBuilder = new StringBuilder("insert into fifa("); foreach (var pair in statsDict) { commandBuilder.Append(pair.Key + ", "); } commandBuilder.Length -= 2; commandBuilder.Append(") values ("); foreach (var pair in statsDict) { commandBuilder.Append(pair.Value + ", "); } commandBuilder.Length -= 2; commandBuilder.Append(");"); string sqlCommand = commandBuilder.ToString(); DBManagement.ExecuteNonQuery(sqlCommand, dbConnection); Console.WriteLine("Results inserted."); } dbConnection.Close(); Console.WriteLine("All images processed."); }
public void OcrSimpleOcrTest() { // Init Drive and a Checker (Hashmap) var relpath = Path.Combine(Dir.OcrDirectory, Dir.OcrSimple); var fullpath = Path.Combine(Drive.GetDriveRoot(), relpath); var checker = Helpers.BuildChecker(Path.Combine(fullpath, Helpers.CheckFile)); var drive = new Drive(relpath, Drive.Reason.Read); // Init Correct List var correct = new List <bool>(drive.FileCount("snip")); // Scan each snippet, check if they are substrings, save result in correct foreach (var file in drive.Files("snip")) { var img = new Bitmap(file); var filename = Path.GetFileName(file); var ocrdata = OCR.Recognize(img); Assert.IsTrue(filename != null); Assert.IsTrue(checker[filename] != null); var isCorrect = ocrdata.Text.ToLower().Contains(checker[filename].ToLower()); correct.Add(isCorrect); Console.WriteLine("-------------------------------------------"); Console.WriteLine("CORRECT: " + isCorrect); Console.WriteLine("OCR: " + OCR.StripNewLine(ocrdata.Text)); Console.WriteLine("REAL: " + checker[filename].ToLower()); Console.WriteLine("COST: " + ocrdata.Cost); Console.WriteLine(); } // Ensure that all the OCR scans were correct Assert.IsTrue(correct.All(x => x)); }
bool SoldierScanCheckForAvailibleSoldiers() { string OcrActiveSoldiers = ""; if (StopSoldierScan == false) //same position for difficulty 5-10 { OcrActiveSoldiers = OCR.OCRcheck(1173, 922, 106, 34, "0123456789/ "); //6char if (!SoldierScanCheckOCRResultValid(OcrActiveSoldiers)) { OcrActiveSoldiers = OCR.OCRcheck(1173, 922, 84, 34, "0123456789/ "); //5char if (!SoldierScanCheckOCRResultValid(OcrActiveSoldiers)) { OcrActiveSoldiers = OCR.OCRcheck(1173, 922, 74, 34, "0123456789/ "); //4char if (!SoldierScanCheckOCRResultValid(OcrActiveSoldiers)) { OcrActiveSoldiers = OCR.OCRcheck(1173, 922, 51, 34, "0123456789/ "); //3char if (!SoldierScanCheckOCRResultValid(OcrActiveSoldiers)) { return(false); } } } } } return(true); }
public void OcrQuickOrientationTest() { // Init Drive var relpath = Path.Combine(Dir.OcrDirectory, Dir.OcrOrientationTesting); var drive = new Drive(relpath, Drive.Reason.Read); var regs = drive.Files("img").ToList(); var revs = drive.Files("rev").ToList(); // Sort them so that the names align correctly regs.Sort(); revs.Sort(); // Zip and Diff var difference = regs.Zip(revs, (reg, rev) => { var imgReg = new Bitmap(reg); var regData = OCR.Recognize(imgReg, Accuracy.High); var imgRev = new Bitmap(rev); var revData = OCR.Recognize(imgRev, Accuracy.High); Console.WriteLine("-----------------------------------------------"); Console.WriteLine(OCR.StripNewLine(regData.Text + " vs " + revData.Text)); Console.WriteLine(regData.Cost + " vs " + revData.Cost); Console.WriteLine("Diff: " + (regData.Cost - revData.Cost)); Console.WriteLine(); return(regData.Cost - revData.Cost); }).ToList(); difference.ForEach(diff => Console.WriteLine("Diff : " + diff)); difference.ForEach(diff => Assert.IsTrue(diff < 0)); Assert.IsTrue(difference.Aggregate((long)0, (total, item) => total + item) < 0); }
public void OcrSimpleReversalTest() { // Init Drive var relpath = Path.Combine(Dir.OcrDirectory, Dir.OcrSimple); var drive = new Drive(relpath, Drive.Reason.Read); var regs = drive.Files("snip").ToList(); var revs = drive.Files("rev").ToList(); // Sort so that the correct files will pair up when zipped regs.Sort(); revs.Sort(); // Zip and diff var difference = regs.Zip(revs, (reg, rev) => { var imgReg = new Bitmap(reg); var regData = OCR.Recognize(imgReg); var imgRev = new Bitmap(rev); var revData = OCR.Recognize(imgRev); Console.WriteLine("-----------------------------------------------"); Console.WriteLine(OCR.StripNewLine(regData.Text + " vs " + revData.Text)); Console.WriteLine(regData.Cost + " vs " + revData.Cost); Console.WriteLine("Diff: " + (regData.Cost - revData.Cost)); Console.WriteLine(); return(regData.Cost - revData.Cost); }).ToList(); difference.ForEach(diff => Console.WriteLine("Diff : " + diff)); Assert.IsTrue(difference.Aggregate((long)0, (total, item) => total + item) < 0); }
public void OnKeyAction(Key key) { // close the snapit overlay when *any* key is pressed down if (snapItOverlayWindow.isEnabled && KeyInterop.KeyFromVirtualKey((int)key) != Key.None) { snapItOverlayWindow.closeOverlay(); return; } if (key == Settings.ActivationKey) { //check if user pressed activation key if (Settings.debug && (Keyboard.Modifiers & ModifierKeys.Shift) == ModifierKeys.Shift) { AddLog("Loading screenshot from file"); StatusUpdate("Offline testing with screenshot", 0); LoadScreenshot(); } else if (Settings.debug && (Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control || (Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control) { AddLog("Starting snap it"); StatusUpdate("Single item pricecheck", 0); OCR.SnapScreenshot(); } else if (Settings.debug || OCR.VerifyWarframe()) { //if (Ocr.verifyFocus()) // Removing because a player may focus on the app during selection if they're using the window style, or they have issues, or they only have one monitor and want to see status // There's a lot of reasons why the focus won't be too useful, IMO -- Kekasi Task.Factory.StartNew(() => OCR.ProcessRewardScreen()); } } }
// 文字识别 private string GetOCR(string imageName) { string s = Marshal.PtrToStringAnsi(OCR.GetOCR(imageName, -1)); LogHelper.ShowLog("图片识别结果 {0}", s); return(Regex.Replace(s, @"\s", "")); }
protected string ReadBox() { Screen.Dirty(); if (Highlighted) { return(OCR.ReadTableRow( Screen.GetPixelsOfColor( Left, Top + CharacterOffset, Right - Left, CharacterHeight, new [] { new byte[] { 255, 255, 255 } }), OCRReader.Alphabet)); } else { return(OCR.ReadTableRow( Screen.GetPixelsOfColor( Left, Top + CharacterOffset, Right - Left, CharacterHeight, Colors), OCRReader.Alphabet)); } }
public bool InsertFileData(int cpeEntryId, int cpeDefinitionId, string filePath) { bool success; if (File.Exists(filePath)) { OCR ocr = new OCR(); var json = ocr.GetJSON(filePath); string ocrText = ocr.GetProperty(json); ExtractData extractData = new ExtractData(); extractData.OCRText = ocrText; switch (cpeDefinitionId) { case 27: success = extractData.Glue_Turret_Data(cpeEntryId, cpeDefinitionId); break; default: success = false; //if wrong definitionId is given break; } return(success); } else { success = false; //if file is not found return(success); } }
private void mnuOCR_Click(object sender, EventArgs e) { // 텍스트 추출 Cursor.Current = Cursors.WaitCursor; rtxtResult.Text = OCR.GetTextfromImage(_file.Bitmap); Cursor.Current = Cursors.Default; }
/// <summary> /// Convert the text from the image to strings /// Translate those strings to the desired language /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void buttonTranslate_Click(object sender, EventArgs e) { try { //Define the tools being used for detection and translation string res = ""; OCR convert = new OCR(); Translation tr = new Translation(); Task.Run(async() => { //Wait for the API to respond res = await convert.ConvertToText(filePath); }).Wait(); textBoxDetected.Text = res; //Display the detected characters textBoxDetected.ReadOnly = true; //lock the text box //Define the selected language and detected characters as a pair KeyValuePair <string, string> vp = new KeyValuePair <string, string>(res, langCodes[langCode]); Task.Run(async() => { //Wait for the translation res = await tr.TranslateText(vp); }).Wait(); textBoxTranslated.Text = res; //Display the translated text textBoxTranslated.ReadOnly = true; //lock the text box } catch (Exception ex) { ErrorLogger.Log(LogLevel.Info, e); //Log exception MessageBox.Show(ex.Message); } }
List <GED_PROC_CodigosBarras_Result> OCRImage(OCR ocr, ListView listView) { if (!CopyImage()) { return(AfterProcess_Start(ocr, listView)); } ocr.BitmapImage.Dispose(); ocr.BitmapImageFile = this.fileName; ocr.Process_Start(); var timeOutAbout = DateTime.Now.AddSeconds(this.TimeOut); while (ocr.Process_Thread.IsAlive) { if (!ACSConfig.GetScanner().Driver.ToUpper().Contains("FUJITSU") && !ACSConfig.GetScanner().Driver.ToUpper().Contains("SP-1120")) { Application.DoEvents(); } if (timeOutAbout < DateTime.Now) { ocr.Process_Thread.Abort(); } } SettingOCR(ref ocr); return(AfterProcess_Start(ocr, listView)); }
/*---------------------------------------------------------------------------------------------------*/ #region ***** Seçilen Resim Parçasını Alma ***** private void rdAyarla() { Crop(); if (CropGecici != null) { OCR oku = new OCR(CropGecici); if (rdAd.Checked) { txtAd.Text = oku.kop(); } else if (rdSoyad.Checked) { txtSoyad.Text = oku.kop(); } else if (rdTel.Checked) { txtTel.Text = oku.kop(); } else if (rdAdres.Checked) { txtAdres.Text = oku.kop(); } } }
public List <string> RecognizeText(Stream bitmap) { List <string> list = new List <string>(); try { OCR ocr = visionServiceClient.RecognizeText(bitmap, LanguageCodes.AutoDetect, true); string result = new Gson().ToJson(ocr); OCRModel ocrModel = JsonConvert.DeserializeObject <OCRModel>(result); foreach (var region in ocrModel.regions) { foreach (var line in region.lines) { foreach (var word in line.words) { list.Add(word.text); } } } } catch (Java.Lang.Exception ex) { ex.PrintStackTrace(); string b = ""; } return(list); }
void SettingOCR(ref OCR ocr) { ocr.BarcodeType = BarcodeTypes.All; ocr.OCRType = OCRType.Barcode; ocr.ProductName = "StandardBar"; ocr.CustomerName = "Version5"; ocr.OrderID = "5152"; ocr.RegistrationCodes = "5445-3139-8282-8844"; ocr.ActivationKey = "6930-2481-1896-4395"; ocr.DisplayChecksum = false; ocr.CalculateChecksum = true; ocr.DisplayErrors = false; ocr.EnforceSpaceRules = false; ocr.StartStopCodesDisplay = false; ocr.StartStopCodesRequired = false; ocr.Statistics = false; ocr.ThinCharacters = true; ocr.Abort = false; ocr.ErrorCorrection = OCRTools.ErrorCorrectionTypes.None; ocr.AnalyzeAutomatic = true; ocr.StartStopCodesDisplay = false; ocr.StartStopCodesRequired = false; ocr.Statistics = false; ocr.ThinCharacters = true; }
private List <string[]> ReadDataTable(int[] columns, int top, int bottom, int lineHeight, int topOfCharactersOffset) { var table = new List <string[]>(); var currentRowY = top; while (currentRowY + lineHeight - 1 <= bottom) { var data = new string[columns.Length - 1]; for (var i = 0; i < columns.Length - 1; i++) { data[i] = OCR.ReadTableRow( Screen.GetPixelsOfColor( GetColumnStartX(i), currentRowY + topOfCharactersOffset, columns[i + 1] - columns[i], lineHeight - topOfCharactersOffset - 1, new[] { new byte[] { 0, 0, 0 }, new byte[] { 255, 0, 0 } }), OCRReader.Alphabet); } table.Add(data); currentRowY += lineHeight; } return(table); }
public void OnMouseAction(MouseButton key) { if (Settings.ActivationMouseButton != MouseButton.Left && key == Settings.ActivationMouseButton) { //check if user pressed activation key if (Settings.debug && (Keyboard.Modifiers & ModifierKeys.Shift) == ModifierKeys.Shift && (Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control) { using (System.Windows.Forms.OpenFileDialog openFileDialog = new System.Windows.Forms.OpenFileDialog()) { openFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures); openFileDialog.Filter = "image files (*.png)|*.png|All files (*.*)|*.*"; openFileDialog.FilterIndex = 2; openFileDialog.RestoreDirectory = true; openFileDialog.Multiselect = true; if (openFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) { Task.Factory.StartNew(() => { try { foreach (string file in openFileDialog.FileNames) { Main.AddLog("Testing fullscreen file: " + file.ToString()); Bitmap image = new Bitmap(file); OCR.ProcessSnapIt(image, image, new Point(0, 0)); } } catch (Exception e) { AddLog(e.Message); StatusUpdate("Failed to load image", 1); } }); } else { StatusUpdate("Failed to load image", 1); } } } else if (Settings.debug && (Keyboard.Modifiers & ModifierKeys.Shift) == ModifierKeys.Shift) { AddLog("Loading screenshot from file"); StatusUpdate("Offline testing with screenshot", 0); LoadScreenshot(); } else if ((Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control) { AddLog("Starting snap it"); StatusUpdate("Starting snap it", 0); OCR.SnapScreenshot(); } else if (Settings.debug || OCR.VerifyWarframe()) { Task.Factory.StartNew(() => OCR.ProcessRewardScreen()); } } }
private void btnDetect_Click(object sender, RoutedEventArgs e) { Mat input = ImageUtils.ReadInImage(ImgLocation); List <string> output = OCR.RecognizeText(input); lstOutput.ItemsSource = output; }
OCR NewOCR() { var ocr = new OCR(); SettingOCR(ref ocr); return(ocr); }
public static bool EquateOCR(OCR e1, OCR e2) { return (e1.Candidates.Count.Equals(e2.Candidates.Count) && e1.Language.Equals(e2.Language) && e1.Metadata.Equals(e2.Metadata) && e1.Text.Equals(e2.Text) && e1.Status.Equals(e2.Status)); }
public void BasicChunkTest() { var chunkedZeros = OCR.Chunk(zeros); Assert.AreEqual(zero, "\n" + chunkedZeros[0]); Assert.AreEqual(zero, "\n" + chunkedZeros[1]); Assert.AreEqual(OCRDigit.digits[0], chunkedZeros[1]); }
public static bool VerifyOCR(OCR ocr, bool isCacheImage = false, bool isEnhanced = false) { string error = ""; try { if (isCacheImage) { VerifyCacheId(isCacheImage, ocr.CacheId); } if (ocr.Candidates == null) { error += "Candidates object is null "; } if (isEnhanced) { if (ocr.Candidates.Count <= 0) { error += "Candidate(s) details not populated."; } } if (ocr.Language == null) { error += "Language is null "; } if (ocr.Metadata == null) { error += "Metadata is null"; } if (!VerifyStatus(ocr.Status)) { error += TestBase.ErrorMessage; } if (ocr.Text == null) { error += "Text is null"; } if (ocr.TrackingId == null) { error += "Trackingid are null"; } TestBase.ErrorMessage = error; return(string.IsNullOrEmpty(TestBase.ErrorMessage)); } catch (Exception e) { TestBase.ErrorMessage += "Unable to verify the Evaulate Result. Error:" + e.InnerException.Message; return(false); } }
protected string ReadBox() { return(OCR.ReadTableRow( Screen.GetPixelsOfColor( Left, Top + CharacterOffset, Right - Left, CharacterHeight, Colors), OCRReader.Alphabet)); }
public void Guessing_111111111_ShouldBeGuessedAs_711111111() { var input = " \n" + " | | | | | | | | |\n" + " | | | | | | | | |\n" + " "; var result = new OCR().ReadDigits(input); var expectedResult = Arrange_ArrayOfDigits(7, 1, 1, 1, 1, 1, 1, 1, 1); result.Digits.ToArray().Should().Equal(expectedResult); }
protected override string RunInBackground(params Stream[] @params) { try { PublishProgress("Recognizing..."); OCR ocr = mainActivity.visionServiceClient.RecognizeText(@params[0], LanguageCodes.English, true); return(new Gson().ToJson(ocr)); } catch (Java.Lang.Exception ex) { return(null); } }
public string ScreenToNMZPoints() { var screenshot = ScreenShotTaker.TakeNmzScreenShot(); var points = NmzPointsImageFinder.FindNMZPoints(screenshot); if (points.IsEmpty()) { return("-1"); } var filteredImage = ImageFilterer.FilterImage(points); var listNumbers = Separator.Separate(filteredImage); return(listNumbers.Aggregate("", (current, number) => current + OCR.RecognizeNumber(number))); }
public void Test_123456789_Get_At_Index_1() { var line0 = " _ _ _ _ _ _ _ "; var line1 = " | _| _||_||_ |_ ||_||_|"; var line2 = " ||_ _| | _||_| ||_| _|"; string expected = " _ " + " _|" + "|_ "; var ocr = new OCR(line0, line1, line2); Assert.That(ocr.GetDigit(1).ToChar(), Is.EqualTo(new Digit(expected).ToChar())); }
public static List <Shred> Factory(List <string> files, bool runOcr = true) { List <Shred> shreds = new List <Shred>(); foreach (string file in files) { shreds.Add(Create(file, true)); } if (runOcr) { OCR.ShredOcr(shreds.ToArray()); } return(shreds); }
protected override Task <ExtractedPDF> ExecuteAsync(AsyncCodeActivityContext context, CancellationToken cancellationToken, Application client) { var inputFilePath = Data.Get(context); if (string.IsNullOrWhiteSpace(inputFilePath)) { throw new ArgumentNullException(Resources.PdfDataArgumentDisplayName); } var ocrFlag = OCR.Get(context); var textFlag = Text.Get(context); var metadataFlag = Metadata.Get(context); var tablesFlag = Tables.Get(context); var singleColumnFlag = SingleColumn.Get(context); return(client.ExtractPDF(inputFilePath, ocrFlag, textFlag, metadataFlag, tablesFlag, singleColumnFlag)); }
private void localeComboboxSelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e) { ComboBoxItem item = (ComboBoxItem)localeCombobox.SelectedItem; string selectedLocale = item.Tag.ToString(); settingsObj["Locale"] = selectedLocale; locale = selectedLocale; Save(); _ = OCR.updateEngineAsync(); _ = Task.Run(async() => { Main.dataBase.ReloadItems(); }); }
internal static unsafe int IsBitmapsAlike(NikseBitmap bmp1, OCR.Binary.BinaryOcrBitmap bmp2) { int different = 0; int maxDiff = bmp1.Width * bmp1.Height / 5; for (int x = 1; x < bmp1.Width; x++) { for (int y = 1; y < bmp1.Height; y++) { if (bmp1.GetAlpha(x, y) < 100 && bmp2.GetPixel(x, y) > 0) different++; } if (different > maxDiff) return different + 10; } return different; }
//FOR-DEBUG: Count images //private int imageCount = 0; // set the Segmode if provided public void SetPSM(OCR.TesseractWrapper.ePageSegMode PageSegMode) { /* OCR.TesseractWrapper.ePageSegMode auto = OCR.TesseractWrapper.ePageSegMode.PSM_AUTO; OCR.TesseractWrapper.ePageSegMode auto_only = OCR.TesseractWrapper.ePageSegMode.PSM_AUTO_ONLY; OCR.TesseractWrapper.ePageSegMode auto_osd = OCR.TesseractWrapper.ePageSegMode.PSM_AUTO_OSD; OCR.TesseractWrapper.ePageSegMode circle_word = OCR.TesseractWrapper.ePageSegMode.PSM_CIRCLE_WORD; OCR.TesseractWrapper.ePageSegMode psm_count = OCR.TesseractWrapper.ePageSegMode.PSM_COUNT; OCR.TesseractWrapper.ePageSegMode osd_only = OCR.TesseractWrapper.ePageSegMode.PSM_OSD_ONLY; OCR.TesseractWrapper.ePageSegMode single_block = OCR.TesseractWrapper.ePageSegMode.PSM_SINGLE_BLOCK; OCR.TesseractWrapper.ePageSegMode vert_text = OCR.TesseractWrapper.ePageSegMode.PSM_SINGLE_BLOCK_VERT_TEXT; OCR.TesseractWrapper.ePageSegMode single_char = OCR.TesseractWrapper.ePageSegMode.PSM_SINGLE_CHAR; OCR.TesseractWrapper.ePageSegMode single_column = OCR.TesseractWrapper.ePageSegMode.PSM_SINGLE_COLUMN; OCR.TesseractWrapper.ePageSegMode single_line = OCR.TesseractWrapper.ePageSegMode.PSM_SINGLE_LINE; OCR.TesseractWrapper.ePageSegMode single_word = OCR.TesseractWrapper.ePageSegMode.PSM_SINGLE_WORD; * */ if (Ocr != null) Ocr.SetPageSegMode(PageSegMode); }
public void Setup() { reader = new OCR(); }