Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Process from imagedata #188

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Process from imagedata #188

wants to merge 6 commits into from

Conversation

D4koon
Copy link

@D4koon D4koon commented Jul 1, 2015

For my project it was easier to process the pixeldata directly so i added the missing functions in the wrapper maybe someone else needs that.

@D4koon
Copy link
Author

D4koon commented Jul 16, 2015

Ive added the possibility to pass a byte-pointer directly the downside is that is has to be decleard as unsafe.

@charlesw
Copy link
Owner

Looks good, I don't have an issue with the unsafe code (we already have some unsafe code in PixData). However in this case using an IntPtr might be a better fit.

byte* to IntPtr
byte* to IntPtr
@charlesw
Copy link
Owner

What's the actual use case here and is there any reason why you cannot use a Pix directly? I've had a bit of a look here and I'm not sure this is such a good idea as all tesseract does in this case is convert the byte data into a Pix object (see ImageThresholder::SetImage in the tesseract source code).

@D4koon
Copy link
Author

D4koon commented Jul 25, 2015

Maybe a few things you could consider:

  • Someone dont need the image as a pix -> acomplish the same thing with less code is always a good thing even when it is used internaly anyway.
  • Its an "offical" Api call why not integrate it in a Wrapper
  • It should be a tiny bit more efficient because thers no need to interop with leptonica (to create the Pix). there might be more performance benefits. I did not look into it that much.

@charlesw
Copy link
Owner

OK, I agree.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants