Distortion compensation method, device and relevant device based on wide-angle lens

文档序号:1758960 发布日期:2019-11-29 浏览:35次 中文

阅读说明:本技术 基于广角镜头的畸变补偿方法、装置、及相关设备 (Distortion compensation method, device and relevant device based on wide-angle lens ) 是由 周彦汝 于 2019-09-19 设计创作,主要内容包括:本申请公开了一种基于广角镜头的畸变补偿方法、装置、电子设备和存储介质。该方法可包括:确定广角镜头的光学畸变曲线;其中,光学畸变曲线用于表示多个视场及其光学畸变值的对应关系;根据光学畸变曲线对广角镜头所形成的图像进行反向补偿;确定广角镜头在X方向上多个视场位置的3D畸变补偿系数,并确定广角镜头在Y方向上多个视场位置的3D畸变补偿系数;根据广角镜头在X方向上多个视场位置的3D畸变补偿系数和在Y方向上多个视场位置的3D畸变补偿系数,对经过反向补偿的图像进行3D畸变校正。该方法可通过软件与硬件结合的方式,既可对广角镜头产生的光学畸变进行补偿校正,又可对广角镜头产生的3D畸变进行补偿与矫正,且省去了标定环节。(This application discloses a kind of distortion compensation method based on wide-angle lens, device, electronic equipment and storage mediums.This method can include: determine the optical distortion curve of wide-angle lens;Wherein, optical distortion curve is used to indicate the corresponding relationship of multiple visual fields and its optical distortion value;Image is formed by wide-angle lens according to optical distortion curve and carries out Contrary compensation;It determines the 3D distortion compensation coefficient of wide-angle lens multiple field positions in the X direction, and determines the 3D distortion compensation coefficient of wide-angle lens multiple field positions in the Y direction;According to wide-angle lens the 3D distortion compensation coefficient of multiple field positions and the 3D distortion compensation coefficient of multiple field positions in the Y direction in the X direction, 3D distortion correction is carried out to by the image of Contrary compensation.This method can be by way of software and combination of hardware, and the optical distortion that can have not only generated to wide-angle lens compensates correction, but also the 3D distortion that can be generated to wide-angle lens is compensated and corrected, and eliminates calibration link.)

1. a kind of distortion compensation method based on wide-angle lens, which comprises the following steps:

Determine the optical distortion curve of the wide-angle lens;Wherein, the optical distortion curve for indicate multiple visual fields and its The corresponding relationship of optical distortion value;

Image is formed by the wide-angle lens according to the optical distortion curve and carries out Contrary compensation;

It determines the 3D distortion compensation coefficient of the wide-angle lens multiple field positions in the X direction, and determines the wide-angle lens The 3D distortion compensation coefficient of multiple field positions in the Y direction;

According to the wide-angle lens 3D distortion compensation coefficient of multiple field positions and described multiple in the Y direction in the X direction The 3D distortion compensation coefficient of field positions carries out 3D distortion correction to by the image of Contrary compensation.

2. the method according to claim 1, wherein determining the optical distortion curve of the wide-angle lens, comprising:

From the configuration information of wide-angle lens optical design, the light of multiple visual field optical systems for the wide-angle lens is obtained Learn distortion value;

According to the optical distortion value of multiple visual field optical systems of the wide-angle lens, the optical distortion of the wide-angle lens is determined Curve.

3. the method according to claim 1, wherein according to the optical distortion curve to the wide-angle lens institute The image of formation carries out Contrary compensation, comprising:

By the optical distortion value of each visual field in the optical distortion curve multiplied by penalty coefficient, the abnormal of each visual field is obtained Become penalty coefficient;

According to the distortion compensation coefficient of each visual field, to the wide-angle lens be formed by image radially carry out stretching or Compression.

4. the method according to claim 1, wherein determining the wide-angle lens multiple visual field positions in the X direction The 3D distortion compensation coefficient set, comprising:

Determine the default 3D distortion compensation coefficient of wide-angle lens maximum field of view position in the X direction;

According to multiple image heights of field positions multiple in the X-direction, determines in the X-direction that other field positions are corresponding and return One changes radius;

According to other field positions in the default 3D distortion compensation coefficient of the position of maximum field of view in the X direction, the X-direction Corresponding normalization radius determines the 3D distortion compensation coefficient of other field positions in the X-direction.

5. the method according to claim 1, wherein determining the wide-angle lens multiple visual field positions in the Y direction The 3D distortion compensation coefficient set, comprising:

Determine the default 3D distortion compensation coefficient of wide-angle lens maximum field of view position in the X direction;

Determine the image height of wide-angle lens maximum field of view position in the X direction;

According to the image height of multiple image heights of field positions multiple in the Y-direction and the position of maximum field of view in the X direction, Calculate the corresponding normalization radius of multiple field positions in the Y-direction;

According to multiple field positions in the default 3D distortion compensation coefficient of the position of maximum field of view in the X direction, the Y-direction Corresponding normalization radius determines the 3D distortion compensation coefficient of multiple field positions in the Y-direction.

6. the method according to any one of claims 1 to 5, which is characterized in that in the X direction according to the wide-angle lens The 3D distortion compensation coefficient of the 3D distortion compensation coefficient of multiple field positions and the field positions multiple in the Y direction, to warp The image for crossing Contrary compensation carries out 3D distortion correction, comprising:

According to the 3D distortion compensation coefficient of the wide-angle lens multiple field positions in the X direction, along the X-direction to the figure As different visual fields carry out the compression of coefficient of correspondence;

According to the 3D distortion compensation coefficient of the wide-angle lens multiple field positions in the Y direction, along the Y-direction, to passing through X The compressed image difference visual field in direction carries out the compression of coefficient of correspondence.

7. a kind of distortion compensation apparatus based on wide-angle lens characterized by comprising

Optical distortion curve determining module, for determining the optical distortion curve of the wide-angle lens;Wherein, the optical distortion Curve is used to indicate the corresponding relationship of multiple visual fields and its optical distortion value;

Optical distortion compensating module carries out instead for being formed by image to the wide-angle lens according to the optical distortion curve To compensation;

3D distortion compensation coefficient determination module, for determine the wide-angle lens in the X direction multiple field positions 3D distortion Penalty coefficient, and determine the 3D distortion compensation coefficient of the wide-angle lens multiple field positions in the Y direction;

3D distortion correction module, for the 3D distortion compensation coefficient according to the wide-angle lens multiple field positions in the X direction With the 3D distortion compensation coefficient of the field positions multiple in the Y direction, 3D distortion school is carried out to the image by Contrary compensation Just.

8. device according to claim 7, which is characterized in that the optical distortion curve determining module is specifically used for:

From the configuration information of wide-angle lens optical design, the light of multiple visual field optical systems for the wide-angle lens is obtained Learn distortion value;

According to the optical distortion value of multiple visual field optical systems of the wide-angle lens, the optical distortion of the wide-angle lens is determined Curve.

9. device according to claim 7, which is characterized in that the optical distortion compensating module is specifically used for:

By the optical distortion value of each visual field in the optical distortion curve multiplied by penalty coefficient, the abnormal of each visual field is obtained Become penalty coefficient;

According to the distortion compensation coefficient of each visual field, to the wide-angle lens be formed by image radially carry out stretching or Compression.

10. device according to claim 7, which is characterized in that the 3D distortion compensation coefficient determination module is specifically used for:

Determine the default 3D distortion compensation coefficient of wide-angle lens maximum field of view position in the X direction;

According to multiple image heights of field positions multiple in the X-direction, determines in the X-direction that other field positions are corresponding and return One changes radius;

According to other field positions in the default 3D distortion compensation coefficient of the position of maximum field of view in the X direction, the X-direction Corresponding normalization radius determines the 3D distortion compensation coefficient of other field positions in the X-direction.

11. device according to claim 7, which is characterized in that the 3D distortion compensation coefficient determination module is specifically used for:

Determine the default 3D distortion compensation coefficient of wide-angle lens maximum field of view position in the X direction;

Determine the image height of wide-angle lens maximum field of view position in the X direction;

According to the image height of multiple image heights of field positions multiple in the Y-direction and the position of maximum field of view in the X direction, Calculate the corresponding normalization radius of multiple field positions in the Y-direction;

According to multiple field positions in the default 3D distortion compensation coefficient of the position of maximum field of view in the X direction, the Y-direction Corresponding normalization radius determines the 3D distortion compensation coefficient of multiple field positions in the Y-direction.

12. device according to any one of claims 7 to 11, which is characterized in that the 3D distortion correction module is specific For:

According to the 3D distortion compensation coefficient of the wide-angle lens multiple field positions in the X direction, along the X-direction to the figure As different visual fields carry out the compression of coefficient of correspondence;

According to the 3D distortion compensation coefficient of the wide-angle lens multiple field positions in the Y direction, along the Y-direction, to passing through X The compressed image difference visual field in direction carries out the compression of coefficient of correspondence.

13. a kind of electronic equipment characterized by comprising memory, processor and storage are on the processor and can be in institute The computer program run on processor is stated, when the processor executes the computer program, realizes such as claim 1 to 6 Any one of described in the distortion compensation method based on wide-angle lens.

14. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the computer program Such as the distortion compensation method described in any one of claims 1 to 6 based on wide-angle lens is realized when being executed by processor.

Technical field

This application involves field of image processing more particularly to a kind of distortion compensation methods based on wide-angle lens, device, electricity Sub- equipment and computer readable storage medium.

Background technique

With the continuous development of the electronic equipments such as mobile phone, tablet computer and intelligent camera, have on above-mentioned electronic equipment Standby camera function, requirement of the user to camera function are also higher and higher.Wherein, wide-angle lens has biggish field angle, usually 100 ° can be greater than, be widely used in electronic equipment, to improve the wide-angle of shooting image.But wide-angle lens is when shooting, Can there are apparent optical distortion and 3D distortion.

Summary of the invention

The purpose of the application is intended to solve at least some of the technical problems in related technologies.

In a first aspect, the embodiment of the present application provides a kind of distortion compensation method based on wide-angle lens, including following step It is rapid: to determine the optical distortion curve of the wide-angle lens;Wherein, the optical distortion curve is for indicating multiple visual fields and its light Learn the corresponding relationship of distortion value;Image is formed by the wide-angle lens according to the optical distortion curve reversely to be mended It repays;It determines the 3D distortion compensation coefficient of the wide-angle lens multiple field positions in the X direction, and determines that the wide-angle lens exists The 3D distortion compensation coefficient of multiple field positions in Y-direction;According to the 3D of the wide-angle lens multiple field positions in the X direction The 3D distortion compensation coefficient of distortion compensation coefficient and the field positions multiple in the Y direction, to the image by Contrary compensation Carry out 3D distortion correction.

Second aspect, the embodiment of the present application provide a kind of distortion compensation apparatus based on wide-angle lens, comprising: optics is abnormal Varied curve determining module, for determining the optical distortion curve of the wide-angle lens;Wherein, the optical distortion curve is used for table Show the corresponding relationship of multiple visual fields and its optical distortion value;Optical distortion compensating module, for according to the optical distortion curve Image is formed by the wide-angle lens and carries out Contrary compensation;3D distortion compensation coefficient determination module is described wide for determining The 3D distortion compensation coefficient of angle mirror head multiple field positions in the X direction, and determine the wide-angle lens multiple views in the Y direction The 3D distortion compensation coefficient of field position;3D distortion correction module, for according to the wide-angle lens multiple visual field positions in the X direction The 3D distortion compensation coefficient of the 3D distortion compensation coefficient and the field positions multiple in the Y direction set, to by Contrary compensation Image carry out 3D distortion correction.

The third aspect, the embodiment of the present application provide a kind of electronic equipment, comprising: memory, processor and are stored in institute The computer program that can be run on memory and on the processor is stated, when the processor executes described program, realizes this Apply for the distortion compensation method based on wide-angle lens described in first aspect embodiment.

Fourth aspect, the embodiment of the present application provide a kind of computer readable storage medium, are stored thereon with computer journey Sequence, the computer program are realized described in the application first aspect embodiment when being executed by processor based on the abnormal of wide-angle lens Become compensation method.

The technical solution of the embodiment of the present application, it may be determined that the optical distortion curve of wide-angle lens, wherein optical distortion curve For indicating the corresponding relationship of multiple visual fields and its optical distortion value, wide-angle lens is formed according to optical distortion curve later Image carry out Contrary compensation, then determine the 3D distortion compensation coefficient of wide-angle lens multiple field positions in the X direction, and really Determine the 3D distortion compensation coefficient of wide-angle lens multiple field positions in the Y direction, it is finally multiple in the X direction according to wide-angle lens The 3D distortion compensation coefficient of the 3D distortion compensation coefficient of field positions and in the Y direction multiple field positions is mended to by reversed The image repaid carries out 3D distortion correction.As a result, can be by way of software and combination of hardware, it both can be to the light of wide-angle lens generation It learns distortion and compensates correction, and the 3D distortion that can be generated to wide-angle lens is compensated and corrected, and eliminates calibration link.

The additional aspect of the application and advantage will be set forth in part in the description, and will partially become from the following description It obtains obviously, or recognized by the practice of the application.

Detailed description of the invention

The application is above-mentioned and/or additional aspect and advantage will become from the following description of the accompanying drawings of embodiments Obviously and it is readily appreciated that, in which:

Fig. 1 is the flow chart according to the distortion compensation method based on wide-angle lens of the application one embodiment.

Fig. 2 is the schematic diagram of the pattern distortion generated according to the shooting of the wide-angle lens of the application one embodiment.

Fig. 3 is the schematic diagram according to the optical distortion curve of the wide-angle lens of the application one embodiment.

Fig. 4 is the schematic diagram according to the compensation of the realization wide-angle lens optical distortion of the application one embodiment.

Fig. 5 is the schematic diagram according to the compensation for realizing wide-angle lens 3D distortion of the application one embodiment.

Fig. 6 is the flow chart according to the distortion compensation method based on wide-angle lens of one specific embodiment of the application.

Fig. 7 is the structural schematic diagram according to the distortion compensation apparatus based on wide-angle lens of the application one embodiment.

Fig. 8 is the structural schematic diagram according to the electronic equipment of the application one embodiment.

Specific embodiment

Embodiments herein is described below in detail, examples of the embodiments are shown in the accompanying drawings, wherein from beginning to end Same or similar label indicates same or similar element or element with the same or similar functions.Below with reference to attached The embodiment of figure description is exemplary, it is intended to for explaining the application, and should not be understood as the limitation to the application.

Below with reference to the accompanying drawings the distortion compensation method based on wide-angle lens, device, the electronics for describing the embodiment of the present application are set Standby and storage medium.

Fig. 1 is the flow chart according to the distortion compensation method based on wide-angle lens of the application one embodiment.It needs It is bright, the distortion compensation method based on wide-angle lens of the embodiment of the present application can be applied to the embodiment of the present application based on wide-angle The distortion compensation apparatus of camera lens, the device can be configured on electronic equipment.

As shown in Figure 1, the distortion compensation method based on wide-angle lens may include:

S110 determines the optical distortion curve of wide-angle lens;Wherein, optical distortion curve for indicate multiple visual fields and its The corresponding relationship of optical distortion value.

In embodiments herein, for example, it is assumed that there is wide-angle lens, wide-angle lens shoots it on electronic equipment After can preview image, as shown in Fig. 2, wide-angle lens shoot image when can generate distortion (i.e. image scene caused by optical distortion Image border caused by bending and 3D distort stretches), the distortion is compensated to guarantee that image is normal in order to realize, at this time may be used First from the configuration information of wide-angle lens optical design, the optical distortion of multiple visual field optical systems for wide-angle lens is obtained Value, then according to the optical distortion value of multiple visual field optical systems of wide-angle lens, determines the optical distortion curve of wide-angle lens. Wherein, optical distortion curve is used to indicate the corresponding relationship of multiple visual fields and its optical distortion value.

Wherein, electronic equipment can be mobile terminal, intelligent digital camera etc., wherein mobile terminal includes but not only limits In hardware devices such as mobile phone, tablet computers.

Wherein, the configuration information of wide-angle lens optical design includes but are not limited to focal length, F-number, optical distortion value Deng.

It for example, can be by mobile terminal, from the optical design of wide-angle lens when wide-angle lens shooting generates distortion In configuration information, the sizes values of the optical distortion of available difference visual field optical system, for example, as shown in figure 3, can use therefrom The heart and then determines the optical distortion curve of wide-angle lens to the optical distortion value of edge totally 11 visual field optical systems, wherein figure 3 left sides are the optical distortion value of 11 visual field optical systems, and abscissa indicates the visual field value of wide-angle lens, ordinate table in right side Show image height.

It should be noted that the optical distortion value acquirement when visual field optical system is more, the effect for the reduction that distorts can be better.

S120 is formed by image to wide-angle lens according to optical distortion curve and carries out Contrary compensation.

It, can will be in optical distortion curve after determining the optical distortion curve of wide-angle lens in embodiments herein The optical distortion value of each visual field obtains the distortion compensation coefficient of each visual field, then according to each visual field multiplied by penalty coefficient Distortion compensation coefficient, image is formed by wide-angle lens and is radially stretched or is compressed, and then is realized to optical distortion Compensation.

That is, after determining the optical distortion curve of wide-angle lens, it can be by visual field each in optical distortion curve Optical distortion value obtains the distortion compensation coefficient of each visual field, then according to the distortion compensation of each visual field multiplied by penalty coefficient Coefficient determines the optical distortion compensated curve of wide-angle lens, is formed by image to wide-angle lens and is radially stretched or pressed Contracting.Wherein, when the point on optical distortion compensated curve is positive value, image can radially be stretched;Optical distortion compensation is bent When point on line is negative value, image can radially be compressed.

It should be noted that different distortion compensation coefficients can be used in the optical distortion value of different visual fields.

It for example, can be by visual field each in optical distortion curve after determining the optical distortion curve of wide-angle lens Optical distortion value obtains the value of the distortion compensation curve of each visual field, then according to the abnormal of each visual field multiplied by penalty coefficient -1 Become the value of compensated curve, determines compensation distortion curve, image is radially stretched or compressed later, wherein optical distortion When point on compensated curve is positive value, image can radially be stretched;When point on optical distortion compensated curve is negative value, Image can radially be compressed.For example, image as shown in Figure 2 is obtained when carrying out image taking using wide-angle lens, The optical distortion curve of the wide-angle lens can be obtained at this time, and image shown in Fig. 2 is carried out instead according to the optical distortion curve To compensation, and then realize the compensation to optical distortion, it can be as shown in Figure 4 for obtaining compensated image.

In embodiments herein, when the number of the distortion compensation coefficient corresponding to each visual field is less, in order to mention High compensation effect, after determining the optical distortion curve of wide-angle lens, by the optical distortion of visual field each in optical distortion curve Value obtains the optical distortion value of several visual fields, and the optical distortion value of several visual fields is multiplied by way of linear interpolation With penalty coefficient, the distortion compensation coefficient of several visual fields is obtained, so as to meet the needs of optical distortion compensation.

S130 determines the 3D distortion compensation coefficient of wide-angle lens multiple field positions in the X direction, and determines wide-angle lens The 3D distortion compensation coefficient of multiple field positions in the Y direction.

It is appreciated that optical system is in imaging, there is peripheral field when projecting to two-dimensional space and is stretched in three-dimension object The phenomenon that, cause wide-angle lens to generate 3D distortion, wherein object more in X direction will be tighter with the stretching of Y-direction at edge Weight, and the stretching of longitudinal direction is often more serious than the stretching of short side direction.

In embodiments herein, when wide-angle lens generates 3D distortion, in order to compensate for 3D distortion, it may be determined that wide-angle lens The 3D distortion compensation coefficient of multiple field positions in the X direction, and determine the 3D of wide-angle lens multiple field positions in the Y direction Distortion compensation coefficient.

For example, maximum field of view carries out 8%-15% or so 3D distortion in the X direction for 120 ° -130 ° of wide-angle lens Penalty coefficient;For 100 ° -120 ° of wide-angle lens, maximum field of view carries out 3%-8% or so 3D distortion compensation system in the X direction Number;For 80 ° -100 ° of camera lens, maximum field of view carries out 0.5%-3% or so 3D distortion compensation coefficient in the X direction;For 80 ° of wide-angle lens below default the compensation to distort without 3D.

Determining that wide-angle lens, can be according to wide-angle lens in the X direction after the 3D distortion compensation coefficient of multiple field positions The default 3D distortion compensation coefficient of head maximum field of view position in the X direction, to determine wide-angle lens multiple visual field positions in the Y direction The 3D distortion compensation coefficient set.Specific implementation process can be found in the description of subsequent embodiment.

S140, according to the wide-angle lens 3D distortion compensation coefficient of multiple field positions and multiple in the Y direction in the X direction The 3D distortion compensation coefficient of field positions carries out 3D distortion correction to by the image of Contrary compensation.

In embodiments herein, in the 3D distortion compensation system for determining wide-angle lens multiple field positions in the X direction Number determines that wide-angle lens, can be according to wide-angle lens in the side X in the Y direction after the 3D distortion compensation coefficient of multiple field positions The 3D distortion compensation coefficient of upward multiple field positions, carries out the compression of coefficient of correspondence to image difference visual field in X direction, according to The 3D distortion compensation coefficient of wide-angle lens multiple field positions in the Y direction, along Y-direction, to passing through the compressed image of X-direction Different visual fields carry out the compression of coefficient of correspondence, obtain when for example, carrying out the compensation of optical distortion to image as shown in Figure 2 such as figure Image shown in 4, at this time can be according to the wide-angle lens 3D distortion compensation coefficient of multiple field positions and in the Y direction in the X direction It is abnormal to carry out 3D to the image (image as shown in Figure 4) by Contrary compensation for the 3D distortion compensation coefficient of upper multiple field positions Become correction, and then realize the compensation to distort to 3D, it can be as shown in Figure 5 for obtaining compensated image, it can be seen that at this time such as Fig. 5 Shown in image be image in normal ideal.

According to the distortion compensation method based on wide-angle lens of the embodiment of the present application, it may be determined that the optical distortion of wide-angle lens Curve, wherein optical distortion curve is used to indicate the corresponding relationship of multiple visual fields and its optical distortion value, abnormal according to optics later Varied curve is formed by image to wide-angle lens and carries out Contrary compensation, then determines wide-angle lens multiple visual field positions in the X direction The 3D distortion compensation coefficient set, and determine the 3D distortion compensation coefficient of wide-angle lens multiple field positions in the Y direction, last root According to wide-angle lens, the 3D distortion compensation coefficient of multiple field positions and the 3D of multiple field positions in the Y direction are abnormal in the X direction Become penalty coefficient, carries out 3D distortion correction to by the image of Contrary compensation.This method can pass through the side of software and combination of hardware Formula, the optical distortion that can have not only generated to wide-angle lens compensate correction, but also the 3D distortion that can be generated to wide-angle lens is mended It repays and corrects, and eliminate calibration link.

Fig. 6 is the flow chart according to the distortion compensation method based on wide-angle lens of one specific embodiment of the application.Such as Shown in Fig. 6, being somebody's turn to do the distortion compensation method based on wide-angle lens may include:

S610 determines the optical distortion curve of wide-angle lens;Wherein, optical distortion curve for indicate multiple visual fields and its The corresponding relationship of optical distortion value.

In embodiments herein, for example, it is assumed that there is wide-angle lens, wide-angle lens shoots it on electronic equipment After can preview image, as shown in Fig. 2, wide-angle lens shoot image when can generate distortion (i.e. image scene caused by optical distortion Image border caused by bending and 3D distort stretches), the distortion is compensated to guarantee that image is normal in order to realize, at this time may be used First from the configuration information of wide-angle lens optical design, the optical distortion of multiple visual field optical systems for wide-angle lens is obtained Value then according to the optical distortion value of multiple visual field optical systems of wide-angle lens, and then determines the optical distortion of wide-angle lens Curve.Wherein, optical distortion curve is used to indicate the corresponding relationship of multiple visual fields and its optical distortion value.

It for example, can be by mobile terminal, from the optical design of wide-angle lens when wide-angle lens shooting generates distortion In configuration information, the sizes values of the optical distortion of available difference visual field optical system, for example, as shown in figure 3, can use therefrom The heart and then determines the optical distortion curve of wide-angle lens to the optical distortion value of edge totally 11 visual field optical systems, wherein figure 3 left sides are the optical distortion value of 11 visual field optical systems, and abscissa indicates the visual field value of wide-angle lens, ordinate table in right side Show image height.

It should be noted that the optical distortion value acquirement when visual field optical system is more, the effect for the reduction that distorts can be better.

S620 is formed by image to wide-angle lens according to optical distortion curve and carries out Contrary compensation.

It for example, can be by visual field each in optical distortion curve after determining the optical distortion curve of wide-angle lens Optical distortion value obtains the value of the distortion compensation curve of each visual field, then according to the abnormal of each visual field multiplied by penalty coefficient -1 Become the value of compensated curve, determines compensation distortion curve, image is radially stretched or compressed later, wherein optical distortion When point on compensated curve is positive value, image can radially be stretched;When point on optical distortion compensated curve is negative value, Image can radially be compressed.For example, image as shown in Figure 1 is obtained when carrying out image taking using wide-angle lens, The optical distortion curve of the wide-angle lens can be obtained at this time, and image shown in FIG. 1 is carried out instead according to the optical distortion curve To compensation, and then realize the compensation to optical distortion, it can be as shown in Figure 4 for obtaining compensated image.

S630 determines the 3D distortion compensation coefficient of wide-angle lens multiple field positions in the X direction.

In embodiments herein, when wide-angle lens generates 3D distortion, in order to compensate for 3D distortion, it may be determined that wide-angle lens The default 3D distortion compensation coefficient of maximum field of view position in the X direction, then according to multiple pictures of field positions multiple in X-direction Height determines the corresponding normalization radius of other field positions in X-direction, later according to the pre- of maximum field of view position in the X direction If the corresponding normalization radius of other field positions in 3D distortion compensation coefficient, X-direction, determines other field positions in X-direction 3D distortion compensation coefficient.

Where it is assumed that the normalization radius in the maximum field of view position of X-direction is 1, the normalization in center picture position Radius is 0, then the normalization radius of other field positions of X-direction is then are as follows: the image height of other field positions divided by X-direction most The image height of big field positions, obtained ratio is the corresponding normalization radius of other field positions.

For example, it is assumed that X-direction maximum field of view carries out the compensation of 10%3D distortion, i.e., corresponding to X-direction maximum field of view Default 3D distortion compensation coefficient be 10%, then the penalty coefficient of other positions can be calculated as follows: K1’=K1*r1^ 2, wherein K1For the 3D distortion compensation coefficient of X-direction maximum field of view, K1’For the 3D distortion compensation coefficient of other visual fields of X-direction, r1 For the corresponding normalization radius of X-direction difference visual field, in the maximum field of view position r of X-direction1=1, in center picture position r1= 0, to can determine the 3D distortion compensation coefficient of wide-angle lens multiple field positions in the X direction.

S640 determines the 3D distortion compensation coefficient of wide-angle lens multiple field positions in the Y direction.

In embodiments herein, it may be determined that wide-angle lens in the X direction maximum field of view position default 3D distort mend It repays coefficient, and determines the image height of wide-angle lens maximum field of view position in the X direction, then according to field positions multiple in Y-direction Multiple image heights and the image height of maximum field of view position in the X direction, calculate the corresponding normalization of multiple field positions in Y-direction Radius, later according to multiple field positions pair in the default 3D distortion compensation coefficient of maximum field of view position in the X direction, Y-direction The normalization radius answered determines the 3D distortion compensation coefficient of multiple field positions in Y-direction.

For example, it is assumed that X-direction maximum field of view carries out the compensation of 10%3D distortion, i.e., corresponding to X-direction maximum field of view Default 3D distortion compensation coefficient be 10%, and determine the image height of wide-angle lens maximum field of view position in the X direction, then basis Multiple image heights of multiple field positions and the image height of maximum field of view position in the X direction, can calculate more in Y-direction in Y-direction The corresponding normalization radius of a field positions, for example, using Y-direction difference visual field image height divided by X-direction maximum image height The corresponding normalization radius of Y-direction difference field positions can be obtained, later, according to the pre- of maximum field of view position in the X direction If the corresponding normalization radius of multiple field positions, is calculated as follows: K in 3D distortion compensation coefficient, Y-direction2’=K2*r2 ^2 determines the 3D distortion compensation coefficient of multiple field positions in Y-direction, wherein K2For the 3D distortion compensation of X-direction maximum field of view Coefficient, K2’For the 3D distortion compensation coefficient of other visual fields of Y-direction, r2For the corresponding normalization radius of Y-direction difference visual field.

S650, according to the wide-angle lens 3D distortion compensation coefficient of multiple field positions and multiple in the Y direction in the X direction The 3D distortion compensation coefficient of field positions carries out 3D distortion correction to by the image of Contrary compensation.

In embodiments herein, in the 3D distortion compensation system for determining wide-angle lens multiple field positions in the X direction Number determines that wide-angle lens, can be according to wide-angle lens in the side X in the Y direction after the 3D distortion compensation coefficient of multiple field positions The 3D distortion compensation coefficient of upward multiple field positions, carries out the compression of coefficient of correspondence to image difference visual field in X direction, according to The 3D distortion compensation coefficient of wide-angle lens multiple field positions in the Y direction, along Y-direction, to passing through the compressed image of X-direction Different visual fields carry out the compression of coefficient of correspondence, for example, obtaining image as shown in Figure 4 when to the compensation of optical distortion, at this time may be used According to wide-angle lens the 3D distortion compensation coefficient of multiple field positions and the 3D of multiple field positions in the Y direction in the X direction Distortion compensation coefficient carries out 3D distortion correction to the image by Contrary compensation, and then realizes the compensation to distort to 3D, is mended Image after repaying can be as shown in Figure 5.

It should be noted that the reason of first carrying out the compression of Y-direction after the compression of progress X-direction is: wide-angle lens is general It is all the 3D distortion of X-direction than more serious, that is to say, that the 3D distortion in which direction is serious, can first press which direction Contracting, by 3D distort serious direction compensate correction and then another direction is compressed, it is abnormal with the 3D to the direction Change is corrected, to complete the 3D distortion compensation correction of entire picture.

According to the distortion compensation method based on wide-angle lens of the embodiment of the present application, it may be determined that the optical distortion of wide-angle lens Curve, wherein optical distortion curve is used to indicate the corresponding relationship of multiple visual fields and its optical distortion value, abnormal according to optics later Varied curve is formed by image to wide-angle lens and carries out Contrary compensation, then determines wide-angle lens multiple visual field positions in the X direction The 3D distortion compensation coefficient set, and determine the 3D distortion compensation coefficient of wide-angle lens multiple field positions in the Y direction, last root According to wide-angle lens, the 3D distortion compensation coefficient of multiple field positions and the 3D of multiple field positions in the Y direction are abnormal in the X direction Become penalty coefficient, carries out 3D distortion correction to by the image of Contrary compensation.This method can pass through the side of software and combination of hardware Formula, the optical distortion that can have not only generated to wide-angle lens compensate correction, but also the 3D distortion that can be generated to wide-angle lens is mended It repays and corrects, and eliminate calibration link.

It is corresponding with the distortion compensation method based on wide-angle lens that above-mentioned several embodiments provide, a kind of reality of the application It applies example a kind of distortion compensation apparatus based on wide-angle lens is also provided, due to provided by the embodiments of the present application based on wide-angle lens Distortion compensation apparatus is corresponding with the distortion compensation method based on wide-angle lens that above-mentioned several embodiments provide, therefore is being based on The embodiment of the distortion compensation method of wide-angle lens is also applied for the distortion compensation provided in this embodiment based on wide-angle lens Device is not described in detail in the present embodiment.Fig. 7 is mended according to the distortion based on wide-angle lens of the application one embodiment Repay the structural schematic diagram of device.

As shown in fig. 7, being somebody's turn to do the distortion compensation apparatus 700 based on wide-angle lens includes: optical distortion curve determining module 710, optical distortion compensating module 720,3D distortion compensation coefficient determination module 730 and 3D distortion correction module 740.Wherein:

Optical distortion curve determining module 710 is used to determine the optical distortion curve of the wide-angle lens;Wherein, the light Learn the corresponding relationship that distortion curve is used to indicate multiple visual fields and its optical distortion value.

In embodiments herein, the optical distortion curve determining module 710 is specifically used for: from wide-angle lens optics In the configuration information of design, the optical distortion value of multiple visual field optical systems for the wide-angle lens is obtained;According to described The optical distortion value of multiple visual field optical systems of wide-angle lens, determines the optical distortion curve of the wide-angle lens.

Optical distortion compensating module 720 is used to be formed by image to the wide-angle lens according to the optical distortion curve Carry out Contrary compensation.

In embodiments herein, the optical distortion compensating module 720 is specifically used for: by the optical distortion curve In each visual field optical distortion value multiplied by penalty coefficient, obtain the distortion compensation coefficient of each visual field;According to described each The distortion compensation coefficient of a visual field is formed by image to the wide-angle lens and is radially stretched or compressed.

3D distortion compensation coefficient determination module 730 is used to determine the wide-angle lens multiple field positions in the X direction 3D distortion compensation coefficient, and determine the 3D distortion compensation coefficient of the wide-angle lens multiple field positions in the Y direction, as one Kind example, the 3D distortion compensation coefficient determination module 730 are specifically used for: determining the wide-angle lens maximum view in the X direction The default 3D distortion compensation coefficient of field position;According to multiple image heights of field positions multiple in the X-direction, the side X is determined The corresponding normalization radius of other upward field positions;It is distorted and is mended according to the default 3D of the position of maximum field of view in the X direction It repays coefficient, the corresponding normalization radius of other field positions in the X-direction, determines other field positions in the X-direction 3D distortion compensation coefficient.

In embodiments herein, the 3D distortion compensation coefficient determination module 730 is specifically used for: determining the wide-angle The default 3D distortion compensation coefficient of camera lens maximum field of view position in the X direction;Determine the wide-angle lens maximum view in the X direction The image height of field position;According to multiple image heights of field positions multiple in the Y-direction and the maximum field of view in the X direction position The image height set calculates the corresponding normalization radius of multiple field positions in the Y-direction;According to the view maximum in the X direction The corresponding normalization radius of multiple field positions, determines the Y on the default 3D distortion compensation coefficient of position, the Y-direction The 3D distortion compensation coefficient of multiple field positions on direction.

3D distortion correction module 740 be used for according to the wide-angle lens in the X direction multiple field positions 3D distort mend The 3D distortion compensation coefficient for repaying coefficient and the field positions multiple in the Y direction carries out 3D to by the image of Contrary compensation Distortion correction.

In embodiments herein, the 3D distortion correction module 740 is specifically used for: according to the wide-angle lens in X The 3D distortion compensation coefficient of multiple field positions on direction carries out coefficient of correspondence to described image difference visual field along the X-direction Compression;According to the 3D distortion compensation coefficient of the wide-angle lens multiple field positions in the Y direction, along the Y-direction, to warp Cross the compression that the compressed image difference visual field of X-direction carries out coefficient of correspondence.

According to the distortion compensation apparatus based on wide-angle lens of the embodiment of the present application, it may be determined that the optical distortion of wide-angle lens Curve, wherein optical distortion curve is used to indicate the corresponding relationship of multiple visual fields and its optical distortion value, abnormal according to optics later Varied curve is formed by image to wide-angle lens and carries out Contrary compensation, then determines wide-angle lens multiple visual field positions in the X direction The 3D distortion compensation coefficient set, and determine the 3D distortion compensation coefficient of wide-angle lens multiple field positions in the Y direction, last root According to wide-angle lens, the 3D distortion compensation coefficient of multiple field positions and the 3D of multiple field positions in the Y direction are abnormal in the X direction Become penalty coefficient, carries out 3D distortion correction to by the image of Contrary compensation.The side of software and combination of hardware can be passed through as a result, Formula, the optical distortion that can have not only generated to wide-angle lens compensate correction, but also the 3D distortion that can be generated to wide-angle lens is mended It repays and corrects, and eliminate calibration link.

In order to realize above-described embodiment, the application also proposed a kind of electronic equipment.

Fig. 8 is the structural schematic diagram according to the electronic equipment of the application one embodiment.As shown in figure 8, the electronic equipment 800 may include: memory 810, processor 820 and be stored in the calculating that can be run on memory 810 and on processor 820 Machine program 830 when processor 820 executes program, realizes that the application distortion described in any of the above embodiments based on wide-angle lens is mended Compensation method.

In order to realize above-described embodiment, the application also proposed a kind of computer readable storage medium, the computer journey The distortion compensation method described in any of the above embodiments based on wide-angle lens is realized when sequence is executed by processor.

In the description of this specification, reference term " one embodiment ", " some embodiments ", " example ", " specifically show The description of example " or " some examples " etc. means specific features, structure, material or spy described in conjunction with this embodiment or example Point is contained at least one embodiment or example of the application.In the present specification, schematic expression of the above terms are not It must be directed to identical embodiment or example.Moreover, particular features, structures, materials, or characteristics described can be in office It can be combined in any suitable manner in one or more embodiment or examples.In addition, without conflicting with each other, the skill of this field Art personnel can tie the feature of different embodiments or examples described in this specification and different embodiments or examples It closes and combines.

Any process described otherwise above or method description are construed as in flow chart or herein, and expression includes It is one or more for realizing specific logical function or process the step of executable instruction code module, segment or portion Point, and the range of the preferred embodiment of the application includes other realization, wherein can not press shown or discussed suitable Sequence, including according to related function by it is basic simultaneously in the way of or in the opposite order, Lai Zhihang function, this should be by the application Embodiment person of ordinary skill in the field understood.

Expression or logic and/or step described otherwise above herein in flow charts, for example, being considered use In the order list for the executable instruction for realizing logic function, may be embodied in any computer-readable medium, for Instruction execution system, device or equipment (such as computer based system, including the system of processor or other can be held from instruction The instruction fetch of row system, device or equipment and the system executed instruction) it uses, or combine these instruction execution systems, device or set It is standby and use.For the purpose of this specification, " computer-readable medium ", which can be, any may include, stores, communicates, propagates or pass Defeated program is for instruction execution system, device or equipment or the dress used in conjunction with these instruction execution systems, device or equipment It sets.The more specific example (non-exhaustive list) of computer-readable medium include the following: there is the electricity of one or more wirings Interconnecting piece (electronic device), portable computer diskette box (magnetic device), random access memory (RAM), read-only memory (ROM), erasable edit read-only storage (EPROM or flash memory), fiber device and portable optic disk is read-only deposits Reservoir (CDROM).In addition, computer-readable medium can even is that the paper that can print described program on it or other are suitable Medium, because can then be edited, be interpreted or when necessary with it for example by carrying out optical scanner to paper or other media His suitable method is handled electronically to obtain described program, is then stored in computer storage.

It should be appreciated that each section of the application can be realized with hardware, software, firmware or their combination.Above-mentioned In embodiment, software that multiple steps or method can be executed in memory and by suitable instruction execution system with storage Or firmware is realized.It, and in another embodiment, can be under well known in the art for example, if realized with hardware Any one of column technology or their combination are realized: having a logic gates for realizing logic function to data-signal Discrete logic, with suitable combinational logic gate circuit specific integrated circuit, programmable gate array (PGA), scene Programmable gate array (FPGA) etc..

Those skilled in the art are understood that realize all or part of step that above-described embodiment method carries It suddenly is that relevant hardware can be instructed to complete by program, the program can store in a kind of computer-readable storage medium In matter, which when being executed, includes the steps that one or a combination set of embodiment of the method.

It, can also be in addition, can integrate in a processing module in each functional unit in each embodiment of the application It is that each unit physically exists alone, can also be integrated in two or more units in a module.Above-mentioned integrated mould Block both can take the form of hardware realization, can also be realized in the form of software function module.The integrated module is such as Fruit is realized and when sold or used as an independent product in the form of software function module, also can store in a computer In read/write memory medium.

Storage medium mentioned above can be read-only memory, disk or CD etc..Although having been shown and retouching above Embodiments herein is stated, it is to be understood that above-described embodiment is exemplary, and should not be understood as the limit to the application System, those skilled in the art can be changed above-described embodiment, modify, replace and become within the scope of application Type.

17页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:镜头模组及该镜头模组的组装方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类