nguyenq / lept4j

Java JNA Wrapper for Leptonica Image Processing Library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error when removing lines from image

Degubi opened this issue · comments

I get no image output/any errors in console when using this code with my own image.
Works fine with dave-orig.png from the test code or scanned-table.jpg from #12

Code:

 var file = Leptonica1.pixRead("bordered.png");
 var pixs1 = LeptUtils.removeLines(file);
 var pixs2 = Leptonica1.pixRotate90(pixs1, 1);
 var pixs3 = LeptUtils.removeLines(pixs2);
 var pixs4 = Leptonica1.pixRotate90(pixs3, -1);

 Leptonica1.pixWrite("result.png", pixs4, ILeptonica.IFF_PNG);

Image:
bordered

The Line Removal algorithm only works with gray-scale images.

That explains everything @nguyenq , thank you!

Converted image to greyscale, works as intented. :) Thank you @nguyenq