Search code examples
javaandroidimage-processingskewleptonica

Leptonica findSkew returns 0.0


I am facing same problem with Leptonica library on Android as How to get skew angle from image I tried both of these methods - with one parameter and with six parameters, where I tried multiple combinations.

Float s = Skew.findSkew(ReadFile.readBitmap(image));
Toast.makeText(this, s.toString(), Toast.LENGTH_SHORT).show();

Result 0.0

Float s = Skew.findSkew(ReadFile.readBitmap(image),40.0f,1.0f,4,1,0.04f);
Toast.makeText(this, s.toString(), Toast.LENGTH_SHORT).show();

Result 0.0 too

Does anybody know how to set these parameters without getting 0.0 or is there other simple library that could same function?


Solution

  • For those who have same problem, try to use binarized image from Leptonica. I used binarization from Catalano framework and it didn't work, but when I applied binarization from Leptonica on the image and use findSkew, it works!