CN107038440B - Image tilt correction device, image processing system, and image tilt correction method - Google Patents

Image tilt correction device, image processing system, and image tilt correction method Download PDF

Info

Publication number
CN107038440B
CN107038440B CN201610080494.8A CN201610080494A CN107038440B CN 107038440 B CN107038440 B CN 107038440B CN 201610080494 A CN201610080494 A CN 201610080494A CN 107038440 B CN107038440 B CN 107038440B
Authority
CN
China
Prior art keywords
pixel
image
angle
included angle
pixel row
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
CN201610080494.8A
Other languages
Chinese (zh)
Other versions
CN107038440A (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.)
Ricoh Co Ltd
Original Assignee
Ricoh 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 Ricoh Co Ltd filed Critical Ricoh Co Ltd
Priority to CN201610080494.8A priority Critical patent/CN107038440B/en
Publication of CN107038440A publication Critical patent/CN107038440A/en
Application granted granted Critical
Publication of CN107038440B publication Critical patent/CN107038440B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/24Aligning, centring, orientation detection or correction of the image
    • G06V10/243Aligning, centring, orientation detection or correction of the image by compensating for image skew or non-uniform image deformations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformation in the plane of the image
    • G06T3/60Rotation of a whole image or part thereof
    • G06T3/608Skewing or deskewing, e.g. by two-pass or three-pass rotation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition

Abstract

The invention provides an image inclination correcting device, an image processing device or an image processing system comprising the same, and also provides a method for carrying out inclination correction on a scanned image of a text document page. The image tilt correction device of the present invention includes a search acquisition section for acquiring character pixels and corresponding pixel position information; a current pixel row setting section; a current pixel setting section; a judging section for judging whether a text pixel exists immediately below the current pixel; a right angle included angle determination recording part for recording that the included angle between the straight line connecting the current pixel and the character pixel right below and the transverse direction is 90 degrees; the inclined included angle calculation recording part is used for calculating and recording inclined included angles between straight lines connected with all character pixels of the current pixel and the next pixel row and the transverse direction; an included angle recording completion judgment section; a pixel row position determination unit; a control unit; a counting part for counting the times of the occurrence of various included angles; an inclination determination unit; and a rotary swing part.

Description

Image tilt correction device, image processing system, and image tilt correction method
Technical Field
The invention relates to an image tilt correction device, an image processing system, and an image tilt correction method.
Background
In the scanning process of the document, the document is often inclined, and the scanning image obtained in the way is inclined, so that great inconvenience is brought to the reference and the processing of the document. Therefore, it is necessary to determine the tilt of the scanned image and correct the image.
With the development of scanners and image processing techniques, it has been possible to perform inclination determination and correction of scanned images accordingly. For example, chinese patent (patent No. CN1755707A) discloses an automatic correction method for tilted images, which fits a plurality of pixel points to obtain a reference line, then determines the deflection angle of the scanned image by calculating the tilt angle of the reference line, and then corrects the image by the obtained deflection angle. However, the method in the patent only calculates the inclination angle once, and the reference line is obtained by fitting, so that a large error is bound to exist, and the corrected image has a problem of inaccurate correction.
Another chinese patent (patent No. CN102184396A) discloses a document image tilt correction method based on OCR recognition feedback, in which a rectangular region in a document image is first selected; then, OCR recognition is carried out on the selected area of the document image by respectively utilizing a text line tracking algorithm and a non-boundary line text line tracking algorithm, and the inclination angle k of the document image is respectively obtainedaAnd kbAnd identifying an effect parameter IaAnd Ib(ii) a By judging IaAnd IbThe size of the document image is determined, and then the whole document image is corrected according to the inclination angle. Although this method improves the correction accuracy of the scanned image to some extent, the inclination angle k is inclinedaAnd kbThe method is obtained by calculating the inclination angle of a straight line formed by connecting the initial pixel point and the ending pixel point, and the calculation error is still large.
Disclosure of Invention
The present invention has been made to solve the above-mentioned problems, and provides an image tilt correction device capable of more accurately determining and correcting a tilt of a scanned image obtained by scanning a text document page containing text and a background, and an image processing apparatus and an image processing system including the image tilt correction device, and also provides a method for performing a tilt correction of a scanned image of a text document page.
In order to achieve the purpose, the invention adopts the following structure and method:
< Structure I >
The present embodiment provides an image tilt correction apparatus for performing tilt determination and correction of a scanned image obtained by scanning a document page containing characters and a background, the image tilt correction apparatus including: a search acquisition unit that searches all pixels in the scanned image one by one based on a predetermined search path to acquire all character pixels constituting a character and corresponding pixel position information; a current pixel row setting unit that sets the uppermost pixel row as a current pixel row based on the acquired pixel position information; a current pixel setting unit for setting character pixels in a current pixel row as current pixels in a predetermined order; a determination unit configured to determine, for each set current pixel, whether or not a text pixel located directly below the current pixel exists on a pixel line next to the current pixel line, based on the pixel position information; a right angle included angle determination recording part, when the determination result of the determination part is yes, determining that the included angle between the line formed by the current pixel and the character pixel positioned right below the current pixel and the transverse direction of the scanned image is 90 degrees, and recording the 90 degree included angle; a tilt angle calculation recording part which calculates the tilt angle between the line formed by the current pixel and each character pixel in the next pixel row and the transverse direction and records the tilt angle when the judgment result of the judging part is negative; an included angle recording completion judging part which judges whether each character pixel on the current pixel row has been recorded with a corresponding included angle; a pixel row position judging part, which judges whether the current pixel row is the penultimate pixel row based on the pixel position information once each character pixel on the current pixel row has been recorded with the corresponding included angle; a control unit for controlling the current pixel row setting unit to set the next pixel row as the current pixel row when the current pixel row is judged not to be the penultimate pixel row, and then controlling the current pixel setting unit, the judgment unit, the right angle recording unit, the inclination angle calculation unit, the pixel row position judgment unit, and the inclination angle recording unit to perform their respective operations; a counting part for counting the occurrence frequency of each included angle when the current pixel row is judged to be the penultimate pixel row; an inclination judging part for judging whether the frequency of the 90 degree included angle recorded by the right angle included angle judging recording part is less than the frequency of the inclined included angle recorded by the inclined included angle calculating recording part, and judging that the scanned image is inclined when the judgment result is yes; and a rotation and swing unit which sets the inclination angle with the largest occurrence frequency as a swing inclination angle when the scanned image is determined to be inclined, and rotates and swings the scanned image based on a predetermined rotation and swing rule according to the swing inclination angle to obtain a swing image.
< Structure two >
Further, the present invention provides an image processing system, including: the device comprises a scanning device and an image processing device which is in communication connection with the scanning device. Wherein, the scanning device has: a scanning part for scanning a text document page containing text and background to obtain a scanned image; and a scanning side communication section that transmits the scanned image to the image processing apparatus; the image processing apparatus has: a processing-side communication unit that receives a scanned image; and an image tilt correction device for determining and correcting a tilt of the scanned image, the image tilt correction device being as described above.
< method one >
Further, the present invention provides an image tilt correction method for performing tilt determination and correction of a scanned image obtained by scanning a text document page containing text and a background, the method comprising the steps of: searching all pixels in the scanned image one by one based on a preset search path to acquire all character pixels forming characters and corresponding pixel position information; setting the uppermost pixel row as the current pixel row based on the acquired pixel position information; respectively setting the character pixels positioned on the current pixel line as current pixels according to a preset sequence; respectively judging whether a character pixel positioned right below the current pixel exists on the next pixel line of the current pixel line aiming at each set current pixel based on the pixel position information; when the judgment result is yes, judging that the included angle between the line formed by the current pixel and the character pixel positioned right below the current pixel and the transverse direction of the scanned image is 90 degrees, and recording the 90-degree included angle; if not, calculating the inclined included angle between the straight line formed by the current pixel and each character pixel in the next pixel row and the transverse direction, and recording the inclined included angle; judging whether each character pixel on the current pixel row has been recorded with a corresponding included angle; once each character pixel on the current pixel row is recorded with the corresponding included angle, judging whether the current pixel row is the penultimate pixel row or not based on the pixel position information; setting the next pixel row as the current pixel row when the current pixel row is judged not to be the penultimate pixel row; when the current pixel row is judged to be the penultimate pixel row, counting the occurrence frequency of each included angle; judging whether the frequency of the 90-degree included angle is smaller than the frequency of the inclined included angle, and judging that the scanned image is inclined when the judgment result is yes; and when the scanned image is judged to be inclined, setting the inclined angle with the largest occurrence frequency as a straightening inclined angle, and rotationally straightening the scanned image according to the straightening inclined angle and based on a preset rotational straightening rule, thereby obtaining a straightened image.
Action and Effect of the invention
According to the image tilt correction device, the image processing system and the image tilt correction method related by the invention, all character pixels and corresponding pixel position information which form characters in a scanned image are obtained, then whether character pixels which are positioned under the current pixel exist on a next pixel row of each set current pixel is judged respectively, if so, an included angle between a straight line formed by the two connected straight lines and the transverse direction of the scanned image is recorded as 90 degrees, if not, a tilt included angle between the straight line formed by the current pixel and each character pixel positioned in the next pixel row and the transverse direction is calculated and recorded, then whether the scanned image is tilted is judged by judging whether the number of times of 90-degree included angles is smaller than the number of times of 90-degree included angles, if the number of times of 90-degree included angles is larger than the number of times of tilt included angles, the scanned image is judged not to be tilted, the image is directly stored, if the situation is the opposite, the scanned image is judged to be inclined, and the scanned image is stored after being rotated and adjusted. Therefore, the image tilt correction device, the image processing system and the image tilt correction method can accurately judge whether the scanned image is tilted or not, the calculation of the tilt included angle of the scanned image is more accurate, the correction effect of the scanned image is better, and great convenience is brought to the file lookup and processing.
Drawings
Fig. 1 is a block diagram of an image processing system in an embodiment to which the present invention relates;
fig. 2 is a block diagram showing the configuration of an image tilt correcting apparatus according to an embodiment of the present invention;
FIG. 3 is a schematic illustration of a scanned image in an embodiment in accordance with the invention;
FIG. 4 is a diagram illustrating text pixels of a scanned image in an embodiment of the present invention;
FIG. 5 is a schematic diagram illustrating a process of calculating a tilt angle of a scanned image according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of a rotational rectification process of a scanned image in an embodiment in accordance with the invention;
FIG. 7 is a schematic illustration of a rectified scan image in an embodiment in accordance with the invention;
FIG. 8 is a process flow diagram of an image processing system in an embodiment in accordance with the invention; and
fig. 9 is a flowchart of a processing procedure of the image tilt correcting apparatus according to the embodiment of the present invention.
The specific implementation mode is as follows:
the inventor of the present invention has studied and found that, when character pixels on two adjacent pixel rows are connected and a character pixel located right below the current pixel exists on the next pixel row of the current pixel row, the connection line between the two character pixels is a vertical line, and when a character pixel located right below the current pixel does not exist on the next pixel row of the current pixel row, all the character pixels of the current pixel row and the next pixel row are connected respectively and the connection line is an oblique line.
If the scanned image is inclined, the number of the oblique lines is larger than that of the vertical lines, and if the scanned image is not inclined, the number of the vertical lines is larger than or equal to that of the oblique lines. Based on the above findings, the inventors propose the following technical solutions:
the present embodiment provides an image tilt correction apparatus for performing tilt determination and correction of a scanned image obtained by scanning a document page containing characters and a background, the image tilt correction apparatus including: a search acquisition unit that searches all pixels in the scanned image one by one based on a predetermined search path to acquire all character pixels constituting a character and corresponding pixel position information; a current pixel row setting unit that sets the uppermost pixel row as a current pixel row based on the acquired pixel position information; a current pixel setting unit for setting character pixels in a current pixel row as current pixels in a predetermined order; a determination unit configured to determine, for each set current pixel, whether or not a text pixel located directly below the current pixel exists on a pixel line next to the current pixel line, based on the pixel position information; a right angle included angle determination recording part, when the determination result of the determination part is yes, determining that the included angle between the line formed by the current pixel and the character pixel positioned right below the current pixel and the transverse direction of the scanned image is 90 degrees, and recording the 90 degree included angle; a tilt angle calculation recording part which calculates the tilt angle between the line formed by the current pixel and each character pixel in the next pixel row and the transverse direction and records the tilt angle when the judgment result of the judging part is negative; an included angle recording completion judging part which judges whether each character pixel on the current pixel row has been recorded with a corresponding included angle; a pixel row position judging part, which judges whether the current pixel row is the penultimate pixel row based on the pixel position information once each character pixel on the current pixel row has been recorded with the corresponding included angle; a control unit for controlling the current pixel row setting unit to set the next pixel row as the current pixel row when the current pixel row is judged not to be the penultimate pixel row, and then controlling the current pixel setting unit, the judgment unit, the right angle recording unit, the inclination angle calculation unit, the pixel row position judgment unit, and the inclination angle recording unit to perform their respective operations; a counting part for counting the occurrence frequency of each included angle when the current pixel row is judged to be the penultimate pixel row; an inclination judging part for judging whether the frequency of the 90 degree included angle recorded by the right angle included angle judging recording part is less than the frequency of the inclined included angle recorded by the inclined included angle calculating recording part, and judging that the scanned image is inclined when the judgment result is yes; and a rotation and swing unit which sets the inclination angle with the largest occurrence frequency as a swing inclination angle when the scanned image is determined to be inclined, and rotates and swings the scanned image based on a predetermined rotation and swing rule according to the swing inclination angle to obtain a swing image.
The image tilt correction apparatus provided by the present embodiment may further have the feature that: the search acquisition part comprises a background information acquisition unit for acquiring background information of a scanned image obtained after scanning; a pixel search unit which searches all pixels on the scanned image one by one along a predetermined search path; and a character pixel acquisition unit which judges whether each searched pixel is a character pixel which does not belong to the background or not based on the background information, and acquires the character pixel and corresponding pixel position information when the judgment result is yes.
The image tilt correction apparatus provided by the present embodiment may further have the feature that: the predetermined search path is: the pixels at the leftmost upper end of the scanned image are searched from left to right and from top to bottom in sequence until the pixels at the rightmost lower end are searched.
The image tilt correction apparatus provided by the present embodiment may further have the feature that: the predetermined order is any one of a forward order from the first pixel to the last pixel and a reverse order from the last pixel to the first pixel in the current pixel row.
The image tilt correction apparatus provided by the present embodiment may further have the feature that: the inclination angle calculation recording section includes: the slope calculation unit is used for calculating the slope between a straight line formed by connecting the current pixel with each character pixel in the next pixel row and the transverse direction; the inclination included angle calculation unit is used for calculating a corresponding inclination included angle for each slope according to a preset precision rule; and the inclination included angle recording unit is used for recording each calculated inclination included angle, and the preset precision rule is that the precision is accurate to one digit after a decimal point.
The image tilt correction apparatus provided by the present embodiment may further have the feature that: the rotation and rectification part comprises: a tilt angle setting unit for setting a tilt angle for setting the tilt angle as a tilt angle for setting the tilt angle, the tilt angle being obtained from the counting unit; and a rotation and rectification unit which performs rotation and rectification on the scanned image according to the rectification inclination angle and based on a preset rotation and rectification rule, thereby obtaining a rectified image.
The image tilt correction apparatus provided by the present embodiment may further have the feature that: the rotating and straightening rules are as follows: when the tilt angle for rectification is an acute angle, the scanned image is rotated clockwise by the angle of the tilt angle for rectification; when the tilt angle for adjustment is an obtuse angle, the scanned image is rotated counterclockwise by an angle complementary to the tilt angle for adjustment.
Further, the present embodiment provides an image processing system, including: the device comprises a scanning device and an image processing device which is in communication connection with the scanning device. Wherein, the scanning device has: a scanning part for scanning a text document page containing text and background to obtain a scanned image; and a scanning side communication section that transmits the scanned image to the image processing apparatus; the image processing apparatus has: a processing-side communication unit that receives a scanned image; and an image tilt correction device for determining and correcting a tilt of the scanned image, the image tilt correction device being as described above.
Further, the present embodiment provides an image tilt correction method for performing tilt determination and correction on a scanned image obtained by scanning a text document page including text and a background, the method including the steps of: searching all pixels in the scanned image one by one based on a preset search path to acquire all character pixels forming characters and corresponding pixel position information; setting the uppermost pixel row as the current pixel row based on the acquired pixel position information; respectively setting the character pixels positioned on the current pixel line as current pixels according to a preset sequence; respectively judging whether a character pixel positioned right below the current pixel exists on the next pixel line of the current pixel line aiming at each set current pixel based on the pixel position information; when the judgment result is yes, judging that the included angle between the line formed by the current pixel and the character pixel positioned right below the current pixel and the transverse direction of the scanned image is 90 degrees, and recording the 90-degree included angle; if not, calculating the inclined included angle between the straight line formed by the current pixel and each character pixel in the next pixel row and the transverse direction, and recording the inclined included angle; judging whether each character pixel on the current pixel row has been recorded with a corresponding included angle; once each character pixel on the current pixel row is recorded with the corresponding included angle, judging whether the current pixel row is the penultimate pixel row or not based on the pixel position information; setting the next pixel row as the current pixel row when the current pixel row is judged not to be the penultimate pixel row; when the current pixel row is judged to be the penultimate pixel row, counting the occurrence frequency of each included angle; judging whether the frequency of the 90-degree included angle is smaller than the frequency of the inclined included angle, and judging that the scanned image is inclined when the judgment result is yes; and when the scanned image is judged to be inclined, setting the inclined angle with the largest occurrence frequency as a straightening inclined angle, and rotationally straightening the scanned image according to the straightening inclined angle and based on a preset rotational straightening rule, thereby obtaining a straightened image.
The image tilt correction device, the image processing system, and the image tilt correction method according to the present invention will be described in detail below with reference to the drawings.
< example >
Fig. 1 is a block diagram of an image processing system in an embodiment to which the present invention relates; fig. 3 is a schematic diagram of a scanned image in an embodiment in accordance with the invention.
As shown in FIG. 1, image processing system 100 is used to process scanned images of a text document page containing text and background, not shown. The image processing system 100 includes a scanner 10, an image processing apparatus 20, and a communication network 30, and the scanner 10 is communicatively connected to the image processing apparatus 20 via the communication network 30.
The scanner 10 includes a scanner unit 11 and a scanner-side communication unit 12. The scanning section 11 is used for scanning a text document page to obtain a scanned image which is inclined as shown in fig. 3; the scanner communication unit 12 is connected to the scanner unit 11, and transmits a scanned image to the image processing apparatus 20.
The image processing apparatus 20 is communicatively connected to the scanner 10, and has a scan condition setting unit 21, a processing side communication unit 22, an image tilt correction unit 23, and an image print output unit 24.
The scan condition setting unit 21 is used for setting scan conditions, such as conditions for setting a picture format, brightness, or resolution of a scanned image, by a user before a scan operation.
The processing-side communication unit 22 is connected to the scan condition setting unit 21 and also to the scan-side communication unit 12, and transmits the scan conditions to the scan unit 11 before the scanning operation, and receives the scan image transmitted from the scan-side communication unit 12 after the scan unit 11 finishes scanning to obtain the scan image.
The image tilt correction device 23 is connected to the processing-side communication unit 22, and determines the tilt of the scanned image received by the processing-side communication unit 22, and if it is determined that the scanned image is tilted, it corrects the tilted image.
Fig. 2 is a block diagram showing the configuration of the image tilt correction apparatus according to the embodiment of the present invention.
As shown in fig. 2, the image tilt correction device 23 includes a search acquisition unit 25, a current pixel row setting unit 26, a current pixel setting unit 27, a determination unit 28, a right angle determination recording unit 29, a tilt angle calculation recording unit 30, an angle recording completion determination unit 31, a pixel row position determination unit 32, a statistic unit 33, a tilt determination unit 34, a rotation swing unit 35, a temporary storage unit 36, a predetermined value storage unit 37, and a control unit 38 for controlling the operations of the above units.
The search acquisition section 25 includes an attribute information acquisition unit 25-1, a pixel search unit 25-2, a pixel attribute determination unit 25-3, a text pixel acquisition unit 25-4, and a last pixel determination unit 25-5.
The attribute information acquiring unit 25-1 is for acquiring file format information, background color information, and line number information of pixel lines of a scanned image.
The pixel search unit 25-2 is for searching all pixels on the scanned image one by one along a set search path, and includes a start point pixel setting section 25-2a, a search path setting section 25-2b, and a current search pixel setting section 25-2 c. The start point pixel setting section 25-2a sets a start point pixel, the search path setting section 25-2b sets a search path from the start point pixel, and the current search pixel setting section 25-2c sets the start point pixel as a current search path according to the search path.
Fig. 4 is a schematic diagram of text pixels of a scanned image in an embodiment of the invention.
As shown in fig. 4, in the present embodiment, the start point pixel setting section 25-2a sets a pixel of the scanned image located at the leftmost upper end a as a start point pixel; the search path setting section 25-2B sets as a search path a path from the start pixel, searching in order from left to right, from top to bottom (i.e., first in the x-axis direction, then in the y-axis direction), until the pixel at the rightmost lower end B is searched; the current search pixel setting section 25-2c continuously sets the start point pixel as the current search pixel. The position of the start pixel and the search path are stored in the predetermined value storage section 37, and the position of the current search pixel is stored in the temporary storage section 36.
The pixel attribute judgment unit 25-3 judges the current search pixel as a background pixel or a text pixel not belonging to the background pixel.
The text pixel obtaining unit 25-4 is configured to obtain a text pixel and corresponding pixel position information when the pixel attribute judging unit 25-3 judges that the current search pixel is a text pixel, and store the text pixel and the corresponding pixel position information in the temporary storage unit 36.
The last pixel judgment unit 25-5 is configured to judge whether each current search pixel is the last pixel in the search path when the judgment is completed and the corresponding pixel attribute information has been acquired. When the current search pixel is determined to be the last pixel, the subsequent function is started by the subsequent section in the image tilt correction device 23; when the current search pixel is determined not to be the last pixel, the control section 38 controls the start point pixel setting section 25-2a to set the next pixel in the search path as the start point pixel according to the set search path.
As shown in FIG. 4In this embodiment, after the first three pixel rows are judged by the pixel attribute judgment unit 25-3, no character pixel is obtained, and the first character pixel appears on the fourth pixel row. At this time, the text pixel obtaining unit 25-4 marks the pixel line as a text pixel line 1, and records the first text pixel 1-1 and its coordinate information (x)1,y1-1) Stored in the temporary storage section 36. Then, the last pixel judgment unit 25-5 judges whether the character pixel 1-1 is the last pixel in the search path, and the judgment result is negative; then, the control section 38 controls the starting point pixel setting section 25-2a to set the pixel next to the character pixel 1-1 as the starting point pixel, and the above steps are performed again until the pixel at the B position is judged.
All text pixel rows of the scanned image, as well as text pixels and corresponding coordinate information on those pixel rows, are stored in the temporary storage 36.
It should be noted that the text pixels in fig. 4 are not the actual text pixels of the text in fig. 3, nor are individual text pixels larger than the other pixels in the pixel row. This is designed only to more clearly explain the operation of the search acquisition unit.
Fig. 5 is a schematic diagram illustrating a process of calculating a tilt angle of a scanned image according to an embodiment of the present invention.
Fig. 5 illustrates the calculation process of the tilt angle by taking the first seven pixel rows in fig. 4 as an example, and the seven pixel rows are enlarged for clarity. As shown in fig. 5, after the search acquisition unit 25 acquires all the text pixels and the corresponding pixel position information of the scanned image, the current pixel row setting unit 26 sets the uppermost text pixel-attached pixel row as the current pixel row, that is, sets the text pixel row 1 as the current pixel row, which is temporarily stored in the temporary storage unit 36.
The current pixel setting section 27 includes an initial pixel setting unit 27-1 and a current pixel setting unit 27-2. The initial pixel setting unit 27-1 is configured to set a certain pixel of the current pixel row as an initial pixel along a predetermined order, and start a subsequent determination step; the current pixel setting unit 27-2 is used to set the current pixel that is currently judged. In the present embodiment, the predetermined order refers to a forward order from the first pixel to the last pixel in the current pixel row, and the predetermined order is stored in the predetermined value storage section 37. The initial pixel setting unit 27-1 sets the text pixel 1-1 at the leftmost end of the text pixel row 1 as an initial pixel, while the current pixel setting unit 27-2 sets the initial pixel as a current pixel.
The determination unit 28 is configured to determine a current pixel and determine whether or not a character pixel located directly below the current pixel exists on a next pixel line.
The right angle included angle determination recording section 29 is configured to determine that an included angle between a line connecting the current pixel and a character pixel located right below the current pixel and the transverse direction of the scanned image is 90 ° when the determination result of the determination section is yes, and record the 90 ° included angle.
The inclined angle calculation recording part 30 includes a slope calculation unit 30-1, an inclined angle calculation unit 30-2, an inclined angle judgment unit 30-3, and an inclined angle recording unit 30-4. The slope calculation unit 30-1 is configured to calculate a slope between a line connecting the current pixel and each text pixel in the next pixel row and the horizontal direction when the determination result of the determination unit is negative; the inclined included angle calculating unit 30-2 is used for calculating an inclined included angle corresponding to the slope according to a preset precision rule; the inclined included angle judging unit 30-3 judges whether the inclined included angle is smaller than 1 degree, if so, the inclined included angle recording unit 30-3 records and stores the inclined included angle, and if not, the inclined included angle is not recorded. The predetermined accuracy rule in the present embodiment is accurate to one decimal place, and is stored in the predetermined value storage section 37.
As shown in fig. 5, the determination unit first determines the text pixel 1-1 as the current pixel, determines whether or not a text pixel exists at a position on the pixel line 2 directly opposite to the text pixel 1-1, and determines whether or not the determination result is negative. In this case, the slope calculating unit 30-1 first determines (y) according to the formula k2-1-y1-1)/(x2-x1) For character pixel 1-1 (x)1,y1-1) And text pixel2-1(x2,y2-1) Calculating the slope of the connected straight lines, and calculating the inclination angle α corresponding to the slope according to the corresponding relation between the slope k and the inclination angle tan α ═ k by the inclination angle calculating unit 30-2(1-1,2-1)Then the inclined angle determination unit 30-3 pairs of inclined angles α(1-1,2-1)Judging whether the angle is less than 1 degree or not, and if so, judging that the included angle is α(1-1,2-1)Not less than 1 deg., the inclined angle α is recorded by the inclined angle recording unit 30-3(1-1,2-1)Then the slope calculating unit 30-1 calculates the slope of the straight line formed by the text pixel 1-1 and the text pixel 2-2 until the inclined angle α of the straight line(1-1,2-2)Is also stored in the temporary storage section 36.
The included angle recording completion judging unit 31 is configured to judge whether each text pixel on the current pixel row has been recorded with a corresponding included angle, and includes a row end pixel judging unit 31-1. Since the initial pixels in this embodiment are set according to a predetermined sequence, in this embodiment, the included angle recording completion determining unit 31 only needs to use the line tail pixel determining unit 31-1 to determine whether the current pixel is the last text pixel of the current pixel line, so that the task of determining the included angle recording completion of the entire pixel line can be completed.
The pixel row position determination unit 32 is configured to determine whether or not the current pixel row is a penultimate character pixel row based on the pixel position information. Because the character pixel which can be connected with the character pixel on the last character pixel line does not exist, all the included angles are considered to be recorded after the last character pixel of the last but one character pixel line is recorded.
As shown in fig. 5, after the recording of the corresponding angle of the text pixel 1-1 is completed, the line end pixel judgment unit 31-1 judges whether the text pixel 1-1 is the last text pixel of the text pixel line 1, and if the judgment result is yes, the included angle recording completion judgment unit 31 judges that each text pixel of the text pixel line 1 has been recorded with the corresponding included angle.
Next, the pixel row position determination unit 32 determines whether or not the character pixel row 1 as the current pixel row is the second last pixel row. In the case where the determination result is no, the current pixel row setting unit 26 sets the pixel row 2 as the current pixel row, the initial pixel setting unit 27-1 sets the character pixel 2-1 as the initial pixel, and the current pixel setting unit 27-2 sets a new initial pixel as the current pixel.
Then, the judgment part judges the character pixel 2-1, and the judgment result is that no character pixel on the pixel line 3 is positioned right below the character pixel 2-1, and further the slope calculation unit 30-1, the inclination angle calculation unit 30-2, the inclination angle judgment unit 30-3 and the inclination angle recording unit 30-4 respectively start to calculate and judge the straight line formed by connecting the character pixel 2-1 and the character pixel 3-1, the character pixel 3-2 and the character pixel 3-3, and record α(2-1,3-1)、α(2-1,3-2)、α(2-1,3-3)
Then, the initial pixel setting unit 27-1 sets the text pixel 2-2 as the initial pixel, the current pixel setting unit 27-2 sets the new initial pixel as the current pixel, the judgment section judges the text pixel 2-2, and the judgment result is that the text pixel 3-1 on the pixel line 3 is located right below the text pixel 2-2, at this time, the right angle judgment recording section 29 judges the angle between the horizontal direction and the straight line formed by connecting the text pixel 2-2 and the text pixel 3-1 as 90 °, and stores the 90 ° angle in the temporary storage section 36.
Then, the included angle recording completion judgment section 31 judges that each character pixel on the pixel row 2 as the current pixel row has been recorded with the corresponding included angle, and the pixel row position judgment section 32 judges that the pixel row 2 as the current pixel row is not the penultimate pixel row.
Subsequently, the current pixel row setting unit 26 sets the pixel row 3 as the current pixel row, and calculates, determines, and records straight lines connecting the text pixels 3-1 to 3 and the text pixels 4-1 to 4-4 on the text pixel row 4, respectively, until the last text pixel on the penultimate text pixel row is determined to have recorded the corresponding angle.
As shown in fig. 4, when the angle of the last text pixel on the penultimate text pixel line is recorded, the counting unit 33 counts the number of times of occurrence of each angle, and the statistical data is stored in the temporary storage unit 36.
The inclination determination unit 34 determines whether or not the number of occurrences of the 90 ° included angle recorded by the angular included angle determination recording unit 29 is smaller than the number of occurrences of the inclined included angle recorded by the inclined included angle calculation recording unit 30, based on the statistical data of the statistical unit. When the judgment result is yes, judging that the scanned image is inclined; when the determination result is no, it is determined that the scanned image is not tilted.
The rotation swing unit 35 includes a tilt angle setting unit 35-1 for swing and a rotation swing unit 35-2. The panning tilt angle setting unit 35-1 is configured to set the tilt angle with the largest number of occurrences as the panning tilt angle when the scanned image is determined to be tilted. The rotation and rectification unit 35-2 includes an acute and obtuse angle determination section 35-2a and a rotation and rectification section 35-2b, the acute and obtuse angle determination section 35-2a determines whether the rectification tilt angle is an acute angle or an obtuse angle, and the rotation and rectification section 35-2b performs rotation and rectification on the scanned image based on a predetermined rotation and rectification rule, thereby obtaining a rectified image. The registered image is stored in the temporary storage section 36.
The rotating and straightening rules are as follows: when the tilt angle for rectification is an acute angle, the scanned image is rotated clockwise by the angle of the tilt angle for rectification; when the tilt angle for tilt is obtuse, the scanned image is rotated counterclockwise by an angle complementary to the tilt angle for tilt. The rotation and correction rule is stored in the predetermined value storage unit 37.
Fig. 6 is a schematic diagram of a rotation and rectification process of a scanned image according to an embodiment of the present invention.
As shown in FIG. 6, the swing tilt angle setting unit 35-1 sets the tilt angle with the largest number of occurrences as the swing tilt angle α for swinging the scanned image, at this time, the swing tilt angle α is also regarded as the tilt angle of the whole scanned image α is an obtuse angle in the present embodiment, and the rotation swing unit 35-2 rotates the scanned image counterclockwise by the complementary angle of α, that is, (180- α) according to the rotation swing rule.
Fig. 7 is a schematic diagram of a rectified scan image in an embodiment of the present invention.
As shown in fig. 6 and 7, the scanned image is rotated counterclockwise (180- α) to obtain a straightened scanned image as shown in fig. 7.
As shown in fig. 1, the image printout means 24 is for printout of a scanned image judged or set by the image inclination correction means 23. In the present embodiment, the image print-output device 24 is a printer.
The following will further describe the processing procedure of the text document page by the image processing system and the inclination correction procedure of the scanned image by the image inclination correction device with reference to the flow chart:
fig. 8 is a flowchart of a processing procedure of the image processing system in the embodiment according to the present invention.
As shown in fig. 8, the processing procedure of the image processing system 100 includes the steps of:
step S1: the scan condition setting unit 21 sets conditions such as a picture format, brightness, and resolution of a scan image;
step S2: the processing-side communication unit 22 transmits the set scanning conditions to the scanning device 10;
step S3: the scanning side communication section 12 of the scanning apparatus 10 receives the scanning condition;
step S4: the scanning part 11 scans the text document page according to the scanning condition to obtain a scanned image;
step S5: the scanning-side communication section 12 transmits the scanned image to the image processing apparatus 20;
step S6: the image inclination correcting device 23 judges the inclination of the scanned image, and corrects the scanned image under the condition of inclination to obtain a non-inclined scanned image;
step S7: the image printout device 24 prints out the non-tilt-scanned image judged or set by the image tilt correction device 23.
Fig. 9 is a flowchart of a processing procedure of the image tilt correcting apparatus according to the embodiment of the present invention.
As shown in fig. 9, the inclination correction process of the scanned image by the image inclination correction device 23 includes the steps of:
in step S6-1, the attribute information acquisition unit 25-1 acquires the file format information of the scanned image, the color information of the background of the document, and the line count information of the pixel lines, and then proceeds to step S6-2.
In step S6-2, the start pixel setting section 25-2a sets the pixel of the scanned image located at the leftmost upper end as the start pixel, and then proceeds to step S6-3.
In step S6-3, the search-path setting section 25-2b sets a search path starting from the start pixel, that is, a path searched from the start pixel in the order from left to right and from top to bottom until the pixel at the rightmost lower end is searched, as a search path, and then proceeds to step S6-4.
In step S1-4, the current search pixel setting section 25-2c sets the start point pixel as the current search pixel, and then proceeds to step S6-5.
Step S6-5, the pixel attribute judgment unit 25-3 judges whether the current search pixel is a character pixel not belonging to the background pixel, and when the judgment result is yes, the step S6-6 is executed; if the judgment result is negative, the step S6-7 is carried out;
in step S6-6, the text pixel obtaining unit 25-4 obtains the text pixel and the corresponding pixel position information, stores these pieces of information in the temporary storage section 36, and then proceeds to step S6-7.
Step S6-7, the last pixel determining unit 25-5 determines whether the current searched pixel is the last pixel in the search path, and if the current searched pixel is determined to be the last pixel, the process goes to step S6-8; if the current search pixel is not the last pixel, the process proceeds to step 6-9.
In step S6-8, the current pixel row setting unit 26 sets the uppermost pixel row with text pixels as the current pixel row, and then proceeds to step S6-10.
In step S6-9, the start point pixel setting section 25-2a sets the next pixel in the search path as the start point pixel, and then proceeds to step S6-4.
In step S6-10, the initial pixel setting unit 27-1 sets the leftmost character pixel on the current pixel row as the initial pixel based on the pixel position information, and then proceeds to step S6-11.
In step S6-11, the current pixel setting unit 27-2 sets the initial pixel as the current pixel, and then proceeds to step S6-12.
In step S6-12, the determination unit 28 determines the current pixel and determines whether or not a character pixel located immediately below the current pixel exists on the next pixel line. If yes, go to step S6-13; if the determination result is negative, the process proceeds to step S6-14.
In step S6-13, the right angle determination recording section 29 determines that the angle between the line connecting the current pixel and the character pixel located immediately below the current pixel and the transverse direction of the scanned image is 90 °, records the 90 ° angle, and then proceeds to step S6-21.
6-14, setting the initial value of the character pixel N of the next pixel row as 1;
in step S6-15, the slope calculating unit 30-1 calculates the slope between the line connecting the current pixel and the text pixel N in the next pixel row and the lateral direction, and then proceeds to step S6-16.
In step S6-16, the inclination angle calculation unit 30-2 calculates the inclination angle corresponding to the slope according to a predetermined precision gauge so that the inclination angle is accurate to one decimal point later, and then the process proceeds to step S6-17.
Step S6-17, the inclined included angle judgment unit 30-3 judges whether the inclined included angle is smaller than 1 degree, if yes, the step S6-18 is executed; if the determination result is negative, the process proceeds to step S6-19.
In step S6-18, the inclination angle recording unit 30-4 does not record and store the inclination angle, and then proceeds to step S6-20.
In step S6-19, the inclination angle recording unit 30-4 records and stores the inclination angle, and then proceeds to step S6-20.
Step S6-20, judging whether N is the last character pixel of the next pixel row, if yes, entering step S6-22; if the determination result is negative, the process proceeds to step S6-21.
In step S6-21, N is set to N +1, and the process proceeds to step S6-15.
In step S6-22, the line end pixel determination unit 31-1 determines whether the current pixel is the last character pixel of the current pixel line. If yes, go to step S6-23; if not, the step S6-24 is proceeded.
In step S6-23, the pixel row position determination unit 32 determines whether or not the current pixel row is the second to last pixel row based on the pixel position information. If yes, go to step S6-25; if not, the process proceeds to step S6-26.
In step S6-24, the initial pixel setting unit 27-1 sets the next text pixel on the current pixel row as the initial pixel, and then proceeds to step S6-11.
In step S6-25, the counting unit 33 counts the number of occurrences of each angle, and the process proceeds to step S6-27.
In step S6-26, the current pixel row setting unit 26 sets the next pixel row with text pixels as the current pixel row, and then proceeds to step S6-10.
In step S6-27, the inclination determination unit 34 determines whether or not the number of occurrences of the 90 ° included angle recorded by the angular included angle determination recording unit 29 is smaller than the number of occurrences of the inclined included angle recorded by the inclined included angle calculation recording unit 30, based on the statistical data of the statistical unit 26. If yes, judging that the scanned image is inclined, and then entering the step S6-28; if the determination result is negative, the process proceeds to step S6-29.
In step S6-28, the pivot inclination angle setting unit 35-1 sets the inclination angle that occurs the most frequently as the pivot inclination angle, and then proceeds to step S6-30.
In step S6-29, the inclination determination section 34 determines that the scanned image is not inclined, and then proceeds to step S6-33.
In step S6-30, the acute/obtuse angle determining section 35-2a determines whether the setting inclination angle is an acute angle or an obtuse angle. If the judgment result is an obtuse angle, the procedure goes to step S6-31; if the judgment result is an acute angle, the process proceeds to step S6-32.
In step S6-31, the rotation and rectification section 35-2b rotates the scanned image counterclockwise by the complementary angle of the inclination angle, and then proceeds to step S6-33.
In step S6-32, the rotation and rectification section 35-2b rotates the scanned image clockwise by the angle of the inclination angle, and then proceeds to step S6-33.
In step S6-33, the temporary storage unit 36 stores the scanned image.
The first embodiment has the following functions and effects:
according to the image tilt correction device, the image processing system and the image tilt correction method related to the embodiment, all character pixels and corresponding pixel position information which form characters in a scanned image are obtained, then whether character pixels which are positioned right below the current pixel exist on a next pixel row of each set current pixel is judged respectively, if so, an included angle between a straight line formed by the two connected straight lines and the transverse direction of the scanned image is recorded as 90 degrees, if not, a tilt included angle between the straight line formed by the current pixel and each character pixel positioned in the next pixel row and the transverse direction is calculated and recorded, then whether the scanned image is tilted or not is judged by judging whether the 90-degree included angle appears less than the tilt included angle, if the 90-degree included angle appears more than the tilt included angle, the scanned image is judged not to be tilted, the image is directly stored, if the situation is the opposite, the scanned image is judged to be inclined, and the scanned image is stored after being rotated and adjusted. Therefore, the image tilt correction device, the image processing system and the image tilt correction method of the embodiment can very accurately judge whether the scanned image is tilted or not, the calculation of the tilt included angle of the scanned image is more accurate, the rectification effect of the scanned image is better, and great convenience is brought to the file lookup and processing.
Further, since the background information acquiring unit can first recognize the background information in the text document page in the search acquiring section of the image tilt correcting apparatus, and then the pixel searching unit searches the text pixels one by one in the order from left to right and from top to bottom, the search of the text pixels is made simpler, thereby shortening the acquisition time of the text pixels.
Furthermore, the inclination angle calculation recording part of the image inclination correction device calculates the inclination angle between a straight line formed by connecting the current pixel with each character pixel in the next pixel row and the transverse direction to obtain the inclination angle, and the rotation correcting part determines the inclination angle of the scanned image by judging the occurrence frequency of the inclination angle, so that the calculation error of the inclination angle of the scanned image is greatly reduced, and the rotation correcting precision of the scanned image with the inclination is improved.
It is to be understood that the image tilt correction device, the image processing system, and the image tilt correction method according to the present invention are not limited to the embodiments described in the above embodiments.
In the above-described embodiments, the image tilt correction apparatus and the scanning section are partially of different devices or apparatuses. In the invention, the image inclination correcting device and the scanning part can be positioned in the same image processing equipment, and the image processing equipment can not only scan the text document page to obtain a scanned image, but also directly judge the inclination of the obtained scanned image and correct the scanned image when the scanned image is inclined.
Further, a printing device may be further provided in the above-described image processing apparatus, so that the image processing apparatus can both scan, correct, and print out an image.
In the above embodiment, the search acquisition unit searches for pixels in the order from left to right and from top to bottom from the pixel located at the top and left most, and determines the character pixel. In the image inclination correction device of the present invention, the starting point pixel setting section may set a pixel at any other position of the scanned image as the starting point pixel, and the search path may not be limited to the above-described order from the starting point pixel, as long as it can determine all pixels and acquire all text pixels. If a pixel located at any one of the upper right end, lower right end, and lower left end of the scanned image may be set as the starting pixel, the pixels may be searched and determined in a column-by-row manner.
In the above embodiment, the current pixel setting unit sets the current pixel in the order of the leftmost end to the rightmost end in one pixel row. In the image tilt correction apparatus of the present invention, the current pixel setting unit may set the current pixel in reverse order from the rightmost end to the leftmost end.

Claims (10)

1. An image tilt correction device for performing tilt determination and correction of a scanned image obtained by scanning a text document page including text and a background, comprising:
a search acquisition unit configured to search all pixels in the scanned image one by one based on a predetermined search path to acquire all character pixels constituting the character and corresponding pixel position information;
a current pixel row setting unit that sets the uppermost pixel row as a current pixel row based on the acquired pixel position information;
a current pixel setting unit configured to set the text pixels located in the current pixel row as current pixels in a predetermined order;
a determination unit configured to determine, for each of the set current pixels, whether or not the text pixel located directly below the current pixel exists on a pixel line next to the current pixel line, based on the pixel position information;
a right angle included angle determination recording section which, when the determination result of the determination section is yes, determines that an included angle between a straight line connecting the current pixel and the text pixel located right below the current pixel and the transverse direction of the scanned image is 90 °, and records the 90 ° included angle;
a tilt angle calculation recording unit that calculates a tilt angle between a line connecting the current pixel and each of the text pixels in the next pixel row and the horizontal direction and records the tilt angle when the determination result of the determination unit is negative;
an included angle recording completion judging section for judging whether each of the text pixels on the current pixel row has been recorded with a corresponding included angle;
a pixel row position judging section that judges whether or not the current pixel row is a penultimate pixel row based on the pixel position information once each of the text pixels on the current pixel row has been recorded with the corresponding included angle;
a control section that controls the current pixel row setting section to set the next pixel row as the current pixel row when the current pixel row is determined not to be the penultimate pixel row, and then controls the current pixel setting section, the determination section, the right angle included angle recording section, the inclination included angle calculation section, the pixel row position determination section, and the inclination included angle recording section to perform respective operations;
a counting part for counting the occurrence frequency of each included angle when the current pixel row is judged to be the penultimate pixel row;
an inclination judging part for judging whether the number of times of the 90-degree included angle recorded by the right-angle included angle judging and recording part is less than the number of times of the inclination included angle recorded by the inclination included angle calculating and recording part, and when the judgment result is yes, judging that the scanned image is inclined; and
and a rotation/swing unit that sets the tilt angle with the largest number of occurrences as a swing tilt angle when the scanned image is determined to be tilted, and rotationally swings the scanned image based on a predetermined rotation/swing rule according to the swing tilt angle to obtain a swung image.
2. The image tilt correction apparatus according to claim 1, characterized in that:
wherein the search acquisition section includes:
a background information acquisition unit which acquires background information of the scanned image obtained after scanning;
a pixel search unit that searches all the pixels on the scanned image one by one along the predetermined search path; and
and the character pixel acquisition unit is used for judging whether each searched pixel is the character pixel which does not belong to the background or not based on the background information, and acquiring the character pixel and corresponding pixel position information when the judgment result is yes.
3. The image tilt correction apparatus according to claim 1, characterized in that:
wherein the predetermined search path is: and searching from the pixel at the leftmost upper end of the scanned image to the pixel at the rightmost lower end along the sequence from left to right and from top to bottom.
4. The image tilt correction apparatus according to claim 3, characterized in that:
wherein the predetermined order is any one of a forward order from a first pixel to a last pixel and a reverse order from the last pixel to the first pixel in the current pixel row.
5. The image tilt correction apparatus according to claim 1, characterized in that:
wherein the inclination angle calculation recording section includes:
a slope calculation unit that calculates a slope between a line connecting the current pixel and each of the text pixels located in the next pixel row, and the lateral direction;
the inclination included angle calculation unit is used for calculating the corresponding inclination included angle for each slope according to a preset precision rule; and
and the inclined included angle recording unit is used for recording each calculated inclined included angle.
6. The image tilt correction apparatus according to claim 5, characterized in that:
wherein the predetermined accuracy rule is accurate to one digit after the decimal point.
7. The image tilt correction apparatus according to claim 1, characterized in that:
wherein, rotatory pendulum portion includes:
a tilt angle setting unit for setting the tilt angle as a tilt angle for setting the tilt angle, the tilt angle being obtained from the counting unit;
and a rotation and rectification unit which performs rotation and rectification on the scanned image according to the rectification inclination angle and based on a preset rotation and rectification rule, thereby obtaining the rectified image.
8. The image tilt correction apparatus according to claim 7, characterized in that:
wherein, the rotation and correction rule is as follows: when the tilt angle for rectification is an acute angle, rotating the scanned image clockwise by the angle of the tilt angle for rectification; when the tilt angle for adjustment is an obtuse angle, the scanned image is rotated counterclockwise by an angle complementary to the tilt angle for adjustment.
9. An image processing system, comprising:
a scanning device; and
an image processing device communicatively coupled to the scanning device,
wherein the scanning device has:
a scanning part for scanning a text document page containing text and background to obtain a scanned image; and
a scanning-side communication section that transmits the scanned image to the image processing apparatus,
the image processing apparatus has:
a processing-side communication unit that receives the scanned image; and
an image tilt correction device for determining and correcting a tilt of the scanned image, the image tilt correction device according to any one of claims 1 to 8.
10. An image tilt correction method for performing tilt determination and correction of a scanned image obtained by scanning a document page containing characters and a background, comprising the steps of:
searching all pixels in the scanned image one by one based on a preset search path to acquire all character pixels and corresponding pixel position information of the characters;
setting the topmost pixel row as a current pixel row based on the acquired pixel position information;
respectively setting the character pixels positioned on the current pixel row as current pixels according to a preset sequence;
respectively judging whether the text pixel positioned right below the current pixel exists on the next pixel line of the current pixel line or not according to the pixel position information and each set current pixel;
when the judgment result is yes, judging that the included angle between the line formed by the current pixel and the character pixel positioned right below the current pixel and the transverse direction of the scanned image is 90 degrees, and recording the 90-degree included angle;
if not, calculating the inclined included angle between the straight line formed by the current pixel and each character pixel in the next pixel row and the transverse direction, and recording the inclined included angle;
judging whether each character pixel on the current pixel row has been recorded with a corresponding included angle;
once each text pixel on the current pixel row has been recorded with the corresponding included angle, judging whether the current pixel row is the penultimate pixel row or not based on the pixel position information;
setting the next pixel row as the current pixel row when the current pixel row is judged not to be the penultimate pixel row;
counting the occurrence frequency of each included angle when the current pixel row is judged to be the penultimate pixel row;
judging whether the frequency of the 90-degree included angle is smaller than the frequency of the inclined included angle, and judging that the scanned image is inclined when the judgment result is yes; and
when the scanned image is determined to be tilted, the tilt angle with the largest number of occurrences is set as a tilt angle for rectification, and the scanned image is rotationally rectified based on a predetermined rotational rectification rule according to the tilt angle for rectification, thereby obtaining a rectified image.
CN201610080494.8A 2016-02-04 2016-02-04 Image tilt correction device, image processing system, and image tilt correction method Active CN107038440B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610080494.8A CN107038440B (en) 2016-02-04 2016-02-04 Image tilt correction device, image processing system, and image tilt correction method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610080494.8A CN107038440B (en) 2016-02-04 2016-02-04 Image tilt correction device, image processing system, and image tilt correction method

Publications (2)

Publication Number Publication Date
CN107038440A CN107038440A (en) 2017-08-11
CN107038440B true CN107038440B (en) 2020-04-28

Family

ID=59532592

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610080494.8A Active CN107038440B (en) 2016-02-04 2016-02-04 Image tilt correction device, image processing system, and image tilt correction method

Country Status (1)

Country Link
CN (1) CN107038440B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110135217B (en) * 2018-02-02 2021-07-23 兴业数字金融服务(上海)股份有限公司 Method and apparatus for recognizing characters within a table in an image
TWI657410B (en) * 2018-03-05 2019-04-21 光寶電子(廣州)有限公司 Method and image processing system of image angle detection
CN108573473A (en) * 2018-04-27 2018-09-25 平安科技(深圳)有限公司 Picture rotation method, apparatus, computer equipment and storage medium
CN110378249B (en) * 2019-06-27 2024-01-12 腾讯科技(深圳)有限公司 Text image inclination angle recognition method, device and equipment
CN111079760B (en) * 2019-08-02 2023-11-28 广东小天才科技有限公司 Character recognition method and electronic equipment
CN111091505B (en) * 2019-11-26 2022-06-24 浙江大学 Photocopy image inclination correction method based on classical profile

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101420507A (en) * 2007-10-26 2009-04-29 村田机械株式会社 Image processing apparatus, image scanning apparatus, and image processing method
CN103714327A (en) * 2013-12-30 2014-04-09 上海合合信息科技发展有限公司 Method and system for correcting image direction

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1623164A (en) * 2002-09-30 2005-06-01 松下电器产业株式会社 Image correction device and image correction method
JP2012129743A (en) * 2010-12-14 2012-07-05 Nec Access Technica Ltd Image processing device, image processing method, and image processing program

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101420507A (en) * 2007-10-26 2009-04-29 村田机械株式会社 Image processing apparatus, image scanning apparatus, and image processing method
CN103714327A (en) * 2013-12-30 2014-04-09 上海合合信息科技发展有限公司 Method and system for correcting image direction

Also Published As

Publication number Publication date
CN107038440A (en) 2017-08-11

Similar Documents

Publication Publication Date Title
CN107038440B (en) Image tilt correction device, image processing system, and image tilt correction method
JP4919028B2 (en) Image processing apparatus and image processing program
US4204193A (en) Adaptive alignment for pattern recognition system
WO2018010547A1 (en) Image processing method, device, and image forming apparatus
EP2093994B1 (en) Electronic document producing device, electronic document producing method and storage medium
CN107992869A (en) For tilting the method, apparatus and electronic equipment of word correction
JP2008147976A (en) Image inclination correction device and image inclination correcting method
JP3876531B2 (en) Document image skew correction method
KR101513431B1 (en) Method for detecting boundary of image automatically, system and method for processing image using that
JP5768673B2 (en) Image processing apparatus and fusion image generation method
JP4487000B2 (en) Image processing apparatus, image forming apparatus, image processing method, image processing system, image processing program, and recording medium thereof
EP3786883A1 (en) Image storage method and apparatus, and electronic device and storage medium
US10321014B2 (en) Image reading apparatus and image forming apparatus, comprising at least a mode reception and a selection of at least a quality first mode or a speed first mode
US9268998B2 (en) Image determining apparatus, image processing system, and recording medium
US9886648B2 (en) Image processing device generating arranged image data representing arranged image in which images are arranged according to determined relative position
JPS58222382A (en) Correcting system for inclination of picture
JP2010186268A (en) Image processor, printer, image processing method and image processing program
KR101198769B1 (en) Image forming apparatus and control method thereof
JP5683387B2 (en) Image processing apparatus, image processing method, computer program, and recording medium
WO2017037136A1 (en) Method and system for correction of an image from a hand-held scanning device
US11853844B2 (en) Information processing apparatus, image orientation determination method, and medium
JP3084177B2 (en) Image data tilt correction device
TW201818296A (en) Image capture and correction method
JP4250828B2 (en) Character recognition device
JPH07134014A (en) Device for measuring magnification/angle of pattern

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