Closed yosefahab closed 1 year ago
Hi,
which are raw [u8] slices
The bytes need an encoding in order to represent an image. I believe tesseract usually prefers the buffers to be tiff formatted (eg this example).
set_frame
takes additional metadata about the image which is why you can pass in a raw buffer.
Would it be possible to dump the [u8] slice
to a file and provide the parameters you were using with set_frame
such that we can make it into a test case?
I've experimented a bit more into that, and found that ffmpeg_the_third might have some issues with extracting frames as images, the resulting bytes aren't exactly correct, and converting them to image formats isn't exactly straightfoward (or necessarily correct).
I tried a different ffmpeg crate which has a built in Frame
struct that works with the example you provided.
That being said, if you still want to implement set_frame()
to be able to set image from an rgb buffer, let me know and i'll provide you with data you need.
Thank you.
Great. It's good you've got it working.
I'll close this issue for now, but if there's additional demand for the feature I might ask for your help with example data.
I'm currently working with the ffmpeg_the_third crate to extract some video frames, which are raw [u8] slices, attempting to use this with
set_image_from_mem()
and then applying ocr causes a panic:i was also experementing with another (less flexible) tesseract crate and found set_frame() function which seems to work fine, i'm not sure why.
Would it be possible to implement it?