CN115482288A - Lens parameter conversion method, device, computer equipment and storage medium - Google Patents

Lens parameter conversion method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN115482288A
CN115482288A CN202110604173.4A CN202110604173A CN115482288A CN 115482288 A CN115482288 A CN 115482288A CN 202110604173 A CN202110604173 A CN 202110604173A CN 115482288 A CN115482288 A CN 115482288A
Authority
CN
China
Prior art keywords
lens
image height
physical
parameter
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110604173.4A
Other languages
Chinese (zh)
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.)
Insta360 Innovation Technology Co Ltd
Original Assignee
Insta360 Innovation 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 Insta360 Innovation Technology Co Ltd filed Critical Insta360 Innovation Technology Co Ltd
Priority to CN202110604173.4A priority Critical patent/CN115482288A/en
Priority to PCT/CN2022/092961 priority patent/WO2022252970A1/en
Publication of CN115482288A publication Critical patent/CN115482288A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/80Analysis of captured images to determine intrinsic or extrinsic camera parameters, i.e. camera calibration
    • G06T5/80
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N17/00Diagnosis, testing or measuring for television systems or their details
    • H04N17/002Diagnosis, testing or measuring for television systems or their details for television cameras
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/50Constructional details
    • H04N23/51Housings
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/50Constructional details
    • H04N23/55Optical parts specially adapted for electronic image sensors; Mounting thereof
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof
    • H04N23/81Camera processing pipelines; Components thereof for suppressing or minimising disturbance in the image signal generation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image

Abstract

The application relates to a lens parameter conversion method, a lens parameter conversion device, computer equipment and a storage medium, which are applied to a second lens, wherein the second lens is a first lens configured with a protective lens. The method comprises the following steps: acquiring a pixel image height expression and a physical image height expression of a first lens; obtaining an image height conversion ratio according to the pixel image height expression and the physical image height expression, and acquiring a target physical distortion table corresponding to the second lens; fitting according to a target physical distortion table to obtain a target physical distortion parameter corresponding to the second lens; and performing parameter conversion according to the target physical distortion parameter and the image height conversion ratio to obtain a lens parameter conversion result. By adopting the method, the calibration process of the lens parameters can be simplified, the calculation precision can be improved, the lens parameters with the protective lenses can be simply, conveniently and accurately determined, and a good calibration effect can be achieved.

Description

Lens parameter conversion method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of image processing technologies, and in particular, to a method and an apparatus for converting lens parameters, a computer device, and a storage medium.
Background
With the development of image processing technology, a lens parameter calibration technology appears, and the lens parameter calibration technology is mainly used for solving internal parameters, external parameters and distortion parameters of a lens. Because the condition such as scraping flower, intaking, collision damage appear more easily in the camera lens of shooting equipment, and it is high to change the camera lens price, so can be at the camera lens external mounting protective housing of shooting equipment usually, this protective housing is transparent material usually, can play the effect of protection camera lens including the camera lens parcel, in addition, also can increase the transparent casing who has waterproof effect when shooing the scene under water. The protective shell or the transparent shell is installed, namely a layer of protective lens is added, the lens can have an extra refraction phenomenon on light, so that the internal parameters and distortion parameters of the lens are influenced, the subsequent image processing is influenced, and therefore in order to eliminate the influence of the factors on the image processing result, the parameter calibration needs to be carried out on the lens again.
In the conventional technology, a conventional lens parameter calibration method is generally adopted to perform parameter calibration again on a lens mounted with a protective shell or a transparent shell, but the process of performing parameter calibration again is complex and tedious, and the edge resolution capability of an image formed by the lens mounted with the protective shell or the transparent shell is reduced, so that the recalibration effect is poor.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a lens parameter conversion method, a lens parameter conversion apparatus, a lens parameter conversion computer device, and a lens parameter conversion storage medium, which are capable of simplifying a parameter calibration process and achieving a good calibration effect.
A lens parameter conversion method is applied to a second lens, wherein the second lens is a first lens provided with a protective lens;
the lens parameter conversion method comprises the following steps:
acquiring a pixel image height expression and a physical image height expression of a first lens;
obtaining an image height conversion ratio according to the pixel image height expression and the physical image height expression, and obtaining a physical distortion table of a second lens target;
fitting according to a target physical distortion table to obtain a target physical distortion parameter corresponding to the second lens;
and performing parameter conversion according to the target physical distortion parameter and the image height conversion ratio to obtain a lens parameter conversion result.
In one embodiment, obtaining the pixel image height expression and the physical image height expression of the first lens comprises:
acquiring a lens calibration parameter of a first lens and a first lens physical distortion table;
and obtaining a pixel image height expression according to a first lens pixel focal length and a first lens pixel distortion parameter in the lens calibration parameters, and performing curve fitting according to a first lens physical distortion table to obtain a physical image height expression.
In one embodiment, the curve fitting according to the first lens physical distortion table to obtain the physical image height expression includes:
performing curve fitting according to the corresponding relation between the incident angle and the theoretical distortion physical image height in the first lens physical distortion table to obtain a first lens physical distortion fitting curve corresponding to the first lens physical distortion table;
obtaining a first lens fitting physical distortion parameter corresponding to the physical image height expression according to the first lens physical distortion fitting curve;
and fitting the physical distortion parameters according to the first lens to obtain a physical image height expression.
In one embodiment, obtaining the image height conversion ratio according to the pixel image height expression and the physical image height expression includes:
acquiring a first lens physical distortion table, and acquiring an incident angle set according to the first lens physical distortion table and a preset step length;
substituting the incidence angles in the incidence angle set into a pixel image height expression to obtain a pixel image height matrix, and substituting the incidence angles in the incidence angle set into a physical image height expression to obtain a physical image height matrix;
and obtaining the image height conversion ratio according to the pixel image height matrix and the physical image height matrix.
In one embodiment, fitting the target physical distortion table to obtain the target physical distortion parameter corresponding to the second lens includes:
performing curve fitting according to the corresponding relation between the incident angle and the theoretical distortion physical image height in the target physical distortion table to obtain a target physical distortion fitting curve corresponding to the target physical distortion table;
and determining a target physical distortion parameter according to the target physical distortion fitting curve.
In one embodiment, the obtaining the lens parameter conversion result by performing parameter conversion according to the target physical distortion parameter and the image height conversion ratio includes:
obtaining a target physical focal length and a target pixel distortion parameter according to a camera imaging model corresponding to the second lens and the target physical distortion parameter;
and performing parameter conversion according to the target physical focal length, the target pixel distortion parameter and the image height conversion ratio to obtain a lens parameter conversion result.
In one embodiment, obtaining the target physical focal length and the target pixel distortion parameter according to the camera imaging model and the target physical distortion parameter corresponding to the second lens includes:
generating a target function corresponding to the second lens according to the camera imaging model and the target physical distortion parameter;
and determining a target incidence angle according to the target physical distortion table, and optimizing the target function according to the target incidence angle to obtain a target physical focal length and a target pixel distortion parameter.
A lens parameter conversion device is applied to a second lens, wherein the second lens is a first lens provided with a protective lens, and the device comprises:
the acquisition module is used for acquiring a pixel image height expression and a physical image height expression of the first lens;
the processing module is used for obtaining an image height conversion ratio according to the pixel image height expression and the physical image height expression and acquiring a target physical distortion table corresponding to the second lens;
the fitting module is used for fitting according to the target physical distortion table to obtain a target physical distortion parameter corresponding to the second lens;
and the conversion module is used for carrying out parameter conversion according to the target physical distortion parameter and the image height conversion ratio to obtain a lens parameter conversion result.
A computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
acquiring a pixel image height expression and a physical image height expression of a first lens;
obtaining an image height conversion ratio according to the pixel image height expression and the physical image height expression, and acquiring a target physical distortion table corresponding to the second lens;
fitting according to a target physical distortion table to obtain a target physical distortion parameter corresponding to the second lens;
and performing parameter conversion according to the target physical distortion parameter and the image height conversion ratio to obtain a lens parameter conversion result.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
acquiring a pixel image height expression and a physical image height expression of a first lens;
obtaining an image height conversion ratio according to the pixel image height expression and the physical image height expression, and acquiring a target physical distortion table corresponding to the second lens;
fitting according to a target physical distortion table to obtain a target physical distortion parameter corresponding to the second lens;
and performing parameter conversion according to the target physical distortion parameter and the image height conversion ratio to obtain a lens parameter conversion result.
According to the lens parameter conversion method, the device, the computer equipment and the storage medium, the pixel image height expression and the physical image height expression of the first lens are obtained, the pixel image height expression and the physical image height expression can be utilized to realize the calculation of the image height conversion ratio, so that the target physical distortion table corresponding to the second lens can be obtained, and after the target physical distortion parameter is obtained through fitting according to the target physical distortion table, the parameter conversion is carried out according to the target physical distortion parameter and the image height conversion ratio, and the lens parameter conversion result is obtained. In the whole process, the first lens with the protective lens is subjected to parameter conversion by using the pixel image height expression and the physical image height expression of the first lens and the target physical distortion table corresponding to the second lens to obtain a lens parameter conversion result, rather than directly re-calibrating the first lens with the protective lens such as a protective shell or a transparent shell, and the first lens with the protective lens is not required to be subjected to parameter conversion, so that the image shot after the protective lens is used is not required to be utilized, the lens parameter calibration process can be simplified, the calculation precision is improved, the first lens with the protective lens, namely the parameter of the second lens, is simply, conveniently and accurately determined, and a good calibration effect is achieved.
Drawings
FIG. 1 is a diagram illustrating an exemplary embodiment of a lens parameter transformation method;
FIG. 2 is a flowchart illustrating a lens parameter transformation method according to an embodiment;
FIG. 3 is a flowchart illustrating a lens parameter transformation method according to another embodiment;
FIG. 4 is a flowchart illustrating a lens parameter transformation method according to another embodiment;
FIG. 5 is a block diagram of a lens parameter conversion apparatus according to an embodiment;
FIG. 6 is a diagram of the internal structure of a computer device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application. The lens parameter conversion method provided by the application can be applied to the application environment shown in fig. 1. After a protective shell or a transparent shell is arranged on the first lens, a layer of protective lens is equivalently added, and the part of the lens can have an additional refraction phenomenon on light, so that the internal parameters and distortion parameters of the lens are influenced, and the subsequent image processing is influenced, so that the lens needs to be subjected to parameter calibration again in order to eliminate the influence of the factors on the image processing result. Specifically, when the lens parameters are converted, a user sends a lens parameter conversion request carrying first lens information to the terminal 102, after receiving the lens parameter conversion request carrying the first lens information, the terminal 102 obtains a pixel image height expression and a physical image height expression of the corresponding first lens according to the first lens information, obtains an image height conversion ratio according to the pixel image height expression and the physical image height expression, obtains a target physical distortion table corresponding to the second lens, obtains a target physical distortion parameter corresponding to the second lens according to the target physical distortion table through fitting, and performs parameter conversion according to the target physical distortion parameter and the image height conversion ratio to obtain a lens parameter conversion result. After the lens parameter conversion result is obtained, when the captured image needs to be processed after the first lens mounted with the protective lens such as the protective shell or the transparent shell is used for capturing, the terminal may perform distortion correction processing on the obtained image according to the obtained lens parameter conversion result. The terminal may be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices.
In an embodiment, as shown in fig. 2, a lens parameter transformation method is provided, and is applied to a second lens, where the second lens is a first lens configured with a protection lens, and this embodiment is illustrated by applying the method to a terminal, it is understood that the method may also be applied to a server, and may also be applied to a system including a terminal and a server, and is implemented by interaction between the terminal and the server. In this embodiment, the method includes the steps of:
step 202, a pixel image height expression and a physical image height expression of the first lens are obtained.
The first lens is a lens without a protective lens. For example, the first lens may specifically refer to a bare lens on which a protective lens is not configured on the camera. The pixel image height expression is a function expression which expresses the relation between the incident angle and the pixel image height in the pixel plane after the incident angle is affected by pixel distortion, the pixel image height corresponds to the actual image height calibrated by the first lens parameter, and the concrete expression form of the pixel image height expression depends on the selected camera imaging model. For example, when the camera images the modelIn the case of an equidistant projection model, the form is: h (θ) = k0 θ + k1 θ 2 +k2*θ 3 +k3*θ 4 Wherein k0, k1, k2 and k3 are expression coefficients, and theta is an incidence angle. For another example, when the camera imaging model is an omnidirectional model, the form is: h (θ) = r + k1 × r 3 +k2*r 5 +k3*r 7 ,
Figure BDA0003093642270000061
Wherein k1, k2 and k3 are expression coefficients, epsilon is a preset constant, and theta is an incident angle. The physical image height expression is a fitting function corresponding to the first lens physical distortion table and is used for representing the corresponding relation between the incident angle and the physical image height in the physical image plane, and the physical image height corresponds to the theoretical image height of the first lens after the first lens leaves a factory.
Specifically, after a protective shell or a waterproof shell is added on a first lens, when parameter conversion needs to be performed on the first lens added with a protective lens, a terminal firstly obtains lens calibration parameters of the first lens and a first lens physical distortion table, determines a camera imaging model corresponding to the first lens, determines a form of a pixel image height expression according to the camera imaging model, obtains the pixel image height expression according to a first lens pixel focal length and a first lens pixel distortion parameter in the lens calibration parameters and the form, performs curve fitting according to the first lens physical distortion table, and obtains the physical image height expression according to a corresponding relation between an incidence angle and a theoretical physical image height in the first lens physical distortion table.
The lens calibration parameters refer to a first lens pixel focal length and a first lens pixel distortion parameter which are calibrated in advance, the focal length refers to the distance from an optical main point of a lens to a focal point and is an important performance index of the lens, and the length of the lens focal length determines the size of a shot image, the size of a field angle, the size of a field depth and the perspective strength of a picture. The pixel distortion parameter is used to characterize the incident angle as affected by the pixel distortion. The first lens physical distortion table is used for recording the corresponding relation between the incident angle of the first lens and the theoretical physical image height.
The terminal acquires the first lens information and determines the first lens needing parameter conversion, and then can directly acquire the lens calibration parameters corresponding to the first lens and the first lens physical distortion table. For example, the lens calibration parameters and the first lens physical distortion table may be pre-stored in the database, and after receiving a lens parameter conversion request carrying first lens information, the terminal may obtain the lens calibration parameters and the first lens physical distortion table corresponding to the first lens from the database according to the first lens information.
And 204, obtaining an image height conversion ratio according to the pixel image height expression and the physical image height expression, and acquiring a target physical distortion table corresponding to the second lens.
The image height conversion ratio refers to a conversion ratio from a physical plane to a pixel plane. The second lens is the first lens which is configured with a protective lens, namely the first lens and the protective lens form the second lens, and the protective lens is a protective shell or a waterproof shell which is arranged on the first lens. The target physical distortion table is used for recording the corresponding relation between the incident angle corresponding to the second lens and the physical image height under the condition that the protective lens is configured.
Specifically, after the pixel image height expression and the physical image height expression are obtained, the terminal can calculate the image height conversion ratio by means of a least square method and the like according to the pixel image height expression, the physical image height expression and the first lens physical distortion table, obtain a parameter value of the protective shell or the waterproof shell corresponding to the protective lens and a lens parameter of the first lens, call preset optical software, and input the parameter value of the protective shell or the waterproof shell and the lens parameter of the first lens into the preset optical software, so that the optical software outputs the target physical distortion table.
And step 206, fitting according to the target physical distortion table to obtain a target physical distortion parameter corresponding to the second lens.
The target physical distortion parameter refers to a coefficient corresponding to a fitting function of a target physical distortion table, and the fitting function of the target physical distortion table represents a relationship between an incident angle and a physical image height corresponding to the second lens when the protective lens is arranged.
Specifically, the terminal performs curve fitting according to the target physical distortion table to obtain a target physical distortion fitting curve corresponding to the target physical distortion table, and obtains the target physical distortion parameter according to the coefficient of the target physical distortion fitting curve.
And 208, performing parameter conversion according to the target physical distortion parameter and the image height conversion ratio to obtain a lens parameter conversion result.
The lens parameter conversion result comprises a pixel focal length and a pixel distortion parameter after parameter conversion, wherein the pixel focal length refers to an actual focal length, and the pixel distortion parameter refers to an actual distortion parameter.
Specifically, after the target physical distortion parameter is obtained, the terminal obtains a camera imaging model corresponding to the second lens, calculates to obtain a target physical focal length and a target pixel distortion parameter according to the camera imaging model and the target physical distortion parameter, calculates to obtain a pixel focal length after parameter conversion according to the target physical focal length and the image height conversion ratio, and obtains a lens parameter conversion result by taking the pixel focal length after parameter conversion and the target pixel distortion parameter as the converted lens parameter.
According to the lens parameter conversion method, the pixel image height expression and the physical image height expression of the first lens are obtained, the image height conversion ratio can be calculated by utilizing the pixel image height expression and the physical image height expression, so that after a target physical distortion table corresponding to the second lens is obtained and a target physical distortion parameter is obtained according to the target physical distortion table in a fitting mode, parameter conversion is carried out according to the target physical distortion parameter and the image height conversion ratio, and a lens parameter conversion result is obtained. In the whole process, the first lens with the protective lens is subjected to parameter conversion by using the pixel image height expression and the physical image height expression of the first lens and the target physical distortion table corresponding to the second lens to obtain a lens parameter conversion result, rather than directly re-calibrating the first lens with the protective lens such as a protective shell or a transparent shell, and the first lens with the protective lens is not required to be subjected to parameter conversion, so that the image shot after the protective lens is used is not required to be utilized, the lens parameter calibration process can be simplified, the calculation precision is improved, the first lens with the protective lens, namely the parameter of the second lens, is simply, conveniently and accurately determined, and a good calibration effect is achieved. Particularly, under the condition that the shooting equipment is provided with various protective lenses, the related information of the protective lenses can be firstly identified, and then the lens parameters of the first lens with the protective lenses, namely the second lens, can be quickly obtained according to the lens parameter conversion method, so that the subsequent image processing can be carried out according to the obtained lens parameters, the complex process of recalibrating the lens is omitted in the whole process, and the method is convenient and simple. In one embodiment, obtaining the pixel image height expression and the physical image height expression of the first lens comprises:
acquiring a lens calibration parameter of a first lens and a first lens physical distortion table;
and obtaining a pixel image height expression according to a first lens pixel focal length and a first lens pixel distortion parameter in the lens calibration parameters, and performing curve fitting according to a first lens physical distortion table to obtain a physical image height expression.
Specifically, the lens calibration parameters include a first lens pixel focal length and a first lens pixel distortion parameter which are calibrated in advance, when a pixel image height expression is required to be determined, the terminal can firstly acquire a camera imaging model corresponding to the first lens, determine a form of the pixel image height expression corresponding to the camera imaging model, obtain the pixel image height expression according to the form, the first lens pixel focal length and the first lens pixel distortion parameter, and perform curve fitting according to a corresponding relation between an incident angle and a theoretical distortion physical image height in a first lens physical distortion table to obtain the physical image height expression.
In this embodiment, a pixel image height expression is obtained by using the first lens pixel focal length and the first lens pixel distortion parameter, and a physical image height expression is obtained by performing curve fitting according to the first lens physical distortion table, so that the pixel image height expression and the physical image height expression can be obtained.
In one embodiment, performing curve fitting according to the first lens physical distortion table to obtain the physical image height expression includes:
performing curve fitting according to the corresponding relation between the incident angle and the theoretical distortion physical image height in the first lens physical distortion table to obtain a first lens physical distortion fitting curve corresponding to the first lens physical distortion table;
obtaining a first lens fitting physical distortion parameter corresponding to the physical image height expression according to the first lens physical distortion fitting curve;
and fitting the physical distortion parameters according to the first lens to obtain a physical image height expression.
Specifically, the terminal performs curve fitting according to the corresponding relation between the incident angle and the theoretical distortion physical image height in the first lens physical distortion table, a stack of discrete data points is drawn by different incident angles and corresponding theoretical distortion physical image heights, a curve passing through all the points can be obtained by fitting the points by using a high-order polynomial, namely, a first lens physical distortion fitting curve, the polynomial parameter of the first lens physical distortion fitting curve is a first lens fitting physical distortion parameter, and a physical image height expression can be obtained according to the first lens fitting physical distortion parameter and a preset physical image height expression form. For example, the physical image height expression may specifically be g (α) = c0+ c1 α + c2 α 2 +c3*α 3 +c4*α 4
Figure BDA0003093642270000091
Wherein c1, c2, c3, and c4 are the first lens fitting physical distortion parameters.
In this embodiment, curve fitting is performed by using the correspondence between the incident angle and the theoretical distortion physical image height to obtain a first lens physical distortion fitting curve corresponding to the first lens physical distortion table, and a corresponding first lens physical distortion parameter can be determined by using the first lens physical distortion fitting curve, so that a physical image height expression is obtained according to the first lens physical distortion parameter.
In one embodiment, obtaining the image height conversion ratio according to the pixel image height expression and the physical image height expression comprises:
acquiring a first lens physical distortion table, and acquiring an incident angle set according to the first lens physical distortion table and a preset step length;
substituting the incidence angle in the incidence angle set into a pixel image height expression to obtain a pixel image height matrix, and substituting the incidence angle in the incidence angle set into a physical image height expression to obtain a physical image height matrix;
and obtaining the image height conversion ratio according to the pixel image height matrix and the physical image height matrix.
The preset step length refers to a preset incident angle interval for acquiring an incident angle, and can be set according to needs. For example, when the step size is 0.1 °, it means that an incident angle is obtained every 0.1 °.
Specifically, the terminal obtains a first lens physical distortion table, calculates an incidence angle set according to a maximum angle of view and a preset step length in the first lens physical distortion table, substitutes the incidence angle in the incidence angle set into a pixel image height expression to obtain a pixel image height matrix, substitutes the incidence angle in the incidence angle set into the physical image height expression to obtain a physical image height matrix, and obtains an image height conversion ratio by using a least square method or other methods through the pixel image height matrix and the physical image height matrix. For example, if the maximum field angle in the first lens physical distortion table is 190 °, the maximum field angle at one side is 95 ° can be obtained, that is, the process from the incident light to the maximum incident angle from the optical axis of the vertical camera to 0 ° to 95 °, and by presetting the step length (assuming that 0.1 °), the corresponding set of incident angles can be obtained as {0 °, 0.1 °, 0.2 °,. Logue, 94.9 °, 95 ° }.
By way of example, the image height conversion ratio is obtained by a least square method, where F is a first lens pixel focal length and belongs to lens calibration parameters, a is a pixel image height matrix, B is a physical image height matrix, scale is the image height conversion ratio, h (θ) is a pixel image height expression, g (α) is a physical image height expression, and θ is an incident angle,
Figure BDA0003093642270000101
A*scale=B;
scale=(A T A) -1 A T B;
Figure BDA0003093642270000102
Figure BDA0003093642270000111
in this embodiment, the pixel image height matrix is obtained according to the pixel image height expression, and the physical image height matrix is obtained according to the physical image height expression, so that the determination of the image height conversion ratio can be realized according to the pixel image height matrix and the physical image height matrix.
In one embodiment, fitting the target physical distortion table to obtain the target physical distortion parameter corresponding to the second lens includes:
performing curve fitting according to the corresponding relation between the incident angle and the theoretical distortion physical image height in the target physical distortion table to obtain a target physical distortion fitting curve corresponding to the target physical distortion table;
and determining a target physical distortion parameter according to the target physical distortion fitting curve.
Specifically, the terminal performs curve fitting according to the corresponding relation between the incident angle and the theoretical distortion physical image height in the target physical distortion table, a pile of discrete data points is drawn by different incident angles and corresponding theoretical distortion physical image heights, a curve passing through all points can be obtained by fitting the points by using a high-order polynomial, namely a target physical distortion fitting curve, and the parameter of the polynomial of the target physical distortion fitting curve is a target physical distortion parameter.
In this embodiment, curve fitting is performed by using the correspondence between the incident angle and the theoretical distortion physical image height to obtain a target physical distortion fitting curve corresponding to the target physical distortion table, and the target physical distortion parameter can be determined according to the target physical distortion fitting curve.
In one embodiment, the obtaining the lens parameter conversion result by performing parameter conversion according to the target physical distortion parameter and the image height conversion ratio includes:
obtaining a target physical focal length and a target pixel distortion parameter according to a camera imaging model corresponding to the second lens and the target physical distortion parameter;
and performing parameter conversion according to the target physical focal length, the target pixel distortion parameter and the image height conversion ratio to obtain a lens parameter conversion result.
Specifically, the terminal obtains a camera imaging model corresponding to the second lens, obtains a target function corresponding to the second lens according to the camera imaging model and the target physical distortion parameter, and then optimizes the target function to minimize the target function, so that a target physical focal length and a target pixel distortion parameter can be obtained, and parameter conversion can be performed according to the target physical focal length, the target pixel distortion parameter and the image height conversion ratio to obtain a lens parameter conversion result. The lens parameter conversion result comprises a pixel focal length after parameter conversion and a target pixel distortion parameter, wherein the pixel focal length after parameter conversion is the product of a target physical focal length and an image height conversion ratio.
In this embodiment, the target physical focal length and the target pixel distortion parameter can be obtained according to the camera imaging model and the target physical distortion parameter corresponding to the second lens, and a lens parameter conversion result can be obtained by performing parameter conversion by using the target physical focal length, the target pixel distortion parameter and the image height conversion ratio.
In one embodiment, obtaining the target physical focal length and the target pixel distortion parameter according to the camera imaging model and the target physical distortion parameter includes:
generating a target function corresponding to the second lens according to the camera imaging model and the target physical distortion parameter;
and determining a target incident angle according to the target physical distortion table, and optimizing the target function according to the target incident angle to obtain a target physical focal length and a target pixel distortion parameter.
The target incidence angle refers to an incidence angle for optimizing the target function, and can be obtained according to a target physical distortion table and a preset target step length, wherein the preset target step length refers to a preset incidence angle interval for obtaining the incidence angle, and can be set according to needs. For example, when the target step size is 0.1 °, it means that an incident angle is obtained every 0.1 °. Specifically, the terminal determines a corresponding pixel image height form according to a camera imaging model, converts the pixel image height form and a target physical distortion parameter to obtain a target function corresponding to the second lens, specifies a target physical focal length and a target pixel distortion parameter as variables to be optimized in the target function, determines a target incident angle set according to a target physical distortion table, substitutes known values such as the target incident angle and the target physical distortion parameter in the target incident angle set, performs nonlinear optimization on the target function to minimize the target function, and estimates to obtain the target physical focal length and the target pixel distortion parameter. The method for determining the target incidence angle set according to the target physical distortion table comprises the following steps: and calculating a target incidence angle set according to the maximum field angle in the target physical distortion table and a preset target step length. For example, if the maximum field angle in the target physical distortion table is 190 degrees, the unilateral maximum field angle is 95 degrees, that is, the incident light is from 0 degree to 95 degrees from the perpendicular to the optical axis of the camera to the maximum incident angle, and by presetting the target step length (assumed here to be 0.1 °), the corresponding target incident angle set can be {0 °, 0.1 °, 0.2 °,..,. 94.9 °, 95 ° }.
Wherein the target physical focal length can be expressed by pixel image height expression and physical image height expression, i.e.
Figure BDA0003093642270000131
Wherein g (α) = c0+ c1 α + c2 α 2 +c3*α 3 +c4*α 4
Figure BDA0003093642270000132
The pixel height expression is formed byAnd determining by the camera imaging model, wherein when the camera imaging model is an equidistant projection model, the pixel image height expression h (theta) is as follows: h (θ) = k0 θ + k1 θ = 2 +k2*θ 3 +k3*θ 4 Wherein k0, k1, k2 and k3 are expression coefficients, theta is a target incidence angle, and when the camera imaging model is an Omni model, the pixel image height expression h (theta): h (θ) = r + k1 × r 3 +k2*r 5 +k3*r 7
Figure BDA0003093642270000133
Wherein k1, k2 and k3 are expression coefficients, epsilon is a preset constant, and theta is a target incident angle. According to the expression of the target physical focal length, the target function of e = f × h (θ) -g (α) can be obtained, namely when the camera imaging model is an equidistant projection model, the target function of e = f × h (k 0 × θ + k1 × θ) 2 +k2*θ 3 +k3*θ 4 )-(c0+c1*α+c2*α 2 +c3*α 3 +c4*α 4 ) When the camera imaging model is the Omni model, the objective function is e = f (r + k1 r) 3 +k2*r 5 +k3*r 7 )-(c0+c1*α+c2*α 2 +c3*α 3 +c4*α 4 ),
Figure BDA0003093642270000134
The target incidence angle theta and the target physical distortion parameter are known quantities, a physical image height expression g (alpha) can be obtained according to the target physical distortion parameter, then a target function can be optimized through the physical image height expression and the target incidence angle theta to obtain a target physical focal length f and a pixel image height expression h (theta), and a target pixel distortion parameter can be obtained according to the pixel image height expression h (theta).
The nonlinear optimization is to substitute the target incident angles in the target incident angle set into the objective function in sequence, estimate and adjust a target physical focal length and a target pixel distortion parameter in the objective function by using the target incident angles, so that the objective function obtains a minimum value when the target physical focal length and the target pixel distortion parameter are considered at the same time, and the optimization of the objective function is realized. For example, the non-linear optimization method may specifically be: presetting a target physical focal length f and an initial value of each expression coefficient in a pixel image height expression h (theta), substituting the target incidence angle in the target incidence angle set into the target function, calculating a target function value corresponding to the initial value, performing gradient update on the initial value to obtain a value of a gradient update variable corresponding to the initial value, substituting the value of the gradient update variable into the target function, recalculating a new target function value until the calculated target function value does not decrease any more, wherein the obtained value of the gradient update variable is an optimization result. In this embodiment, a target function corresponding to the second lens is generated according to the camera imaging model and the target physical distortion parameter, and the target function is optimized according to the incident angle in the target physical distortion table, so that the target physical focal length and the target pixel distortion parameter can be obtained.
In an embodiment, as shown in fig. 3, the lens parameter conversion of the present application is described by a flowchart, and the lens parameter conversion specifically includes the following steps:
the terminal outputs a distortion table by using optical measurement (namely, a target physical distortion table corresponding to the second lens is obtained), a distortion coefficient is fitted according to the distortion table (namely, a target physical distortion parameter corresponding to the second lens is obtained according to the target physical distortion table), a camera physical focal length is obtained according to the distortion coefficient and a field angle (namely, a target function corresponding to the second lens is generated according to a camera imaging model and the target physical distortion parameter corresponding to the second lens, a target incident angle is determined according to the target physical distortion table, the target function is optimized according to the target incident angle to obtain the target physical focal length and a target pixel distortion parameter), and the conversion ratio from a physical plane to a pixel plane is calculated according to a bare engine distortion coefficient and a calibration intrinsic parameter (namely, a lens calibration parameter and a first lens physical distortion table of the first lens are obtained, obtaining a pixel image height expression according to the lens calibration parameters, obtaining a physical image height expression according to the first lens physical distortion table, obtaining an image height conversion ratio according to the pixel image height expression and the physical image height expression, obtaining a focal length (namely a target pixel focal length) according to a physical focal length (namely a target physical focal length) and a physical to pixel ratio (namely the image height conversion ratio), wherein the focal length is equal to the physical focal length multiplied by the physical to pixel ratio, replacing the original focal length and distortion coefficient (namely the pixel focal length and the pixel distortion coefficient corresponding to the first lens) with a new focal length (namely a target pixel focal length) and distortion coefficient (namely a target pixel distortion parameter) (namely performing parameter conversion according to the target physical focal length, the target pixel distortion parameter and the image height conversion ratio), get the lens parameter conversion result).
In an embodiment, as shown in fig. 4, a flowchart is used to describe the lens parameter conversion of the present application, where the lens parameter conversion specifically includes the following steps:
step 402, acquiring a lens calibration parameter of a first lens and a first lens physical distortion table;
404, obtaining a pixel height expression according to a first lens pixel focal length and a first lens pixel distortion parameter in the lens calibration parameters;
step 406, performing curve fitting according to the corresponding relation between the incident angle and the theoretical distortion physical image height in the first lens physical distortion table to obtain a first lens physical distortion fitting curve corresponding to the first lens physical distortion table;
step 408, obtaining a first lens fitting physical distortion parameter corresponding to the physical image height expression according to the first lens physical distortion fitting curve;
step 410, fitting a physical distortion parameter according to the first lens to obtain a physical image height expression;
step 412, acquiring a first lens physical distortion table, and obtaining an incidence angle set according to the first lens physical distortion table and a preset step length;
step 414, substituting the incidence angles in the incidence angle set into a pixel image height expression to obtain a pixel image height matrix, and substituting the incidence angles in the incidence angle set into a physical image height expression to obtain a physical image height matrix;
step 416, obtaining an image height conversion ratio according to the pixel image height matrix and the physical image height matrix;
step 418, acquiring a target physical distortion table corresponding to the second lens;
step 420, performing curve fitting according to the corresponding relation between the incident angle and the theoretical distortion physical image height in the target physical distortion table to obtain a target physical distortion fitting curve corresponding to the target physical distortion table;
step 422, determining target physical distortion parameters according to the target physical distortion fitting curve;
step 424, generating a target function corresponding to the second lens according to the camera imaging model corresponding to the second lens and the target physical distortion parameter;
426, determining a target incident angle according to the target physical distortion table, and optimizing a target function according to the target incident angle to obtain a target physical focal length and a target pixel distortion parameter;
and 428, performing parameter conversion according to the target physical focal length, the target pixel distortion parameter and the image height conversion ratio to obtain a lens parameter conversion result.
It should be understood that, although the steps in the flowcharts related to the above embodiments are shown in sequence as indicated by the arrows, the steps are not necessarily executed in sequence as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a part of the steps in each flowchart related to the above embodiments may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of performing the steps or stages is not necessarily sequential, but may be performed alternately or alternately with other steps or at least a part of the steps or stages in other steps.
In one embodiment, as shown in fig. 5, there is provided a lens parameter converting apparatus applied to a second lens, which is a first lens configured with a protective lens, including: an obtaining module 502, a processing module 504, a fitting module 506, and a scaling module 508, wherein:
an obtaining module 502, configured to obtain a pixel image height expression and a physical image height expression of the first lens;
the processing module 504 is configured to obtain an image height conversion ratio according to the pixel image height expression and the physical image height expression, and obtain a target physical distortion table corresponding to the second lens;
a fitting module 506, configured to fit according to the target physical distortion table to obtain a target physical distortion parameter corresponding to the second lens;
and the conversion module 508 is configured to perform parameter conversion according to the target physical distortion parameter and the image height conversion ratio to obtain a lens parameter conversion result.
According to the lens parameter conversion device, the pixel image height expression and the physical image height expression of the first lens are obtained, the calculation of the image height conversion ratio can be realized by utilizing the pixel image height expression and the physical image height expression, so that after a target physical distortion table corresponding to the second lens is obtained and a target physical distortion parameter is obtained according to the target physical distortion table, parameter conversion is carried out according to the target physical distortion parameter and the image height conversion ratio, and a lens parameter conversion result is obtained. In the whole process, the first lens with the protective lens is subjected to parameter conversion by using the pixel image height expression and the physical image height expression of the first lens and the target physical distortion table corresponding to the second lens to obtain a lens parameter conversion result, rather than directly re-calibrating the first lens with the protective lens such as a protective shell or a transparent shell, and the first lens with the protective lens is not required to be subjected to parameter conversion, so that the image shot after the protective lens is used is not required to be utilized, the lens parameter calibration process can be simplified, the calculation precision is improved, the first lens with the protective lens, namely the parameter of the second lens, is simply, conveniently and accurately determined, and a good calibration effect is achieved.
In an embodiment, the obtaining module is further configured to obtain a lens calibration parameter of the first lens and a first lens physical distortion table, obtain a pixel height expression according to a first lens pixel focal length and a first lens pixel distortion parameter in the lens calibration parameter, and perform curve fitting according to the first lens physical distortion table to obtain a physical image height expression.
In an embodiment, the obtaining module is further configured to perform curve fitting according to a corresponding relationship between an incident angle and a theoretical distortion physical image height in the first lens physical distortion table to obtain a first lens physical distortion fitting curve corresponding to the first lens physical distortion table, obtain a first lens fitting physical distortion parameter corresponding to the physical image height expression according to the first lens physical distortion fitting curve, and obtain the physical image height expression according to the first lens fitting physical distortion parameter.
In an embodiment, the processing module is further configured to obtain a first lens physical distortion table, obtain an incident angle set according to the first lens physical distortion table and a preset step length, substitute an incident angle in the incident angle set into the pixel image height expression to obtain a pixel image height matrix, substitute an incident angle in the incident angle set into the physical image height expression to obtain a physical image height matrix, and obtain an image height conversion ratio according to the pixel image height matrix and the physical image height matrix.
In one embodiment, the fitting module is further configured to perform curve fitting according to a corresponding relationship between an incident angle and a theoretical distortion physical image height in the target physical distortion table to obtain a target physical distortion fitting curve corresponding to the target physical distortion table, and determine the target physical distortion parameter according to the target physical distortion fitting curve.
In an embodiment, the conversion module is further configured to obtain a target physical focal length and a target pixel distortion parameter according to the camera imaging model and the target physical distortion parameter corresponding to the second lens, and perform parameter conversion according to the target physical focal length, the target pixel distortion parameter and the image height conversion ratio to obtain a lens parameter conversion result.
In an embodiment, the conversion module is further configured to generate a target function corresponding to the second lens according to the camera imaging model and the target physical distortion parameter, determine a target incident angle according to the target physical distortion table, and optimize the target function according to the target incident angle to obtain a target physical focal length and a target pixel distortion parameter.
For a specific embodiment of the lens parameter converting apparatus, reference may be made to the above embodiments of the lens parameter converting method, which are not described herein again. All or part of the modules in the lens parameter conversion device can be realized by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 6. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless communication can be realized through WIFI, an operator network, NFC (near field communication) or other technologies. The computer program is executed by a processor to implement a shot parameter conversion method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 6 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having a computer program stored therein, the processor implementing the following steps when executing the computer program:
acquiring a pixel image height expression and a physical image height expression of a first lens;
obtaining an image height conversion ratio according to the pixel image height expression and the physical image height expression, and acquiring a target physical distortion table corresponding to the second lens;
fitting according to a target physical distortion table to obtain a target physical distortion parameter corresponding to the second lens;
and performing parameter conversion according to the target physical distortion parameter and the image height conversion ratio to obtain a lens parameter conversion result.
In one embodiment, the processor when executing the computer program further performs the steps of: the method comprises the steps of obtaining a lens calibration parameter of a first lens and a first lens physical distortion table, obtaining a pixel image height expression according to a first lens pixel focal length and a first lens pixel distortion parameter in the lens calibration parameter, and performing curve fitting according to the first lens physical distortion table to obtain a physical image height expression.
In one embodiment, the processor when executing the computer program further performs the steps of: according to the corresponding relation between the incident angle and the theoretical distortion physical image height in the first lens physical distortion table, curve fitting is carried out to obtain a first lens physical distortion fitting curve corresponding to the first lens physical distortion table, according to the first lens physical distortion fitting curve, first lens fitting physical distortion parameters corresponding to the physical image height expression are obtained, and according to the first lens fitting physical distortion parameters, the physical image height expression is obtained.
In one embodiment, the processor, when executing the computer program, further performs the steps of: the method comprises the steps of obtaining a first lens physical distortion table, obtaining an incidence angle set according to the first lens physical distortion table and a preset step length, substituting incidence angles in the incidence angle set into a pixel image height expression to obtain a pixel image height matrix, substituting the incidence angles in the incidence angle set into the physical image height expression to obtain a physical image height matrix, and obtaining an image height conversion ratio according to the pixel image height matrix and the physical image height matrix.
In one embodiment, the processor, when executing the computer program, further performs the steps of: and performing curve fitting according to the corresponding relation between the incident angle and the theoretical distortion physical image height in the target physical distortion table to obtain a target physical distortion fitting curve corresponding to the target physical distortion table, and determining a target physical distortion parameter according to the target physical distortion fitting curve.
In one embodiment, the processor, when executing the computer program, further performs the steps of: and obtaining a target physical focal length and a target pixel distortion parameter according to the camera imaging model and the target physical distortion parameter corresponding to the second lens, and performing parameter conversion according to the target physical focal length, the target pixel distortion parameter and the image height conversion ratio to obtain a lens parameter conversion result.
In one embodiment, the processor, when executing the computer program, further performs the steps of: and generating a target function corresponding to the second lens according to the camera imaging model and the target physical distortion parameter, determining a target incidence angle according to a target physical distortion table, and optimizing the target function according to the target incidence angle to obtain a target physical focal length and a target pixel distortion parameter.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
acquiring a pixel image height expression and a physical image height expression of a first lens;
obtaining an image height conversion ratio according to the pixel image height expression and the physical image height expression, and acquiring a target physical distortion table corresponding to the second lens;
fitting according to a target physical distortion table to obtain a target physical distortion parameter corresponding to the second lens;
and performing parameter conversion according to the target physical distortion parameter and the image height conversion ratio to obtain a lens parameter conversion result.
In one embodiment, the computer program when executed by the processor further performs the steps of: the method comprises the steps of obtaining a lens calibration parameter of a first lens and a first lens physical distortion table, obtaining a pixel image height expression according to a first lens pixel focal length and a first lens pixel distortion parameter in the lens calibration parameter, and performing curve fitting according to the first lens physical distortion table to obtain a physical image height expression.
In one embodiment, the computer program when executed by the processor further performs the steps of: and performing curve fitting according to the corresponding relation between the incident angle and the theoretical distortion physical image height in the first lens physical distortion table to obtain a first lens physical distortion fitting curve corresponding to the first lens physical distortion table, obtaining a first lens fitting physical distortion parameter corresponding to the physical image height expression according to the first lens physical distortion fitting curve, and obtaining the physical image height expression according to the first lens fitting physical distortion parameter.
In one embodiment, the computer program when executed by the processor further performs the steps of: the method comprises the steps of obtaining a first lens physical distortion table, obtaining an incidence angle set according to the first lens physical distortion table and a preset step length, substituting incidence angles in the incidence angle set into a pixel image height expression to obtain a pixel image height matrix, substituting the incidence angles in the incidence angle set into the physical image height expression to obtain a physical image height matrix, obtaining a physical image height matrix, and obtaining an image height conversion ratio according to the pixel image height matrix and the physical image height matrix.
In one embodiment, the computer program when executed by the processor further performs the steps of: and performing curve fitting according to the corresponding relation between the incident angle and the theoretical distortion physical image height in the target physical distortion table to obtain a target physical distortion fitting curve corresponding to the target physical distortion table, and determining a target physical distortion parameter according to the target physical distortion fitting curve.
In one embodiment, the computer program when executed by the processor further performs the steps of: and obtaining a target physical focal length and a target pixel distortion parameter according to the camera imaging model and the target physical distortion parameter corresponding to the second lens, and performing parameter conversion according to the target physical focal length, the target pixel distortion parameter and the image height conversion ratio to obtain a lens parameter conversion result.
In one embodiment, the computer program when executed by the processor further performs the steps of: and generating a target function corresponding to the second lens according to the camera imaging model and the target physical distortion parameter, determining a target incidence angle according to a target physical distortion table, and optimizing the target function according to the target incidence angle to obtain a target physical focal length and a target pixel distortion parameter.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A lens parameter conversion method is characterized in that the method is applied to a second lens, wherein the second lens is a first lens provided with a protective lens;
the lens parameter conversion method comprises the following steps:
acquiring a pixel image height expression and a physical image height expression of the first lens;
obtaining an image height conversion ratio according to the pixel image height expression and the physical image height expression, and acquiring a target physical distortion table corresponding to the second lens;
fitting according to the target physical distortion table to obtain a target physical distortion parameter corresponding to the second lens;
and performing parameter conversion according to the target physical distortion parameter and the image height conversion ratio to obtain a lens parameter conversion result.
2. The method according to claim 1, wherein the obtaining of the pixel image height expression and the physical image height expression of the first lens comprises:
acquiring a lens calibration parameter of a first lens and a first lens physical distortion table;
and obtaining a pixel image height expression according to a first lens pixel focal length and a first lens pixel distortion parameter in the lens calibration parameters, and performing curve fitting according to the first lens physical distortion table to obtain a physical image height expression.
3. The method of claim 2, wherein the curve fitting according to the first lens physical distortion table to obtain the physical image height expression comprises:
performing curve fitting according to the corresponding relation between the incident angle and the theoretical distortion physical image height in the first lens physical distortion table to obtain a first lens physical distortion fitting curve corresponding to the first lens physical distortion table;
obtaining a first lens fitting physical distortion parameter corresponding to a physical image height expression according to the first lens physical distortion fitting curve;
and fitting a physical distortion parameter according to the first lens to obtain a physical image height expression.
4. The method of claim 1, wherein the deriving an image height conversion ratio according to the pixel image height expression and the physical image height expression comprises:
acquiring a first lens physical distortion table, and acquiring an incidence angle set according to the first lens physical distortion table and a preset step length;
substituting the incidence angles in the incidence angle set into the pixel image height expression to obtain a pixel image height matrix, and substituting the incidence angles in the incidence angle set into the physical image height expression to obtain a physical image height matrix;
and obtaining the image height conversion ratio according to the pixel image height matrix and the physical image height matrix.
5. The method of claim 1, wherein the fitting from the target physical distortion table to obtain the target physical distortion parameters corresponding to the second lens comprises:
performing curve fitting according to the corresponding relation between the incident angle and the theoretical distortion physical image height in the target physical distortion table to obtain a target physical distortion fitting curve corresponding to the target physical distortion table;
and determining a target physical distortion parameter according to the target physical distortion fitting curve.
6. The method according to claim 1, wherein the performing parameter transformation according to the target physical distortion parameter and the image height transformation ratio to obtain a lens parameter transformation result comprises:
obtaining a target physical focal length and a target pixel distortion parameter according to the camera imaging model corresponding to the second lens and the target physical distortion parameter;
and performing parameter conversion according to the target physical focal length, the target pixel distortion parameter and the image height conversion ratio to obtain a lens parameter conversion result.
7. The method of claim 6, wherein obtaining a target physical focal length and a target pixel distortion parameter according to the camera imaging model corresponding to the second lens and the target physical distortion parameter comprises:
generating a target function corresponding to the second lens according to the camera imaging model and the target physical distortion parameter;
and determining a target incident angle according to the target physical distortion table, and optimizing the target function according to the target incident angle to obtain a target physical focal length and a target pixel distortion parameter.
8. A lens parameter conversion device is applied to a second lens, wherein the second lens is a first lens configured with a protection lens, the device comprises:
the acquisition module is used for acquiring a pixel image height expression and a physical image height expression of the first lens;
the processing module is used for obtaining an image height conversion ratio according to the pixel image height expression and the physical image height expression and acquiring a target physical distortion table corresponding to the second lens;
the fitting module is used for fitting according to the target physical distortion table to obtain a target physical distortion parameter corresponding to the second lens;
and the conversion module is used for carrying out parameter conversion according to the target physical distortion parameter and the image height conversion ratio to obtain a lens parameter conversion result.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
CN202110604173.4A 2021-05-31 2021-05-31 Lens parameter conversion method, device, computer equipment and storage medium Pending CN115482288A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202110604173.4A CN115482288A (en) 2021-05-31 2021-05-31 Lens parameter conversion method, device, computer equipment and storage medium
PCT/CN2022/092961 WO2022252970A1 (en) 2021-05-31 2022-05-16 Lens parameter conversion method and apparatus, computer device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110604173.4A CN115482288A (en) 2021-05-31 2021-05-31 Lens parameter conversion method, device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115482288A true CN115482288A (en) 2022-12-16

Family

ID=84322767

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110604173.4A Pending CN115482288A (en) 2021-05-31 2021-05-31 Lens parameter conversion method, device, computer equipment and storage medium

Country Status (2)

Country Link
CN (1) CN115482288A (en)
WO (1) WO2022252970A1 (en)

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4893629B2 (en) * 2005-12-05 2012-03-07 株式会社ニコン Distortion correction method, distortion correction program, image processing apparatus, interchangeable lens, camera, and camera system
JP4798221B2 (en) * 2006-04-14 2011-10-19 株式会社ニコン Image distortion correction method, distortion correction program, and optical apparatus
CN110717942B (en) * 2018-07-11 2022-06-10 Oppo广东移动通信有限公司 Image processing method and device, electronic equipment and computer readable storage medium
CN109345467B (en) * 2018-08-14 2021-06-04 深圳市麦极客图像技术有限公司 Imaging distortion correction method, imaging distortion correction device, computer equipment and storage medium
CN109451302A (en) * 2018-12-07 2019-03-08 昆山丘钛微电子科技有限公司 A kind of camera module test method, device, electronic equipment and medium

Also Published As

Publication number Publication date
WO2022252970A1 (en) 2022-12-08

Similar Documents

Publication Publication Date Title
US6538691B1 (en) Software correction of image distortion in digital cameras
CN109345467B (en) Imaging distortion correction method, imaging distortion correction device, computer equipment and storage medium
US9392153B2 (en) Plenoptic camera resolution
CN108040210B (en) Local distortion correction method, mobile terminal and related medium product
CN109754434B (en) Camera calibration method, device, user equipment and storage medium
US10645364B2 (en) Dynamic calibration of multi-camera systems using multiple multi-view image frames
US9235063B2 (en) Lens modeling
JP6547754B2 (en) Triangulation apparatus, triangulation method and program thereof
CN111080687A (en) Method and apparatus for active depth sensing and calibration method thereof
CN111105367B (en) Face distortion correction method and device, electronic equipment and storage medium
CN110809781A (en) Image processing method, control terminal and storage medium
CN112686824A (en) Image correction method, image correction device, electronic equipment and computer readable medium
WO2019232793A1 (en) Two-camera calibration method, electronic device and computer-readable storage medium
US10965871B2 (en) Apparatus and method for compensating for image change caused by optical image stabilization motion
WO2020135577A1 (en) Picture generation method and apparatus, and terminal and corresponding storage medium
CN115482288A (en) Lens parameter conversion method, device, computer equipment and storage medium
CN111353945B (en) Fisheye image correction method, device and storage medium
CN116152357A (en) Parameter calibration system and method for infinity focusing camera
CN113963072B (en) Binocular camera calibration method and device, computer equipment and storage medium
CN113506343B (en) Color coordinate estimation method, system, device and medium based on multi-source data
CN112465917B (en) Distortion calibration method, system, equipment and storage medium of lens module
CN113452920A (en) Focus point determining method, device, equipment and medium
CN113643377B (en) Single lens consistency error analysis method and system based on multiple calibration
CN110728714B (en) Image processing method and device, storage medium and electronic equipment
CN113701891B (en) Temperature drift suppression model construction method, image processing method, device and equipment

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