The content of the invention
In view of this, the embodiment of the present invention provides a kind of method and apparatus of tilted image correction, can be with less fortune
Calculation amount is corrected to tilted image exactly, and can interpolate that whether the image after correction is inverted, and then to inverted image
It is adjusted.
To achieve the above object, according to an aspect of the invention, there is provided a kind of method of tilted image correction.
The method of the tilted image correction of the embodiment of the present invention includes:Character in cutting image;From the character of cutting
Determine at least one feature string;Pass through at least one described feature string correction chart picture.
Alternatively, at least one described feature string is linear pattern character string.
Alternatively, the character in cutting image includes:Character in detection image, sets up according to the end points of the character of detection
Accommodate the character frame of the character.
Alternatively, determine that feature string includes from the character of cutting:Bebinning character is determined from the character frame of image
Frame;The character frame to be discriminated of default criterion is chosen in the bebinning character frame neighborhood and met, characteristic character is used as
Frame;Using obtained characteristic character frame successively as bebinning character frame, it is determined that in the bebinning character frame neighborhood and meeting default
The character frame to be discriminated of criterion is characterized character frame, until not new characteristic character frame is generated;By obtained all spies
Levy character frame composition characteristic character string.
Alternatively, default criterion is:The lateral separation of character frame to be discriminated and bebinning character frame is less than the first distance
Threshold value, and longitudinal center's distance of character frame to be discriminated and bebinning character frame is less than second distance threshold value;Or character to be discriminated
The fore-and-aft distance of frame and bebinning character frame is less than the 3rd distance threshold, and the transverse center of character frame to be discriminated and bebinning character frame
Distance is less than the 4th distance threshold.
Alternatively, methods described further comprises:Each Undulating angle of any feature character string is calculated, by any Undulating angle
Feature string less than predetermined angle threshold value is removed;Wherein, the Undulating angle is:In feature string in a character frame
The angle of heart point and the line of the central point of adjacent character frame.
Alternatively, if determining a feature string from the character of cutting, one feature string is passed through
Correction chart picture includes:The central point of the end points character frame of this feature character string is connected with straight line, the inclination angle conduct of the straight line is calculated
The inclination angle of this feature character string;Rotate image to realize correction according to the inclination angle.
Alternatively, if determining multiple feature strings from the character of cutting, the multiple feature string is passed through
Correction chart picture includes:For any feature character string, the central point of the end points character frame of this feature character string is connected with straight line, is counted
The inclination angle for calculating the straight line is used as the inclination angle of this feature character string;If the inclination angle of the multiple feature string is all in predetermined angle
Scope or not in predetermined angle scope, then calculate the average value at the inclination angle of the multiple feature string, according to described average
Value rotates image to realize correction.
Alternatively, methods described further comprises:In the multiple feature string, if Partial Feature character string
Inclination angle then counts inclination angle and not preset in the quantity of the feature string of predetermined angle scope, with inclination angle in predetermined angle scope
The quantity of the feature string of angular range, the less individual features character string of quantity is removed;For remaining characteristic character
String, calculates the average value at the inclination angle of each feature string, rotates image to realize correction according to the average value.
Alternatively, methods described further comprises:After correction chart picture, according to the image of the feature string after calibration
In position judgment described in correct after image whether be inverted:If so, by 180 ° of the image rotation.
To achieve the above object, there is provided a kind of device of tilted image correction according to another aspect of the present invention.
The device of the tilted image correction of the embodiment of the present invention includes:Cutting module, available for the character in cutting image;
Text string extracting module, available for determining at least one feature string from the character of cutting;Correction module, available for passing through
At least one described feature string correction chart picture.
Alternatively, cutting module includes:Detection module, available for the character in detection image;Character frame sets up module, can
End points for the character according to detection sets up the character frame for accommodating the character.
Alternatively, text string extracting module includes:Bebinning character frame determining module, available for true from the character frame of image
Determine bebinning character frame;Characteristic character frame chooses module, is preset available for choosing in the bebinning character frame neighborhood and meeting
The character frame to be discriminated of criterion, is used as characteristic character frame;Feature string generation module, available for by obtained tagged word
Frame is accorded with successively as bebinning character frame, it is determined that in the bebinning character frame neighborhood and meeting the to be discriminated of default criterion
Character frame is characterized character frame, until not new characteristic character frame is generated;By obtained all characteristic character frame composition characteristics
Character string.
Alternatively, correction module includes:Dip countion module, available for for any feature character string, is connected with straight line
The central point of the end points character frame of this feature character string, the inclination angle for calculating the straight line is used as the inclination angle of this feature character string;First
Correction module, available for when it is determined that feature string for it is multiple when, if it is determined that the inclination angle of multiple feature strings is all pre-
If angular range or not in predetermined angle scope, then the average value at the inclination angle of the multiple feature string is calculated, according to institute
Average value rotation image is stated to realize correction;Second correction module, available for when it is determined that feature string for it is multiple when, if
Judge that the inclination angle of Partial Feature character string in multiple feature strings in predetermined angle scope, then counts inclination angle in predetermined angle
The quantity of the feature string of scope, with inclination angle not predetermined angle scope feature string quantity, quantity is less
Individual features character string is removed;And for remaining feature string, the average value at the inclination angle of each feature string is calculated, according to
The average value rotates image to realize correction;3rd correction module, available for when it is determined that feature string be one when, root
Rotate image to realize correction according to the inclination angle of this feature character string.
Alternatively, described device further comprises:Adjusting module is inverted, is being corrected available for according to the feature string
Whether the image after being corrected described in the position judgment in image afterwards is inverted:If so, by 180 ° of the image rotation
To achieve the above object, there is provided a kind of electronic equipment in accordance with a further aspect of the present invention.
The a kind of electronic equipment of the present invention includes:One or more processors;Storage device, it is one or more for storing
Program, when one or more of programs are by one or more of computing devices so that one or more of processors
The method for realizing tilted image correction provided by the present invention.
To achieve the above object, there is provided a kind of computer-readable recording medium in accordance with a further aspect of the present invention.
A kind of computer-readable recording medium of the present invention, is stored thereon with computer program, described program is by processor
The method that tilted image correction provided by the present invention is realized during execution.
One embodiment in technique according to the invention scheme, foregoing invention has the following advantages that or beneficial effect:It is logical
Cross and character frame is set for the character of cutting, feature string is determined using the adjacent position relation of character frame, according to characteristic character
String determines that angle of inclination, to rotate image, so as to realize the precise calibration of tilted image with less operand, is greatly improved
The correction efficiency of tilted image, and follow-up identification for character in image provides basis, solves prior art correction calculation
The problem of amount is big, correction efficiency is low;It is corrected due to extracting the character feature of image, it is not necessary to extract image outline, from
And the problem of solve that prior art interfering line is more, profile can not be extracted under strong noise background;Pass through judging characteristic character string
The position in image after calibration comes whether detection image is inverted, and then Inverted Image is adjusted, so as to overcome existing
There is the defect that technology can not be handled Inverted Image.
The further effect that above-mentioned non-usual optional mode has adds hereinafter in conjunction with embodiment
With explanation.
Embodiment
The one exemplary embodiment of the present invention is explained below in conjunction with accompanying drawing, including the various of the embodiment of the present invention
Details should think them only exemplary to help understanding.Therefore, those of ordinary skill in the art should recognize
Arrive, various changes and modifications can be made to the embodiments described herein, without departing from scope and spirit of the present invention.Together
Sample, for clarity and conciseness, eliminates the description to known function and structure in following description.
The technical scheme of embodiments of the invention utilizes the adjacent bit of character frame by setting character frame for the character of cutting
The relation of putting determines feature string, and angle of inclination is determined to rotate image according to feature string, so that with less operand
The precise calibration of tilted image is realized, the correction efficiency of tilted image greatly improved, and be the follow-up knowledge of character in image
Indescribably for basis, the problem of prior art correction calculation amount is big, correction efficiency is low is solved;By the character feature for extracting image
To be corrected, it is not necessary to extract image outline, so as to solve that prior art interfering line is more, can not carry under strong noise background
The problem of contouring;Whether it is inverted come detection image by the position in the image of judging characteristic character string after calibration, and then
Inverted Image is adjusted, so as to overcome the defect that prior art can not be handled Inverted Image.
Fig. 2 is the schematic diagram of the key step of the method for tilted image correction according to embodiments of the present invention.
As shown in Fig. 2 the method for the tilted image correction of the embodiment of the present invention mainly comprises the following steps:
Step S1:Character in cutting image.The purpose of this step is:The character in image is extracted, and utilizes character
Frame carries out cutting to character.
In embodiments of the present invention, before step S1, using the center of image as origin, using target direction as X-direction,
Set up plane right-angle coordinate.Above-mentioned target direction can be the signified direction of characteristic curve in the image after desired correction,
Characteristic curve is specially the straight line with orientation in image, for example:For ID Card Image, the following institute of its rectangular profile
Straight line or through " straight line of character center can serve as characteristic curve in citizenship number xxxxxxxxxx ".In this hair
In bright embodiment, when rotation image makes the characteristic curve in image be in target direction, illustrate that image is in correcting state.
It is preferred that in embodiments of the present invention, step S1 can include:Character in detection image, according to the word of detection
The end points of symbol sets up the character frame for accommodating character.The end points of character refers to two maximum, minimum pixels of the abscissa of character
Two maximum, minimum pixels of the ordinate of point and character, rectangle character frame is built based on four end points in X, Y-direction
It may include whole pixels of the character, that is, accommodate the character.
In concrete application, it is possible to use MSER (Maximally Stable Extremal Regions, maximum stable pole
Value region) algorithm realizes the cutting of character, MSER algorithms can pass through OpenCv (Open Source Computer Vision
Library, computer vision algorithms make of increasing income storehouse) CvExtractMSER functions realize.Before MSER algorithm process images,
Gray proces are carried out firstly the need of to image.MSER algorithms are comprised the following steps that:
1. binary conversion treatment is carried out to image using different gray thresholds.
2. the binary image obtained for each threshold value, obtains corresponding black region and white portion.
3. the region for keeping dimensionally stable, as maximum stable extremal region are extracted in default gray threshold.
4. extracting minimum and maximum value x1, x2, y1, y2 of all pixels point transverse and longitudinal coordinate in the same area, combination is obtained
Four coordinate points (x1, y1), (x1, y2), (x2, y1), (x2, y2).
5. four coordinate points using in step 4 is four angles of rectangle, all pixels point in the same area this four
The rectangle character inframe that individual point is surrounded.
Fig. 3 is that the character frame of the method for tilted image correction according to embodiments of the present invention sets up schematic diagram, above-mentioned steps
4th, 5 it for details, reference can be made to Fig. 3.
Step S2:At least one feature string is determined from the character of cutting.The purpose of this step is:Based on cutting
Character and character frame, extracting feature string is used to determine the angle of inclination of image.
In embodiments of the present invention, feature string is made up of multiple characters, and each character is corresponding with character frame, because
This is it is also assumed that feature string is made up of character frame corresponding with above-mentioned character.In concrete application, feature string is straight
Line style character string, i.e., by character string that is adjacent, being constituted along multiple characters arranged in a straight line, being arranged in a linear to be:Character
The arrangement of each character frame central point meets default rule arranged in a straight line in string, and rule arranged in a straight line can be clever according to actual needs
It is living to set.
It should be noted that being by extracting feature string from tilted image simultaneously in an embodiment of the present invention
The inclination angle of feature string is calculated, referring concurrently to fixed position of the character string in such image of this content, is inclined to obtain
The angle of inclination of skewing scheme picture.Therefore, the present invention can to the image of character string as characterized above for example identity card, driver's license,
License plate number etc. is corrected.For example:When being corrected for ID Card Image, the character string that can extract identity card bottom is " public
People identification number xxxxxxxx " calculates its tilt angles as feature string.Due to the character string and the characteristic curve of identity card
In the same direction, therefore ID Card Image can be rotated to above-mentioned tilt angles realize correction.
In embodiments of the present invention, step S2 can be performed according to the following steps:
Step S21:Bebinning character frame is determined from the character frame of image.
It is preferred that it is determined that before bebinning character frame, grid chart can be set up and rower is entered in the position to each character frame
Note.
Fig. 4 is that the grid of the method for tilted image correction according to embodiments of the present invention builds schematic diagram.
As shown in figure 4, tilted image is by " Shandong MBD726 " is constituted with " vehicle " two parts.First can be according to pre-determined distance
Grid is set up, for example, is averaged using 1.5 times of all character frame length average values as the length of grid, with all character width of frame
1.5 times of value set up grid as mesh width.
Set up after grid, each character frame can be numbered, and mark the position of each character frame within a grid.
Wherein:The position of each character frame within a grid refers to the position of the central point of each character frame within a grid.
For example:Character " Shandong ", " M ", " B ", " D ", " 7 ", " 2 ", " 6 ", " car ", " " number consecutively can be 0-8, and tied
Close its position within a grid generate following array a [n]=(4,3,0), (4,4,0), (4,4,0), (4,4,0), (4,5,0),
(3,5,0), (3,6,0), (3,6,0), (3,6,0) }.Wherein, the first two numeral of each single item represents word in n values 0-8, array
Frame central point which row, which row within a grid are accorded with, third digit represents the processing state of character frame, and o is untreated, and 1 is
It is processed.
In above-mentioned steps, enter line character collimation mark note by setting up grid, can quickly limit the region model for needing to judge
Enclose, it is only necessary to which whether have legal adjacent character frame, so as to avoid if judging that a certain character frame is interior at the regional level
The process judged in overall scope all other character frame, thus considerably enhances correction efficiency.
In embodiments of the present invention, any character frame in image can be chosen as bebinning character frame, for example:Choose Fig. 4
In " Shandong " as bebinning character frame to extract feature string.
Step S22:The character frame to be discriminated of default criterion is chosen in bebinning character frame neighborhood and meets, as
Characteristic character frame.Wherein:Neighborhood is referred in the adjacent area of bebinning character frame, practical application, and neck can be set according to demand
Domain scope.For example:Can be by using bebinning character frame central point as the center of circle, the circle inner region by radius of preset length is used as neck
Domain.In Fig. 4, if " Shandong " be bebinning character frame, can be with the grid residing for it, adjacent grid nine grids (4,3),
(3,2), (3,3), (3,4), (4,2), (4,4), (5,2), (5,3), (5,4) are its neighborhood.Usually, character frame to be discriminated is
Untreated character frame, characteristic character frame is processed character frame.
In embodiments of the present invention, default criterion can be any in following two condition:
Condition 1:The lateral separation of character frame to be discriminated and bebinning character frame is less than the first distance threshold, while word to be discriminated
The longitudinal center's distance for according with frame and bebinning character frame is less than second distance threshold value.Lateral separation refers to that two character frames connect the most
The distance of near vertical edge, longitudinal center's distance refers to the fore-and-aft distance of two character frame central points, the first distance threshold and
Two distance thresholds can determine according to specific environment, for example:First distance threshold, second distance threshold value can be set to two words
Accord with the 25% of the length of the most short vertical edge of frame.
Condition 2:The fore-and-aft distance of character frame to be discriminated and bebinning character frame is less than the 3rd distance threshold, while word to be discriminated
The transverse center distance for according with frame and bebinning character frame is less than the 4th distance threshold.
Fore-and-aft distance refers to the distance of the closest horizontal edge of two character frames, and transverse center distance refers to two words
The lateral separation of frame central point is accorded with, the 3rd distance threshold can be determined with the 4th distance threshold according to specific environment, for example:3rd away from
The 25% of two character frames most length on hyphen side can be set to from threshold value, the 4th distance threshold.
In Fig. 4, if using " Shandong " character frame as bebinning character frame, judge " Shandong ", " M " in its nine grids,
Whether " B ", " D " meet default criterion, if it is determined that " M " meets criterion, " B ", " D " are unsatisfactory for criterion, then
" Shandong ", " M " character collimation mark are designated as " processed ", characteristic character frame is used as.
Step S23:Using obtained characteristic character frame successively as bebinning character frame, it is determined that in the bebinning character frame neighborhood
Character frame to be discriminated that is interior and meeting default criterion is characterized character frame, until not new characteristic character frame is generated;Will
Obtained all characteristic character frame composition characteristic character strings.
Specifically, in step S23, using characteristic character frame as bebinning character frame, step S22, S23 is constantly performed;When
When there is no new characteristic character frame generation, by obtained all characteristic character frame composition characteristic character strings.The purpose of this step exists
In:Determine all adjacent character frames for meeting criterion, composition characteristic character string.
In Fig. 4, " M " character frame has been characteristic character frame, then as bebinning character frame, is judged in its nine grids
Whether character frame " B " to be discriminated, " D ", " 7 ", " 2 " meet default criterion.If " B " is met, remaining three is unsatisfactory for, then
By " B " as characteristic character frame, and " B " is performed into step S22, S23 as bebinning character frame.So, until it is determined that from " Shandong "
All characteristic character frames that character frame is obtained, these characteristic character frame composition characteristic character strings " Shandong MBD726 ".
Step S24:If also there is character frame to be discriminated in image, any character frame to be discriminated is defined as banner word
Frame is accorded with, step S22, S23, S24 are performed successively;Thus feature strings all in image are obtained.
It is preferred that in embodiments of the present invention, bebinning character frame, executed can be determined according to the number order of character frame
The character frame to be discriminated for crossing step S24 is not repeated to perform.
For example:In Fig. 4, it is determined that feature string " after the MBD726 " of Shandong, judges that " car " " " is untreated, then with " car "
Or " " is bebinning character frame, repeat step S21-S23 determines feature string " vehicle ".
Fig. 5 is the feature string generation schematic diagram of the method for tilted image correction according to embodiments of the present invention, such as Fig. 5
Shown, " Shandong MBD726 ", " vehicle " are determined two feature strings in image.
By step S2, the method for the tilted image correction of the embodiment of the present invention can extract the tagged word in tilted image
Correction of the symbol string for image.
Step S3:Pass through feature string correction chart picture.The purpose of this step is to obtain image by feature string
Angle of inclination, rotate image to realize the correction of image according to angle of inclination.
In embodiments of the present invention, step S3 can be performed according to following steps:
Step S31:Each Undulating angle of any feature character string is calculated, any one Undulating angle is less than predetermined angle threshold
The feature string of value is removed.Wherein, Undulating angle is specially:The central point and adjacent character of a character frame in feature string
The angle of the line of the central point of frame.
Fig. 6 is the Undulating angle generation schematic diagram of the method for tilted image correction according to embodiments of the present invention.
As shown in fig. 6, Undulating angle can be obtained by the following method:According to character frame central point abscissa in feature string
Or the ascending order of ordinate, successively with straight line concatenation character frame central point, the angle between line less than 180 ° has been
Fu Jiao.Predetermined angle threshold value can be configured according to application environment, for example, could be arranged to 150 °.Typically, for transverse direction
The feature string of arrangement, it is possible to use the ascending sequential configuration straight line formation Undulating angle of abscissa, for longitudinal arrangement
Feature string, it is possible to use ordinate it is ascending sequential configuration straight line formation Undulating angle.It is transversely arranged to be arranged with longitudinal direction
The implication of row will be introduced specifically below.
The purpose of this step is:By the Undulating angle of judging characteristic character string, by big rise and fall, calibration result is influenceed
Feature string is removed, to improve image rectification quality.
Step S32:For any feature character string, the center of the end points character frame of this feature character string is connected with straight line
Point, the inclination angle for calculating the straight line is used as the inclination angle of this feature character string.The purpose of this step is to calculate each feature string
Inclination angle, the inclination angle of comprehensive characteristics character string can obtain the angle of inclination of image.Above-mentioned inclination angle is specially straight slope correspondence
Angle, i.e., from X-axis positive direction originate, rotate in the counterclockwise direction to the straight line formation angle.End points character frame is referred to
Center point coordinate is two character frames being most worth in each character frame center point coordinate in feature string.
Step S33:If it is determined that feature string be 1, then according to the inclination angle of the feature string rotate image
To realize correction.
In embodiments of the present invention, the angle of inclination that inclination angle always calculates image with target side can be combined.Due at this
In inventive embodiments, target direction is X-direction, then tilt angles are the angle of inclination of image, and then image rotation inclines
Angle angle is that correction can be achieved.
Step S34:When it is determined that feature string for it is multiple when, if it is determined that the inclination angle of feature string is all in preset angle
Spend scope or not in predetermined angle scope, then the average value at the inclination angle of each feature string is calculated, according to the average value at inclination angle
Image is rotated to realize correction.
Wherein, predetermined angle scope can be configured according to the actual requirements, for example, be set to (- 45 °, 45 °).In step
In S34, if it is determined that whether feature string is all in predetermined angle scope or all in predetermined angle scope, then
Think that the arrangement mode of each feature string is similar, then the average value for calculating the inclination angle of each feature string is corrected.
In embodiments of the present invention, the average value and target direction at inclination angle can be combined, the angle of inclination of image is calculated.By
In in embodiments of the present invention, target direction is X-direction, then the average value at inclination angle is the angle of inclination of image, then will
The average value at image rotation inclination angle is that correction can be achieved.
Step S35:When it is determined that feature string for it is multiple when, if it is determined that the part in the multiple feature string
The inclination angle of feature string counted in predetermined angle scope, then inclination angle the feature string of predetermined angle scope quantity, with
Inclination angle not predetermined angle scope feature string quantity, the less individual features character string of quantity is removed.
In practical application, in addition to it can extract out the feature string corresponding with true character in image, from image
It also can extract out the feature string being made up of noise.Feature strings that these are made up of noise are with corresponding to true character
Character string direction differs greatly, and quantity is smaller.Step S35 can tackle above-mentioned situation.In step s 35, spy is first determined whether
Levy whether character string is in predetermined angle scope, so that feature string is divided into two groups;Compare two groups of features included afterwards
Character string quantity, by quantity, less one group is defined as the character string that noise is constituted, and removes it.
Step S36:For remaining feature string, the average value at the inclination angle of each feature string is calculated, it is flat according to this
Average rotates image to realize correction.In step S36, for removing the feature string after noise, the flat of its inclination angle is calculated
Average is with correction chart picture.
In embodiments of the present invention, step S3 can also be performed according to following steps:
Step S37:The character frame central point of abscissa minimum and maximum in connection features character string, calculates central point connection
Straight line expression formula y=ax+b of the line in plane right-angle coordinate.Judge a value whether between -1 to 1:If so, then true
It is transversely arranged to determine this feature character string;Otherwise, it is determined that this feature character string is longitudinal arrangement.
Step S38:It is ascending according to wherein character frame central point abscissa for transversely arranged feature string
Order uses straight line concatenation character frame central point successively, forms Undulating angle;For the feature string of longitudinal arrangement, according to wherein word
Accord with the ascending order of frame central point ordinate and use straight line concatenation character frame central point successively, form Undulating angle.By any
The feature string that Fu Jiao is less than predetermined angle threshold value is removed.
Step S39:Judge remaining feature string whether all for transversely arranged or longitudinal arrangement:If so, calculating feature
The average value at the inclination angle of character string is with correction chart picture;Otherwise, the feature of the transversely arranged feature string of removal and longitudinal arrangement
Less one group of quantity in two groups of character string, calculates the average value at inclination angle of remaining feature string with correction chart picture.Wherein,
The inclination angle of feature string is the angle of the central point line of the end points character frame of this feature character string.For transversely arranged spy
Levy character string:The maximum character frame with minimum of abscissa is put centered on two end points character frame;For the feature of longitudinal arrangement
Character string:The maximum character frame with minimum of ordinate is put centered on two end points character frame.
It is preferred that after correction chart picture, whether the method for the tilted image correction of the embodiment of the present invention can interpolate that image
It is inverted.If be inverted, 180 ° of inversion corrections for realizing image are rotated.Specifically, in embodiments of the present invention, it is inverted and judges
Process it is as follows:
1. determine the position in image of the corresponding character string of compensation line in reality.For example:Corresponding " the citizen of compensation line
Identification number xxxxxxxx " is in the lower section of identity card.
2. determine position of the character string in image to be judged.
3. carry out inversion judgement:If above-mentioned two position is identical, it is not inverted;Otherwise it is to be inverted.For example:If treated
Judge that the above-mentioned character string in image judges image for inversion above image, then;If in lower section, being judged as not falling
Put.
If next, image is not inverted, do not processed to it.If image inversion, it is rotated around picture centre
180 ° obtain final image.
The method of tilted image correction according to embodiments of the present invention can be seen that to be set because employing for the character of cutting
Character frame is put, feature string is determined using the adjacent position relation of character frame, angle of inclination is determined according to feature string
Technological means, so the precise calibration of tilted image can be realized with less operand, can greatly improve tilted image
Correct efficiency, and follow-up identification for character in image provides basis, can solve the problem that prior art correction calculation amount greatly, correct and imitate
The problem of rate is low;It is corrected due to extracting the character feature of image, it is not necessary to image outline is extracted, so solving existing
Technology interfering line is more, the problem of can not extract profile under strong noise background;Pass through the figure of judging characteristic character string after calibration
Position as in comes whether detection image is inverted, and then Inverted Image is adjusted, can not be right so as to overcome prior art
The defect that Inverted Image is handled.
Fig. 7 is the schematic diagram of the major part of the device of tilted image correction according to embodiments of the present invention.
As shown in fig. 7, the device 70 of the tilted image correction of the embodiment of the present invention mainly may include:Cutting module 701, word
Symbol string extraction module 702, correction module 703.Wherein:
The character that cutting module 701 can be used in cutting image.
Text string extracting module 702 can be used for determining at least one feature string from the character of cutting.
Correction module 703 can be used for by least one described feature string correction chart picture.
It is preferred that cutting module 701 may include that detection module sets up module with character frame.Wherein:
The character that detection module can be used in detection image.
Character frame sets up module and can be used for setting up the character frame for accommodating the character according to the end points of the character of detection.
As an alternative, text string extracting module 702 may include bebinning character frame determining module, characteristic character frame
Choose module and feature string generation module.Wherein:
Bebinning character frame determining module can be used for determining bebinning character frame from the character frame of image.
Characteristic character frame chooses module and can be used for selection in the bebinning character frame neighborhood and meet default differentiation bar
The character frame to be discriminated of part, is used as characteristic character frame.
Feature string generation module can be used for the characteristic character frame that will be obtained successively as bebinning character frame, it is determined that in institute
The character frame to be discriminated stated in bebinning character frame neighborhood and meet default criterion is characterized character frame, until not new
Characteristic character frame is generated;By obtained all characteristic character frame composition characteristic character strings.
In embodiments of the present invention, correction module 703 may include:Dip countion module, the first correction module, the second correction
Module and the 3rd correction module.Wherein:
Dip countion module can be used for being directed to any feature character string, and the end points character of this feature character string is connected with straight line
The central point of frame, the inclination angle for calculating the straight line is used as the inclination angle of this feature character string.
First correction module can be used for when it is determined that feature string for it is multiple when, if it is determined that multiple feature strings
Inclination angle then calculates the average value at the inclination angle of each feature string, root all in predetermined angle scope or not in predetermined angle scope
Rotate image to realize correction according to the average value.
Second correction module can be used for when it is determined that feature string for it is multiple when, if it is determined that in multiple feature strings
The inclination angle of Partial Feature character string number of the inclination angle in the feature string of predetermined angle scope is counted in predetermined angle scope, then
Amount, with inclination angle not predetermined angle scope feature string quantity, the less individual features character string of quantity is removed;And
For remaining feature string, calculate the average value at the inclination angle of each feature string, according to the average value rotate image with
Realize correction.
3rd correction module, for when it is determined that feature string be one when, according to the inclination angle of this feature character string revolve
Turn image to realize correction.
In addition, the device 70 of the tilted image correction of the embodiment of the present invention further comprises being inverted adjusting module, it can be used for
Whether the image after being corrected described in the position judgment in the image of the feature string after calibration is inverted:If so, will
180 ° of the image rotation.
It should be noted that the device 70 of the tilted image correction of the embodiment of the present invention can be arranged on and calculate as software
In the equipment such as machine, mobile terminal.
From the above, it can be seen that setting character frame because employing for the character of cutting, the adjacent of character frame is utilized
Position relationship determines feature string, and the technological means at angle of inclination is determined according to feature string, so can be with less
Operand realizes the precise calibration of tilted image, can greatly improve the correction efficiency of tilted image, and be character in image
Follow-up identification provides basis, can solve the problem that the problem of prior art correction calculation amount is big, correction efficiency is low;Due to extracting image
Character feature is corrected, it is not necessary to extract image outline, so solving, prior art interfering line is more, strong noise background
Under the problem of can not extract profile;Whether fallen come detection image by the position in the image of judging characteristic character string after calibration
Put, and then Inverted Image is adjusted, so as to overcome the defect that prior art can not be handled Inverted Image.
According to embodiment disclosed by the invention, present invention also offers a kind of electronic equipment.
The electronic equipment of the embodiment of the present invention includes:One or more processors;Storage device, for storing one or many
Individual program, when one or more of programs are by one or more of computing devices so that one or more of processing
The method that device realizes tilted image correction provided by the present invention.
Below with reference to Fig. 8, it illustrates suitable for for the computer system 800 for the electronic equipment for realizing the embodiment of the present invention
Structural representation.Electronic equipment shown in Fig. 8 is only an example, to the function of the embodiment of the present invention and should not use model
Shroud carrys out any limitation.
As shown in figure 8, computer system 800 includes CPU (CPU) 801, it can be read-only according to being stored in
Program in memory (ROM) 802 or be loaded into program in random access storage device (RAM) 803 from storage part 808 and
Perform various appropriate actions and processing.In RAM803, the computer system that is also stored with 800 operate required various programs and
Data.CPU801, ROM 802 and RAM 803 are connected with each other by bus 804.Input/output (I/O) interface 805 is also connected
To bus 804.
I/O interfaces 805 are connected to lower component:Importation 806 including keyboard, mouse etc.;Penetrated including such as negative electrode
The output par, c 807 of spool (CRT), liquid crystal display (LCD) etc. and loudspeaker etc.;Storage part 808 including hard disk etc.;
And the communications portion 809 of the NIC including LAN card, modem etc..Communications portion 809 via such as because
The network of spy's net performs communication process.Driver 810 is also according to needing to be connected to I/O interfaces 805.Detachable media 811, such as
Disk, CD, magneto-optic disk, semiconductor memory etc., are arranged on driver 810, so as to what is read from it as needed
Computer program is mounted into storage part 808 as needed.
Especially, according to embodiment disclosed by the invention, the process of key step figure description above may be implemented as
Computer software programs.For example, the embodiment of the present invention includes a kind of computer program product, it includes being carried on computer-readable
Computer program on medium, the computer program includes the program code for being used for performing the method shown in key step figure.
In above-described embodiment, the computer program can be downloaded and installed by communications portion 809 from network, and/or from removable
Medium 811 is unloaded to be mounted.When the computer program is performed by CPU 801, perform in the system of the present invention and limit
Above-mentioned functions.
It should be noted that the computer-readable medium shown in the present invention can be computer-readable signal media or meter
Calculation machine readable storage medium storing program for executing either the two any combination.Computer-readable recording medium for example can be --- but not
Be limited to --- electricity, magnetic, optical, electromagnetic, system, device or the device of infrared ray or semiconductor, or it is any more than combination.Meter
The more specifically example of calculation machine readable storage medium storing program for executing can include but is not limited to:Electrical connection with one or more wires, just
Take formula computer disk, hard disk, random access storage device (RAM), read-only storage (ROM), erasable type and may be programmed read-only storage
Device (EPROM or flash memory), optical fiber, portable compact disc read-only storage (CD-ROM), light storage device, magnetic memory device,
Or above-mentioned any appropriate combination.In the present invention, computer-readable recording medium can any include or store journey
The tangible medium of sequence, the program can be commanded execution system, device or device and use or in connection.In this hair
In bright, computer-readable signal media can be included in a base band or as the data-signal of carrier wave part propagation, wherein
Carry computer-readable program code.The data-signal of this propagation can take various forms, and include but is not limited to electricity
Magnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be computer-readable storage medium
Any computer-readable medium beyond matter, the computer-readable medium can be sent, propagated or be transmitted for being held by instruction
Row system, device or device are used or program in connection.The program code included on computer-readable medium
It can be transmitted, included but is not limited to any appropriate medium:Wirelessly, electric wire, optical cable, RF etc., or above-mentioned any conjunction
Suitable combination.
Flow chart and block diagram in accompanying drawing, it is illustrated that according to the system of various embodiments of the invention, method and computer journey
Architectural framework in the cards, function and the operation of sequence product.At this point, each square frame in flow chart or block diagram can generation
The part of one module of table, program segment or code, a part for above-mentioned module, program segment or code is comprising one or more
Executable instruction for realizing defined logic function.It should also be noted that in some realizations as replacement, institute in square frame
The function of mark can also be with different from the order marked in accompanying drawing generation.For example, two square frames succeedingly represented are actual
On can perform substantially in parallel, they can also be performed in the opposite order sometimes, depending on this is according to involved function.
It should be noted that the combination of each square frame in block diagram or flow chart and the square frame in block diagram or flow chart, can use execution
Defined function or the special hardware based system of operation realize, or can use specialized hardware and computer instruction
Combine to realize.
Being described in unit involved in the embodiment of the present invention can be realized by way of software, can also be by hard
The mode of part is realized.Described unit can also be set within a processor, for example, can be described as:A kind of processor bag
Include transmitting element, acquiring unit, determining unit and first processing units.Wherein, the title of these units is under certain conditions simultaneously
The restriction in itself to the unit is not constituted, for example, transmitting element is also described as " sending picture to the service end connected
Obtain the unit of request ".
As on the other hand, present invention also offers a kind of computer-readable medium, the computer-readable medium can be
Included in equipment described in above-described embodiment;Can also be individualism, and without be incorporated the equipment in.Above-mentioned meter
Calculation machine computer-readable recording medium carries one or more program, when said one or multiple programs are performed by the equipment so that
The step of equipment is performed includes:Character in cutting image;At least one feature string is determined from the character of cutting;It is logical
Cross at least one described feature string correction chart picture.
Technical scheme according to embodiments of the present invention, by setting character frame for the character of cutting, utilizes the phase of character frame
Adjacent position relationship determines feature string, and angle of inclination is determined to rotate image according to feature string, so that with less fortune
Calculation amount realizes the precise calibration of tilted image, greatly improved the correction efficiency of tilted image, and for character in image after
Continuous identification provides basis, solves the problem of prior art correction calculation amount is big, correction efficiency is low;Due to extracting the character of image
Feature is corrected, it is not necessary to extract image outline, thus solve that prior art interfering line is more, nothing under strong noise background
The problem of method extracts profile;Whether it is inverted come detection image by the position in the image of judging characteristic character string after calibration,
And then Inverted Image is adjusted, so as to overcome the defect that prior art can not be handled Inverted Image.
Above-mentioned embodiment, does not constitute limiting the scope of the invention.Those skilled in the art should be bright
It is white, depending on design requirement and other factors, can occur various modifications, combination, sub-portfolio and replacement.It is any
Modifications, equivalent substitutions and improvements made within the spirit and principles in the present invention etc., should be included in the scope of the present invention
Within.