CN108009981A - Optimization method, device and the computer-readable recording medium of distortion parameter - Google Patents

Optimization method, device and the computer-readable recording medium of distortion parameter Download PDF

Info

Publication number
CN108009981A
CN108009981A CN201710885382.4A CN201710885382A CN108009981A CN 108009981 A CN108009981 A CN 108009981A CN 201710885382 A CN201710885382 A CN 201710885382A CN 108009981 A CN108009981 A CN 108009981A
Authority
CN
China
Prior art keywords
parameter
distortion
parameter set
feature point
straight line
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
Application number
CN201710885382.4A
Other languages
Chinese (zh)
Other versions
CN108009981B (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.)
Shenzhen Yicheng Automatic Driving Technology Co Ltd
Original Assignee
Shenzhen Yicheng Automatic Driving Technology Co Ltd
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 Shenzhen Yicheng Automatic Driving Technology Co Ltd filed Critical Shenzhen Yicheng Automatic Driving Technology Co Ltd
Priority to CN201710885382.4A priority Critical patent/CN108009981B/en
Publication of CN108009981A publication Critical patent/CN108009981A/en
Application granted granted Critical
Publication of CN108009981B publication Critical patent/CN108009981B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/04Context-preserving transformations, e.g. by using an importance map
    • G06T3/047Fisheye or wide-angle transformations

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)

Abstract

The invention discloses a kind of optimization method of distortion parameter, including:Obtain the corresponding first parameter set group of fish eye images;Calculate the corresponding first straight line degree error of each parameter set in the first parameter set group;Based on the corresponding parameter set of first straight line degree error for meeting preset condition in the first parameter set group, the corresponding second parameter set group of the fish eye images is generated;Calculate the corresponding second straight line degree error of parameters collection in the first parameter set group;Obtain the corresponding parameter set of straightness error minimum in second straight line degree error, and the target distortion parameter using the distortion parameter in the parameter set got as fish eye images.The invention also discloses the optimization device and computer-readable recording medium of a kind of distortion parameter.The present invention improves the correction accuracy to fish eye images, can effectively utilize line constraint generation calibration result and be more conform with desired image, solid foundation is provided for follow-up image registration.

Description

Optimization method, device and the computer-readable recording medium of distortion parameter
Technical field
The present invention relates to technical field of image processing, more particularly to a kind of optimization method of distortion parameter, device and calculating Machine readable storage medium storing program for executing.
Background technology
The distortion correction of fish eye images is 360 important steps for looking around automobile data recorder, the direct shadow of its correction mass The synthetic effect of panorama birds-eye view is rung, so as to also contribute to the visual determination of driver.Realize the master of fish eye images distortion correction It is to establish fish-eye geometrical model to want step, and wherein equidistant projection model is preferably a kind of model of calibration result.Influence The key of equidistant model is to choose the distortion parameter including the center of distortion of fish eye images and distortion radius.
At present, mainly using the side such as least square fitting, area statistics method, scan line approach method and region growth method Method obtains the parameters such as center of distortion and the distortion radius of fish eye images.But the obtained center of distortion of aforesaid way and distortion half Deviation between footpath, and the center of distortion of fish eye images reality and distortion radius is larger, causes what is obtained after correcting fisheye image The visual effect of image is poor.
The above is only used to facilitate the understanding of the technical scheme, and is not represented and is recognized that the above is existing skill Art.
The content of the invention
It is a primary object of the present invention to provide a kind of optimization method of distortion parameter, device and computer-readable storage medium Matter, it is intended to which the correcting mode for solving existing fish eye images causes the visual effect of the image obtained after correcting fisheye image poor Technical problem.
To achieve the above object, the present invention provides a kind of optimization method of distortion parameter, the optimizing side of the distortion parameter Method comprises the following steps:
The corresponding first parameter set group of fish eye images is obtained, wherein, the first parameter set group includes multigroup parameter set;
According to of the first preset order successively based on the parameter set in the first parameter set group, and the fish eye images One feature point set, calculates the corresponding first straight line degree error of each parameter set in the first parameter set group;
Based on the corresponding parameter set of first straight line degree error for meeting preset condition in the first parameter set group, institute is generated The corresponding second parameter set group of fish eye images is stated, wherein, the second parameter set group includes multigroup parameter set;
According to of the second preset order successively based on the parameter set in the second parameter set group, and the fish eye images One feature point set, calculates the corresponding second straight line degree error of each parameter set in the second parameter set group;
Obtain the corresponding parameter set of straightness error minimum in the second straight line degree error, and the parameter that will be got Target distortion parameter of the distortion parameter of concentration as the fish eye images.
Preferably, it is described according to the first preset order successively based on the parameter set in the first parameter set group, it is and described The fisrt feature point set of fish eye images, calculates the corresponding first straight line degree of each parameter set in the first parameter set group The step of error, includes:
The fisrt feature point set of the fish eye images is obtained according to the first preset rules;
According to the first preset order successively based on the parameter set in the first parameter set group, and the fisrt feature got Point set calculates the second feature point set of target image;
Based on the second feature point set being calculated, the first straight line degree error is calculated.
Preferably, it is described according to the first preset order successively based on the parameter set in the first parameter set group, and get The step of second feature point set of the fisrt feature point set calculating target image, includes:
Obtain the default center point coordinates of the target image;
According to the first preset order successively based on the parameter set in the first parameter set group, the fisrt feature point set and described Default center point coordinates, calculates the second feature point set.
Preferably, it is described based on the second feature point set being calculated, calculate the step of the first straight line degree error Suddenly include:
The first straight line equation and Ge Lie of the second feature point set corresponding each row are calculated according to the first preset rules Second straight line equation;
The coordinate of each characteristic point is concentrated to calculate row error according to the first straight line equation and second feature point, and The coordinate for concentrating each characteristic point according to the second straight line equation and second feature point calculates row error;
Based on first straight line degree error described in each row error and each row error calculation.
Preferably, it is described according to the second preset order successively based on the parameter set in the second parameter set group, it is and described The fisrt feature point set of fish eye images, calculates the corresponding second straight line degree of each parameter set in the second parameter set group The step of error, includes:
Calculated successively based on the parameter set in the second parameter set group, and the fisrt feature point set according to the second preset order The third feature point set of target image;
Based on the third feature point set being calculated, the second straight line degree error is calculated.
Preferably, it is described according to the second preset order successively based on the parameter set in the second parameter set group, and described first The step of third feature point set of feature point set calculating target image, includes:
Obtain the default center point coordinates of the target image;
According to the second preset order successively based on the parameter set in the second parameter set group, the fisrt feature point set and described Default center point coordinates, calculates the third feature point set.
Preferably, the step of acquisition fish eye images corresponding first parameter set group includes:
The adjusting range of centre coordinate, center of distortion based on the fish eye images, calculates the value of center of distortion coordinate Scope;
The scaling coefficient of reference radius and distortion radius based on the fish eye images, calculates the value model of distortion radius Enclose;
Value range, the first adjusting step of value range based on center of distortion coordinate, the radius that distorts, obtain described the One parameter set group.
Preferably, it is described based on the corresponding ginseng of first straight line degree error for meeting preset condition in the first parameter set group Manifold, the step of generating the fish eye images corresponding second parameter set group, include:
Obtain the corresponding parameter set of straightness error of preceding predetermined number minimum in the first straight line degree error;
Successively according to the parameter set and second adjustment step-length got, the second parameter set group is generated.
In addition, to achieve the above object, the present invention also provides a kind of optimization device of distortion parameter, the distortion parameter Optimization device includes:The distortion ginseng that memory, processor and being stored in can be run on the memory and on the processor Several optimizing programs, the optimizing program of the distortion parameter realize the method described in any of the above-described when being performed by the processor The step of.
In addition, to achieve the above object, it is described computer-readable the present invention also provides a kind of computer-readable recording medium The optimizing program of distortion parameter is stored with storage medium, is realized when the optimizing program of the distortion parameter is executed by processor The step of stating the optimization method of any one of them distortion parameter.
The optimization method of distortion parameter in the present embodiment, obtains the corresponding first parameter set group of fish eye images first, its In, the first parameter set group includes multigroup parameter set;Then first parameter set is based on successively according to the first preset order Parameter set in group, and the fisrt feature point set of the fish eye images, calculate each ginseng in the first parameter set group The corresponding first straight line degree error of manifold;Afterwards again based on the first straight line degree for meeting preset condition in the first parameter set group The corresponding parameter set of error, generates the corresponding second parameter set group of the fish eye images, wherein, the second parameter set group includes Multigroup parameter set;Then according still further to the second preset order successively based on the parameter set in the second parameter set group, and the fish The fisrt feature point set of eye pattern picture, the corresponding second straight line degree of each parameter set calculated in the second parameter set group miss Difference;Finally obtain the corresponding parameter set of straightness error minimum in the second straight line degree error, and the parameter that will be got Target distortion parameter of the distortion parameter of concentration as the fish eye images.The optimization method of distortion parameter of the present invention improves pair The low optimization accuracy of distortion parameter, can effectively utilize line constraint generation calibration result and be more conform with desired image, after being Continuous image registration provides solid foundation.
Brief description of the drawings
Fig. 1 is the affiliated terminal of optimization device of distortion parameter in the hardware running environment that the embodiment of the present invention is related to Structure diagram;
Fig. 2 is the flow diagram of the optimization method first embodiment of distortion parameter of the present invention;
Fig. 3 is the parameters calculated in the optimization method second embodiment of distortion parameter of the present invention in first parameter set group The refinement flow diagram for the step of collecting corresponding first straight line degree error;
Fig. 4 is the second feature point set that target image is calculated in the optimization method 3rd embodiment of distortion parameter of the present invention The refinement flow diagram of step;
Fig. 5 is thin the step of calculating first straight line degree error in the optimization method fourth embodiment of distortion parameter of the present invention Change flow diagram;
Fig. 6 is each described in first parameter set group to be calculated in the 5th embodiment of optimization method of distortion parameter of the present invention The refinement flow diagram of the step of parameter set corresponding second straight line degree error;
Fig. 7 is the third feature point set that target image is calculated in the optimization method sixth embodiment of distortion parameter of the present invention The refinement flow diagram of step;
Fig. 8 is that corresponding first parameter set of fish eye images is obtained in the 7th embodiment of optimization method of distortion parameter of the present invention The refinement flow diagram of the step of group;
Fig. 9 is that corresponding second parameter set of fish eye images is generated in the 8th embodiment of optimization method of distortion parameter of the present invention The flow diagram of the step of group;
The embodiments will be further described with reference to the accompanying drawings for the realization, the function and the advantages of the object of the present invention.
Embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
As shown in Figure 1, in the hardware running environment that Fig. 1, which is the embodiment of the present invention, to be related to distortion parameter optimization device The structure diagram of affiliated terminal.
Terminal of the embodiment of the present invention can be PC or smart mobile phone, tablet computer, E-book reader, MP3 (Moving Picture Experts Group Audio Layer III, dynamic image expert's compression standard audio aspect 3) Player, MP4 (Moving Picture Experts Group Audio Layer IV, dynamic image expert's compression standard sound Frequency aspect 4) player, pocket computer etc. have the packaged type terminal device of display function.
As shown in Figure 1, the terminal can include:Processor 1001, such as CPU, network interface 1004, user interface 1003, memory 1005, communication bus 1002.Wherein, communication bus 1002 is used for realization the connection communication between these components. User interface 1003 can include display screen (Display), input unit such as keyboard (Keyboard), optional user interface 1003 can also include standard wireline interface and wireless interface.Network interface 1004 can optionally connect including the wired of standard Mouth, wave point (such as WI-FI interfaces).Memory 1005 can be high-speed RAM memory or the memory of stabilization (non-volatile memory), such as magnetic disk storage.Memory 1005 optionally can also be independently of aforementioned processor 1001 storage device.
Alternatively, terminal can also include camera, RF (Radio Frequency, radio frequency) circuit, sensor, audio Circuit, WiFi module etc..Wherein, sensor ratio such as optical sensor, motion sensor and other sensors.Specifically, light Sensor may include ambient light sensor and proximity sensor, wherein, ambient light sensor can according to the light and shade of ambient light come The brightness of display screen is adjusted, proximity sensor can close display screen and/or backlight when mobile terminal is moved in one's ear.As One kind of motion sensor, gravity accelerometer can detect in all directions the size of (generally three axis) acceleration, quiet It can detect that size and the direction of gravity when only, the application available for identification mobile terminal posture is (such as horizontal/vertical screen switching, related Game, magnetometer pose calibrating), Vibration identification correlation function (such as pedometer, tap) etc.;Certainly, mobile terminal can also match somebody with somebody The other sensors such as gyroscope, barometer, hygrometer, thermometer, infrared ray sensor are put, details are not described herein.
It will be understood by those skilled in the art that the restriction of the terminal structure shown in Fig. 1 not structure paired terminal, can wrap Include than illustrating more or fewer components, either combine some components or different components arrangement.
As shown in Figure 1, it can lead to as in a kind of memory 1005 of computer-readable storage medium including operating system, network Believe the optimizing program of module, Subscriber Interface Module SIM and distortion parameter.
In the terminal shown in Fig. 1, network interface 1004 is mainly used for connecting background server, is carried out with background server Data communication;User interface 1003 is mainly used for connecting client (user terminal), with client into row data communication;And processor 1001 can be used for calling the optimizing program of distortion parameter stored in memory 1005.
In the present embodiment, the optimization device of distortion parameter includes:Memory 1005, processor 1001 and it is stored in described On memory and the optimizing program of distortion parameter that can run on the processor, wherein:
When processor 1001 calls the optimizing program of the distortion parameter stored in memory 1005, following operation is performed:
The corresponding first parameter set group of fish eye images is obtained, wherein, the first parameter set group includes multigroup parameter set;
According to of the first preset order successively based on the parameter set in the first parameter set group, and the fish eye images One feature point set, calculates the corresponding first straight line degree error of each parameter set in the first parameter set group;
Based on the corresponding parameter set of first straight line degree error for meeting preset condition in the first parameter set group, institute is generated The corresponding second parameter set group of fish eye images is stated, wherein, the second parameter set group includes multigroup parameter set;
According to of the second preset order successively based on the parameter set in the second parameter set group, and the fish eye images One feature point set, calculates the corresponding second straight line degree error of each parameter set in the second parameter set group;
Obtain the corresponding parameter set of straightness error minimum in the second straight line degree error, and the parameter that will be got Target distortion parameter of the distortion parameter of concentration as the fish eye images.
Further, processor 1001 can call the optimizing program of the distortion parameter stored in memory 1005, also hold The following operation of row:
The fisrt feature point set of the fish eye images is obtained according to the first preset rules;
According to the first preset order successively based on the parameter set in the first parameter set group, and the fisrt feature got Point set calculates the second feature point set of target image;
Based on the second feature point set being calculated, the first straight line degree error is calculated.
Further, processor 1001 can call the optimizing program of the distortion parameter stored in memory 1005, also hold The following operation of row:
Obtain the default center point coordinates of the target image;
According to the first preset order successively based on the parameter set in the first parameter set group, the fisrt feature point set and described Default center point coordinates, calculates the second feature point set.
Further, processor 1001 can call the optimizing program of the distortion parameter stored in memory 1005, also hold The following operation of row:
The first straight line equation and Ge Lie of the second feature point set corresponding each row are calculated according to the first preset rules Second straight line equation;
The coordinate of each characteristic point is concentrated to calculate row error according to the first straight line equation and second feature point, and The coordinate for concentrating each characteristic point according to the second straight line equation and second feature point calculates row error;
Based on first straight line degree error described in each row error and each row error calculation.
Further, processor 1001 can call the optimizing program of the distortion parameter stored in memory 1005, also hold The following operation of row:
Calculated successively based on the parameter set in the second parameter set group, and the fisrt feature point set according to the second preset order The third feature point set of target image;
Based on the third feature point set being calculated, the second straight line degree error is calculated.
Further, processor 1001 can call the optimizing program of the distortion parameter stored in memory 1005, also hold The following operation of row:
Obtain the default center point coordinates of the target image;
According to the second preset order successively based on the parameter set in the second parameter set group, the fisrt feature point set and described Default center point coordinates, calculates the third feature point set.
Further, processor 1001 can call the optimizing program of the distortion parameter stored in memory 1005, also hold The following operation of row:
The adjusting range of centre coordinate, center of distortion based on the fish eye images, calculates the value of center of distortion coordinate Scope;
The scaling coefficient of reference radius and distortion radius based on the fish eye images, calculates the value model of distortion radius Enclose;
Value range, the first adjusting step of value range based on center of distortion coordinate, the radius that distorts, obtain described the One parameter set group.
Further, processor 1001 can call the optimizing program of the distortion parameter stored in memory 1005, also hold The following operation of row:
Obtain the corresponding parameter set of straightness error of preceding predetermined number minimum in the first straight line degree error;
Successively according to the parameter set and second adjustment step-length got, the second parameter set group is generated.
First embodiment of the invention provides a kind of optimization method of distortion parameter, and with reference to Fig. 2, Fig. 2 joins for present invention distortion The flow diagram of several optimization method first embodiments, the optimization method of the distortion parameter include:
Step S100, obtains the corresponding first parameter set group of fish eye images, wherein, the first parameter set group includes multigroup Parameter set;
The distortion correction of fish eye images is put down firstly the need of fish-eye geometrical model is established further according to geometrical relationship Face perspective projection correction.Used in the present embodiment using equidistant projection model, this geometrical model in camera lens manufacture It is most extensive, and carry out preferably a kind of geometrical model of effect during correcting fisheye image.Due to the correcting fisheye image of the present invention Using equidistant projection model in method, therefore its distortion parameter is mainly center of distortion coordinate and the distortion half of fish eye images Footpath, center of distortion coordinate can be refined as the X-coordinate of horizontal direction and the Y-coordinate of vertical direction again.Fish eye images corresponding One parameter set group includes multigroup parameter set, wherein, each group of parameter set all includes 3 kinds of distortion parameters, and the first distortion parameter refers to The used distortion parameter when first time determining distortion parameter scope.
In the present embodiment, center of distortion point coordinates value range and the radius that distorts can be set to take according to preset rules It is worth scope, while one the first adjusting step of the parameter setting such as resolution ratio according to fish eye images, it is preferable that in the present embodiment Fish eye images resolution ratio is 1280 × 720, therefore the first adjusting step is arranged to 10.Wherein, center of distortion point coordinates value Scope and the calculation formula of value range for the radius that distorts are respectively:
CenterX ∈ [ImgCenterX-Range, ImgCenterX+Range]
CenterY ∈ [ImgCenterY-Range, ImgCenterY+Range]
R ∈ [REFER_R*MinCoe, REFER_R*MaxCoe]
Wherein, Center X and Center Y are required center of distortion X-coordinate and Y-coordinate, and R is required distortion half Footpath, ImgCenterX and ImgCenterY are the central point X-coordinate and Y-coordinate of fish eye images to be corrected, and REFER_F is user's root According to the reference radius set by the size of fish eye images to be corrected, it is preferable that point of the fish eye images to be corrected in the present embodiment Resolution is 1280 × 720, therefore reference radius is arranged to 600.Range is the adjusting range of center of distortion, it is preferable that this reality It is 100 to apply the Range values in example.MaxCoe and MinCoe is respectively the scaling coefficient of distortion radius, it is preferable that this implementation MaxCoe and MinCoe in example are respectively 1.2 and 0.8.For example, the fish-eye image to be corrected that a resolution ratio is 1280 × 720 The centre coordinate of picture is (640,360), and the adjusting range of center of distortion is 100, can obtain the value of center of distortion point X-coordinate Scope is (540,740), and the value range of center of distortion point Y-coordinate is (260,460);The value of reference radius is 600, then is divided Be not multiplied by scaling coefficient can obtain distortion radius value range be (480,720).Due in the present embodiment, adjusting step Value be 10, according to adjusting step travel through three the first distortion parameters value range can obtain their value set, The value set of center of distortion point X-coordinate respectively, i.e. CenterX ∈ { 540,550,560...730,740 }, center of distortion The value set of point Y-coordinate, i.e. CenterY ∈ { 260,270,280...450,460 }, and the value collection of distortion radius R Close, i.e. R ∈ { 480,490,500...700,710,720 }.
Afterwards, operation is combined to the element in the value set of the first distortion parameter of above three so that wherein every One element can carry out all possible combination with the element in two other set, wherein, total combined number is equal to The element number that element number in the point X-coordinate value set of center of distortion is multiplied by the point Y-coordinate value set of center of distortion multiplies With the element number in the radius R value set that distorts.For example, 2 elements are included in the value set of center of distortion point X-coordinate, It is [1,2] that 2 elements are included in the value set of center of distortion point Y-coordinate, are [3,4] respectively respectively, the value for the radius that distorts 2 elements [5,6] are included in set, then after permutation and combination is carried out to the value set of first distortion parameter, can be obtained To the combination of all possible distortion parameter include:(1,3,5), (2,3,5), (Isosorbide-5-Nitrae, 5), (2,4,5), (1,3,6), (2, 3,6), (Isosorbide-5-Nitrae, 6), (2,4,6).By the value set of all first distortion parameters obtain after permutation and combination it is all can The combination of energy, is the first parameter set group, wherein comprising multigroup parameter set, each parameter set includes three parameters, is respectively Center of distortion point X-coordinate, center of distortion point Y-coordinate and distortion radius R.
Step S200, according to the first preset order successively based on the parameter set in the first parameter set group and the flake The fisrt feature point set of image, the corresponding first straight line degree of each parameter set calculated in the first parameter set group miss Difference;
The present embodiment is merely able to, and the chessboard cloth angle point on to fish eye images to be corrected obtains by way of demarcating Fisrt feature point set.Preferably, in the present embodiment by the way of black and white chessboard calibration to the spy on fish eye images to be corrected Sign point set is demarcated and is determined as fisrt feature point set.M row N row feature point sets can be got on fish eye images to be corrected {(uij, vij), 0≤i<M, 0≤j<N, wherein uijFor abscissa of this on fish eye images, vijIt is the point in fish eye images On ordinate.
Processor can select all parameter sets from the first parameter set group successively according to the first preset order, based on parameter set Calculate the corresponding second feature point set of fisrt feature point set.First preset order refers to the value collection from center of distortion point X-coordinate In conjunction according to from small to large take out a value in turn and then successively from the value set of center of distortion point Y-coordinate and abnormal Become in the set of radius R according to the ginseng for taking out a value in turn and being combined in one the first parameter set group of generation from small to large Manifold, until taking all possible situation, it is readily appreciated that, three parameters in the first distortion parameter can use from big to small It is smooth or from small to large be smoothed out value, therefore, the first preset order can be above three parameter value order Any combination, its process is similar with the above process, and details are not described herein.For a specific parameter set (CenterX, CenterY, R), each that fisrt feature point is concentrated can be calculated according to the following equation out and put corresponding second feature point set In corresponding point:
Wherein, (u, v) is a bit on fish eye images to be corrected, and (x, y) is a bit on image after correcting, (AmdImgCenterX, AmdImgCenterY) be default correction after picture centre point coordinates, (CenterX, CenterY) For center of distortion coordinate, R is distortion radius.According to above-mentioned formula, fisrt feature point can be calculated and concentrate any one of extraction A fish eye images characteristic point { (uij, vij) corresponding to correction after image second feature point concentrate point { (xij, yij), 0≤i< M, 0≤j<N.
Based on the second feature point set being calculated, straightness error is calculated.Since the distortion at fish eye images center is opposite Minimum, therefore most middle 2 points chosen per a line can determine M linear equation fm(x), 0≤m<M, based on the M straight line The all elements of equation and second feature point set point, the horizontal direction straightness that can calculate all the points according to the following equation miss Difference:
Similarly, N number of linear equation f can be determined by choosing each most middle 2 points of rown(x), 0≤n<N is N number of straight based on this The all elements of line equation and second feature point set point, can calculate the vertical direction straightness of all the points according to the following equation Error:
The straightness error of straightness error and vertical direction based on above-mentioned horizontal direction, can obtain according to the following equation To total straightness error:
Error=Errorhor+Errorver
The total straightness error being calculated is the straightness error of the specific set of parameters.For the first parameter set group In any one parameter set, corresponding first straight line degree error can be calculated according to above-mentioned steps and formula.
Step S300, based on the corresponding parameter of first straight line degree error for meeting preset condition in the first parameter set group Collection, generates the corresponding second parameter set group of the fish eye images, wherein, the second parameter set group includes multigroup parameter set;
After the corresponding first straight line degree error group of all parameter sets in obtaining the first parameter set group, it is arranged Sequence, exports the corresponding parameter set of preceding Z straightness error of minimum.Preferably, exported in the present embodiment after sequence terminates Three groups of parameter sets of straightness error minimum, afterwards readjust it according to preset rules, so as to obtain new parameter The value range of collection.In the present embodiment, user can according to preset formula arrange parameter concentrate center of distortion point coordinates and The adjusting range of distortion radius, concurrently sets a second adjustment step-length, it is preferable that the second adjustment step-length in the present embodiment is set It is set to 1.Preset rules mainly include 3 formula:
CenterX∈[CenterXk- NEW_RANGE, CenterXk+NEW_RANGE]
CenterY∈[CenterYk- NEW_RANGE, CenterYk+NEW_RANGE]
R ∈ [R-NEW_RANGE, R+NEW_RANGE]
Wherein, NEW_RANGE is new parameter adjustment scope, it is preferable that NEW_RANGE is arranged to 10 in the present embodiment, I.e. new value range is adjusted to 10, and each parameter adjustment step-length is 1, i.e. PARAMS_STEP is 1.Second distortion parameter refers to The distortion parameter got based on the first distortion parameter, including center of distortion X-coordinate, center of distortion Y-coordinate and distortion radius This 3 parameters.For the distortion parameter in each parameter set, processor can be pressed in the adjusting range of the distortion parameter Whole value range is traveled through from small to large successively according to second adjustment step-length.For each distortion parameter, take all After possible values, all numerical value got are put into the set of establishment, generate the second distortion parameter of the fish eye images Corresponding second parameter set group, including, the value set of the X-coordinate of center of distortion, the value set of the Y-coordinate of center of distortion, And the value set of distortion radius.For example, preceding 3 parameter set groups of straightness error minimum are (Isosorbide-5-Nitraes, 7), (2,5,8), (3, 6,9), it is meant that the corresponding center of distortion X-coordinate of first three minimum straightness error includes [1,2,3], center of distortion Y-coordinate Including [4,5,6], distortion radius R includes [7,8,9], and a distortion ginseng is generated all in accordance with preset rules to each of which value Several value ranges, can generate the value range of [- 9,11] when center of distortion X-coordinate takes 1, simultaneously because second adjustment walks Long value be 1, can obtain corresponding center of distortion X-coordinate when center of distortion X coordinates take 1 value range -9, -8 ..., 0,1,2 ..., 10,11 }, correspondingly, the value of corresponding center of distortion X-coordinate when center of distortion X-coordinate takes 2 can be obtained Scope -8, -7 ..., 1,2,3 ... and 11,12 }, the value model of corresponding center of distortion X-coordinate when center of distortion X-coordinate takes 3 Enclose -7, -6 ..., 2,3,4 ..., 12,13], after collecting, the value set of center of distortion X-coordinate in the second distortion parameter For [- 9, -8 ..., 0,1,2,3,4 ..., 12,13].Similarly, center of distortion Y-coordinate in the second distortion parameter can be obtained Value collection is combined into [- 6, -5 ..., 3,4,5,6,7 ..., 15,16], and the value for the radius R that distorts in the second distortion parameter Collection is combined into [- 3, -2 ..., 6,7,8,9,10 ..., 18,19].Arrangement group is carried out to the value set of first distortion parameter After conjunction, the combination of available all possible distortion parameter is the first parameter set group, and in the present embodiment, one is shared 23 × 23 × 23 groups of parameter sets, each parameter set include three parameters, are center of distortion point X-coordinate respectively, center of distortion point Y Coordinate and distortion radius R.
Step S400, according to the second preset order successively based on the parameter set in the second parameter set group, and the fish The fisrt feature point set of eye pattern picture, the corresponding second straight line degree of each parameter set calculated in the second parameter set group miss Difference;
Second preset order refers to from the parameters set that the second distortion parameter includes according to order from small to large Value is selected successively form set, specifically, according to from small to large first from the value set of center of distortion point X-coordinate Take out in turn a value and then successively from the value set of center of distortion point Y-coordinate and the set of distortion radius R according to From small to large take out in turn a value be combined generation one the first parameter set group in parameter set, until take it is all can Can situation, it is readily appreciated that, three parameters in the first distortion parameter can use from big to small smooth or from small to large Be smoothed out value, therefore, the first preset order can be above three parameter value order any combination, its process with it is upper It is similar to state process, details are not described herein obtains M row N row fisrt feature point sets according to presetting method on fish eye images to be corrected {(uij, vij), 0≤i<M, 0≤j<N, wherein uijFor abscissa of this on fish eye images, vijIt is the point in fish eye images On ordinate.
Processor can select all parameter sets from the second parameter set group successively according to the second preset order, for a spy Fixed parameter set, can be calculated according to the following equation out each corresponding third feature point set of point of fisrt feature point concentration In corresponding point:
Wherein, (u, v) is a bit on fish eye images to be corrected, and (x, y) is a bit on image after correcting, (AmdImgCenterX, AmdImgCenterY) is picture centre point coordinates after default correction, and (CenterX, CenterY) is Center of distortion coordinate, R are distortion radius.According to above-mentioned formula, fisrt feature point can be calculated and concentrate any one extracted Fish eye images characteristic point { (uij, vij) corresponding to correction after image third feature point concentrate point { (xij, yij), 0≤i<M, 0≤j<N。
Based on the third feature point set being calculated, straightness error is calculated.Since the distortion at fish eye images center is opposite Minimum, therefore most middle 2 points chosen per a line can determine M linear equation fm (x), 0≤m<M, based on the M straight line The all elements of equation and third feature point set point, the horizontal direction straightness that can calculate all the points according to the following equation miss Difference:
Similarly, N number of linear equation fn (x), 0≤n can be determined by choosing each most middle 2 points of row<N is N number of straight based on this The all elements of line equation and third feature point set point, can calculate the vertical direction straightness of all the points according to the following equation Error:
The straightness error of straightness error and vertical direction based on above-mentioned horizontal direction, can obtain according to the following equation To total straightness error:
Error=Errorhor+Errorver
The total straightness error being calculated is the straightness error of the specific set of parameters.For the first parameter set group In any one parameter set, corresponding second straight line degree error can be calculated according to above-mentioned steps and formula.
Step S500, obtains the corresponding parameter set of straightness error minimum in the second straight line degree error, and will obtain Target distortion parameter of the distortion parameter as the fish eye images in the parameter set got.
After the corresponding second straight line degree error group of all parameter sets in obtaining the second parameter set group, it is arranged Sequence, exports the corresponding parameter set of straightness error of minimum.The distortion parameter that the parameter set includes is determined as fish eye images Target distortion parameter.
The optimization method of distortion parameter in the present embodiment, by obtaining the corresponding first parameter set group of fish eye images, its In, the first parameter set group includes multigroup parameter set;Then first parameter set is based on successively according to the first preset order Parameter set in group, and the fisrt feature point set of the fish eye images, calculate each ginseng in the first parameter set group The corresponding first straight line degree error of manifold;It is next based on meeting in the first parameter set group that the first straight line degree of preset condition misses The corresponding parameter set of difference, generates the corresponding second parameter set group of the fish eye images, wherein, the second parameter set group includes more Group parameter set;Afterwards according still further to the second preset order successively based on the parameter set in the second parameter set group, and the flake The fisrt feature point set of image, the corresponding second straight line degree of each parameter set calculated in the second parameter set group miss Difference;Then the corresponding parameter set of straightness error minimum in the second straight line degree error, and the ginseng that will be got are obtained again Target distortion parameter of the distortion parameter as the fish eye images in manifold, improves the low optimization accuracy and standard to distortion parameter Exactness, avoids the shortcomings that existing method depends on fish eye images circular contour, can effectively utilize line constraint generation school Plus effect is more conform with desired image, and solid foundation is provided for follow-up image registration.
Based on first embodiment, the second embodiment of the optimization method of proposition distortion parameter of the present invention, with reference to Fig. 3, at this In embodiment, step S200 includes:
Step S210, the fisrt feature point set of the fish eye images is obtained according to the first preset rules;
The method for obtaining fisrt feature point set is to the chessboard cloth angle point on fish eye images to be corrected according to presetting method Demarcated, so as to obtain the feature point set of fish eye images to be corrected.Preferably, in the present embodiment using black and white chessboard calibration Method the feature point set on fish eye images to be corrected is demarcated and is determined as fisrt feature point set.In fish-eye image to be corrected M row N row feature point sets { (uij, vij) }, 0≤i can be got on picture<M, 0≤j<N, wherein uij are the point in fish-eye image As upper abscissa, vij is ordinate of this on fish eye images.
Step S220, according to the first preset order successively based on the parameter set in the first parameter set group, and the institute got State the second feature point set that fisrt feature point set calculates target image;
Processor can select all parameter sets from the first parameter set group successively according to the first preset order, based on parameter set Calculate the corresponding second feature point set of fisrt feature point set.First preset order refers to the value collection from center of distortion point X-coordinate In conjunction according to from small to large take out a value in turn and then successively from the value set of center of distortion point Y-coordinate and abnormal Become in the set of radius R according to the ginseng for taking out a value in turn and being combined in one the first parameter set group of generation from small to large Manifold, until taking all possible situation, it is readily appreciated that, three parameters in the first distortion parameter can use from big to small It is smooth or from small to large be smoothed out value, therefore, the first preset order can be above three parameter value order Any combination, its process is similar with the above process, and details are not described herein.For a specific parameter set (CenterX, CenterY, R), each that fisrt feature point is concentrated can be calculated according to the following equation out and put corresponding second feature point set In corresponding point:
Wherein, (u, v) is a bit on fish eye images to be corrected, and (x, y) is a bit on image after correcting (AmdImgCenterX, AmdImgCenterY) be default correction after picture centre point coordinates, (CenterX, CenterY) For center of distortion coordinate, R is distortion radius.According to above-mentioned formula, fisrt feature point can be calculated and concentrate any one of extraction The point { (xij, yij) } that image second feature point is concentrated after correction corresponding to a fish eye images characteristic point { (uij, vij) }, 0 ≤i<M, 0≤j<N.
Step S230, based on the second feature point set being calculated, calculates the first straight line degree error.
Based on the second feature point set being calculated, straightness error is calculated.Since the distortion at fish eye images center is opposite Minimum, therefore most middle 2 points chosen per a line can determine M linear equation fm (x), 0≤m<M, based on the M straight line The all elements of equation and second feature point set point, the horizontal direction straightness that can calculate all the points according to the following equation miss Difference:
Similarly, N number of linear equation fn (x), 0≤n can be determined by choosing each most middle 2 points of row<N is N number of straight based on this The all elements of line equation and second feature point set point, can calculate the vertical direction straightness of all the points according to the following equation Error:
The straightness error of straightness error and vertical direction based on above-mentioned horizontal direction, can obtain according to the following equation To total straightness error:
Error=Errorhor+Errorver
The total straightness error being calculated is the straightness error of the specific set of parameters.For the first parameter set group In any one parameter set, corresponding first straight line degree error can be calculated according to above-mentioned steps and formula.
The optimization method of distortion parameter in the present embodiment, by obtaining the fish eye images according to the first preset rules Fisrt feature point set;Then according to the first preset order successively based on the parameter set in the first parameter set group, and the institute got State the second feature point set that fisrt feature point set calculates target image;Afterwards again based on the second feature point being calculated Collection, calculates the first straight line degree error, improves the accuracy of the second parameter set group, and then can improve first straight line degree mistake The accuracy of difference, further increases low optimization accuracy and the accuracy of distortion parameter.
Based on second embodiment, the 3rd embodiment of the optimization method of proposition distortion parameter of the present invention, with reference to Fig. 4, at this In embodiment, step S220 includes:
Step S221, obtains the default center point coordinates of the target image;
Since target image needs to meet certain size requirement after the corresponding correction of fish eye images, in distortion parameter Searching process before, can judge as the case may be correction after target image size, and then determine target image it is pre- If center point coordinate.
Step S222, according to the first preset order successively based on the parameter set in the first parameter set group, the fisrt feature Point set and the default center point coordinates, calculate the second feature point set.
Processor can select all parameter sets from the first parameter set group successively according to the first preset order, based on parameter set Calculate the corresponding second feature point set of fisrt feature point set.First preset order refers to the value collection from center of distortion point X-coordinate In conjunction according to from small to large take out a value in turn and then successively from the value set of center of distortion point Y-coordinate and abnormal Become in the set of radius R according to the ginseng for taking out a value in turn and being combined in one the first parameter set group of generation from small to large Manifold, until taking all possible situation, it is readily appreciated that, three parameters in the first distortion parameter can use from big to small It is smooth or from small to large be smoothed out value, therefore, the first preset order can be above three parameter value order Any combination, its process is similar with the above process, and details are not described herein.For a specific parameter set (CenterX, CenterY, R), each that fisrt feature point is concentrated can be calculated according to the following equation out and put corresponding second feature point set In corresponding point:
Wherein, (u, v) is a bit on fish eye images to be corrected, and (x, y) is a bit on image after correcting, (AmdImgCenterX, AmdImgCenterY) be default correction after picture centre point coordinates, (CenterX, CenterY) For center of distortion coordinate, R is distortion radius.According to above-mentioned formula, fisrt feature point can be calculated and concentrate any one of extraction The point { (xij, yij) } that image second feature point is concentrated after correction corresponding to a fish eye images characteristic point { (uij, vij) }, 0 ≤i<M, 0≤j<N.
The optimization method of distortion parameter in the present embodiment, by the default center point coordinates for obtaining the target image; Then according to the first preset order successively based on the parameter set in the first parameter set group, the fisrt feature point set and described default Center point coordinate, calculates the second feature point set;First has been calculated based on each parameter set in the second parameter set group The corresponding second feature point set of feature point set, can be accurately obtained second feature point set, improve the standard of the second parameter set group Exactness, and then can improve the accuracy of first straight line degree error, further increases the low optimization accuracy of distortion parameter and accurate Degree.
Based on second embodiment, the fourth embodiment of the optimization method of proposition distortion parameter of the present invention, with reference to Fig. 5, at this In embodiment, step S230 includes:
Step S231, the first straight line equation of the corresponding each row of the second feature point set is calculated according to the second preset rules With the second straight line equation of each row;
Since the distortion at fish eye images center is relatively minimal, can be determined by choosing at most middle 2 points per a line by M Linear equation fm (x), 0≤m<M;Similarly, N number of linear equation fn (x), 0≤n can be determined by choosing each most middle 2 points of row< N.Second preset rules refer to 2 points of equations that can determine straight line in plane, since the two point form equation is existing skill Art, details are not described herein.
If the feature points of the row or column are even number, most middle 2 points of calculating linear equation is selected;If the row or The feature points of row are odd number, select the characteristic point of most middle both sides to calculate linear equation.
Step S232, the coordinate for concentrating each characteristic point according to the first straight line equation and second feature point calculate Row error, and concentrate the coordinate of each characteristic point to calculate row error according to the second straight line equation and second feature point;
All elements point based on the M linear equation and second feature point set, can calculate institute according to the following equation Horizontal direction straightness error a little:
Similarly, all elements point based on N number of linear equation and second feature point set, can calculate according to the following equation Go out the vertical direction straightness error of all the points:
Step S233, based on first straight line degree error described in each row error and each row error calculation.
The straightness error of straightness error and vertical direction based on above-mentioned horizontal direction, can obtain according to the following equation To total straightness error:
Error=Errorhor+Errorver
The total straightness error being calculated is the straightness error of the specific set of parameters.For the first parameter set group In any one parameter set, corresponding first straight line degree error can be calculated according to above-mentioned steps and formula.
The optimization method of distortion parameter in the present embodiment, is first according to the second preset rules and calculates the second feature point Collect the first straight line equation of corresponding each row and the second straight line equation of Ge Lie;Then according to the first straight line equation and described Second feature point concentrates the coordinate of each characteristic point to calculate row error, and according to the second straight line equation and the second feature Point concentrates the coordinate of each characteristic point to calculate row error;It is based on each row error and each row error calculation again afterwards The first straight line degree error.All parameter sets have been carried out to screen for the first time using the method for comparing first straight line degree error, Retain qualified parameter set and carry out next step screening, improve the Searching efficiency of distortion parameter, improve first straight line degree The accuracy of error, further increases low optimization accuracy and the accuracy of distortion parameter, save technical staff time and The limited resources of processor.
Based on first embodiment, the 5th embodiment of the optimization method of proposition distortion parameter of the present invention, with reference to Fig. 6, at this In embodiment, step S400 includes:
Step S410, according to the second preset order successively based on the parameter set in the second parameter set group, and first spy Levy the third feature point set that point set calculates target image;
Second preset order refers to from the parameters set that the second distortion parameter includes according to order from small to large Value is selected successively form set, specifically, according to from small to large first from the value set of center of distortion point X-coordinate Take out in turn a value and then successively from the value set of center of distortion point Y-coordinate and the set of distortion radius R according to From small to large take out in turn a value be combined generation one the first parameter set group in parameter set, until take it is all can The situation of energy.
After getting fisrt feature point set, processor can be selected from the second parameter set group successively according to the second preset order Go out all parameter sets, for a specific parameter set, the every of fisrt feature point concentration can be calculated according to the following equation out The corresponding third feature point of one point concentrates corresponding point:
Wherein, (u, v) is a bit on fish eye images to be corrected, and (x, y) is a bit on image after correcting, (AmdImgCenterX, AmdImgCenterY) be default correction after picture centre point coordinates, (CenterX, CenterY) For center of distortion coordinate, R is distortion radius.According to above-mentioned formula, fisrt feature point can be calculated and concentrate any one of extraction The point { (xij, yij) } that image third feature point is concentrated after correction corresponding to a fish eye images characteristic point { (uij, vij) }, 0 ≤i<M, 0≤j<N.
Step S420, based on the third feature point set being calculated, calculates the second straight line degree error.
Based on the third feature point set being calculated, straightness error is calculated.Since the distortion at fish eye images center is opposite Minimum, therefore most middle 2 points chosen per a line can determine M linear equation fm (x), 0≤m<M, based on the M straight line The all elements of equation and third feature point set point, the horizontal direction straightness that can calculate all the points according to the following equation miss Difference:
Similarly, N number of linear equation fn (x), 0≤n can be determined by choosing each most middle 2 points of row<N is N number of straight based on this The all elements of line equation and third feature point set point, can calculate the vertical direction straightness of all the points according to the following equation Error:
The straightness error of straightness error and vertical direction based on above-mentioned horizontal direction, can obtain according to the following equation To total straightness error:
Error=Errorhor+Errorver
The total straightness error being calculated is the straightness error of the specific set of parameters.For the first parameter set group In any one parameter set, corresponding second straight line degree error can be calculated according to above-mentioned steps and formula.
The optimization method of distortion parameter in the present embodiment, is first according to the second preset order and is based on the second parameter set successively Parameter set in group, and the fisrt feature point set calculate the third feature point set of target image;It is then based on what is be calculated The third feature point set, calculates the second straight line degree error.The calculating of second straight line degree error is to be based on the second parameter set What group was calculated, the small but excellent degree of parameters obtained collection scope is high, can get the parameter being not included in the first parameter set group Collect data, improve low optimization accuracy and the accuracy of distortion parameter, further increase the accuracy to correcting fisheye image.
Based on the 5th embodiment, the sixth embodiment of the optimization method of proposition distortion parameter of the present invention, with reference to Fig. 7, at this In embodiment, step S410 includes:
Step S411, obtains the default center point coordinates of the target image;
Since target image needs to meet certain size requirement after the corresponding correction of fish eye images, in distortion parameter Searching process before, can judge as the case may be correction after target image size, and then determine target image it is pre- If center point coordinate.
Step S412, according to the second preset order successively based on the parameter set in the second parameter set group, the fisrt feature Point set and the default center point coordinates, calculate the third feature point set.
Processor can select all parameter sets from the second parameter set group successively according to the second preset order, for a spy Fixed parameter set, can be calculated according to the following equation out each corresponding third feature point set of point of fisrt feature point concentration In corresponding point:
Wherein, (u, v) is a bit on fish eye images to be corrected, and (x, y) is a bit on image after correcting, (AmdImgCenterX, AmdImgCenterY) be default correction after picture centre point coordinates, (CenterX, CenterY) For center of distortion coordinate, R is distortion radius.According to above-mentioned formula, fisrt feature point can be calculated and concentrate any one of extraction The point { (xij, yij) } that image third feature point is concentrated after correction corresponding to a fish eye images characteristic point { (uij, vij) }, 0 ≤i<M, 0≤j<N.
The optimization method of distortion parameter in the present embodiment, by the default center point coordinates for obtaining the target image; Then according to the first preset order successively based on the parameter set in the second parameter set group, the fisrt feature point set and described default Center point coordinate, calculates the third feature point set.Second parameter set group optimizes to obtain based on the first parameter set group, can be with So that third feature point set is optimized on the basis of second feature point set, the precision of third feature point set is improved, so that Improve the optimizing quality of distortion parameter.
Based on first embodiment, the 7th embodiment of the optimization method of proposition distortion parameter of the present invention, with reference to Fig. 8, at this In embodiment, step S100 includes:
Step S110, the adjusting range of centre coordinate, center of distortion based on the fish eye images, calculates center of distortion and sits Target value range;
User can set distortion based on the center point coordinate of fish eye images to be corrected and the adjusting range of center of distortion The value range of centre coordinate.The adjusting range of center of distortion can voluntarily be set by user, it is preferable that abnormal in the present embodiment The adjusting range value at change center is 100.When getting the central point X-coordinate and Y-coordinate of fish eye images to be corrected, processor The value range of center of distortion X coordinates and Y-coordinate can be calculated according to the following equation:
CenterX ∈ [ImgCenterX-Range, ImgCenterX+Range]
CenterY ∈ [ImgCenterY-Range, ImgCenterY+Range]
R ∈ [REFER_R*MinCoe, REFER_R*MaxCoe]
Wherein, Center X and Center Y are required center of distortion X-coordinate and Y-coordinate, and R is required distortion half Footpath, ImgCenterX and ImgCenterY are the central point X-coordinate and Y-coordinate of fish eye images to be corrected, and Range is center of distortion Adjusting range.For example, the centre coordinate for the fish eye images to be corrected that a resolution ratio is 1280 × 720 is (640,360), The adjusting range of center of distortion is 100, therefore the value range that can obtain center of distortion point X-coordinate is (540,740), distortion The value range of central point Y coordinates is (260,460).
Step S120, the scaling coefficient of reference radius and distortion radius based on the fish eye images, calculates distortion radius Value range;
User can set the value range of distortion radius based on the scaling coefficient of reference radius and distortion radius.With reference to The adjusting range of radius can voluntarily be set by user, it is preferable that due to the fish eye images to be corrected used in the present embodiment Resolution ratio be 1280 × 720, therefore reference radius is arranged to 600, meanwhile, MaxCoe and MinCoe are respectively set to 1.2 and 0.8.When getting the reference radius and distortion parameter of fish eye images to be corrected, processor can be according to following public affairs Formula calculates the value range of distortion radius R:
R ∈ [REFER_R*MinCoe, REFER_R*MaxCoe]
Wherein, REFER_F is reference radius of the user according to set by the size of fish eye images to be corrected,.For example, one Resolution ratio is that the centre coordinate of 1280 × 720 fish eye images to be corrected is (640,360), and MaxCoe and MinCoe are respectively The scaling coefficient of distortion radius.For example, the value of reference radius is 600, then scaling coefficient is multiplied by respectively can obtain distortion half The value range in footpath is (480,720).
Step S130, the value range based on center of distortion coordinate, value range, the first adjusting step of the radius that distorts, Obtain the first parameter set group.
In the present embodiment, user can set center of distortion point coordinates value range and distortion radius according to preset rules Value range, concurrently set first adjusting step, it is preferable that the first adjusting step in the present embodiment is arranged to 10. For each distortion parameter, processor can in the value range of the distortion parameter, according to the first adjusting step successively from It is small to being traveled through to whole value range greatly.Afterwards, the element in the set of the first distortion parameter of above three is arranged Row combination operation so that each of which element can carry out all possible combination with the element in two other set, Wherein, the element number that total combined number is equal in the point X-coordinate value set of center of distortion is multiplied by center of distortion point Y coordinates Element number in value set is multiplied by the element number in distortion radius R value set.For example, center of distortion point X-coordinate 2 elements are included in value set, are respectively [1,2], 2 elements are included in the value set of center of distortion point Y coordinates, point It is not [3,4], 2 elements [5,6] is included in the value set for the radius that distorts, then in the value collection to first distortion parameter Close after carrying out permutation and combination, the combination of available all possible distortion parameter includes:(1,3,5), (2,3,5), (1, 4,5), (2,4,5), (1,3,6), (2,3,6), (Isosorbide-5-Nitrae, 6), (2,4,6).By the value set of all first distortion parameters into The all possible combination obtained after row permutation and combination, is the first parameter set group, wherein comprising multigroup parameter set, each Parameter set includes three parameters, is center of distortion point X-coordinate, center of distortion point Y-coordinate and distortion radius R respectively.
The optimization method of distortion parameter in the present embodiment, be primarily based on the fish eye images centre coordinate, distortion in The adjusting range of the heart, calculates the value range of center of distortion coordinate;It is then based on reference radius and the distortion of the fish eye images The scaling coefficient of radius, calculates the value range of distortion radius;Value range again based on center of distortion coordinate, distortion half afterwards The value range in footpath, the first adjusting step, obtain the first parameter set group.The first parameter set group is carried out by empirical method Estimation, meets the basic demand of image rectification, and the process for obtaining distortion parameter is simplified by the means of science, is improved abnormal The low optimization accuracy of variable element.
Based on above-described embodiment, the 8th embodiment of the optimization method of proposition distortion parameter of the present invention, with reference to Fig. 9, at this In embodiment, step S300 includes:
Step S310, obtains the corresponding ginseng of straightness error of preceding predetermined number minimum in the first straight line degree error Manifold;
After the corresponding first straight line degree error group of all parameter sets in obtaining the first parameter set group, it is arranged Sequence, exports the corresponding parameter set of preceding Z straightness error of minimum.Preferably, exported in the present embodiment after sequence terminates Three groups of parameter sets of straightness error minimum, afterwards readjust it according to preset rules, so as to obtain new parameter The value range of collection.
Step S320, successively according to the parameter set and second adjustment step-length got, generates second parameter set Group.
In the present embodiment, the center of distortion point coordinates and distortion half that user can concentrate according to preset formula arrange parameter The adjusting range in footpath, concurrently sets a second adjustment step-length, it is preferable that the second adjustment step-length in the present embodiment is arranged to 1. Preset rules mainly include 3 formula:
CenterX∈[CenterXk- NEW_RANGE, CenterXk+NEW_RANGE]
CenterY∈[CenterYk- NEW_RANGE, CenterYk+NEW_RANGE]
R ∈ [R-NEW_RANGE, R+NEW_RANGE]
Wherein, NEW_RANGE is new parameter adjustment scope, it is preferable that NEW_RANGE is arranged to 10 in the present embodiment, I.e. new value range is adjusted to 10, and each parameter adjustment step-length is 1, i.e. PARAMS_STEP is 1.Second distortion parameter refers to The distortion parameter got based on the first distortion parameter, including center of distortion X-coordinate, center of distortion Y-coordinate and distortion radius This 3 parameters.For the distortion parameter in each parameter set, processor can be pressed in the adjusting range of the distortion parameter Whole value range is traveled through from small to large successively according to second adjustment step-length.For each distortion parameter, take all After possible values, all numerical value got are put into the set of establishment, generate the second distortion parameter of the fish eye images Corresponding second parameter set group, including, the value set of the X-coordinate of center of distortion, the value set of the Y-coordinate of center of distortion, And the value set of distortion radius.For example, preceding 3 parameter set groups of straightness error minimum are (Isosorbide-5-Nitraes, 7), (2,5,8), (3, 6,9), it is meant that the corresponding center of distortion X-coordinate of first three minimum straightness error includes [1,2,3], center of distortion Y-coordinate Including [4,5,6], distortion radius R includes [7,8,9], and a distortion ginseng is generated all in accordance with preset rules to each of which value Several value ranges, can generate the value range of [- 9,11] when center of distortion X-coordinate takes 1, simultaneously because second adjustment walks Long value be 1, can obtain corresponding center of distortion X-coordinate when center of distortion X coordinates take 1 value range -9, -8 ..., 0,1,2 ..., 10,11 }, correspondingly, the value of corresponding center of distortion X-coordinate when center of distortion X-coordinate takes 2 can be obtained Scope -8, -7 ..., 1,2,3 ... and 11,2 }, the value range of corresponding center of distortion X-coordinate when center of distortion X-coordinate takes 3 - 7, -6 ..., 2,3,4 ..., 12,13], after collecting, the value collection of center of distortion X-coordinate is combined into the second distortion parameter [- 9, -8 ..., 0,1,2,3,4 ..., 12,13].Similarly, taking for center of distortion Y-coordinate in the second distortion parameter can be obtained Value set is [- 6, -5 ..., 3,4,5,6,7 ..., 15,16], and the value collection for the radius R that distorts in the second distortion parameter It is combined into [- 3, -2 ..., 6,7,8,9,10 ..., 18,19].Permutation and combination is carried out to the value set of first distortion parameter Afterwards, the combination of available all possible distortion parameter is the first parameter set group, and in the present embodiment, one shares 23 × 23 × 23 groups of parameter sets, each parameter set include three parameters, are center of distortion point X-coordinate respectively, and center of distortion point Y is sat Be marked with and distort radius R.
The optimization method of distortion parameter in the present embodiment, by obtain in the first straight line degree error it is minimum before it is pre- If the corresponding parameter set of the straightness error of number;It is raw again successively according to the parameter set and second adjustment step-length got Into the second parameter set group.After a certain number of optimal solution is got, it is refined, with the adjusting step of smaller Recalculate a second parameter set group so that bearing calibration of the invention more becomes more meticulous, and improves the second parameter set group Precision, and then improve the low optimization accuracy of distortion parameter.
The present invention also provides a kind of computer-readable recording medium, in the present embodiment, on computer-readable recording medium The optimizing program of distortion parameter is stored with, wherein:
When the optimizing program of the distortion parameter is performed by the processor, following steps are realized:
The corresponding first parameter set group of fish eye images is obtained, wherein, the first parameter set group includes multigroup parameter set;
According to of the first preset order successively based on the parameter set in the first parameter set group, and the fish eye images One feature point set, calculates the corresponding first straight line degree error of each parameter set in the first parameter set group;
Based on the corresponding parameter set of first straight line degree error for meeting preset condition in the first parameter set group, institute is generated The corresponding second parameter set group of fish eye images is stated, wherein, the second parameter set group includes multigroup parameter set;
According to of the second preset order successively based on the parameter set in the second parameter set group, and the fish eye images One feature point set, calculates the corresponding second straight line degree error of each parameter set in the second parameter set group;
Obtain the corresponding parameter set of straightness error minimum in the second straight line degree error, and the parameter that will be got Target distortion parameter of the distortion parameter of concentration as the fish eye images.
Further, when the optimizing program of the distortion parameter is performed by the processor, following steps are also realized:
The fisrt feature point set of the fish eye images is obtained according to the first preset rules;
According to the first preset order successively based on the parameter set in the first parameter set group, and the fisrt feature got Point set calculates the second feature point set of target image;
Based on the second feature point set being calculated, the first straight line degree error is calculated.
Further, when the optimizing program of the distortion parameter is performed by the processor, following steps are also realized:
Obtain the default center point coordinates of the target image;
According to the first preset order successively based on the parameter set in the first parameter set group, the fisrt feature point set and described Default center point coordinates, calculates the second feature point set.
Further, when the optimizing program of the distortion parameter is performed by the processor, following steps are also realized:
The first straight line equation and Ge Lie of the second feature point set corresponding each row are calculated according to the second preset rules Second straight line equation;
The coordinate of each characteristic point is concentrated to calculate row error according to the first straight line equation and second feature point, and The coordinate for concentrating each characteristic point according to the second straight line equation and second feature point calculates row error;
Based on first straight line degree error described in each row error and each row error calculation.
Further, when the optimizing program of the distortion parameter is performed by the processor, following steps are also realized:
Calculated successively based on the parameter set in the second parameter set group, and the fisrt feature point set according to the second preset order The third feature point set of target image;
Based on the third feature point set being calculated, the second straight line degree error is calculated.
Further, when the optimizing program of the distortion parameter is performed by the processor, following steps are also realized:
Obtain the default center point coordinates of the target image;
According to the second preset order successively based on the parameter set in the second parameter set group, the fisrt feature point set and described Default center point coordinates, calculates the third feature point set.
Further, when the optimizing program of the distortion parameter is performed by the processor, following steps are also realized:
Obtain the corresponding parameter set of straightness error of preceding predetermined number minimum in the first straight line degree error;
Successively according to the parameter set and the first adjusting step got, the second parameter set group is generated.
Further, when the optimizing program of the distortion parameter is performed by the processor, following steps are also realized:
The adjusting range of centre coordinate, center of distortion based on the fish eye images, calculates the value of center of distortion coordinate Scope;
The scaling coefficient of reference radius and distortion radius based on the fish eye images, calculates the value model of distortion radius Enclose;
Value range, the second adjustment step-length of value range based on center of distortion coordinate, the radius that distorts, obtain described the One parameter set group.
It should be noted that herein, term " comprising ", "comprising" or its any other variant are intended to non-row His property includes, so that process, method, article or system including a series of elements not only include those key elements, and And other elements that are not explicitly listed are further included, or further include as this process, method, article or system institute inherently Key element.In the absence of more restrictions, the key element limited by sentence "including a ...", it is not excluded that including this Also there are other identical element in the process of key element, method, article or system.
The embodiments of the present invention are for illustration only, do not represent the quality of embodiment.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side Method can add the mode of required general hardware platform to realize by software, naturally it is also possible to by hardware, but in many cases The former is more preferably embodiment.Based on such understanding, technical scheme substantially in other words does the prior art Going out the part of contribution can be embodied in the form of software product, which is stored in one as described above In storage medium (such as ROM/RAM, magnetic disc, CD), including some instructions use so that a station terminal equipment (can be mobile phone, Computer, server, air conditioner, or network equipment etc.) perform method described in each embodiment of the present invention.
It these are only the preferred embodiment of the present invention, be not intended to limit the scope of the invention, it is every to utilize this hair The equivalent structure or equivalent flow shift that bright specification and accompanying drawing content are made, is directly or indirectly used in other relevant skills Art field, is included within the scope of the present invention.

Claims (10)

1. a kind of optimization method of distortion parameter, it is characterised in that the optimization method of the distortion parameter comprises the following steps:
The corresponding first parameter set group of fish eye images is obtained, wherein, the first parameter set group includes multigroup parameter set;
It is special based on the parameter set in the first parameter set group, and the first of the fish eye images successively according to the first preset order Point set is levied, calculates the corresponding first straight line degree error of each parameter set in the first parameter set group;
Based on the corresponding parameter set of first straight line degree error for meeting preset condition in the first parameter set group, the fish is generated Eye pattern as corresponding second parameter set group, wherein, the second parameter set group includes multigroup parameter set;
It is special based on the parameter set in the second parameter set group, and the first of the fish eye images successively according to the second preset order Point set is levied, calculates the corresponding second straight line degree error of each parameter set in the second parameter set group;
The corresponding parameter set of straightness error minimum in the second straight line degree error is obtained, and by the parameter set got Target distortion parameter of the distortion parameter as the fish eye images.
2. the optimization method of distortion parameter as claimed in claim 1, it is characterised in that it is described according to the first preset order successively Based on the fisrt feature point set of the parameter set in the first parameter set group, and the fish eye images, first parameter is calculated The step of each parameter set in collection group corresponding first straight line degree error, includes:
The fisrt feature point set of the fish eye images is obtained according to the first preset rules;
According to the first preset order successively based on the parameter set in the first parameter set group, and the fisrt feature point set got Calculate the second feature point set of target image;
Based on the second feature point set being calculated, the first straight line degree error is calculated.
3. the optimization method of distortion parameter as claimed in claim 2, it is characterised in that it is described according to the first preset order successively Based on the parameter set in the first parameter set group, and the fisrt feature point set got calculates the second feature point of target image The step of collection, includes:
Obtain the default center point coordinates of the target image;
According to the first preset order successively based on the parameter set in the first parameter set group, the fisrt feature point set and described default Center point coordinate, calculates the second feature point set.
4. the optimization method of distortion parameter as claimed in claim 2, it is characterised in that described based on be calculated described Two feature point sets, the step of calculating the first straight line degree error, include:
According to the second preset rules calculate the corresponding each row of the second feature point set first straight line equation and Ge Lie second Linear equation;
According to the first straight line equation and the coordinate calculating row error of each characteristic point of second feature point concentration, and according to The second straight line equation and second feature point concentrate the coordinate of each characteristic point to calculate row error;
Based on first straight line degree error described in each row error and each row error calculation.
5. the optimization method of distortion parameter as claimed in claim 1, it is characterised in that it is described according to the second preset order successively Based on the fisrt feature point set of the parameter set in the second parameter set group, and the fish eye images, second parameter is calculated The step of each parameter set in collection group corresponding second straight line degree error, includes:
Target is calculated based on the parameter set in the second parameter set group, and the fisrt feature point set successively according to the second preset order The third feature point set of image;
Based on the third feature point set being calculated, the second straight line degree error is calculated.
6. the optimization method of distortion parameter as claimed in claim 5, it is characterised in that it is described according to the second preset order successively Based on the parameter set in the second parameter set group, and the step of third feature point set of fisrt feature point set calculating target image Including:
Obtain the default center point coordinates of the target image;
According to the second preset order successively based on the parameter set in the second parameter set group, the fisrt feature point set and described default Center point coordinate, calculates the third feature point set.
7. the optimization method of the correcting distorted parameter of fish eye images as claimed in claim 1, it is characterised in that the parameter set Element include center of distortion coordinate and distortion radius, the step of acquisition fish eye images corresponding first parameter set group, wraps Include:
The adjusting range of centre coordinate, center of distortion based on the fish eye images, calculates the value range of center of distortion coordinate;
The scaling coefficient of reference radius and distortion radius based on the fish eye images, calculates the value range of distortion radius;
Value range, the first adjusting step of value range based on center of distortion coordinate, the radius that distorts, obtain first ginseng Manifold group.
8. such as the optimization method of claim 1 to 7 any one of them distortion parameter, it is characterised in that described based on described the Meet the corresponding parameter set of first straight line degree error of preset condition in one parameter set group, generate the fish eye images corresponding The step of two parameter set groups, includes:
Obtain the corresponding parameter set of straightness error of preceding predetermined number minimum in the first straight line degree error;
Successively according to the parameter set and second adjustment step-length got, the second parameter set group is generated.
9. a kind of optimization device of distortion parameter, it is characterised in that the optimization device of the distortion parameter includes:Memory, place Reason device and the optimizing program for being stored in the distortion parameter that can be run on the memory and on the processor, the distortion ginseng The optimizing such as distortion parameter described in any item of the claim 1 to 8 is realized when several optimizing programs is performed by the processor The step of method.
10. a kind of computer-readable recording medium, it is characterised in that distortion ginseng is stored with the computer-readable recording medium Several optimizing programs, is realized such as any one of claim 1 to 8 institute when the optimizing program of the distortion parameter is executed by processor The step of optimization method for the distortion parameter stated.
CN201710885382.4A 2017-09-26 2017-09-26 Method and device for optimizing distortion parameter and computer readable storage medium Active CN108009981B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710885382.4A CN108009981B (en) 2017-09-26 2017-09-26 Method and device for optimizing distortion parameter and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710885382.4A CN108009981B (en) 2017-09-26 2017-09-26 Method and device for optimizing distortion parameter and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN108009981A true CN108009981A (en) 2018-05-08
CN108009981B CN108009981B (en) 2021-06-01

Family

ID=62050839

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710885382.4A Active CN108009981B (en) 2017-09-26 2017-09-26 Method and device for optimizing distortion parameter and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN108009981B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116823681A (en) * 2023-08-31 2023-09-29 尚特杰电力科技有限公司 Method, device and system for correcting distortion of infrared image and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050036706A1 (en) * 2003-08-15 2005-02-17 Donghui Wu Better picture for inexpensive cameras
CN102647964A (en) * 2009-11-16 2012-08-22 爱尔康手术激光股份有限公司 Variable stage optical system for ophthalmic surgical laser
US20130142396A1 (en) * 2011-12-01 2013-06-06 Canon Kabushiki Kaisha Estimation of shift and small image distortion
CN103955928A (en) * 2014-04-28 2014-07-30 华为技术有限公司 Method and device for determining camber lens distortion parameter and electronic equipment
CN104048815A (en) * 2014-06-27 2014-09-17 青岛歌尔声学科技有限公司 Method and system for measuring distortion of lens
CN104077768A (en) * 2014-06-04 2014-10-01 华为技术有限公司 Method and device for calibrating fish-eye lens radial distortion

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050036706A1 (en) * 2003-08-15 2005-02-17 Donghui Wu Better picture for inexpensive cameras
CN102647964A (en) * 2009-11-16 2012-08-22 爱尔康手术激光股份有限公司 Variable stage optical system for ophthalmic surgical laser
US20130142396A1 (en) * 2011-12-01 2013-06-06 Canon Kabushiki Kaisha Estimation of shift and small image distortion
CN103955928A (en) * 2014-04-28 2014-07-30 华为技术有限公司 Method and device for determining camber lens distortion parameter and electronic equipment
CN104077768A (en) * 2014-06-04 2014-10-01 华为技术有限公司 Method and device for calibrating fish-eye lens radial distortion
CN104048815A (en) * 2014-06-27 2014-09-17 青岛歌尔声学科技有限公司 Method and system for measuring distortion of lens

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
D. SANTANA-CEDRES: "An Iterative Optimization Algorithm for Lens Distortion Correction Using Two-Parameter Models", 《IMAGE PROCESSING ON LINE》 *
刘志龙等: "利用直线控制进行非量测相机的几何标定", 《测绘科学技术学报》 *
魏利胜等: "基于双经度模型的鱼眼图像畸变矫正方法", 《仪器仪表学报》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116823681A (en) * 2023-08-31 2023-09-29 尚特杰电力科技有限公司 Method, device and system for correcting distortion of infrared image and storage medium
CN116823681B (en) * 2023-08-31 2024-01-26 尚特杰电力科技有限公司 Method, device and system for correcting distortion of infrared image and storage medium

Also Published As

Publication number Publication date
CN108009981B (en) 2021-06-01

Similar Documents

Publication Publication Date Title
US11244170B2 (en) Scene segmentation method and device, and storage medium
US11410284B2 (en) Face beautification method and apparatus, computer device, and storage medium
KR101979669B1 (en) Method for correcting user’s gaze direction in image, machine-readable storage medium and communication terminal
WO2020015724A1 (en) Picture acquisition method, and picture processing method and device
CN113132704B (en) Image processing method, device, terminal and storage medium
KR20170098089A (en) Electronic apparatus and operating method thereof
CN110059685A (en) Word area detection method, apparatus and storage medium
US20230091710A1 (en) Image processing method and apparatus, electronic device, and storage medium
CN112686824A (en) Image correction method, image correction device, electronic equipment and computer readable medium
US9245348B2 (en) Determining a maximum inscribed size of a rectangle
CN106534619A (en) Method and apparatus for adjusting focusing area, and terminal
JP7487293B2 (en) Method and device for controlling virtual camera movement, and computer device and program
CN112150560B (en) Method, device and computer storage medium for determining vanishing point
JP2022551007A (en) Method and apparatus for setting alarm rules for IoT devices, devices and storage media
CN109544441B (en) Image processing method and device, and skin color processing method and device in live broadcast
CN108170817A (en) Differentiation video acquiring method, device and the readable storage medium storing program for executing of photo main body
CN108235132A (en) Panoramic video visual angle regulating method and device based on human eye positioning
CN108200352A (en) A kind of method, terminal and storage medium for reconciling picture luminance
CN113888447A (en) Image processing method, terminal and storage medium
CN110503618A (en) Image processing method and electronic equipment
CN108009981A (en) Optimization method, device and the computer-readable recording medium of distortion parameter
CN112184581B (en) Image processing method, device, computer equipment and medium
CN113472943B (en) Audio processing method, device, equipment and storage medium
CN116739908A (en) Image processing method, device and equipment
CN112560903A (en) Method, device and equipment for determining image aesthetic information and storage medium

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
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: Optimization method, device and computer readable storage medium of distortion parameters

Effective date of registration: 20220623

Granted publication date: 20210601

Pledgee: Industrial and Commercial Bank of China Limited Shenzhen Fuyong sub branch

Pledgor: SHENZHEN ECHIEV AUTONOMOUS DRIVING TECHNOLOGY Co.,Ltd.

Registration number: Y2022980008778

PE01 Entry into force of the registration of the contract for pledge of patent right
PC01 Cancellation of the registration of the contract for pledge of patent right

Date of cancellation: 20230818

Granted publication date: 20210601

Pledgee: Industrial and Commercial Bank of China Limited Shenzhen Fuyong sub branch

Pledgor: SHENZHEN ECHIEV AUTONOMOUS DRIVING TECHNOLOGY Co.,Ltd.

Registration number: Y2022980008778

PC01 Cancellation of the registration of the contract for pledge of patent right