Optical continuous zoom method, calibration method, electronic device and readable storage medium
By obtaining the correspondence between magnification and zoom motor position in portable electronic devices and compensating for it with temperature, attitude and object distance information, the problem that portable electronic devices cannot achieve continuous optical zoom is solved, and a fast and accurate continuous optical zoom effect is achieved.
Patent Information
- Application Number
- CN202110867104.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-29
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2041-07-29
AI Technical Summary
Current portable electronic devices cannot achieve continuous optical zoom, resulting in a loss of image quality.
By acquiring the target magnification, and using the pre-stored correspondence between the magnification and the zoom motor position, the zoom motor is driven to move to the target position. Compensation is then performed by combining temperature, attitude, and object distance information to achieve continuous optical zoom.
It enables fast and accurate continuous optical zoom for electronic devices, improving zoom speed and accuracy.
Smart Images

Figure CN115696036B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of imaging technology, and in particular to an optical continuous zoom method, a calibration method, an electronic device, and a computer-readable storage medium. Background Technology
[0002] Zoom can be categorized into digital zoom, optical zoom, and hybrid zoom. Digital zoom and hybrid zoom methods will result in a loss of image quality, while optical zoom does not change the image resolution and has no impact on image quality.
[0003] Digital zoom refers to using software algorithms to increase the pixel area of an acquired image, thereby magnifying the image and obtaining an image taken at the same focal length. It is essentially equivalent to cropping the image.
[0004] Optical zoom is achieved by changing the internal structure of the lens, that is, by moving one or more groups of lenses inside the optical zoom lens to change the relative positions of the object being photographed, the lens, and the focal plane, thereby changing the focal length.
[0005] Hybrid zoom is a combination of digital zoom and optical zoom, and is usually achieved based on multiple fixed-focus lenses.
[0006] Currently, continuous optical zoom cannot be achieved on electronic devices, especially portable electronic devices such as mobile phones. Summary of the Invention
[0007] This application provides an optical continuous zoom method, a calibration method, an electronic device, and a computer-readable storage medium, which can realize continuous optical zoom of electronic devices.
[0008] In a first aspect, embodiments of this application provide an optical continuous zoom method applied to an electronic device. The method includes: acquiring a target magnification; determining a target position corresponding to the target magnification according to a pre-stored first correspondence relationship, wherein the first correspondence relationship is a correspondence between the magnification and the position of the zoom motor; and driving the zoom motor to move to the target position.
[0009] The electronic device includes an optical continuous zoom module, and a zoom motor is used to change the focal length of the optical continuous zoom module. The focal length of the optical continuous zoom module changes as the zoom motor moves.
[0010] In this embodiment, based on the correspondence between magnification and zoom motor position, the zoom motor is driven to move to the position corresponding to the required magnification quickly and accurately to obtain the required magnification, thereby achieving continuous optical zoom with fast zoom speed and high zoom accuracy.
[0011] Among some possible implementations of the first aspect, the method may further include:
[0012] Acquire target information, which includes at least one of the following: the temperature of the optical continuous zoom module, the attitude of the optical continuous zoom module, and the object distance;
[0013] Determine the zoom motor position offset corresponding to each type of information in the target information;
[0014] Add up the zoom motor position offset corresponding to each type of information in the target information to obtain the total offset;
[0015] Based on the pre-stored first correspondence, determine the target location corresponding to the target magnification, including:
[0016] Based on the first correspondence, locate the zoom motor position corresponding to the target magnification.
[0017] The target position is obtained based on the zoom motor position and total offset corresponding to the target magnification.
[0018] In this implementation, considering the impact of any one or any combination of factors such as temperature, attitude, and object distance on zoom accuracy, after finding the position corresponding to the target magnification based on the correspondence between the zoom motor position and the magnification, the position is added to the total offset to obtain the final target position. The zoom motor position offset is used for compensation, which further improves zoom accuracy.
[0019] Among some possible implementations of the first aspect, obtaining the target information as described above includes at least one of the following:
[0020] The temperature of the optical continuous zoom module is obtained by acquiring the temperature information fed back by the temperature sensor inside the optical continuous zoom module.
[0021] The attitude of the optical continuous zoom module is obtained by acquiring the attitude information fed back by the attitude sensor.
[0022] The object distance is obtained by acquiring distance information fed back by the distance sensor.
[0023] For example, when the electronic device is a mobile phone, the mobile phone obtains the attitude of the optical continuous zoom module through the gyroscope and obtains the object distance in the current shooting scene through the distance sensor.
[0024] Understandably, the specific process of acquiring the target information will differ depending on the information included in the target information. For example, when the target information includes temperature and attitude, the process of acquiring the target information includes: acquiring the temperature information fed back by the temperature sensor and acquiring the attitude information acquired by the attitude sensor.
[0025] In some possible implementations of the first aspect, when the target information includes the temperature of the optical continuous zoom module, the zoom motor position offset corresponding to each type of information in the aforementioned determination of the target information may include:
[0026] Based on the pre-stored second correspondence, the zoom motor position offset corresponding to the temperature is determined. The second correspondence is the correspondence between temperature and zoom motor position offset.
[0027] The correspondence between temperature and zoom motor position offset can be pre-calibrated and stored in the electronic device.
[0028] In some possible implementations of the first aspect, when the target information includes the attitude of the optical continuous zoom module, the zoom motor position offset corresponding to each type of information in the aforementioned determination of the target information may include:
[0029] Based on the pre-stored third correspondence, the zoom motor position offset corresponding to the attitude is determined. The third correspondence is the correspondence between the attitude and the zoom motor position offset.
[0030] The correspondence between the attitude and the position offset of the zoom motor can be pre-calibrated and stored in the electronic device.
[0031] In some possible implementations of the first aspect, when the target information includes object distance, the zoom motor position offset corresponding to each type of information in the aforementioned determination of the target information may include:
[0032] Based on the pre-stored fourth correspondence, the change in field of view corresponding to the object distance is determined. The fourth correspondence is the correspondence between the object distance, the position of the focusing motor, and the change in field of view.
[0033] Convert the change in field of view into a change in magnification;
[0034] Based on the first correspondence, determine the change in zoom motor position corresponding to the change in magnification;
[0035] Based on the change in the position of the zoom motor, the corresponding offset of the zoom motor position is obtained for the object distance.
[0036] The correspondence between object distance, focusing motor position, and field of view change can be pre-calibrated and stored in the electronic device.
[0037] It is understandable that the process of determining the zoom motor position offset corresponding to each type of information will differ depending on the types of information included in the target information. For example, when the target information includes temperature, attitude, and object distance, the process of determining the zoom motor position offset corresponding to each type of information can include: determining the zoom motor position offset corresponding to temperature, determining the zoom motor position offset corresponding to attitude, and determining the zoom motor position offset corresponding to object distance. The process for determining the zoom motor position offset for each type of information can be found in the corresponding implementation described above.
[0038] In some possible implementations of the first aspect, the process of determining the target position corresponding to the target magnification based on a pre-stored first correspondence may include:
[0039] Based on the first correspondence, locate the zoom motor position corresponding to the target magnification.
[0040] The zoom motor position corresponding to the target magnification is taken as the target position.
[0041] In this implementation, the electronic device does not use the zoom motor position offset for compensation, but instead uses the found zoom motor position as the final target position.
[0042] In some possible implementations of the first aspect, the process of obtaining the target magnification may include: detecting a first operation input by the user within the viewfinder; and in response to the first operation, obtaining the target magnification.
[0043] In some possible implementations of the first aspect, the first operation is a sliding operation of a magnification adjustment control within the viewfinder.
[0044] It is understandable that electronic devices can determine the target magnification autonomously or through user input.
[0045] In some possible implementations of the first aspect, after driving the zoom motor to move to the target position, the method further includes: displaying an image with a magnification of the target magnification within the viewfinder.
[0046] For example, when the target magnification is 6x, the phone quickly and accurately drives the zoom motor to move to the position corresponding to 6x based on the correspondence between the magnification and the zoom motor, and displays an image with a magnification of 6x.
[0047] In some possible implementations of the first aspect, the first correspondence is stored in the optical continuous zoom module. For example, the correspondence between magnification and zoom motor position is burned into the OTP storage space of the optical continuous zoom module using OTP technology.
[0048] Secondly, embodiments of this application provide a calibration method, the method comprising:
[0049] Obtain a set of test position points, which includes at least one test position point. The test position point is a position point selected from the travel range of the zoom motor. The zoom motor is used to change the focal length of the optical continuous zoom module.
[0050] For each test location, the zoom motor is driven to move to the test location, and the test table image of the current test location is captured by the optical continuous zoom module. The magnification corresponding to the test location is obtained based on the test table image.
[0051] Based on each test location and its corresponding magnification, the relationship between magnification and zoom motor position is obtained.
[0052] In some possible implementations of the second aspect, obtaining the magnification corresponding to the test location point from the test table image may include:
[0053] Determine the pixel distance between two key points on the test table image;
[0054] Based on the pixel distance and the actual distance between the two key points, the magnification corresponding to the location point to be tested is obtained.
[0055] In some possible implementations of the second aspect, determining the pixel distance between two key points on the test table image can include:
[0056] Extract the center coordinates of two dots from the test table image;
[0057] The distance between the coordinates of two dots is taken as the pixel distance between the two dots.
[0058] In this implementation, a dot test table (chart) is used for magnification testing. Compared with other charts (e.g., checkerboard), the extraction accuracy of key points is higher, which further improves the calculation accuracy of magnification.
[0059] In some possible implementations of the second aspect, the process of extracting the center coordinates of two dots from the test table image described above may include:
[0060] Using the position of the optical center of the optical continuous zoom module in the test table image as the center point, the region of the test table image with a preset ratio field of view is selected as the region of interest.
[0061] Extract the center coordinates of two points from the region of interest.
[0062] In this implementation, considering the distortion effect of the camera lens, key points in the region of interest with less distortion are selected for magnification calculation, which reduces the impact of distortion on magnification calibration and improves the accuracy of magnification calibration.
[0063] In some possible implementations of the second aspect, the process of obtaining the correspondence between the magnification and the zoom motor position based on each test location and the corresponding magnification of each test location may include:
[0064] Based on the magnification of each test location and the code value of each test location, a curve of change between magnification and zoom motor position is obtained by curve fitting.
[0065] In this implementation, the correspondence between magnification and zoom motor position is obtained through curve fitting. In other implementations, this correspondence can also be obtained in other ways, such as by using a lookup table.
[0066] In some possible implementations of the second aspect, after obtaining the correspondence between the magnification and the zoom motor position, the method further includes: storing the correspondence between the magnification and the zoom motor position into the optical continuous zoom module.
[0067] Among some possible implementations of the second aspect, the method also includes:
[0068] Drive the zoom motor to move to the position corresponding to the first magnification;
[0069] Record the position of the zoom motor of the optical continuous zoom module at each test temperature;
[0070] Based on the zoom motor position at each test temperature and the first zoom motor reference position, the zoom motor position offset at each test temperature is obtained. The first zoom motor reference position is the zoom motor position corresponding to the first magnification.
[0071] Based on each temperature to be measured and the zoom motor position offset at each temperature, the correspondence between temperature and zoom motor position offset is obtained.
[0072] In this implementation, considering the temperature drift phenomenon that may occur in the zoom motor position, the correspondence between temperature and zoom motor position offset is pre-calibrated to facilitate subsequent compensation of the zoom motor position based on the calibration results, thereby further improving zoom accuracy.
[0073] Among some possible implementations of the second aspect, the method also includes:
[0074] Drive the zoom motor to move to the position corresponding to the second magnification;
[0075] Record the position of the zoom motor of the optical continuous zoom module under each test posture;
[0076] Based on the zoom motor position and the second zoom motor reference position under each test posture, the zoom motor position offset under each test posture is obtained. The second zoom motor reference position is the zoom motor position corresponding to the second magnification.
[0077] Based on each attitude to be tested and the zoom motor position offset under each attitude to be tested, the correspondence between the attitude and the zoom motor position offset is obtained.
[0078] In this implementation, it is considered that the position of the zoom motor of the optical continuous zoom lens will be inaccurate under different postures, thus affecting the zoom accuracy. Therefore, by pre-calibrating the correspondence between the state and the position offset of the zoom motor, it is convenient to compensate for the position of the zoom motor based on the calibration results, thereby further improving the zoom accuracy.
[0079] Among some possible implementations of the second aspect, the method also includes:
[0080] Drive the zoom motor to move to the position corresponding to the third magnification;
[0081] Record the field of view of the optical continuous zoom module at each object distance;
[0082] Based on the field of view and the field of view reference value for each object distance to be measured, the change in field of view corresponding to each object distance to be measured is obtained. The field of view reference value is the field of view corresponding to the third magnification.
[0083] Based on the change in field of view for each object distance to be measured, the position of the focusing motor corresponding to each object distance to be measured, and the object distance to be measured, the correspondence between the object distance, the position of the focusing motor, and the change in field of view is obtained.
[0084] In this implementation, considering that the movement of the focusing module will slightly change the magnification of the optical continuous zoom lens, thus affecting the zoom accuracy, the correspondence between the object distance, the position of the focusing motor and the change in the field of view is pre-calibrated. This facilitates subsequent compensation of the zoom motor position based on the calibration results, thereby further improving the zoom accuracy.
[0085] Thirdly, embodiments of this application provide an electronic device, including a zoom motor, an optical continuous zoom module, a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it performs the following steps: obtaining a target magnification; determining a target position corresponding to the target magnification based on a pre-stored first correspondence, wherein the first correspondence is a relationship between the magnification and the position of the zoom motor; and driving the zoom motor to move to the target position. The zoom motor is used to change the focal length of the optical continuous zoom module.
[0086] In some possible implementations of the third aspect, the processor, when executing the computer program, also performs the following steps: acquiring target information, which includes at least one of the following: the temperature of the optical continuous zoom module, the attitude of the optical continuous zoom module, and the object distance;
[0087] Determine the zoom motor position offset corresponding to each type of information in the target information;
[0088] The total offset is obtained by adding up the zoom motor position offset corresponding to each type of information in the target information.
[0089] At this time, when the processor executes the computer program, it specifically implements the following steps: according to the first correspondence, find the zoom motor position corresponding to the target magnification; according to the zoom motor position corresponding to the target magnification and the total offset, obtain the target position.
[0090] In some possible implementations of the third aspect, the processor, when executing the computer program, specifically implements at least one of the following steps:
[0091] The temperature of the optical continuous zoom module is obtained by acquiring the temperature information fed back by the temperature sensor inside the optical continuous zoom module.
[0092] The attitude of the optical continuous zoom module is obtained by acquiring the attitude information fed back by the attitude sensor.
[0093] The object distance is obtained by acquiring distance information fed back by the distance sensor.
[0094] At this time, the electronic device may include at least one of the following: a temperature sensor, an attitude sensor, and a distance sensor.
[0095] In some possible implementations of the third aspect, when the target information includes the temperature of the optical continuous zoom module, the processor executes the computer program to specifically implement the following steps: determine the zoom motor position offset corresponding to the temperature according to the pre-stored second correspondence, the second correspondence being the correspondence between the temperature and the zoom motor position offset.
[0096] In some possible implementations of the third aspect, when the target information includes the attitude of the optical continuous zoom module, the processor executes the computer program to specifically implement the following steps: determine the zoom motor position offset corresponding to the attitude according to the pre-stored third correspondence, where the third correspondence is the correspondence between the attitude and the zoom motor position offset.
[0097] In some possible implementations of the third aspect, when the target information includes object distance, the processor executes the computer program and specifically implements the following steps:
[0098] Based on the pre-stored fourth correspondence, the change in field of view corresponding to the object distance is determined. The fourth correspondence is the correspondence between the object distance, the position of the focusing motor, and the change in field of view.
[0099] Based on the first correspondence, determine the zoom motor position offset corresponding to the change in field of view.
[0100] At this time, the electronic device also includes a focusing motor.
[0101] In some possible implementations of the third aspect, the processor executes the following steps when running the computer program: based on the first correspondence, find the zoom motor position corresponding to the target magnification; and take the zoom motor position corresponding to the target magnification as the target position.
[0102] In some possible implementations of the third aspect, the processor executes the computer program by performing the following steps:
[0103] The system detects the first action input by the user within the viewfinder; in response to the first action, it obtains the target magnification. The first action can be a sliding operation on the magnification adjustment control within the viewfinder.
[0104] In some possible implementations of the third aspect, the processor, when executing the computer program, also performs the following steps: displaying an image with a magnification of the target magnification within the viewfinder.
[0105] Fourthly, embodiments of this application provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method described in any of the second aspects above.
[0106] Fifthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method as described in either the first or second aspect above.
[0107] Sixthly, embodiments of this application provide a chip system including a processor coupled to a memory. The processor executes a computer program stored in the memory to implement the method described in any of the first or second aspects above. The chip system may be a single chip or a chip module composed of multiple chips.
[0108] In a seventh aspect, embodiments of this application provide a computer program product that, when run on an electronic device, causes the electronic device to perform the method described in any of the first or second aspects above.
[0109] It is understood that the beneficial effects of the second to seventh aspects mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here. Attached Figure Description
[0110] Figure 1 A schematic block diagram of the hardware structure of the electronic device 100 provided in the embodiments of this application;
[0111] Figures 2A to 2C This is a schematic diagram of the zoom component movement provided in an embodiment of this application;
[0112] Figure 2D This is a schematic diagram of the optical path during the movement of the zoom component provided in the embodiments of this application;
[0113] Figure 3 A schematic block diagram of the software structure of the electronic device 100 provided in the embodiments of this application;
[0114] Figure 4 This is a schematic diagram of the calibration process provided in the embodiments of this application;
[0115] Figure 5 A schematic diagram illustrating the calibration principle of mobile phone magnification provided in an embodiment of this application;
[0116] Figure 6 This is a schematic diagram of a dot chart provided in an embodiment of this application;
[0117] Figure 7 This is a schematic diagram of lens imaging provided in an embodiment of this application;
[0118] Figure 8 This is a schematic diagram of the magnification-zoom motor position variation curve provided in an embodiment of this application;
[0119] Figure 9A A schematic diagram illustrating the downward orientation of a mobile phone as provided in an embodiment of this application;
[0120] Figure 9B A schematic diagram illustrating the upward posture of a mobile phone as provided in an embodiment of this application;
[0121] Figure 9C A schematic diagram illustrating the horizontal orientation of a mobile phone as provided in an embodiment of this application;
[0122] Figures 9D to 9E A schematic diagram illustrating the calculation of zoom motor offset under other attitudes provided in the embodiments of this application;
[0123] Figure 10 This is a calibration diagram for different object distances provided in the embodiments of this application;
[0124] Figure 11 A schematic flowchart illustrating the optical continuous zoom method provided in this application embodiment;
[0125] Figure 12A A schematic diagram illustrating user input of magnification as provided in an embodiment of this application;
[0126] Figure 12B Another schematic diagram illustrating the user input magnification provided in this application embodiment;
[0127] Figure 13 This is a schematic diagram of the shooting process provided in an embodiment of this application. Detailed Implementation
[0128] In the following description, specific details such as particular system architectures and technologies are set forth for illustrative purposes and not for limiting purposes, in order to provide a thorough understanding of the embodiments of this application.
[0129] The hardware and software structures of the electronic devices involved in the embodiments of this application will be described below by way of example.
[0130] See Figure 1 This is a schematic diagram of the hardware structure of the electronic device 100 provided in an embodiment of this application. Figure 1 As shown, the electronic device 100 may include a processor 101, a memory 102, a zoom motor 103, and a camera 104.
[0131] Electronic device 100 may include one or N cameras 104, where N is a positive integer greater than 1.
[0132] Optionally, the electronic device 100 may also include a sensor module 105 and a focusing motor 106.
[0133] The sensor module 105 may include, but is not limited to, an attitude sensor 105A, a distance sensor 105B, and a temperature sensor 105C.
[0134] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0135] For example, when the electronic device 100 is a mobile phone or a tablet computer, the electronic device 100 may also include a touch screen consisting of a display screen and a touch sensor.
[0136] Processor 101 may include one or more processing units. For example, processor 101 may include an application processor (AP), a graphics processing unit (GPU), an image signal processor (ISP), a controller, memory, a video codec, and / or a digital signal processor (DSP), etc. The different processing units may be independent devices or integrated into one or more processors.
[0137] The controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to the instruction opcode and timing signals to complete the control of fetching and executing instructions.
[0138] In some embodiments, the processor 101 may include one or more interfaces. Interfaces may include a mobile industry processor interface (MIPI) and / or a general-purpose input / output (GPIO) interface, etc.
[0139] The MIPI interface can be used to connect the processor 101 to peripheral devices such as a display screen and a camera 104. The MIPI interface includes a camera serial interface (CSI) and a display serial interface (DSI). In some embodiments, the processor 101 and the camera 104 communicate via the CSI interface to enable the electronic device 100 to capture images. The processor 101 and the display screen communicate via the DSI interface to enable the electronic device 100 to display images.
[0140] The GPIO interface can be configured via software. It can be configured as a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 101 to the camera 104, display screen, sensor module 105, etc. The GPIO interface can also be configured as a MIPI interface, etc.
[0141] It is understood that the interface connection relationships between the modules illustrated in the embodiments of this application are merely illustrative and do not constitute a structural limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.
[0142] Electronic device 100 can perform shooting functions through ISP, camera 104, video codec, GPU, display screen and application processor.
[0143] The ISP (Image Signal Processor) is used to process data fed back from the camera 104. For example, when taking a picture, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, and the camera's photosensitive element transmits the electrical signal to the ISP for processing, transforming it into an image visible to the naked eye. The ISP can also perform algorithmic optimizations on image noise, brightness, and skin tone. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be integrated into the camera 104.
[0144] Camera 104 is used to capture still images or videos. An object is projected onto a photosensitive element through the lens, generating an optical image. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then passed to the ISP (Image Signal Processor) for conversion into a digital image signal. The ISP outputs the digital image signal to the DSP (Digital Signal Processor) for processing. The DSP converts the digital image signal into image signals in standard RGB, YUV, or other formats.
[0145] In this embodiment, one or more camera modules among the N cameras 104 may include an optical continuous zoom lens. The optical continuous zoom lens includes multiple lenses, some of which form a zoom group, and some of which form a focus group. The zoom group can move inside the lens to change the focal length, thus achieving optical continuous zoom.
[0146] The zoom component can move along with the zoom motor 103, that is, the zoom motor 103 is used to move the zoom component.
[0147] Within the travel range of the zoom motor 103, the electronic device 100 can drive the zoom motor 103 to move continuously. As the zoom motor 103 moves, the zoom assembly also moves continuously, causing the focal length of the optical continuous zoom lens to change continuously, and the field of view (FOV) and magnification (or zoom ratio) to also change continuously. When the focal length changes continuously, the amount of light entering the optical continuous zoom lens also changes, i.e., the aperture changes.
[0148] For example, see Figures 2A to 2C A schematic diagram showing the movement of the zoom component is shown. Figures 2A to 2C As shown, the optical continuous zoom lens includes a front fixed assembly 21, a zoom assembly 22, a focusing assembly 23, and a photosensitive element 24. The front fixed assembly 21 and the photosensitive element 24 are fixed, while the zoom assembly 22 and the focusing assembly 23 are movable.
[0149] exist Figure 2A In the middle, the zoom component 22 and the focusing component 23 are in a certain position. The electronic device 100 controls the zoom component 22 to move to the left by driving the zoom motor 103, until it moves to the left. Figure 2B The zoom component 22 moves to the position shown. Figure 2B After reaching the indicated position, the electronic device 100 again controls the zoom component 22 to continue moving to the left by driving the zoom motor 103, until it reaches the position shown. Figure 2C The location shown. In Figures 2A to 2C In the process, when the zoom component 22 moves, the focusing component 23 will also move accordingly.
[0150] As the zoom component 22 moves, the focal length and aperture change. The amount of light entering the camera is generally related to the diameter of the aperture; the larger the aperture, the greater the amount of light entering. For example, see... Figure 2D The diagram shows the optical path during the movement of the zoom component 22. During the movement of the zoom component 22, the amount of light entering the optical continuous zoom lens will change accordingly. Figure 2D From top to bottom, they correspond to Figure 2A , Figure 2B and Figure 2C The zoom components are positioned, from left to right, corresponding to the front fixed component 21, zoom component 22, focusing component 23, and image sensor 24, respectively. Light passes sequentially through the front fixed component 21, zoom component 22, and focusing component 23 before reaching the image sensor 24.
[0151] It should be noted that, Figures 2A to 2C The optical continuous zoom lens and the movement of the zoom assembly shown are merely examples. Similarly, Figure 2DThe optical paths shown when the zoom component is in different positions are also examples. This application does not limit the specific structure of the optical continuous zoom lens.
[0152] Understandably, when the electronic device 100 is a portable electronic device (e.g., a mobile phone or tablet), the optical continuous zoom lens can be a miniaturized lens, which is small in size and weight and suitable for portable electronic devices with high requirements for thinness and lightness.
[0153] Of course, in addition to optical continuous zoom lenses, electronic devices 100 may also include other types of cameras, such as telephoto cameras and wide-angle cameras.
[0154] In some embodiments, the zoom motor 103 and the focus motor 106 may be disposed within the optical continuous zoom module.
[0155] A digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals.
[0156] The memory 102 can be used to store computer executable program code, which includes instructions. The processor 101 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 102. The memory 102 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback function, image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, phone book, etc.). In addition, the internal memory 102 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.
[0157] In this embodiment, the camera module may include a One-Time Programmable (OTP) memory for storing information such as the travel range of the zoom motor and / or a pre-calibrated correspondence between the zoom motor position and magnification. The travel range of the zoom motor can be represented as [macro, infinity]. Specifically, this information can be programmed into the camera module using OTP technology.
[0158] Attitude sensor 105A is used to acquire the attitude of electronic device 100. Specifically, attitude sensor 105A can be a gyroscope sensor, which can be used to determine the motion attitude of electronic device 100. In some embodiments, the angular velocity of electronic device 100 about three axes (i.e., x, y, and z axes) can be determined by the gyroscope sensor.
[0159] In this embodiment of the application, in the optical continuous zoom scenario, the electronic device 100 can obtain the attitude feedback from the gyroscope sensor, and after determining the position compensation value of the zoom motor corresponding to the current attitude, use the position compensation value to compensate for the position difference of the zoom motor to improve zoom accuracy.
[0160] Distance sensor 105B is used to measure distance. Electronic device 100 can measure distance via infrared or laser. In some embodiments, during a shooting scene, electronic device 100 can utilize distance sensor 105B to measure distance for rapid focusing.
[0161] In this embodiment of the application, in the optical continuous zoom scenario, the electronic device 100 can measure the object distance (i.e., the distance between the lens and the object being photographed) through the distance sensor 105B, and after determining the position compensation value of the zoom motor corresponding to the current object distance, use the position compensation value to compensate for the position difference of the zoom motor to improve zoom accuracy.
[0162] Temperature sensor 105C is used to detect temperature. In some embodiments, electronic device 100 uses the temperature detected by temperature sensor 1080J to execute a temperature processing strategy. For example, when the temperature reported by temperature sensor 105C exceeds a threshold, electronic device 100 performs thermal protection by reducing the performance of a processor located near temperature sensor 105C to reduce power consumption.
[0163] In this embodiment, the temperature sensor 105C can be installed inside the optical continuous zoom module to detect the temperature inside the optical continuous zoom module. The electronic device 100 determines the zoom motor position compensation value corresponding to the current temperature based on the current temperature fed back by the temperature sensor 105C, and compensates for the position difference of the zoom motor based on the zoom motor position compensation value to improve zoom accuracy.
[0164] The focusing motor 106 is used to control the movement of the focusing module within the focusing range to achieve focusing. Normally, the electronic device 100 zooms first and then focuses.
[0165] After introducing the hardware architecture of the electronic device 100, the software architecture of the electronic device 100 will be introduced as an example below.
[0166] The software system of electronic device 100 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application embodiment uses the layered architecture Android system as an example to exemplify the software structure of electronic device 100.
[0167] Figure 3 This is a software structure block diagram of an electronic device 100 according to an embodiment of this application.
[0168] A layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.
[0169] The application layer can include a series of application packages.
[0170] like Figure 3 As shown, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and SMS.
[0171] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.
[0172] like Figure 3 As shown, the application framework layer may include a window manager, content provider, view system, phone manager, resource manager, notification manager, etc.
[0173] The window manager is used to manage windowed applications. It can retrieve screen size, determine the presence of a status bar, lock the screen, and capture screenshots. The content provider stores and retrieves data, making that data accessible to applications. This data can include video, images, audio, etc.
[0174] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text notification icon could include views for displaying text and views for displaying images.
[0175] The Phone Manager provides communication functionality for electronic devices 100, such as managing call status (including connection and disconnection). The Resource Manager provides applications with various resources, such as localized strings, icons, images, layout files, video files, etc. The Notification Manager allows applications to display notifications in the status bar, conveying informational messages that disappear automatically after a short pause without user interaction. For example, the Notification Manager can be used to notify of download completion or message alerts. The Notification Manager can also display notifications as icons or scrolling text in the system's top status bar, such as notifications from background applications, or as dialog boxes on the screen. Examples include displaying text messages in the status bar, emitting alert sounds, vibrating the electronic device, and flashing indicator lights.
[0176] The Android Runtime consists of core libraries and a virtual machine. The Android runtime is responsible for scheduling and managing the Android system.
[0177] The core library consists of two parts: one part is the functionalities that need to be called by the Java language, and the other part is the Android core library.
[0178] The application layer and application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.
[0179] System libraries can include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), etc.
[0180] The Surface Manager is used to manage the display subsystem and provides the blending of 2D and 3D layers for multiple applications.
[0181] The media library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG.
[0182] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing. The 2D graphics engine is a drawing engine for 2D graphics. The kernel layer is the layer between hardware and software. The kernel layer contains at least the display driver, camera driver, audio driver, sensor driver, zoom motor driver, and focus motor driver.
[0183] In this embodiment, after the kernel layer receives the zoom motor position value sent down from the upper layer, it drives the zoom motor to move to the corresponding position and returns the current zoom motor position to the upper layer.
[0184] The following example, using a shooting scenario, illustrates the workflow of the software and hardware of electronic device 100.
[0185] For example, when the touch sensor receives a touch operation, a corresponding hardware interrupt is sent to the kernel layer. The kernel layer processes the touch operation into a raw input event (including touch coordinates, timestamp of the touch operation, etc.). The raw input event is stored in the kernel layer. The application framework layer retrieves the raw input event from the kernel layer and identifies the control corresponding to the input event. Taking a touch click as an example, where the click corresponds to the camera application icon, the camera application calls the application framework layer's interface to launch the camera application, and then calls the kernel layer to launch the camera driver, capturing still images or videos through the camera 104.
[0186] After introducing the electronic device 100 involved in the embodiments of this application, the technical solutions provided by the embodiments of this application will be described in detail below.
[0187] The solution provided in this application can be exemplarily divided into a calibration stage and an application stage. In the calibration stage, the relationship between the magnification of the optical continuous zoom lens and the position of the zoom motor is calibrated to obtain the correspondence between the zoom motor position and the magnification. In the application stage, after obtaining the required magnification, the electronic device 100 determines the target position corresponding to the required magnification based on the correspondence between the zoom motor position and the magnification, and then drives the zoom motor of the optical continuous zoom lens to move to the target position to achieve optical continuous zoom.
[0188] The calibration phase and the application phase will be introduced separately below.
[0189] 1. Calibration stage.
[0190] As mentioned above, optical continuous zoom lenses use a zoom motor to control the movement of the zoom assembly within the lens to change the focal length and magnification. Therefore, during the calibration phase, it is necessary to calibrate the correspondence between the zoom motor position and the magnification, so that in subsequent application phases, the zoom motor position corresponding to the required magnification can be determined based on this correspondence.
[0191] The calibration stage can be performed on the production line of electronic device 100. For example, when electronic device 100 is a mobile phone, the correspondence between the zoom motor position and magnification can be calibrated on the mobile phone production line, and the calibrated correspondence can be stored in the internal storage space of the mobile phone. Of course, the calibration stage can also be performed on the camera module production line.
[0192] In this embodiment, the relationship between the zoom motor position and magnification of an optical continuous zoom lens can be calibrated using optical calibration and image-based calibration methods.
[0193] Optical calibration typically requires additional equipment, usually a set of light-emitting and data-collecting devices, to detect and calculate the magnification and field of view (FOV) of the optical continuous zoom lens. For example, the light-emitting and data-collecting devices are used to detect and calculate the magnification at different zoom motor positions. Then, based on the magnification corresponding to different zoom motor positions, the relationship between the zoom motor position and the magnification is obtained through curve fitting or other methods.
[0194] Image-based calibration: Within the zoom motor's travel range, multiple different zoom motor positions are selected as test locations. For each test location, an image of the test chart is captured using an optical continuous zoom lens. The distance between any two key points in the captured image is calculated. Based on the distance between the two key points in the image and the actual distance, the field of view (FOV) and magnification at the current zoom motor position are obtained. The actual distance between the two key points can be obtained by measuring the distance between two key points on the actual calibration chart.
[0195] The test table mentioned above can be a checkerboard chart, a dot chart, or other charts. This application does not limit the types of charts used.
[0196] However, during actual calibration, the inventors discovered that when using a checkerboard chart for calibration, key points are typically extracted at the vertices of the checkerboard, leading to significant errors and low accuracy in the extracted key points, thus affecting the accuracy of subsequent calibration. Furthermore, for optical continuous zoom lenses, as the magnification gradually increases, the field of view (FOV) gradually decreases, and the number of checkerboard squares in the captured image may be very small, resulting in low accuracy in the calculated FOV and magnification. To improve the accuracy of key point extraction and magnification calculation, a dotted chart can be used for calibration.
[0197] In the specific calibration process, you can first select multiple different zoom motor positions within the zoom motor's stroke range, and then measure the magnification corresponding to each zoom motor position; or you can first select multiple different magnifications, and then measure the zoom motor position corresponding to each magnification.
[0198] Taking image-based calibration as an example. See [link / reference] Figure 4 The illustrated embodiment of this application provides a calibration process that may include the following steps:
[0199] Step S401: After the optical continuous zoom module is powered on, obtain the travel range of the zoom motor of the optical continuous zoom lens. The optical continuous zoom module includes an optical continuous zoom lens.
[0200] The travel range of the aforementioned zoom motor is typically calibrated at the factory, describing its closest and furthest possible movement. After calibrating the zoom motor's travel range, this range can be programmed into the OTP (Optical Time Point) storage space of the optical continuous zoom lens. Based on this, after the optical continuous zoom lens is powered on, the zoom motor's travel range can be read from the OTP storage space.
[0201] As shown above, the calibration phase can be performed on the camera module production line. Figure 4 The process steps can be performed by external testing equipment. The calibration phase can also be carried out on the electronic equipment production line, in which case... Figure 4 The process steps can be executed on the electronic device 100.
[0202] Step S402: Within the stroke range of the zoom motor, select multiple different position points to form a set of position points to be measured.
[0203] The set of locations to be measured includes at least one location point. The number of locations in the set can be set according to actual needs and is not limited here.
[0204] It should be noted that each position point within the zoom motor's travel range can be numbered, giving each position point a unique code value. The code value identifies the corresponding position point. Each code value corresponds to a zoom motor position. After selecting the position point to be measured, the code value for each position point can also be obtained.
[0205] Typically, electronic device 100 may include a driver chip, and the code value is data sent by the driver chip.
[0206] For example, if the set of test locations includes 10 test locations, then the code values of the 10 test locations are: 1000, 2000, 4000, 6000, 8000, 10000, 11000, 12000, 1300, and 14000.
[0207] Step S403: Drive the zoom motor of the optical zoom lens to the i-th position to be measured.
[0208] Where i is a positive integer greater than or equal to 1 and less than or equal to N. N is the number of selected test locations. For example, when there are 10 selected test locations, N = 10.
[0209] Step S404: Take a picture of the calibration chart using an optical continuous zoom lens to obtain the image corresponding to the current test position point.
[0210] For example, electronic device 100 is a mobile phone. See also Figure 5 The diagram shown illustrates the principle of mobile phone magnification calibration. The mobile phone 51 includes an optical continuous zoom lens 511, and a calibration chart 52 can rotate around a rotation axis. During calibration, the mobile phone 51 and the calibration chart 52 remain relatively parallel. The calibration chart can be a checkerboard chart, a dotted chart, or other types of chart. The size of the calibration chart can be determined based on the actual shooting distance and magnification, and is not limited here. Additionally, Figure 5 The example also shows that the distance between the mobile phone 51 and the calibration chart 52 is approximately 450mm, which can also be set according to the actual application requirements.
[0211] Different calibration charts will result in different images. For example, when the calibration chart is a dotted chart, the captured image may look like this: Figure 6 As shown. Figure 6 The image contains many dots, the size of which can be set according to the actual application requirements. The dots with thicker lines are pre-set key points; this image includes 7 key points.
[0212] Step S405: Calculate the magnification of the current test location point based on the image corresponding to the current test location point.
[0213] For example, the key points in the image are extracted first.
[0214] The key points may differ between different calibrated charts. For example, for a checkerboard chart, the corners of the checkerboard are used as key points. For a dotted chart, either a point on the circle or the center of the circle can be used as a key point. Using the center of the circle as the key point results in higher precision in key point extraction, leading to a more accurate calculated magnification.
[0215] by Figure 6 Taking the dotted chart image shown as an example, for each dot with a thickened line, calculate the coordinates of its center. For example... Figure 6 As shown, the pixel coordinates of the center A and the center B of the circle are calculated.
[0216] It should be noted that in some embodiments, the magnification can be calculated directly based on the captured chart image. However, the inventors discovered in their research that when calculating the magnification based on the captured chart image, the edge areas of the captured chart image are deformed due to the distortion of the camera lens, which in turn affects the accuracy of the calculated magnification.
[0217] To reduce the impact of camera lens distortion and improve the accuracy of the calculated magnification, in some embodiments, a Region of Interest (ROI) with smaller distortion can be selected from the image before extracting key points, and then key points can be extracted based on the ROI.
[0218] Typically, you can first perform a camera calibration on the optical continuous zoom lens to determine its optical center; then, using the position of the optical center in the captured chart image as the center point, select an image with 50% field of view as the ROI region.
[0219] After extracting the keypoints, the pixel distance between any two keypoints is calculated. Typically, any two keypoints can be adjacent keypoints.
[0220] For example, any two key points are Figure 6 Given centers A and B in an image, calculate the pixel distance between them. Pixel distance refers to the distance on the image.
[0221] Finally, based on the pixel distance and actual distance (or physical distance) between these two key points in the image, the magnification is calculated using similar trigonometric relationships.
[0222] For example, see Figure 7The diagram illustrates lens imaging. AB represents the object being photographed on the object plane, and A'B' represents the image of the object on the image plane. The space between MM' is a lens, specifically a continuous zoom lens. F is the focal point, f is the focal length, and l is the object distance. The length of AB is y, which can be obtained through measurement or calculation. For example, for a dotted chart, y can be obtained by measuring the distance between the center A and the center B of the circle. The length of A'B' is y', which is the pixel distance. For example, for... Figure 6 In the chart image shown, the distance between point A and point B is y'. Based on similar triangles, the magnification can be calculated as follows:
[0223]
[0224] Step S406: Determine whether i is less than or equal to N. If yes, then i = i + 1 and return to step S403. If no, proceed to step S407.
[0225] Specifically, after calculating the magnification of the current test position, it is first determined whether the current test position is the last test position, i.e., whether i equals N. If not, i = i + 1 and the process returns to step S403, i.e., the zoom motor is driven to move to the next test position, and steps S404 to S406 are repeated until i = N, i.e. until the current test position is the last test position.
[0226] If the current position to be measured is the last position to be measured, i.e., i = N, then the magnification corresponding to all positions to be measured is obtained, and these data are processed to obtain the correspondence between the zoom motor position and the magnification.
[0227] For example, when i = 1, the zoom motor is moved to the first test position. After calculating the magnification of the first test position based on its image, i = i + 1 = 2, meaning the zoom motor is moved to the second test position. Then, the magnification of the second test position is calculated based on its image. This process continues until the magnification of all test positions in the set is calculated.
[0228] Step S407: Based on the magnification of each test location, obtain the correspondence between the zoom motor position and the magnification.
[0229] Understandably, the magnification at each test location can be viewed as a series of discrete data points. Based on these discrete data points, a continuous curve of magnification versus zoom motor position can be obtained through curve fitting. This continuous curve of magnification versus zoom motor position represents the correspondence between the zoom motor position and the magnification.
[0230] The position of the zoom motor can be specifically represented by the code value at each position point. Therefore, by observing the continuous change curve of magnification versus zoom motor position, the code value corresponding to the zoom motor position at each magnification level can be found.
[0231] For example, see Figure 8 The diagram shows the change curves of magnification and zoom motor position. The horizontal axis represents magnification, and the vertical axis represents the code value of the zoom motor position. The fitting coefficient is:
[0232] Y = 6.8426x 4 -180.32x 3 +1571.5x 2 -2921.5x-844.47.
[0233] The fitting error is: R 2 =0.9999.
[0234] based on Figure 8 The curves shown allow you to find the code value for the zoom motor position at any magnification. For example, at 6x magnification, the code value for the zoom motor position is 8000; at 7x magnification, it is 10000; and at 8x magnification, it is 12000.
[0235] It should be noted that within the zoom motor's travel range, each position point is pre-numbered, meaning each position point has a specific number. The zoom motor's code value can be equated to its actual position. Therefore, during curve fitting, based on the code value of each measured position point and its corresponding magnification, a curve relating the zoom motor's code value to its magnification is obtained.
[0236] Besides curve fitting, other methods can be used to process discrete data points to obtain the correspondence between the zoom motor position and the magnification.
[0237] For example, the correspondence between the zoom motor position and the magnification can be obtained by looking up a table. Specifically, the obtained discrete data points are made into a table, which contains rows or columns with the code value of the zoom motor position and the magnification, with each magnification corresponding to a code value.
[0238] For example, a portion of the table may be shown in Table 1 below.
[0239] Table 1
[0240] Magnification code value of zoom motor position 6x 8000 7x 10000 8x 12000
[0241] This table allows you to find the code value for the zoom motor position corresponding to each magnification level.
[0242] After obtaining the correspondence between the zoom motor position and the magnification, this correspondence can be stored in the OTP storage space of the optical continuous zoom lens. In subsequent applications, the electronic device 100 can read the correspondence between the zoom motor position and the magnification from the OTP storage space to determine the code value of the zoom motor position corresponding to the target magnification.
[0243] The target magnification refers to the required magnification. For example, when a user needs to magnify the magnification to 6x, the target magnification is 6x.
[0244] It should be noted that in other embodiments, multiple different magnifications can be selected first, and then the zoom motor positions corresponding to each magnification can be measured. Finally, based on the zoom motor positions corresponding to different magnifications, the correspondence between the zoom motor positions and the magnifications can be obtained through curve fitting or lookup tables. For example, if the selected magnifications include 6x, the zoom motor is first driven to achieve a magnification of 6x, and then the position of the driven zoom motor is recorded to obtain the zoom motor position corresponding to a magnification of 6x.
[0245] As can be seen from the above, the embodiments of this application pre-calibrate the correspondence between the zoom motor position and the magnification, so that the zoom motor can be driven quickly and accurately to the position corresponding to the target magnification in subsequent stages based on the correspondence. This not only achieves continuous optical zoom, but also improves zoom speed and zoom accuracy.
[0246] Furthermore, the inventors discovered during their research that factors such as temperature, orientation, and focusing distance all affect the accuracy of optical continuous zoom.
[0247] To reduce or even eliminate the influence of factors such as temperature, attitude, and focusing distance, and to improve the accuracy of optical continuous zoom, embodiments of this application also calibrate at least one of the following during the calibration stage: the correspondence between temperature and zoom motor position offset, the correspondence between attitude and zoom motor position offset, and the correspondence between object distance, focusing motor position, and zoom motor position offset.
[0248] The calibration process for these three factors will be described below.
[0249] (1) Temperature. Temperature refers to the temperature inside the optical continuous zoom module.
[0250] It is understandable that after an electronic device is powered on, its internal temperature will rise, and the temperature sensor inside the optical continuous zoom module of the electronic device can provide real-time feedback on the temperature inside the optical continuous zoom module.
[0251] The position of the zoom motor changes with temperature, which is called temperature drift. Therefore, temperature drift calibration is needed to obtain the corresponding relationship between temperature and zoom motor position offset.
[0252] Through a temperature drift calibration process, the offset of the zoom motor position at different temperatures is recorded. Then, based on the offset of the zoom motor position at different temperatures, a temperature-zoom motor position offset curve is obtained through curve fitting and other methods. In subsequent application stages, based on the temperature-zoom motor position offset curve, the zoom motor position offset at the current temperature is determined, and the zoom motor position offset is compensated to the zoom motor position found according to the target magnification.
[0253] During temperature drift calibration, it is assumed that the offset at the same temperature is the same for different magnifications. Therefore, by measuring the correspondence between temperature and zoom motor offset at one magnification, the correspondence between temperature and zoom motor offset at all magnifications can be obtained.
[0254] Specifically, a magnification is first determined, then the position of the zoom motor at different temperatures is measured at that magnification, and the position offset of the zoom motor is obtained based on the difference between the measured position of the zoom motor and the reference position of the zoom motor at that magnification.
[0255] The zoom motor reference position refers to the position of the zoom motor at a given magnification at a specific temperature (e.g., room temperature). For example, ... Figure 8 The graph shown indicates that when the magnification is 6x, the reference position of the zoom motor is the position corresponding to the code value of 8000.
[0256] For example, for a mobile phone, the magnification is first increased to 6x by driving the zoom motor. The phone is then placed in a temperature chamber, and the chamber temperature is gradually increased. The position of the zoom motor is recorded at different temperatures. Then, the difference between the recorded zoom motor position and the reference position of the zoom motor is calculated to obtain the offset at that temperature. For instance, at temperature A, the code value of the recorded zoom motor position is 8002, while the code value of the reference position of the zoom motor at 6x magnification is 8000. Therefore, the offset of the zoom motor position at that temperature is 2.
[0257] In the subsequent application stage, assuming the phone detects the current temperature as temperature A via its temperature sensor, and the user requires a magnification of 6x, the code value for the zoom motor position is found to be 8000 based on the correspondence between magnification and zoom motor position. This code value is then subtracted from the offset at temperature A to obtain the compensated code value for the zoom motor position: 8000 - 2 = 7998. Finally, the phone uses a specific drive current to move the zoom motor to the position with code value 7998, thus amplifying the magnification to 6x. In this way, by compensating for the zoom motor position based on a pre-calibrated correspondence between temperature and zoom motor position offset, zoom accuracy is improved.
[0258] After obtaining the zoom motor position offset at different temperatures, the relationship between temperature and zoom motor position offset can be obtained through curve fitting or lookup table.
[0259] It should be noted that, in other embodiments, the correspondence between temperature and zoom motor offset can also be converted into a correspondence between temperature and magnification offset. Specifically, after obtaining the zoom motor position offset at different temperatures, the magnification offset corresponding to each zoom motor position offset is determined based on the correspondence between zoom motor position and magnification.
[0260] The correspondence between temperature and magnification offset describes the magnification offset corresponding to different temperature values. For example, at temperature B, the magnification offset is -0.1x. This magnification offset can then be compensated to the desired magnification. Assuming the user requires 6x magnification, and the phone detects temperature B via its temperature sensor, the compensated magnification = 6x - (-0.1x) = 6.1x. Finally, based on the correspondence between magnification and zoom motor position, the zoom motor position corresponding to 6.1x is located, and the zoom motor is moved to that position to magnify the magnification to 6x.
[0261] (2) Attitude. Attitude refers to the angle between the central axis of the optical continuous zoom lens and the vertical line.
[0262] Optical continuous zoom lenses experience variations in error due to the lens's central axis deviating from the direction of gravity under different orientations. These errors affect the position of the zoom motor in the optical continuous zoom lens. To improve zoom accuracy, the correspondence between orientation and zoom motor position offset can be calibrated, and the zoom motor position can be compensated based on this calibrated correspondence.
[0263] During the specific calibration, it is assumed that the zoom motor position offset is the same at the same attitude under different magnifications. Therefore, by calibrating the correspondence between attitude and zoom motor offset at one magnification, the correspondence between attitude and zoom motor offset at all magnifications can be obtained.
[0264] Specifically, a magnification is first determined, then the zoom motor position corresponding to different postures at that magnification is recorded, and the zoom motor position offset is obtained based on the difference between the recorded zoom motor position and the zoom motor reference position at that magnification.
[0265] In some embodiments, the zoom motor position offset in three postures—horizontal, up, and down—can be calibrated, and then the zoom motor position offset in other postures can be calculated based on the zoom motor position offset in these three postures.
[0266] For example, the downward attitude, upward attitude, and horizontal attitude are respectively as follows: Figures 9A to 9C As shown. See also Figure 9A The diagram shows a mobile phone in a downward orientation. The mobile phone 91 includes an optical continuous zoom lens 92. In this orientation, the optical continuous zoom lens 92 is facing downwards, and the angle between the lens's central axis and the direction of gravity is 0°. See also... Figure 9B The diagram shows a mobile phone in an upward orientation, with the optical continuous zoom lens 92 of the phone 91 pointing downwards. The angle between the lens's central axis and the direction of gravity is 0° or 180°. See also... Figure 9C The diagram shows the horizontal orientation of the mobile phone. The central axis of the optical continuous zoom lens 92 of the mobile phone 91 is perpendicular to the direction of gravity, and the angle between the two is 90°.
[0267] First, let the phone 91 be in such a state Figure 9A The lens is zoomed to 6x magnification by driving the zoom motor, and the position of the zoom motor at this point is recorded. Then, based on the reference position of the zoom motor at 6x magnification, the zoom motor offset for the downward orientation is calculated. For example, if the code value of the zoom motor reference position at 6x magnification is 8000, and the code value of the recorded zoom motor position is 8003, then the zoom motor offset for the downward orientation is 3.
[0268] Then let the phone 91 be in such a state Figure 9BThe image shows an upward orientation, and the zoom motor is driven to zoom to 6x, with the zoom motor position recorded at this point. Then, based on the zoom motor reference position at 6x magnification, the zoom motor offset for the upward orientation is calculated. For example, if the code value of the zoom motor reference position at 6x magnification is 8000, and the recorded code value of the zoom motor position is 7997, then the zoom motor offset for the upward orientation is -3.
[0269] Next, put the phone 91 in such a state. Figure 9C The image shows the orientation, and the zoom motor is driven to zoom to 6x, with the zoom motor position recorded at this point. Then, based on the zoom motor reference position at 6x magnification, the zoom motor offset for the upward orientation is calculated. For example, if the code value of the actual zoom motor position at 6x magnification is 8000, and the recorded code value of the zoom motor position is 8000, then the zoom motor offset for the horizontal orientation is 0.
[0270] Finally, based on the zoom motor offset in the upward, downward, and horizontal orientations, the zoom motor offset in other orientations is calculated using trigonometric functions.
[0271] For example, see Figures 9D to 9E The diagram shows the calculation of zoom motor offset for other postures, such as... Figure 9D As shown, at this moment, the angle between the lens's central axis and the direction of gravity is a°. The downward offset is known, with an angle of a°. Based on trigonometric relationships, the zoom motor position offset in the current orientation is calculated.
[0272] Similarly, such as Figure 9E As shown, the angle between the lens's central axis and the direction of gravity is b°. The upward offset is known, with an angle of b°. Based on trigonometric relationships, the zoom motor position offset in the current orientation is calculated.
[0273] Understandably, during the calibration phase, in addition to measurement... Figures 9A to 9C The zoom motor position offset shown in the mobile phone posture can also be measured and recorded in other postures, such as zoom motor position offset at tilt angles of 30°, 45°, and 60°.
[0274] After obtaining the zoom motor position offsets under various attitudes, these data can be processed to obtain the attitude-zoom motor position offset variation curve. It should be noted that in other embodiments, the correspondence between attitude and zoom motor offset can also be converted into a correspondence between attitude and magnification offset. Specifically, after obtaining the zoom motor position offsets for different attitudes, the magnification offset corresponding to each zoom motor position offset is determined based on the correspondence between zoom motor position and magnification.
[0275] It is worth noting that during the calibration phase, only the zoom motor position offset in the three attitudes of horizontal, upward, and downward can be calibrated. Then, in the compensation algorithm during the application phase, the zoom motor position offset corresponding to the detected current attitude is calculated based on the zoom motor position offset in the three attitudes of horizontal, upward, and downward.
[0276] (3) Focusing distance.
[0277] Optical continuous zoom lenses can continuously adjust the lens's focal length and magnification, while the focusing module also adjusts its focus. The movement of the focusing module slightly alters the lens's magnification, resulting in a discrepancy between the desired and actual magnification. For example, if the target magnification is 6x, the phone drives the zoom motor to the 6x position, and the focusing module moves within the focusing range to sharpen the captured image. This movement slightly changes the magnification. Suppose the magnification changes from 6x to 5.8x after focusing. Thus, the user needs 6x magnification, but the movement of the focusing module causes the magnification to become 5.8x, resulting in a mismatch between the final and desired magnification.
[0278] To improve zoom accuracy, the correspondence between object distance, focus motor position, and FOV change can be pre-calibrated, and the zoom motor position can be compensated based on this calibration. During calibration, it is assumed that the FOV change is the same at the same object distance for different magnifications. Therefore, by calibrating the correspondence between object distance, focus motor position, and FOV change at one magnification, the correspondence between object distance, focus motor position, and FOV change at all magnifications can be obtained.
[0279] Specifically, first determine a magnification, then record the focusing motor position and FOV corresponding to different object distances at that magnification, and obtain the FOV change based on the recorded FOV and FOV reference value.
[0280] For example, see Figure 10The calibration diagrams shown are for different object distances. The mobile phone 101 includes an optical continuous zoom lens 102, and the distances (i.e., object distances) between the photographed object 103 and the optical continuous zoom lens 102 are l1 and l2, respectively.
[0281] The phone 101 zooms to 6x magnification by driving the zoom motor. Then, at an object distance of l1, it records the position of the zoom motor before focusing and the actual field of view (FOV) after focusing. At an object distance of l2, it records the position of the zoom motor before focusing and the actual FOV after focusing.
[0282] Then, based on the recorded actual FOV and FOV reference value, the FOV change at each object distance is obtained. The FOV reference value can be obtained by determining the magnification. For example, if the determined magnification is 2x, then the FOV reference value is the FOV corresponding to 2x.
[0283] Similarly, the position of the focusing motor and the field of view (FOV) are measured at different selected object distances. Then, based on the recorded changes in the position of the focusing motor and the size of the FOV at different object distances, a correspondence between the object distance, motor position, and FOV change is established.
[0284] In subsequent applications, the electronic device 100 can detect the current object distance using a distance sensor, determine the FOV change based on the current object distance and the current focus motor position, convert the FOV change into a magnification change, and finally determine the corresponding zoom motor position change based on the correlation between magnification and zoom motor position. This zoom motor position change is then used to compensate for the zoom motor position.
[0285] For example, when the magnification change is +Cx, the change in the code value of the zoom motor position is determined to be +D based on the curve between the magnification and the zoom motor position.
[0286] It should be noted that the specific values mentioned in the examples above are merely illustrative.
[0287] 2. Application stage.
[0288] After calibration, the calibration results can be stored in electronic device 100. During application, electronic device 100 can read the calibration results to achieve fast and accurate optical continuous zoom.
[0289] See Figure 11 The illustrated flowchart of an optical continuous zoom method includes the following steps:
[0290] Step S1101: Electronic device 100 acquires the target magnification.
[0291] It should be noted that the target magnification refers to the desired magnification. For example, if a user wants to magnify to 6x, the magnification input to the electronic device 100 via touch operation is 6x.
[0292] The target magnification can be input by the user or determined by the application itself; there are no restrictions on how the target magnification is obtained.
[0293] For example, see Figure 12A The diagram illustrates user-input magnification. The camera interface of mobile phone 121 includes a viewfinder 122, which includes an adjustment bar 123 for adjusting magnification. The user can increase or decrease the magnification by dragging the controls 124 on the adjustment bar 123 up or down. The bottom of the adjustment bar 123 is wide-angle, and the top has a magnification of 30x. Figure 12A In the current case, the magnification of the phone 121 is 1.2x. If the user wants to increase the magnification, they can drag the control 124 upwards to the corresponding magnification value. If they want to decrease the magnification, they can drag the control 124 downwards to the corresponding magnification value.
[0294] The mobile phone 121 responds to the touch operation input by the user at the adjustment bar 123 and obtains the target magnification specified by the user.
[0295] In addition to users can Figure 12A The magnification is specified as shown. You can also increase or decrease the magnification by pinching your finger inwards or outwards within the viewfinder. For example, see... Figure 12B Another illustration shows the user input magnification, where the user increases the magnification by pinching their finger outward within the viewfinder 122.
[0296] This application does not limit the method by which the electronic device 100 obtains the target magnification.
[0297] Step S1102: The electronic device 100 determines the target position corresponding to the target magnification based on the correspondence between the magnification and the position of the zoom motor.
[0298] In some embodiments, after obtaining the target magnification, the electronic device 100 can read the pre-stored correspondence between the magnification and the zoom motor position, and based on the correspondence, find the position corresponding to the target magnification and use the position corresponding to the target magnification as the target position.
[0299] For example, the correspondence between magnification and zoom motor position can be as follows: Figure 8As shown, if the user inputs a target magnification of 6x, the code value of the zoom motor position corresponding to 6x can be found to be 8000. The target position is then the position corresponding to code value 8000. Electronic device 100 drives the zoom motor to move to the position with code value 8000 to magnify the magnification to 6x. If the user inputs a target magnification of 7x, the code value of the zoom motor position corresponding to 7x can be found to be 10000. The target position is then the position corresponding to code value 10000. Electronic device 100 drives the zoom motor to move to the position with code value 10000 to magnify the magnification to 7x.
[0300] However, due to factors such as temperature, orientation, and focusing distance, the zoom accuracy of this method is relatively low.
[0301] To improve zoom accuracy, in some embodiments, the influence of any one or any combination of factors such as temperature, attitude, and focusing distance on the accuracy of optical continuous zoom can be considered, and the position of the zoom motor can be compensated based on the calibration results of each factor.
[0302] At this point, based on the correspondence between magnification and zoom motor position, the zoom motor position corresponding to the target magnification is found. Then, using the calibration results corresponding to each factor, the zoom motor position corresponding to the found target magnification is compensated.
[0303] For example, the correspondence between magnification and zoom motor position can be as follows: Figure 8 As shown, if the user inputs a target magnification of 6x, the code value of the zoom motor position corresponding to 6x can be found to be 8000.
[0304] Then, the electronic device 100 acquires the current temperature from the temperature sensor, the current attitude from the gyroscope, and the current object distance from the distance sensor. Based on the pre-calibrated correspondence between temperature and zoom motor position offset, it determines the zoom motor position offset at the current temperature as +3, the zoom motor position offset at the current attitude as -2, and the change in FOV between the object distance, motor position, and FOV as +1. At this point, the total zoom motor position offset from these three factors = +3 - 2 + 1 = +2.
[0305] Finally, subtracting the zoom motor position 8000 corresponding to 6x from the total offset of the zoom motor position + 2, we obtain the compensated zoom motor position as 7998. At this point, the target position corresponding to the target magnification is the compensated zoom motor position, i.e., 7998. Electronic device 100 then drives the zoom motor to move to the position corresponding to the code value 7998 to magnify the magnification to 6x.
[0306] It should be noted that when only one or two factors are considered, the total offset of the zoom motor position is the zoom motor position offset of any one factor, or the sum of the zoom motor position offsets of any two factors.
[0307] For example, based on the example above, considering only attitude, electronic device 100 obtains the current attitude from the gyroscope feedback and determines the zoom motor position offset as -2 according to the pre-calibrated correspondence between attitude and zoom motor position offset. Finally, the zoom motor position 8000 found according to the target magnification is subtracted from the zoom motor position offset -2 to obtain the code value of the target position 8002.
[0308] When only temperature is considered, the electronic device 100 obtains the current temperature fed back by the temperature sensor. Based on the pre-calibrated correspondence between the temperature and the zoom motor position offset, it determines that the zoom motor position offset at the current temperature is +3. Finally, it subtracts the zoom motor position 8000 found according to the target magnification from the zoom motor position offset +3 to obtain the code value of the target position 7997.
[0309] When only the object distance is considered, the electronic device 100 obtains the current object distance fed back by the distance sensor and the current position of the focusing motor. Based on the correspondence between the object distance, the position of the focusing motor and the change in FOV, the zoom motor position offset under the current object distance and the current focusing motor position is determined to be +1. Finally, the zoom motor position 8000 found according to the target magnification is subtracted from the zoom motor position offset +1 to obtain the coed value of the target position as 7999.
[0310] When considering both temperature and attitude, the electronic device 100 acquires the current temperature from the temperature sensor and the current object distance from the distance sensor, respectively, and determines the zoom motor position offset at the current temperature to be +3, and the zoom motor position offset at the current attitude to be -2. At this point, the total zoom motor position offset = +3 - 2 = +1. Finally, the zoom motor position 8000 found based on the target magnification is subtracted from the total zoom motor position offset +1, resulting in the target position's code value of 7999.
[0311] Similarly, considering both temperature and object distance, the total offset of the zoom motor position = +3 + 1 = +4. The code value of the target position corresponding to the target magnification = 8000 - 4 = 7996.
[0312] When considering both attitude and object distance, the total offset of the zoom motor position = -2 + 1 = -1. The code value of the target position corresponding to the target magnification = 8000 + 1 = 8001.
[0313] It should be noted that the specific values shown in the examples above are merely illustrative.
[0314] In other words, in practical applications, the electronic device 100 can consider the influence of any one or any combination of temperature, attitude, and object distance. After finding the position corresponding to the target magnification based on the correspondence between the zoom motor position and the magnification, it adds the position to the total offset to obtain the final target position. Alternatively, it can disregard the influence of factors such as temperature, attitude, and object distance, and directly use the position corresponding to the target magnification as the target position based on the correspondence between the zoom motor position and the magnification.
[0315] In comparison, the former has higher zoom accuracy because it takes into account the influence of any one or any combination of temperature, attitude, and object distance, and uses the position offset of the zoom motor for compensation.
[0316] Understandably, when considering any one or any combination of temperature, attitude, and object distance, the electronic device 100 can obtain the necessary information through sensors when it determines that zooming is required. For example, when considering temperature and attitude, when the phone determines that zooming is required, it obtains the current temperature fed back by the temperature sensor, obtains the current attitude fed back by the gyroscope, and determines the total offset of the zoom motor position based on the current temperature and current attitude, and compensates for the zoom motor position based on this total offset.
[0317] In step S1103, the electronic device 100 drives the zoom motor to move to the target position to obtain the desired target magnification.
[0318] In practical applications, after determining the target position corresponding to the target magnification, the electronic device 100 can drive the zoom motor to move to the target position through the corresponding drive current in order to obtain the required target magnification.
[0319] Understandably, after the electronic device 100 drives the zoom motor to move to the target position, it can display an image corresponding to the target magnification on the screen.
[0320] For example, see Figure 13The diagram illustrates the shooting process. The main interface 132 on the phone 131 includes applications such as camera 133, calendar, settings, and gallery. When the user wants to take a photo, they can tap camera 133 to open the camera interface.
[0321] In response to a tap on the camera 133, the mobile phone 131 displays a camera interface 134 and shows an image at the current magnification in the viewfinder. At this time, the current magnification is 1x. The camera interface 134 includes an adjustment bar 135 for adjusting the magnification, and controls 136 on the adjustment bar 135 display the current magnification of 1x.
[0322] To zoom in to 6x, meaning the target magnification is 6x, the user can adjust the position of control 136 on the adjustment bar 135 by dragging the control 136 with their finger, thereby changing the magnification. For example... Figure 13 As shown, the user drags the control upwards from 136 to 6x.
[0323] In response to the user's operation of pulling up the control 136, the mobile phone 131 obtains the required magnification and, based on the correspondence between the position of the zoom motor and the magnification, drives the zoom motor to move to the position corresponding to the required magnification and displays the image with the corresponding magnification in the viewfinder.
[0324] like Figure 13 As shown, when the user drags the control 136 to 6x, the mobile phone 131 determines the target position corresponding to 6x based on the correspondence between the zoom motor position and the magnification, and drives the zoom motor to move to the target position corresponding to 6x to display the image at 6x.
[0325] It should be noted that the driving current for the zoom motor will vary depending on its position. When the user pulls the control 136 on the adjustment bar 135, the magnification will change accordingly, and the driving current for the zoom motor will also change accordingly.
[0326] In practical applications, after determining the target magnification, the application layer of electronic device 100 transmits the target magnification to the continuous zoom algorithm. The application layer can determine the target magnification autonomously or through user input via human-computer interaction. After receiving the transmitted target magnification, the continuous zoom algorithm, based on the correspondence between the zoom motor position and magnification established during the calibration phase, finds the code value of the zoom motor position corresponding to the target magnification. Then, the continuous zoom algorithm can transmit the code value of the zoom motor position to the drive layer to activate the zoom motor drive. The zoom motor drive uses the corresponding drive current to push the zoom motor to the position corresponding to the code value and feeds back the current zoom motor position to the continuous zoom algorithm. Typically, after the zoom motor is moved to a certain position, its position can be read and recorded in real time by a sensor.
[0327] It is understood that in other embodiments, in addition to the continuous zoom algorithm, a compensation algorithm may also be included. The compensation algorithm is used to compensate for the zoom motor position based on factors such as temperature, attitude, and object distance to improve zoom accuracy. In this case, while the continuous zoom algorithm is finding the code value of the zoom motor position corresponding to the target magnification based on the correspondence between the zoom motor position and the magnification, the compensation algorithm will also determine the total offset of the zoom motor position based on the acquired information. For example, the compensation algorithm determines the offset corresponding to the current temperature based on the current temperature fed back by the temperature sensor, and determines the offset corresponding to the current attitude based on the current attitude fed back by the attitude sensor, and then obtains the total offset based on these two offsets. After finding the zoom motor code value corresponding to the target magnification, this code value is subtracted from the total offset obtained by the compensation algorithm to obtain the final code value. This final code value is then sent to the drive layer to drive the zoom motor to move to the position corresponding to the final code value.
[0328] It should also be noted that, in addition to compensating for the zoom motor position, the zoom motor position compensation value can also be converted into a magnification compensation value. In this case, after obtaining the target magnification from the application layer, the continuous zoom algorithm can use the magnification compensation value to compensate for the target magnification, obtaining the final magnification. Finally, based on the correspondence between the magnification and the zoom motor position, the zoom motor position code value corresponding to the final magnification is found.
[0329] At this point, during the calibration phase, the calibration results of each factor can be converted into a correspondence with the magnification offset. For example, for the factor of temperature, after obtaining the correspondence between temperature and zoom motor position offset, the magnification offset corresponding to each zoom motor position offset can be determined based on the relationship between zoom motor position and magnification, and then the correspondence between temperature and magnification offset can be obtained.
[0330] As can be seen from the above, based on the calibration results obtained in the calibration stage, the electronic device 100 can quickly and accurately drive the zoom motor to move to the position corresponding to the required magnification, so as to obtain the required magnification, realize continuous optical zoom, and achieve fast zoom speed and high zoom accuracy.
[0331] The electronic device provided in this application embodiment may include a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the method as described in any of the above method embodiments.
[0332] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps described in the various method embodiments above.
[0333] This application provides a computer program product that, when run on an electronic device, enables the electronic device to perform the steps described in the various method embodiments above.
[0334] This application also provides a chip system, which includes a processor coupled to a memory. The processor executes a computer program stored in the memory to implement the methods described in the above embodiments. The chip system may be a single chip or a chip module composed of multiple chips.
[0335] In the above embodiments, the descriptions of each embodiment have their own emphasis. Parts not detailed or described in a particular embodiment can be referred to in the relevant descriptions of other embodiments. It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application. Furthermore, in the description of this application specification and the appended claims, the terms "first," "second," "third," etc., are only used to distinguish descriptions and should not be construed as indicating or implying relative importance. References to "one embodiment" or "some embodiments" in this application specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in yet other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized.
[0336] Finally, it should be noted that the above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. An optical continuous zoom method, characterized in that, Applied to electronic devices, the method includes: Obtain the target magnification; Based on a pre-stored first correspondence, the target position of the zoom motor corresponding to the target magnification is determined, where the first correspondence is the correspondence between the magnification and the position of the zoom motor. Drive the zoom motor to move to the target position; The electronic device includes an optical continuous zoom module; the zoom component in the optical continuous zoom module moves with the movement of the zoom motor to change the focal length of the optical continuous zoom module. The method further includes: Acquire target information, which includes at least one of the following: the temperature of the optical continuous zoom module, the attitude of the optical continuous zoom module, and the object distance; Determine the zoom motor position offset corresponding to each type of information in the target information; Add up the zoom motor position offset corresponding to each type of information in the target information to obtain the total offset; The step of determining the target position corresponding to the target magnification based on a pre-stored first correspondence includes: Based on the first correspondence, locate the zoom motor position corresponding to the target magnification. The target position is obtained based on the zoom motor position corresponding to the target magnification and the total offset.
2. The method according to claim 1, characterized in that, The acquisition of target information includes at least one of the following: The temperature of the optical continuous zoom module is obtained by acquiring the temperature information fed back by the temperature sensor inside the optical continuous zoom module. The attitude of the optical continuous zoom module is obtained by acquiring the attitude information fed back by the attitude sensor. The object distance is obtained by acquiring the distance information fed back by the distance sensor.
3. The method according to claim 1, characterized in that, When the target information includes the temperature of the optical continuous zoom module, determine the zoom motor position offset corresponding to each type of information in the target information, including: Based on a pre-stored second correspondence, the zoom motor position offset corresponding to the temperature is determined. The second correspondence is the relationship between temperature and zoom motor position offset.
4. The method according to claim 1, characterized in that, When the target information includes the attitude of the optical continuous zoom module, determine the zoom motor position offset corresponding to each type of information in the target information, including: Based on a pre-stored third correspondence, the zoom motor position offset corresponding to the posture is determined. The third correspondence is the correspondence between the posture and the zoom motor position offset.
5. The method according to claim 1, characterized in that, When the target information includes the object distance, determine the zoom motor position offset corresponding to each type of information in the target information, including: Based on the pre-stored fourth correspondence, the change in field of view corresponding to the object distance is determined. The fourth correspondence is the correspondence between the object distance, the position of the focusing motor, and the change in field of view. The change in field of view is converted into a change in magnification. Based on the first correspondence, determine the change in zoom motor position corresponding to the change in magnification; Based on the change in the position of the zoom motor, the position offset of the zoom motor corresponding to the object distance is obtained.
6. The method according to claim 1, characterized in that, The step of determining the target position corresponding to the target magnification based on a pre-stored first correspondence includes: Based on the first correspondence, locate the zoom motor position corresponding to the target magnification. The zoom motor position corresponding to the target magnification is taken as the target position.
7. The method according to any one of claims 1 to 6, characterized in that, The process of obtaining the target magnification includes: Detects the first action input by the user within the viewfinder; In response to the first operation, the target magnification is obtained.
8. The method according to claim 7, characterized in that, The first operation is a sliding operation of the magnification adjustment control within the viewfinder.
9. The method according to claim 7, characterized in that, After driving the zoom motor to move to the target position, the method further includes: An image with a magnification of the target magnification is displayed within the viewfinder.
10. The method according to claim 1, characterized in that, The first correspondence is stored in the optical continuous zoom module.
11. A calibration method, characterized in that, The method includes: Obtain a set of test position points, the set of test position points including at least one test position point, the test position point being a position point selected from the travel range of the zoom motor, the zoom motor being used to change the focal length of the optical continuous zoom module; For each of the test locations, the zoom motor is driven to move to the test location, and the test table image of the current test location is captured by the optical continuous zoom module. The magnification corresponding to the test location is then obtained based on the test table image. Based on each of the test locations and the corresponding magnification, the correspondence between the magnification and the zoom motor position is obtained; The step of obtaining the magnification corresponding to the test location point based on the test table image includes: Determine the pixel distance between two key points on the test table image; The magnification of the test location is obtained based on the pixel distance and the actual distance between the two key points.
12. The method according to claim 11, characterized in that, Determining the pixel distance between two key points on the test table image includes: Extract the center coordinates of two dots from the test table image; The distance between the coordinates of the two center points is taken as the pixel distance between the two points.
13. The method according to claim 12, characterized in that, Extracting the center coordinates of two dots from the test table image includes: Using the position of the optical center of the optical continuous zoom module in the test table image as the center point, a region of the test table image with a preset ratio field of view is selected as the region of interest. Extract the center coordinates of the two points from the region of interest.
14. The method according to claim 11, characterized in that, Based on each of the measured locations and the corresponding magnification, the correspondence between the magnification and the zoom motor position is obtained, including: Based on the magnification corresponding to each of the test locations and the code value of each of the test locations, a curve of change between magnification and zoom motor position is obtained by curve fitting.
15. The method according to claim 14, characterized in that, After obtaining the correspondence between magnification and zoom motor position, the method further includes: The correspondence between magnification and zoom motor position is stored in the optical continuous zoom module.
16. The method according to claim 11, characterized in that, The method further includes: Drive the zoom motor to move to the position corresponding to the first magnification; Record the position of the zoom motor of the optical continuous zoom module at each test temperature; Based on the zoom motor position at each of the measured temperatures and the first zoom motor reference position, the zoom motor position offset at each of the measured temperatures is obtained, where the first zoom motor reference position is the zoom motor position corresponding to the first magnification. Based on each of the measured temperatures and the zoom motor position offset at each measured temperature, a correspondence between the temperature and the zoom motor position offset is obtained.
17. The method according to claim 11, characterized in that, The method further includes: Drive the zoom motor to move to the position corresponding to the second magnification; Record the position of the zoom motor of the optical continuous zoom module under each test posture; Based on the zoom motor position and the second zoom motor reference position under each of the tested postures, the zoom motor position offset under each of the tested postures is obtained, where the second zoom motor reference position is the zoom motor position corresponding to the second magnification. Based on each of the tested postures and the zoom motor position offset under each tested posture, the correspondence between the posture and the zoom motor position offset is obtained.
18. The method according to claim 11, characterized in that, The method further includes: Drive the zoom motor to move to the position corresponding to the third magnification; Record the field of view of the optical continuous zoom module at each object distance to be measured; Based on the field of view and the field of view reference value for each object distance to be measured, the change in field of view corresponding to each object distance to be measured is obtained, wherein the field of view reference value is the field of view corresponding to the third magnification. Based on the change in field of view for each measured object distance, the position of the focusing motor corresponding to each measured object distance, and the measured object distance, the correspondence between the object distance, the position of the focusing motor, and the change in field of view is obtained.
19. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method as described in any one of claims 1 to 10 or 11 to 18.
20. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 10 or 11 to 18.
Citation Information
Patent Citations
Zoom tracking curve correction method and device
CN105554387A
Zoom camera focusing method and camera
CN105676563A