CN-115482288-B - Lens parameter conversion method, device, computer equipment and storage medium
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 provided with a protective lens. The method comprises the steps of obtaining a pixel image high expression and a physical image high expression of a first lens, obtaining an image height conversion ratio according to the pixel image high expression and the physical image high expression, obtaining a target physical distortion table corresponding to a second lens, obtaining a target physical distortion parameter corresponding to the second lens according to fitting of the target physical distortion table, and carrying out 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 lens parameter calibration flow 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.
Inventors
- LUO TIANJIAO
- CHEN CONG
Assignees
- 影石创新科技股份有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20210531
Claims (10)
- 1. The lens parameter conversion method is characterized by being applied to a second lens, wherein the second lens is formed by configuring a protective lens for a first lens; The lens parameter conversion method comprises the following steps: The method comprises the steps of obtaining a pixel image high expression and a physical image high expression of a first lens, wherein the pixel image high expression refers to a functional expression which represents the relation between an incident angle and a pixel image height in a pixel plane after the incident angle is influenced by pixel distortion, and the physical image high expression is used for representing the corresponding relation between the incident angle and the physical image height in a physical plane; Obtaining an image height conversion ratio according to the pixel image height expression and the physical image height expression, and obtaining a target physical distortion table corresponding to the second lens, wherein the image height conversion ratio refers to a conversion ratio from a physical plane to a pixel plane; Fitting according to the target physical distortion table to obtain a target physical distortion parameter corresponding to the second lens, wherein the target physical distortion parameter refers to a coefficient corresponding to a fitting function of the target physical distortion table, and the fitting function of the target physical distortion table represents a relationship between an incident angle corresponding to the second lens and a physical image height under the condition that a protective lens is configured; and performing parameter conversion according to the target physical distortion parameters and the image height conversion ratio to obtain a lens parameter conversion result.
- 2. The method of claim 1, wherein the obtaining the pixel image height expression and the physical image height expression of the first lens comprises: acquiring lens calibration parameters of a first lens and a first lens physical distortion table; And obtaining a pixel image high 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 high expression.
- 3. The method of claim 2, wherein performing curve fitting according to the first lens physical distortion table to obtain a physical image height expression comprises: Performing curve fitting according to the corresponding relation between the incidence 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 high expression according to the first lens physical distortion fitting curve; And fitting physical distortion parameters according to the first lens to obtain a physical image high expression.
- 4. The method of claim 1, wherein the obtaining the image height conversion ratio from 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 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 an 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 the target physical distortion parameters corresponding to the second lens according to the target physical distortion table comprises: Performing curve fitting according to the corresponding relation between the incidence 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 target physical distortion parameters according to the target physical distortion fitting curve.
- 6. The method of claim 1, wherein performing the parameter conversion according to the target physical distortion parameter and the image height conversion ratio to obtain a lens parameter conversion result comprises: 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 parameters and the image height conversion ratio to obtain a lens parameter conversion result.
- 7. The method of claim 6, wherein obtaining the target physical focal length and the target pixel distortion parameters according to the camera imaging model corresponding to the second lens and the target physical distortion parameters comprises: Generating an objective 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 converting apparatus, applied to a second lens, the second lens being formed by configuring a protective lens for a first lens, the apparatus comprising: The system comprises an acquisition module, a physical image height expression and a first lens, wherein the acquisition module is used for acquiring a pixel image height expression and a physical image height expression of the first lens, wherein the pixel image height expression refers to a functional expression which represents the relation between an incident angle and a pixel image height in a pixel plane after the incident angle is influenced by pixel distortion; 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 obtaining a target physical distortion table corresponding to the second lens, wherein the image height conversion ratio is a conversion ratio from a physical plane to a pixel plane; 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, wherein the target physical distortion parameter refers to a coefficient corresponding to a fitting function of the target physical distortion table, and the fitting function of the target physical distortion table represents a relationship between an incident angle corresponding to the second lens and a physical image height under the condition that a protective lens is configured; And the conversion module is used for carrying out parameter conversion according to the target physical distortion parameters 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 implements the steps of the method of any of claims 1 to 7 when the computer program is executed.
- 10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 7.
Description
Lens parameter conversion method, 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 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 scratch, water inflow, collision damage appear more easily in shooting equipment's camera lens, and change the camera lens high price, so can generally be at shooting equipment's camera lens external mounting protective housing, this protective housing is transparent material generally, can wrap up the camera lens in, plays the effect of protection camera lens, in addition, also can increase the transparent casing that has waterproof effect when shooting underwater scene. The installation of the protective shell or the transparent shell is equivalent to adding a layer of protective lens, and the lens has additional refraction phenomenon on light rays, so that 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, parameter calibration is needed to be carried out on the lens again. In the conventional technology, the conventional lens parameter calibration method is generally adopted to re-calibrate parameters of the lens with the protective shell or the transparent shell, but the process of re-calibrating parameters is complex and complicated, and the re-calibration effect is poor because of the reduced edge resolution capability of an image formed by the lens with the protective shell or the transparent shell. Disclosure of Invention Based on the foregoing, it is necessary to provide a lens parameter conversion method, device, computer equipment and storage medium, which can simplify the parameter calibration process and achieve a good calibration effect. The 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 high expression and a physical image high 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 corresponding to a second lens target; fitting according to a target physical distortion table to obtain target physical distortion parameters corresponding to the second lens; and performing parameter conversion according to the target physical distortion parameters 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 includes: acquiring lens calibration parameters of a first lens and a first lens physical distortion table; and obtaining a pixel image high expression according to the first lens pixel focal length and the 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 high expression. In one embodiment, performing curve fitting according to a first lens physical distortion table to obtain a physical image high expression includes: Performing curve fitting according to the corresponding relation between the incidence 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 high expression according to a first lens physical distortion fitting curve; and fitting physical distortion parameters according to the first lens to obtain a physical image high expression. In one embodiment, obtaining the image height conversion ratio from 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 incident angle in the incident angle set into the pixel image height expression to obtain a pixel image height matrix, and substituting the incident angle in the incident 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 pi