Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/11/2022 in all areas

  1. Hello guys. I recently saw some posts that Windows 10 provides OCR API. So I decided to create a UDF. What's UWPOCR? UWPOCR UDF is a simple library to use Universal Windows Platform Optical character recognition API. Features. Get Text From Image File. Get Text From GDI+ Bitmap. Easy to use. Usage: #include "..\UWPOCR.au3" _Example() Func _Example() Local $sOCRTextResult = _UWPOCR_GetText(FileOpenDialog("Select Image", @ScriptDir & "\", "Images (*.jpg;*.bmp;*.png;*.tif;*.gif)")) MsgBox(0,"",$sOCRTextResult) EndFunc Get Words Rect(Example): More examples here. Check UWPOCR UDF on GitHub. Saludos
    6 points
  2. I've found that anytime you need to use virtually any kind of pointer in a tag just using "ptr" works.
    1 point
  3. Jos

    Cleaning up code..

    Something like this? While 1     $msg = GUIGetMsg()     Switch $msg         Case $GUI_EVENT_CLOSE             MsgBox($MB_SYSTEMMODAL, "", "Dialog was closed")             ExitLoop         Case $Button1, $Button2, $Button3, $Button4             WinActivate("CMD")             $message = "SEND FUNCTION: " & GUICtrlRead($msg)             TCPSend($connectedSocket, $message)     EndSwitch WEnd
    1 point
  4. For the fun #Include <Array.au3> $txt = "Objects (id: bounding-box centroid area mean-color):" & @crlf & _ " 0: 280x80+0+0 140.8,39.4 20069 gray(0)" & @crlf & _ " 4: 25x27+136+26 148.4,38.9 342 gray(255)" & @crlf & _ " 5: 25x26+34+27 48.9,39.9 307 gray(255)" & @crlf & _ " " & @crlf & _ " 6: 26x25+65+27 77.5,39.3 292 gray(255)" & @crlf & _ " 11: 33x18+211+34 227.7,41.3 289 gray(255)" & @crlf & _ " 9: 23x26+111+34 122.1,44.3 254 gray(255)" & @crlf & _ "" & @crlf & _ " 7: 16x19+70+30 77.8,39.0 219 gray(0)" & @crlf & _ " 2: 25x27+163+25 172.0,36.5 199 gray(255)" & @crlf & _ " 10: 20x18+187+34 197.2,41.6 179 gray(255)" & @crlf & _ " 3: 15x26+95+26 101.2,37.1 153 gray(255)" & @crlf & _ " 13: 11x11+116+37 121.1,42.2 97 gray(0)" $txt = StringRegExpReplace($txt, '(^.+\R)|(?m)^(\s*\R)|(.*gray\(0\)\R?)', "") $stmp = Execute("'" & StringRegExpReplace($txt, "(?m)(^.*?)(?<=\h)(\d+)(?=\.)", "' & StringFormat('%04i', '$2') & ' $1$2' & '") & "'") $atmp = StringRegExp($stmp, '\N+', 3) _ArraySort($atmp, 1) $res = StringRegExpReplace(_ArrayToString($atmp, @crlf), '(?m)^\d{4}\h*', "") Msgbox(0,"", $res)
    1 point
×
×
  • Create New...