Summary of the invention
The shortcoming of prior art in view of the above, the object of the present invention is to provide a kind of correcting direction of image method and system, be used for solving prior art when image direction is incorrect, quick and precisely correcting image direction, and the problem that the disconnected sense of rotation of erroneous judgement can occur in the process of correcting image direction.
For achieving the above object and other relevant objects, one aspect of the present invention provides a kind of correcting direction of image method, comprising: the raw image data that pre-service reads, judge and bar code in pretreated image, whether detected, if, angle centered by the orientation angle of bar code, in a rotation angle range, every a default anglec of rotation, rotate an image, detect in the rear image of rotation and whether have word, if, identify word, and calculate and to rotate each time corresponding word degree of confidence after the anglec of rotation, and judge whether that existence is greater than the word degree of confidence of a predetermined threshold value, if do not exist, image direction is without correction, if exist, select image rotation angle corresponding to high confidence level, according to its correcting image direction, if not, the orientation angle of selector bar shape code, according to bar code orientation angle correcting image direction, if not, in comprehensive scope, every another default anglec of rotation, rotate an image, detect and whether have word, if, identify word, and calculate and to rotate each time corresponding word degree of confidence after another anglec of rotation, judge whether to have the word degree of confidence that is greater than a predetermined threshold value, if do not exist, image direction is without correction, if exist, select image rotation angle corresponding to high confidence level, according to its correcting image direction, if not, image direction without correction.
Preferably, judge and bar code in pretreated image, whether detected, judge and bar code in pretreated image, whether detected, if not, by [0 °, 360 °] be arranged to some sub-ranges, in each sub-range, select the another anglec of rotation, every an another anglec of rotation rotation pretreatment image, and detect and whether have word in postrotational image, if, identify word, and calculate and to rotate each time corresponding word degree of confidence after the another anglec of rotation, and judge whether that existence is greater than the word degree of confidence of a predetermined threshold value, if do not exist, image direction is without correction, if exist, select image rotation angle corresponding to high confidence level, according to its correcting image direction, if not, image direction without correction.
Preferably, described correcting direction of image method also comprises and judges whether only to exist in pretreated image a bar code, if, angle centered by the orientation angle of bar code, in a rotation angle range, every a default anglec of rotation, rotate an image, detect in the rear image of rotation and whether have word, if, identify word, and calculate and to rotate each time corresponding word degree of confidence after the anglec of rotation, and judge whether that existence is greater than the word degree of confidence of a predetermined threshold value, if do not exist, image direction is without correction, if exist, select image rotation angle corresponding to high confidence level, according to its correcting image direction, if not, the orientation angle of selector bar shape code, according to bar code orientation angle correcting image direction, if not, angle centered by the orientation angle of each bar code respectively, in a rotation angle range corresponding to each bar code, every a default anglec of rotation, rotate an image respectively, detect in the rear image of rotation and whether have word, if, identify word, and calculate and to rotate each time corresponding word degree of confidence after the anglec of rotation, and judge whether that existence is greater than the word degree of confidence of a predetermined threshold value, if do not exist, image direction is without correction, if exist, select image rotation angle corresponding to high confidence level, according to its correcting image direction, if not, select the orientation angle of arbitrary bar code, according to bar code orientation angle correcting image direction.
Preferably, described rotation angle range is [center angle-i, center angle+i], and wherein, described i is greater than 0 degree, is less than or equal to 10 degree; The described anglec of rotation is greater than 0 degree, is less than 10 degree.
Preferably, judge that the step that bar code whether detected in pretreated image comprises: the arbitrary pixel column after scanning pre-service in image; Described pixel column is done to pixels statistics, add up black and white pixel continuous in described pixel column, the ratio sequence that calculating pixel is capable; The finger URL of the described ratio sequence calculating and pre-stored all kinds of bar codes is compared, if ratio is identical, represent to detect corresponding bar code; If ratio is not identical, represent not detect bar code, continue to carry out next step; Rotate described image, return to scanning step and continue to detect.
The present invention also provides a kind of correcting direction of image system on the other hand, comprising: barcode detection module is for detection of whether there being bar code in pretreated image; Bar code orientation angle determination module, be connected with described barcode detection module, for obtaining the orientation angle of the bar code that described barcode detection module detects, obtain after the orientation angle of bar code, angle centered by orientation angle, sets the rotation angle range corresponding with bar code; The described bar code orientation angle determination module anglec of rotation that prestores; Rotary module, is connected with described bar code orientation angle determination module, for when detecting while there is bar code in rotation angle range every an image of a default anglec of rotation rotation; Described rotary module, also for when bar code not detected, rotates an image every another default anglec of rotation within the scope of full method 360 degree.Text detection module, is connected with described rotary module, for detection of whether there being word in the image rotating each time after the anglec of rotation; Word identification module, is connected with described text detection module, and while there is word for detecting when described text detection module the image rotating each time after the anglec of rotation, existing word in the image after anglec of rotation degree is rotated in identification each time; Computing module, is connected with described word identification module, for calculating and obtain and rotating each time corresponding word degree of confidence after the anglec of rotation; Comparison module, be connected with described computing module, for judge rotate each time the anglec of rotation after corresponding word degree of confidence whether there is the word degree of confidence that is greater than a predetermined threshold value, if not, after representing to rotate each time the anglec of rotation, corresponding word degree of confidence is not high, and image direction is without correction; If so, select the word degree of confidence image rotation angle of high correspondence, according to its correcting image direction.
Preferably, described corrective system also comprises image correction module, and described image correction module is connected with described comparison module, for according to described image rectification angularity correction image direction.
Preferably, described rotary module is also for pre-stored another anglec of rotation and the another anglec of rotation, be used for when described barcode detection module is not when pretreated image detects bar code, within the scope of comprehensive 360 degree, every another anglec of rotation, pretreated image is rotated, wherein, another anglec of rotation is greater than 10 degree, is less than 30 degree; Or [0 °, 360 °] is arranged to some sub-ranges, in each sub-range, adopts another anglec of rotation, every an another anglec of rotation, pretreated image is rotated.
Preferably, described corrective system also comprises for reading the image reading module of raw image data, and the pretreatment image module of view data described in pre-service.
Preferably, described bar code detecting module comprises: scanning element, for scanning arbitrary pixel column of image after pre-service; Arithmetic element, is connected with described scanning element, for adding up described pixel column, adds up black and white pixel continuous in described pixel column, the ratio sequence that calculating pixel is capable; Comparing unit, is connected with described arithmetic element, for the described ratio sequence calculating and the finger URL of pre-stored wherein each class bar code are compared, if ratio is identical, represents to detect corresponding bar code; If ratio is not identical, represent not detect bar code; Rotary unit, is connected with described comparing unit.For bar code not detected when described scanning element, rotate described image, scanning element continues the arbitrary pixel column in scan image described in re invocation.
As mentioned above, correcting direction of image method and system of the present invention, have following beneficial effect:
1, correcting direction of image method and system of the present invention are utilized bar code orientation determination image rotation direction scope, within the scope of this by the detection and Identification of word are determined to image rectification angle, can reduce image rotation erroneous judgement possibility, can quick and precisely judge correcting image direction again simultaneously
2, correcting direction of image method and system of the present invention are browsed in daily life, commercial affairs work, research work etc. to user and other later image are processed to operate convenience is provided.
Embodiment
Below, by specific instantiation explanation embodiments of the present invention, those skilled in the art can understand other advantages of the present invention and effect easily by the disclosed content of this instructions.The present invention can also be implemented or be applied by other different embodiment, and the every details in this instructions also can be based on different viewpoints and application, carries out various modifications or change not deviating under spirit of the present invention.It should be noted that, in the situation that not conflicting, the feature in following examples and embodiment can combine mutually.
It should be noted that, the diagram providing in following examples only illustrates basic conception of the present invention in a schematic way, satisfy and only show with assembly relevant in the present invention in graphic but not component count, shape and size drafting while implementing according to reality, during its actual enforcement, kenel, quantity and the ratio of each assembly can be a kind of random change, and its assembly layout kenel also may be more complicated.
The bar code direction that first the present invention exists in detected image, and according to the possible direction range detection of bar code and identification word, angle and degree of confidence in conjunction with the direction of word and bar code, direction to image is proofreaied and correct, can also be to there is the image of head portrait in the present invention in addition, by the method for detection head picture, utilize head portrait method information correction image.If in the present embodiment without explanation, sense of rotation can be regarded as clockwise direction, but scope of the present invention is not limited to this.
Embodiment mono-
Preserving before view data or display image data browse to user, or opening the image file of having preserved, after reads image data, the view data reading is being shown to before user browses, first view data being carried out to the automatic anglec of rotation detects and automatic rotation correction, thereby the image of seeing while guaranteeing user's image browsing is through rotation correction, reduce user's have to carry out with picture browsing instrument trouble of artificial rotation correction.
The present embodiment provides a kind of correcting direction of image method, refers to Fig. 1, is shown as the flow process of correcting direction of image method, and described correcting direction of image method comprises:
S1, reads raw image data.The raw image data reading can be: with digital camera, take the view data obtaining; Or the view data obtaining by scanner scanning; Or open one and be pre-existing in the file that includes view data, read data in this document and according to canonical algorithm, decompress after the view data that obtains.
S2, the raw image data that pre-service reads.Refer to Fig. 2, be shown as pretreatment process, pre-service comprises:
S201, raw image data described in gray processing; The original image reading due to great majority is all coloured image, and coloured image storage takies than the more spaces of gray level image, deals with also much longer than gray level image.The printing bar code simultaneously existing in image is printed according to black and white mode again, so in the process of identification bar code, actual photographed to bar code image in chromatic information component for not effect of the identification of bar code, thereby coloured image need to be converted to gray level image, to reduce the operation time of subsequent operation.The color of each pixel in coloured image is determined by R, G, tri-components of B, and a kind of special coloured image that gray level image is R, G, tri-components of B are identical, the variation range of one of them pixel is 0~255.
S202, continues denoising to described view data.Because the image reading generally all can contain noise because of the interference of surrounding environment, therefore, carry out denoising to the image reading.In the present embodiment, denoising method adopts medium filtering to process.Medium filtering is the Nonlinear Processing method of noise always, and its ultimate principle is that any the value in digital picture or Serial No. is replaced with the Mesophyticum of the value of each point in a field of this point.
S203, continues binary conversion treatment to described view data.The object of image binaryzation is in order to remove background, retains as much as possible bar code symbol and reduces noise magazine in symbol, is correct recognizing site detection figure and correctly read bar code code word basic guarantee is provided in follow-up barcode detection.Gray-scale value access L in the view data reading
lowand L
hightbetween pixel formed zone of transition.The basic thought of the image partition method of transition region extraction is by extracting the pixel of zone of transition, then using the gray average of zone of transition pixel, as segmentation threshold, image is carried out to binaryzation.
S3, judges in pretreated image bar code whether detected, if bar code detected, continues execution step S4; If bar code do not detected, continue execution step S18.In the present embodiment, described bar code is one-dimensional bar code or two-dimensional bar.Refer to Fig. 3, be shown as the flow process of detector bar shape code, barcode detection concrete steps comprise:
S301, the arbitrary pixel column after scanning pre-service in image; Pixel column due to the corresponding monochrome pixels value in each provisional capital in image.In the present embodiment, for fear of the impact of neighbourhood noise, the pixel column in step S31 in meeting Multiple-Scan image.
S302, does pixels statistics to described pixel column, adds up black and white pixel continuous in described pixel column, the ratio sequence that calculating pixel is capable; Due to the corresponding finger URL of each bar code, described finger URL is corresponding to a certain proportion of black and white bar empty sequence.
S303, compares the finger URL of the described ratio sequence calculating and pre-stored all kinds of bar codes, if ratio is identical, represents to detect corresponding bar code, execution step S4; If ratio is not identical, represent not detect bar code, continue to carry out next step.
S304, by described image rotation ω degree, returns to step S301, continues the arbitrary pixel column in scan image, and this row is done to pixels statistics, adds up the continuous black and white pixel of this row, calculates the ratio sequence of described row,
S4, judges whether only to have a bar code in pretreated image, if only there is a bar code, performs step S5; If there are a plurality of bar codes, perform step S12.
, there is a bar code in S5, utilizes bar code scanning line algorithm, obtains the orientation angle j of this bar code.Angle centered by the orientation angle j by this bar code, in [j-i, j+i] rotation angle range, sets an anglec of rotation θ, every an image of an anglec of rotation θ rotation.Wherein, the orientation angle j of described bar code is greater than 0 degree, is less than 360 degree, angle i is greater than 0 degree, is less than or equal to 10 degree, and described anglec of rotation θ is greater than 0 degree, be less than or equal to 10 degree, in the present embodiment, it is 5 degree that angle i is set, anglec of rotation θ is 1 degree, by bar code scanning line algorithm, get the orientation angle j of described bar code, in angle centered by described orientation angle j, in [j-5, j+5] rotation angle range, every 1 degree, rotate once pretreated image.
S6, detects to rotate each time in the image after θ degree whether have word, if there is word, performs step S7; If there is not word, perform step S11.
S7, existing word in the image after θ degree is rotated in identification each time, and calculate and rotate each time corresponding lteral data after θ degree and preset the similarity degree of correct direction word template data, obtain and rotate each time corresponding word degree of confidence after θ degree;
S8, after θ degree is rotated in judgement each time, whether corresponding word degree of confidence there is the word degree of confidence that is greater than a predetermined threshold value, if do not exist, after representing to rotate each time θ degree, corresponding word degree of confidence is not high, image rotation angle is from j-i+ θ, j-i+2 θ ... all insincere to j-i+n θ, perform step so S9; If there is the word degree of confidence that is greater than predetermined threshold value, perform step S10.
S9, setting image rectification angle is 0 degree, and image is without being rotated, and image direction is without correction.
S10, will be greater than predetermined threshold value, and the corresponding word degree of confidence of the different images anglec of rotation compares.Select the highest corresponding image rotation angle of word degree of confidence, be set as image rectification angle, according to described image rectification angle, correcting image direction, the image that output calibration is good.In the present embodiment, for example, if i equals 5 degree, θ equals 1 degree, if, when image is in rotation angle range, rotate after 10 times, and rotation 10 θ, after 10 degree, corresponding word degree of confidence is the highest, and the highest corresponding image rotation of word degree of confidence is told somebody what one's real intentions are as j-5+10=j+5 degree so, so image rectification angle is j+5 degree.
S11, the orientation angle of selecting described bar code is image rectification angle, according to image rectification angularity correction image direction, the image after output calibration, end process.
S12, there are a plurality of bar codes, utilize described bar code scanning line algorithm, obtain direction angle alpha, β, γ etc. of a plurality of bar codes, in angle centered by the direction angle alpha of each bar code, β, γ etc. respectively, at [α-i, α+i], in [β-i, β+i], [γ-i, γ+i] etc. rotation angle range, set another anglec of rotation θ, every an image of an anglec of rotation θ rotation.Wherein, the direction angle alpha of a plurality of bar codes, β, γ etc. is greater than 0 degree, be less than 360 degree, angle i is greater than 0 degree, be less than or equal to 10 degree, described anglec of rotation θ is greater than 0 degree, be less than or equal to 10 degree, in the present embodiment, it is 5 degree that angle i is set, anglec of rotation θ. be 1 degree, by bar code scanning line algorithm, obtain the direction angle alpha of a plurality of bar codes, β, γ etc., with each bar code direction angle alpha, β, angle centered by γ etc., at [α-i, α+i], [β-i, β+i], [γ-i, γ+i] etc. in rotation angle range every 1 degree rotation pretreated image once.
S13, detects to rotate each time in the image after θ degree whether have word, if there is word, performs step S14; If there is not word, perform step S17.
S14, existing word in the image after θ degree is rotated in identification each time, and calculate and rotate each time lteral data corresponding after θ degree and preset the similarity degree of correct direction word template data, obtain and rotate each time corresponding word degree of confidence after θ degree;
S15, after θ degree is rotated in judgement each time, whether corresponding word degree of confidence there is the word degree of confidence that is greater than a predetermined threshold value, if do not exist, after representing to rotate each time θ degree, corresponding word degree of confidence is not high, image rotation angle is from α-i+ θ/β-i+ θ/γ-i+ θ ... α-i+2 θ/β-i+2 θ/γ-i+2 θ ... ... to α-i+n θ/β-i+n θ/γ-i+n θ ... all insincere, perform step so S9; If there is the word degree of confidence that is greater than predetermined threshold value, perform step S16.
S16, will be greater than predetermined threshold value, and the corresponding word degree of confidence of the different images anglec of rotation compares.Select the highest image rotation angle of word degree of confidence, be set as image rectification angle, according to image rectification angularity correction image direction, the image that output calibration is good.In the present embodiment, by utilizing the confidence information of word identification within the scope of bar code direction and corresponding rotation, do cross validation image rotating method, avoided the erroneous judgement of image rotating method disconnected.In the present embodiment, for example, the angle centered by α if the direction of a bar code is told somebody what one's real intentions are, in [α-i, α+i] rotation angle range, if i equals 5 degree, θ equals 1 degree, if, when image is in rotation angle range, rotate after 12 times, and rotation 12 θ,, after 12 degree, corresponding word degree of confidence is the highest, the highest corresponding image rotation of word degree of confidence is told somebody what one's real intentions are as α-5+12=α+7 degree so, so image rectification angle is α+7 degree.
S17, the orientation angle of selecting arbitrary bar code in a plurality of bar codes is image rectification angle, according to image rectification angularity correction image direction, the image after output calibration, end process.
S18, does not detect bar code in image,, within the scope of comprehensive 360 degree, set an anglec of rotation
every an anglec of rotation
pretreated image is rotated, wherein the anglec of rotation
be greater than 10 degree, be less than 30 degree; This step can also be arranged to n sub-range by [0 °, 360 °], selects another anglec of rotation in each sub-range
rotation pretreatment image.
S19 detects whether there is word in postrotational image, has word if detect, and performs step S20; If word do not detected, image rotating not, end process;
S20, identification is rotation each time
degree or
existing word in image after degree, and calculate and rotation each time
degree or
the rear corresponding lteral data of degree and the similarity degree that presets correct direction word template data, obtain rotation each time
degree or
corresponding word degree of confidence after degree;
S21, judgement is rotation each time
or
after degree, whether corresponding word degree of confidence exists and is greater than a predetermined threshold value word degree of confidence, if do not exist, represents rotation each time
degree or
degree after corresponding word degree of confidence not high, image rotation angle from
all insincere, perform step so S22; If there is the word degree of confidence that is greater than predetermined threshold value, perform step S23.
S22, setting image rectification angle is 0 degree, and image is without being rotated, and image direction is without correction.
S23, will be greater than predetermined threshold value, and the corresponding word degree of confidence of the different images anglec of rotation compares, select the highest image rotation angle of word degree of confidence, be set as image rectification angle, according to image rectification angularity correction image direction, the image that output calibration is good.
If in the present embodiment, if described image comprises people's face, described step S7 detects to rotate each time after the anglec of rotation whether have people's face in image, calculates people's face reliability index, according to the people's face reliability index correcting image direction calculating.
Embodiment bis-
The present embodiment provides a kind of correcting direction of image system 1, refer to Fig. 4, be shown as the structure of correcting direction of image system, described corrective system comprises: image reading module 10, image pretreatment module 20, barcode detection module 30, bar code orientation angle determination module 40, rotary module 50, text detection module 60, word identification module 70, computing module 80, comparison module 90 and correction module 100.
Described image reading module 10, for reading raw image data.
Described image pretreatment module 20, for carrying out pre-service to raw image data.Refer to Fig. 5, be shown as the structure of described image pretreatment module 20, described image pretreatment module 20 comprises: image gray processing unit 201, image denoising unit 202, image binaryzation unit 203.Wherein,
Described image gray processing unit 201 is for gray processing raw image data, and the original image reading due to great majority is all coloured image, and coloured image storage takies than the more spaces of gray level image, deals with also much longer than gray level image.The printing bar code simultaneously existing in image is printed according to black and white mode again, so in the process of identification bar code, actual photographed to bar code image in chromatic information component for not effect of the identification of bar code, thereby coloured image need to be converted to gray level image, to reduce the operation time of subsequent operation.The color of each pixel in coloured image is determined by R, G, tri-components of B, and a kind of special coloured image that gray level image is R, G, tri-components of B are identical, the variation range of one of them pixel is 0~255.Described image denoising unit 202 is used to described view data denoising.Because the image reading generally all can contain noise because of the interference of surrounding environment, therefore, carry out denoising to the image reading.In the present embodiment, denoising method adopts medium filtering to process.Medium filtering is the Nonlinear Processing method of noise always, and its ultimate principle is that any the value in digital picture or Serial No. is replaced with the Mesophyticum of the value of each point in a field of this point.Described image binaryzation unit 203 is for continuing binary conversion treatment to described view data.The object of image binaryzation is in order to remove background, retains as much as possible bar code symbol and reduces noise magazine in symbol, is correct recognizing site detection figure and correctly read bar code code word basic guarantee is provided in follow-up barcode detection.Gray-scale value access L in the view data reading
lowand L
hightbetween pixel formed zone of transition.The basic thought of the image partition method of transition region extraction is by extracting the pixel of zone of transition, then using the gray average of zone of transition pixel, as segmentation threshold, image is carried out to binaryzation.
Described barcode detection module 30 is connected with described image pretreatment unit 20, for detection of whether there being at least one bar code in pretreated image.Refer to Fig. 6, be shown as the structure of barcode detection module, described barcode detection module 30 comprises scanning element 301, arithmetic element 302, comparing unit 303 and rotary unit 304.In the present embodiment, described bar code is one-dimensional bar code or two-dimensional bar.
Described scanning element 301 is for scanning arbitrary pixel column of image after pre-service; Pixel column due to the corresponding monochrome pixels value in each provisional capital in image.In the present embodiment, for fear of the impact of neighbourhood noise, repeatedly call the pixel column in described scanning element scan image.
The described arithmetic element 302 being connected with described scanning element 301, for adding up described pixel column, is added up black and white pixel continuous in described pixel column, the ratio sequence that calculating pixel is capable.Due to the corresponding finger URL of each bar code, described finger URL is corresponding to a certain proportion of black and white bar empty sequence.
The described comparing unit 303 being connected with described arithmetic element 302 is compared the described ratio sequence calculating and the finger URL of pre-stored wherein each class bar code, if ratio is identical, represents to detect corresponding bar code; If ratio is not identical, represent not detect bar code.
The rotary unit 304 being connected with described comparing unit 303 is not for bar code being detected when described scanning element 301, described image is rotated according to predetermined anglec of rotation ω, arbitrary pixel column that described in re invocation, scanning element 301 continues in scan image, this row is done to pixels statistics, add up the continuous black and white pixel of this row, calculate the ratio sequence of described row.
Described barcode detection module 30 is also for detection of the number of bar code in pretreated image, and in described pretreated image, the number of bar code at least comprises a bar code.
The described bar code orientation angle determination module 40 being connected with described barcode detection module 30 is for orientation angle j, α, β, γ etc. of all bar codes of obtaining described barcode detection module 30 and detecting, obtain the orientation angle of all bar codes at described bar code orientation angle determination module 40 after, centered by orientation angle, tell somebody what one's real intentions are, setting and each bar code be rotation angle range [j-i one to one, j+i], [α-i, α+i], [β-i, β+i], [γ-i, γ+i] etc., pre-stored in this module have an anglec of rotation θ.
The rotary module 50 being connected with described bar code orientation angle determining unit 40 is for angle centered by orientation angle j, the α of each bar code, β, γ etc. respectively, at [j-i, j+i], [α-i, α+i], [β-i, β+i], [γ-i, γ+i] etc. in rotation angle range, every an image of an anglec of rotation θ rotation.Wherein, the orientation angle j of a plurality of bar codes, α, β, γ etc. is greater than 0 degree, be less than 360 degree, angle i is greater than 0 degree, be less than or equal to 10 degree, described anglec of rotation θ is greater than 0 degree, be less than or equal to 10 degree, in the present embodiment, it is 5 degree that angle i is set, anglec of rotation θ is 1 degree, by bar code scanning line algorithm, get the orientation angle j of described bar code, with described orientation angle j, α, β, angle centered by γ etc., at [j-5, j+5], [α-5, α+5], [β-5, β+5], [γ-5, γ+5] etc. in rotating range every 1 degree rotation pretreated image once.Pre-stored in described rotary module 50 have another anglec of rotation
with the another anglec of rotation
for bar code not detected at pretreated image when described barcode detection module 30, within the scope of comprehensive 360 degree, every an anglec of rotation
pretreated image is rotated.The anglec of rotation wherein
be greater than 10 degree, be less than 30 degree; Or described rotary module 50 can also be arranged to n sub-range by [0 °, 360 °], adopts another anglec of rotation in each sub-range
pretreated image is rotated
The described
text detection module 60 being connected with described
rotary module 50 is for detection of whether there being word in the image rotating each time after θ degree.Described
text detection module 60 can also be for people's face detection module 60 ' be for detection of whether there being people's face in the image rotating each time after θ degree.Computing module 80 ' is for calculating people's face reliability index, and correction module 100 ' is for according to the people's face reliability index correcting image direction calculating.Described
text detection module 60 is also for when described
barcode detection module 30 is not when pretreated image detects bar code, every an anglec of rotation
after image rotating, detect rotation each time
in image after degree, whether there is word.
When the described
word identification module 70 being connected with described
text detection module 60 exists word for detecting when described
text detection module 60 image rotating each time after θ degree, existing word in the image after θ degree is rotated in identification each time.Described
word identification module 70 is also for rotation each time being detected when described
text detection module 60
identification rotation each time while there is word in the image after degree
existing word in image after degree.
The
computing module 80 being connected with described
word identification module 70 rotates corresponding word degree of confidence after θ degree each time for calculating and rotate each time corresponding lteral data and the similarity degree that presets correct direction word template data after θ degree, obtaining; Described
computing module 80 is also for calculating rotation each time
corresponding lteral data and the similarity degree that presets correct direction word template data after degree, obtain rotation each time
corresponding word degree of confidence after degree.
The described comparison module 90 being connected with described computing module 80 for judge rotate each time θ degree after corresponding word degree of confidence whether there is the word degree of confidence that is greater than a predetermined threshold value, if do not exist, after representing to rotate each time θ degree, corresponding word degree of confidence is not high, image rotation angle is from j-i+ θ/α-i+ θ/β-i+ θ/γ-i+ θ ... j-i+2 θ/α-i+2 θ/β-i-+2 θ/γ-i+2 θ ... to j-i+n θ/α-i+n θ/β-i+n θ/γ-i+n θ ... all insincere, pretreated image is without being rotated.If there is the word degree of confidence that is greater than predetermined threshold value, represent to continue to be greater than predetermined threshold value, the corresponding word degree of confidence of the different images anglec of rotation compares, select the highest image rotation angle of word degree of confidence, be set as image rectification angle, in the present embodiment, by utilizing the confidence information of word identification within the scope of bar code direction and corresponding rotation, do cross validation image rotating method, avoided the erroneous judgement of image rotating method disconnected.Described comparison module 90 is also for judgement rotation each time
degree or
after degree, whether corresponding word degree of confidence there is the word degree of confidence that is greater than a predetermined threshold value, if do not exist, represents rotation each time
degree or
degree after corresponding word degree of confidence not high, image rotation angle from
all insincere, image is without correction; If exist, be greater than the word degree of confidence of predetermined threshold value, will be greater than predetermined threshold value, the corresponding word degree of confidence of the different images anglec of rotation compares, and selects the highest image rotation angle of word degree of confidence, be set as image rectification angle.
The described correction module 100 being connected with described comparison module 90 is for obtaining image rectification angle, according to image rectification angularity correction image direction, the image that output calibration is good.
For the image that comprises word and/or bar code, correcting direction of image method and system of the present invention are automatically according to angle and the confidence information detected image positive dirction of word and/or bar code direction, first utilize bar code orientation determination image rotation direction scope, within the scope of this by the detection and Identification of word are determined to image rectification angle, so, can reduce image rotation erroneous judgement possibility, can quick and precisely judge correcting image direction again simultaneously, give user in daily life, commercial affairs work, in research work etc., browse and other later image are processed operation convenience is provided.The present invention is also convenient to be arranged in the smart machines such as computing machine, mobile phone, panel computer.
So the present invention has effectively overcome various shortcoming of the prior art and tool high industrial utilization.
Above-described embodiment is illustrative principle of the present invention and effect thereof only, but not for limiting the present invention.Any person skilled in the art scholar all can, under spirit of the present invention and category, modify or change above-described embodiment.Therefore, such as in affiliated technical field, have and conventionally know that the knowledgeable, not departing from all equivalence modifications that complete under disclosed spirit and technological thought or changing, must be contained by claim of the present invention.