Jump to content

no ocr script works i get this error


Recommended Posts

Posted Image

not to sure wat im doing wrong, first step to ocr would be fixing this error lol..

$oMyError = ObjEvent("AutoIt.Error","MyErrFunc")


Dim $img
Dim $ret


$oMagic = ObjCreate("ImageMagickObject.MagickImage.1") 
   
$ret = $oMagic.Convert("C:\Documents and Settings\Silvio\My Documents\traffic swarm autobot\OCR\5.jpeg", _
    "-black-threshold", "100%", "C:\Documents and Settings\Silvio\My Documents\traffic swarm autobot\OCR\5.jpeg")

$oOCR = ObjCreate("TxtrCtl.TxtrCtl.1")
If Not IsObj($oOCR) Then MsgBox(0, "", "TxtrCtl.TxtrCtl.1 is not an onject")
   
$img = "C:\Documents and Settings\Silvio\My Documents\traffic swarm autobot\OCR\5.jpeg"
$oOCR.Init
$oUtput = $oOCR.ReadFile($img)
$Text =  $oOCR.Text
MsgBox(0, "", $Text)
$oOCR.Term


Func MyErrFunc()
  $HexNumber=hex($oMyError.number,8)
  Msgbox(0,"COM Error Test","We intercepted a COM Error !"   & @CRLF  & @CRLF & _
             "err.description is: " & @TAB & $oMyError.description   & @CRLF & _
             "err.windescription:"   & @TAB & $oMyError.windescription & @CRLF & _
             "err.number is: "   & @TAB & $HexNumber        & @CRLF & _
             "err.lastdllerror is: "   & @TAB & $oMyError.lastdllerror   & @CRLF & _
             "err.scriptline is: "   & @TAB & $oMyError.scriptline   & @CRLF & _
             "err.source is: "   & @TAB & $oMyError.source       & @CRLF & _
             "err.helpfile is: "       & @TAB & $oMyError.helpfile   & @CRLF & _
             "err.helpcontext is: " & @TAB & $oMyError.helpcontext _
            )
  SetError(1); to check for after this function returns
Endfunc

Exit
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...