eightban's memo

残しておきたい記事をまとめてみました。このブログに書いてあるドキュメントやブログで配布しているファイルの使用によって発生するいかなる損害に対してもこのブログの管理者は責任を負いません。使用する場合は自己責任のもとに使用してください。

AutoIt

autoit でOCRを使う

更新日:

Tesseract

ここからダウンロードしてインストール
https://tesseract-ocr.github.io/tessdoc/Installation.html

Additional script data 「Japanese script」と「Japanese vertical script」をチェック
Additional language data 「Japanese」と「Japanese (vertical)」をチェック

スクリプト

$ImageToReadPath = @ScriptDir & "\image.bmp"
$ResultTextPath = @ScriptDir & "\Result"
$OutPutPath = $ResultTextPath & ".txt"
$TesseractExePath = "C:\app\tesseract\tesseract.exe"
$TesseractExePara =  "  -c tessedit_char_whitelist=abcdefghijklmnopqrstuvwxyz0123456789  -l eng --psm 7 --oem 1 "

;
ShellExecuteWait($TesseractExePath, '"' & $ImageToReadPath & '" "' & $ResultTextPath & '" "' & $TesseractExePara & '"', "", "", @SW_HIDE)
Sleep(1000)
If @error Then
	Exit MsgBox(0, "Error", @error)
EndIf

MsgBox(0, "Result", FileRead($OutPutPath))

FileDelete($OutPutPath)

https://www.autoitscript.com/forum/topic/174483-tesseract-simple-example/

tesseract option


    0 = Orientation and script detection (OSD) only.
    1 = Automatic page segmentation with OSD.
    2 = Automatic page segmentation, but no OSD, or OCR.
    3 = Fully automatic page segmentation, but no OSD. (Default)
    4 = Assume a single column of text of variable sizes.
    5 = Assume a single uniform block of vertically aligned text.
    6 = Assume a single uniform block of text.
    7 = Treat the image as a single text line.
    8 = Treat the image as a single word.
    9 = Treat the image as a single word in a circle.
    10 = Treat the image as a single character.

説明しているホームページサイト参考に
https://qiita.com/henjiganai/items/7a5e871f652b32b41a18

スクリーンキャプチャーと併用することで活用できそうです

UWPOCR UDF

UWPOCR UDF は、 Universal Windows Platform Optical 文字認識 API を使用するためのシンプルなライブラリです。https://github.com/DanysysTeam/UWPOCR

ソフトをインストールせずに使用できます。サンプルもあります。

-AutoIt

Copyright© eightban's memo , 2024 All Rights Reserved Powered by STINGER.