public double getSkewAngle() {
        double var2 = 0.0D;
        int var4 = 0;
        this.calc();
        HoughLine[] var1 = this.getTop(20);
        if (var1.length < 20) {
            return 0.0D;
        } else {
            for (int var5 = 0; var5 < 19; ++var5) {
                var2 += var1[var5].alpha;
                ++var4;
            }

            return var2 / (double) var4;
        }
    }
Copied and pasted from Tess4j (https://sourceforge.net/projects/tess4j/)
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-ocr-module/src/main/java/org/apache/tika/parser/ocr/tess4j/ImageDeskew.java