CN113421257B - Method and device for correcting rotation of text lines of dot matrix fonts - Google Patents

Method and device for correcting rotation of text lines of dot matrix fonts Download PDF

Info

Publication number
CN113421257B
CN113421257B CN202110829961.3A CN202110829961A CN113421257B CN 113421257 B CN113421257 B CN 113421257B CN 202110829961 A CN202110829961 A CN 202110829961A CN 113421257 B CN113421257 B CN 113421257B
Authority
CN
China
Prior art keywords
angle
characteristic point
text line
dot
font
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110829961.3A
Other languages
Chinese (zh)
Other versions
CN113421257A (en
Inventor
王博帝
姚毅
杨艺
全煜鸣
金刚
彭斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Lingyun Shixun Technology Co ltd
Luster LightTech Co Ltd
Original Assignee
Shenzhen Lingyun Shixun Technology Co ltd
Luster LightTech Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Lingyun Shixun Technology Co ltd, Luster LightTech Co Ltd filed Critical Shenzhen Lingyun Shixun Technology Co ltd
Priority to CN202110829961.3A priority Critical patent/CN113421257B/en
Publication of CN113421257A publication Critical patent/CN113421257A/en
Application granted granted Critical
Publication of CN113421257B publication Critical patent/CN113421257B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/40Image enhancement or restoration using histogram techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/80Geometric correction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30176Document

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Character Input (AREA)
  • Controls And Circuits For Display Device (AREA)

Abstract

The application provides a method and a device for correcting rotation of a text line of a dot matrix font. The method comprises the following steps: acquiring a text line image of a dot matrix font to be corrected; performing binarization processing on the text line image of the dot matrix font to be corrected to obtain a binarized image; acquiring characteristic point data of the text line of the dot matrix font according to the binarized image; performing rotation angle search according to the characteristic point data to obtain a rotation correction angle; and carrying out rotation correction on the text line image of the dot font to be corrected according to the rotation correction angle to obtain a corrected image. According to the rotation correction method provided by the application, binarization processing is firstly carried out on the text line image of the lattice font, then characteristic point data are extracted, a rotation correction angle is obtained by searching, and finally the text line image of the lattice font is rotated according to the rotation correction angle, so that the rotation correction of the text line of the lattice font can be realized.

Description

Method and device for correcting rotation of text lines of dot matrix fonts
Technical Field
The application relates to the technical field of image recognition, in particular to a method and a device for correcting rotation of lines of a dot matrix font text.
Background
The application of machine vision instead of human eyes has become an important component of automated production to efficiently recognize text in images. Among other things, character recognition (optical character recognise, OCR) technology can recognize printed and printed text characters on paper, and store the recognition results in a text manner in a computing machine. A document or picture that is not editable in writing can be converted into editable content by character recognition. In the case of recognizing text in an image, the recognition is generally performed in a horizontal direction. However, in practical applications, the text lines are typically at an angle to the horizontal in the acquired text image. Therefore, it is necessary to correct the line of the rotated text to the horizontal direction in order to accurately recognize the text.
The existing text line rotation correction method comprises a Hough transformation method, a Radon transformation method and a principal component analysis method. The Hough transformation assumes that the collinear points of the rectangular coordinate system certainly intersect at one point on the curve corresponding to the polar coordinate system, so that the estimated rotation angle of the straight line is judged; the Radon transformation is to project the image space to the transformation domain in a line integral mode, is a continuous form of linear parameter transformation, and estimates the rotation angle by discriminating a straight line as the Hough transformation; the principal component analysis rule is to calculate a feature vector having the largest influence on the rotation angle distribution.
But for a line of lattice font text, the lattice font is represented by the outline of the character in terms of the false and true of each point. The Hough transformation and the Radon transformation are used for searching the rotation angle through judging the straight line, and the dot matrix font outline is discrete and does not have the straight line characteristic. Principal component analysis analyzes the distribution of rotation angles, and a dot-matrix font discrete outline causes a feature vector to have a plurality of components similar to the principal component, so that it is difficult to analyze the feature vector having the greatest influence on the distribution of rotation angles. Therefore, the existing text line rotation correction method cannot be applied to the lattice font text line.
Disclosure of Invention
The application provides a method and a device for correcting rotation of a text line of a dot matrix font. The method solves the problem that the existing text line rotation correction method cannot be applied to the text lines of the dot matrix fonts.
In a first aspect, the present application provides a method for correcting rotation of a line of text in a lattice font, including:
acquiring a text line image of a dot matrix font to be corrected;
performing binarization processing on the text line image of the dot matrix font to be corrected to obtain a binarized image;
extracting characteristic point data of the text line of the dot matrix font according to the binarized image;
performing rotation angle search according to the characteristic point data to obtain a rotation correction angle;
and carrying out rotation correction on the text line image of the dot font to be corrected according to the rotation correction angle to obtain a corrected image.
With reference to the first aspect, in one possible implementation manner, the feature point data includes: the step of searching the rotation angle according to the characteristic point data to obtain the rotation correction angle comprises the following steps:
Acquiring a search angle range;
calculating the relative relation value between the characteristic point intensity and the characteristic point azimuth of each angle in the search angle range;
And acquiring an angle value corresponding to the maximum relative relation value, wherein the angle value is the rotation correction angle.
With reference to the first aspect, in a possible implementation manner, the calculating a relative relationship value between the feature point intensity and the feature point azimuth of each angle in the search angle range includes:
Generating a projection histogram according to the characteristic point intensity and the characteristic point azimuth;
performing discrete suppression processing on the projection histogram to obtain a suppressed projection histogram;
And calculating the relative relation value between the characteristic point intensity and the characteristic point azimuth according to the suppressed projection histogram.
With reference to the first aspect, in one possible implementation manner, when the projection histogram meets a gaussian distribution, the performing a discrete suppression process on the projection histogram includes: and carrying out mean value filtering on the projection histogram.
With reference to the first aspect, in one possible implementation manner, the relative relationship value between the feature point intensity and the feature point azimuth is: and the ratio of the characteristic point intensity to the characteristic point azimuth.
In a second aspect, the present application also provides a device for correcting rotation of lines of text in a dot matrix font, the device comprising:
The acquisition module is used for acquiring text line images of the dot fonts to be corrected;
the binarization module is used for carrying out binarization processing on the text line image of the dot-matrix font to be corrected to obtain a binarized image;
The extraction module is used for extracting the characteristic point data of the text line of the dot matrix font according to the binarized image;
The rotation angle searching module is used for searching the rotation angle according to the characteristic point data to obtain a rotation correction angle;
And the correction module is used for carrying out rotation correction on the text line image of the dot matrix font to be corrected according to the rotation correction angle to obtain a corrected image.
With reference to the second aspect, in one possible implementation manner, the feature point data includes: the rotation angle search module is further used for:
Acquiring a search angle range;
calculating the relative relation value between the characteristic point intensity and the characteristic point azimuth of each angle in the search angle range;
And acquiring an angle value corresponding to the maximum relative relation value, wherein the angle value is the rotation correction angle.
With reference to the second aspect, in one possible implementation manner, the rotation angle search module is further configured to:
Generating a projection histogram according to the characteristic point intensity and the characteristic point azimuth;
performing discrete suppression processing on the projection histogram to obtain a suppressed projection histogram;
And calculating the relative relation value between the characteristic point intensity and the characteristic point azimuth according to the suppressed projection histogram.
With reference to the second aspect, in one possible implementation manner, when the projection histogram meets a gaussian distribution, the performing a discrete suppression process on the projection histogram includes: and carrying out mean value filtering on the projection histogram.
With reference to the second aspect, in one possible implementation manner, a relative relationship value between the feature point intensity and the feature point azimuth is: and the ratio of the characteristic point intensity to the characteristic point azimuth.
According to the technical scheme, the method and the device for correcting the rotation of the text line of the dot matrix font are provided. The method comprises the following steps: acquiring a text line image of a dot matrix font to be corrected; performing binarization processing on the text line image of the dot matrix font to be corrected to obtain a binarized image; acquiring characteristic point data of the text line of the dot matrix font according to the binarized image; performing rotation angle search according to the characteristic point data to obtain a rotation correction angle; and carrying out rotation correction on the text line image of the dot font to be corrected according to the rotation correction angle to obtain a corrected image. According to the rotation correction method provided by the application, binarization processing is firstly carried out on the text line image of the lattice font, then characteristic point data are extracted, a rotation correction angle is obtained by searching, and finally the text line image of the lattice font is rotated according to the rotation correction angle, so that the rotation correction of the text line of the lattice font can be realized.
Drawings
In order to more clearly illustrate the technical solution of the present application, the drawings that are needed in the embodiments will be briefly described below, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1 is a schematic diagram of a continuous font according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a dot font according to an embodiment of the present application;
FIG. 3 is a flowchart of a method for correcting rotation of lines of a text in a dot matrix font according to an embodiment of the present application;
FIG. 4 is a text line image of a dot font provided by an embodiment of the present application;
FIG. 5 is a binarized image according to an embodiment of the present application;
FIG. 6 is a flowchart of a method for performing rotation angle search according to a binarized image according to an embodiment of the present application;
FIG. 7 is a flowchart of calculating the relative relationship between the feature point intensity and the feature point orientation of each angle in the search angle range according to the embodiment of the present application;
FIG. 8 is a projection histogram provided by an embodiment of the present application;
FIG. 9 is a discrete suppressed post-projection histogram provided by an embodiment of the present application;
FIG. 10 is a rotation corrected image provided by an embodiment of the present application;
fig. 11 is a schematic diagram of a device for correcting rotation of text lines in a dot font according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to the embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The embodiments described in the examples below do not represent all embodiments consistent with the application. Merely exemplary of systems and methods consistent with aspects of the application as set forth in the claims.
The application of machine vision instead of human eyes has become an important component of automated production to efficiently recognize text in images. Among other things, character recognition (optical character recognise, OCR) technology can recognize printed and printed text characters on paper, and store the recognition results in a text manner in a computing machine. A document or picture that is not editable in writing can be converted into editable content by character recognition. In the case of recognizing text in an image, the recognition is generally performed in a horizontal direction. However, in practical applications, the text lines are typically at an angle to the horizontal in the acquired text image. Therefore, it is necessary to correct the line of the rotated text to the horizontal direction in order to accurately recognize the text.
Fig. 1 is a schematic diagram of a continuous font according to an embodiment of the present application, where, as shown in fig. 1, the outline of the continuous font is formed by continuous real dots, and is a text representation font that is common in daily life. The rotation correction method for the text lines of the continuous fonts comprises a Hough transformation method, a Radon transformation method and a principal component analysis method. The Hough transformation assumes that the collinear points of the rectangular coordinate system certainly intersect at one point on the curve corresponding to the polar coordinate system, so that the estimated rotation angle of the straight line is judged; the Radon transformation is to project the image space to the transformation domain in a line integral mode, is a continuous form of linear parameter transformation, and estimates the rotation angle by discriminating a straight line as the Hough transformation; the principal component analysis rule is to calculate a feature vector having the largest influence on the rotation angle distribution.
However, for the text line of the dot matrix font, as shown in fig. 2, fig. 2 is a schematic diagram of a dot matrix font according to an embodiment of the present application, where the dot matrix font represents the outline of a character by using the virtual reality of each dot. The Hough transformation and the Radon transformation are used for searching the rotation angle through judging the straight line, and the dot matrix font outline is discrete and does not have the straight line characteristic. Principal component analysis analyzes the distribution of rotation angles, and a dot-matrix font discrete outline causes a feature vector to have a plurality of components similar to the principal component, so that it is difficult to analyze the feature vector having the greatest influence on the distribution of rotation angles. Therefore, the existing text line rotation correction method cannot be applied to the lattice font text line.
The application provides a method and a device for correcting rotation of a text line of a dot matrix font. The method solves the problem that the existing text line rotation correction method cannot be applied to the text lines of the dot matrix fonts.
In a first aspect, the present application provides a method for correcting rotation of lines of text in a dot matrix font, and fig. 3 is a flowchart of a method for correcting rotation of lines of text in a dot matrix font, as shown in fig. 3, where the method includes the following steps:
s100: and acquiring a text line image of the lattice font to be corrected.
In this embodiment, the dot-matrix text line image to be corrected includes dot-matrix text lines, and the direction of the dot-matrix text lines forms a certain angle with the horizontal direction. Fig. 4 is a view of a text line image of a dot-matrix font according to an embodiment of the present application, where, as shown in fig. 4, the text line content of the dot-matrix font includes "06:41 0753 2013 1027BG", and the text line of the dot-matrix font is not in a horizontal direction, i.e., is at an angle to the horizontal direction. In order to improve the accuracy of image character recognition, it is necessary to perform rotation correction on the lattice font text line.
The format of the text line image of the dot font to be corrected can be: the present application does not specifically limit the format of the obtained text line image of the lattice font to be corrected, such as JPEG (Joint Photographic Expert Group) format, PNG (Portable Network Graphics, portable network graphic) format, BMP (BitMaP ) format, and the like.
S200: and carrying out binarization processing on the text line image of the dot matrix font to be corrected to obtain a binarized image.
In this embodiment, binarization processing is first performed on the corrected dot-matrix font text line image. For example, the binarization process is a process of setting the gray value of a pixel point on the dot-matrix font text line image to 0 or 255, that is, displaying a clear black-and-white effect on the entire dot-matrix font text line image. The binarization processing of the image is beneficial to the further processing of the text line image of the dot matrix font, so that the text line image of the dot matrix font becomes simple, the data volume is reduced, and the outline of the target can be highlighted. Fig. 5 is a binary image provided in an embodiment of the present application, as shown in fig. 5, in which the text line content "06:41 0753 2013 1027BG" of the lattice font in the binary image is changed to white, and the background color is changed to black. The method provided by the application can primarily filter irrelevant background interference except for the text lines of the dot matrix fonts through binarization processing so as to improve the accuracy of rotation correction.
S300: extracting characteristic point data of the text line of the dot matrix font according to the binarized image;
In one possible implementation, the feature point data includes feature point intensities and feature point orientations of the feature points. The feature point intensity includes gray information of feature points, and the feature point azimuth includes a position of the feature point in the to-be-corrected dot matrix text line image, for example, a X, Y coordinate value of the feature point on the to-be-corrected dot matrix text line image. The feature point intensities and the feature point orientations are used to determine a rotation correction angle.
S400: and searching the rotation angle according to the characteristic point data to obtain a rotation correction angle.
In this embodiment, the rotation correction angle of the text line of the dot-matrix font is obtained within the search angle range by processing the binarized image.
In one possible implementation manner, as shown in fig. 6, step S400, performing a rotation angle search according to the feature point data, and obtaining a rotation correction angle specifically includes the following steps S410 to S430:
S410: and acquiring a search angle range.
In this embodiment, the search angle range is set by an operator, and is generally determined according to the obtained included angle between the text line of the dot-matrix font to be corrected and the horizontal direction, and the search angle range is generally plus or minus 60 °.
Optionally, the search range is narrowed from coarse to fine according to the search angle range. For example, first, a coarse-scale search is performed, the search angle range is equally divided into 5 angle ranges, and the coarse-scale search is performed to obtain a closest coarse-scale search angle range. And then equally dividing the coarse-scale search angle range into 5 angle ranges for accurate search, and finally obtaining the rotation correction angle. In this way, the efficiency of the rotation correction angle search can be improved. It should be noted that, under the scene with low precision requirement, only coarse scale search can be adopted to realize higher-efficiency rotation correction of the text lines of the dot matrix fonts.
S420: and calculating the relative relation value between the characteristic point intensity and the characteristic point azimuth of each angle in the search angle range.
In one possible implementation manner, fig. 7 is a flowchart of calculating a relative relationship value between a feature point intensity and a feature point orientation of each angle in a search angle range according to an embodiment of the present application, and as shown in fig. 7, step S420 specifically includes the following steps:
S421: and generating a projection histogram according to the characteristic point intensity and the characteristic point azimuth. Fig. 8 is a projection histogram provided in an embodiment of the present application, as shown in fig. 8, in which an abscissa of the projection histogram represents the feature point orientation and an ordinate of the projection histogram represents the feature point intensity. The projection histogram may represent a relationship between the intensity and the azimuth of the feature points in the image of the text line of the lattice font to be corrected, so as to obtain a rotation correction angle of the text line of the lattice font.
S422: and performing discrete suppression processing on the projection histogram to obtain a suppressed projection histogram.
In this embodiment, morphological processing is performed on the projection histogram, discrete suppression is performed on the projection histogram, characteristic intensity fluctuation caused by dot matrix font discreteness is relieved, and noise points of interference are removed, so that a smoother projection histogram is obtained.
Fig. 9 is a schematic diagram of a post-suppression projection histogram according to an embodiment of the present application, where, as shown in fig. 9, a curve in the projection histogram after the discrete suppression processing is smoother, which is more favorable for obtaining a rotation correction angle.
In one possible implementation, when the projection histogram satisfies a gaussian distribution, the performing the discrete suppression processing on the projection histogram includes: and carrying out mean value filtering on the projection histogram.
Alternatively, by adjusting the degree of discrete suppression of the projection histogram, the rotation correction method provided by the application can be directly applied to rotation correction of continuous font text lines, and even can be regarded as dot matrix font processing when continuous fonts are broken. In particular, by adjusting parameters of morphological processing on the projection histogram, for example, morphological processing structural elements, a lattice font can use large structural elements, and a continuous font can use small structural elements; the morphological processing may be iterated a plurality of times, the lattice font may be performed a plurality of times, and the continuous font may be performed only once. Therefore, the rotation correction method provided by the application is more widely applied.
S423: and calculating the relative relation value between the characteristic point intensity and the characteristic point azimuth according to the suppressed projection histogram.
The relative relation value is used for representing the relevance between the intensity of the characteristic point and the azimuth of the characteristic point, and the rotation correction angle can be searched and obtained according to the calculated relative relation value between the intensity of the characteristic point and the azimuth of the characteristic point. The specific expression of the relative relation value can be determined according to the actually acquired lattice font text line and the character recognition requirement, and the application is not particularly limited to this.
In one possible implementation, the relative relationship value between the feature point intensity and the feature point azimuth is: and the ratio of the characteristic point intensity to the characteristic point azimuth.
S430: and acquiring an angle value corresponding to the maximum relative relation value, wherein the angle value is the rotation correction angle.
In this embodiment, the rotation correction angle is an included angle between the text line of the dot font and the horizontal direction. The obtaining the rotation correction angle specifically includes: firstly, searching the maximum value of the relative relation value of each angle in the search angle range, and then determining the corresponding angle value according to the maximum value of the relative relation value, wherein the angle value is used as the rotation correction angle.
S500: and carrying out rotation correction on the text line image of the dot font to be corrected according to the rotation correction angle to obtain a corrected image.
In this embodiment, rotation correction is performed on the to-be-corrected dot-matrix text line image, that is, two-dimensional rotation operation is performed on the to-be-corrected dot-matrix text line image, for example, when the rotation correction angle is θ°, that is, the included angle between the direction of the dot-matrix text line and the horizontal direction is counterclockwise θ°, the rotation correction is to rotate the dot-matrix text line image clockwise θ°, so as to obtain dot-matrix text lines distributed along the horizontal direction. Fig. 10 is a diagram of an image after rotation correction according to an embodiment of the present application, and as shown in fig. 10, the position of the text line "06:41 0753 2013 1027BG" of the dot-matrix font is corrected to be in the horizontal direction after rotation correction.
In a second aspect, the present application further provides a device for correcting rotation of a line of text in a dot font, and fig. 11 is a device for correcting rotation of a line of text in a dot font, provided in an embodiment of the present application, as shown in fig. 11, where the device includes:
an obtaining module 11, configured to obtain a text line image of a to-be-corrected dot font.
The binarization module 12 is used for performing binarization processing on the text line image of the dot-matrix font to be corrected to obtain a binarized image;
An extracting module 13, configured to extract feature point data of a text line of a dot matrix font according to the binarized image;
a rotation angle search module 14, configured to perform rotation angle search according to the feature point data, and obtain a rotation correction angle;
and the correction module 15 is used for carrying out rotation correction on the text line image of the dot font to be corrected according to the rotation correction angle to obtain a corrected image.
In one possible implementation, the feature point data includes: the rotation angle search module 14 is further configured to:
And acquiring a search angle range.
And calculating the relative relation value between the characteristic point intensity and the characteristic point azimuth of each angle in the search angle range.
And acquiring an angle value corresponding to the maximum relative relation value, wherein the angle value is the rotation correction angle.
In one possible implementation, the rotation angle search module 14 is further configured to:
and generating a projection histogram according to the characteristic point intensity and the characteristic point azimuth.
And performing discrete suppression processing on the projection histogram to obtain a suppressed projection histogram.
And calculating the relative relation value between the characteristic point intensity and the characteristic point azimuth according to the suppressed projection histogram.
In one possible implementation, when the projection histogram satisfies a gaussian distribution, the performing the discrete suppression processing on the projection histogram includes: and carrying out mean value filtering on the projection histogram.
And calculating the relative relation value between the characteristic point intensity and the characteristic point azimuth according to the suppressed projection histogram.
In one possible implementation, the relative relationship value between the feature point intensity and the feature point azimuth is: and the ratio of the characteristic point intensity to the characteristic point azimuth.
According to the technical scheme, the method and the device for correcting the rotation of the text line of the dot matrix font are provided. The method comprises the following steps: acquiring a text line image of a dot matrix font to be corrected; performing binarization processing on the text line image of the dot matrix font to be corrected to obtain a binarized image; acquiring characteristic point data of the text line of the dot matrix font according to the binarized image; performing rotation angle search according to the characteristic point data to obtain a rotation correction angle; and carrying out rotation correction on the text line image of the dot font to be corrected according to the rotation correction angle to obtain a corrected image. According to the rotation correction method provided by the application, binarization processing is firstly carried out on the text line image of the lattice font, then characteristic point data are extracted, a rotation correction angle is obtained by searching, and finally the text line image of the lattice font is rotated according to the rotation correction angle, so that the rotation correction of the text line of the lattice font can be realized.
The above-provided detailed description is merely a few examples under the general inventive concept and does not limit the scope of the present application. Any other embodiments which are extended according to the solution of the application without inventive effort fall within the scope of protection of the application for a person skilled in the art.

Claims (8)

1. A method for correcting rotation of lines of text in a lattice font, comprising:
acquiring a text line image of a dot matrix font to be corrected;
performing binarization processing on the text line image of the dot matrix font to be corrected to obtain a binarized image;
extracting characteristic point data of the text line of the dot matrix font according to the binarized image; the feature point data includes: characteristic point intensity and characteristic point orientation;
Acquiring a search angle range;
calculating the relative relation value between the characteristic point intensity and the characteristic point azimuth of each angle in the search angle range;
Acquiring an angle value corresponding to the maximum relative relation value, wherein the angle value is the rotation correction angle;
and carrying out rotation correction on the text line image of the dot font to be corrected according to the rotation correction angle to obtain a corrected image.
2. The method according to claim 1, wherein calculating the relative relationship value between the feature point intensity and the feature point orientation for each angle in the search angle range comprises:
Generating a projection histogram according to the characteristic point intensity and the characteristic point azimuth;
performing discrete suppression processing on the projection histogram to obtain a suppressed projection histogram;
And calculating the relative relation value between the characteristic point intensity and the characteristic point azimuth according to the suppressed projection histogram.
3. The dot-matrix font text line rotation correction method according to claim 2, wherein when the projection histogram satisfies a gaussian distribution, the performing a discrete suppression process on the projection histogram includes: and carrying out mean value filtering on the projection histogram.
4. The dot matrix font text line rotation correction method according to claim 1 or 2, wherein the relative relation value of the feature point intensity and the feature point orientation is: and the ratio of the characteristic point intensity to the characteristic point azimuth.
5. A dot-matrix font text line rotation correction apparatus, the apparatus comprising:
The acquisition module is used for acquiring text line images of the dot fonts to be corrected;
the binarization module is used for carrying out binarization processing on the text line image of the dot-matrix font to be corrected to obtain a binarized image;
The extraction module is used for extracting the characteristic point data of the text line of the dot matrix font according to the binarized image;
The rotation angle searching module is used for searching the rotation angle according to the characteristic point data to obtain a rotation correction angle;
the correction module is used for carrying out rotation correction on the text line image of the dot-matrix font to be corrected according to the rotation correction angle to obtain a corrected image;
The feature point data includes: the rotation angle search module is further used for:
Acquiring a search angle range;
calculating the relative relation value between the characteristic point intensity and the characteristic point azimuth of each angle in the search angle range;
And acquiring an angle value corresponding to the maximum relative relation value, wherein the angle value is the rotation correction angle.
6. The dot-matrix font text line rotation correction apparatus of claim 5, wherein the rotation angle search module is further configured to:
Generating a projection histogram according to the characteristic point intensity and the characteristic point azimuth;
performing discrete suppression processing on the projection histogram to obtain a suppressed projection histogram;
And calculating the relative relation value between the characteristic point intensity and the characteristic point azimuth according to the suppressed projection histogram.
7. The dot-matrix font text line rotation correction apparatus according to claim 6, wherein when the projection histogram satisfies a gaussian distribution, the performing a discreteness suppression process on the projection histogram includes: and carrying out mean value filtering on the projection histogram.
8. The dot-matrix font text line rotation correction apparatus according to claim 5 or 6, wherein the relative relationship value of the feature point intensity and the feature point orientation is: and the ratio of the characteristic point intensity to the characteristic point azimuth.
CN202110829961.3A 2021-07-22 2021-07-22 Method and device for correcting rotation of text lines of dot matrix fonts Active CN113421257B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110829961.3A CN113421257B (en) 2021-07-22 2021-07-22 Method and device for correcting rotation of text lines of dot matrix fonts

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110829961.3A CN113421257B (en) 2021-07-22 2021-07-22 Method and device for correcting rotation of text lines of dot matrix fonts

Publications (2)

Publication Number Publication Date
CN113421257A CN113421257A (en) 2021-09-21
CN113421257B true CN113421257B (en) 2024-05-31

Family

ID=77719478

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110829961.3A Active CN113421257B (en) 2021-07-22 2021-07-22 Method and device for correcting rotation of text lines of dot matrix fonts

Country Status (1)

Country Link
CN (1) CN113421257B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117351495B (en) * 2023-09-21 2024-04-26 山东睿芯半导体科技有限公司 Text image correction method, device, chip and terminal

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101872475A (en) * 2009-04-22 2010-10-27 中国科学院自动化研究所 Method for automatically registering scanned document images
WO2015092059A1 (en) * 2013-12-20 2015-06-25 I.R.I.S. Method and system for correcting projective distortions.
CN107203766A (en) * 2017-04-19 2017-09-26 杭州泽火科技有限公司 It is accurately positioned the method for character, apparatus and system in image
CN108052936A (en) * 2017-11-03 2018-05-18 中国科学院计算技术研究所 A kind of braille image wing drop bearing calibration and system
CN108596867A (en) * 2018-05-09 2018-09-28 五邑大学 A kind of picture bearing calibration and system based on ORB algorithms
WO2019056346A1 (en) * 2017-09-25 2019-03-28 深圳传音通讯有限公司 Method and device for correcting tilted text image using expansion method
CN109993161A (en) * 2019-02-25 2019-07-09 众安信息技术服务有限公司 A kind of text image rotational correction method and system
CN112017223A (en) * 2020-09-11 2020-12-01 西安电子科技大学 Heterologous image registration method based on improved SIFT-Delaunay
CN112101351A (en) * 2020-09-07 2020-12-18 凌云光技术股份有限公司 Projection-based text line rotation correction method and device
CN112257713A (en) * 2020-11-12 2021-01-22 Oppo广东移动通信有限公司 Image processing method, image processing device, electronic equipment and computer readable storage medium

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101872475A (en) * 2009-04-22 2010-10-27 中国科学院自动化研究所 Method for automatically registering scanned document images
WO2015092059A1 (en) * 2013-12-20 2015-06-25 I.R.I.S. Method and system for correcting projective distortions.
CN107203766A (en) * 2017-04-19 2017-09-26 杭州泽火科技有限公司 It is accurately positioned the method for character, apparatus and system in image
WO2019056346A1 (en) * 2017-09-25 2019-03-28 深圳传音通讯有限公司 Method and device for correcting tilted text image using expansion method
CN108052936A (en) * 2017-11-03 2018-05-18 中国科学院计算技术研究所 A kind of braille image wing drop bearing calibration and system
CN108596867A (en) * 2018-05-09 2018-09-28 五邑大学 A kind of picture bearing calibration and system based on ORB algorithms
CN109993161A (en) * 2019-02-25 2019-07-09 众安信息技术服务有限公司 A kind of text image rotational correction method and system
CN112101351A (en) * 2020-09-07 2020-12-18 凌云光技术股份有限公司 Projection-based text line rotation correction method and device
CN112017223A (en) * 2020-09-11 2020-12-01 西安电子科技大学 Heterologous image registration method based on improved SIFT-Delaunay
CN112257713A (en) * 2020-11-12 2021-01-22 Oppo广东移动通信有限公司 Image processing method, image processing device, electronic equipment and computer readable storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
易拉罐喷码字符在线视觉检测;南阳;白瑞林;吉峰;;光学技术(第06期);全文 *

Also Published As

Publication number Publication date
CN113421257A (en) 2021-09-21

Similar Documents

Publication Publication Date Title
US8750619B2 (en) Character recognition
CN110020692B (en) Handwriting separation and positioning method based on print template
WO2019056346A1 (en) Method and device for correcting tilted text image using expansion method
CN114926839A (en) Image identification method based on RPA and AI and electronic equipment
CN113221897B (en) Image correction method, image text recognition method, identity verification method and device
CN113421257B (en) Method and device for correcting rotation of text lines of dot matrix fonts
CN115512381A (en) Text recognition method, text recognition device, text recognition equipment, storage medium and working machine
CN113361547B (en) Signature recognition method, signature recognition device, signature recognition equipment and readable storage medium
CN113537216B (en) Dot matrix font text line inclination correction method and device
CN108427954B (en) Label information acquisition and recognition system
CN114005127A (en) Image optical character recognition method based on deep learning, storage device and server
Van Beusekom et al. Automated ocr ground truth generation
Shukla et al. An approach for skew detection using hough transform
CN112507914A (en) OCR (optical character recognition) method and recognition system based on bankbook and bill characters
CN112200789A (en) Image identification method and device, electronic equipment and storage medium
CN116994269A (en) Seal similarity comparison method and seal similarity comparison system in image document
CN113421256B (en) Dot matrix text line character projection segmentation method and device
CN113743360B (en) Intelligent seal analysis method and device
Naz et al. Challenges in baseline detection of cursive script languages
CN115100663A (en) Method and device for estimating distribution situation of character height in document image
CN112766261A (en) Character recognition method and device and computer storage medium
CN117877037B (en) OCR single character positioning and identifying method, system and computer storage medium
US10878271B2 (en) Systems and methods for separating ligature characters in digitized document images
CN117893502A (en) Image detection method, device, equipment and storage medium
Jalli et al. Text extraction from skewed text lines

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant