CN115760595A - Ultra-wide-angle lens photo distortion correction method based on line segment characteristics - Google Patents
Ultra-wide-angle lens photo distortion correction method based on line segment characteristics Download PDFInfo
- Publication number
- CN115760595A CN115760595A CN202211314646.8A CN202211314646A CN115760595A CN 115760595 A CN115760595 A CN 115760595A CN 202211314646 A CN202211314646 A CN 202211314646A CN 115760595 A CN115760595 A CN 115760595A
- Authority
- CN
- China
- Prior art keywords
- line segment
- line
- wide
- angle lens
- image
- 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.)
- Granted
Links
Images
Landscapes
- Image Processing (AREA)
Abstract
The invention discloses a line segment characteristic-based ultra-wide-angle lens photo distortion correction method, and belongs to the technical field of image processing. Which comprises the following steps: extracting line segments from the super-wide-angle lens image to obtain a line segment set; dividing the whole image into a plurality of areas; respectively defining upper, lower, left and right edge regions of an image, and only correcting linear distortion in the regions; respectively acquiring a line segment set positioned in each edge area; dividing the line segment into a plurality of line segment subsets at equal intervals according to the inclination angles of the line segments in the edge region line segment set; searching line segment pairs in the line segment subset to form a matched line segment set; generating a line segment characteristic correction point set; forming a global correction matching point set; and establishing a quadratic polynomial correction model, and correcting the ultra-wide-angle lens image by a least square method. The invention fully utilizes the linear characteristics of the target in the image and completes the image correction by combining the image resampling method, thereby effectively reducing the distortion of the ultra-wide-angle lens of the mobile phone in a scene with the linear target.
Description
Technical Field
The invention belongs to the technical field of image processing, and particularly relates to a method for correcting distortion of a super-wide-angle lens photo based on line segment characteristics.
Background
With the rapid development of smart phones, mobile phone photography gradually enters mass life and becomes a main photographing mode in daily application, so that the convenience of mass photography is greatly improved, and the photographing cost is reduced. In recent years, the ultra-wide-angle lens is gradually applied to smart phones, can bring a larger visual angle and a wider visual field for mobile phone photos, and meanwhile, has a large depth of field for taking photos, and can accommodate more close-range scenes and far-range scenes.
Currently, the maximum viewing angle of the super-wide angle camera of many mobile phones exceeds 100 degrees, and more particularly reaches 150 degrees. Although a super wide-angle lens can capture a larger scene, the resulting picture may have larger distortion, especially near the edge. Most mobile phones can carry out fixed parameter calibration on the ultra-wide-angle lens when leaving a factory, and still have distortion to a certain degree due to the difference of distance of a target in a view field, particularly when the target with obvious linear characteristics is shot. When the ultra-wide-angle photo has an object with obvious linear characteristics, the image can be corrected directly according to the linear characteristics. Therefore, how to correct the image by using the linear characteristics of the super-wide-angle lens photo becomes an urgent problem to be solved.
Disclosure of Invention
The invention aims to provide a line segment characteristic-based ultra-wide-angle lens photo distortion correction method, which fully utilizes the linear characteristics of a target in an image and completes image correction by combining an image resampling method, thereby effectively reducing the distortion of a mobile phone ultra-wide-angle lens in a scene with a linear target.
The technical scheme adopted by the invention is as follows:
a method for correcting the distortion of a super-wide-angle lens photo based on line segment characteristics comprises the following steps:
step 1, extracting line segments from an ultra-wide-angle lens image IM by adopting an LSD algorithm to obtain a line segment set L set ;
Step 2, dividing the whole super wide-angle lens image IM into 4 regions with the number of the regions being 4 x 4, and recording the region of the ith row and the jth column as Z ij ;
Step 3, respectively defining upper, lower, left and right edge regions E of the image top 、E bot 、E lef And E rig Correcting only the linear distortion in the region;
step 4, respectively obtaining the line segment sets L positioned in each edge area through the position relation E ;
Step 5, using the edge region line segment set L E Based on the inclination angle theta of the middle line segment, and dividing L according to the interval d theta E Equal-spacing division into multiple line segment subsets
Step 6, according to the inclination angle and distance constraint of the line segment, on the line segment subsetFinding line segment pair to form matched line segment set
Step 7, based on the obtained matching line segment setGenerating a set of line segment feature correction points P line ;
Step 8, in each sub-area Z of the super wide-angle lens image IM ij Inner uniform selection points to form a global correction matching point set P adj ;
Step 9, correcting the matching point set P according to the universe adj Establishing a quadratic polynomial correction model, and correcting the super wide-angle lens image IM by a least square method to obtain a corrected image IM adj 。
Further, in step 4, L is judged according to the following conditions set Whether the line segment L in (A) belongs to the corresponding line segment set L E :
E∈{E top ,E bot ,E lef ,E rig }
Where N () denotes the number of pixels of the line segment and δ denotes a scale threshold.
wherein int () is rounded up, θ l Indicates the inclination angle, theta, of the line segment l min And theta max Respectively a subset of line segmentsMinimum and maximum values of the pitch of the neutral line.
Further, in step 6, if the line segment subsetTwo line segments l in i And l j If the following conditions are satisfied, it is considered that the segment pair (l) is formed by the segment pairs i ,l j ) Belonging to a set of matching line segments
Where | x | represents the absolute value of θ thr A threshold value representing a difference in inclination angle of the line segment, | represents the length of the line segment, dis () represents the distance between two points, P M The midpoint of the corresponding line segment is indicated, and λ represents the line segment position constraint threshold.
Further, the specific manner of step 7 is as follows:
for a set of matched line segmentsSegment pair (l) in (1) i ,l j ) Taking the line segment closer to the boundary of the edge region E as the line segment l to be corrected a Let l a Respectively as a starting point and an end point ofAndthen the end point of the line segment to be correctedThe calculation of (c) is as follows:
in the formula I a The representation is composed of line segment pairs (l) i ,l j ) The generated line segment, | l to be corrected a I represents l a The length of the line segment of (a),the absolute value of the inclination angle difference is obtained;
there are c sets P of line segment feature correction points line Expressed as:
in the formula (I), the compound is shown in the specification,the pairs of correction points produced by the line segments are indicated,in order to correct the position of the front point,the corrected position of the point.
Further, in step 8, the matching point set P is corrected in the whole domain adj Set of non-line segment region points P noline And line segment characteristic correction point set P line Consists of the following components:
P adj =P noline +P line
in the formula (I), the compound is shown in the specification,is a region Z m Middle point of (Z) m Set of finger and edge line segments L E The disjoint areas are composed of partial edge areas and central areas.
The invention has the following beneficial effects:
(1) The invention provides a line segment characteristic-based ultra-wide-angle lens photo distortion correction method, which can effectively correct an ultra-wide-angle camera image with straight lines at the edge and reduce the distortion of the central area of the image.
(2) The method can effectively extract the linear characteristics, automatically search the matching points to be corrected and provide technical support for automatic image correction.
Drawings
FIG. 1 is a schematic diagram of image region division;
fig. 2 is a schematic diagram illustrating the principle of an ultra-wide angle camera image correction method.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and specific embodiments.
As shown in fig. 2, a method for correcting distortion of a super-wide-angle lens photograph based on line segment characteristics includes the following steps:
step 1, adopting an LSD algorithm to extract line segments from an ultra-wide-angle lens image IM to obtain a line segment set L set . When there are n line segments, it can be expressed as:
L set ={l 1 ,l 2 ,l 3 ...l n }
step 2, dividing the whole image into 4-4 areas, and recording each area as Z ij . In this example, the whole image is divided into 16 regions, the positions and numbers of the regions are shown in FIG. 1, Z ij Can be expressed as:
Z ij ={Z 11 ,Z 12 ,...,Z 44 }
step 3, respectively defining upper, lower, left and right edge regions E of the image top 、E bot 、E lef And E rig Only the linear distortion in the region is corrected, and the defined edge region E is specifically expressed as follows:
E top ={Z 11 ,Z 12 ,Z 13 ,Z 14 }
E bot ={Z 41 ,Z 42 ,Z 43 ,Z 44 }
E lef ={Z 11 ,Z 21 ,Z 31 ,Z 41 }
E rig ={Z 14 ,Z 24 ,Z 34 ,Z 44 }
step 4, respectively obtaining the line segment sets L positioned in each edge area through the position relation E . Calculating only the line segments in the edge region, and judging L set The condition that the line segment l in (1) belongs to the edge region E is as follows:
E∈{E top ,E bot ,E lef ,E rig }
where N () denotes the number of pixels of the line segment and δ denotes a scale threshold.
Step 5, using the edge region line segment set L E Dividing the middle line segment into a plurality of line segment subsets at equal intervals according to the inclination angle theta of the middle line segmentDivision of line segments l into line segment subsetsThe conditions of (a) are as follows:
wherein int () is rounded up, θ l Indicates the inclination angle, theta, of the line segment l min And theta max Respectively a subset of line segmentsMinimum and maximum values of the pitch of the median line.
Step 6, according to the inclination angle and distance constraint of the line segment, on the line segment subsetFinding line segment pair to form matched line segment setLine segment subsetTwo line segments l in i And l j If the following conditions are satisfied, it is considered that the segment pair (l) is composed of the same i ,l j ) Belonging to a set of matched line segmentsThe constraints are as follows:
where | x | represents the absolute value of θ thr A threshold value representing a difference in inclination angle of the line segment, | represents the length of the line segment, dis () represents the distance between two points, P l M The midpoint of the line segment l is indicated and λ represents the line segment position constraint threshold.
Step 7, based on the obtained matching line segment setGenerating a set of line segment feature correction points P line . For matched segment pairs (l) i ,l j ) The line segment closer to the boundary of the edge region E is the line segment l to be corrected a Let l a Respectively as a starting point and an end point ofAndthe position of the corrected point corresponding to the end point of the line segment to be correctedThe calculation method of (c) is as follows:
in the formula I a Is represented by a line segment pair (l) i ,l j ) The generated line segment to be corrected, | | l a I represents l a The length of the line segment of (a),the absolute value of the difference in the tilt angle is shown.
Therefore, when there are c sets P of line segment correction points line Can be expressed as:
in the formula (I), the compound is shown in the specification,the pairs of correction points produced by the line segments are indicated,in order to correct the position of the front point,the corrected position of the point.
Step 8, uniformly selecting points in each sub-region Z of the image to form a global correction matching point set P adj 。P adj Set of non-line segment region points P noline And line segment characteristic correction point set P line Consists of the following components:
P adj =P noline +P line
in the formula (I), the compound is shown in the specification,is a region Z m Middle point of (Z) m Refers to and edge line segment set L E The disjoint areas are mainly composed of partial edge areas and central areas.
Step 9, correcting the matching point set P according to the universe adj Establishing a quadratic polynomial correction model, correcting the super wide-angle lens image by a least square method to obtain a corrected image IM adj . When the global correction matches the point set P adj When the point is formed by r points, the method can be expressed as follows:
P adj ={[(μ 1 ,v 1 ),(x 1 ,y 1 )],...,[(μ r ,v r ),(x r ,y r )]}
wherein (mu) r ,v r ) And (x) r ,y r ) And respectively correcting the pre-correction position and the post-correction position in the r-th pair of matching points.
Then use the correct matching point set P adj The constructed quadratic polynomial expression is as follows:
in the formula, b 00 ,b 01 ,b 02 ,b 11 ,b 12 ,b 22 And e 00 ,e 01 ,e 02 ,e 11 ,e 12 ,e 22 The model coefficients are respectively, and the solution can be carried out through the polynomial.
The final constructed model can be expressed as:
in the formula, (x, y) represents an image IM after correction of the ultra-wide-angle lens adj Point (μ, v) represents a point in the ultra-wide-angle lens image IM to be corrected.
In a word, the ultra-wide angle distortion image correction algorithm provided by the invention is oriented to the situation that the image edge has a straight line and can generate large distortion, the line segment to be corrected is judged through the line segment characteristics, the matching point is automatically extracted, manual intervention and identification are not needed, and important technical support is provided for convenient, rapid and efficient post-processing of the ultra-wide angle lens image.
Claims (6)
1. A super wide-angle lens photo distortion correction method based on line segment characteristics is characterized by comprising the following steps:
step 1, extracting line segments from an ultra-wide-angle lens image IM by adopting an LSD algorithm to obtain a line segment set L set ;
Step 2, dividing the whole super wide-angle lens image IM into 4 regions with the number of the regions being 4 x 4, and recording the region of the ith row and the jth column as Z ij ;
Step 3, respectively definingUpper, lower, left and right edge regions E of the image top 、E bot 、E lef And E rig Correcting only the linear distortion in the region;
step 4, respectively obtaining the line segment sets L positioned in each edge area through the position relation E ;
Step 5, using the edge region line segment set L E Based on the inclination angle theta of the middle line segment, L is divided by the interval d theta E Equidistant division into a plurality of line segment subsets
Step 6, according to the inclination angle and distance constraint of the line segment, on the line segment subsetFinding line segment pair to form matched line segment set
Step 7, based on the obtained matching line segment setGenerating a set of line segment feature correction points P line ;
Step 8, in each sub-area Z of the super wide-angle lens image IM ij Internal uniform selection of points to form a global calibration matching point set P adj ;
Step 9, correcting the matching point set P according to the universe adj Establishing a quadratic polynomial correction model, and correcting the super wide-angle lens image IM by a least square method to obtain a corrected image IM adj 。
2. The method for correcting the distortion of the ultra-wide-angle lens photograph based on the line segment characteristics as claimed in claim 1, wherein in the step 4, L is determined according to the following condition set Whether the line segment L in (A) belongs to the corresponding line segment set L E :
E∈{E top ,E bot ,E lef ,E rig }
Where N () denotes the number of pixels of a line segment and δ denotes a scaling threshold.
3. The method as claimed in claim 2, wherein the line segment subset in step 5 is a line segment subsetThe calculation method of (c) is as follows:
4. The method as claimed in claim 3, wherein in step 6, if the line segment subset is selected, the line segment is selected from the group consisting of a plurality of line segmentsTwo line segments l in i And l j A pair of line segments (A) and (B) satisfying the following conditionl i ,l j ) Belonging to a set of matched line segments
Where | x | represents the absolute value of θ thr A threshold value representing a difference in inclination angle of the line segment, | represents the length of the line segment, dis () represents the distance between two points, P M The midpoint of the corresponding line segment is indicated, and λ represents the line segment position constraint threshold.
5. The method for correcting the distortion of the photograph of the ultra-wide-angle lens based on the line segment characteristics as claimed in claim 4, wherein the specific mode of the step 7 is as follows:
for a set of matched line segmentsSegment pair (l) in (1) i ,l j ) Taking the line segment closer to the boundary of the edge region E as the line segment l to be corrected a Let l a Respectively as a starting point and an end point ofAndthen the end point of the line segment to be correctedThe calculation method of (c) is as follows:
in the formula I a The representation is composed of line segment pairs (l) i ,l j ) The generated line segment to be corrected, | | l a I represents l a The length of the line segment of (a),the absolute value of the inclination angle difference is obtained;
there are c sets P of line segment feature correction points line Expressed as:
6. The method for correcting distortion of ultra-wide-angle lens photograph based on line segment characteristics as claimed in claim 5, wherein in step 8, the global correction matching point set P adj Set of non-line segment region points P noline And line segment characteristic correction point set P line Consists of the following components:
P adj =P noline +P line
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211314646.8A CN115760595B (en) | 2022-10-26 | 2022-10-26 | Super-wide-angle lens photo distortion correction method based on line segment characteristics |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211314646.8A CN115760595B (en) | 2022-10-26 | 2022-10-26 | Super-wide-angle lens photo distortion correction method based on line segment characteristics |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115760595A true CN115760595A (en) | 2023-03-07 |
CN115760595B CN115760595B (en) | 2023-07-21 |
Family
ID=85353225
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211314646.8A Active CN115760595B (en) | 2022-10-26 | 2022-10-26 | Super-wide-angle lens photo distortion correction method based on line segment characteristics |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115760595B (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2006330772A (en) * | 2005-05-23 | 2006-12-07 | Hitachi Zosen Corp | Distortion correction method for photographic image |
US20090088999A1 (en) * | 2005-10-31 | 2009-04-02 | Mitutoyo Corporation | Optical aberration correction for machine vision inspection systems |
CN104537663A (en) * | 2014-12-26 | 2015-04-22 | 广东中科遥感技术有限公司 | Method for rapid correction of image dithering |
CN111667414A (en) * | 2019-03-06 | 2020-09-15 | 厦门雅迅网络股份有限公司 | Image distortion correction method and computer-readable storage medium |
-
2022
- 2022-10-26 CN CN202211314646.8A patent/CN115760595B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2006330772A (en) * | 2005-05-23 | 2006-12-07 | Hitachi Zosen Corp | Distortion correction method for photographic image |
US20090088999A1 (en) * | 2005-10-31 | 2009-04-02 | Mitutoyo Corporation | Optical aberration correction for machine vision inspection systems |
CN104537663A (en) * | 2014-12-26 | 2015-04-22 | 广东中科遥感技术有限公司 | Method for rapid correction of image dithering |
CN111667414A (en) * | 2019-03-06 | 2020-09-15 | 厦门雅迅网络股份有限公司 | Image distortion correction method and computer-readable storage medium |
Non-Patent Citations (2)
Title |
---|
徐丁天等: "基于人眼跟踪的360°悬浮显示系统及其畸变校正方法", 光学学报, vol. 42, no. 9, pages 232 - 240 * |
艾文宇: "光场相机建模与畸变校正改进方法研究", 中国优秀硕士学位论文全文数据库 (基础科学辑), pages 1 - 58 * |
Also Published As
Publication number | Publication date |
---|---|
CN115760595B (en) | 2023-07-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109785291B (en) | Lane line self-adaptive detection method | |
WO2022141178A1 (en) | Image processing method and apparatus | |
CN110493527B (en) | Body focusing method and device, electronic equipment and storage medium | |
CN110223235B (en) | Fisheye monitoring image splicing method based on combination and matching of various characteristic points | |
CN108491786B (en) | Face detection method based on hierarchical network and cluster merging | |
CN108537782B (en) | Building image matching and fusing method based on contour extraction | |
CN106469444B (en) | Rapid image fusion method for eliminating splicing gap | |
CN106683139A (en) | Fisheye-camera calibration system based on genetic algorithm and image distortion correction method thereof | |
CN111899164B (en) | Image splicing method for multi-focal-segment scene | |
CN107492080B (en) | Calibration-free convenient monocular head image radial distortion correction method | |
CN114175091A (en) | Method for optimal body or face protection with adaptive dewarping based on context segmentation layer | |
JP2013536960A (en) | System and method for synthesizing portrait sketches from photographs | |
CN112907580B (en) | Image feature extraction and matching algorithm applied to comprehensive dotted line features in weak texture scene | |
WO2023236508A1 (en) | Image stitching method and system based on billion-pixel array camera | |
CN115205118A (en) | Underwater image splicing method and device, computer equipment and storage medium | |
WO2021142843A1 (en) | Image scanning method and device, apparatus, and storage medium | |
CN113095385B (en) | Multimode image matching method based on global and local feature description | |
CN115760595A (en) | Ultra-wide-angle lens photo distortion correction method based on line segment characteristics | |
CN113298867A (en) | Accurate positioning method and device for ground object target position based on line matching and storage medium | |
CN116823895A (en) | Variable template-based RGB-D camera multi-view matching digital image calculation method and system | |
CN110245674B (en) | Template matching method, device, equipment and computer storage medium | |
CN104036453A (en) | Image local deformation method and image local deformation system and mobile phone with image local deformation method | |
CN116823611A (en) | Multi-focus image-based referenced super-resolution method | |
CN112419172B (en) | Remote sensing image processing method for correcting and deblurring inclined image | |
CN111598940B (en) | Hemispherical photographing center point positioning method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |