ahk2_lib RapidOCR with bitmap buffer

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
Dgls
Posts: 12
Joined: 11 Jan 2023, 21:53

ahk2_lib RapidOCR with bitmap buffer

Post by Dgls » 27 Jan 2023, 21:40

So i have been using wincapture->RapidOcr like this:

Code: Select all

	bm_buf:=wgcp.capture(rect)
	bm_buf.save("temp.bmp")
	ocr_str:= ocr.ocr_from_file('temp.bmp', param)
I would like to OCR the BitmapBuffer directly, rather than through a file.
ocr_str:= ocr.ocr_from_bitmapdata(..)
I'm not sure how to convert bm_buf into suitable parameters for ocr_from_bitmapdata() or do I use ocr_from_binary() and if so how do I form the parameters?
Thanks for any hints...

User avatar
Tebayaki
Posts: 7
Joined: 04 Aug 2021, 17:59

Re: ahk2_lib RapidOCR with bitmap buffer

Post by Tebayaki » 28 Jan 2023, 00:59

Code: Select all

ocr.ocr_from_bitmapdata(bm_buf.info)
try this

Dgls
Posts: 12
Joined: 11 Jan 2023, 21:53

Re: ahk2_lib RapidOCR with bitmap buffer

Post by Dgls » 28 Jan 2023, 03:56

Works, thanks!

Post Reply

Return to “Ask for Help (v2)”