Lens calibration or shooting method, device, chip, terminal and storage medium
By adjusting the distance between the lens and the image sensor, obtaining the Hall value and field of view angle, fitting the image cropping range, and using picture cropping to eliminate the breathing effect of the portable photography equipment, solving the problem of change in the field of view angle of the lens, achieving consistency and cost reduction in the image range.
Patent Information
- Application Number
- CN202111148297.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-28
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2041-09-28
AI Technical Summary
During the focusing process, the viewing angle changes due to the radial movement of the lens, resulting in a breathing effect, which is more obvious, especially when the sensor size and the lens aperture increase, and it is difficult to effectively eliminate the prior art.
By adjusting the distance between the lens and the image sensor, obtaining the Hall value and field of view angle, fitting the image cropping range, and eliminating the breathing effect through picture cropping without hardware adjustment.
Keeping the image range consistent at any field of view eliminates the respiration effect of the lens and reduces costs.
Smart Images

Figure CN113870360B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technologies, and in particular, to a lens calibration or shooting method, device, chip, terminal, and storage medium. Background Art
[0002] The breathing effect, that is, the change in the field of view angle during the focusing process. In a camera, a lens generally consists of multiple lenses in multiple groups. During the focusing process, it is necessary to change the focus so that the formed image falls on the image sensor. To change the focus, the lens group in the lens needs to be moved. During the movement of the lens group, the focal length will also change to a certain extent, resulting in a change in the field of view angle of the final image. During the repeated focusing process, the picture will look like it is getting closer and farther away, which has a particularly serious impact on video shooting. Mobile phones and some other portable photography devices are limited by their volume, and the lens cannot be made very complex. By using the method of moving the entire lens for focusing, the field of view angle will inevitably change with the radial movement of the lens, and the breathing effect cannot be eliminated. As the sensor size and lens aperture continue to increase, the focusing stroke is also increasing, and the breathing effect will become more obvious. Summary of the Invention
[0003] The lens calibration or shooting method, device, chip, terminal, and storage medium provided by the present invention can eliminate the breathing effect of the lens by cropping the picture, without the need for additional adjustment of the hardware, reducing the cost.
[0004] In a first aspect, the present invention provides a lens calibration method, including:
[0005] Adjusting the first distance between the lens and the image sensor successively according to a predetermined step;
[0006] After each adjustment of the first distance, obtaining the Hall value and the field of view angle corresponding to the current first distance;
[0007] Obtaining the image ranges corresponding to multiple field of view angles;
[0008] According to the image range corresponding to the minimum field of view angle, obtaining the image cropping ranges at other field of view angles;
[0009] Fitting multiple Hall values with the image cropping ranges at the corresponding multiple field of view angles to obtain the image cropping ranges corresponding to continuous Hall values.
[0010] Optionally, fitting multiple Hall values with the image cropping ranges at the corresponding multiple field of view angles includes:
[0011] Fitting multiple Hall values with the corresponding multiple field of view angles to form a first fitting relationship between the Hall value and the field of view angle;
[0012] Fitting multiple field of view angles with corresponding multiple image cropping ranges to form a second fitting relationship between the field of view angle and the image cropping range;
[0013] According to the first fitting relationship and the second fitting relationship, obtain the image cropping range corresponding to consecutive Hall values.
[0014] Optionally, after each adjustment of the first distance, obtaining the Hall value and the field of view angle corresponding to the current first distance includes:
[0015] After each adjustment of the first distance, wait for the Hall value to stabilize and read the Hall value;
[0016] Take a calibration plate at a predetermined distance in front of the image sensor;
[0017] According to the range of the calibration plate in the image and the predetermined distance, determine the field of view angle.
[0018] Optionally, waiting for the Hall value to stabilize includes:
[0019] Read the Hall value of the Hall sensor multiple times. When the difference between adjacent Hall values is less than a predetermined threshold, determine that the Hall value is stable.
[0020] Optionally, before adjusting the first distance between the lens and the image sensor in sequence according to a predetermined step, further include:
[0021] Fix the image sensor and the calibration plate, and the distance between the image sensor and the calibration plate is the predetermined distance, so that the calibration plate photographed by the lens at the maximum field of view angle fills the entire picture.
[0022] In a second aspect, the present invention provides a lens shooting method, including:
[0023] Obtain the current frame image, the first size of the current frame image, and the corresponding current Hall value;
[0024] According to the current Hall value, determine the corresponding image cropping range;
[0025] According to the image cropping range, crop the current frame image to obtain a first cropped image;
[0026] Scale the first image to the first size to obtain a captured image.
[0027] Optionally, according to the current Hall value, determining the corresponding image cropping range includes:
[0028] According to the current Hall value, determine the field of view angle corresponding to the current picture;
[0029] According to the field of view angle, determine the cropping range of the current frame image relative to the image corresponding to the minimum field of view angle.
[0030] In a third aspect, the present invention provides a lens calibration device, comprising:
[0031] A distance adjustment module for sequentially adjusting a first distance between a lens and an image sensor according to a predetermined step;
[0032] A parameter acquisition module for acquiring a Hall value and a field of view angle corresponding to the current first distance each time the first distance is adjusted;
[0033] A range acquisition module for acquiring an image range corresponding to a plurality of fields of view angles;
[0034] A cropping determination module for acquiring an image cropping range at other fields of view angles according to the image range corresponding to the minimum field of view angle;
[0035] A cropping fitting module for fitting a plurality of Hall values with the image cropping ranges at corresponding plurality of fields of view angles to obtain an image cropping range corresponding to continuous Hall values.
[0036] Optionally, the cropping fitting module includes:
[0037] A first fitting unit for fitting a plurality of Hall values with corresponding plurality of fields of view angles to form a first fitting relationship between the Hall value and the field of view angle;
[0038] A second fitting unit for fitting a plurality of fields of view angles with corresponding plurality of image cropping ranges to form a second fitting relationship between the field of view angle and the image cropping range;
[0039] A cropping fitting unit for obtaining an image cropping range corresponding to continuous Hall values according to the first fitting relationship and the second fitting relationship.
[0040] Optionally, the parameter acquisition module includes:
[0041] A Hall value unit for waiting for the Hall value to be stable and reading the Hall value each time the first distance is adjusted;
[0042] A shooting unit for shooting a calibration plate at a predetermined distance in front of the image sensor;
[0043] A field of view angle unit for determining the field of view angle according to the range of the calibration plate in the image and the predetermined distance.
[0044] Optionally, the Hall value unit includes:
[0045] A stabilization subunit for reading the Hall values of the Hall sensor multiple times and determining that the Hall value is stable when the difference between adjacent Hall values is less than a predetermined threshold.
[0046] Optionally, it further includes:
[0047] A spacing fixing module is used to fixedly arrange an image sensor and the calibration board, and the distance between the image sensor and the calibration board is the predetermined distance, so that the calibration board photographed by the lens at the maximum field of view angle fills the entire picture.
[0048] In a fourth aspect, the present invention provides a lens photographing device, including:
[0049] A parameter reading module is used to obtain the current frame image, the first size of the current frame image, and the corresponding current Hall value;
[0050] A cropping range module is used to determine the corresponding image cropping range according to the current Hall value;
[0051] An image cropping module is used to crop the current frame image according to the image cropping range to obtain a first cropped image;
[0052] An image scaling module is used to scale the first image to the first size to obtain a photographed image.
[0053] Optionally, the cropping range module includes:
[0054] A corresponding unit is used to determine the field of view angle corresponding to the current picture according to the current Hall value;
[0055] A cropping unit is used to determine the cropping range of the current frame image relative to the image corresponding to the minimum field of view angle according to the field of view angle.
[0056] In a fifth aspect, the present invention provides a chip, the chip is located in a terminal, and the chip includes:
[0057] At least one processor; and
[0058] A memory communicatively connected to the at least one processor; wherein,
[0059] The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can execute the lens calibration method described in any one of the above, or the at least one processor can execute the lens photographing method described in any one of the above.
[0060] In a sixth aspect, the present invention provides a chip module, and the chip module includes the above-mentioned chip.
[0061] In a seventh aspect, the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and when the computer instructions are executed by a processor, the lens calibration method described in any one of the above is implemented, or the lens shooting method described in any one of the above is executed.
[0062] In an eighth aspect, the present invention provides a terminal, the terminal comprising:
[0063] at least one processor; and
[0064] a memory communicatively connected to the at least one processor; wherein,
[0065] the memory stores instructions executable by the at least one processor, and when the instructions are executed by the at least one processor, the at least one processor is enabled to execute the lens calibration method described in any one of the above, or the at least one processor is enabled to execute the lens shooting method described in any one of the above.
[0066] In the embodiment provided by the present invention, by obtaining the image range at the minimum field of view angle, the minimum image range that the lens can capture is obtained. Since at other field of view angles, the image range is necessarily larger than the image range at the minimum field of view angle, therefore, by cropping the images at other field of view angles, the image range at the minimum field of view angle can be obtained, and then by scaling the cropped images, it is ensured that the images captured at any field of view angle are the same as the image range captured at the minimum field of view angle. Since the image range remains consistent during the shooting process, the change of the image range is avoided, and the breathing effect of the lens is eliminated. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] Figure 1 is a flowchart of a lens calibration method according to an embodiment of the present invention;
[0068] Figure 2 is a flowchart of obtaining a fitting relationship in another embodiment of the lens calibration method of the present invention;
[0069] Figure 3 is a flowchart of obtaining Hall values and field of view angles in another embodiment of the lens calibration method of the present invention;
[0070] Figure 4 is a flowchart of a lens shooting method according to another embodiment of the present invention;
[0071] Figure 5 is a flowchart of obtaining a cropping range in another embodiment of the lens shooting method of the present invention;
[0072] Figure 6 is a schematic diagram of a lens calibration device according to an embodiment of the present invention;
[0073] Figure 7 Schematic diagram of the cropping fitting module in the lens calibration device according to another embodiment of the present invention;
[0074] Figure 8 Schematic diagram of the parameter acquisition module in the lens calibration device according to another embodiment of the present invention;
[0075] Figure 9 Schematic diagram of the lens shooting device according to another embodiment of the present invention;
[0076] Figure 10 Schematic diagram of the cropping range module in the lens shooting device according to another embodiment of the present invention;
[0077] Figure 11 Schematic diagram of the principle for determining the cropping range of the lens calibration method according to an embodiment of the present invention. Detailed implementation manners
[0078] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0079] The embodiments of the present invention provide a lens calibration method, as Figure 1 shown, including:
[0080] Step 110: Adjust the first distance between the lens and the image sensor successively according to a predetermined step size;
[0081] In some embodiments, the predetermined step size is set according to the stroke of the lens. For example, the predetermined step size can be set as a fraction of the stroke of the lens. During the process of adjusting the first distance, for example, the closest distance between the lens and the image sensor can be used as the starting point, and the position of the lens can be adjusted successively in the direction away from the image sensor according to the predetermined step size; or for another example, the farthest distance between the lens and the image sensor can be used as the starting point, and the position of the lens can be adjusted successively in the direction close to the image sensor according to the predetermined step size.
[0082] Step 120: After adjusting the first distance each time, obtain the Hall value and the field of view angle corresponding to the current first distance;
[0083] In some embodiments, since the lens is usually driven by a closed-loop motor, and the Hall value output by the Hall sensor of the closed-loop motor, the Hall sensor is a sensor disposed in the closed-loop motor for obtaining the magnetic flux of the magnetic device on the lens to determine the position of the lens. When the closed-loop motor drives the lens to move, due to the relative position change between the magnetic device and the Hall sensor, the magnetic flux changes, that is, the Hall value output by the Hall sensor of the closed-loop motor corresponds one-to-one with the position of the lens. When obtaining the field of view angle at the first distance, the same object plane can be photographed by the lens, and the field of view angle can be determined by the included angle formed between the edge of the object plane range in the photographed image and the optical axis of the lens.
[0084] Step 130, obtaining image ranges corresponding to multiple field of view angles;
[0085] In some embodiments, since the field of view angle of the lens is different at different first distances, and thus the photographed image range is also different. Therefore, during the process of adjusting the first distance, the photographed image range is recorded simultaneously to determine the image ranges corresponding to multiple field of view angles.
[0086] Step 140, obtaining the image cropping ranges at other field of view angles according to the image range corresponding to the minimum field of view angle;
[0087] In some embodiments, at the minimum field of view angle, the photographed image range is the smallest, and at other field of view angles, the image range is larger. In order to eliminate the breathing effect of the lens, it is necessary to crop the larger image range so that the image ranges at other field of view angles are the same as the image range at the minimum field of view angle. Therefore, in this embodiment, first, the image cropping ranges at other field of view angles are obtained according to the image range corresponding to the minimum long time.
[0088] Step 150, fitting multiple Hall values with the image cropping ranges at corresponding multiple field of view angles to obtain the image cropping ranges corresponding to continuous Hall values.
[0089] In some embodiments, since multiple image cropping ranges and multiple Hall values are obtained as described above, and their corresponding relationships are known. However, in the actual photographing process, the limited numerical pairs of Hall values and image cropping ranges cannot meet the image photographing requirements at any Hall value. Therefore, the Hall values and image cropping ranges are fitted to form a continuous curve to obtain the image cropping ranges corresponding to continuous Hall values.
[0090] In this embodiment, by obtaining the image range at the minimum field of view angle, the smallest image range that the lens can capture is obtained. Since the image range at other field of view angles is necessarily larger than the image range at the minimum field of view angle, the image range at the minimum field of view angle can be obtained by cropping the images at other field of view angles, and then by scaling the cropped images, it is ensured that the images captured at any field of view angle are the same as the image range captured at the minimum field of view angle. Since the image range remains consistent during the shooting process, the change of the image range is avoided, and the breathing effect of the lens is eliminated.
[0091] As an alternative embodiment, as Figure 2 shown, in step 150, fitting the multiple Hall values with the image cropping ranges at the corresponding multiple field of view angles includes:
[0092] Step 151, fitting the multiple Hall values with the corresponding multiple field of view angles to form a first fitting relationship between the Hall values and the field of view angles;
[0093] In some embodiments, since the Hall values are directly related to the field of view angles, first, the multiple Hall values are fitted with the multiple field of view angles to form a first fitting relationship between the continuous Hall values and the continuous field of view angles.
[0094] Step 152, fitting the multiple field of view angles with the corresponding multiple image cropping ranges to form a second fitting relationship between the field of view angles and the image cropping ranges;
[0095] In some embodiments, since the field of view angles are directly related to the image cropping ranges, the multiple field of view angles are fitted with the image cropping ranges to form a second fitting relationship between the continuous field of view angles and the continuous cropping ranges.
[0096] Step 153, obtaining the image cropping ranges corresponding to the continuous Hall values according to the first fitting relationship and the second fitting relationship.
[0097] In some embodiments, taking the field of view angle as an intermediate variable, substituting the first fitting relationship into the second fitting relationship to form a relationship between the continuous Hall values and the continuous image cropping ranges.
[0098] In this embodiment, by taking the field of view angle as an intermediate variable, a continuous mapping relationship is formed between the Hall values and the image cropping ranges, and the image cropping ranges corresponding to any Hall values are obtained. Thus, during the subsequent shooting process, the image cropping ranges corresponding to any Hall values can be obtained.
[0099] As an alternative embodiment, as Figure 3 shown, in step 120, after each adjustment of the first distance, obtaining the Hall value and the field of view angle corresponding to the current first distance includes:
[0100] Step 121, after adjusting the first distance each time, wait for the Hall value to stabilize and read the Hall value;
[0101] In some embodiments, since the Hall value is not immediately stable after the closed-loop motor adjusts the lens, it is necessary to wait for the Hall value to stabilize before reading the Hall value, so as to accurately obtain the position of the lens.
[0102] Step 122, photograph a calibration board at a predetermined distance in front of the image sensor;
[0103] In some embodiments, the calibration board of the image can display the range of the image. When taking a picture, place the calibration board at a certain distance in front of the image sensor and photograph the calibration board through the lens. The range of the calibration board shown in the image is the current image range.
[0104] Step 123, determine the field of view angle according to the range of the calibration board in the image and the predetermined distance.
[0105] In some embodiments, the range of the calibration board in the image can show the edge of the shooting range that the lens can cover. Through the relative two edges of this range and the position of the lens, a triangle can be determined, and the angle corresponding to the lens position of this triangle is the field of view angle.
[0106] In this embodiment, by reading a stable Hall value, the relationship between the first distance and the Hall value can be accurately obtained. By using the calibration board to obtain a standard image range, and through the image range and the lens position, a triangle can be determined. According to the angle corresponding to the lens position of this triangle, the field of view angle can be determined. By accurately obtaining the Hall value and the field of view angle, it provides a premise for the subsequent calculation process and avoids large errors in the subsequent calculation results.
[0107] As an alternative embodiment, in step 121, waiting for the Hall value to stabilize includes:
[0108] Read the Hall value of the Hall sensor multiple times. When the difference between adjacent several Hall values is less than a predetermined threshold, it is determined that the Hall value is stable. In some embodiments, by reading the Hall value of the Hall sensor multiple times and comparing the consecutive Hall values, when the difference between adjacent several Hall values is less than a predetermined threshold, it can be determined that the Hall value has stabilized. For example, when the difference between two adjacent Hall values is lower than 1% of the previously read Hall value, it can be determined that the Hall value has stabilized.
[0109] As an alternative embodiment, in step 110, before adjusting the first distance between the lens and the image sensor successively according to a predetermined step size, it further includes:
[0110] Fix the image sensor and the calibration board, and set the distance between the image sensor and the calibration board to the predetermined distance, so that the calibration board photographed by the lens at the maximum field of view angle fills the entire screen. In some embodiments, since the range of the calibration board needs to be used to determine the subsequent cropping range, it is necessary that the calibration board fills the image at any field of view angle. Therefore, in this embodiment, when setting the predetermined distance, it is based on the fact that the calibration board photographed by the lens at the maximum field of view angle can still fill the entire screen.
[0111] The image cropping principle in each embodiment of the present invention is as Figure 11 shown. First, find the minimum field of view angle Amin of the lens. At the minimum field of view angle, obtain an image, and the principle of obtaining the image is as Figure 11 shown by the imaging optical path on the left. As the lens moves, the field of view angle An of the lens is greater than the minimum field of view angle Amin. At this time, the photographed range in the image is larger, that is, the proportion of the same target object in the image is smaller. The principle of obtaining the image is as Figure 11 shown by the imaging optical path in the middle. At this time, in order to eliminate the breathing effect, crop the images at other field of view angles, as Figure 11 shown on the right in the figure. First, determine the target object in the image photographed at the minimum field of view angle; obtain the area where the corresponding target object is located in the images photographed at other field of view angles, and crop this area, so that the images output at other field of view angles have exactly the same target object as the images output at the minimum field of view angle, that is, have the same photographed range.
[0112] The embodiment of the present invention also provides a lens photographing method, as Figure 4 shown, including:
[0113] Step 210, obtain the current frame image, the first size of the current frame image, and the corresponding current Hall value;
[0114] In some embodiments, the current frame image refers to the image currently photographed by the lens. The first size is usually determined by the image sensor, and the number of rows and columns of the image sensor determines the size of the image. The current Hall value is obtained by reading the Hall sensor in the closed-loop motor.
[0115] Step 220, determine the corresponding image cropping range according to the current Hall value;
[0116] In some embodiments, before shooting, the mapping relationship between the Hall value and the image cropping range is obtained in advance. For example, the lens calibration method in the foregoing embodiment can be used to obtain the mapping relationship between the Hall value and the image cropping range. In this embodiment, according to the pre-determined corresponding relationship between the Hall value and the image cropping range, the range where the current image should be cropped can be obtained.
[0117] Step 230: Crop the current frame image according to the image cropping range to obtain a first cropped image.
[0118] In some embodiments, according to the image cropping range, the edges of the current frame image are cropped to remove the shooting range outside the minimum field of view angle, so as to obtain the first image captured at the minimum field of view angle.
[0119] Step 240: Scale the first image to a first size to obtain a captured image.
[0120] In some embodiments, since the image size will become smaller after cropping the image, in order to ensure the consistency of the image size, in this embodiment, the first image is scaled so that the image reaches the first size before output.
[0121] In this embodiment, by obtaining the image range at the minimum field of view angle, the smallest image range that the lens can capture is obtained. Since at other field of view angles, the image range is necessarily larger than the image range at the minimum field of view angle, therefore, the image range at the minimum field of view angle can be obtained by cropping the images at other field of view angles, and then by scaling the cropped images, it is ensured that the images captured at any field of view angle are the same as the image range captured at the minimum field of view angle. Since the image range remains consistent during the shooting process, the change of the image range is avoided, and the breathing effect of the lens is eliminated.
[0122] As an alternative embodiment, as Figure 5 shown, in step 230, determining the corresponding image cropping range according to the current Hall value includes:
[0123] Step 231: Determine the field of view angle corresponding to the current frame according to the current Hall value.
[0124] In some embodiments, since there is a direct relationship between the Hall value and the field of view angle, therefore, in this embodiment, by using the Hall value to determine the field of view angle corresponding to the current frame, the mapping relationship can be obtained more directly and accurately.
[0125] Step 232: Determine the cropping range of the current frame image relative to the image corresponding to the minimum field of view angle according to the field of view angle.
[0126] In some embodiments, since there is a direct relationship between the field of view angle and the cropping range, therefore, in this embodiment, by using the field of view angle to determine the cropping range of the current frame image, the mapping relationship can be obtained more directly and accurately.
[0127] In this embodiment, since the field of view angle is directly related to both the Hall value and the cropping range, the mapping between the Hall value and the cropping range is achieved through the transmission of the field of view angle with the field of view angle as the intermediate quantity, thereby providing a basis for subsequent image cropping.
[0128] The embodiment of the present invention also provides a lens calibration device, as Figure 6 shown, including:
[0129] A distance adjustment module for sequentially adjusting the first distance between the lens and the image sensor according to a predetermined step.
[0130] In some embodiments, the predetermined step is set according to the stroke of the lens. For example, the predetermined step can be set to a fraction of the stroke of the lens. During the process of adjusting the first distance, for example, the closest distance between the lens and the image sensor can be used as the starting point, and the position of the lens can be adjusted successively away from the image sensor according to the predetermined step; or for another example, the farthest distance between the lens and the image sensor can be used as the starting point, and the position of the lens can be adjusted successively towards the image sensor according to the predetermined step.
[0131] A parameter acquisition module for acquiring the Hall value and the field of view angle corresponding to the current first distance after each adjustment of the first distance.
[0132] In some embodiments, since the lens is usually driven by a closed-loop motor, and the Hall value output by the Hall sensor of the closed-loop motor, the Hall sensor is a sensor arranged in the closed-loop motor for acquiring the magnetic flux of the magnetic device on the lens to determine the position of the lens. When the closed-loop motor drives the lens to move, due to the relative position change between the magnetic device and the Hall sensor, the magnetic flux changes, that is, the Hall value output by the Hall sensor of the closed-loop motor is in one-to-one correspondence with the position of the lens. When acquiring the field of view angle of the first distance, the lens can be used to photograph the same object plane, and the field of view angle can be determined by the included angle formed between the edge of the object plane range in the photographed image and the optical axis of the lens.
[0133] A range acquisition module for acquiring the image ranges corresponding to multiple field of view angles.
[0134] In some embodiments, since the field of view angle of the lens is different at different first distances, and thus the photographed image range is also different, during the process of adjusting the first distance, the photographed image range is recorded simultaneously to determine the image ranges corresponding to multiple field of view angles.
[0135] A cropping determination module for acquiring the image cropping ranges at other field of view angles according to the image range corresponding to the minimum field of view angle.
[0136] In some embodiments, at the minimum field of view angle, the image range captured by the image is the smallest, and at other field of view angles, the image range is larger. To eliminate the breathing effect of the lens, it is necessary to crop the larger image range so that the image ranges at other field of view angles are the same as the image range at the minimum field of view angle. Therefore, in this embodiment, first, according to the image range corresponding to the minimum long time, the image cropping ranges at other field of view angles are obtained.
[0137] A cropping fitting module for fitting multiple Hall values with the image cropping ranges at corresponding multiple field of view angles to obtain the image cropping ranges corresponding to continuous Hall values.
[0138] In some embodiments, since multiple image cropping ranges and multiple Hall values have been obtained above, and their corresponding relationships are known. However, during the actual shooting process, the limited numerical pairs of Hall values and image cropping ranges cannot meet the image shooting requirements at any Hall value. Therefore, the Hall values and image cropping ranges are fitted to form a continuous curve to obtain the image cropping ranges corresponding to continuous Hall values.
[0139] In this embodiment, by obtaining the image range at the minimum field of view angle, the smallest image range that the lens can capture is obtained. Since at other field of view angles, the image range is necessarily larger than the image range at the minimum field of view angle, the image at other field of view angles can be cropped to obtain the image range at the minimum field of view angle, and then the cropped image is scaled to ensure that the images captured at any field of view angle are the same as the image range captured at the minimum field of view angle. Since the image range remains consistent during the shooting process, the change in the image range is avoided, and the breathing effect of the lens is eliminated.
[0140] As an alternative embodiment, as Figure 7 shown, the cropping fitting module includes:
[0141] A first fitting unit for fitting multiple Hall values with corresponding multiple field of view angles to form a first fitting relationship between Hall values and field of view angles;
[0142] In some embodiments, since the Hall value is directly related to the field of view angle, first, multiple Hall values are fitted with multiple field of view angles to form a first fitting relationship between continuous Hall values and continuous field of view angles.
[0143] A second fitting unit for fitting multiple field of view angles with corresponding multiple image cropping ranges to form a second fitting relationship between field of view angles and image cropping ranges;
[0144] In some embodiments, since the field of view angle is directly related to the image cropping range, therefore, multiple field of view angles and the image cropping range are fitted to form a second fitting relationship between the continuous field of view angle and the continuous cropping range.
[0145] The cropping fitting unit is configured to obtain the image cropping range corresponding to the continuous Hall values according to the first fitting relationship and the second fitting relationship.
[0146] In some embodiments, taking the field of view angle as an intermediate variable, the first fitting relationship is brought into the second fitting relationship to form a relationship between the continuous Hall values and the continuous image cropping range.
[0147] In this embodiment, by taking the field of view angle as an intermediate variable, a continuous mapping relationship is formed between the Hall value and the image cropping range, and the image cropping range corresponding to any Hall value is obtained. Thus, during the subsequent shooting process, the image cropping range corresponding to any Hall value can be obtained.
[0148] As an alternative embodiment, as Figure 8 shown, the parameter acquisition module includes:
[0149] The Hall value unit is configured to wait for the Hall value to stabilize and read the Hall value after adjusting the first distance each time;
[0150] In some embodiments, since the Hall value is not immediately stable after the closed-loop motor adjusts the lens, it is necessary to wait for the Hall value to stabilize before reading the Hall value, so as to accurately obtain the position of the lens.
[0151] The shooting unit is configured to shoot a calibration board at a predetermined distance in front of the image sensor;
[0152] In some embodiments, the calibration board of the image can display the range of the image. During shooting, the calibration board is placed at a certain distance in front of the image sensor, and the calibration board is shot through the lens. The range of the calibration board shown in the image is the current image range.
[0153] The field of view angle unit is configured to determine the field of view angle according to the range of the calibration board in the image and the predetermined distance.
[0154] In some embodiments, the range of the calibration board in the image can display the edge of the range that the lens can shoot. Through the relative two side edges of this range and the position of the lens, a triangle can be determined, and the angle corresponding to the lens position in this triangle is the field of view angle.
[0155] In this embodiment, by reading a stable Hall value, the relationship between the first distance and the Hall value can be accurately obtained. A standard image range is obtained through a calibration plate. Based on the image range and the lens position, a triangle can be determined, and the field of view angle can be determined according to the angle corresponding to the lens position of the triangle. The accurate acquisition of the Hall value and the field of view angle provides a premise for subsequent calculation processes and avoids large errors in subsequent calculation results.
[0156] As an alternative embodiment, the Hall value unit includes:
[0157] A stabilizer unit for reading the Hall value of the Hall sensor multiple times. When the difference between several adjacent Hall values is less than a predetermined threshold, it is determined that the Hall value is stable. In some embodiments, by reading the Hall value of the Hall sensor multiple times and comparing consecutive Hall values, when the difference between several adjacent Hall values is less than a predetermined threshold, it can be determined that the Hall value has become stable. For example, when the difference between two adjacent Hall values is lower than 1% of the previously read Hall value, it can be determined that the Hall value has become stable.
[0158] As an alternative embodiment, it further includes: a spacing fixing module for fixedly arranging the image sensor and the calibration plate. The distance between the image sensor and the calibration plate is the predetermined distance, so that the calibration plate photographed by the lens at the maximum field of view angle fills the entire picture. In some embodiments, since the range of the calibration plate needs to be relied on in the subsequent determination process of the cropping range, it is necessary that the calibration plate fills the image at any field of view angle. Therefore, in this embodiment, when setting the predetermined distance, it is based on the fact that the calibration plate photographed by the lens at the maximum field of view angle can still fill the entire picture.
[0159] The embodiment of the present invention also provides a lens photographing device, as Figure 9 shown, including:
[0160] A parameter reading module for obtaining the current frame image, the first size of the current frame image, and the corresponding current Hall value;
[0161] In some embodiments, the current frame image refers to the image currently photographed by the lens. The first size is usually determined by the image sensor, and the number of rows and columns of the image sensor determines the size of the image. The current Hall value is obtained by reading the Hall sensor in the closed-loop motor.
[0162] A cropping range module for determining the corresponding image cropping range according to the current Hall value;
[0163] In some embodiments, before shooting, the mapping relationship between the Hall value and the image cropping range is obtained in advance. For example, the lens calibration method in the foregoing embodiments can be used to obtain the mapping relationship between the Hall value and the image cropping range. In this embodiment, according to the pre-determined correspondence between the Hall value and the image cropping range, the range where the current image should be cropped can be obtained.
[0164] An image cropping module, configured to crop the current frame image according to the image cropping range to obtain a first cropped image;
[0165] In some embodiments, according to the image cropping range, the edges of the current frame image are cropped to remove the shooting range outside the minimum field of view angle, thereby obtaining the first image captured at the minimum field of view angle.
[0166] An image scaling module, configured to scale the first image to a first size to obtain a captured image.
[0167] In some embodiments, since the image size becomes smaller after the image is cropped, in order to ensure the consistency of the image size, in this embodiment, the first image is scaled so that the image reaches the first size before being output.
[0168] In this embodiment, by obtaining the image range at the minimum field of view angle, the smallest image range that the lens can capture is obtained. Since the image range at other field of view angles is necessarily larger than the image range at the minimum field of view angle, the image range at the minimum field of view angle can be obtained by cropping the images at other field of view angles, and then by scaling the cropped images, it is ensured that the images captured at any field of view angle are the same as the image range captured at the minimum field of view angle. Since the image range remains consistent during the shooting process, the change of the image range is avoided, and the breathing effect of the lens is eliminated.
[0169] As an alternative embodiment, as Figure 10 shown, the cropping range module includes:
[0170] A corresponding unit, configured to determine the field of view angle corresponding to the current frame according to the current Hall value;
[0171] In some embodiments, since there is a direct relationship between the Hall value and the field of view angle, in this embodiment, by determining the field of view angle corresponding to the current frame through the Hall value, the mapping relationship can be obtained more directly and accurately.
[0172] A cropping unit, configured to determine the cropping range of the current frame image relative to the image corresponding to the minimum field of view angle according to the field of view angle.
[0173] In some embodiments, since the field of view angle is directly related to the cropping range, in this embodiment, by determining the cropping range of the current frame image based on the field of view angle, the mapping relationship can be obtained more directly and accurately.
[0174] In this embodiment, since the field of view angle is directly related to both the Hall value and the cropping range, taking the field of view angle as an intermediate quantity, through the transmission of the field of view angle, the mapping between the Hall value and the cropping range is achieved, thereby providing a basis for subsequent image cropping.
[0175] The principle of image cropping in each embodiment of the present invention is as Figure 11 shown. First, find the minimum field of view angle Amin of the lens. At the minimum field of view angle, an image is obtained, and the principle of obtaining the image is as Figure 11 shown by the imaging optical path on the left. As the lens moves, the field of view angle An of the lens is greater than the minimum field of view angle Amin. At this time, the shooting range in the image is larger, that is, the proportion of the same target object in the image is smaller, and the principle of obtaining its image is as Figure 11 shown by the imaging optical path in the middle. At this time, in order to eliminate the breathing effect, the images at other field of view angles are cropped. As Figure 11 shown on the right in the figure, first determine the target object in the image taken at the minimum field of view angle; obtain the area where the corresponding target object is located in the images taken at other field of view angles, and crop this area, so that the images output at other field of view angles have exactly the same target object as the image output at the minimum field of view angle, that is, have the same shooting range.
[0176] An embodiment of the present invention further provides a chip, the chip is located in a terminal, and the chip includes:
[0177] At least one processor; and
[0178] A memory communicatively connected to the at least one processor; wherein,
[0179] The memory stores instructions executable by the at least one processor. The instructions are executed by the at least one processor so that the at least one processor can execute the lens calibration method described in any one of the above, or the at least one processor can execute the lens shooting method described in any one of the above.
[0180] An embodiment of the present invention further provides a chip module, and the chip module includes the above-mentioned chip.
[0181] An embodiment of the present invention further provides a computer-readable storage medium. The computer-readable storage medium stores computer instructions, and when the computer instructions are executed by a processor, the lens calibration method described in any one of the above is implemented, or the lens shooting method described in any one of the above is executed.
[0182] An embodiment of the present invention further provides a terminal, the terminal comprising:
[0183] at least one processor; and
[0184] a memory communicatively connected to the at least one processor; wherein,
[0185] the memory stores instructions executable by the at least one processor, and when the instructions are executed by the at least one processor, the at least one processor is enabled to execute the lens calibration method described in any one of the above, or the at least one processor is enabled to execute the lens shooting method described in any one of the above.
[0186] Those of ordinary skill in the art can understand that to implement all or part of the processes in the above method embodiments, it can be completed by instructing relevant hardware through a computer program. The program can be stored in a computer-readable storage medium. When the program is executed, it may include the processes of the above method embodiments. Among them, the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM), etc.
[0187] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by those skilled in the art within the technical scope disclosed by the present invention should be covered by the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.
Claims
1. A lens calibration method, characterized in that, Including: Adjusting the first distance between the lens and the image sensor successively according to a predetermined step; After each adjustment of the first distance, obtaining the Hall value and the field of view angle corresponding to the current first distance; Obtaining the image ranges corresponding to multiple field of view angles; According to the image range corresponding to the minimum field of view angle, obtaining the image cropping ranges at other field of view angles; Fitting multiple Hall values with the image cropping ranges at the corresponding multiple field of view angles to obtain the image cropping ranges corresponding to continuous Hall values; Among them, fitting multiple Hall values with the image cropping ranges at the corresponding multiple field of view angles includes: Fitting multiple Hall values with the corresponding multiple field of view angles to form a first fitting relationship between the Hall value and the field of view angle; Fitting multiple field of view angles with the corresponding multiple image cropping ranges to form a second fitting relationship between the field of view angle and the image cropping range; According to the first fitting relationship and the second fitting relationship, obtaining the image cropping ranges corresponding to continuous Hall values.
2. The lens calibration method according to claim 1, wherein After each adjustment of the first distance, obtaining the Hall value and the field of view angle corresponding to the current first distance includes: After each adjustment of the first distance, waiting for the Hall value to stabilize and reading the Hall value; Taking a picture of the calibration plate at a predetermined distance in front of the image sensor; Determining the field of view angle according to the range of the calibration plate in the image and the predetermined distance.
3. The lens calibration method according to claim 2, wherein Waiting for the Hall value to stabilize includes: Reading the Hall values of the Hall sensor multiple times. When the difference between adjacent Hall values is less than a predetermined threshold, it is determined that the Hall value is stable.
4. The lens calibration method according to claim 2, wherein Before successively adjusting the first distance between the lens and the image sensor according to a predetermined step, it further includes: Fixing the image sensor and the calibration plate, and the distance between the image sensor and the calibration plate is the predetermined distance, so that the calibration plate photographed by the lens at the maximum field of view angle fills the entire picture.
5. A method for lens shooting, characterized in that, Including: Obtaining the current frame image, the first size of the current frame image, and the corresponding current Hall value; Determining the corresponding image cropping range according to the current Hall value; Cropping the current frame image according to the image cropping range to obtain a first cropped image; Scaling the first image to the first size to obtain a photographed image; Among them, determining the corresponding image cropping range according to the current Hall value includes: determining the corresponding image cropping range according to the mapping relationship between the Hall value and the image cropping range obtained in advance; among them, the mapping relationship between the Hall value and the image cropping range is obtained by using the lens calibration method described in any one of claims 1-4.
6. The method for shooting a lens according to claim 5, characterized in that, Determining the corresponding image cropping range according to the current Hall value includes: Determining the field of view angle corresponding to the current picture according to the current Hall value; Determining the cropping range of the current frame image relative to the image corresponding to the minimum field of view angle according to the field of view angle.
7. A lens calibration device, characterized in that, Including: A distance adjustment module for successively adjusting the first distance between the lens and the image sensor according to a predetermined step; A parameter acquisition module for obtaining the Hall value and the field of view angle corresponding to the current first distance after each adjustment of the first distance; A range acquisition module for obtaining the image ranges corresponding to multiple field of view angles; A cropping determination module for obtaining the image cropping ranges at other field of view angles according to the image range corresponding to the minimum field of view angle; A cutting and fitting module, configured to fit multiple Hall values with the image cutting ranges at corresponding multiple field angles of view, so as to obtain the image cutting ranges corresponding to continuous Hall values; Wherein, the cutting and fitting module includes: A first fitting unit, configured to fit multiple Hall values with corresponding multiple field angles of view, so as to form a first fitting relationship between the Hall values and the field angles of view; A second fitting unit, configured to fit multiple field angles of view with corresponding multiple image cutting ranges, so as to form a second fitting relationship between the field angles of view and the image cutting ranges; A cutting and fitting unit, configured to obtain the image cutting ranges corresponding to continuous Hall values according to the first fitting relationship and the second fitting relationship.
8. The lens calibration device according to claim 7, characterized in that, The parameter acquisition module includes: A Hall value unit, configured to wait for the Hall value to stabilize after adjusting the first distance each time, and read the Hall value; A shooting unit, configured to shoot a calibration board at a predetermined distance in front of the image sensor; A field angle unit, configured to determine the field angle of view according to the range of the calibration board in the image and the predetermined distance.
9. The lens calibration device according to claim 8, wherein The Hall value unit includes: A stabilization subunit, configured to read the Hall values of the Hall sensor multiple times, and determine that the Hall value is stable when the difference between adjacent Hall values is less than a predetermined threshold.
10. The lens calibration device according to claim 8, characterized in that, It further includes: A spacing fixing module, configured to fixedly arrange the image sensor and the calibration board, and the distance between the image sensor and the calibration board is the predetermined distance, so that the calibration board photographed by the lens at the maximum field angle of view fills the entire screen.
11. A lens shooting device, characterized in that, It includes: A parameter reading module, configured to acquire the current frame image, the first size of the current frame image, and the corresponding current Hall value; A cutting range module, configured to determine the corresponding image cutting range according to the current Hall value; wherein, determining the corresponding image cutting range according to the current Hall value includes: determining the corresponding image cutting range according to the mapping relationship between the Hall values and the image cutting ranges obtained in advance; wherein, the mapping relationship between the Hall values and the image cutting ranges is obtained by using the lens calibration method described in any one of claims 1-4; An image cutting module, configured to cut the current frame image according to the image cutting range; so as to obtain a first cut image; An image scaling module, configured to scale the first image to the first size, so as to obtain a photographed image.
12. The lens photographing apparatus according to claim 11, wherein The cutting range module includes: A corresponding unit, configured to determine the field angle of view corresponding to the current picture according to the current Hall value; A cutting unit, configured to determine the cutting range of the current frame image relative to the image corresponding to the minimum field angle of view according to the field angle of view.
13. A chip, the chip being located in a terminal, characterized in that, The chip includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can execute the lens calibration method described in any one of claims 1 to 4, or so that the at least one processor can execute the lens shooting method described in any one of claims 5 to 6.
14. A chip module, characterized in that, The chip module includes the chip described in claim 13.
15. A computer-readable storage medium, wherein, The computer-readable storage medium stores computer instructions, which, when executed by a processor, implement the lens calibration method described in any one of claims 1 to 4, or execute the lens shooting method described in any one of claims 5 to 6.
16. A terminal, characterized in that, The terminal includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and when the instructions are executed by the at least one processor, the at least one processor is enabled to execute the lens calibration method described in any one of claims 1 to 4, or the at least one processor is enabled to execute the lens shooting method described in any one of claims 5 to 6.
Citation Information
Patent Citations
Image compensation method, electronic equipment and computer readable storage medium
CN108876739A
Image breathing correction systems and related methods
US20170134620A1