CN106780523A - A kind of method for correcting image - Google Patents
A kind of method for correcting image Download PDFInfo
- Publication number
- CN106780523A CN106780523A CN201611239987.8A CN201611239987A CN106780523A CN 106780523 A CN106780523 A CN 106780523A CN 201611239987 A CN201611239987 A CN 201611239987A CN 106780523 A CN106780523 A CN 106780523A
- Authority
- CN
- China
- Prior art keywords
- image
- pixel coverage
- coordinate
- described image
- content
- 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.)
- Pending
Links
Landscapes
- Image Analysis (AREA)
Abstract
The present invention relates to a kind of method for correcting image, comprising three steps, the first step is split to image, second step, according to the result of image segmentation, delimits the slant range of picture material, and the 3rd step finds the inclination angle of image, and useful achievement of the invention is:One aspect of the present invention employs automatic identification technology to reduce artificial input, simplify workflow, on the other hand during research is of the invention, different algorithms are employed for different identification objects, on Research foundation of the invention, the process object being similar to can be understood the rest by analogy, the early stage processing procedure in this, as image procossing is adjusted to the position of image.
Description
Technical field
The present invention relates to image processing field, it is related to a kind of method for correcting image.
Background technology
It is affected by human factors in image practical operation, it is also likely to be laterally vertically to be put into scanner to sweep that image is probably
Retouch, for the uniformity of subsequent treatment, it is necessary to revert to all images laterally disposed.Because pending amount of images is various and
Artificial collimation error when placing can cause the image after scanning inevitably to there is angle tilt problem, and correction chart picture is asked
Topic is difficult to complete, therefore, it is necessary to the bearing calibration to image is studied.
The content of the invention
In view of this, the present invention provides a kind of a kind of method for correcting image for solving or partly solving the above problems.
To reach the effect of above-mentioned technical proposal, the technical scheme is that:A kind of method for correcting image, comprising following
Step:
(1) image is split;According to segmentation theory subgraph of the cutting containing border up and down, segmentation theory is system
Count pixel position and the pixel coverage of image on the border of the content of image, the pixel position on the border of the content of image
Comprising coboundary pixel coverage, lower boundary pixel coverage, left margin pixel coverage, right margin pixel coverage, coboundary pixel model
The coboundary of the content for image is enclosed, lower boundary pixel coverage is the lower boundary of the content of image, and left margin pixel coverage is figure
The left margin of the content of picture, right margin pixel coverage is the right margin of the content of image, and the pixel coverage of image includes row pixel
Scope, row pixel coverage, row pixel coverage are the line number of image, and row pixel coverage is the columns of image;The content bag of image
Containing the word in image, picture, form;
(2) according to the result of (1st) step image segmentation, the intersection point of following boundary pixel scope and left margin pixel coverage
It is origin, sets up the coordinate of image, abscissa is lower boundary pixel coverage, and ordinate is left margin pixel coverage, takes coboundary
Intersection point (the x of pixel coverage and left margin pixel coverage1,y1), the intersection point (x of lower boundary pixel coverage and right margin pixel coverage2,
y2), it is y=ax+b by 2 points of straight lines, it constitutes closing with left margin pixel coverage and lower boundary pixel coverage
Triangle scope, 16 centrifugal pumps are taken in the triangle scope of closing, and the coordinate of centrifugal pump is added using accumulator,
It is added i.e. between abscissa, is added between ordinate, obtains new coordinate value (m1,n1);
(3) on the edge of image, the right margin point and coboundary point, the right margin of the content of image of the content of image are taken
Put and the computational methods of coboundary point are:Intersection point with the lower edge of image and the left hand edge of image is schemed as origin
The lower edge of picture is the X-coordinate of coordinate, and the left hand edge of image is Y-coordinate, and the right margin point and coboundary point of image are respectively
The content of the image point maximum with X-coordinate in the intersection point of lower edge, the content of image and Y-coordinate maximum in the intersection point of left hand edge
Point, the right margin point of image is connected with coboundary point, is y=a by 2 points of straight lines1x+b1, try to achieve straight line y=ax+b with
Straight line y=a1x+b1Slope, and calculate two linear angle of inclination θ1With tiltangleθ2, try to achieve two differences at inclination angle;In figure
The lower edge of picture, the left hand edge of image, straight line y=a1x+b116 values are taken in the space of composition, by their X-coordinate, Y-coordinate
It is separately summed, obtains coordinate value (m2,n2), by new coordinate value (m1,n1) and coordinate value (m2,n2) connection, try to achieve by 2 points
Straight line be y=a2x+b2, straight line y=a2x+b2Tiltangleθ3, compare the difference and tiltangleθ at two inclinations angle3If, both
Difference be less than 10 °, using two differences at inclination angle as image correction angle.
Useful achievement of the invention is:One aspect of the present invention employs automatic identification technology to reduce artificial input, letter
Change workflow, on the other hand during research is of the invention, different algorithms are employed for different identification objects,
On Research foundation of the invention, the process object being similar to can be understood the rest by analogy, the position of image is adjusted in this, as
The early stage processing procedure of image procossing.
Specific embodiment
In order that the technical problems to be solved by the invention, technical scheme and beneficial effect become more apparent, below tie
Embodiment is closed, the present invention will be described in detail.It should be noted that specific embodiment described herein is only used to explain
The present invention, is not intended to limit the present invention, and can realize that the product of said function belongs to equivalent and improvement, is all contained in this hair
Within bright protection domain.Specific method is as follows:
Embodiment 1:Due to the artificial randomness placed when being input into scanner, i.e. image can be laterally or vertically defeated
Enter in scanner, the uniformity of position, first complete by image during in order to ensure to cut image in follow-up angle slant correction
Portion's unification is transverse view.Because image is a rectangular shape, the depth-width ratio of image and between size compare
Result thinks that image is longitudinal input if depth-width ratio as judging whether image needs the foundation being rotated by 90 ° more than or equal to if
, now need rotation;If depth-width ratio is smaller, then it is assumed that image is laterally input, is now maintained the original state all right, fixed here
The rotation of justice is clockwise.Some machineries that the collimation error or scanner exist in itself during due to artificial placement lack
The reason such as sunken, can cause the image after scanning a certain degree of angle occur and incline, just because of being not fee from these objective factors
Presence, so the slant correction of angle is the link that must carry out in pretreatment, positioning follow-up to image graph picture, cutting and
Identification will be with relatively upright, and nonangular image graph picture is treatment basis.
Present invention employs the correction that improved Hough transform method carries out image, in the neck such as image procossing, machine vision
Domain has a wide range of applications because Hough transform principle it is simple, it can be readily appreciated that its basic thought is by image from
Coordinate plane transforms to another coordinate plane, causes to be not easy to be detected in original cartesian coordinate plane by this conversion
Those linear features for measuring can be showed in another polar coordinate plane in the form of local maximum, by part
The main information for asking for obtaining straight line in former coordinate plane of maximum, so as to realize that angle is detected.Can by above-mentioned detection process
Know, conversion is inadequate for the susceptibility of noise, i.e., have stronger antijamming capability to noise, while it is good at parallel place again
Reason, just because of these advantages, just cause that conversion is all greatly applied in every field and direction.
On the one hand, this improved method is converted with four subgraphs under cutting, and needs to calculate so as to avoid binary from converting
The whole defect of image slices vegetarian refreshments, and after the angle change scope for determining ± 30 ° after analysis, conversion can be reduced
The array number of traversal is needed in space, i.e. the treatment by being made after analysis reduces the time complexity of algorithm;The opposing party
Face, removal maximum and minimum value simultaneously take the averages of middle two number as result of calculation, this sources of law in medium filtering thought, with
Original transform is tried to achieve an angle of inclination and is compared more accurately and reliably as testing result, and can more effectively control error, is made
Correction result is relatively reliable.
Embodiment 2:In the first step of image rectification is laterally disposed, when image is detected for vertical placement, made
It is clockwise, so this is likely to result in postrotational image right part and show handstand state and is to be rotated by 90 ° treatment
Whether follow-up localization process needs placement work upright to image to judge, it is necessary to image is collectively referred to as upright state for this, selects
Select the criterion whether ratio of whole rectangle frame pixel shared by black pixel in red rectangle frame region is stood as image.By statistics
Analysis finds, for the red area for being marked, if image is upright, that Pixel Information in red area will very
It is many, because it includes image name and red chapter information, now whole rectangle frame pixel occupied by black picture element in rectangle frame
Ratio be significantly greater than when image be stand upside down when red area in black picture element proportion.When program is realized, red mark is judged
The image that black picture element ratio is more than in note region is upright, and otherwise process decision chart picture is now needed image around center to stand upside down
180 ° of point rotation, completes from the transformation stood upside down to erected image.It is by obtaining relative dip angle after pretreatment process, it is upright
Bianry image.
A kind of method for correcting image, comprises the steps of:
(1) image is split;According to segmentation theory subgraph of the cutting containing border up and down, segmentation theory is system
Count pixel position and the pixel coverage of image on the border of the content of image, the pixel position on the border of the content of image
Comprising coboundary pixel coverage, lower boundary pixel coverage, left margin pixel coverage, right margin pixel coverage, coboundary pixel model
The coboundary of the content for image is enclosed, lower boundary pixel coverage is the lower boundary of the content of image, and left margin pixel coverage is figure
The left margin of the content of picture, right margin pixel coverage is the right margin of the content of image, and the pixel coverage of image includes row pixel
Scope, row pixel coverage, row pixel coverage are the line number of image, and row pixel coverage is the columns of image;The content bag of image
Containing the word in image, picture, form;
(2) according to the result of (1st) step image segmentation, the intersection point of following boundary pixel scope and left margin pixel coverage
It is origin, sets up the coordinate of image, abscissa is lower boundary pixel coverage, and ordinate is left margin pixel coverage, takes coboundary
Intersection point (the x of pixel coverage and left margin pixel coverage1,y1), the intersection point (x of lower boundary pixel coverage and right margin pixel coverage2,
y2), it is y=ax+b by 2 points of straight lines, it constitutes closing with left margin pixel coverage and lower boundary pixel coverage
Triangle scope, 16 centrifugal pumps are taken in the triangle scope of closing, and the coordinate of centrifugal pump is added using accumulator,
It is added i.e. between abscissa, is added between ordinate, obtains new coordinate value (m1,n1);
(3) on the edge of image, the right margin point and coboundary point, the right margin of the content of image of the content of image are taken
Put and the computational methods of coboundary point are:Intersection point with the lower edge of image and the left hand edge of image is schemed as origin
The lower edge of picture is the X-coordinate of coordinate, and the left hand edge of image is Y-coordinate, and the right margin point and coboundary point of image are respectively
The content of the image point maximum with X-coordinate in the intersection point of lower edge, the content of image and Y-coordinate maximum in the intersection point of left hand edge
Point, the right margin point of image is connected with coboundary point, is y=a by 2 points of straight lines1x+b1, try to achieve straight line y=ax+b with
Straight line y=a1x+b1Slope, and calculate two linear angle of inclination θ1With tiltangleθ2, try to achieve two differences at inclination angle;In figure
The lower edge of picture, the left hand edge of image, straight line y=a1x+b116 values are taken in the space of composition, by their X-coordinate, Y-coordinate
It is separately summed, obtains coordinate value (m2,n2), by new coordinate value (m1,n1) and coordinate value (m2,n2) connection, try to achieve by 2 points
Straight line be y=a2x+b2, straight line y=a2x+b2Tiltangleθ3, compare the difference and tiltangleθ at two inclinations angle3If, both
Difference be less than 10 °, using two differences at inclination angle as image correction angle.
The preferred embodiments of the invention is the foregoing is only, claims of the invention are not limited to.
Simultaneously it is described above, for those skilled in the technology concerned it would be appreciated that and implement, therefore other be based on institute of the present invention
The equivalent change that disclosure is completed, should be included in the covering scope of the claims.
Useful achievement of the invention is:One aspect of the present invention employs automatic identification technology to reduce artificial input, letter
Change workflow, on the other hand during research is of the invention, different algorithms are employed for different identification objects,
On Research foundation of the invention, the process object being similar to can be understood the rest by analogy, the position of image is adjusted in this, as
The early stage processing procedure of image procossing.
Claims (1)
1. a kind of method for correcting image, it is characterised in that comprise the steps of:
(1) image is split;The subgraph on border up and down is cut according to segmentation theory, the segmentation theory is statistics
The pixel position on the border of the content of image and the pixel coverage of image;The content of image includes the word in image, figure
Piece, form;The pixel position on the border of the content of described image includes coboundary pixel coverage, lower boundary pixel coverage, a left side
Boundary pixel scope, right margin pixel coverage, the coboundary pixel coverage for described image content coboundary, it is described under
Boundary pixel scope is the lower boundary of the content of described image, and the left margin pixel coverage is the left side of the content of described image
Boundary, the right margin pixel coverage is the right margin of the content of described image, and the pixel coverage of described image includes row pixel model
Enclose, row pixel coverage, the row pixel coverage is the line number of image, and the row pixel coverage is the columns of image;
(2) according to the result of (1st) step image segmentation, with the lower boundary pixel coverage and the left margin pixel coverage
Intersection point is origin, sets up the coordinate of image, and abscissa is the lower boundary pixel coverage, and ordinate is the left margin pixel model
Enclose, take the intersection point (x of the coboundary pixel coverage and the left margin pixel coverage1,y1), the lower boundary pixel coverage with
Intersection point (the x of the right margin pixel coverage2,y2), it is y=ax+b, itself and the left margin pixel coverage by 2 points of straight lines
And the lower boundary pixel coverage constitutes the triangle scope of closing, taken in the triangle scope of the closing 16 from
Value is dissipated, the coordinate of the centrifugal pump is added using accumulator, i.e., be added between the abscissa of described centrifugal pump, institute
Addition between the ordinate of centrifugal pump is stated, new coordinate value (m is obtained1,n1);
(3) on the edge of image, the right margin point and coboundary point, the right margin of the content of described image of the content of image are taken
The computational methods of coboundary point of point and described image are:Intersection point with the lower edge of image and the left hand edge of image is as coordinate
Origin, using the lower edge of described image as coordinate X-coordinate, using the left hand edge of described image as coordinate Y-coordinate, institute
State the lower edge of the right margin point of image and the coboundary point respectively content of described image of described image and described image
Intersection point in the maximum point, the content of described image and described image of X-coordinate left hand edge intersection point in Y-coordinate maximum point,
The right margin point of described image is connected with the coboundary point of described image, is y=a by 2 points of straight lines1x+b1, try to achieve straight
Line y=ax+b and straight line y=a1x+b1Slope, and calculate two tiltangleθs of straight line1With tiltangleθ2, try to achieve two and incline
The difference at oblique angle;The left hand edge of lower edge, described image in described image, straight line y=a1x+b116 are taken in the space of composition
Value, their X-coordinate, Y-coordinate are separately summed, and obtain coordinate value (m2,n2), by the new coordinate value (m1,n1) with it is described
Coordinate value (m2,n2) connection, it is y=a to try to achieve by 2 points of straight line2x+b2, straight line y=a2x+b2Inclination angle be θ3, compare
The difference and tiltangleθ at described two inclinations angle3If both differences are less than 10 °, using the difference at described two inclinations angle as image
Correction angle.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611239987.8A CN106780523A (en) | 2016-12-29 | 2016-12-29 | A kind of method for correcting image |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611239987.8A CN106780523A (en) | 2016-12-29 | 2016-12-29 | A kind of method for correcting image |
Publications (1)
Publication Number | Publication Date |
---|---|
CN106780523A true CN106780523A (en) | 2017-05-31 |
Family
ID=58923266
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201611239987.8A Pending CN106780523A (en) | 2016-12-29 | 2016-12-29 | A kind of method for correcting image |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106780523A (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030128280A1 (en) * | 2002-01-04 | 2003-07-10 | Perlmutter Keren O. | Registration of separations |
CN102147919A (en) * | 2010-02-10 | 2011-08-10 | 昆明医学院第一附属医院 | Intraoperative registration method for correcting preoperative three-dimensional image and device |
CN104240259A (en) * | 2014-10-10 | 2014-12-24 | 江苏国光信息产业股份有限公司 | High-speed photographing instrument voucher intelligent edge cutting and correcting system and high-speed photographing instrument voucher intelligent edge cutting and correcting method based on silhouette extraction |
CN106709884A (en) * | 2016-12-25 | 2017-05-24 | 刘震 | Image correction method |
-
2016
- 2016-12-29 CN CN201611239987.8A patent/CN106780523A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030128280A1 (en) * | 2002-01-04 | 2003-07-10 | Perlmutter Keren O. | Registration of separations |
CN102147919A (en) * | 2010-02-10 | 2011-08-10 | 昆明医学院第一附属医院 | Intraoperative registration method for correcting preoperative three-dimensional image and device |
CN104240259A (en) * | 2014-10-10 | 2014-12-24 | 江苏国光信息产业股份有限公司 | High-speed photographing instrument voucher intelligent edge cutting and correcting system and high-speed photographing instrument voucher intelligent edge cutting and correcting method based on silhouette extraction |
CN106709884A (en) * | 2016-12-25 | 2017-05-24 | 刘震 | Image correction method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9824258B2 (en) | Method and apparatus for fingerprint identification | |
CN104268591B (en) | A kind of facial critical point detection method and device | |
US10922794B2 (en) | Image correction method and device | |
TW201941110A (en) | Qr code identifying and reading method and apparatus, and device | |
WO2018082389A1 (en) | Skin colour detection method and apparatus, and terminal | |
CN107808386A (en) | A kind of sea horizon detection method based on image, semantic segmentation | |
CN104008542B (en) | A kind of Fast Corner matching process for specific plane figure | |
WO2018082388A1 (en) | Skin color detection method and device, and terminal | |
CN107564080A (en) | A kind of replacement system of facial image | |
WO2019128495A1 (en) | Method and apparatus for detecting image resolution, storage medium, and electronic device | |
CN111257329A (en) | Smartphone camera defect detection method and detection system | |
CN111062331B (en) | Image mosaic detection method and device, electronic equipment and storage medium | |
CN104574312A (en) | Method and device of calculating center of circle for target image | |
CN103778406A (en) | Object detection method and device | |
CN111798422B (en) | Checkerboard corner recognition method, device, equipment and storage medium | |
CN115497108B (en) | Chinese character framework angular point detection method based on elliptical eccentricity | |
CN109190617A (en) | A kind of rectangle detection method of image, device and storage medium | |
CN116342519A (en) | Image processing method based on machine learning | |
CN109767436B (en) | Method and device for identifying authenticity of seal | |
CN109242854A (en) | A kind of image significance detection method based on FLIC super-pixel segmentation | |
CN115205286A (en) | Mechanical arm bolt identification and positioning method for tower-climbing robot, storage medium and terminal | |
CN106875328A (en) | Image processing method and device | |
CN106709884A (en) | Image correction method | |
CN106469432A (en) | Object extraction method and object extraction equipment | |
CN106530272A (en) | Overlapped protein point separation method and device based on concave point matching |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WD01 | Invention patent application deemed withdrawn after publication | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20170531 |