CN1254949C - Automatic correction method for oblique image - Google Patents

Automatic correction method for oblique image Download PDF

Info

Publication number
CN1254949C
CN1254949C CN 03148131 CN03148131A CN1254949C CN 1254949 C CN1254949 C CN 1254949C CN 03148131 CN03148131 CN 03148131 CN 03148131 A CN03148131 A CN 03148131A CN 1254949 C CN1254949 C CN 1254949C
Authority
CN
China
Prior art keywords
correction method
image correction
value
automatic tilt
district
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.)
Expired - Fee Related
Application number
CN 03148131
Other languages
Chinese (zh)
Other versions
CN1567977A (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.)
Lite On Technology Corp
Original Assignee
Lite On Technology Corp
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 Lite On Technology Corp filed Critical Lite On Technology Corp
Priority to CN 03148131 priority Critical patent/CN1254949C/en
Publication of CN1567977A publication Critical patent/CN1567977A/en
Application granted granted Critical
Publication of CN1254949C publication Critical patent/CN1254949C/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Abstract

The present invention discloses an automatic method for correcting oblique images. An image is segmented into a plurality of square regions with N<*>N pixels, and a plurality of boundary regions with larger lightness or chroma difference are found out by sensing all the square regions one by one. Subsequently, all angles in the gradient direction of the boundary regions are calculated in order to accumulate weight. In this way, the obtained angle in the gradient direction with highest weight is the oblique angle of the image, and the image correction has higher accuracy by using the method.

Description

Automatic tilt image correction method
Technical field
The present invention relates to a kind of automatic tilt image correction method, be meant a kind of adjustment of image technology that can accurately obtain the image angle of inclination especially.
Background technology
When duplicating or capturing the content on the plane recording medium (as paper) when using photocopier or scanning apparatus, be easy to because the inclination of recording medium is placed, and cause the result or the picked image of duplicating also to tilt.
At the inclination adjustment of image technology of this problem, main key point is how to obtain accurate angle of inclination.Generally speaking, the characteristic that scans image depends on element on the original document such as literal (Character), image (Picture), form (Table).Because these elements are generally laterally or directly to layout, therefore many alignment techniques just based on element laterally or the variation that directly makes progress, the foundation of calculating as the angle of inclination.Yet such mode but can't obtain comparatively accurate angle of inclination, because the detecting mode of communal technique is comprehensive, does not screen at the characteristic of inclination image; List pixels all on the image result of consideration in, often cause disturbance variable too much, the detecting result calculated also loses accuracy.
Summary of the invention
The objective of the invention is to, solve existing inclination image rotation technique with element laterally or the variation that directly makes progress, can't try to achieve the technical problem at accurate angle of inclination.
Above-mentioned purpose of the present invention is achieved in that a kind of automatic tilt image correction method, wherein, comprises following steps:
Detect a plurality of frontier districts that have a border on the image;
Calculate respectively gradient direction angle and its weight of accumulative total of this frontier district; And
Rotate this image according to described gradient direction angle with highest weighting;
On behalf of the maximum in this frontier district, wherein said border show that difference value is greater than a limiting value.
Automatic tilt image correction method of the present invention, wherein, the decision of described frontier district is definite through the following steps:
Cutting this image is a plurality of squares districts, and respectively this square district comprises the N*N pixel, and N is the odd number beyond 1;
According to a plurality of angles this square district is divided into a plurality of pixel group;
Calculating each other demonstration difference value between adjacent two pixel groups under this angle respectively;
Determine that maximum demonstration difference value is greater than this limiting value; And
The square district that definition has this border is described frontier district.
Automatic tilt image correction method of the present invention, wherein, described each square district gets with the trunnion axis angle to become 0 °, 45 °, 90 ° to be partitioned into described respectively as number group with 135 ° of angles.
Automatic tilt image correction method of the present invention, wherein, the difference of the display parameters total value that described demonstration difference value is adjacent two these pixel groups.
Automatic tilt image correction method of the present invention, wherein, the display parameters total value of described pixel group comprises the summation of the display parameter value of pixel for it.
Automatic tilt image correction method of the present invention, wherein, described display parameter value is brightness value or chromatic value.
Automatic tilt image correction method of the present invention, wherein, described demonstration difference value is a luminance difference value or a colourity difference value.
Automatic tilt image correction method of the present invention wherein, when calculating described gradient direction angle, also comprises one and confirms that this gradient direction angle is positioned at the step of an angular range.
Automatic tilt image correction method of the present invention, wherein, described angular range is-89 ° to 89 °.
Automatic tilt image correction method of the present invention, wherein, described angular range is-45 ° to 45 °.
Automatic tilt image correction method of the present invention wherein, also comprises the step of exporting an information warning.
Automatic tilt image correction method of the present invention wherein, also comprises the step of adjusting this border, image rotation back.
Automatic tilt image correction method of the present invention, wherein, described gradient direction angle is to try to achieve by the Suo Beier operator.
In sum, a kind of automatic tilt image correction method provided by the invention, it comprises the following step: detect all frontier districts that have the border on the image; Calculate gradient direction angle and its weight of accumulative total of each frontier district; And, according to gradient direction angle image rotating with highest weighting.
Wherein the decision of frontier district also comprises following steps: the cutting image is a plurality of squares districts, and each square district comprises the N*N pixel; According to a plurality of angles this square district is divided into most pixel groups; Calculating each other demonstration difference value between pixel group adjacent two under each angle; Determine that maximum demonstration difference value is greater than limiting value; And the square district that definition has the border is the frontier district.
Owing to adopted the effect that aforesaid the present invention reached, be to go all pixels on the detecting image one by one with the square district that comprises the N*N pixel, find out and have the frontier district that the border exists, the accumulative total of weight is carried out at the gradient direction angle of calculating all frontier districts again, and the gradient direction angle of resultant like this highest weighting is the image angle of inclination of pinpoint accuracy.
Description of drawings
Fig. 1 is a main flow chart of the present invention;
Fig. 2 is the thin portion flow chart that the present invention determines the frontier district;
Fig. 3 is the square district schematic diagram of 3*3 pixel of the present invention;
Fig. 4 a is the differentiation schematic diagram of the square district of 3*3 pixel of the present invention 0 ° of following pixel group;
Fig. 4 b is the differentiation schematic diagram of the square district of 3*3 pixel of the present invention 45 ° of following pixel groups;
Fig. 4 c is the differentiation schematic diagram of the square district of 3*3 pixel of the present invention 90 ° of following pixel groups;
Fig. 4 d is the differentiation schematic diagram of the square district of 3*3 pixel of the present invention 135 ° of following pixel groups;
Fig. 5 is the schematic diagram that the present invention uses the Suo Beier operator;
Fig. 6 is the inclination image schematic diagram of preferred embodiment of the present invention;
Fig. 7 is the display parameter value schematic diagram in square district 311 in the preferred embodiment of the present invention;
Fig. 8 is an image schematic diagram after the rotation of preferred embodiment of the present invention; And
Fig. 9 is rotation, the deburring image schematic diagram of preferred embodiment of the present invention.
Embodiment
Automatic tilt image correction method provided by the present invention, original conception is the image that scans that is applied to correct tilt, and this scans element on the image such as literal (Character), image (Picture), form (Table), at original record medium (Record Media is as paper) mainly is to become horizontal or straight to layout; In other words, if having laterally or directly when the homogeneity (Uniformity) of layout, can proofread and correct by this method as the element of inclination image.
As shown in Figure 1, the method mainly comprises following steps:
Step 110: at first detect all frontier districts that have the border on the image;
Step 120: gradient direction angle and its weight of accumulative total of calculating each frontier district then;
Step 130: last then according to gradient direction angle image rotating with highest weighting.
Then, each step is done further detailed must the explanation.
Step 110: detect all frontier districts that have the border on the image:
So-called border (Edge), be to represent that the maximum in the frontier district shows that difference value (DisplayDifference) is greater than a limiting value (Threshold), and show that difference value is to be preset as a brightness (Luminance) difference value or a colourity (Chrominance) difference value, limiting value is an empirical value, and is different with the machine of image capture unit.Wherein, as shown in Figure 2, the decision of frontier district is to determine by following steps,
Step 210: cutting this image is a plurality of squares districts, and each square district comprises the N*N pixel, and wherein N is the odd number beyond 1.With N=3 is example, and each square district (Block) comprises 9 pixels, as shown in Figure 3, gives the numbering of 1-9 earlier at this; Then represent the display parameter value of each pixel as for Z1-Z9, this display parameter value is predeterminable to be the brightness value or the chromatic value of each pixel;
Step 220: each square district is divided into a plurality of pixel group according to different angles.The angle that adopts is to get with the trunnion axis angle to become 0 °, 45 °, 90 ° and 135 ° of equal angles, distinguishes each as number group (PixelGroup).The pixel group that each angle is divided into comprises, pixel group 123,456,789 shown in Fig. 4 a 0 ° the time, shown in Fig. 4 b with the pixel group 124,357,689 of 45 ° of differentiations, shown in Fig. 4 c with the pixel group 147,258,369 of 90 ° of differentiations, with shown in Fig. 4 d with the pixel group 236,159,478 of 135 ° of differentiations.
Step 230: calculate in each other demonstration difference value between adjacent two pixel groups under each angle.Represent the display parameters total value with " Data ", then the display parameters total value is the summation of the display parameter value of all pixels in the pixel group, and is as follows with the formula tabular form:
a.0°:
Data123=Z1+Z2+Z3
Data456=Z4+Z5+Z6
Data789=Z7+Z8+Z9
b.45°:
Data124=Z1+Z2+Z4
Data357=Z3+Z5+Z7
Data689=Z6+Z8+Z9
c.90°:
Data147=Z1+Z4+Z7
Data258=Z2+Z5+Z8
Data369=Z3+Z6+Z9
d.135°:
Data236=Z2+Z3+Z6
Data159=Z1+Z5+Z9
Data478=Z4+Z7+Z8
Show difference value with " Diff " representative, show that then difference value is defined as the difference of the display parameters total value of adjacent two pixel groups, is expressed as follows (Abs represents absolute value) with formula:
a.0°:
Diff123_456=Abs(Data123-Data456)
Diff789_456=Abs(Data789-Data456)
b.45°:
Diff124_357=Abs(Data124-Data357)
Diff689_357=Abs(Data689-Data357)
c.90°:
Diff147_258=Abs(Data147-Data258)
Diff369_258=Abs(Data369-Data258)
d.135°:
Diff478_159=Abs(Data478-Data159)
Diff478_159=Abs(Data478-Data159)
Step 240: determine maximum demonstration difference value greater than limiting value, that is, according to previous definition, square has " border " in the district.Show that difference value is big more, represent between two neighbor groups on display effect such as brightness or colourity, to have significant difference; If this difference value greater than (or equaling) limiting value (for example 120, with brightness value), then is enough to the target as sampling.
Step 250: the square district that definition has the border is the frontier district, and the square district that is defined as the frontier district will be used to be further processed.
Step 120: gradient direction angle and its weight of accumulative total of calculating each frontier district:
The demonstration difference of each frontier district will be converted into gradient direction angle (Gradient Angle), its representative be all possible angle of inclination of image (Skew Angle).
The calculating at gradient direction angle can be tried to achieve by Suo Beier operator (Sobel Operator) Gx and Gy, and as shown in Figure 5, the calculating of the gradient direction angle A of frontier district can cooperate Fig. 3 to be expressed as follows with formula:
Gx=(Z7+2*Z8+Z9)-(Z1+2*Z2+Z3)
Gy=(Z3+2*Z6+Z9)-(Z1+2*Z4+Z7)
A=tan -1(Gy/Gx)
Wherein A refers to the angle with trunnion axis, tan -1Inverse function for trigonometric function tan.
By the accumulative total of each its weight of gradient direction angle (Weighting) that calculates, can find a gradient direction angle with weight limit, based on the homogeneity prerequisite of this method image element, this gradient direction angle is the angle of inclination of image.
Step 130: according to gradient direction angle image rotating with highest weighting:
The technology of image rotating to a special angle is known, and this method is characterised in that and can seeks out the angle of inclination accurately by the weight accumulative total at gradient direction angle.
Below describe in detail by a preferred embodiment.See also Fig. 6, can pick out one of them element on the image 300 very easily and be letter " B ", and letter " B " image 310 inclinations one angle.Carry out step 210,220 and distinguish in regular turn after square district, the pixel group, promptly carry out the calculating that step 230 shows difference value, present embodiment is to be foundation with the brightness value; With square district 311 is example, the brightness value of its each pixel, and promptly display parameter value is as shown in Figure 7, so the display parameters total value of each pixel group is calculated as follows:
0°:
Data123=83+60+53=196
Data456=137+73+51=261
Data789=200+141+86=427
45°:
Data124=83+60+137=280
Data689=51+141+86=278
Data357=53+73+200=326
90°:
Data147=83+137+200=420
Data258=60+73+141=274
Data369=53+51+86=190
135°:
Data478=137+200+141=478
Data159=83+73+86=242
Data236=60+53+51=164
Show the calculating of difference value:
0°:
Diff123_456=abs(Data123-Data456)=abs(196-261)=65
Diff789_456=abs(Data789-Data456)=abs(427-2610)=166
45°:
Diff124_357=abs(Data124-Data357)=abs(280-326)=46
Diff689_357=abs(Data689-Data357)=abs(278-326)=48
90°:
Diff147_258=abs(Data147-Data258)=abs(420-274)=146
Diff369_258=abs(Data369-Data258)=abs(190-274)=84
135°:
Diff478_159=abs(Data478-Data159)=abs(478-242)=236
Diff236_159=abs(Data236-Data159)=abs(164-242)=78
It is 236 that above-mentioned result of calculation can draw maximum demonstration difference value, is 120,236>120 so the square district is the frontier district with border as default limiting value.
And being calculated as follows of its gradient direction angle:
Gx=(Z7+2*Z8+Z9)-(Z1+2*Z2+Z3)
=(200+2*141+86)-(83+2*60+53)=312
Gy=(Z3+2*Z6+Z9)-(Z1+2*Z4+Z7)
=(53+2*51+86)-(83+2*137+200)=-316
A=tan -1(Gy/Gx)=tan -1(316/312)=-1 (radian)
Gradient direction angle A=-1* (180/ π) after converting=-45 °
Follow above-mentioned mode, find out frontier districts all on the image 300, and calculate its gradient direction angle and carry out after the weight accumulation, find that-45 ° have maximum weights, image rotating 300 according to this so just is as Fig. 8.
The angle of inclination that can try to achieve according to the present invention is in theory between-89 ° to 89 °, so approaching-89 ° or the 89 ° of normal angled that may represent image, therefore when the calculating at gradient direction angle, can increase by one and confirm that the gradient direction angle is positioned at the step of an angular range, this angular range is for being generally between-89 ° to 89 °, and the best is between-45 ° to 45 °.
And postrotational image 300 borders as shown in Figure 8 need be carried out the chamfered edge adjustment usually again, therefore can proceed a step of adjusting border, image rotation back after the rotation, with the result that image 300 is formed as Fig. 9.
When if this method is applied to scanning apparatus or photocopier, for avoiding image rotation, can excise the local edge of image when deburring is adjusted, perhaps, for keeping the integrality that scans image, this method still can increase the step of output one information warning, reminds the user to scan again.
The above only is preferred embodiment of the present invention, is not in order to limit scope of the invention process; Any personnel that have the knack of this type of technology not breaking away from the equalization variation of being done under spirit of the present invention and the scope and modification, all are covered by in the claim of the present invention.

Claims (10)

1. an automatic tilt image correction method is characterized in that, comprises following steps:
Detect a plurality of frontier districts that have a border on the image;
Calculate gradient direction angle and its weight of accumulative total of each described frontier district by the Suo Beier operator;
Rotate this image according to described gradient direction angle with highest weighting;
Wherein said frontier district is decided through the following steps: cutting this image is a plurality of squares districts, and respectively this square district comprises the N*N pixel, and N is the odd number beyond 1; According to a plurality of angles this square district is divided into a plurality of pixel group; The difference of the display parameters total value by adjacent two these pixel groups is calculated in each other demonstration difference value between adjacent two pixel groups under each described angle; Determine that maximum demonstration difference value is greater than a limiting value; The square district that definition has this border is described frontier district.
2. automatic tilt image correction method as claimed in claim 1 is characterized in that, described each square district gets with the trunnion axis angle to become 0 °, 45 °, 90 ° to be partitioned into described respectively as number group with 135 ° of angles.
3. automatic tilt image correction method as claimed in claim 1 is characterized in that, the display parameters total value of described pixel group comprises the summation of the display parameter value of pixel for it.
4. automatic tilt image correction method as claimed in claim 3 is characterized in that, described display parameter value is brightness value or chromatic value.
5. automatic tilt image correction method as claimed in claim 1 is characterized in that, described demonstration difference value is a luminance difference value or a colourity difference value.
6. automatic tilt image correction method as claimed in claim 1 is characterized in that, when calculating described gradient direction angle, also comprises one and confirms that this gradient direction angle is positioned at the step of an angular range.
7 automatic tilt image correction methods as claimed in claim 6 is characterized in that, described angular range is-89 ° to 89 °.
8. automatic tilt image correction method as claimed in claim 7 is characterized in that, described angular range is-45 ° to 45 °.
9. automatic tilt image correction method as claimed in claim 1 is characterized in that, also comprises the step of exporting an information warning.
10. automatic tilt image correction method as claimed in claim 1 is characterized in that, also comprises the step of adjusting this border, image rotation back.
CN 03148131 2003-06-27 2003-06-27 Automatic correction method for oblique image Expired - Fee Related CN1254949C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 03148131 CN1254949C (en) 2003-06-27 2003-06-27 Automatic correction method for oblique image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 03148131 CN1254949C (en) 2003-06-27 2003-06-27 Automatic correction method for oblique image

Publications (2)

Publication Number Publication Date
CN1567977A CN1567977A (en) 2005-01-19
CN1254949C true CN1254949C (en) 2006-05-03

Family

ID=34472201

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 03148131 Expired - Fee Related CN1254949C (en) 2003-06-27 2003-06-27 Automatic correction method for oblique image

Country Status (1)

Country Link
CN (1) CN1254949C (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4369953B2 (en) * 2006-12-06 2009-11-25 株式会社 日立ディスプレイズ Image correction method and image display apparatus
TWI493500B (en) * 2009-06-18 2015-07-21 Mstar Semiconductor Inc Image processing method and related apparatus for rendering two-dimensional image to show three-dimensional effect
GB2472854A (en) 2009-08-21 2011-02-23 Snell Ltd Correcting image defects using a gradient measure
CN103337080A (en) * 2013-07-15 2013-10-02 四川大学 Registration technology of infrared image and visible image based on Hausdorff distance in gradient direction
KR101862490B1 (en) * 2016-12-13 2018-05-29 삼성전기주식회사 image correct processor and computer readable recording medium

Also Published As

Publication number Publication date
CN1567977A (en) 2005-01-19

Similar Documents

Publication Publication Date Title
CN1800962A (en) Projection control system, projector and projection control method
CN1577048A (en) Image processing system, projector,and image processing method
CN1711559A (en) Characteristic region extraction device, characteristic region extraction method, and characteristic region extraction program
CN1217526C (en) Image processing device, image processing method, image processing program and its recording medium
CN1258287C (en) Picture processing system, projector and picture processing method
CN100351868C (en) Generation of still image from a plurality of frame images
CN1799252A (en) Captured image projection apparatus and captured image correction method
CN1713068A (en) Automatic focus adjustment for projector
CN1825194A (en) Projector and processing line specification method
CN1713069A (en) Projector and image correction method
CN1527126A (en) Image processing system, projector and image processing method
CN1845002A (en) Distortion correction for projector
CN100345159C (en) Image editing device, image cutting method and program
CN1236402C (en) Image processing method, image processing program and recording medium for recording the same program
CN1698379A (en) Monitoring device and monitoring method using panorama image
CN101079952A (en) Image processing method and image processing apparatus
CN1910613A (en) Method for extracting person candidate area in image, person candidate area extraction system, person candidate area extraction program, method for judging top and bottom of person image, system for j
CN101035273A (en) Automatically tracking and controlling method and control device in the video monitoring
CN1691728A (en) Image reading apparatus
CN1815350A (en) Projector and exposure adjustment method
CN1441595A (en) Contrast correction circuit
CN1512450A (en) Image processing device and image processing method and its program
CN1601369A (en) Image processing system, projector and image processing method
CN101031032A (en) Image pick-up apparatus, exposure controlling method, and computer program
CN1750043A (en) Histogram equalizing method for controlling average brightness

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
EE01 Entry into force of recordation of patent licensing contract

Assignee: Xuli Electronics (Guangzhou) Co., Ltd.

Assignor: Lite-On Technology Corporation

Contract fulfillment period: 2008.2.20 to 2025.3.7 contract change

Contract record no.: 2009990000666

Denomination of invention: Automatic correction method for oblique image

Granted publication date: 20060503

License type: Exclusive license

Record date: 2009.6.17

LIC Patent licence contract for exploitation submitted for record

Free format text: EXCLUSIVE LICENSE; TIME LIMIT OF IMPLEMENTING CONTACT: 2008.2.20 TO 2025.3.7; CHANGE OF CONTRACT

Name of requester: XULI ELECTRONIC (GUANGZHOU) CO., LTD.

Effective date: 20090617

CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20060503

Termination date: 20150627

EXPY Termination of patent right or utility model