コード例 #1
0
ファイル: Tesseract.cs プロジェクト: zy850580380/emgucv
 /// <summary>
 /// Make a HTML-formatted string with hOCR markup from the internal data structures.
 /// </summary>
 /// <param name="pageNumber">pageNumber is 0-based but will appear in the output as 1-based.</param>
 /// <returns>A HTML-formatted string with hOCR markup from the internal data structures.</returns>
 public String GetHOCRText(int pageNumber = 0)
 {
     using (Util.VectorOfByte bytes = new Util.VectorOfByte())
     {
         OcrInvoke.TessBaseAPIGetHOCRText(_ptr, pageNumber, bytes);
         return(UtfByteVectorToString(bytes));
     }
 }
コード例 #2
0
ファイル: Tesseract.cs プロジェクト: zy850580380/emgucv
 /// <summary>
 /// Get all the text in the image
 /// </summary>
 /// <returns>All the text in the image</returns>
 public string GetUTF8Text()
 {
     using (Util.VectorOfByte bytes = new Util.VectorOfByte())
     {
         OcrInvoke.TessBaseAPIGetUTF8Text(_ptr, bytes);
         return(UtfByteVectorToString(bytes));
     }
 }
コード例 #3
0
 /// <summary>
 /// Get all the text in the image
 /// </summary>
 /// <returns>All the text in the image</returns>
 public string GetText()
 {
     using (Util.VectorOfByte bytes = new Util.VectorOfByte())
     {
         TessBaseAPIGetUTF8Text(_ptr, bytes);
         return(_utf8.GetString(bytes.ToArray()).Replace("\n", Environment.NewLine));
     }
 }
コード例 #4
0
        /// <summary>
        /// Get all the text in the image
        /// </summary>
        /// <returns>All the text in the image</returns>
        public string GetText()
        {
            using (Util.VectorOfByte bytes = new Util.VectorOfByte())
            {
                OcrInvoke.TessBaseAPIGetUTF8Text(_ptr, bytes);
#if NETFX_CORE
                byte[] bArr = bytes.ToArray();
                return(_utf8.GetString(bArr, 0, bArr.Length).Replace("\n", Environment.NewLine));
#else
                return(_utf8.GetString(bytes.ToArray()).Replace("\n", Environment.NewLine));
#endif
            }
        }