Replies: 6 comments 3 replies
-
eynollah/src/eynollah/utils/marginals.py Lines 102 to 105 in a2359ea This seems wrong: when neither Also, why do you allow marginalia on both sides here? Shouldn't you try to limit the range to the "best" (in the sense of most prominent peak) side only? |
Beta Was this translation helpful? Give feedback.
-
eynollah/src/eynollah/utils/marginals.py Line 131 in a2359ea mask_marginals is already deskewed (because it is based off text_with_lines , which was already deskewed before calling get_marginals ), while text_regions is not. Your mask_margins_rotated therefore undeskews the image, so the result is in the same shape as text_regions . (Of course, it is not really, exactly in the same coordinate space, because rotating back does not undo the coordinate offset caused by enlarging the image – to the contrary, it increases the offset even further.)
So my point is: why not use |
Beta Was this translation helpful? Give feedback.
-
eynollah/src/eynollah/utils/marginals.py Lines 38 to 43 in a2359ea min_textline_thickness constants seem to be calibrated for some fixed image resolution, but text_with_lines actually varies in size. Shouldn't this be relative to the image size?
|
Beta Was this translation helpful? Give feedback.
-
eynollah/src/eynollah/utils/marginals.py Line 72 in a2359ea Moreover, IMO locally-minimising the vertical sum of the text mask is much less reliable than locally-maximising it. Take this example: ![]() Here, Eynollah classified both the small text patches on the left of the book spine and the page number and catch word on the right edge of the page as marginalia. (Like I said above, And this is a plot of the internals leading up to that decision: ![]() The upper left shows the (deskewed) text mask, with red lines indicating |
Beta Was this translation helpful? Give feedback.
-
Another problem I see in the code (but I still don't know if it really is one): eynollah/src/eynollah/eynollah.py Lines 4431 to 4433 in a2359ea eynollah/src/eynollah/eynollah.py Line 2939 in a2359ea |
Beta Was this translation helpful? Give feedback.
-
@vahidrezanezhad, can you please take a look at the above points? I have a related PR with some improvements already in the works, but would like to have your opinion before I finalise and submit it. (We can discuss it in video conference if that's preferable to you.) Many thanks in advance! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Seeing problems (like this) in the results of
get_marginals
, I am trying to fully understand the code and the intents behind it. Ideally this will flow into a PR...Beta Was this translation helpful? Give feedback.
All reactions