Class AsposeOcr
Namespace: Aspose.OCR
Assembly: Aspose.OCR.dll (25.1.0)
Aspose OCRライブラリのメインAPI
public class AsposeOcr
継承
継承されたメンバー
object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
コンストラクター
AsposeOcr()
public AsposeOcr()
メソッド
CalculateSkew(OcrInput)
画像の傾きを計算します。
GIF、PNG、JPEG、BMP、TIFF、JFIF、ストリーム、フォルダー、配列、アーカイブをサポートします。
public List<skewoutput> CalculateSkew(OcrInput images)
パラメーター
images
OcrInput
ソースを含むコンテナ。Aspose.OCR.OcrInput
戻り値
List<SkewOutput>
Aspose.OCR.SkewOutputの度数単位の傾きリスト。
CompareImageTexts(string, string, RecognitionSettings, bool)
2つの画像が同じテキストを含んでいるかどうかを確認します。
public bool CompareImageTexts(string fullPath1, string fullPath2, RecognitionSettings settings = null, bool ignoreCase = true)
パラメーター
fullPath1
string
最初の画像のパス。
fullPath2
string
2番目の画像のパス。
settings
RecognitionSettings
認識設定。
ignoreCase
bool
True - 大文字と小文字を区別しない検索を意味します。
戻り値
画像が同じテキストを持っている場合はTrue(90%の類似性)。
CorrectSpelling(string, SpellCheckLanguage, string)
テキストを修正します(誤字を置き換えます)。
public string CorrectSpelling(string text, SpellCheckLanguage language = SpellCheckLanguage.Eng, string dictionaryPath = null)
パラメーター
text
string
修正するテキスト。
language
SpellCheckLanguage
使用する辞書。
dictionaryPath
string
オプション。ユーザー辞書(頻度辞書)へのフルパス。
辞書ファイル形式:
UTF-8エンコーディングのプレーンテキストファイル。
単語と単語の頻度はスペースまたはタブで区切られています。デフォルトでは、単語は最初の列に、頻度は2番目の列にあると予想されます。
各単語-頻度ペアは別の行にあります。行は、改行("\n")、キャリッジリターン("\r")、またはキャリッジリターンの後に改行が続くもの("\r\n")として定義されます。
すべての単語は小文字であることが期待されます。
戻り値
置き換えられた単語を含むテキスト。
DetectDefects(OcrInput, DefectType)
OCRの精度に大きな影響を与える画像の問題エリアを自動的に見つけます。
PNG、JPEG、BMP、TIFF、JFIF、GIF画像をファイル、ストリーム、またはピクセル配列としてサポートします。バルク認識をサポートします。
public List<defectoutput> DetectDefects(OcrInput images, DefectType defectType)
パラメーター
images
OcrInput
ソース画像Aspose.OCR.OcrInput
defectType
DefectType
認識する欠陥の種類Aspose.OCR.DefectType
戻り値
List<DefectOutput>
検出された画像の欠陥、または欠陥が見つからなかった場合は空のコレクションAspose.OCR.DefectOutput。
DetectRectangles(OcrInput)
画像上のテキストエリアを検出します。
GIF、PNG、JPEG、BMP、TIFF、JFIF、ストリーム、フォルダー、配列、アーカイブをサポートします。
public List<rectangleoutput> DetectRectangles(OcrInput images)
パラメーター
images
OcrInput
ソースを含むコンテナ。Aspose.OCR.OcrInput
戻り値
List<RectangleOutput>
検出されたテキストエリアまたは行を含むAspose.OCR.RectangleOutputのリスト。
DetectRectangles(OcrInput, AreasType, bool)
画像上のテキストエリアを検出します。
GIF、PNG、JPEG、BMP、TIFF、JFIF、ストリーム、フォルダー、配列、アーカイブをサポートします。
public List<rectangleoutput> DetectRectangles(OcrInput images, AreasType areasType, bool detectAreas = true)
パラメーター
images
OcrInput
ソースを含むコンテナ。Aspose.OCR.OcrInput
areasType
AreasType
返す矩形の種類を決定します - 行または段落。
detectAreas
bool
自動テキストエリア検出を有効にします。
戻り値
List<RectangleOutput>
検出されたテキストエリアまたは行を含むAspose.OCR.RectangleOutputのリスト。
ImageHasText(string, string, RecognitionSettings, bool, bool)
画像が指定されたテキスト断片を含んでいるかどうかを確認します。
public bool ImageHasText(string fullPath, string text, RecognitionSettings settings = null, bool ignoreCase = true, bool autoSkew = true)
パラメーター
fullPath
string
画像へのパス。
text
string
画像上で検索するテキスト断片。
settings
RecognitionSettings
認識設定。
ignoreCase
bool
True - 大文字と小文字を区別しない検索を意味します。
autoSkew
bool
自動画像傾き補正を有効にします。
戻り値
画像がテキスト断片を含んでいる場合はTrue。False - 画像はテキスト断片を含んでいません。
備考
指定されたAspose.OCR.RecognitionSettingsで画像を認識します。
GIF、PNG、JPEG、BMP、TIFF、JFIFをサポートします。
ImageHasText(string, Regex, RecognitionSettings, bool)
画像のテキストが指定された正規表現に一致するかどうかを確認します。
public bool ImageHasText(string fullPath, Regex regex, RecognitionSettings settings = null, bool autoSkew = true)
パラメーター
fullPath
string
画像へのパス。
regex
Regex
指定されたパターンとオプションを持つSystem.Text.RegularExpressionsオブジェクト。
settings
RecognitionSettings
認識設定。
autoSkew
bool
自動画像傾き補正を有効にします。
戻り値
画像のテキストが指定された正規表現に一致する場合はTrue。
備考
指定されたAspose.OCR.RecognitionSettingsで画像を認識します。
GIF、PNG、JPEG、BMP、TIFF、JFIFをサポートします。
ImageTextDiff(string, string, RecognitionSettings, bool, bool)
2つの画像のテキストを比較し、どれだけ似ているかを示す数値を返します(0から1)。
public float ImageTextDiff(string fullPath1, string fullPath2, RecognitionSettings settings = null, bool ignoreCase = true, bool autoSkew = true)
パラメーター
fullPath1
string
最初の画像のパス。
fullPath2
string
2番目の画像のパス。
settings
RecognitionSettings
認識設定。
ignoreCase
bool
True - 大文字と小文字を区別しない検索を意味します。
autoSkew
bool
自動画像傾き補正を有効にします。
戻り値
0はテキストが完全に異なることを意味し、1はテキストが同一であることを意味します。
Recognize(OcrInput)
画像/文書上のテキストを認識します。
GIF、PNG、JPEG、BMP、TIFF、JFIF、ストリーム、ディレクトリ、配列、アーカイブをサポートします。
public OcrOutput Recognize(OcrInput images)
パラメーター
images
OcrInput
ソースを含むコンテナ。Aspose.OCR.OcrInput
戻り値
画像認識結果を持つAspose.OCR.RecognitionResultオブジェクトのリスト。
Recognize(OcrInput, RecognitionSettings, CancellationToken)
画像/文書上のテキストを認識します。
GIF、PNG、JPEG、BMP、TIFF、JFIF、ストリーム、ディレクトリ、配列、アーカイブをサポートします。
public OcrOutput Recognize(OcrInput images, RecognitionSettings settings, CancellationToken cancellationToken)
パラメーター
images
OcrInput
ソースを含むコンテナ。Aspose.OCR.OcrInput
settings
RecognitionSettings
認識設定Aspose.OCR.RecognitionSettings。
cancellationToken
CancellationToken
CancellationTokenオブジェクト。
戻り値
画像認識結果を持つAspose.OCR.RecognitionResultオブジェクトのリスト。
Recognize(OcrInput, RecognitionSettings)
画像/文書上のテキストを認識します。
GIF、PNG、JPEG、BMP、TIFF、JFIF、ストリーム、ディレクトリ、配列、アーカイブをサポートします。
public OcrOutput Recognize(OcrInput images, RecognitionSettings settings)
パラメーター
images
OcrInput
ソースを含むコンテナ。Aspose.OCR.OcrInput
settings
RecognitionSettings
認識設定Aspose.OCR.RecognitionSettings。
戻り値
画像認識結果を持つAspose.OCR.RecognitionResultオブジェクトのリスト。
RecognizeCarPlate(OcrInput)
車のナンバープレート上のテキストを認識します。
public OcrOutput RecognizeCarPlate(OcrInput images)
パラメーター
images
OcrInput
ソースを含むコンテナ。Aspose.OCR.OcrInput
戻り値
画像認識結果を持つAspose.OCR.RecognitionResultオブジェクトのリスト。
備考
Aspose.OCR.CarPlateRecognitionSettingsを指定する機能を持って車のナンバープレートを認識します。
GIF、PNG、JPEG、BMP、TIFF、JFIF、ストリーム、ディレクトリ、配列、アーカイブをサポートします。
RecognizeCarPlate(OcrInput, CarPlateRecognitionSettings)
車のナンバープレート上のテキストを認識します。
public OcrOutput RecognizeCarPlate(OcrInput images, CarPlateRecognitionSettings settings)
パラメーター
images
OcrInput
ソースを含むコンテナ。Aspose.OCR.OcrInput
settings
CarPlateRecognitionSettings
認識設定Aspose.OCR.CarPlateRecognitionSettings。
戻り値
画像認識結果を持つAspose.OCR.RecognitionResultオブジェクトのリスト。
備考
Aspose.OCR.CarPlateRecognitionSettingsを指定する機能を持って車のナンバープレートを認識します。
GIF、PNG、JPEG、BMP、TIFF、JFIF、ストリーム、ディレクトリ、配列、アーカイブをサポートします。
RecognizeCharacters(OcrInput)
画像上のシンボルを検出します。
GIF、PNG、JPEG、BMP、TIFF、JFIF、ストリーム、フォルダー、配列、アーカイブをサポートします。
public List<characterrecognitionresult> RecognizeCharacters(OcrInput images)
パラメーター
images
OcrInput
ソースを含むコンテナ。Aspose.OCR.OcrInput
戻り値
List<CharacterRecognitionResult>
検出されたシンボルデータを持つAspose.OCR.CharacterRecognitionResultのリスト。
RecognizeCharacters(OcrInput, DetectAreasMode, Language)
画像上のシンボルを検出します。
GIF、PNG、JPEG、BMP、TIFF、JFIF、ストリーム、フォルダー、配列、アーカイブをサポートします。
public List<characterrecognitionresult> RecognizeCharacters(OcrInput images, DetectAreasMode detectAreasMode = DetectAreasMode.UNIVERSAL, Language language = Language.Latin)
パラメーター
images
OcrInput
ソースを含むコンテナ。Aspose.OCR.OcrInput
detectAreasMode
DetectAreasMode
エリア検出に使用されるニューラルネットワークのタイプを決定します。
language
Language
OCRに使用される言語。
戻り値
List<CharacterRecognitionResult>
検出されたシンボルデータを持つAspose.OCR.Characterのリスト。
RecognizeFast(OcrInput)
画像/文書上のテキストを認識します。
GIF、PNG、JPEG、BMP、TIFF、JFIF、ストリーム、ディレクトリ、配列、アーカイブをサポートします。
public List<string> RecognizeFast(OcrInput images)
パラメーター
images
OcrInput
ソースを含むコンテナ。Aspose.OCR.OcrInput
戻り値
画像認識結果を持つ文字列のリスト。
RecognizeHandwrittenText(OcrInput)
画像上の手書きテキストを認識します。
public OcrOutput RecognizeHandwrittenText(OcrInput images)
パラメーター
images
OcrInput
ソースを含むコンテナ。Aspose.OCR.OcrInput
戻り値
画像認識結果を持つAspose.OCR.RecognitionResultオブジェクトのリスト。
備考
GIF、PNG、JPEG、BMP、TIFF、JFIF、ストリーム、ディレクトリ、配列、アーカイブをサポートします。
RecognizeIDCard(OcrInput)
IDカード上のテキストを認識します。
public OcrOutput RecognizeIDCard(OcrInput images)
パラメーター
images
OcrInput
ソースを含むコンテナ。Aspose.OCR.OcrInput
戻り値
画像認識結果を持つAspose.OCR.RecognitionResultオブジェクトのリスト。
備考
Aspose.OCR.IDCardRecognitionSettingsを指定する機能を持ってIDカードを認識します。
GIF、PNG、JPEG、BMP、TIFF、JFIF、ストリーム、ディレクトリ、配列、アーカイブをサポートします。
RecognizeIDCard(OcrInput, IDCardRecognitionSettings)
IDカード上のテキストを認識します。
public OcrOutput RecognizeIDCard(OcrInput images, IDCardRecognitionSettings settings)
パラメーター
images
OcrInput
ソースを含むコンテナ。Aspose.OCR.OcrInput
settings
IDCardRecognitionSettings
認識設定Aspose.OCR.IDCardRecognitionSettings。
戻り値
画像認識結果を持つAspose.OCR.RecognitionResultオブジェクトのリスト。
備考
Aspose.OCR.IDCardRecognitionSettingsを指定する機能を持ってIDカードを認識します。
GIF、PNG、JPEG、BMP、TIFF、JFIF、ストリーム、ディレクトリ、配列、アーカイブをサポートします。
RecognizeInvoice(OcrInput)
請求書上のテキストを認識します。
public OcrOutput RecognizeInvoice(OcrInput images)
パラメーター
images
OcrInput
ソースを含むコンテナ。Aspose.OCR.OcrInput
戻り値
画像認識結果を持つAspose.OCR.RecognitionResultオブジェクトのリスト。
備考
Aspose.OCR.InvoiceRecognitionSettingsを指定する機能を持って請求書を認識します。
GIF、PNG、JPEG、BMP、TIFF、JFIF、ストリーム、ディレクトリ、配列、アーカイブをサポートします。
RecognizeInvoice(OcrInput, InvoiceRecognitionSettings)
請求書上のテキストを認識します。
public OcrOutput RecognizeInvoice(OcrInput images, InvoiceRecognitionSettings settings)
パラメーター
images
OcrInput
ソースを含むコンテナ。Aspose.OCR.OcrInput
settings
InvoiceRecognitionSettings
認識設定Aspose.OCR.InvoiceRecognitionSettings。
戻り値
画像認識結果を持つAspose.OCR.RecognitionResultオブジェクトのリスト。
備考
Aspose.OCR.InvoiceRecognitionSettingsを指定する機能を持って請求書を認識します。
GIF、PNG、JPEG、BMP、TIFF、JFIF、ストリーム、ディレクトリ、配列、アーカイブをサポートします。
GIF、PNG、JPEG、BMP、TIFF、JFIF、ストリーム、ディレクトリ、配列、アーカイブをサポートします。
RecognizeLines(OcrInput)
単一行のテキストを含む画像を認識します。
GIF、PNG、JPEG、BMP、TIFF、JFIF、ストリーム、フォルダー、配列、アーカイブをサポートします。
public OcrOutput RecognizeLines(OcrInput images)
パラメーター
images
OcrInput
ソースを含むコンテナ。Aspose.OCR.OcrInput
戻り値
画像認識結果を持つAspose.OCR.RecognitionResultオブジェクトのリスト。
RecognizeLines(OcrInput, RecognitionSettings)
単一行のテキストを含む画像を認識します。
GIF、PNG、JPEG、BMP、TIFF、JFIF、ストリーム、フォルダー、配列、アーカイブをサポートします。
public OcrOutput RecognizeLines(OcrInput images, RecognitionSettings settings)
パラメーター
images
OcrInput
ソースを含むコンテナ。Aspose.OCR.OcrInput
settings
RecognitionSettings
認識設定Aspose.OCR.RecognitionSettings。
戻り値
画像認識結果を持つAspose.OCR.RecognitionResultオブジェクトのリスト。
RecognizePassport(OcrInput)
パスポート上のテキストを認識します。
public OcrOutput RecognizePassport(OcrInput images)
パラメーター
images
OcrInput
ソースを含むコンテナ。Aspose.OCR.OcrInput
戻り値
画像認識結果を持つAspose.OCR.RecognitionResultオブジェクトのリスト。
備考
Aspose.OCR.PassportRecognitionSettingsを指定する機能を持ってパスポートを認識します。
GIF、PNG、JPEG、BMP、TIFF、JFIF、ストリーム、ディレクトリ、配列、アーカイブをサポートします。
RecognizePassport(OcrInput, PassportRecognitionSettings)
パスポート上のテキストを認識します。
public OcrOutput RecognizePassport(OcrInput images, PassportRecognitionSettings settings)
パラメーター
images
OcrInput
ソースを含むコンテナ。Aspose.OCR.OcrInput
settings
PassportRecognitionSettings
認識設定Aspose.OCR.PassportRecognitionSettings。
戻り値
画像認識結果を持つAspose.OCR.RecognitionResultオブジェクトのリスト。
備考
Aspose.OCR.PassportRecognitionSettingsを指定する機能を持ってパスポートを認識します。
GIF、PNG、JPEG、BMP、TIFF、JFIF、ストリーム、ディレクトリ、配列、アーカイブをサポートします。
RecognizeReceipt(OcrInput)
領収書上のテキストを認識します。
public OcrOutput RecognizeReceipt(OcrInput images)
パラメーター
images
OcrInput
ソースを含むコンテナ。Aspose.OCR.OcrInput
戻り値
画像認識結果を持つAspose.OCR.RecognitionResultオブジェクトのリスト。
備考
Aspose.OCR.ReceiptRecognitionSettingsを指定する機能を持って領収書を認識します。
GIF、PNG、JPEG、BMP、TIFF、JFIF、ストリーム、ディレクトリ、配列、アーカイブをサポートします。
RecognizeReceipt(OcrInput, ReceiptRecognitionSettings)
領収書上のテキストを認識します。
public OcrOutput RecognizeReceipt(OcrInput images, ReceiptRecognitionSettings settings)
パラメーター
images
OcrInput
ソースを含むコンテナ。Aspose.OCR.OcrInput
settings
ReceiptRecognitionSettings
認識設定Aspose.OCR.ReceiptRecognitionSettings。
戻り値
画像認識結果を持つAspose.OCR.RecognitionResultオブジェクトのリスト。
備考
Aspose.OCR.ReceiptRecognitionSettingsを指定する機能を持って領収書を認識します。
GIF、PNG、JPEG、BMP、TIFF、JFIF、ストリーム、ディレクトリ、配列、アーカイブをサポートします。
SaveMultipageDocument(string, SaveFormat, List<recognitionresult>, string, PdfOptimizationMode)
RecognitionResultオブジェクトのリストからマルチページドキュメントを取得することを可能にします。
public static void SaveMultipageDocument(string fullFileName, SaveFormat saveFormat, List<recognitionresult> results, string embeddedFontPath = null, PdfOptimizationMode optimizePdf = PdfOptimizationMode.MAXIMUM_QUALITY)
パラメーター
fullFileName
string
選択した形式で認識結果を保存するためのパスを持つファイル名。
saveFormat
SaveFormat
ドキュメント形式(Docx、Txt、Pdf、Xlsx、Rtf、Json、Xml)。
results
List<RecognitionResult>
Aspose.OCR.RecognitionResultオブジェクトのリスト。
embeddedFontPath
string
オプション。ユーザーフォントへのフルパス。
optimizePdf
PdfOptimizationMode
背景画像の品質を下げることでPDFファイルサイズを削減します。デフォルトでは、元の画像品質が保持されます。
SaveMultipageDocument(string, SaveFormat, List<recognitionresult>, bool, SpellCheckLanguage, string, string, PdfOptimizationMode)
RecognitionResultオブジェクトのリストからマルチページドキュメントを取得することを可能にします。
public static void SaveMultipageDocument(string fullFileName, SaveFormat saveFormat, List<recognitionresult> results, bool applySpellingCorrection, SpellCheckLanguage language = SpellCheckLanguage.Eng, string dictionaryPath = null, string embeddedFontPath = null, PdfOptimizationMode optimizePdf = PdfOptimizationMode.MAXIMUM_QUALITY)
パラメーター
fullFileName
string
選択した形式で認識結果を保存するためのパスを持つファイル名。
saveFormat
SaveFormat
ドキュメント形式(Docx、Txt、Pdf、Xlsx、Rtf、Json、Xml)。
results
List<RecognitionResult>
Aspose.OCR.RecognitionResultオブジェクトのリスト。
applySpellingCorrection
bool
認識結果に誤字がある場合は修正するためにtrueを設定します。
language
SpellCheckLanguage
スペルチェック用の辞書(オプション)。
dictionaryPath
string
オプション。.txt形式のユーザー辞書へのフルパス。形式は[word - space - frequency(number)]です。
例:the 23135851162\nthat 3400031103\n
embeddedFontPath
string
オプション。ユーザーフォントへのフルパス。
optimizePdf
PdfOptimizationMode
背景画像の品質を下げることでPDFファイルサイズを削減します。デフォルトでは、元の画像品質が保持されます。
SaveMultipageDocument(MemoryStream, SaveFormat, List<recognitionresult>, string, PdfOptimizationMode)
RecognitionResultオブジェクトのリストからマルチページドキュメントを取得することを可能にします。
public static void SaveMultipageDocument(MemoryStream stream, SaveFormat saveFormat, List<recognitionresult> results, string embeddedFontPath = null, PdfOptimizationMode optimizePdf = PdfOptimizationMode.MAXIMUM_QUALITY)
パラメーター
stream
MemoryStream
選択した形式で認識結果を保存するためのMemoryStream。
saveFormat
SaveFormat
ドキュメント形式(Docx、Txt、Pdf、Xlsx、Rtf、Json、Xml)。
results
List<RecognitionResult>
Aspose.OCR.RecognitionResultオブジェクトのリスト。
embeddedFontPath
string
オプション。ユーザーフォントへのフルパス。
optimizePdf
PdfOptimizationMode
背景画像の品質を下げることでPDFファイルサイズを削減します。デフォルトでは、元の画像品質が保持されます。
SaveMultipageDocument(MemoryStream, SaveFormat, List<recognitionresult>, bool, SpellCheckLanguage, string, string, PdfOptimizationMode)
RecognitionResultオブジェクトのリストからマルチページドキュメントを取得することを可能にします。
public static void SaveMultipageDocument(MemoryStream stream, SaveFormat saveFormat, List<recognitionresult> results, bool applySpellingCorrection, SpellCheckLanguage language = SpellCheckLanguage.Eng, string dictionaryPath = null, string embeddedFontPath = null, PdfOptimizationMode optimizePdf = PdfOptimizationMode.MAXIMUM_QUALITY)
パラメーター
stream
MemoryStream
選択した形式で認識結果を保存するためのMemoryStream。
saveFormat
SaveFormat
ドキュメント形式(Docx、Txt、Pdf、Xlsx、Rtf、Json、Xml)。
results
List<RecognitionResult>
Aspose.OCR.RecognitionResultオブジェクトのリスト。
applySpellingCorrection
bool
認識結果に誤字がある場合は修正するためにtrueを設定します。
language
SpellCheckLanguage
スペルチェック用の辞書(オプション)。
dictionaryPath
string
オプション。.txt形式のユーザー辞書へのフルパス。形式は[word - space - frequency(number)]です。
例:the 23135851162\nthat 3400031103\n
embeddedFontPath
string
オプション。ユーザーフォントへのフルパス。
optimizePdf
PdfOptimizationMode
背景画像の品質を下げることでPDFファイルサイズを削減します。デフォルトでは、元の画像品質が保持されます。
OcrProgress
マルチページ画像認識の進行状況を追跡するためのイベント。
public event OcrRecognizeEventHandler OcrProgress