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

Method findSkew returns incorrectr angle #622

Open
atgorvi opened this issue May 25, 2022 · 1 comment
Open

Method findSkew returns incorrectr angle #622

atgorvi opened this issue May 25, 2022 · 1 comment

Comments

@atgorvi
Copy link

atgorvi commented May 25, 2022

Before doing OCR i need to detect angle of text, and possibly rotate image but using findSkew function i get incorrect angle, what do I do wrong?

val skewImage: Pix = Binarize.otsuAdaptiveThreshold(Convert.convertTo8(ReadFile.readBitmap(bitmap)))
val skew: Float = Skew.findSkew(skewImage)
Log.i("skew", skew.toString()

findSkew_Issue
Screenshot_20220525-083146_DocScanner
)

@atgorvi atgorvi changed the title Method findSkew gives incorrectr angle Method findSkew returns incorrectr angle May 25, 2022
@DanBloomberg
Copy link
Owner

The method works on binary images, typically text or graphics.
pixFindSkew, by default, only finds skew angles between -7 and +7 degrees.
It may have failed in your case either because the image wasn't binarized properly to extract the inverted text (white text on dark background), or because the skew angle is larger than 7 degrees (it is), or both.

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

No branches or pull requests

2 participants