mittagessen / kraken

OCR engine for all the languages
http://kraken.re
Apache License 2.0
673 stars 125 forks source link

Line detection does not work with version 5.0.0 #607

Closed szekrenyesi closed 1 month ago

szekrenyesi commented 1 month ago

Hi, I have a problem with the latest version installed with "pip install kraken". In the output of blla.segment, there are only regions, the array of lines is empty:

Segmentation(type='baselines', imagename='sample1.jpg', text_direction='horizontal-lr', script_detection=False, lines=[], regions={'text': [Region(id='161eaa2c-58dc-4c8b-a46f-d5c9b55dc1fd', boundary=[[479, 3200], [872, 3215], [887, 3258], [689, 3303], [460, 3288], [445, 3230], [479, 3200]], imagename=None, tags={'type': 'text'}), Region(id='2ccce087-d268-407d-84d7-d3bd862a16b4', boundary=[[226, 349], [2245, 363], [2349, 371], [2364, 414], [2017, 436], [1970, 473], [1814, 480], [222, 466], [226, 349]], imagename=None, tags={'type': 'text'}), Region(id='41595480-a8ee-42be-b833-81bb3ac95766', boundary=[[1554, 683], [1651, 690], [1690, 742], [1749, 757], [2089, 779], [2096, 859], [1987, 896], [1948, 1000], [2200, 1010], [2267, 1099], [2267, 1208], [2304, 1255], [2297, 1379], [2349, 1567], [2342, 1654], [2290, 1700], [2304, 1832], [2282, 1943], [2364, 2072], [2364, 2255], [2319, 2302], [2319, 2344], [2349, 2376], [2371, 2545], [2304, 2599], [2290, 2651], [2327, 2740], [2304, 2894], [2408, 2940], [2408, 3043], [1276, 3087], [1199, 3124], [304, 3117], [260, 1893], [230, 1721], [230, 1173], [354, 1151], [371, 1114], [362, 1075], [252, 1067], [222, 1015], [222, 861], [297, 831], [570, 831], [609, 807], [638, 727], [705, 712], [1554, 683]], imagename=None, tags={'type': 'text'}), Region(id='d15098ed-8a88-4db2-aa09-57e203141eb2', boundary=[[1099, 0], [2319, 7], [2327, 57], [1134, 64], [1090, 50], [1099, 0]], imagename=None, tags={'type': 'text'})]}, line_orders=[])
[Region(id='161eaa2c-58dc-4c8b-a46f-d5c9b55dc1fd', boundary=[[479, 3200], [872, 3215], [887, 3258], [689, 3303], [460, 3288], [445, 3230], [479, 3200]], imagename=None, tags={'type': 'text'}), Region(id='2ccce087-d268-407d-84d7-d3bd862a16b4', boundary=[[226, 349], [2245, 363], [2349, 371], [2364, 414], [2017, 436], [1970, 473], [1814, 480], [222, 466], [226, 349]], imagename=None, tags={'type': 'text'}), Region(id='41595480-a8ee-42be-b833-81bb3ac95766', boundary=[[1554, 683], [1651, 690], [1690, 742], [1749, 757], [2089, 779], [2096, 859], [1987, 896], [1948, 1000], [2200, 1010], [2267, 1099], [2267, 1208], [2304, 1255], [2297, 1379], [2349, 1567], [2342, 1654], [2290, 1700], [2304, 1832], [2282, 1943], [2364, 2072], [2364, 2255], [2319, 2302], [2319, 2344], [2349, 2376], [2371, 2545], [2304, 2599], [2290, 2651], [2327, 2740], [2304, 2894], [2408, 2940], [2408, 3043], [1276, 3087], [1199, 3124], [304, 3117], [260, 1893], [230, 1721], [230, 1173], [354, 1151], [371, 1114], [362, 1075], [252, 1067], [222, 1015], [222, 861], [297, 831], [570, 831], [609, 807], [638, 727], [705, 712], [1554, 683]], imagename=None, tags={'type': 'text'}), Region(id='d15098ed-8a88-4db2-aa09-57e203141eb2', boundary=[[1099, 0], [2319, 7], [2327, 57], [1134, 64], [1090, 50], [1099, 0]], imagename=None, tags={'type': 'text'})]

I got this error messages during line detection:

Polygonizer failed on line 0: make_polygonal_mask() missing 1 required positional argument: 'shape'

What could be the problem?

mittagessen commented 1 month ago

Please upgrade to the latest release. I don't know how you managed to install 5.0 (this bug was the reason why I yanked the release) but it's been fixed in any installable release.