заменить глифы по эталону #5
Replies: 13 comments 18 replies
-
Пока мне очень сильно не до проектов связанных с djvu. Я даже собраться и опубликовать djvu модуль к stu никак не могу, хотя бы в альфа версии. И ближайший год мне будет не до решения серьезных задач в этих проектах. И можно было бы на пальцах посмотреть, а не слишком ли коряво выглядят отредактированные таким образом страницы... потому что такое подозрение у меня есть. Потому что плохобинаризованных вариантов написания одной буквы А на 20 страниц может быть в словаре 10 штук, и замена их всех на 1 эталонный может в конечном итоге бросаться в глаза. Потому что, к примеру, геометрия страницы поползла (или даже дефект оригинальной печати) и все буквы у края страницы на 2 пикселя больше букв у корешка. Начнет плавать положение букв в строке и замены будет бросаться в глаза. В качестве GUI можно было бы использовать польский djview4shapes. Это форк djview4, который использовался для изучения шрифтов средневековых книг. Он умеет выводить глифы словаря для текущей страницы, подсвечивать их и пр. Но кодовая база там устарела даже по ср с актуальным djview, форк старый. Я им с этим чуть-чуть помогал. В общем, сначала нужно будет актуализировать его состояние. Но не в этом году. Доживем до следующего - там посмотрим. P.S. И если кто и будет этим пользоваться, то полтора человека раз в год... В общем, без энтузиазма и очень скептически я на это смотрю. |
Beta Was this translation helpful? Give feedback.
-
I understand Russian a little, but I'm afraid I don't understand fully your discussion. |
Beta Was this translation helpful? Give feedback.
-
Когда замена одной буквы - то бросается в глаза. Когда замена многих - то страницы начинают выглядеть намногосимпатичнее. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Не пробовал ClearScan, нужно будет ознакомиться.. |
Beta Was this translation helpful? Give feedback.
-
@AlexeyAlexeew What exactly ClearScan ( "Editable text and images") is doing? Can you demonstrate it on one of the images at https://github.com/jsbien/early_fonts_inventory/tree/main/font_tables/PNG? |
Beta Was this translation helpful? Give feedback.
-
OK, I will download the trial version some time in the future. |
Beta Was this translation helpful? Give feedback.
-
You forked the wrong branch. The easiest way is dropping the fork and fork branch master-exportshapes as you can only fork one branch. But if you intend to learn learning git is very helpful. I used chatbots to bring me to the idea to replace libboost with a guard. Programming C++ is mostly 30 years ago for me.
|
Beta Was this translation helpful? Give feedback.
-
https://chat.openai.com/ is now advertised not to require a login. If that's what kept you from using it that might not be a problem anymore.
|
Beta Was this translation helpful? Give feedback.
-
I did not decide on the repo yet. Those big dependencies of djvulibre, even as fork as the internal details are not published to the regular apt-library, make me consider using this repo. If the resulting coordinates are equal the error in the resulting .bmp of thiscrepo might be negligable.
|
Beta Was this translation helpful? Give feedback.
-
Reading the code of exportshapes I get the idea a multipage-djvu can also have different main dictionaries with the same glyph-number ranges, am I right? Then there should also be a main dictionary index number, and, as main dictionaries can differ in size, an indicator pointing to some main dictionary or the individual dictionary per glyph index.
So then the desired output-line per glyph becomes
1. Page number
2. Dictionary id
3. Glyph id
4. x
5. y
6. w
7. h
Am I right?
Verzonden vanaf Outlook voor Android<https://aka.ms/AAb9ysg>
…________________________________
Van: Janusz S. Bie ***@***.***>
Verstuurd: zaterdag, april 6, 2024 10:52:14 a.m.
Aan: trufanov-nok/djvudict ***@***.***>
CC: rmast ***@***.***>; Comment ***@***.***>
Onderwerp: Re: [trufanov-nok/djvudict] заменить глифы по эталону (Discussion #5)
My main problem with djvudict was the identification of the page number. Can you provide it?
―
Reply to this email directly, view it on GitHub<#5 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAZPZ5RR2BWFECEETGZCJE3Y36ZTVAVCNFSM6AAAAABEMQMOIOVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TAMRYGQZDM>.
You are receiving this because you commented.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
>If the resulting coordinates are equal the >>error in the resulting .bmp of thiscrepo >>might be negligable.
I'm afraid I don't follow you :-(
djvudict reconstructs the image in which the glyphs of one row jump up and down. Some wrong y calculation.
|
Beta Was this translation helpful? Give feedback.
-
Google-Translated:
Glyphs within a DjVu-dictionary often have doubles, probably due to the same subpixel-shift that makes characters jump up and down in the restored image. The same principle of jumping up and down will also be there from left to right, that will also contain extra info on those characters. So if a book has been scanned then many shared dictionaries might have multiple copies of characters, with positions on originals, that have a lot of extra information on the original font. Taking the weight-point of all those - probably with OCR - further matchable characters might enable the possibility to blow them up by for example 8 or 16 times, undo the subpixel shift with their weight points, for as far as their weight-point is credible within context of their original positions with respect to the rest of the line they were on. I could imagine trying to restore those characters, even with something like DualVector, might be an automizable approach. |
Beta Was this translation helpful? Give feedback.
-
Скажите, не смогли бы вы допилить ваш djvudict на такую фичу:
сравнивать получающийся shape с "эталонным" из отдельной папки и заменять его. Я бы заранее нашел и сделал bmp-шки основных алфавитов и кеглей книги, и программа определяла новый шейп - с устанавливаемым уровнем/коэффициентом совпадения - и заменяла старый на новый. И в словаре и в чанке sjbz. Для начала можно попробовать даже refinement-шейпы не трогать. Которые как отклонения записаны.
Вариативности и произвольности не предполагаю, выискивать "инь-эффект" чтоб ошибочные "н" заменить на "и" не нужно. Хочу получить "улучшалку" плохобинаризованных книг, когда книга в целом читаема, но после бинаризации буквы не очень красивые. Хотя возможен вариант что если буква разорвана на куски, то и шейп у нее будет не один, а несколько. Тогда я приплыл.
Beta Was this translation helpful? Give feedback.
All reactions