Closed kangalio closed 4 years ago
We could add a helper method that uses GetInputImage
API (https://github.com/tesseract-ocr/tesseract/blob/master/include/tesseract/baseapi.h#L139) to get a Pix object, then use it to return the dimension.
I had a go at implementing this. The Tesseract C++ library documentation was very hard to understand for me though, and I don't know if the code I wrote is sound.
Maybe you can be a better judge?
https://github.com/kangalioo/leptess/blob/master/src/tesseract.rs#L90-L100
Oh damn, I misclicked on mobile 😅
@kangalioo that looks good to me, feel free to send a PR.
Would it be possible to add a way to retrieve the dimensions of the image which is currently loaded in a LepTess instance?