Claims (8)
1. Способ улучшения текста при цифровом копировании печатных документов, предусматривающий выполнение следующих операций:1. A way to improve the text in digital copying of printed documents, providing for the following operations:
- сканируют печатный документ, получая сканированное изображение;- scan a printed document, receiving a scanned image;
- выявляют на сканированном изображении связные области символов;- connected areas of characters are detected on the scanned image;
- определяют характерные цвета для групп связных областей символов;- determine the characteristic colors for groups of connected areas of characters;
- аппроксимируют контуры связных областей символов с помощью последовательностей отрезков линий и сегментов кривых;- approximate the contours of the connected areas of the characters using sequences of line segments and curve segments;
- выполняют на сканированном изображении растеризацию аппроксимированных контуров с заполнением их внутренней области соответствующими характерными цветами;- perform rasterization of the approximated contours on the scanned image with filling their inner area with the corresponding characteristic colors;
- печатают модифицированное изображение.- print a modified image.
2. Способ по п.1, отличающийся тем, что по результатам выявления на сканированном изображении связных областей символов создают маркерное бинарное изображение, определяющее связные области символов на сканированном изображении.2. The method according to claim 1, characterized in that according to the results of the identification of the connected areas of the characters on the scanned image, a marker binary image is created that defines the connected areas of the characters on the scanned image.
3. Способ по п.1, отличающийся тем, что определяют характерные цвета для связных областей символов посредством выполнения следующих операций:3. The method according to claim 1, characterized in that the characteristic colors for the connected areas of the characters are determined by performing the following operations:
- размечают связные области на маркерном бинарном изображении;- mark the connected areas on the marker binary image;
- определяют на сканированном изображении цвет областей символов, соответствующих размеченным связным областям на маркерном бинарном изображении;- determine on the scanned image the color of the symbol areas corresponding to the marked connected areas on the marker binary image;
- группируют близкорасположенные связные области символов,отличающиеся цветом на величину, не более предопределенного значения;- group closely spaced connected areas of characters that differ in color by an amount of no more than a predetermined value;
- определяют среднее значение цвета для каждой из указанных групп связных областей символов;- determine the average color value for each of these groups of connected areas of characters;
- объединяют группы посредством кластеризации средних значений цвета указанных групп;- group together by clustering the average color values of these groups;
- выбирают центры полученных кластеров в качестве характерных цветов для групп связных областей символов, соответствующих этим кластерам.- choose the centers of the resulting clusters as characteristic colors for groups of connected symbol regions corresponding to these clusters.
4. Способ по п.1, отличающийся тем, что аппроксимируют контуры связных областей символов с помощью последовательностей отрезков линий и сегментов кривых посредством выполнения следующих операций:4. The method according to claim 1, characterized in that they approximate the contours of the connected regions of the characters using sequences of line segments and curve segments by performing the following operations:
- отслеживают точки внешнего и внутренних контуров каждой связной области на маркерном бинарном изображении;- track the points of the external and internal contours of each connected area on the marker binary image;
- упрощают контуры связных областей за счет выделения точек перегиба каждого контура;- simplify the contours of the connected areas by highlighting the inflection points of each contour;
- аппроксимируют упрощенные контуры связных областей символов с помощью последовательностей отрезков линий и сегментов кривых.- approximate the simplified contours of the connected areas of the characters using sequences of line segments and curve segments.
5. Способ по любому из пп.1 и 3, отличающийся тем, что группируют близкорасположенные связные области символов, отличающиеся цветом на величину, не более предопределенного значения, посредством выполнения следующих операций:5. The method according to any one of claims 1 and 3, characterized in that they group closely connected connected areas of the characters that differ in color by an amount of not more than a predetermined value, by performing the following operations:
- вычисляют евклидово расстояние в цветовом пространстве RGB между средними значениями компонентов цвета сравниваемых связных близкорасположенных областей символов;- calculate the Euclidean distance in the RGB color space between the average values of the color components of the compared connected closely spaced areas of the characters;
- группируют указанные области символов, если евклидово расстояние между средними значениями цвета этих областей не превышает предопределенного значения.- group the indicated symbol regions if the Euclidean distance between the average color values of these regions does not exceed a predetermined value.
6. Способ по любому из пп.1 и 3, отличающийся тем, что объединяют группы посредством кластеризации средних значений цвета указанных групп за счет выполнения следующих операций:6. The method according to any one of claims 1 and 3, characterized in that the groups are combined by clustering the average color values of these groups by performing the following operations:
- выбирают группу близкорасположенных связных областей символов, обладающую наибольшим количеством пикселей сканированного изображения, содержащихся в указанных областях;- choose a group of closely connected connected areas of the characters with the largest number of pixels of the scanned image contained in these areas;
- принимают средний цвет выбранной группы за центр кластера;- take the average color of the selected group as the center of the cluster;
- включают в текущий кластер еще одну группу близкорасположенных связных областей символов, для которой евклидово расстояние между ее средним цветом и центром кластера не превышает предопределенного значения;- include in the current cluster another group of closely connected connected regions of symbols for which the Euclidean distance between its middle color and the center of the cluster does not exceed a predetermined value;
- корректируют центр кластера посредством вычисления нового среднего значения цвета групп, составляющих кластер;- adjust the center of the cluster by calculating a new average color value of the groups that make up the cluster;
- повторяют указанные операции до тех пор, пока все группы близкорасположенных связных областей символов не будут включены в соответствующие кластеры.- repeat the indicated operations until all groups of closely connected connected regions of symbols are included in the corresponding clusters.
7. Способ по пп.1 и 4, отличающийся тем, что аппроксимируют упрощенные контуры связных областей символов с помощью последовательностей отрезков линий и сегментов кривых посредством определения координат начала и конца для отрезков линий и координат двух контрольных точек и точек начала и конца сегментов кривых, описанных кубическими кривыми Безье.7. The method according to claims 1 and 4, characterized in that the simplified contours of the connected regions of the symbols are approximated using sequences of line segments and curve segments by determining the coordinates of the beginning and end for line segments and the coordinates of two control points and the start and end points of the curve segments, described by cubic Bezier curves.
8. Система улучшения текста, реализующая способ по п.1, включающая в себя:8. The text improvement system that implements the method according to claim 1, including:
- сканирующий модуль, выполненный с возможностью сканирования исходного печатного документа и подачи на выходы сканированного изображения, причем один выход сканирующего модуля соединен с входом модуля сегментации, а второй выход сканирующего модуля соединен с входами модуля определения характерных цветов и модулярастрирования;- a scanning module, configured to scan the original printed document and feed the output of the scanned image, moreover, one output of the scanning module is connected to the input of the segmentation module, and the second output of the scanning module is connected to the inputs of the module for determining characteristic colors and rasterization module;
- модуль сегментации текста, выполненный с возможностью создания маркерного бинарного изображения, определяющего текстовые и нетекстовые области на сканированном изображении поступающего на три выхода модуля сегментации текста, причем один выход модуля сегментации текста соединен со вторым входом модуля определения характерных цветов, второй выход модуля сегментации текста соединен с входом модуля векторизации, а третий выход модуля сегментации текста соединен с одним из четырех входов модуля растрирования;- a text segmentation module, configured to create a marker binary image that defines text and non-text areas on a scanned image received at three outputs of a text segmentation module, with one output of the text segmentation module connected to the second input of the characteristic color determination module, the second output of the text segmentation module with the input of the vectorization module, and the third output of the text segmentation module is connected to one of the four inputs of the rasterization module;
- модуль определения характерных цветов, выполненный с возможностью выявления групп связных областей символов, отличающихся цветом на величину, не более предопределенного значения, и с возможностью определения характерных цветов для указанных групп; выход модуля определения характерных цветов соединен с одним из четырех входов модуля растрирования;- a module for determining characteristic colors, configured to identify groups of connected areas of characters differing in color by an amount no more than a predetermined value, and with the ability to determine characteristic colors for these groups; the output of the characteristic color determination module is connected to one of four inputs of the rasterization module;
- модуль векторизации, выполненный с возможностью аппроксимации контуров связных областей символов на маркерном бинарном изображении с помощью последовательностей отрезков линий и сегментов кривых; выход модуля векторизации соединен с одним из четырех входов модуля растрирования;- a vectorization module, made with the possibility of approximating the contours of the connected areas of the characters on the marker binary image using sequences of line segments and curve segments; the output of the vectorization module is connected to one of the four inputs of the rasterization module;
- модуль растрирования, выполненный с возможностью растеризации на сканированном изображении аппроксимированных контуров с заполнением их внутренних областей соответствующими характерными цветами; выход модуля растрирования соединен с входом модуля печати;- rasterization module, configured to rasterize the approximated contours on the scanned image with filling their inner areas with the corresponding characteristic colors; the output of the screening module is connected to the input of the print module;
- модуль печати, выполненный с возможностью печати модифицированного изображения.
- print module, configured to print a modified image.