CN114078165A - Calibration method of optical imaging module, distortion correction method and related equipment - Google Patents

Calibration method of optical imaging module, distortion correction method and related equipment Download PDF

Info

Publication number
CN114078165A
CN114078165A CN202010815081.6A CN202010815081A CN114078165A CN 114078165 A CN114078165 A CN 114078165A CN 202010815081 A CN202010815081 A CN 202010815081A CN 114078165 A CN114078165 A CN 114078165A
Authority
CN
China
Prior art keywords
image
coordinates
region
electronic equipment
preset
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
CN202010815081.6A
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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN202010815081.6A priority Critical patent/CN114078165A/en
Publication of CN114078165A publication Critical patent/CN114078165A/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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/80Geometric correction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Processing (AREA)
  • Studio Devices (AREA)

Abstract

The embodiment of the application provides a calibration method and a distortion correction method of an optical imaging module and related equipment, and relates to the technical field of electronic devices. The method provided by the application can be used for calibrating the optical imaging module with the optical free-form surface so as to correct the image acquired by the optical imaging module, and the image acquired by the electronic equipment is more real. The method can be applied to electronic equipment, and an optical imaging module of the electronic equipment comprises an optical free-form surface. The method comprises the following steps: the electronic equipment can acquire N images of the preset calibration plate, each image in the N images comprises a plurality of feature points on the preset calibration plate, and N is a positive integer greater than 2. According to the coordinates of the feature points in the N images, the true value coordinates of the feature points on the preset calibration board can be obtained through calculation. And respectively performing fitting calculation on the coordinates of the characteristic points of each of the M areas by adopting the true value coordinates of the characteristic points to obtain the calibration result of each area.

Description

Calibration method of optical imaging module, distortion correction method and related equipment
Technical Field
The embodiment of the application relates to the technical field of optical electronic devices, in particular to a calibration method of an optical imaging module, a distortion correction method and related equipment.
Background
The optical free-form surface is an optical surface of which the light propagation axis does not have translational symmetry and rotational symmetry, and the lens (lens) surface shape of the optical free-form surface is complex and irregular. If the optical free-form surface is arranged in the optical imaging module, the aberration of the optical system can be further corrected, and the optical performance of the optical imaging module is better improved. In addition, the optical imaging module comprising the optical free-form surface has a compact structure, is easy for light-weight production, and is suitable for terminal products such as Augmented Reality (AR) \ Virtual Reality (VR) head-mounted display equipment (such as VR glasses), cameras, mobile phones and the like.
However, the surface shape of the optical free-form surface is irregular. After an optical free-form surface is arranged in the optical imaging module, optical distortion can be introduced in the optical imaging process, and the optical distortion is accurately explained by adopting a traditional optical distortion model. When the optical imaging module with the optical free-form surface is used for generating the image, distortion data in different directions are different in the range of the field angle of the optical imaging module. That is to say, the image that adopts this optical imaging module to obtain does not conform to the traditional distortion model based on the symmetry characteristics of center of rotation to it is difficult to represent the optical distortion of optics free form surface through conventional distortion model.
It can be understood that if the optical imaging module of the electronic device includes the optical free-form surface, the optical imaging module of the electronic device needs to be subjected to distortion correction, so that an image acquired by the electronic device through the optical imaging module is more real.
Disclosure of Invention
The application provides a calibration method of an optical imaging module, a distortion correction method and related equipment, which can calibrate the optical imaging module with an optical free-form surface so as to correct images collected by the optical imaging module, so that the images acquired by electronic equipment adopting the optical imaging module are more real.
In order to achieve the technical purpose, the following technical scheme is adopted in the application:
in a first aspect, the present application provides a calibration method for an optical imaging module, where the method may be applied to an electronic device, and the optical imaging module of the electronic device includes an optical free-form surface. It can be understood that the optical free curved surface is disposed in the optical imaging module, so that the image captured by the optical imaging module is distorted, resulting in distortion of the image captured by the electronic device. The calibration method of the optical imaging module can be used for calibrating the optical imaging module and obtaining the calibration result, so that the electronic equipment can correct the image acquired by the optical imaging module according to the calibration result, and the image acquired by the electronic equipment is more real.
The method for calibrating the imaging module comprises the following steps: the electronic equipment can acquire N images of the preset calibration plate, each image in the N images comprises a plurality of feature points on the preset calibration plate, and N is a positive integer greater than 2. The N images are acquired by sequentially forming N angles between the preset calibration plate and the imaging surface of the optical imaging module, and the N angles comprise a first preset angle. According to the coordinates of the feature points in the N images, the true value coordinates of the feature points on the preset calibration board can be obtained through calculation. The true coordinates of a plurality of feature points on the preset calibration board may be: when the preset calibration plate and the imaging surface of the optical imaging module form a first preset angle, the undistorted coordinates of the plurality of characteristic points on the calibration plate are preset, or the true coordinates of the plurality of characteristic points on the calibration plate can be understood.
The electronic equipment can calculate to obtain the true value coordinate of the preset calibration plate and the optical imaging module at the first preset angle according to the coordinates of the characteristic points in the N images. Therefore, a first image corresponding to a first preset angle in the N images may be divided into M regions, each of the M regions includes at least one feature point, and M is a positive integer. And respectively performing fitting calculation on the coordinates of the characteristic points of each of the M areas by adopting the true value coordinates of the characteristic points to obtain the calibration result of each area. And the calibration result of each region comprises the offset of the coordinate of each feature point in the corresponding region relative to the corresponding true value coordinate.
It can be understood that the electronic device calculates the true coordinates of the feature points in the first image according to the N images, so that the electronic device can determine the distortion of the image acquired by the optical imaging module according to the coordinates and the true coordinates of the feature points on the first image. The electronic equipment divides the first image into M areas, each area comprises at least one characteristic point, and each area is calculated to obtain calibration data. In this way, various distortions generated in the captured image corresponding to the optical free-form surface can be effectively detected, and distortion correction can be performed on each divided region of the image when the image size is large. That is to say, the method provided by the application can reduce the correction time of the large-size image, thereby improving the correction efficiency of the image.
In a possible design manner of the first aspect, after the electronic device divides the first image into M regions, the following operations may be performed for each region: the electronic equipment can generate a fitted surface of a region according to a calibration result of the region; calculating the fitting error of the fitting surface of one region according to the true value coordinates of a plurality of characteristic points of one region; if the fitting error is smaller than the preset threshold, the fact that the distortion caused by the optical free-form surface is reduced by the fitting surface fitted according to the calibration result is shown, and the calibration result of the area can be stored.
It will be appreciated that the electronic device divides the first image into M regions and fits a surface to each region separately. That is, the electronic device fits to each region of the first image with the idea of local fitting. This way, each feature point in the first image can be effectively covered, and the fitting efficiency of the distorted image can be improved.
In another possible design manner of the first aspect, before the electronic device calculates the true coordinates of the plurality of feature points on the preset calibration board according to the coordinates of the feature points of the N images, the electronic device may further obtain N angles corresponding to the N images, and N distance values between the electronic device and the preset calibration board when the N images are obtained. It can be understood that when the electronic device obtains N images, the electronic device obtains the images of the preset calibration plate when the preset calibration plate sequentially forms N angles with the electronic device.
The first image corresponds to a first preset angle and a first distance value. The electronic equipment calculates an angle corresponding to the true value coordinate to be a first preset angle according to the coordinates of the feature points of the N images, and calculates a distance value corresponding to the true value coordinate to be a first distance value.
It can be understood that, in the process of acquiring the N images by the electronic device, the preset calibration plate and the electronic device sequentially form a preset angle. If the electronic equipment and the preset calibration plate form a first preset angle, the distance between the electronic equipment and the preset calibration plate is a first distance, and the electronic equipment acquires a first image. And sequentially adjusting the angles of the preset calibration plate and the electronic equipment to enable the electronic equipment to acquire N images. When the electronic device calculates the true coordinates according to the N images, the true coordinates on the preset calibration board can be calculated according to the distance values and the preset angles between the N images and the electronic device.
In a second aspect, the present application further provides a distortion correction method, which can be applied to an electronic device, and an optical imaging module of the electronic device can include an optical free-form surface. The optical free-form surface may introduce distortion to an image acquired by the electronic device, and the distortion correction method can correct the distortion introduced by the optical free-form surface, so that the image acquired by the electronic device is more real.
The method can comprise the following steps: the electronic device may acquire an image to be corrected and divide the image to be corrected into M regions. Where M is a positive integer, the calibration result of each of the M regions may be stored in the electronic device in advance, and the calibration result of each region corresponds to an offset of the coordinate of each feature point in the region relative to the corresponding true value coordinate. And the electronic equipment can respectively carry out distortion correction on each pixel point in each region according to the calibration result of each region, the coordinates of each characteristic point in each region and the coordinates of each pixel point in each region, so as to generate a corrected image.
It can be understood that the electronic device stores the calibration result of each of the M regions in advance, and can correct the image according to the calibration result. Therefore, the electronic device can be divided into M regions after acquiring the image to be corrected. The M areas saved by the electronic equipment are obtained by dividing the image and dividing the image to be corrected in the same dividing mode as the electronic equipment. Therefore, the electronic equipment can correct the image to be corrected according to the preset calibration result to obtain the corrected image. By implementing the distortion correction method provided by the application, distortion introduced by the optical free-form surface can be corrected to obtain a real image.
In a possible design manner of the second aspect, the electronic device performs distortion correction on each pixel point in each region respectively according to the calibration result of each region, and the coordinates of each feature point in each region and the coordinates of each pixel point in each region, so as to generate a corrected image.
The electronic device can generate a distortion lookup table of the pixel according to the calibration result of each region, the coordinates of each feature point in each region and the coordinates of each pixel point in each region. The distortion lookup table may include offsets corresponding to coordinates of a plurality of pixels. The electronic equipment can respectively carry out distortion correction on each pixel point in each region according to the distortion lookup table and the coordinates of each pixel point in each region so as to generate a corrected image.
The electronic device can correct the coordinates of each pixel point according to the calibration result. That is, the electronic device may perform distortion correction for each pixel based on the calibration result for each region. The correction mode can effectively correct the image acquired by the electronic equipment, so that the corrected image acquired by the electronic equipment is the same as the real scene.
For example, the distortion lookup table may include offsets corresponding to coordinates of a part of pixel points on the image to be corrected, and the electronic device may calculate the offset of each pixel point on the image to be corrected according to the distortion lookup table. For another example, the distortion lookup table may include an offset corresponding to a coordinate of each pixel point on the image to be corrected, and the electronic device may obtain the coordinate offset of each pixel point by looking up the distortion lookup table.
In another possible design manner of the second aspect, the performing, by the electronic device, distortion correction on each pixel point in each region to generate a corrected image includes: the electronic device may perform distortion correction on each pixel point in each region by using an interpolation method to generate a corrected image.
It can be understood that the interpolation method is adopted to correct the image to accurately correct the geometric distortion on the image, and when the image to be corrected comprises the geometric figure, the interpolation method can correct the geometric figure distortion in the image to improve the reality of the corrected image.
In another possible design manner of the second aspect, the electronic device obtains the image to be corrected and divides the image to be corrected into M regions. The electronic equipment can also acquire a shot image and preprocess the shot image to obtain an image to be corrected. The preprocessing may include at least noise reduction processing, deblurring processing, and the like.
In another possible design manner of the second aspect, the electronic device obtains the image to be corrected and divides the image to be corrected into M regions. The electronic equipment can also acquire N images of the preset calibration plate, each image in the N images comprises a plurality of feature points on the preset calibration plate, and N is a positive integer greater than 2. The N images are acquired by sequentially forming N angles between the preset calibration plate and the imaging surface of the optical imaging module, and the N angles comprise a first preset angle. According to the coordinates of the feature points in the N images, the true value coordinates of the feature points on the preset calibration board can be obtained through calculation. The true coordinates of a plurality of feature points on the preset calibration board may be: when the preset calibration plate and the imaging surface of the optical imaging module form a first preset angle, the undistorted coordinates of the plurality of characteristic points on the calibration plate are preset, or the true coordinates of the plurality of characteristic points on the calibration plate can be understood. The electronic device may divide a first image corresponding to a first preset angle in the N images into M regions, where each of the M regions includes at least one feature point. In this way, the electronic device may adopt the true coordinates of the plurality of feature points to respectively fit the coordinates of the feature points of each of the M regions, so as to obtain the calibration result of each region.
In another possible design manner of the second aspect, after the electronic device divides the first image into M regions, the following operations may be performed for each region: the electronic equipment can calculate the fitting error of the plurality of characteristic points of one region, namely the calibration result of the region according to the true value coordinates of the plurality of characteristic points of the region; generating a fitting curved surface of a region according to a calibration result of the region; if the fitting errors in the region are all smaller than the preset threshold value, the calibration result is effective, distortion caused by the optical free-form surface can be reduced according to the fitted surface after the calibration result is fitted, and the calibration result of the region can be stored.
In another possible design manner of the first aspect, before the electronic device calculates the true coordinates of the plurality of feature points on the preset calibration board according to the coordinates of the feature points of the N images, the electronic device may further obtain N angles corresponding to the N images, and N distance values between the electronic device and the preset calibration board when the N images are obtained. It can be understood that when the electronic device obtains N images, the electronic device obtains the images of the preset calibration plate when the preset calibration plate sequentially forms N angles with the electronic device.
In a third aspect, the present application further provides an electronic device, which may include: the device comprises an acquisition module and a calibration module. The acquisition module may be configured to acquire an image to be corrected and divide the image to be corrected into M regions. The calibration result of each of the M regions may be pre-stored in the electronic device, and the calibration result of each region corresponds to an offset of the coordinate of each feature point in the region relative to the corresponding true value coordinate. The calibration module can be used for respectively carrying out distortion correction on each pixel point in each region according to the calibration result of each region, the coordinates of each characteristic point in each region and the coordinates of each pixel point in each region, and generating a corrected image.
In a possible design manner of the third aspect, the calibration module may be specifically configured to generate a distortion lookup table of pixels according to the calibration result of each region, and coordinates of each feature point in each region and coordinates of each pixel point in each region. The distortion lookup table can include offsets corresponding to the coordinates of the multiple pixel points, and the electronic device can calculate the offset corresponding to the coordinates of each pixel point according to the distortion lookup table. And respectively carrying out distortion correction on each pixel point in each region according to the distortion lookup table and the coordinates of each pixel point in each region so as to generate a corrected image.
In another possible design manner of the third aspect, the calibration module may further be configured to perform distortion correction on each pixel point in each region by using an interpolation method, so as to generate a corrected image.
In another possible design manner of the third aspect, the obtaining module may further be configured to obtain a captured image, and perform preprocessing on the captured image to obtain an image to be corrected. The preprocessing may include at least noise reduction processing, deblurring processing, and the like.
In another possible design manner of the third aspect, the electronic device may further include a computing module.
The acquisition module can also be used for acquiring N images of the preset calibration plate, wherein each image in the N images comprises a plurality of characteristic points on the preset calibration plate, and N is a positive integer greater than 2. The N images are acquired by sequentially forming N angles between the preset calibration plate and the imaging surface of the optical imaging module, and the N angles comprise a first preset angle.
The calculation module may be configured to calculate, according to the coordinates of the feature points in the N images, true coordinates of the plurality of feature points on the preset calibration board. The true coordinates of a plurality of feature points on the preset calibration board may be: when the preset calibration plate and the imaging plane of the optical imaging module form a first preset angle, the undistorted coordinates of the plurality of characteristic points on the calibration plate are preset.
The acquisition module is further used for dividing a first image corresponding to a first preset angle in the N images into M areas, and each area in the M areas comprises at least one feature point.
The calibration module may further be configured to respectively fit the coordinates of the feature points of each of the M regions by using the true coordinates of the plurality of feature points, so as to obtain a calibration result of each region.
In a fourth aspect, the present application further provides an electronic device, including: a memory, a display device, and one or more processors; the memory, the display device and the processor are coupled. Wherein the memory is adapted to store computer program code comprising computer instructions which, when executed by the processor, cause the electronic device to perform the steps as in the first aspect and any of its possible designs, the second aspect and any of its possible designs.
In a fifth aspect, the present application further provides a chip system, where the chip system is applied to an electronic device including a memory; the chip system includes one or more interface circuits and one or more processors; the interface circuit and the processor are interconnected through a line; the interface circuit is used for receiving signals from the memory and sending signals to the processor, and the signals comprise computer instructions stored in the memory; when the processor executes the computer instructions, the electronic device performs the method as in the first aspect and any of its possible designs and the second aspect and any of its possible designs.
In a sixth aspect, the present application also provides a computer readable storage medium comprising computer instructions which, when run on a control device, cause the control device to perform the method as in the first aspect and any one of its possible designs and the second aspect and any one of its possible designs.
In a seventh aspect, the present application further provides a computer program product, which when run on a computer, enables the computer to perform the method of the first aspect and any of its possible designs and the second aspect and any of its possible designs.
It should be understood that, for the beneficial effects achieved by the third aspect and any possible design manner thereof, the electronic device of the fourth aspect, the chip system of the fifth aspect, the computer-readable storage medium of the sixth aspect, and the computer program product of the seventh aspect provided by the present application, reference may be made to the beneficial effects of the first aspect, the second aspect, and any possible design manner thereof, and no further description is provided herein.
Drawings
Fig. 1 is a schematic structural diagram of a testing apparatus provided in the present application;
fig. 2 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure;
fig. 3 is a flowchart of a calibration method of an optical imaging module according to an embodiment of the present disclosure;
fig. 4 is a schematic test diagram of a testing apparatus according to an embodiment of the present disclosure;
FIG. 5 is a schematic view of a calibration plate according to an embodiment of the present application;
fig. 6A is a schematic diagram of a first image partition according to an embodiment of the present disclosure;
fig. 6B is a schematic diagram of another first image division provided in the present embodiment;
fig. 7 is a flowchart of a distortion correction method according to an embodiment of the present application;
fig. 8A is an image to be corrected according to an embodiment of the present disclosure;
FIG. 8B is a diagram of a corrected image according to an embodiment of the present disclosure;
fig. 9A is a schematic diagram of an image to be corrected according to an embodiment of the present disclosure;
FIG. 9B is a schematic diagram of a corrected image according to an embodiment of the present disclosure;
fig. 10 is a schematic block diagram of an electronic device according to an embodiment of the present disclosure;
fig. 11 is a schematic structural diagram of a chip system according to an embodiment of the present disclosure.
Detailed Description
In the following, the terms "first", "second" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the present embodiment, "a plurality" means two or more unless otherwise specified.
The conventional optical imaging module is composed of a spherical lens or an aspheric lens. The optical distortion of the traditional optical imaging module occurs during imaging due to the manufacturing precision of the lens and the deviation of the assembly process of the optical imaging module. It can be understood that, because the spherical lens and the aspherical lens have rotational symmetry, the optical distortion of the conventional optical imaging module has rotational symmetry. Exemplary distortions that occur when capturing images in conventional optical imaging modules include radial and tangential distortions. That is, the optical distortion formed by a conventional optical imaging module can be characterized by radial distortion and tangential distortion.
It can be understood that the light propagation axis of the optical free-form surface has no translational symmetry and rotational symmetry, and the lens surface shape of the optical free-form surface is irregular. The structural characteristics of the optical free-form surface enable the aberration of the optical system to be further corrected, the optical performance to be better improved, and the optical imaging module comprising the optical free-form surface is compact in structure and easy to produce in a light weight mode. However, since the lens surface shape of the optical free-form surface is irregular, optical distortion occurs in the optical imaging module after the optical free-form surface is arranged in the optical imaging module, and the optical distortion does not conform to the conventional distortion model. Based on the structural characteristics of the optical free-form surface, calibrating the optical lens provided with the optical free-form surface to obtain a calibration result. When the optical imaging module is arranged on the electronic equipment, the electronic equipment can perform distortion correction on the image acquired by the optical imaging module according to the calibration result, so that the image acquired by the electronic equipment through the optical imaging module is more real.
In the first implementation, a calibration plate is fixed at a position having a preset distance from the electronic equipment, and the electronic equipment can acquire an image of the calibration plate through the optical imaging module. The calibration board is provided with a plurality of characteristic points, and the images of the calibration board collected by the electronic equipment comprise the characteristic points on the calibration board. The electronic device can identify the image of the calibration plate to extract coordinates of feature points in the image of the calibration plate. And the electronic equipment calculates the coordinates of the extracted feature points on the image of the calibration plate and the coordinates of the real feature points of the calibration plate to obtain the distortion parameter of each feature point, namely the calibration result. Therefore, when the electronic equipment is used for shooting the image, distortion correction can be carried out on the pixel points on the shot image according to the calibration result, so that the image shot by the electronic equipment is more real.
It should be noted that, in the above implementation, the angle between the fixed test board and the electronic device is difficult to accurately obtain, so that the calibration result calculated by the electronic device is inaccurate. Therefore, this calibration method is not suitable for high-precision distortion correction. In addition, the distortion of the image acquired by the optical imaging module of the optical free-form surface does not conform to a conventional distortion model, and the distortion caused by the optical free-form surface cannot be accurately identified and corrected by the calibration mode.
In a second implementation, three theodolites can be used to establish the measurement coordinate system. The calibration plate is arranged in a measurement coordinate system established by the theodolite, and the angle of the calibration plate, the angle of the electronic equipment and the like in the field angle range of the optical system are calibrated through reference conversion. In this way, when the field angle of the electronic device is calculated to be 76 degrees in the measuring coordinate system established by the three theodolites, the calibration of the two-dimensional distortion distribution on the image of the calibration plate acquired by the electronic device can be realized.
The implementation mode can accurately obtain the calibration result of the optical imaging module. However, this method is expensive, complicated and difficult to implement.
In a third implementation manner, an image of a geometric figure may be captured by using an electronic device, the electronic device may identify structural distortion of the geometric figure on the image, and calibrate the distorted geometric figure based on a real geometric figure structure. It will be appreciated that this approach may eliminate distortion of the geometry captured by the electronic device, however, this technique does not accurately identify distortion of every pixel in the image.
That is, in this implementation, the electronic device may calculate global parameters of the image, and may not recognize distortion of each pixel based on the pixels of the image, and the distortion residual is difficult to guarantee. Therefore, this implementation is not suitable for high-precision distortion correction.
The embodiment of the application provides a calibration method of an optical imaging module, which can be applied to electronic equipment, wherein the optical imaging module of the electronic equipment comprises an optical free-form surface. The electronic equipment adopts the method provided by the application, and calculates the true value coordinates of the characteristic points on the image with the preset angle by collecting the image with the multiple angles. And calculating the calibration result of each local part by adopting a local fitting mode according to the true value coordinate obtained by calculation, and obtaining the calibration result of the whole image according to the calibration result of each local part. That is to say, the method provided by the embodiment of the application can be used for calculating the distortion in each direction of the image acquired by the optical imaging module, and further correcting the image according to the calibration result so as to obtain a more real image.
It can be understood that, the calibration result of the optical imaging module with the optical free-form surface is obtained by the method provided by the application, and the distortion of the lens surface type of the optical free-form surface to the optical imaging module can be known according to the calibration result, so that the design of the optical free-form surface can be adjusted according to the calibration result, and the lens surface type of the optical free-form surface is improved.
The embodiment of the application further provides a distortion correction method, and distortion correction is performed on the image obtained by the optical imaging module by adopting the calibration result obtained by the calibration method of the optical imaging module in the embodiment.
Wherein, the in-process of maring the optical imaging module can adopt testing arrangement to mark the electronic equipment who is provided with the optical imaging module. Fig. 1 is a schematic structural diagram of a testing apparatus according to an embodiment of the present disclosure. As in fig. 1, the test apparatus includes: the test tool 10, the rotating mechanism 20, the calibration plate 30 and the like. The test fixture 10 is used for fixing an electronic device, and the calibration plate 30 may be fixed on the rotating mechanism 20. The calibration plate 30 is rotated when the rotating mechanism 20 is rotated. As shown in fig. 1, the rotating mechanism 20 may be a rotating shaft.
When the electronic device is fixed on the test fixture 10, the optical axis direction of the optical imaging module of the electronic device is perpendicular to the calibration plate at the 0-degree position. Wherein, the rotating mechanism 20 may further be provided with an angle measuring device, and the angle measuring device may measure the angle between the rotating mechanism 20 and the test fixture 10. The test fixture 10 is fixed and the angle is not adjustable, and the angle between the test board on the rotating mechanism 20 and the electronic device on the test fixture 10 can be adjusted by adjusting the rotating mechanism 20.
For example, the electronic device in the embodiment of the present application may be a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, a vehicle-mounted device, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a Personal Digital Assistant (PDA), an Augmented Reality (AR) \ Virtual Reality (VR) device, and the like, and the embodiment of the present application does not particularly limit the specific form of the electronic device.
Suppose the electronic device is a mobile phone and the optical imaging module is a camera module on the mobile phone. For example, the optical imaging module with the optical free-form surface may be an ultra-wide-angle camera module on a mobile phone. When the ultra-wide-angle camera module on the mobile phone comprises the optical free-form surface, distortion correction can be performed on an image collected by the ultra-wide-angle camera module in the mobile phone, so that the image shot by the mobile phone is more real.
The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings.
Please refer to fig. 2, which is a schematic structural diagram of an electronic device 200 according to an embodiment of the present disclosure. As shown in fig. 2, the electronic device 200 may include a processor 210, an external memory interface 220, an internal memory 221, a charging management module 240, a power management module 241, a battery 242, an antenna 1, an antenna 2, a mobile communication module 250, a wireless communication module 260, a sensor module 280, keys 290, a camera 291, a display 294, and the like. Among them, the sensor module 280 may include a pressure sensor, a gyroscope sensor, a vibration sensor, a direction sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a temperature sensor, a touch sensor, an ambient light sensor, and the like.
It is to be understood that the illustrated structure of the embodiment of the present invention does not specifically limit the electronic device 200. In other embodiments of the present application, the electronic device 200 may include more or fewer components than illustrated, or some components may be combined, some components may be separated, or a different arrangement of components may be used. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
Processor 210 may include one or more processing units, such as: the processor 210 may include an Application Processor (AP), a modem processor, a Graphics Processing Unit (GPU), an Image Signal Processor (ISP), a controller, a memory, a video codec, a Digital Signal Processor (DSP), a baseband processor, and/or a neural-Network Processing Unit (NPU), etc. The different processing units may be separate devices or may be integrated into one or more processors.
The controller may be, among other things, a neural center and a command center of the electronic device 200. The controller can generate an operation control signal according to the instruction operation code and the timing signal to complete the control of instruction fetching and instruction execution.
A memory may also be provided in processor 210 for storing instructions and data.
In some embodiments, processor 210 may include one or more interfaces. The interface may include an integrated circuit (I2C) interface, an integrated circuit built-in audio (I2S) interface, a Pulse Code Modulation (PCM) interface, a universal asynchronous receiver/transmitter (UART) interface, a Mobile Industry Processor Interface (MIPI), a general-purpose input/output (GPIO) interface, a Subscriber Identity Module (SIM) interface, and/or a Universal Serial Bus (USB) interface, etc.
It should be understood that the connection relationship between the modules according to the embodiment of the present invention is only illustrative, and is not limited to the structure of the electronic device 200. In other embodiments of the present application, the electronic device 200 may also adopt different interface connection manners or a combination of multiple interface connection manners in the above embodiments.
The external memory interface 220 may be used to connect an external memory card, such as a Micro SD card, to extend the memory capability of the electronic device 200. The external memory card communicates with the processor 210 through the external memory interface 220 to implement a data storage function. For example, files such as music, video, etc. are saved in an external memory card.
Internal memory 221 may be used to store computer-executable program code, including instructions. The processor 210 executes various functional applications of the electronic device 200 and data processing by executing instructions stored in the internal memory 221.
The charge management module 240 is configured to receive a charging input from a charger. The charger may be a wireless charger or a wired charger. The power management module 241 is used to connect the battery 242, the charging management module 240 and the processor 210. The power management module 241 receives input from the battery 242 and/or the charge management module 240 to power the processor 210, the internal memory 221, the external memory, the display screen 294, and the like.
The wireless communication function of the electronic device 200 may be implemented by the antenna 1, the antenna 2, the mobile communication module 250, the wireless communication module 260, a modem processor, a baseband processor, and the like.
The electronic device 200 may implement a shooting function through the ISP, the camera 291, the video codec, the GPU, the display 294, and the application processor, etc. The electronic device 200 may include 1-N cameras 291, where N is a positive integer greater than 1. Illustratively, the electronic device 200 includes a wide-angle camera, and the wide-angle camera includes an optical free-form surface therein. Wherein, wide-angle camera and ISP constitute optical imaging module.
The ISP is used to process the data fed back by the camera 291. For example, when a photo is taken, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, the optical signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converting into an image visible to naked eyes. The ISP can also carry out algorithm optimization on the noise, brightness and skin color of the image. The ISP can also optimize parameters such as exposure, color temperature and the like of a shooting scene. In some embodiments, the ISP may be provided in the camera 291.
The camera 291 is used to capture still images or video. The object generates an optical image through the lens and projects the optical image to the photosensitive element. The photosensitive element may be a Charge Coupled Device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The light sensing element converts the optical signal into an electrical signal, which is then passed to the ISP where it is converted into a digital image signal. And the ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into image signal in standard RGB, YUV and other formats.
The digital signal processor is used for processing digital signals, and can process digital image signals and other digital signals. For example, when the electronic device 200 selects a frequency point, the digital signal processor is used to perform fourier transform or the like on the frequency point energy.
Video codecs are used to compress or decompress digital video. The electronic device 200 may support one or more video codecs. In this way, the electronic device 200 may play or record video in a variety of encoding formats, such as: moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, and the like.
The electronic device 200 implements display functions via the GPU, the display screen 294, and the application processor. The GPU is a microprocessor for image processing, and is connected to the display screen 294 and an application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 210 may include one or more GPUs that execute program instructions to generate or alter display information.
The display screen 294 is used to display images, video, and the like. The display screen 294 includes a display panel. The display panel may adopt a Liquid Crystal Display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (active-matrix organic light-emitting diode, AMOLED), a flexible light-emitting diode (FLED), a miniature, a Micro-oeld, a quantum dot light-emitting diode (QLED), and the like. In some embodiments, the electronic device 200 may include 1 or N display screens 294, N being a positive integer greater than 1.
The methods in the following embodiments may be implemented on an electronic device having the above hardware structure.
Please refer to fig. 3, which is a flowchart illustrating a calibration method of an optical imaging module according to an embodiment of the present disclosure. As shown in fig. 3, the method includes steps 301-305.
It can be understood that the optical imaging module comprises an optical free-form surface, and the optical imaging module is a camera module arranged on the electronic equipment. Taking the electronic device as a mobile phone as an example, the calibration method can be performed on a camera module on the mobile phone by using the testing apparatus shown in fig. 1.
Step 301: the method comprises the steps of obtaining N images of a preset calibration plate, wherein each image of the N images comprises a plurality of feature points on the preset calibration plate, and N is a positive integer larger than 2.
The N images are acquired by sequentially forming N angles between the preset calibration plate and the imaging surface of the optical imaging module, and the N angles comprise a first preset angle.
Illustratively, taking N as 3 as an example, if the first preset angle is 0 °, the included angle between the camera of the mobile phone and the preset calibration board is 0 °, that is, the camera of the mobile phone is parallel to the preset calibration board. The second preset angle is-20 degrees, and the included angle between the camera of the mobile phone and the preset calibration board is-20 degrees. The third preset angle is 20 degrees, and then the included angle between the camera of the mobile phone and the preset calibration plate is 20 degrees. As shown in fig. 4, when the preset calibration board is at position 1 (as in S1 in fig. 4), the included angle between the mobile phone and the preset calibration board is a second preset angle; when the preset calibration board is at position 2 (as shown in S2 in fig. 4), an included angle between the mobile phone and the preset calibration board is a first preset angle; when the preset calibration board is at position 3 (as shown in S3 in fig. 4), the included angle between the mobile phone and the preset calibration board is a third preset angle.
The angle of the rotating mechanism 20 on the testing device is adjusted to achieve the purpose of adjusting the included angle between the mobile phone and the preset calibration plate. And adjusting the rotating mechanism to enable the preset calibration plate to be in the position 1, the position 2 and the position 3 in sequence, and when the preset calibration plate is in the corresponding position, the mobile phone acquires an image of the preset calibration plate. In a possible implementation, the preset calibration plate is at position 1, the mobile phone obtains an image of the preset calibration plate, the mobile phone judges whether the image of the calibration plate is a clear image, and if the image of the calibration plate is determined to be a clear image, one-time shooting is completed. And N is 3, the mobile phone determines to acquire images of 3 different calibration plates, and then the acquisition of the images of the calibration plates is completed.
N may be set by a user, for example, N is 3, 4, or 5. The mobile phone can acquire the value of N set by the user to judge that the image acquisition of the calibration board is completed. And the corresponding angle of each image in the images of the N calibration plates can also be set by the user, for example, N is 3, and the preset angle can also be-10 °, 0 ° and 10 °.
The preset calibration plate comprises a plurality of feature points, and the mobile phone comprises a plurality of feature points on an image of the preset calibration plate when acquiring the image of the preset calibration plate. That is, the image of the preset calibration plate acquired by the mobile phone includes a plurality of feature points of the preset calibration plate. In a possible implementation, assuming that the preset calibration board includes 30 × 20 feature points, after the mobile phone acquires the image of the calibration board, it is determined that the image of the calibration board includes 30 × 20 feature points, and then it is determined that the image of the calibration board is a satisfactory image.
Illustratively, the preset calibration plate includes 38 × 26 feature points, and 10 special feature points may be included in the 38 × 26 feature points, except for the special feature points. Please refer to fig. 5, which is a partial schematic view of a preset calibration plate according to an embodiment of the present disclosure. As shown in fig. 5, a denotes a special feature point, and the special feature point is a circular ring. B is a non-special characteristic point which is a solid round point.
The preset calibration board may be arranged in a checkerboard manner, such as the arrangement shown in fig. 5, or arranged in a circular grid manner. The shape of the feature points may be solid dots, circles, asymmetric dots, and the like.
It should be noted that, under the condition that the first preset angle is 0 °, when the mobile phone obtains an image of the preset calibration plate, the feature points of the preset calibration plate should be distributed over the entire field of view of the camera of the mobile phone, and the special feature points are located in the field of view of the camera. In this way, the characteristic points of the preset calibration board are distributed in the image view acquired by the mobile phone and comprise special characteristic points.
Step 302: according to the coordinates of the feature points in the N images, the true value coordinates of the plurality of feature points on the corresponding first image when the mobile phone and the preset calibration board form a first preset angle can be calculated.
The truth coordinates of a plurality of feature points on the preset calibration board can be as follows: when the preset calibration plate and the imaging surface of the optical imaging module form a first preset angle, the undistorted coordinates of the plurality of characteristic points on the calibration plate are preset, or the true coordinates of the plurality of characteristic points on the calibration plate can be understood.
It can be understood that, after acquiring the N images, the mobile phone identifies the coordinates of the feature points of the preset marker board in each of the N images. And calculating a true value coordinate of the feature point on the first image according to the coordinates of the feature points on the N images. Since the mobile phone does not perform distortion correction on the N images, the N images are images with distortion.
Illustratively, the mobile phone obtains a distance value between the mobile phone and the preset calibration board and an angle between the mobile phone and the preset calibration board according to coordinates of feature points on each image in the N images. And calculating to obtain the true value coordinate of the first image through processing the N images.
Step 303: according to the coordinates of the feature points in the N images, the real distance and the angle between the mobile phone and the preset calibration board when the mobile phone and the preset calibration board form the first preset angle can be calculated.
For example, the mobile phone may calculate, according to the coordinates of the feature points in the N images, a true distance value and an actual angle value between the mobile phone and the preset calibration board when the angle between the mobile phone and the preset calibration board is 0 °.
When the mobile phone obtains N images, the mobile phone obtains the real distance and angle between the mobile phone and the preset calibration board when the image is shot by obtaining one image. The real angle corresponding to the first image is 0 °, and the true value coordinate of the first image is obtained by the mobile phone through calculation.
Step 304: the first image is divided into M areas, each area of the M areas comprises at least one characteristic point, and M is a positive integer.
Illustratively, as shown in fig. 6A, the first image is divided into 12 × 9 regions according to a preset dividing manner. The division of the first image may be uniform division or non-uniform division, and here, for example, as shown in fig. 6A, the first image is non-uniformly divided. Note that, as shown in fig. 6A, a plurality of feature points on the first image are displayed in the form of a cross, and the distribution of the feature points on the preset calibration board can be represented by the cross on the first image.
As another example, as shown in fig. 6B, the first image is divided into 12 × 9 regions according to a preset uniform dividing manner. It should be noted that the preset calibration board includes special feature points and non-special feature points, and the special feature points serve to mark the direction of the preset calibration board, so that all the feature points on the preset calibration board on the first image are represented in a cross form.
The dividing manner of the first image is not particularly limited in the present application, and for example, the first image may be divided into 12 × 9 regions, or the first image may be divided into 22 × 13 regions. As long as it is ensured that each region includes the feature point, the specific division manner is subject to the preset division manner.
Step 305: and respectively performing fitting calculation on the coordinates of the characteristic points of each of the M areas by adopting the true value coordinates of the characteristic points to obtain the calibration result of each area.
And the calibration result of each region comprises the offset of the coordinate of each feature point in the corresponding region relative to the corresponding true value coordinate.
For example, after the mobile phone divides the first image into M regions, the following operations may be performed for each region: calculating the fitting error of the fitting surface of one region according to the true value coordinates of a plurality of characteristic points of one region; if the fitting error is smaller than the preset threshold, the calibration result is valid, and the calibration result of the area can be stored.
In one possible embodiment, the distortion of each feature point may be described based on discrete data points in the region into which the first image is divided. For example, the calibration procedure for each region is: and establishing a rectangular coordinate system for the first image, and constructing two families of basis functions of the feature points according to the coordinates of the x axis and the y axis for the feature points in one region. And identifying the number of the characteristic points in the area, including the number in the x-axis direction and the y-axis direction, so as to obtain the row number and the column number of the characteristic points in the area. And fitting the coordinate difference between each characteristic point and the true value coordinate by using a local curved surface to obtain a fitted curved surface. When the local surface is adopted to fit the coordinate difference between each characteristic point and the true value coordinate, the method specifically comprises the following steps: firstly, fitting the coordinates of the characteristic points in the x direction by adopting a unitary function to obtain m curves; and performing function fitting on the coordinates of the characteristic points in the y direction to obtain a fitted curved surface.
In order to ensure smooth distortion between adjacent regions, the coordinates of the feature points at the edge of each region may be controlled to ensure smooth distortion between adjacent regions.
It should be noted that, after calculating a difference value between each feature point of each of the M regions on the first image and the true value coordinate, fitting the difference value in each region respectively to obtain a fitted curved surface. The method comprises the steps of calculating the standard deviation and the maximum error value of the surface fitting error, if the surface fitting error of the region is smaller than a preset threshold value, determining that the surface fitting error of the region can represent the distortion of an image, and storing a calibration result of the region in a memory. In the subsequent use process of the mobile phone, the distortion correction is carried out on the image by adopting the calibration result of each area, so that the image acquired by the mobile phone is a real image.
For example, if there is a surface fitting error of one region in M regions of the first image, which is greater than a preset threshold, then surface fitting needs to be performed again on the region. Or recalculating the calibration result for the region, and performing surface fitting according to the recalculated calibration result.
Exemplarily, the mobile phone generates a distortion lookup table of pixels according to the calibration result of each region, the coordinates of each feature point in each region and the coordinates of each pixel point in each region; the offset corresponding to the coordinate of each pixel point can be calculated through the distortion lookup table; distortion look-up tables include, but are not limited to, original size, 1/2 down-sample size, 1/4 size.
The embodiment of the application further provides a distortion correction method, wherein after the mobile phone completes calibration, the calibration result of each area is stored in the memory, and when the mobile phone is used for obtaining an image, distortion correction needs to be performed on the image obtained by the mobile phone. As shown in fig. 7, the method may include steps 701-703.
Step 701: the mobile phone acquires a shot image and preprocesses the shot image to obtain an image to be corrected.
The preprocessing may include at least noise reduction processing, deblurring processing, and the like.
It can be understood that, the image processor in the mobile phone can pre-process the shot image acquired by the mobile phone through the camera. The preprocessing can solve the imaging problem of the image so as to carry out post-processing on the shot image.
Step 702: and the mobile phone determines distortion data corresponding to each pixel point by using the calibration result of each region aiming at each pixel point in the shot image according to the distortion lookup table.
The distortion lookup table may include offsets of coordinates of a plurality of pixel points on the shot image. For example, the number of pixels included in the captured image is: 1600 x 1200, the distortion look-up table may include offsets of the coordinates of 40 x 30 pixels. The mobile phone can calculate the offset of the coordinates of each pixel point on the shot image through the distortion lookup table according to the relation between the pixels.
In one possible implementation, the distortion lookup table may include an offset of coordinates of each pixel point on the captured image. Therefore, the mobile phone can directly obtain the offset of the coordinate of each pixel point in the distortion lookup table.
Step 703: the mobile phone can respectively carry out distortion correction on each pixel point in the shot image according to the distortion data of each pixel point in the shot image, the coordinates of each characteristic point and the coordinates of each pixel point in each area, and generate a corrected image.
The electronic device may perform distortion correction on each pixel point in each region by using an interpolation method to generate a corrected image.
For example, the mobile phone may perform distortion correction on the image to be corrected by using an interpolation method to obtain a corrected image.
It can be understood that the distortion generated by the first image shot by the mobile phone also generates an image to be corrected. Therefore, the distortion of the image to be corrected is corrected by adopting the calibration result of the first image, and the distorted image can be accurately corrected, so that the image acquired by the mobile phone through the optical imaging module is more real.
For example, it is assumed that the distortion of the first image is as shown in fig. 8A, where the positions of feature points of 3 lines on the first image are distorted in the first image shown in fig. 8A. As shown in fig. 8B, the distortion of the first image shown in fig. 8A is corrected to obtain an image. As shown in fig. 8B, the positions of the feature points of the first 3 rows are corrected to the positions of the true value coordinates.
For example, if distortion generated by a mobile phone is corrected, a photographed image of an actual scene acquired by the mobile phone is as shown in fig. 9A, where the area 90 shown in fig. 9A is an area where distortion is generated. It will be appreciated that the image shown in fig. 9A is distorted. For the image distortion correction shown in fig. 9A, an image shown in fig. 9B is generated, and a region 91 shown in fig. 9B is a distortion-corrected region. Among them, the image shown in fig. 9B is more realistic, and more closely resembles the shape of a real building.
An embodiment of the present invention further provides an electronic device, which corresponds to the mobile phone in the foregoing embodiment, as shown in fig. 10, the mobile phone may include: the device comprises an acquisition module 101, a calibration module 102 and a calculation module 103.
The obtaining module 101 is configured to obtain an image to be corrected, and divide the image to be corrected into M regions.
The calibration module 102 may be configured to perform distortion correction on each pixel point in each region respectively according to the calibration result of each region, and the coordinates of each feature point in each region and the coordinates of each pixel point in each region, so as to generate a corrected image.
The calculating module 103 may be configured to calculate, according to the coordinates of the feature points in the N images, true coordinates of a plurality of feature points on the preset calibration board. The true coordinates of a plurality of feature points on the preset calibration board may be: when the preset calibration plate and the imaging plane of the optical imaging module form a first preset angle, the undistorted coordinates of the plurality of characteristic points on the calibration plate are preset.
In the embodiment of the present application, the electronic device may be divided into the functional modules according to the method example, for example, each functional module may be divided corresponding to each function, or two or more functions may be integrated into one processing module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. It should be noted that the division of the modules in the embodiments of the present application is illustrative, and is only one logical function division, and in actual implementation, there may be another division manner.
The embodiment of the present application further provides a chip system, as shown in fig. 11, the chip system includes at least one processor 1001 and at least one interface circuit 1002. The processor 1001 and the interface circuit 1002 may be interconnected by wires. For example, the interface circuit 1002 may be used to receive signals from other devices (e.g., a memory of an electronic device). Also for example, the interface circuit 1002 may be used to send signals to other devices, such as the processor 1001. Illustratively, the interface circuit 1002 may read instructions stored in the memory and send the instructions to the processor 1001. The instructions, when executed by the processor 1001, may cause the electronic device to perform the various steps in the embodiments described above. Of course, the chip system may also include other discrete devices, which is not specifically limited in this embodiment.
The embodiment of the present application further provides a computer storage medium, where the computer storage medium includes computer instructions, and when the computer instructions are run on the electronic device, the electronic device is enabled to execute each function or step executed by the mobile phone in the foregoing method embodiment.
The embodiment of the present application further provides a computer program product, which when running on a computer, causes the computer to execute each function or step executed by the mobile phone in the above method embodiments.
It is clear to those skilled in the art from the foregoing description of the embodiments that, for convenience and simplicity of description, the above-mentioned division of the functional modules is merely used as an example, and in practical applications, the above-mentioned function distribution can be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the above-mentioned functions.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described device embodiments are merely illustrative, and for example, the division of the modules or units is only one logical functional division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another device, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may be one physical unit or a plurality of physical units, that is, may be located in one place, or may be distributed in a plurality of different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially or partially contributed to by the prior art, or all or part of the technical solutions may be embodied in the form of a software product, where the software product is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, or the like) or a processor (processor) to execute all or part of the steps of the methods described in the embodiments of the present application. The storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above description is only an embodiment of the present application, but the scope of the present application is not limited thereto, and any changes or substitutions within the technical scope of the present disclosure should be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (14)

1. The calibration method of the optical imaging module is characterized by being applied to electronic equipment, wherein the optical imaging module of the electronic equipment comprises an optical free-form surface, and the method comprises the following steps:
the electronic equipment acquires N images of a preset calibration plate, wherein each image in the N images comprises a plurality of feature points on the preset calibration plate, and N is a positive integer greater than 2; the N images are acquired by sequentially forming N angles between the preset calibration plate and an imaging surface of the optical imaging module, wherein the N angles comprise a first preset angle;
the electronic equipment calculates true value coordinates of a plurality of characteristic points on the preset calibration board according to the coordinates of the characteristic points of the N images; the truth coordinates of a plurality of characteristic points on the preset calibration board are as follows: when the preset calibration plate and the imaging surface of the optical imaging module form the first preset angle, the undistorted coordinates of the plurality of characteristic points on the preset calibration plate are obtained;
the electronic equipment divides a first image corresponding to the first preset angle in the N images into M areas, wherein each area in the M areas comprises at least one characteristic point, and M is a positive integer;
the electronic equipment respectively performs fitting calculation on the coordinates of the characteristic points of each of the M areas by adopting the true value coordinates of the characteristic points to obtain a calibration result of each area; and the calibration result of each region comprises the offset of the coordinate of each feature point in the corresponding region relative to the corresponding true value coordinate.
2. The method of claim 1, further comprising:
the electronic device performs the following operations for each of the regions: the electronic equipment generates a fitting curved surface of one region according to a calibration result of the region; calculating the fitting error of the fitted surface of the region according to the true value coordinates of the plurality of feature points of the region; and if the fitting error is smaller than a preset threshold value, storing the calibration result of the area.
3. The method according to claim 1 or 2, before the electronic device calculates the true coordinates of the plurality of feature points on the preset calibration board according to the coordinates of the feature points of the N images, the method further comprising:
the electronic equipment acquires N angles corresponding to the N images, and N distance values between the electronic equipment and the preset calibration board when the electronic equipment acquires the N images, wherein the first image corresponds to a first preset angle and a first distance value;
and the electronic equipment calculates to obtain the angle corresponding to the true value coordinate as a first preset angle according to the coordinates of the feature points of the N images, and calculates to obtain the distance value corresponding to the true value coordinate as a first distance value.
4. A distortion correction method is applied to an electronic device, an optical imaging module of the electronic device comprises an optical free-form surface, and the method comprises the following steps:
the electronic equipment acquires an image to be corrected and divides the image to be corrected into M areas; the calibration result of each region in the M regions is pre-stored in the electronic device, and the calibration result of each region comprises an offset of a coordinate of each feature point in a corresponding region relative to a corresponding true value coordinate;
and the electronic equipment respectively performs distortion correction on each pixel point in each region according to the calibration result of each region, the coordinates of each characteristic point in each region and the coordinates of each pixel point in each region, and generates a corrected image.
5. The method according to claim 4, wherein the electronic device performs distortion correction on each pixel point in each region according to the calibration result of each region, and the coordinates of each feature point in each region and the coordinates of each pixel point in each region, to generate a corrected image, and includes:
the electronic equipment generates a distortion lookup table of pixels according to the calibration result of each region, the coordinates of each feature point in each region and the coordinates of each pixel point in each region; the distortion lookup table comprises offsets corresponding to the coordinates of a plurality of pixel points;
and the electronic equipment respectively performs distortion correction on each pixel point in each region according to the distortion lookup table and the coordinates of each pixel point in each region to generate the corrected image.
6. The method according to claim 4 or 5, wherein said performing distortion correction on each pixel point in each region to generate the corrected image comprises:
and the electronic equipment performs distortion correction on each pixel point in each region by adopting an interpolation method to generate the corrected image.
7. The method according to any one of claims 4-6, wherein before the electronic device acquires an image to be corrected and divides the image to be corrected into M regions, the method further comprises:
the electronic equipment acquires a shot image;
and the electronic equipment preprocesses the shot image to obtain the image to be corrected, wherein the preprocessing at least comprises noise reduction processing or deblurring processing.
8. The method according to any one of claims 4-7, wherein before the electronic device acquires an image to be corrected and divides the image to be corrected into M regions, the method further comprises:
the electronic equipment acquires N images of a preset calibration plate, wherein each image in the N images comprises a plurality of feature points on the preset calibration plate, and N is a positive integer greater than 2; the N images are acquired by sequentially forming N angles between the preset calibration plate and an imaging surface of the optical imaging module, wherein the N angles comprise a first preset angle;
the electronic equipment calculates true value coordinates of a plurality of characteristic points on the preset calibration board according to the coordinates of the characteristic points of the N images; the truth coordinates of a plurality of characteristic points on the preset calibration board are as follows: when the preset calibration plate and the imaging surface of the optical imaging module form the first preset angle, the undistorted coordinates of the plurality of characteristic points on the preset calibration plate are obtained;
the electronic equipment divides a first image corresponding to the first preset angle in the N images into the M areas, wherein each area in the M areas comprises at least one characteristic point;
and the electronic equipment adopts the true value coordinates of the characteristic points to respectively perform fitting calculation on the coordinates of the characteristic points of each of the M areas to obtain the calibration result of each area.
9. The method of claim 8, further comprising:
the electronic device performs the following operations for each of the regions: the electronic equipment generates a fitting curved surface of one region according to a calibration result of the region; calculating the fitting error of the fitted surface of the region according to the true value coordinates of the plurality of feature points of the region; and if the fitting error is smaller than a preset threshold value, storing the calibration result of the area.
10. The method according to claim 8 or 9, before the electronic device calculates the true coordinates of the plurality of feature points on the preset calibration board according to the coordinates of the feature points of the N images, the method further comprising:
the electronic equipment acquires N angles corresponding to the N images, and N distance values between the electronic equipment and the preset calibration board when the electronic equipment acquires the N images, wherein the first image corresponds to a first preset angle and a first distance value;
and the electronic equipment calculates to obtain the angle corresponding to the true value coordinate as a first preset angle according to the coordinates of the feature points of the N images, and calculates to obtain the distance value corresponding to the true value coordinate as a first distance value.
11. An electronic device, characterized in that the electronic device comprises: a memory, a display device, and one or more processors; the memory, the display device and the processor are coupled;
wherein the memory is for storing computer program code comprising computer instructions which, when executed by the processor, cause the electronic device to perform the method of any of claims 1-10.
12. A chip system, wherein the chip system is applied to an electronic device including a memory; the chip system includes one or more interface circuits and one or more processors; the interface circuit and the processor are interconnected through a line; the interface circuit to receive signals from the memory and to send the signals to the processor, the signals including computer instructions stored in the memory; the electronic device performs the method of any of claims 1-10 when the processor executes the computer instructions.
13. A computer-readable storage medium comprising computer instructions that, when executed on a control device, cause the control device to perform the method of any one of claims 1-10.
14. A computer program product, characterized in that, when the computer program product is run on a computer, it causes the computer to perform the method according to any of claims 1-10.
CN202010815081.6A 2020-08-13 2020-08-13 Calibration method of optical imaging module, distortion correction method and related equipment Pending CN114078165A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010815081.6A CN114078165A (en) 2020-08-13 2020-08-13 Calibration method of optical imaging module, distortion correction method and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010815081.6A CN114078165A (en) 2020-08-13 2020-08-13 Calibration method of optical imaging module, distortion correction method and related equipment

Publications (1)

Publication Number Publication Date
CN114078165A true CN114078165A (en) 2022-02-22

Family

ID=80280497

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010815081.6A Pending CN114078165A (en) 2020-08-13 2020-08-13 Calibration method of optical imaging module, distortion correction method and related equipment

Country Status (1)

Country Link
CN (1) CN114078165A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114460743A (en) * 2022-03-25 2022-05-10 泽景(西安)汽车电子有限责任公司 Imaging effect analysis method, device, equipment and medium of image display equipment
CN114792327A (en) * 2022-06-23 2022-07-26 中国科学院空天信息创新研究院 Image processing method and system
CN115908201A (en) * 2023-01-09 2023-04-04 武汉凡德智能科技有限公司 Hot area quick correction method and device for image distortion

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114460743A (en) * 2022-03-25 2022-05-10 泽景(西安)汽车电子有限责任公司 Imaging effect analysis method, device, equipment and medium of image display equipment
CN114460743B (en) * 2022-03-25 2023-04-07 泽景(西安)汽车电子有限责任公司 Imaging effect analysis method, device, equipment and medium of image display equipment
CN114792327A (en) * 2022-06-23 2022-07-26 中国科学院空天信息创新研究院 Image processing method and system
CN114792327B (en) * 2022-06-23 2022-11-04 中国科学院空天信息创新研究院 Image processing method and system
CN115908201A (en) * 2023-01-09 2023-04-04 武汉凡德智能科技有限公司 Hot area quick correction method and device for image distortion
CN115908201B (en) * 2023-01-09 2023-11-28 武汉凡德智能科技有限公司 Method and device for quickly correcting hot zone of image distortion

Similar Documents

Publication Publication Date Title
WO2021115071A1 (en) Three-dimensional reconstruction method and apparatus for monocular endoscope image, and terminal device
CN114078165A (en) Calibration method of optical imaging module, distortion correction method and related equipment
US10726580B2 (en) Method and device for calibration
KR101900873B1 (en) Method, device and system for acquiring antenna engineering parameters
CN109672871B (en) White balance information synchronization method, white balance information synchronization device and computer readable medium
US10645364B2 (en) Dynamic calibration of multi-camera systems using multiple multi-view image frames
WO2022095596A1 (en) Image alignment method, image alignment apparatus and terminal device
CN111080687A (en) Method and apparatus for active depth sensing and calibration method thereof
US10965871B2 (en) Apparatus and method for compensating for image change caused by optical image stabilization motion
CN110099220B (en) Panoramic stitching method and device
US20210407132A1 (en) Fisheye camera calibration system, method and electronic device
CN112470192A (en) Dual-camera calibration method, electronic device and computer-readable storage medium
CN111383264B (en) Positioning method, positioning device, terminal and computer storage medium
CN115375827B (en) Illumination estimation method and electronic equipment
CN112927306A (en) Calibration method and device of shooting device and terminal equipment
KR100513789B1 (en) Method of Lens Distortion Correction and Orthoimage Reconstruction In Digital Camera and A Digital Camera Using Thereof
CN111383254A (en) Depth information acquisition method and system and terminal equipment
CN111385461B (en) Panoramic shooting method and device, camera and mobile terminal
CN113362445B (en) Method and device for reconstructing object based on point cloud data
TWI705292B (en) Method of determining assembly quality of camera module
CN114731372A (en) Electronic device and method for correcting image during camera switching
CN110838147B (en) Camera module detection method and device
CN112116530B (en) Fisheye image distortion correction method, device and virtual display system
CN112200842B (en) Image registration method, device, terminal equipment and storage medium
CN111353945A (en) Fisheye image correction method, fisheye image correction device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination