CN103268597B - A kind of bearing calibration of pattern distortion - Google Patents
A kind of bearing calibration of pattern distortion Download PDFInfo
- Publication number
- CN103268597B CN103268597B CN201310220100.0A CN201310220100A CN103268597B CN 103268597 B CN103268597 B CN 103268597B CN 201310220100 A CN201310220100 A CN 201310220100A CN 103268597 B CN103268597 B CN 103268597B
- Authority
- CN
- China
- Prior art keywords
- pixel
- correcting image
- image
- prime
- original 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.)
- Expired - Fee Related
Links
Landscapes
- Image Processing (AREA)
- Image Analysis (AREA)
Abstract
The invention discloses a kind of bearing calibration of pattern distortion, comprise the following steps: step 10) obtains raw image data, step 20) set up correcting image, step 40) red value of pixel, green value and blue valve on measuring and calculating correcting image, step 50) set up correcting image: return step 30), until calculate the red value of each pixel on correcting image, green value and blue valve, thus set up correcting image.This bearing calibration is when pattern distortion coefficient is known, reverse measuring and calculating is carried out to each pixel on the image after distortion correction, obtain its position in original image, then bilinear interpolation is utilized to calculate the color value of the red, green, blue of this pixel, trimming process is simple, and efficiency is high.
Description
Technical field
The invention belongs to computer vision and digital photogrammetry field, specifically, relate to a kind of bearing calibration of pattern distortion.
Background technology
Computer vision and digital photogrammetry field usually require to carry out space three-dimensional measurement by image to photographic, wherein, pattern distortion is very large on the impact of measurement result, requires to carry out distortion correction by the distortion factor obtaining image to the coordinate of picture point in measuring process.At present, the forward computing method of the many employings of image distortion correction from original image to correcting image, the method calculates simple early stage, but the interpolation quantity calculation of later stage on correcting image is comparatively large, have impact on the speed of distortion correction.
Summary of the invention
Technical matters: the technical problem to be solved in the present invention is: the bearing calibration that a kind of pattern distortion is provided, this bearing calibration is when pattern distortion coefficient is known, reverse measuring and calculating is carried out to each pixel on the image after distortion correction, obtain its position in original image, then bilinear interpolation is utilized to calculate the color value of the red, green, blue of this pixel, trimming process is simple, and efficiency is high.
Technical scheme: for solving the problems of the technologies described above, the technical solution used in the present invention is:
A bearing calibration for pattern distortion, this bearing calibration comprises the following steps:
Step 10) obtains raw image data, comprises step 101) to step 103):
Step 101) obtain the distortion factor k of original image
1, read picture traverse width and the picture altitude height of original image;
Step 102) to set up with original image center for initial point, horizontal ordinate is x-axis, and ordinate is the coordinates of original image coordinates system o-xy of y-axis; The row i of each pixel in original image and row j and the coordinate relation of this pixel in coordinates of original image coordinates system meet formula (1):
Wherein, x represents the horizontal ordinate of pixel in coordinates of original image coordinates system, and y represents the ordinate of pixel in coordinates of original image coordinates system; I and j is positive integer;
Step 103) read the color value of each pixel in original image, comprise the red value R (i, j) of each pixel, green G (i, j) and blue valve B (i, j);
Step 20) set up correcting image, specifically comprise step 201) to step 203)
Step 201) determine picture traverse and the picture altitude of correcting image: the picture traverse of correcting image equals the picture traverse width of original image, and the picture altitude of correcting image equals the picture altitude width of original image;
Step 202) to give initial value to the color value of pixel each in correcting image be 0;
Step 203) to set up with correcting image center for initial point, horizontal ordinate is x ' axle, and ordinate is the correcting image coordinate system o '-x ' y ' of y ' axle;
Step 30) correcting image is transformed into original image, comprise step 301) and step 302):
Step 301) the row i ' of each pixel in correcting image and row j ' meets formula (2) with the coordinate relation of this pixel in correcting image coordinate system:
Wherein, the horizontal ordinate of x ' expression pixel in correcting image coordinate system, the ordinate of y ' expression pixel in correcting image coordinate system;
Step 302) measuring and calculating correcting image in the coordinate of pixel in coordinates of original image coordinates system;
Step 40) red value of pixel, green value and blue valve on measuring and calculating correcting image, comprise step 401) and step 402)
Step 401) utilize formula (4) to calculate the ranks value of pixel on original image:
Wherein, u represents row, and v represents capable; J represents the integral part of u, and q represents the fraction part of u, and i represents the integral part of v, and p represents the fraction part of v;
Step 402) according to red value, green value and the blue valve of pixel (i ', j ') on formula (5) measuring and calculating correcting image:
Formula (5)
Wherein, R (i ', j ') represent pixel on correcting image (i ', j ') red value, G (i ', j ') represent pixel on correcting image (i ', j ') green value, B (i ', j ') represents the blue valve of pixel on correcting image (i ', j ');
Step 50) set up correcting image: return step 30), until calculate the red value of each pixel on correcting image, green value and blue valve, thus set up correcting image.
Further, described step 302) comprise the following steps:
Step 3021) calculate the radius vector r ' of pixel in correcting image coordinate system on correcting image:
Step 3022) calculate the radius vector difference approximate value Δ r ' of this pixel on original image and correcting image:
Δr′=k
1r′
3
Step 3023) calculate this pixel radius vector r in coordinates of original image coordinates system on original image:
r=r′-Δr′
Step 3024) utilize radius vector on original image, measuring and calculating convergence radius vector distortion Δ r:
Δr=k
1r
3;
Step 3025) comparison step 3022) in approximate radius vector distortion Δ r ' and step 3024) in convergence radius vector distortion Δ r, if when the absolute value of the difference of Δ r ' and Δ r is greater than 0.1, then return step 3023), and by step 3024) the Δ r that calculates of the last time substitutes Δ r ', carries out iterative processing; If when the absolute value of the difference of Δ r ' and Δ r is less than or equal to 0.1, then enter step 3026);
Step 3026) utilize formula (3), the coordinate (x, y) of pixel in coordinates of original image coordinates system in measuring and calculating correcting image:
Wherein, the horizontal ordinate of x ' expression pixel in correcting image coordinate system, the ordinate of y ' expression pixel in correcting image coordinate system; X represents the horizontal ordinate of pixel in coordinates of original image coordinates system, and y represents the ordinate of pixel in coordinates of original image coordinates system.
Beneficial effect: compared with prior art, the present invention has following beneficial effect: the present invention adopts each pixel from correcting image, calculate its position on the original image, and then interpolation on original image, thus calculate the color value of the red, green, blue of this pixel, method is easy, and measuring and calculating speed is fast, and distortion correction efficiency is high.
Accompanying drawing explanation
Fig. 1 is fundamental diagram of the present invention.
Fig. 2 is the original image of the embodiment of the present invention.
Fig. 3 is the correcting image of the embodiment of the present invention.
Embodiment
Below in conjunction with embodiment, technical scheme of the present invention is described in detail.
The bearing calibration of a kind of pattern distortion of the present invention, this bearing calibration comprises the following steps:
Step 10) obtains raw image data, comprises step 101) to step 103).
Step 101) obtain the distortion factor k of original image
1, read picture traverse width and the picture altitude height of original image;
Step 102) to set up with original image center for initial point, horizontal ordinate is x-axis, and ordinate is the coordinates of original image coordinates system o-xy of y-axis; The row i of each pixel in original image and row j and the coordinate relation of this pixel in coordinates of original image coordinates system meet formula (1):
Wherein, x represents the horizontal ordinate of pixel in coordinates of original image coordinates system, and y represents the ordinate of pixel in coordinates of original image coordinates system; I and j is positive integer;
Step 103) read the color value of each pixel in original image, comprise the red value R (i, j) of each pixel, green G (i, j) and blue valve B (i, j).
Step 20) set up correcting image, specifically comprise step 201) to step 203):
Step 201) determine picture traverse and the picture altitude of correcting image: the picture traverse of correcting image equals the picture traverse width of original image, and the picture altitude of correcting image equals the picture altitude width of original image;
Step 202) to give initial value to the color value of pixel each in correcting image be 0;
Step 203) to set up with correcting image center for initial point, horizontal ordinate is x ' axle, and ordinate is the correcting image coordinate system o '-x ' y ' of y ' axle.
Step 30) correcting image is transformed into original image, comprise step 301) and step 302):
Step 301) the row i ' of each pixel in correcting image and row j ' meets formula (2) with the coordinate relation of this pixel in correcting image coordinate system:
Wherein, the horizontal ordinate of x ' expression pixel in correcting image coordinate system, the ordinate of y ' expression pixel in correcting image coordinate system;
Step 302) measuring and calculating correcting image in the coordinate of pixel in coordinates of original image coordinates system, comprise step 3021) to step 3026):
Step 3021) calculate the radius vector r ' of pixel in correcting image coordinate system on correcting image:
Step 3022) calculate the radius vector difference approximate value Δ r ' of this pixel on original image and correcting image:
Δr′=k
1r′
3
Step 3023) calculate this pixel radius vector r in coordinates of original image coordinates system on original image:
r=r′-Δr′
Step 3024) utilize radius vector on original image, measuring and calculating convergence radius vector distortion Δ r:
Δr=k
1r
3;
Step 3025) comparison step 3022) in approximate radius vector distortion Δ r ' and step 3024) in convergence radius vector distortion Δ r, if when the absolute value of the difference of Δ r ' and Δ r is greater than 0.1, then return step 3023), and by step 3024) the Δ r that calculates of the last time substitutes Δ r ', carries out iterative processing; If when the absolute value of the difference of Δ r ' and Δ r is less than or equal to 0.1, then enter step 3026);
Step 3026) utilize formula (3), the coordinate (x, y) of pixel in coordinates of original image coordinates system in measuring and calculating correcting image:
Wherein, the horizontal ordinate of x ' expression pixel in correcting image coordinate system, the ordinate of y ' expression pixel in correcting image coordinate system; X represents the horizontal ordinate of pixel in coordinates of original image coordinates system, and y represents the ordinate of pixel in coordinates of original image coordinates system.
Step 40) red value of pixel, green value and blue valve on measuring and calculating correcting image, comprise step 401) and step 402):
Step 401) utilize formula (4) to calculate the ranks value of pixel on original image:
Wherein, u represents row, and v represents capable; J represents the integral part of u, and q represents the fraction part of u, and i represents the integral part of v, and p represents the fraction part of v;
Step 402) according to red value, green value and the blue valve of pixel (i ', j ') on formula (5) measuring and calculating correcting image:
Formula (5)
Wherein, R (i ', j ') represent pixel on correcting image (i ', j ') red value, G (i ', j ') represent pixel on correcting image (i ', j ') green value, B (i ', j ') represents the blue valve of pixel on correcting image (i ', j ').
Step 50) set up correcting image: return step 30), until calculate the red value of each pixel on correcting image, green value and blue valve, thus set up correcting image.
Bearing calibration of the present invention is based on known image distortion factor k
1as original image.Correcting image is called to the image after original image carries out distortion correction.
Fundamental diagram of the present invention in Fig. 1.In Fig. 1, the image on the left side is original image, and the image on the right is correcting image.As shown in Figure 1, the principle of work of bearing calibration of the present invention is: from each pixel of correcting image, according to distortion factor, calculate this pixel position on the original image, then calculate the color component of this pixel on the original image by the method for bilinear interpolation.
Exemplify an embodiment below.
A width original image (2592 × 1944) as shown in Figure 2, distortion factor k
1=1.98 × 10
-8, adopt the correcting image that bearing calibration of the present invention obtains as shown in Figure 3.With the example that is corrected to of the P ' of on Fig. 3 (being positioned at 199 row, 1669 row), the positive process of effect is described below:
(1) coordinate of P ' in correcting image coordinate system is:
(2) radius vector of P ' on correcting image:
(3) distortion factor k is utilized
1, radius vector difference approximate value Δ r ': Δ r '=k of measuring and calculating P ' on original image and correcting image
1r '
3=12.51.
(4) P ' radius vector r:r=r '-Δ r '=845.55 in coordinates of original image coordinates system are calculated.
(5) convergence radius vector distortion Δ r: Δ r=k is calculated
1r
3=11.97
(6) because Δ r ' and Δ r differ 12.51-11.97=0.54>0.1, with the Δ r ' in Δ r=11.97 iteration above-mentioned steps (4), repeat (4) and (5) two steps, iterations and result as shown in the table:
Iterations | r′ | r | Δr | R calculated value | Remarks |
1 | 858.06 | Unknown | Δr=k 1r′ 3=12.51 | 845.55 | Δ r is calculated with r ' replacement r |
2 | 858.06 | 845.55 | Δr=k 1r 3=11.97 | 846.09 | |
3 | 858.06 | 846.09 | Δr=k 1r 3=11.99 | 846.07 | |
4 | 858.06 | 846.07 | Δr=k 1r 3=11.99 | 846.07 | Convergence |
Finally record r=r '-Δ r '=858.06-11.99=846.07
(7) coordinate of P ' in coordinates of original image coordinates system on correcting image is calculated:
(8) being converted into ranks number is
Get
With
Utilize formula (5) according to the color value of (209,1663), (210,1663), (209,1664), (210,1664) 4 points on original image, calculate the color value that P ' on correcting image (199,1669) puts, thus the correction of complete P '.
Claims (1)
1. a bearing calibration for pattern distortion, is characterized in that, this bearing calibration comprises the following steps:
Step 10) obtain raw image data, comprise step 101) to step 103):
Step 101) obtain the distortion factor k of original image
1, read picture traverse width and the picture altitude height of original image;
Step 102) to set up with original image center for initial point, horizontal ordinate is x-axis, and ordinate is the coordinates of original image coordinates system o-xy of y-axis; The row i of each pixel in original image and row j and the coordinate relation of this pixel in coordinates of original image coordinates system meet formula (1):
Wherein, x represents the horizontal ordinate of pixel in coordinates of original image coordinates system, and y represents the ordinate of pixel in coordinates of original image coordinates system; I and j is positive integer;
Step 103) read the color value of each pixel in original image, comprise the red value R (i, j) of each pixel, green G (i, j) and blue valve B (i, j);
Step 20) set up correcting image, specifically comprise step 201) to step 203):
Step 201) determine picture traverse and the picture altitude of correcting image: the picture traverse of correcting image equals the picture traverse width of original image, and the picture altitude of correcting image equals the picture altitude height of original image;
Step 202) to give initial value to the color value of pixel each in correcting image be 0;
Step 203) to set up with correcting image center for initial point, horizontal ordinate is x ' axle, and ordinate is the correcting image coordinate system o '-x ' y ' of y ' axle;
Step 30) correcting image is transformed into original image, comprise step 301) and step 302):
Step 301) the row i ' of each pixel in correcting image and row j ' meets formula (2) with the coordinate relation of this pixel in correcting image coordinate system:
Wherein, the horizontal ordinate of x ' expression pixel in correcting image coordinate system, the ordinate of y ' expression pixel in correcting image coordinate system;
Step 302) measuring and calculating correcting image in the coordinate of pixel in coordinates of original image coordinates system;
Described step 302) comprise the following steps:
Step 3021) calculate the radius vector r ' of pixel in correcting image coordinate system on correcting image:
Step 3022) calculate the radius vector difference approximate value Δ r ' of this pixel on original image and correcting image:
Δr′=k
1r′
3
Step 3023) calculate this pixel radius vector r in coordinates of original image coordinates system on original image:
r=r′-Δr′
Step 3024) utilize radius vector on original image, measuring and calculating convergence radius vector distortion Δ r:
Δr=k
1r
3;
Step 3025) comparison step 3022) in approximate radius vector distortion Δ r ' and step 3024) in convergence radius vector distortion Δ r, if when the absolute value of the difference of Δ r ' and Δ r is greater than 0.1, then return step 3023), and by step 3024) the Δ r that calculates of the last time substitutes Δ r ', carries out iterative processing; If when the absolute value of the difference of Δ r ' and Δ r is less than or equal to 0.1, then enter step 3026);
Step 3026) utilize formula (3), the coordinate (x, y) of pixel in coordinates of original image coordinates system in measuring and calculating correcting image:
Wherein, the horizontal ordinate of x ' expression pixel in correcting image coordinate system, the ordinate of y ' expression pixel in correcting image coordinate system; X represents the horizontal ordinate of pixel in coordinates of original image coordinates system, and y represents the ordinate of pixel in coordinates of original image coordinates system;
Step 40) red value of pixel, green value and blue valve on measuring and calculating correcting image, comprise step 401) and step 402):
Step 401) utilize formula (4) to calculate the ranks value of pixel on original image:
Wherein, u represents row, and v represents capable;
Step 402) according to red value, green value and the blue valve of pixel (i ', j ') on formula (5) measuring and calculating correcting image:
Formula (5)
Wherein, R (i ', j ') represent pixel on correcting image (i ', j ') red value, G (i ', j ') represent pixel on correcting image (i ', j ') green value, B (i ', j ') represents the blue valve of pixel on correcting image (i ', j '); The integral part of u is the fraction part that j, q represent u, and the integral part of v is the fraction part that i, p represent v;
Step 50) set up correcting image: return step 30), until calculate the red value of each pixel on correcting image, green value and blue valve, thus set up correcting image.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310220100.0A CN103268597B (en) | 2013-06-04 | 2013-06-04 | A kind of bearing calibration of pattern distortion |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310220100.0A CN103268597B (en) | 2013-06-04 | 2013-06-04 | A kind of bearing calibration of pattern distortion |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103268597A CN103268597A (en) | 2013-08-28 |
CN103268597B true CN103268597B (en) | 2015-12-02 |
Family
ID=49012224
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310220100.0A Expired - Fee Related CN103268597B (en) | 2013-06-04 | 2013-06-04 | A kind of bearing calibration of pattern distortion |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103268597B (en) |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104517092B (en) * | 2013-09-29 | 2018-04-03 | 北大方正集团有限公司 | A kind of detection method and system of QR codes correction graph |
CN106033592A (en) * | 2015-03-11 | 2016-10-19 | 株式会社理光 | Copy correction method for original manuscript, original manuscript providing device, copy correction device, and copy correction system of original manuscript |
CN107240064B (en) * | 2016-03-28 | 2021-04-06 | 展讯通信(天津)有限公司 | Image correction method and device and terminal |
CN106251339A (en) * | 2016-07-21 | 2016-12-21 | 深圳市大疆创新科技有限公司 | Image processing method and device |
CN106886982A (en) * | 2017-02-20 | 2017-06-23 | 江苏美伦影像系统有限公司 | CBCT image annular artifact minimizing technologies |
CN108267857B (en) * | 2017-12-29 | 2021-01-12 | 杭州联络互动信息科技股份有限公司 | Distortion correction real-time visual debugging method, device and system |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102236790A (en) * | 2011-05-23 | 2011-11-09 | 杭州华三通信技术有限公司 | Image processing method and device |
CN103124334A (en) * | 2012-12-19 | 2013-05-29 | 四川九洲电器集团有限责任公司 | Lens distortion correction method |
-
2013
- 2013-06-04 CN CN201310220100.0A patent/CN103268597B/en not_active Expired - Fee Related
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102236790A (en) * | 2011-05-23 | 2011-11-09 | 杭州华三通信技术有限公司 | Image processing method and device |
CN103124334A (en) * | 2012-12-19 | 2013-05-29 | 四川九洲电器集团有限责任公司 | Lens distortion correction method |
Non-Patent Citations (1)
Title |
---|
基于控制点鲁棒提取的视觉成像畸变校正方法;刘军等;《东北大学学报(自然科学版)》;20100331;第31卷(第3期);330-333 * |
Also Published As
Publication number | Publication date |
---|---|
CN103268597A (en) | 2013-08-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103268597B (en) | A kind of bearing calibration of pattern distortion | |
CN104182982B (en) | Overall optimizing method of calibration parameter of binocular stereo vision camera | |
CN105678757B (en) | A kind of ohject displacement measuring method | |
CN103983963B (en) | A kind of autoegistration method of multistation ground laser radar data | |
CN104915963B (en) | A kind of detection and localization method for PLCC elements | |
CN102156970B (en) | Fisheye image correction method based on distorted straight slope calculation | |
CN103473771B (en) | A kind of camera scaling method | |
CN105528785A (en) | Binocular visual image stereo matching method | |
CN105139411B (en) | Big visual field camera calibration method based on four sets of conllinear constraint demarcation chis | |
CN103258328B (en) | A kind of center of distortion localization method of wide visual field camera lens | |
CN111160298B (en) | Robot and pose estimation method and device thereof | |
CN103150724B (en) | Segmented model-based camera calibration method | |
CN110415192B (en) | Image distortion correction method for linear array camera of rail train | |
CN104657737B (en) | The method and apparatus being corrected based on cluster to QR image in 2 D code | |
CN104036512A (en) | Novel Tsai's camera calibration improved method based on orthogonal vanishing points | |
CN110688440B (en) | Map fusion method suitable for less sub-map overlapping parts | |
CN107038308A (en) | A kind of regular grid terrain modeling method based on linear interpolation | |
CN105488535B (en) | A kind of three-dimensional point cloud matching process | |
CN100563295C (en) | A kind of image magnification method based on estimation error in the linear interpolation arithmetic | |
CN103411562B (en) | A kind of structured light strip center extraction method based on dynamic programming and average drifting | |
CN107730543B (en) | Rapid iterative computation method for semi-dense stereo matching | |
CN103413306B (en) | A kind of Harris angular-point detection method of adaptive threshold | |
CN103116888A (en) | Method for solving intrinsic parameters of cameras by plane triangles | |
CN117030620A (en) | Method and device for adjusting regional network based on multisource optical remote sensing satellite image | |
CN108537810B (en) | Improved Zernike moment sub-pixel edge detection method |
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 | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20151202 Termination date: 20190604 |