-
Notifications
You must be signed in to change notification settings - Fork 591
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option --naming
for different line name patterns
#184
base: master
Are you sure you want to change the base?
Conversation
This a very valuable enhancement. However, I would drop the predefined choices and rely on pure format strings only. |
@wrznr Do you mean that with the Then, these calls would be possible: ocropus-gpageseg test.bin.png
# by default the pattern "01%04x" is used
ocropus-gpageseg test.bin.png --naming %04d
# pattern with 4 decimal digits |
There may be more places to attribute different length of file names:
|
@amitdo What do you want to point me to with these two links? |
At some point in history, Tom switched from Just digging in ocropus history... |
Usually the lines are named as a hexadecimal 6-digits number where the first two digits are always
01
starting from010001.bin.png
. However, the hexadecimal numbers are sometimes sorting differently and don't fulfill an easy regexp as ´\d+`.This new option for
ocropus-gpageseg
will introduce the possibility to change the naming patterns. By defaultargs.naming="hex"
, we have the same behavior as at the moment. Moreover, there is the option to change to a decimal naming pattern with--naming dec
, which will produce 4-digits (decimal) numbers starting from0001.bin.png
. Any other value will be tried to be interpreted as an individual pattern, e.g.--naming ex%05d
.Note: The
pseg
format will save the page segmentation by labeling the different lines with 6-digits hexadecimal numbers which are then represented as a number. Therefore,ocropus-hocr
needed also a change. Are there more consequences when not using 6-digits hexadecimal numbers for naming the lines?Any other reaction for this idea?