CN113973200A - Zoom magnification calibration method and device, electronic equipment and storage medium - Google Patents

Zoom magnification calibration method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113973200A
CN113973200A CN202010720582.6A CN202010720582A CN113973200A CN 113973200 A CN113973200 A CN 113973200A CN 202010720582 A CN202010720582 A CN 202010720582A CN 113973200 A CN113973200 A CN 113973200A
Authority
CN
China
Prior art keywords
zoom magnification
image
driving mechanism
zoom
theoretical
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010720582.6A
Other languages
Chinese (zh)
Inventor
胡友华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanchang OFilm Optoelectronics Technology Co Ltd
Original Assignee
Nanchang OFilm Optoelectronics Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nanchang OFilm Optoelectronics Technology Co Ltd filed Critical Nanchang OFilm Optoelectronics Technology Co Ltd
Priority to CN202010720582.6A priority Critical patent/CN113973200A/en
Publication of CN113973200A publication Critical patent/CN113973200A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N17/00Diagnosis, testing or measuring for television systems or their details
    • H04N17/002Diagnosis, testing or measuring for television systems or their details for television cameras
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/67Focus control based on electronic image sensor signals

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • General Health & Medical Sciences (AREA)
  • Studio Devices (AREA)
  • Lens Barrels (AREA)

Abstract

The embodiment of the application discloses a method and a device for calibrating zoom magnification, electronic equipment and a storage medium. The method can comprise the following steps: controlling a zoom driving mechanism of the imaging device to move according to a driving mechanism control parameter corresponding to a theoretical zoom magnification so as to move a lens of the imaging device to a first position corresponding to the theoretical zoom magnification through the zoom driving mechanism; acquiring a first image acquired by the imaging equipment, wherein the first image is obtained by moving a lens of the imaging equipment to a first position and shooting a preset graphic card; calculating the size parameter of the preset graphic card in the first image; calculating actual zoom magnification corresponding to the control parameter of the driving mechanism according to the size parameter; and obtaining a calibration result according to the actual zoom magnification and the control parameter of the driving mechanism. The method and the device for calibrating the zoom magnification, the electronic equipment and the storage medium can calibrate the zoom magnification of the imaging equipment, and achieve a zoom effect with high accuracy.

Description

Zoom magnification calibration method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of imaging device technologies, and in particular, to a method and an apparatus for calibrating zoom magnification, an electronic device, and a storage medium.
Background
Optical Zoom (Optical Zoom) refers to an imaging device (e.g., a camera image, etc.) that achieves zooming by means of an Optical lens structure, by changing the position between the lens, the object, and the focal point three parties. At present, imaging equipment with optical zooming is provided with fixed zooming magnification when the imaging equipment leaves a factory, and in the actual use process, images acquired after zooming are carried out through the set fixed zooming magnification, the situation that the actual zooming magnification is not matched with the fixed zooming magnification can occur, and the zooming effect is relatively inaccurate.
Disclosure of Invention
The embodiment of the application discloses a method and a device for calibrating zoom magnification, electronic equipment and a storage medium, which can calibrate the zoom magnification of imaging equipment and realize a zoom effect with higher accuracy.
The embodiment of the application discloses a method for calibrating zoom magnification, which comprises the following steps: controlling a zoom driving mechanism of an imaging device to move according to a driving mechanism control parameter corresponding to a theoretical zoom magnification so as to move a lens of the imaging device to a first position corresponding to the theoretical zoom magnification through the zoom driving mechanism; acquiring a first image acquired by the imaging equipment, wherein the first image is obtained by shooting a preset graphic card when a lens of the imaging equipment moves to the first position; calculating the size parameter of the preset graphic card in the first image; calculating actual zoom magnification corresponding to the control parameter of the driving mechanism according to the size parameter; and obtaining a calibration result according to the actual zoom magnification and the control parameter of the driving mechanism.
The zoom drive mechanism of the imaging device is controlled to move according to the drive mechanism control parameter corresponding to the theoretical zoom magnification, the lens of the imaging device is moved to the first position corresponding to the theoretical zoom magnification, the first image obtained by shooting the preset graphic card is obtained, the actual zoom magnification can be determined according to the size parameter of the preset graphic card in the first image, the actual zoom magnification corresponding to the drive mechanism control parameter is calibrated, the condition that the actual zoom magnification is not matched with the required zoom magnification during shooting can be prevented, and the zoom effect with high accuracy can be achieved.
In one embodiment, before the controlling the movement of the zoom driving mechanism of the imaging apparatus according to the driving mechanism control parameter corresponding to the theoretical zoom magnification, the method further comprises: acquiring theoretical design data corresponding to the imaging equipment, wherein the theoretical design data comprises one or more theoretical zoom magnifications and drive mechanism control parameters corresponding to the theoretical zoom magnifications; the method for controlling the movement of the zooming driving mechanism of the imaging equipment according to the driving mechanism control parameter corresponding to the theoretical zooming magnification comprises the following steps: determining the theoretical zoom magnification to be calibrated at this time according to the theoretical design data; and issuing the control parameter of the driving mechanism corresponding to the theoretical zoom magnification to be calibrated to a driving chip of the zoom driving mechanism, and controlling the zoom driving mechanism to move according to the issued control parameter of the driving mechanism through the driving chip.
In the embodiment of the application, a plurality of theoretical zoom magnifications can be calibrated, the continuous zoom magnification of the imaging equipment can be calibrated, and the accuracy of the zoom effect is improved.
In one embodiment, the preset graphics card comprises a pattern of one or more preset shapes; the calculating the size parameter of the preset graphic card in the first image comprises: calculating a first size occupied by an edge of the pattern in the first image; acquiring a second size occupied by an image edge corresponding to the edge of the pattern and the first image, wherein the image edge corresponding to the edge of the pattern and the first image refers to an edge parallel to the edge of the pattern or an edge with an included angle smaller than an angle threshold value in the first image; the calculating the actual zoom magnification corresponding to the control parameter of the driving mechanism according to the size parameter comprises the following steps: calculating a first ratio between the first dimension and the second dimension; acquiring a first physical length of the edge of the pattern and a second physical length of the edge of the preset graphic card corresponding to the edge of the pattern, wherein the edge of the preset graphic card corresponding to the edge of the pattern refers to an edge of the preset graphic card which is parallel to the edge of the pattern or has an included angle smaller than an angle threshold; calculating a second ratio between the first physical length and the second physical length; and calculating the ratio between the first ratio and the second ratio to obtain the actual zoom magnification corresponding to the theoretical zoom magnification to be calibrated at this time.
In the embodiment of the application, the actual zoom magnification is determined by utilizing the proportion of the number of pixels occupied by the edge of the pattern in the edge of the image and the proportion of the edge length of the pattern in the actual image in the preset image card, so that the accuracy of calibration can be improved.
In one embodiment, the preset graphic card comprises a plurality of patterns with preset shapes, and the patterns are arranged at certain intervals; the calculating the size parameter of the preset graphic card in the first image comprises: calculating the image distance of two adjacently arranged patterns in the first image; acquiring a third size occupied by image edges corresponding to the first image and the two adjacent patterns, wherein the image edges corresponding to the first image and the two adjacent patterns refer to edges parallel to the arrangement direction of the two patterns in the first image; the calculating the actual zoom magnification corresponding to the control parameter of the driving mechanism according to the size parameter comprises the following steps: calculating a third ratio between the image distance and a third dimension; acquiring a physical distance between the two adjacent patterns in the preset graphic card and a third physical length of the preset graphic card and edges corresponding to the two adjacent patterns, wherein the edges corresponding to the two adjacent patterns in the preset graphic card refer to edges parallel to the arrangement direction of the two patterns in the preset graphic card; calculating a fourth ratio between the physical distance and the third physical length; and calculating the ratio between the third ratio and the fourth ratio to obtain the actual zoom magnification corresponding to the theoretical zoom magnification to be calibrated at this time.
In the embodiment of the application, the actual zoom magnification is determined by utilizing the proportion of the number of pixels occupied by the distance between the adjacent arranged patterns to the edge of the image and the proportion of the actual physical distance between the adjacent arranged patterns to the side length of the preset graphic card in practice, so that the accuracy of calibration can be improved.
In one embodiment, after the calculating the size parameter of the preset graphic card in the image, the method further comprises: if the theoretical zoom magnification to be calibrated at this time is not the maximum theoretical zoom magnification in the theoretical design data, increasing a specified zoom step length on the basis of the theoretical zoom magnification to be calibrated at this time to determine the theoretical zoom magnification to be calibrated at the next time; and taking the next theoretical zoom magnification to be calibrated as a new theoretical zoom magnification to be calibrated at this time, and executing the drive mechanism control parameter corresponding to the theoretical zoom magnification to control the zoom drive mechanism of the imaging device to move until the theoretical zoom magnification to be calibrated at this time is the maximum theoretical zoom magnification in the theoretical design data.
In the embodiment of the application, the zoom magnification range of the imaging device is divided by setting the designated zoom step length, and the theoretical zoom magnification required to be calibrated is determined again, so that the continuous zoom magnification of the imaging device can be calibrated, and the accuracy of the zoom effect is improved.
In one embodiment, the obtaining a calibration result according to the actual zoom magnification and the driving mechanism control parameter includes: acquiring a plurality of actual zooming magnifications determined according to a plurality of driving mechanism control parameters, wherein the driving mechanism control parameters correspond to the actual zooming magnifications one to one; generating a check table according to the plurality of driving mechanism control parameters and the plurality of actual zooming magnifications; and fitting according to a plurality of driving mechanism control parameters contained in the check table and corresponding actual zooming magnifications to obtain a relation curve of the driving mechanism control parameters and the actual zooming magnifications, and outputting the check table and the relation curve as a calibration result.
In the embodiment of the application, in the actual use process of the imaging device, based on the calibration table and the relationship curve, the control parameter of the driving mechanism corresponding to the required zoom magnification can be accurately found, so that the accurate zoom effect is realized.
In one embodiment, the method further comprises: acquiring a driving mechanism control parameter corresponding to the zoom magnification to be tested according to the calibration result; controlling a zoom driving mechanism of the imaging device to move according to the driving mechanism control parameter corresponding to the zoom magnification to be tested so as to move the lens of the imaging device to a second position corresponding to the zoom magnification to be tested through the zoom driving mechanism; acquiring a second image acquired by the imaging equipment, wherein the second image is obtained by moving a lens of the imaging equipment to the second position and shooting the preset graphic card; calculating the size parameter of the preset graphic card in the second image, and calculating the zoom magnification of the actual test according to the size parameter of the preset graphic card in the second image; and comparing the zoom magnification to be tested with the zoom magnification of the actual test to obtain a test result.
In the embodiment of the application, after the zoom magnification of the imaging device is calibrated, the calibration result can be further tested, so that the accuracy of the calibration result is ensured, and the accuracy of the optical zoom effect of the imaging device can be further improved.
In one embodiment, the obtaining of the driving mechanism control parameter corresponding to the zoom magnification to be tested according to the calibration result includes: when the actual zoom magnification which is the same as the zoom magnification to be tested is recorded in the check table, acquiring the drive mechanism control parameter corresponding to the same actual zoom magnification from the check table, and taking the acquired drive mechanism control parameter as the drive mechanism control parameter corresponding to the zoom magnification to be tested; and when the actual zoom magnification which is the same as the zoom magnification to be tested is not recorded in the check table, substituting the zoom magnification to be tested into the relation curve, and determining the control parameter of the driving mechanism corresponding to the zoom magnification to be tested in the relation curve.
In the embodiment of the application, the determined control parameter of the driving mechanism corresponding to the zoom magnification to be tested can be more accurate by utilizing the calibration table and the relation curve between the control parameter of the driving mechanism obtained by fitting and the actual zoom magnification, and the accuracy of the test is ensured.
In one embodiment, the comparing the zoom magnification to be tested with the zoom magnification actually tested to obtain a test result includes: calculating the error between the zoom magnification to be tested and the actual zoom magnification; if the error is smaller than a preset error threshold value, the test is passed, and if the error is not smaller than the error threshold value, the test is not passed.
In the embodiment of the application, whether the calibration result is accurate or not can be tested according to the error between the zoom magnification to be tested and the zoom magnification actually tested, so that the accuracy of the calibration result is ensured, and the accuracy of the optical zoom effect of the imaging equipment can be further improved.
In one embodiment, the predetermined graphic card is a pattern including one or more squares, the squares having a predetermined tilt angle with respect to an edge of the predetermined graphic card; after the acquiring the first image acquired by the imaging device, the method further comprises: and testing a Modulation Transfer Function (MTF) corresponding to the first image according to a hypotenuse of the square included in the first image, wherein the hypotenuse is an edge of the square with the preset inclination angle relative to the edge of the preset graphic card.
In the embodiment of the application, the MTF test and the calibration of the optical zoom magnification can be performed together, so that the test process is simplified, and the test and calibration efficiency is improved.
The embodiment of the application discloses calibrating device of magnification zooms includes: the control module is used for controlling the zoom driving mechanism of the imaging device to move according to the driving mechanism control parameter corresponding to the theoretical zoom magnification so as to move the lens of the imaging device to a first position corresponding to the theoretical zoom magnification through the zoom driving mechanism; the image acquisition module is used for acquiring a first image acquired by the imaging equipment, wherein the first image is obtained by moving a lens of the imaging equipment to the first position and shooting a preset graphic card; the size calculation module is used for calculating the size parameter of the preset graphic card in the first image; the actual magnification calculation module is used for calculating the actual zooming magnification corresponding to the control parameter of the driving mechanism according to the size parameter; and the calibration module is used for obtaining a calibration result according to the actual zoom magnification and the control parameter of the driving mechanism.
An embodiment of the present application provides an electronic device, which includes a memory and a processor, where the memory stores a computer program, and when the computer program is executed by the processor, the processor is enabled to implement the method described above.
Embodiments of the present application provide a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the method as described above.
The embodiment of the application discloses a calibrating device of zoom magnification, electronic equipment and storage medium, zoom drive mechanism motion according to the drive mechanism control parameter that theoretical zoom magnification corresponds of control imaging equipment, and acquire the camera lens of imaging equipment and move to the first position department that theoretical zoom magnification corresponds, shoot the first image that obtains to predetermineeing the picture card, can confirm the actual zoom magnification according to predetermineeing the size parameter of picture card in first image, thereby realize calibrating the actual zoom magnification that drive mechanism control parameter corresponds, can prevent the unmatched condition of actual zoom magnification and required zoom magnification when shooing, can realize the higher effect of zooming of accuracy.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
FIG. 1 is a block diagram of an electronic device in one embodiment;
FIG. 2 is a flow chart of a method for calibrating zoom magnification in one embodiment;
FIG. 3A is a diagram illustrating an embodiment of a default graphics card;
FIG. 3B is a diagram illustrating a default graphics card in accordance with another embodiment;
FIG. 4 is a flowchart of a method for calibrating zoom magnification in another embodiment;
FIG. 5A is a diagram illustrating a default graphics card in accordance with another embodiment;
FIG. 5B is a diagram illustrating a first image in one embodiment;
FIG. 5C is a schematic illustration of a first image in another embodiment;
FIG. 5D is a diagram illustrating a default graphics card in accordance with another embodiment;
FIG. 5E is a schematic illustration of a first image in another embodiment;
FIG. 5F is a diagram illustrating a default graphics card in accordance with another embodiment;
FIG. 6 is a diagram illustrating a relationship between a control parameter of a driving mechanism and an actual zoom magnification in one embodiment;
FIG. 7 is a flowchart of a method for calibrating zoom magnification in another embodiment;
fig. 8 is a block diagram of a calibration apparatus of zoom magnification in one embodiment.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It is to be noted that the terms "comprises" and "comprising" and any variations thereof in the examples and figures of the present application are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
It will be understood that, as used herein, the terms "first," "second," and the like may be used herein to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish one element from another. For example, a first client may be referred to as a second client, and similarly, a second client may be referred to as a first client, without departing from the scope of the present application. Both the first client and the second client are clients, but they are not the same client.
Fig. 1 is a block diagram of an electronic device in one embodiment. As shown in fig. 1, the electronic device may include a processor 110, a memory 130 coupled to the processor 110, and an imaging device 120 coupled to the processor 110. Memory 130 may store one or more applications that may be configured to be executed by one or more processors 110, among other things, the one or more programs configured to perform the methods as described in the various embodiments of the present application.
Processor 110 may include one or more processing cores. The processor 110 interfaces with various components throughout the electronic device 1000 using various interfaces and circuitry to perform various functions of the electronic device and process data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 130 and invoking data stored in the memory 130. Alternatively, the processor 110 may be implemented in hardware using at least one of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 110 may integrate one or more of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a modem, and the like. Wherein, the CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for rendering and drawing display content; the modem is used to handle wireless communications. It is understood that the modem may not be integrated into the processor 110, but may be implemented by a communication chip.
The Memory 130 may include a Random Access Memory (RAM) or a Read-Only Memory (Read-Only Memory). The memory 130 may be used to store instructions, programs, code, sets of codes, or sets of instructions. The memory 130 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing the various method embodiments described above, and the like. The stored data area may also store data created during use by the electronic device 1000, and the like.
Imaging device 120 may include a zoom drive mechanism 112, one or more lenses 114, and an image sensor 116. Image sensor 116 may include an array of color filters (e.g., Bayer filters), and image sensor 116 may acquire light intensity and wavelength information captured by each imaging pixel and provide a set of image data that may be processed by processor 110. The zoom driving mechanism 112 can drive the lens 114 to move, and the focal length is changed by changing the position of the lens 114, so as to achieve the effect of zooming.
In some embodiments, which may include a processor and/or microcontroller executing one or more routines (e.g., firmware), processor 110 may control imaging device 120 to acquire images according to control parameters of imaging device 120, for example, control parameters of imaging device 120 may include flash control parameters, anti-shake displacement parameters, lens 114 control parameters (e.g., focal length for focusing or zooming), and/or the like.
In the embodiment of the present application, the processor 110 may calibrate the zoom magnification of the imaging device 120. The processor 110 may obtain a theoretical zoom magnification, and control the movement of the zoom driving mechanism 112 of the imaging device 120 according to a driving mechanism control parameter corresponding to the theoretical zoom magnification, and the zoom driving mechanism 112 may push the lens 114 to move when moving, and the lens 114 may be moved to a first position corresponding to the theoretical zoom magnification. After the lens 114 is moved to the first position corresponding to the theoretical zoom magnification, the imaging device 120 may capture a preset image card through the image sensor 116 and the lens 114, capture a first image, and transmit the first image to the processor 110. After receiving the first image sent by the imaging device 120, the processor 110 may calculate a size parameter of the preset image in the first image, calculate an actual zoom magnification corresponding to a driving mechanism control parameter corresponding to the theoretical zoom magnification according to the size parameter, and obtain a calibration result of the zoom magnification of the imaging device 120 according to the driving mechanism control parameter and the actual zoom magnification, where the calibration result may include a real correspondence between the zoom magnification of the imaging device 120 and the driving mechanism control parameter.
In some embodiments, when a user needs to perform optical zoom shooting by using the imaging device 120, the processor 110 may obtain a zoom magnification ratio required by the user, and according to the obtained calibration result, may find a driving mechanism control parameter corresponding to the required zoom magnification ratio, so as to control a zoom driving mechanism in the imaging device 120 to move according to the found driving mechanism control parameter, adjust the position of the lens 114, meet a requirement that an actual zoom magnification ratio matches the required zoom magnification ratio, and enable a zoom effect with higher accuracy.
In some embodiments, the imaging device may also be a camera device that is provided separately from the electronic device, and the imaging device may not be provided on the electronic device, but may establish a connection with the electronic device in a wireless (e.g., bluetooth, infrared, etc.) or wired manner, and then perform data transmission with the electronic device.
It is understood that the electronic device may include more or less structural elements than those shown in the above structural block diagrams, for example, a power supply, a screen, a Wi-Fi (Wireless Fidelity) module, a bluetooth module, etc., and is not limited herein.
As shown in fig. 2, in an embodiment, a method for calibrating zoom magnification is provided, which is applicable to the above-mentioned electronic device, and the electronic device may be a mobile phone, a smart wearable device, a tablet Computer, a digital camera, a PC (Personal Computer), and the like, and the embodiment of the present invention is not limited thereto. The zoom magnification calibration method can comprise the following steps:
and step 210, controlling the zoom driving mechanism of the imaging device to move according to the driving mechanism control parameter corresponding to the theoretical zoom magnification, so that the lens of the imaging device is moved to a first position corresponding to the theoretical zoom magnification through the zoom driving mechanism.
In the embodiment of the present application, the zoom driving mechanism may be various types of driving mechanisms, and the driving mechanism may be a driving mechanism such as a motor, for example, a stepping motor, a linear motor, a piezoelectric motor, or the like. Wherein, the step motor uses a microminiature motor and a transmission device with small diameter and length to convert the revolution rate of the motor into linear motion; the linear motor drives the imaging device to move linearly by utilizing the electromagnetic force between the driving coil and the permanent magnet, so that the lens moves linearly; the piezoelectric motor drives a moving member to rotate or move linearly by using vibration of a piezoelectric body under the action of voltage. It will be appreciated that the type of zoom drive mechanism is not limited to the above, and may be other types.
The driving mechanism control parameter may refer to a parameter for driving the zoom driving mechanism to move, and the driving mechanism control parameter has a certain relationship with a moving distance of the lens, specifically, the driving mechanism control parameter and the moving distance of the lens may be in a positive correlation, and the larger the driving mechanism control parameter is, the larger the moving distance of the lens is pushed to be. For example, the driving mechanism control parameter may include a driving mechanism code value, which is a value of a control register of a driving chip of the zoom driving mechanism and may be used to control a movement position of the zoom driving mechanism, and the driving mechanism code value may be used to indicate a driving mechanism stroke, and optionally, the larger the driving mechanism code value, the longer the driving mechanism stroke, the larger a movement amount by which the zoom driving mechanism moves the lens. For example, for different driving mechanisms, the corresponding driving mechanism code value ranges can be corresponding to different driving mechanisms, and if there is a zoom driving mechanism, the corresponding range is 0 to 1023code, and if there is a zoom driving mechanism, the corresponding range is 0 to 1012code, etc., but the invention is not limited thereto. In some embodiments, the driving mechanism control parameter may also be other than a driving mechanism code value, for example, the driving mechanism control parameter may be a current value, a magnitude of the current value may affect a movement amount by which the zoom driving mechanism moves the lens, and optionally, the larger the current value, the larger the movement amount by which the zoom driving mechanism moves the lens may be. The specific parameters of the drive mechanism control parameters are not limited herein.
The zoom ratio of the imaging device can refer to a ratio of a focal length of the lens to a minimum focal length, and can also be used for representing the magnification ratio of pixel points in the acquired image, wherein the longer the focal length of the lens is, the closer the shooting distance of the relative shot object is, and the larger the shot object contained in the acquired image is. In some embodiments, when the imaging device performs the module design, for each zoom magnification, there may be a theoretical design value of the driving mechanism control parameter of the zoom driving mechanism corresponding thereto, for example, for 1.2 magnifications, the corresponding theoretical design driving mechanism control parameter may be 290code, and for 1.5 magnifications, the corresponding theoretical design driving mechanism control parameter may be 523code, but is not limited thereto. In the actual shooting process of the imaging device, after the zoom driving mechanism is driven to move by the driving mechanism control parameter of the theoretical design corresponding to the magnification, the actual magnification of the shot image may be inconsistent with the theoretical zoom magnification corresponding to the driving mechanism control parameter, for example, theoretically, the driving mechanism control parameter corresponding to 1.2 magnification is 290code, and after the zoom driving mechanism is controlled to move according to 290code, the acquired image is an image with 1.1 magnification, which is different from the theoretical 1.2 magnification, so that the zoom magnification of the imaging device needs to be calibrated.
The electronic device may obtain a theoretical zoom magnification to be calibrated of the imaging device, where the theoretical zoom magnification may be a zoom magnification set by the imaging device during design, or a zoom magnification that needs to be calibrated according to actual requirements, and the selected zoom magnification does not necessarily belong to the zoom magnification set by the imaging device during design. For example, the zoom magnification set at the time of design of the imaging apparatus is 1 magnification, 1.5 magnification, 2 magnification, and the theoretical zoom magnification to be calibrated may be one or more of the above 3 zoom magnifications, or may be a zoom magnification other than the above 3 zoom magnifications, such as 1.2 magnification, 1.3 magnification, and the like, and is not limited herein.
When there are a plurality of theoretical zoom magnifications to be calibrated, the electronic device may calibrate each theoretical zoom magnification one by one. The control parameter of the driving mechanism corresponding to the theoretical zoom magnification to be calibrated at this time can be obtained, and the control parameter of the driving mechanism corresponding to the theoretical zoom magnification refers to the control parameter of the theoretically designed driving mechanism corresponding to the theoretical zoom magnification. The zoom driving mechanism of the imaging device can be controlled to move according to the driving mechanism control parameter corresponding to the theoretical zoom magnification to be calibrated at this time, so that the lens of the imaging device can be moved to a first position corresponding to the theoretical zoom magnification through the zoom driving mechanism, and the first position is the position where the lens is located after the zoom driving mechanism pushes the lens to move according to the driving mechanism control parameter corresponding to the theoretical zoom magnification.
In some embodiments, the electronic device may obtain theoretical design data corresponding to the imaging device, where the theoretical design data is data set by the imaging device during design, and the theoretical design data may include one or more theoretical zoom magnifications and drive mechanism control parameters corresponding to the theoretical zoom magnifications, and the drive mechanism control parameters corresponding to the theoretical zoom magnifications are theoretical design values. As an embodiment, the electronic device may calibrate each theoretical zoom magnification included in the theoretical design data, and optionally, may calibrate each theoretical zoom magnification in a certain order, for example, in the order of the magnifications from small to large, or in the order of the magnifications from large to small, and the like. The electronic equipment can determine the theoretical zoom magnification to be calibrated at this time according to the theoretical design data, and sends the drive mechanism control parameter corresponding to the theoretical zoom magnification to be calibrated at this time to the drive chip of the zoom drive mechanism, and after the drive chip receives the drive mechanism control parameter, the drive chip can control the zoom drive mechanism to move according to the drive mechanism control parameter, so that the lens of the imaging equipment is moved to the first position corresponding to the theoretical zoom magnification to be calibrated at this time.
Step 220, acquiring a first image acquired by the imaging device, wherein the first image is obtained by moving a lens of the imaging device to a first position and shooting a preset graphic card.
After a zoom driving mechanism of the imaging device moves the lens to the first position, the imaging device can shoot a preset image card to obtain a first image. In one embodiment, after the zoom driving mechanism of the imaging device moves the lens to the first position, a focusing driving mechanism (e.g., a focusing motor) of the imaging device may be controlled to perform a focusing operation, and a focused first image is captured, so that the sharpness of the first image may be ensured.
In some embodiments, the predetermined graphic card may include one or more patterns of predetermined shapes, wherein the patterns of predetermined shapes may be square blocks, and each square block may have the same size and be sequentially arranged at intervals. The arrangement position and the arrangement number of the square blocks in the preset graphic card are not limited in the embodiment of the present application.
As an alternative embodiment, the number of the square blocks may be 1, and the square block may be disposed at a central position of the predetermined graphic card. FIG. 3A is a diagram illustrating an embodiment of a default graphics card. As shown in fig. 3A, the default card includes only 1 square, and the square is disposed at the center of the pattern.
As another optional implementation, the number of the square blocks may be multiple, the square blocks may be sequentially arranged on the diagonal line of the preset graphic card at intervals, and on the horizontal line and the vertical line in the middle, and the arranged square blocks may be in a shape of a Chinese character 'mi' or a snowflake. FIG. 3B is a diagram illustrating a default graphics card in accordance with another embodiment. As shown in fig. 3B, the preset graphic card may include a plurality of squares, and the squares are sequentially arranged on the diagonal line, the middle horizontal line and the middle vertical line, and are substantially in a shape of a Chinese character "mi" or a snowflake. The squares are arranged in such a way, so that the number of the squares contained in the image acquired by the imaging equipment is more, the calculation of the actual zoom magnification is facilitated, and the accuracy is improved.
The pattern of the predetermined shape may be other patterns, for example, a rectangular block, or may include a plurality of different shaped blocks (e.g., a pentagon, a hexagon, a circle, a cross, etc.). It is understood that the specific patterns included in the preset graphic card, and the arrangement positions and the arrangement numbers of the internal patterns are not limited in the embodiments of the present application.
In step 230, the size parameter of the preset graphics card in the first image is calculated.
The electronic equipment acquires the first image acquired by the imaging equipment, and can calculate the size parameter of the preset graphic card in the first image, wherein the size parameter can be used for representing the size of the preset graphic card in the first image. Optionally, the size parameter may include an image size of the first image, where the image size of the first image may be represented by the number of pixels included in the first image, or the number of pixels occupied by each image edge of the first image, for example, the image size of the first image is 640 × 480. The size parameter of the preset graphic card in the first image may further include a pixel area occupied by each pattern included in the preset graphic card in the first image, and may also be represented by the number of occupied pixels. As a specific embodiment, the size parameter of the preset graphic card in the first image may include a size parameter of a pattern of a preset shape in the preset graphic card in the first image, such as the number of pixels of the side length of the pattern in the first image, or the size of the pixel area of the pattern in the first image. For example, the size of the pixel area occupied by the square in the first image in the preset graphic card is 5 × 5, that is, the number of pixels occupied by the side length is 5, and the number of pixels included in the whole square is 25.
In some embodiments, the electronic device may perform binarization processing on the first image first, and represent the same or similar pixel points in the first image with the same effect, and the binarized first image may exhibit a significant black-and-white effect. The area where the square is located can be determined in the first image after the binarization processing, and the pixel coordinates of each vertex of the square in the first image are calculated, so that the number of pixel points occupied by the side length of the square in the first image can be calculated according to the pixel coordinates of each vertex. Optionally, the threshold value of the binarization may be selected by a two-peak method, a p-parameter method, a maximum entropy threshold value method, and the like, which is not limited herein.
And 240, calculating the actual zoom magnification corresponding to the control parameter of the driving mechanism according to the size parameter.
The electronic device may determine an actual zoom magnification corresponding to the first image according to a size parameter of a preset map in the first image, that is, may determine an actual zoom magnification corresponding to a drive mechanism control parameter corresponding to a theoretical zoom magnification to be calibrated at this time. The larger the size parameter of the preset map in the first image is, the larger the area of the preset map in the first image is, the larger the actual zoom magnification can be.
In some embodiments, the electronic device may obtain a dimension parameter of the preset graphic card in the first image, and obtain a physical dimension parameter of the preset graphic card, where the physical dimension parameter may be used to represent an actual physical size of the preset graphic card, and optionally, the physical dimension parameter may include a physical length of an edge of the preset graphic card, a physical length of an edge of a pattern included in the preset graphic card, and the like. For example, the actual size of the predetermined graphic card is 1m (meters) × 1m, the pattern is a square block, and the actual size of the square block is 10cm (centimeters) × 10 cm.
As an embodiment, the pixel ratio of the pattern in the preset graphic card in the first image corresponding to the theoretical zoom magnification to be calibrated at this time may be calculated according to the size parameter of the preset graphic card in the first image, where the pixel ratio may be a ratio of the number of pixels occupied by the edge of the pattern in the first image, a ratio of the number of pixels occupied by the area of the pattern in the first image, a ratio of an image distance between two adjacent patterns in the first image, and the like. The physical proportion of the pattern in the preset image in the preset graphic card can be calculated according to the physical size parameter of the preset graphic card, and the physical proportion can be the proportion of the length of the edge of the pattern in the preset graphic card, the proportion of the area of the pattern in the preset graphic card, the proportion of the physical distance between two adjacent patterns in the preset graphic card, and the like, and is not limited herein. The actual zoom magnification corresponding to the theoretical zoom magnification to be calibrated at this time can be determined according to the pixel proportion of the pattern in the first image corresponding to the theoretical zoom magnification to be calibrated at this time and the physical proportion of the pattern in the preset graphic card, wherein the pixel proportion and the physical proportion can be the same type of proportion, for example, the proportion is the proportion corresponding to the edge of the pattern. The actual zoom magnification corresponding to the theoretical zoom magnification to be calibrated at this time may be a ratio of the two proportions.
And step 250, obtaining a calibration result according to the actual zoom magnification and the control parameter of the driving mechanism.
The electronic device can calibrate the zoom magnification corresponding to the control parameter of the driving mechanism according to the actual zoom magnification, and can modify the corresponding relation between the theoretical zoom magnification and the control parameter of the driving mechanism into the corresponding relation between the control parameter of the driving mechanism and the actual zoom magnification. For example, in the theoretical design data, the drive mechanism code value corresponding to the 2-magnification zoom is 600code, and the actual calibration magnification is determined to be 1.8 magnification after calculation, so that the drive mechanism code value of 600code corresponding to the 1.8-magnification zoom can be modified.
For example, the relationship between the theoretical zoom magnification, the drive mechanism control parameter, and the actual zoom magnification may be as shown in table 1.
TABLE 1
Theoretical zoom magnification Magnification of 1 Magnification of 1.2 Magnification of 1.4 Magnification of 1.6 Magnification of 2
Drive mechanism control parameters 178 245 350 421 587
Actual zoom magnification Magnification of 1.04 Magnification of 1.14 Magnification of 1.36 Magnification of 1.55 Magnification of 1.88
It is to be understood that the data in table 1 are only for illustrating the embodiments of the present application and are not intended to limit the embodiments of the present application, wherein the relationship between the theoretical zoom magnification and the actual zoom magnification is not limited, and the actual zoom magnification may be greater than or less than the theoretical zoom magnification or equal to the theoretical zoom magnification.
After the electronic device calibrates multiple theoretical zoom magnifications, a calibration result may be obtained according to an actual zoom magnification and a driving mechanism control parameter corresponding to each theoretical zoom magnification, where the calibration result may include a corresponding relationship between the actual zoom magnification and the driving mechanism control parameter, and optionally, the calibration result may be represented by a table, a relational expression, a relational curve, or the like, which is not limited herein. In some embodiments, the electronic device may store the calibration result, and when a user actually uses the imaging device to perform image acquisition, may acquire a zoom magnification required by the user, and search for a driving mechanism control parameter corresponding to the zoom magnification in the calibration result. For example, taking table 1 as an example, if the zoom magnification required by the user is 1.14 magnification, the corresponding drive mechanism control parameter can be found to be 245 code. And controlling the zooming driving mechanism to move according to the driving mechanism control parameter, so that the zooming multiplying power of the shot image is the same as the zooming multiplying power required by the user.
In the embodiment of the application, the zoom driving mechanism of the imaging device is controlled to move according to the driving mechanism control parameter corresponding to the theoretical zoom magnification, the lens of the imaging device is obtained to move to the first position corresponding to the theoretical zoom magnification, the preset graphic card is shot to obtain the first image, the actual zoom magnification can be determined according to the size parameter of the preset graphic card in the first image, the actual zoom magnification corresponding to the driving mechanism control parameter is calibrated, the situation that the actual zoom magnification is not matched with the required zoom magnification during shooting can be prevented, and the zoom effect with high accuracy can be achieved.
As shown in fig. 4, in an embodiment, another zoom magnification calibration method is provided, which is applicable to the electronic device described above. The zoom magnification calibration method can comprise the following steps:
and step 402, determining the theoretical zoom magnification to be calibrated at this time.
And 404, issuing the control parameter of the driving mechanism corresponding to the theoretical zoom magnification to be calibrated to a driving chip of the zoom driving mechanism, and controlling the zoom driving mechanism to move according to the issued control parameter of the driving mechanism through the driving chip so as to move the lens of the imaging device to a first position corresponding to the theoretical zoom magnification through the zoom driving mechanism.
And 406, acquiring a first image acquired by the imaging device, wherein the first image is obtained by moving a lens of the imaging device to a first position and shooting a preset graphic card.
The descriptions of steps 402-406 can refer to the related descriptions in the above embodiments, and are not repeated herein.
In some embodiments, the predetermined graphic card may include one or more blocks, each block included in the predetermined graphic card may have a predetermined inclination angle with respect to an edge of the predetermined graphic card, the block is obliquely disposed in the predetermined graphic card, and an edge of the block is not parallel or perpendicular to the edge of the predetermined graphic card, but has a certain inclination angle. FIG. 5A is a diagram illustrating a default graphics card in accordance with another embodiment. As shown in fig. 5A, the preset graphic card may include a plurality of squares, each of the squares is obliquely disposed in the preset graphic card, and an edge of each of the squares and an edge of the preset graphic card form an included angle of a certain angle. The Modulation Transfer Function (MTF) of the imaging device can be tested by using a square with a certain inclination angle, and the MTF refers to a Function of which the Modulation degree changes along with the spatial frequency, and can be used for describing the image resolution of the imaging device, and the image resolution can be used for explaining whether the acquired image is clear or fuzzy.
After acquiring the first image captured by the imaging device, the MTF corresponding to the first image may be tested according to the oblique side of the square included in the first image, where the oblique side of the square may refer to an edge of the square having a preset oblique angle with respect to an edge of a preset graphic card. Alternatively, an algorithm such as a Spatial Frequency Response (SFR) may be used to test the MTF corresponding to the first image, and the SFR may calculate the MTF of the first image at each spatial frequency. As a specific embodiment, a black-and-white Line may be obtained by using an Edge Spread Function (ESF) according to a hypotenuse of a square included in the first image, a change rate of the Line may be obtained by deriving the Line by using a Line Spread Function (LSF), and an MTF at each spatial frequency may be obtained by transforming the change rate of the Line. The MTF test and the calibration of the optical zoom magnification can be carried out together, the test process is simplified, and the test and calibration efficiency is improved.
Step 408, calculating the size parameter of the preset graphic card in the first image.
And step 410, calculating an actual zooming magnification corresponding to the control parameter of the driving mechanism according to the size parameter.
The descriptions of steps 408-410 can refer to the related descriptions in the above embodiments, and are not repeated herein.
In one embodiment, the size parameters of the predetermined graphic card in the first image may include the number of pixels occupied by each edge of the pattern in the first image or the actual size length of each edge of the pattern in the first image, the number of pixels occupied by each edge of the image in the first image or the actual size length of each edge of the image, and the like. Any one edge of the pattern can be selected, a first size of the edge in the first image is calculated, and a second size of the image edge corresponding to the selected edge of the pattern in the first image is obtained. The image edge of the first image corresponding to the selected edge of the pattern may refer to an image edge parallel to the selected edge of the pattern or having an included angle smaller than an angle threshold (e.g., 45 degrees, 30 degrees, etc., but not limited thereto). FIG. 5B is a diagram illustrating a first image in one embodiment. As shown in fig. 5B, if the side a of the pattern is selected, the image edge corresponding to the first image is the image edge e, and if the side B of the pattern is selected, the image edge corresponding to the first image is the image edge f. Taking the edge a of the selected pattern as an example, the first size of the edge a is X0, the image edge e corresponding to the first image is X0, and the second size of the image edge e is W0, a first ratio between the first size X0 and the second size W0 can be calculated, where the first size can be the number of pixels (i.e., the pixel length) occupied by the selected edge of the pattern in the first image, and the second size can be the number of pixels (i.e., the pixel length) occupied by the image edge corresponding to the selected edge of the pattern in the first image; the first dimension may also be the actual dimension length (described in terms of physical length) of the selected edge of the pattern in the first image, and the second dimension may then be the actual dimension length of the edge of the image in the first image.
The electronic device may further obtain a first physical length of the edge selected by the pattern, and a second physical length of an edge corresponding to the preset graphic card and the edge selected by the pattern, where the edge corresponding to the preset graphic card and the edge selected by the pattern may refer to an edge parallel to the edge selected by the pattern or an edge having an included angle smaller than an angle threshold. For example, as shown in fig. 3A, if the side a of the pattern is selected, the edge corresponding to the preset graphic card is the edge l, and if the side b of the pattern is selected, the edge corresponding to the preset graphic card is the edge f. Taking the edge a of the selected pattern as an example, the first physical length of the edge a is X1, the second physical length of the edge f corresponding to the preset graphic card is W1, a second ratio between the first physical length X1 and the second physical length W1 can be calculated, and the actual zoom magnification corresponding to the theoretical zoom magnification to be calibrated at this time is determined according to the first ratio and the second ratio.
Alternatively, the first size of the edge of the memorable pattern in the first image is X0, the second size of the edge of the image corresponding to the edge of the first image is W0, the first physical length of the edge is X1, and the second physical length of the edge corresponding to the preset graphic card is W1, then the first ratio may be X0/W0, and the second ratio may be X1/W1. The actual zoom magnification corresponding to the theoretical zoom magnification to be calibrated at this time may be a ratio between the first ratio and the second ratio, i.e., the actual zoom magnification may be (X0/W0)/(X1/W1). The actual zoom magnification is determined by utilizing the proportion of the size of the edge of the pattern in the first image to the edge of the image and the proportion of the edge length of the pattern in the actual image to the edge length of the preset graphic card, so that the accuracy of calibration can be improved.
In some embodiments, the predetermined graphics card may include a plurality of patterns of predetermined shapes arranged at intervals. The size parameters of the predetermined graphic card in the first image may include an image distance between adjacent patterns and a size of each image edge of the first image. The image distance between two adjacent patterns may be a distance between the same corner points of two adjacent patterns, or a distance between centers of two adjacent patterns, and the like, which is not limited herein.
Any two adjacent arranged patterns can be selected, and the image distance of the two selected adjacent arranged patterns in the first image is calculated, wherein the image distance can be the pixel distance of the difference between the two adjacent arranged patterns in the first image or the actual size distance (described by the length in the physical sense). The third size of the image edge corresponding to the first image and the two adjacent patterns can be obtained, wherein the image edge corresponding to the first image and the two adjacent patterns refers to an image edge of the first image parallel to the arrangement direction of the two selected patterns, the arrangement direction can be a vertical direction and a horizontal direction, if the two selected patterns are arranged in the horizontal direction, the third size of the image edge in the horizontal direction of the first image can be obtained, and if the two selected patterns are arranged in the vertical direction, the third size of the image edge in the vertical direction of the first image can be obtained. A third ratio between the image distance and a third dimension may be calculated. Fig. 5C is a schematic diagram of a first image in another embodiment, as shown in fig. 5C, selecting the patterns 502 and 504 arranged adjacently, it is able to calculate the image distance of the patterns 502 and 504 in the horizontal direction as D0, and the image edge of the first image corresponding to the patterns 502 and 504 is the edge g, then it is able to obtain the third size of the image edge g as W2, and calculate the third ratio as D0/W2.
In some embodiments, any two patterns arranged in the same direction, which may be a vertical direction, a parallel direction, etc., may be selected, the number of patterns included between the two selected patterns may be determined, and the image distance between two adjacent arranged patterns may be calculated according to the image distance of the two selected patterns in the first image and the number of patterns included. As a specific embodiment, the image distance between two adjacent arranged patterns is equal to the image distance of two selected patterns in the first image/(the number of patterns included between two selected patterns + 1).
The electronic device can also obtain the physical distance between the two adjacent patterns selected from the preset graphic card and a third physical length of the preset graphic card and the edge corresponding to the two adjacent patterns. The edges of the preset graphic card corresponding to the two adjacent patterns can be edges of the preset graphic card parallel to the arrangement direction of the two selected patterns. And calculating a fourth ratio between the physical distance and the third physical length, and determining the actual zoom magnification corresponding to the theoretical zoom magnification to be calibrated at this time according to the third ratio and the fourth ratio. Fig. 5D is a schematic diagram of another embodiment of a preset graphic card, as shown in fig. 5D, a physical distance between the patterns 502 and 504 arranged adjacently is D1, an edge of the preset graphic card corresponding to the patterns 502 and 504 is an edge j, and a third physical length of the edge j is W3, so that a fourth ratio D1/W3 can be calculated.
Alternatively, it may be noted that the image distance between the two adjacent patterns in the first image is D0, the third size of the edge of the image corresponding to the two adjacent patterns in the first image is W2, the physical distance between the two adjacent patterns in the first image is D1, the third physical length of the edge of the predetermined card corresponding to the two adjacent patterns in the second image is W3, the third ratio may be D0/W2, and the fourth ratio may be D1/W3. The actual zoom magnification corresponding to the theoretical zoom magnification to be calibrated at this time may be a ratio between the third ratio and the fourth ratio, that is, the actual zoom magnification may be (D0/W2)/(D1/W3).
In some embodiments, the arrangement direction of the two selected adjacent arranged patterns may also be parallel to a diagonal line of the preset graphic card, after the image distance of the two adjacent arranged patterns in the first image is obtained, the size of the diagonal line parallel to the two adjacent arranged patterns in the first image may be obtained, and the ratio of the image distance to the size is calculated.
Fig. 5E is a schematic diagram of the first image in another embodiment, as shown in fig. 5E, the patterns 506 and 508 arranged adjacently in parallel with the diagonal line m are selected, the image distance of the patterns 506 and 508 in the direction parallel with the diagonal line m is calculated to be D2 (length of the line parallel with the diagonal line connecting the centers of the patterns 506 and 508), the size of the diagonal line m in the first image is W4, and the ratio of the image distance between the patterns 506 and 508 to the size of the diagonal line m is calculated to be D2/W4. FIG. 5F is a diagram illustrating another embodiment of the default card, as shown in FIG. 5F, the physical distance between the pattern 506 and the pattern 508 arranged adjacently in parallel with the diagonal line n of the default card is D3, the physical length of the diagonal line n in the default card is W5, and the ratio of the physical distance between the pattern 506 and the pattern 508 to the physical length of the diagonal line n is D3/W5. Based on fig. 5E and 5F, an actual zoom magnification (D2/W4)/(D3/W5) corresponding to the theoretical zoom magnification to be calibrated at this time can be calculated. The actual zoom magnification is determined by utilizing the proportion of the number of pixels occupied by the distance between the adjacent arranged patterns to the edge of the image and the proportion of the actual physical distance between the adjacent arranged patterns to the side length of the preset graphic card in practice, so that the accuracy of calibration can be improved.
In step 412, it is determined whether the theoretical zoom magnification to be calibrated at this time is the maximum theoretical zoom magnification in the theoretical design data, if not, step 414 is executed, and if so, step 416 is executed.
In some embodiments, the respective theoretical zoom magnifications included in the theoretical design data may be individually calibrated in the order of the zoom magnifications from small to large. After the actual zoom magnification corresponding to the drive mechanism control parameter corresponding to the theoretical zoom magnification to be calibrated at this time is obtained through calculation, whether the theoretical zoom magnification to be calibrated at this time is the maximum theoretical zoom magnification in the theoretical design data or not can be judged, wherein the maximum theoretical zoom magnification in the theoretical design data can be determined according to the theoretical zoom range of the imaging device. As an embodiment, a ratio between the maximum focal length and the minimum focal length in the theoretical zoom range may be calculated, and the ratio between the maximum focal length and the minimum focal length may be used as the maximum theoretical zoom magnification, for example, the theoretical zoom range of the imaging apparatus is 35-200 mm (millimeters), and the maximum theoretical zoom magnification may be 200/35 ≈ 5.7.
And if the theoretical zoom magnification to be calibrated at this time is smaller than the maximum theoretical zoom magnification in the theoretical design data, determining the theoretical zoom magnification to be calibrated at the next time, and continuing to calibrate, and if the theoretical zoom magnification to be calibrated at this time reaches the maximum theoretical zoom magnification in the theoretical design data, obtaining a calibration result according to a plurality of calibrated actual zoom magnifications and corresponding drive mechanism control parameters.
And step 414, determining the theoretical zoom magnification to be calibrated next time according to the specified zoom step length.
In performing zoom magnification calibration, a designated zoom step may be set, and a zoom magnification range of the imaging apparatus may be divided into a plurality of segments according to the designated zoom step, thereby achieving zoom of continuous magnification, where the zoom magnification range refers to a zoom magnification interval that the imaging apparatus can achieve. The zoom step may refer to a difference between two adjacent zoom magnifications after dividing the zoom magnification range of the imaging apparatus into a plurality of sections, which may be understood as dividing the zoom magnification range of the imaging apparatus by the specified zoom step. For example, the zoom magnification range of the imaging device is 1 magnification to 5 magnifications, and the designated zoom step can be 0.5, then the zoom magnification range of 1 magnification to 5 magnifications can be divided into 10 segments according to the designated zoom step, that is, 1 to 1.5, 1.5 to 2, 2 to 2.5, 2.5 to 3, … …, 4.5 to 5, which are not listed here.
In some embodiments, respective theoretical zoom magnifications obtained by dividing the zoom magnification range into a plurality of segments may be calibrated in order of the theoretical zoom magnifications from large to small. If the theoretical zoom magnification to be calibrated at this time is not the maximum theoretical zoom magnification in the theoretical design data, the specified zoom step length can be increased on the basis of the theoretical zoom magnification to be calibrated at this time to determine the theoretical zoom magnification to be calibrated next time. For example, if the specified zoom step is 0.2, the theoretical zoom magnification of this time is 1.4, and the specified zoom step is not the maximum theoretical zoom magnification of 2, it is determined that the theoretical zoom magnification to be calibrated next time is 1.6.
The smaller the specified zoom step size is, the more the number of stages dividing the zoom magnification range of the imaging apparatus is, the more the theoretical zoom magnification required for calibration can be, and the more accurate the calibration result is obtained. Compared with the fixed zoom magnification set during the design of the imaging equipment, the zoom magnification range of the imaging equipment is divided by setting the appointed zoom step length, and the theoretical zoom magnification needing to be calibrated is determined again, so that the calibration of the continuous zoom magnification of the imaging equipment can be realized, and the accuracy of the zoom effect is improved.
And step 416, obtaining a calibration result according to the actual zoom magnification and the control parameter of the driving mechanism.
The electronic equipment can obtain a plurality of actual zooming magnifications determined according to driving mechanism control parameters corresponding to a plurality of theoretical zooming magnifications to be calibrated, the driving mechanism control parameters and the actual zooming magnifications can be in one-to-one correspondence, and a calibration table is generated according to the plurality of driving mechanism control parameters and the corresponding plurality of actual zooming magnifications. The calibration table may record the actual zoom magnification corresponding to each drive mechanism control parameter. For example, the calibration table may be as shown in Table 2.
TABLE 2
Actual zoom magnification Magnification of 1.05 Magnification of 1.48 Magnification of 1.97 Magnification of 2.41 Magnification of 2.93
Drive mechanism control parameters 370 474 592 724 900
It is to be understood that the data in table 2 is only used for illustrating the calibration table of the embodiment of the present application, and is not used to limit the embodiment of the present application.
In some embodiments, after the electronic device generates the calibration table, a relationship curve between the driving mechanism control parameters and the actual zoom magnification may be obtained according to a plurality of driving mechanism control parameters and corresponding actual zoom magnification included in the calibration table, and optionally, the relationship curve may be constructed by using the driving mechanism control parameters as a horizontal axis and the actual zoom magnification as a vertical axis, or by using the actual zoom magnification as a horizontal axis and the driving mechanism control parameters as a vertical axis, which is not limited herein. The relationship curve of the drive mechanism control parameter and the actual zoom magnification can be used for representing the corresponding relationship between the drive mechanism control parameter and the calibrated zoom magnification.
Taking the calibration table shown in table 2 as an example, taking the driving mechanism control parameter as the horizontal axis and the actual zoom magnification as the vertical axis, fitting based on the plurality of driving mechanism control parameters and the corresponding actual zoom magnification included in table 2 to obtain a relationship curve between the driving mechanism control parameter and the actual zoom magnification, which can be shown in fig. 6, as can be seen from fig. 6, the larger the driving mechanism control parameter is, the larger the actual zoom magnification can be along with the increase, and the two can be in a positive correlation, and after the actual zoom magnification reaches the maximum zoom magnification of the imaging device, the zoom magnification can not increase along with the increase of the driving mechanism control parameter. It is to be understood that fig. 6 shows only an example of a relationship curve, and the relationship curve of the driving mechanism control parameter and the actual zoom magnification may be other expressions, for example, a straight line having a linear relationship or a curve having a negative correlation.
The electronic equipment can output the calibration table and the relation curve between the driving mechanism control parameter and the actual zooming magnification as the calibration result and store the calibration result in the memory, and when the imaging equipment is in actual use, the driving mechanism control parameter corresponding to the required zooming magnification can be accurately searched based on the calibration table and the relation curve so as to realize accurate zooming effect. And the user can select any zoom magnification within the zoom magnification range of the imaging equipment according to actual needs to acquire images, if the zoom magnification recorded in the calibration table is not available, corresponding drive mechanism control parameters can be calculated through the relation curve, and the method is not limited to the fixed zoom magnification set during the design of the imaging equipment, so that the optical zoom effect is improved.
In the embodiment of the application, the zoom magnification range of the imaging device is divided by setting the designated zoom step length, and the theoretical zoom magnification required to be calibrated is determined again, so that the continuous zoom magnification of the imaging device can be calibrated, and the accuracy of the zoom effect is improved.
As shown in fig. 7, in one embodiment, another zoom magnification calibration method is provided, which is applicable to the electronic device described above. The zoom magnification calibration method can comprise the following steps:
and 702, controlling a zoom driving mechanism of the imaging device to move according to the driving mechanism control parameter corresponding to the theoretical zoom magnification so as to move the lens of the imaging device to a first position corresponding to the theoretical zoom magnification through the zoom driving mechanism.
Step 704, acquiring a first image acquired by the imaging device, wherein the first image is obtained by moving a lens of the imaging device to a first position and shooting a preset graphic card.
Step 706, calculating the size parameter of the preset graphic card in the first image.
Step 708, calculating an actual zoom magnification corresponding to the drive mechanism control parameter based on the dimensional parameter.
And step 710, obtaining a calibration result according to the actual zoom magnification and the control parameter of the driving mechanism.
The steps 702 to 710 can refer to the related descriptions in the above embodiments, and are not described herein again.
And 712, acquiring a driving mechanism control parameter corresponding to the zoom magnification to be tested according to the calibration result.
In some embodiments, after the electronic device calibrates the zoom magnification of the imaging device, the obtained calibration result may be tested to determine whether the calibration result is accurate. The zoom magnification to be tested may be determined, optionally, it may be a zoom magnification selected from a calibration table, i.e., it may be any one of the various actual zoom magnifications obtained at the time of calibration. Optionally, the zoom magnification to be tested may also be a zoom magnification input by a calibrator according to an actual requirement, the calibrator may select a zoom magnification input within a zoom magnification range of the imaging device, and the electronic device may use the input zoom magnification as the zoom magnification to be tested. Optionally, a zoom magnification may also be randomly selected from a zoom magnification range of the imaging device as a zoom magnification to be tested, and the like, which is not limited herein.
After the zoom magnification to be tested is determined, the control parameters of the driving mechanism corresponding to the zoom magnification to be tested can be searched from the calibration result. In some embodiments, the calibration results may include calibration tables and drive mechanism control parameters versus actual zoom magnification. And if so, acquiring a driving mechanism control parameter corresponding to the same actual zoom magnification from the calibration table, and taking the acquired driving mechanism control parameter as a driving mechanism control parameter corresponding to the zoom magnification to be tested. For example, as shown in table 2, if the zoom magnification under test is 1.48 magnification and the same actual zoom magnification is present in the calibration table, it can be determined that the drive mechanism control parameter corresponding to the zoom magnification under test is 474 code.
And if the actual zoom magnification which is the same as the zoom magnification to be tested is not recorded in the selected calibration table, determining the drive mechanism control parameter corresponding to the zoom magnification to be tested according to the relation curve of the drive mechanism control parameter and the actual zoom magnification. The zoom magnification to be tested can be substituted into the relation curve, and the control parameter of the driving mechanism corresponding to the zoom magnification to be tested in the relation curve is determined. For example, as shown in table 2, if the tested zoom magnification is 1.5 magnification and the calibration table does not have the same actual zoom magnification, the 1.5 magnification may be substituted into the relationship curve shown in fig. 6, and the drive mechanism control parameter corresponding to the 1.5 magnification may be calculated from the relationship curve, so as to obtain the drive mechanism control parameter corresponding to the zoom magnification to be tested. The relation curve between the driving mechanism control parameter and the actual zoom magnification obtained by utilizing the calibration table and fitting can ensure that the determined driving mechanism control parameter corresponding to the zoom magnification to be tested is more accurate, and the test accuracy is ensured.
And 714, controlling the zoom driving mechanism of the imaging device to move according to the driving mechanism control parameter corresponding to the zoom magnification to be tested, so that the lens of the imaging device is moved to a second position corresponding to the zoom magnification to be tested through the zoom driving mechanism.
The electronic equipment can control the zoom driving mechanism of the imaging equipment to move according to the driving mechanism control parameter corresponding to the zoom magnification to be tested, the driving mechanism control parameter corresponding to the zoom magnification to be tested can be issued to the driving chip of the zoom driving mechanism, and after the driving chip receives the driving mechanism control parameter, the driving chip can control the zoom driving mechanism to move according to the driving mechanism control parameter, so that the lens of the imaging equipment is moved to a second position corresponding to the zoom magnification to be tested. And the second position is the position of the lens after the zoom driving mechanism pushes the lens to move according to the driving mechanism control parameter corresponding to the zoom magnification to be tested.
And 716, acquiring a second image acquired by the imaging device, wherein the second image is obtained by moving the lens of the imaging device to a second position and shooting the preset graphic card.
After the zoom driving mechanism of the imaging device moves the lens to the second position, the imaging device may shoot a preset graphic card to obtain a second image, where the preset graphic card is a pattern used when the zoom magnification of the imaging device is calibrated, and the specific pattern style of the preset graphic card may refer to the description in each of the above embodiments, and is not described herein again. In one embodiment, after the zoom driving mechanism of the imaging device moves the lens to the second position, the focusing driving mechanism of the imaging device can be controlled to perform focusing operation, and the focused second image is captured, so that the definition of the second image can be ensured.
Step 718, calculating the size parameter of the preset graphic card in the second image, and calculating the zoom magnification of the actual test according to the size parameter of the preset graphic card in the second image.
The electronic device acquires the second image acquired by the imaging device, and can calculate the size parameter of the preset image card in the second image, wherein the size parameter can be the pixel area occupied by the preset image card in the second image, and can also be represented by the number of occupied pixels and the like. The manner of calculating the size parameter of the preset map card in the second image may be the same as or similar to the manner of calculating the size parameter of the preset map card in the first image in the above embodiments, and is not repeated herein.
After the electronic device calculates the size parameter of the preset graphic card in the second image, the actual zoom magnification corresponding to the second image can be calculated according to the size parameter of the preset graphic card in the second image, and the actual zoom magnification corresponding to the second image is the zoom magnification actually tested. The manner of determining the actual zoom magnification corresponding to the second image may be the same as the manner of determining the actual zoom magnification corresponding to the first image described in the foregoing embodiments, and reference may be made to the related description in the foregoing embodiments, and details are not repeated here.
And 720, comparing the zoom magnification to be tested with the zoom magnification actually tested to obtain a test result.
The actual zoom magnification ratio can be compared with the zoom magnification ratio to be tested, whether the actual zoom magnification ratio and the zoom magnification ratio are the same or not is judged, if the actual zoom magnification ratio and the zoom magnification ratio are the same, the fact that the zoom magnification ratio in the actual using process is matched with the actual zoom magnification ratio of the calibration result can be shown, and the fact that the test result is passed can be determined. If the two are different, it can be shown that the zoom magnification in the actual use process is not matched with the actual zoom magnification of the calibration result, and the test result can be determined as a test failure.
In one embodiment, an error between the zoom magnification to be tested and the zoom magnification actually tested may be calculated, and it is determined whether the error is smaller than a preset error threshold, and optionally, the error threshold may be set according to an actual requirement, for example, 0.01, 0.02, and the like, but is not limited thereto. And if the error between the zoom magnification to be tested and the zoom magnification actually tested is not less than the preset error threshold, determining that the test result is that the test is passed.
In some embodiments, if the test result is that the test fails, one zoom magnification to be tested may be selected again for retesting, and the zoom magnification of the imaging device may also be calibrated again. As an optional implementation manner, the electronic device may select a preset number of zoom magnifications as zoom magnifications to be tested, and perform testing one by one, may count a number of test passes in the preset number of zoom magnifications to be tested, and calculate a ratio of the number of test passes to the preset number. For example, 10 zoom magnifications to be tested can be selected and tested one by one, wherein 8 test results of the zoom magnifications to be tested are passed, and 2 test results of the zoom magnifications to be tested are failed, so that the proportion of the number of passed tests in 80% can be calculated. The method can judge whether the proportion of the number which passes the test to the preset number is larger than a preset proportion threshold value or not, if the proportion is larger than the preset proportion threshold value, the test passing of the calibration result can be determined, if the proportion is not larger than the preset proportion threshold value, the test failing of the calibration result can be determined, and the zoom magnification of the imaging equipment can be calibrated again. For example, the preset percentage threshold is 75%, and if the percentage of the number of passed tests is 80%, and exceeds 75%, the test passing of the calibration result can be determined. The preset number and the proportion threshold value can be set according to actual requirements, limitation is not required, and the more the selected preset number is, the larger the proportion threshold value is, the more accurate the test result is.
In the embodiment of the application, after the zoom magnification of the imaging device is calibrated, the calibration result can be further tested, so that the accuracy of the calibration result is ensured, and the accuracy of the optical zoom effect of the imaging device can be further improved.
As shown in fig. 8, in an embodiment, a zoom ratio calibration apparatus 800 is provided, which is applicable to the electronic device. The zoom magnification calibration apparatus 800 may include a control module 810, an image acquisition module 820, a size calculation module 830, an actual magnification calculation module 840, and a calibration module 850.
And the control module 810 is configured to control the zoom driving mechanism of the imaging device to move according to the driving mechanism control parameter corresponding to the theoretical zoom magnification, so that the lens of the imaging device is moved to the first position corresponding to the theoretical zoom magnification by the zoom driving mechanism.
The image obtaining module 820 is configured to obtain a first image collected by an imaging device, where the first image is obtained by moving a lens of the imaging device to a first position and shooting a preset graphic card.
And a size calculating module 830, configured to calculate a size parameter of the preset card in the first image.
And the actual magnification calculation module 840 is used for calculating the actual zoom magnification corresponding to the drive mechanism control parameter according to the size parameter.
And the calibration module 850 is used for obtaining a calibration result according to the actual zoom magnification and the control parameter of the driving mechanism.
In one embodiment, the calibration apparatus 800 for zoom magnification may further include a theoretical data acquisition module.
And the theoretical data acquisition module is used for acquiring theoretical design data corresponding to the imaging equipment, and the theoretical design data comprises one or more theoretical zoom magnifications and driving mechanism control parameters corresponding to the theoretical zoom magnifications.
The control module 810 includes a magnification determination unit and a parameter issuing unit.
And the magnification determining unit is used for determining the theoretical zoom magnification to be calibrated at this time according to the theoretical design data.
And the parameter issuing unit is used for issuing the control parameter of the driving mechanism corresponding to the theoretical zoom magnification to be calibrated to a driving chip of the zoom driving mechanism, and controlling the zoom driving mechanism to move according to the issued control parameter of the driving mechanism through the driving chip.
In one embodiment, the predetermined graphic card is a pattern including one or more squares, and the squares have a predetermined tilt angle with respect to the edge of the predetermined graphic card. The calibration apparatus 800 for zoom magnification may further include a modulation transfer function test module.
And the modulation transfer function testing module is used for testing the modulation transfer function MTF corresponding to the first image according to the oblique side of the square contained in the first image, wherein the oblique side is the side of the square with a preset oblique angle relative to the edge of the preset graphic card. The MTF test and the calibration of the optical zoom magnification can be carried out together, the test process is simplified, and the test and calibration efficiency is improved.
In the embodiment of the application, the zoom driving mechanism of the imaging device is controlled to move according to the driving mechanism control parameter corresponding to the theoretical zoom magnification, the lens of the imaging device is obtained to move to the first position corresponding to the theoretical zoom magnification, the preset graphic card is shot to obtain the first image, the actual zoom magnification can be determined according to the size parameter of the preset graphic card in the first image, the actual zoom magnification corresponding to the driving mechanism control parameter is calibrated, the situation that the actual zoom magnification is not matched with the required zoom magnification during shooting can be prevented, and the zoom effect with high accuracy can be achieved.
In one embodiment, the size calculation module 830 includes a pixel calculation unit and a pixel acquisition unit.
A pixel calculation unit for calculating a first size of an edge of the pattern in the first image.
And the pixel acquisition unit is used for acquiring a second size of an image edge corresponding to the pattern edge of the first image, wherein the image edge corresponding to the pattern edge of the first image refers to an edge which is parallel to the pattern edge or has an included angle smaller than an angle threshold value in the first image.
The actual magnification calculation module 840 includes a first calculation unit, a physical length acquisition unit, a second calculation unit, and an actual magnification calculation unit.
The first calculating unit is used for calculating a first ratio between the first size and the second size.
The physical length obtaining unit is used for obtaining a first physical length of the edge of the pattern and a second physical length of the edge corresponding to the edge of the preset graphic card and the pattern, wherein the edge corresponding to the edge of the preset graphic card and the pattern refers to an edge parallel to the edge of the pattern in the preset graphic card or an included angle of the edge is smaller than an angle threshold.
A second calculating unit for calculating a second ratio between the first physical length and the second physical length.
And the actual magnification calculation unit is used for calculating the ratio between the first ratio and the second ratio to obtain the actual zoom magnification corresponding to the theoretical zoom magnification to be calibrated at this time.
In one embodiment, the pixel calculation unit is further configured to calculate an image distance between two adjacently arranged patterns in the first image.
The pixel acquisition unit is further used for acquiring a third size of an image edge corresponding to the first image and the two adjacent patterns, wherein the image edge corresponding to the first image and the two adjacent patterns refers to an edge parallel to the arrangement direction of the two patterns in the first image.
The first calculating unit is further used for calculating a third ratio between the image distance and the third size.
And the physical length acquiring unit is further used for acquiring a physical distance between the two adjacent patterns in the preset graphic card and a third physical length of the preset graphic card and the edge corresponding to the two adjacent patterns.
And the second calculating unit is also used for calculating a fourth ratio between the physical distance and the third physical length.
And the actual magnification calculation unit is also used for calculating the ratio between the third ratio and the fourth ratio to obtain the actual zoom magnification corresponding to the theoretical zoom magnification to be calibrated at this time.
In an embodiment, the magnification determining unit of the control module 810 is further configured to, if the theoretical zoom magnification to be calibrated this time is not the maximum theoretical zoom magnification in the theoretical design data, increase a specified zoom step length on the basis of the theoretical zoom magnification to be calibrated this time to determine the theoretical zoom magnification to be calibrated next time, and use the theoretical zoom magnification to be calibrated next time as a new theoretical zoom magnification to be calibrated this time.
In one embodiment, the calibration module 850 includes a magnification acquisition unit, a generation unit, and a fitting unit.
And the magnification acquisition unit is used for acquiring a plurality of actual zooming magnifications determined according to a plurality of driving mechanism control parameters, and the driving mechanism control parameters correspond to the actual zooming magnifications one by one.
And the generating unit is used for generating a check table according to the plurality of driving mechanism control parameters and the plurality of actual zooming magnifications.
And the fitting unit is used for fitting according to the plurality of driving mechanism control parameters contained in the check table and the corresponding actual zooming magnification to obtain a relation curve of the driving mechanism control parameters and the actual zooming magnification, and outputting the check table and the relation curve as a calibration result.
In the embodiment of the application, the zoom magnification range of the imaging device is divided by setting the designated zoom step length, and the theoretical zoom magnification required to be calibrated is determined again, so that the continuous zoom magnification of the imaging device can be calibrated, and the accuracy of the zoom effect is improved.
In one embodiment, the calibration apparatus 800 for zoom magnification includes a test parameter acquisition module and a comparison module, in addition to the control module 810, the image acquisition module 820, the size calculation module 830, the actual magnification calculation module 840, the calibration module 850, the theoretical data acquisition module, the modulation transfer function test module, and the recording module.
And the test parameter acquisition module is used for acquiring the control parameters of the driving mechanism corresponding to the zoom magnification to be tested according to the calibration result.
In one embodiment, the test parameter obtaining module is further configured to obtain a driving mechanism control parameter corresponding to the same actual zoom magnification from the calibration table when the actual zoom magnification which is the same as the zoom magnification to be tested is recorded in the calibration table, and use the obtained driving mechanism control parameter as the driving mechanism control parameter corresponding to the zoom magnification to be tested; and when the actual zoom magnification which is the same as the zoom magnification to be tested is not recorded in the check table, substituting the zoom magnification to be tested into the relation curve, and determining the control parameters of the driving mechanism corresponding to the zoom magnification to be tested in the relation curve.
The control module 810 is further configured to control the zoom driving mechanism of the imaging device to move according to the driving mechanism control parameter corresponding to the zoom magnification to be tested, so that the lens of the imaging device is moved to a second position corresponding to the zoom magnification to be tested through the zoom driving mechanism.
The image obtaining module 820 is further configured to obtain a second image collected by the imaging device, where the second image is obtained by moving the lens of the imaging device to a second position and shooting the preset graphic card.
The size calculating module 830 is further configured to calculate a size parameter of the preset card in the second image.
And the actual magnification calculation module 840 is further configured to calculate an actual zoom magnification according to the size parameter of the preset graphic card in the second image.
And the comparison module is used for comparing the zoom magnification to be tested with the zoom magnification actually tested to obtain a test result.
In one embodiment, the comparison module includes an error calculation unit and a test result unit.
And the error calculation unit is used for calculating the error between the zoom magnification to be tested and the zoom magnification actually tested.
And the test result unit is used for passing the test if the error is smaller than a preset error threshold value, and failing the test if the error is not smaller than the error threshold value.
In the embodiment of the application, after the zoom magnification of the imaging device is calibrated, the calibration result can be further tested, so that the accuracy of the calibration result is ensured, and the accuracy of the optical zoom effect of the imaging device can be further improved.
The embodiment of the application discloses a computer readable storage medium, which stores a computer program, wherein the computer program realizes the method described in the above embodiments when being executed by a processor.
Embodiments of the present application disclose a computer program product comprising a non-transitory computer readable storage medium storing a computer program, and the computer program, when executed by a processor, implements the method as described in the embodiments above.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a non-volatile computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the program is executed. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), or the like.
Any reference to memory, storage, database, or other medium as used herein may include non-volatile and/or volatile memory. Suitable non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM), which acts as external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), Enhanced SDRAM (ESDRAM), synchronous Link (Synchlink) DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and bus dynamic RAM (RDRAM).
It should be appreciated that reference throughout this specification to "one embodiment" or "an embodiment" means that a particular feature, structure or characteristic described in connection with the embodiment is included in at least one embodiment of the present application. Thus, the appearances of the phrases "in one embodiment" or "in an embodiment" in various places throughout this specification are not necessarily all referring to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. Those skilled in the art should also appreciate that the embodiments described in this specification are all alternative embodiments and that the acts and modules involved are not necessarily required for this application.
In various embodiments of the present application, it should be understood that the size of the serial number of each process described above does not mean that the execution sequence is necessarily sequential, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment. In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated units, if implemented as software functional units and sold or used as a stand-alone product, may be stored in a computer accessible memory. Based on such understanding, the technical solution of the present application, which is a part of or contributes to the prior art in essence or in whole or in part, can be embodied in the form of a software product stored in a memory, including several requests to cause a computer device to perform part or all of the steps of the above-described method of the various embodiments of the present application.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (13)

1. A method for calibrating zoom magnification, comprising:
controlling a zoom driving mechanism of an imaging device to move according to a driving mechanism control parameter corresponding to a theoretical zoom magnification so as to move a lens of the imaging device to a first position corresponding to the theoretical zoom magnification through the zoom driving mechanism;
acquiring a first image acquired by the imaging equipment, wherein the first image is obtained by moving a lens of the imaging equipment to the first position and shooting a preset graphic card;
calculating the size parameter of the preset graphic card in the first image;
calculating actual zoom magnification corresponding to the control parameter of the driving mechanism according to the size parameter;
and obtaining a calibration result according to the actual zoom magnification and the control parameter of the driving mechanism.
2. The method according to claim 1, wherein before the driving mechanism control parameter corresponding to the theoretical zoom magnification controls the zoom driving mechanism of the imaging apparatus to move, the method further comprises:
acquiring theoretical design data corresponding to the imaging equipment, wherein the theoretical design data comprises one or more theoretical zoom magnifications and drive mechanism control parameters corresponding to the theoretical zoom magnifications;
the method for controlling the movement of the zooming driving mechanism of the imaging equipment according to the driving mechanism control parameter corresponding to the theoretical zooming magnification comprises the following steps:
determining the theoretical zoom magnification to be calibrated at this time according to the theoretical design data;
and issuing the control parameter of the driving mechanism corresponding to the theoretical zoom magnification to be calibrated to a driving chip of the zoom driving mechanism, and controlling the zoom driving mechanism to move according to the issued control parameter of the driving mechanism through the driving chip.
3. The method of claim 2, wherein the preset graphic card comprises one or more patterns of preset shapes; the calculating the size parameter of the preset graphic card in the first image comprises:
calculating a first dimension of an edge of the pattern in the first image;
acquiring a second size of an image edge corresponding to the first image and the pattern edge, wherein the image edge corresponding to the first image and the pattern edge refers to an edge parallel to the pattern edge or an edge with an included angle smaller than an angle threshold value in the first image;
the calculating the actual zoom magnification corresponding to the control parameter of the driving mechanism according to the size parameter comprises the following steps:
calculating a first ratio between the first dimension and the second dimension;
acquiring a first physical length of the edge of the pattern and a second physical length of the edge of the preset graphic card corresponding to the edge of the pattern, wherein the edge of the preset graphic card corresponding to the edge of the pattern refers to an edge of the preset graphic card which is parallel to the edge of the pattern or has an included angle smaller than an angle threshold;
calculating a second ratio between the first physical length and the second physical length;
and calculating the ratio between the first ratio and the second ratio to obtain the actual zoom magnification corresponding to the theoretical zoom magnification to be calibrated at this time.
4. The method of claim 2, wherein the predetermined graphic card includes a plurality of patterns of predetermined shapes, the patterns being arranged at intervals; the calculating the size parameter of the preset graphic card in the first image comprises:
calculating the image distance of two adjacently arranged patterns in the first image;
acquiring a third size of an image edge corresponding to the first image and the two adjacent patterns, wherein the image edge corresponding to the first image and the two adjacent patterns refers to an edge parallel to the arrangement direction of the two patterns in the first image;
the calculating the actual zoom magnification corresponding to the control parameter of the driving mechanism according to the size parameter comprises the following steps:
calculating a third ratio between the image distance and a third dimension;
acquiring a physical distance between the two adjacent patterns in the preset graphic card and a third physical length of the preset graphic card and edges corresponding to the two adjacent patterns, wherein the edges corresponding to the two adjacent patterns in the preset graphic card refer to edges parallel to the arrangement direction of the two patterns in the preset graphic card;
calculating a fourth ratio between the physical distance and the third physical length;
and calculating the ratio between the third ratio and the fourth ratio to obtain the actual zoom magnification corresponding to the theoretical zoom magnification to be calibrated at this time.
5. The method of claim 2, wherein after said calculating the size parameter of the preset graphics card in the image, the method further comprises:
if the theoretical zoom magnification to be calibrated at this time is not the maximum theoretical zoom magnification in the theoretical design data, increasing a specified zoom step length on the basis of the theoretical zoom magnification to be calibrated at this time to determine the theoretical zoom magnification to be calibrated at the next time;
and taking the next theoretical zoom magnification to be calibrated as a new theoretical zoom magnification to be calibrated at this time, and executing the drive mechanism control parameter corresponding to the theoretical zoom magnification to control the zoom drive mechanism of the imaging device to move until the theoretical zoom magnification to be calibrated at this time is the maximum theoretical zoom magnification in the theoretical design data.
6. The method according to any one of claims 1 to 5, wherein the obtaining a calibration result according to the actual zoom magnification and the driving mechanism control parameter comprises:
acquiring a plurality of actual zooming magnifications determined according to a plurality of driving mechanism control parameters, wherein the driving mechanism control parameters correspond to the actual zooming magnifications one to one;
generating a check table according to the plurality of driving mechanism control parameters and the plurality of actual zooming magnifications;
and fitting according to a plurality of driving mechanism control parameters contained in the check table and corresponding actual zooming magnifications to obtain a relation curve of the driving mechanism control parameters and the actual zooming magnifications, and outputting the check table and the relation curve as a calibration result.
7. The method of claim 5, further comprising:
acquiring a driving mechanism control parameter corresponding to the zoom magnification to be tested according to the calibration result;
controlling a zoom driving mechanism of the imaging device to move according to the driving mechanism control parameter corresponding to the zoom magnification to be tested so as to move the lens of the imaging device to a second position corresponding to the zoom magnification to be tested through the zoom driving mechanism;
acquiring a second image acquired by the imaging equipment, wherein the second image is obtained by moving a lens of the imaging equipment to the second position and shooting the preset graphic card;
calculating the size parameter of the preset graphic card in the second image, and calculating the zoom magnification of the actual test according to the size parameter of the preset graphic card in the second image;
and comparing the zoom magnification to be tested with the zoom magnification of the actual test to obtain a test result.
8. The method according to claim 7, wherein the obtaining of the driving mechanism control parameter corresponding to the zoom magnification to be tested according to the calibration result comprises:
when the actual zoom magnification which is the same as the zoom magnification to be tested is recorded in the check table, acquiring the drive mechanism control parameter corresponding to the same actual zoom magnification from the check table, and taking the acquired drive mechanism control parameter as the drive mechanism control parameter corresponding to the zoom magnification to be tested;
and when the actual zoom magnification which is the same as the zoom magnification to be tested is not recorded in the check table, substituting the zoom magnification to be tested into the relation curve, and determining the control parameter of the driving mechanism corresponding to the zoom magnification to be tested in the relation curve.
9. The method of claim 7, wherein comparing the zoom magnification ratio to be tested with the zoom magnification ratio to be actually tested to obtain a test result comprises:
calculating the error between the zoom magnification to be tested and the actual zoom magnification;
if the error is smaller than a preset error threshold value, the test is passed, and if the error is not smaller than the error threshold value, the test is not passed.
10. The method of claim 1, wherein the predetermined graphic card is a pattern comprising one or more squares having a predetermined tilt angle with respect to an edge of the predetermined graphic card; after the acquiring the first image acquired by the imaging device, the method further comprises:
and testing a Modulation Transfer Function (MTF) corresponding to the first image according to a hypotenuse of the square included in the first image, wherein the hypotenuse is an edge of the square with the preset inclination angle relative to the edge of the preset graphic card.
11. A zoom magnification calibration device, comprising:
the control module is used for controlling the zoom driving mechanism of the imaging device to move according to the driving mechanism control parameter corresponding to the theoretical zoom magnification so as to move the lens of the imaging device to a first position corresponding to the theoretical zoom magnification through the zoom driving mechanism;
the image acquisition module is used for acquiring a first image acquired by the imaging equipment, wherein the first image is obtained by moving a lens of the imaging equipment to the first position and shooting a preset graphic card;
the size calculation module is used for calculating the size parameter of the preset graphic card in the first image;
the actual magnification calculation module is used for calculating the actual zooming magnification corresponding to the control parameter of the driving mechanism according to the size parameter;
and the calibration module is used for obtaining a calibration result according to the actual zoom magnification and the control parameter of the driving mechanism.
12. An electronic device comprising a memory and a processor, the memory having stored thereon a computer program that, when executed by the processor, causes the processor to carry out the method of any one of claims 1 to 10.
13. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1 to 10.
CN202010720582.6A 2020-07-24 2020-07-24 Zoom magnification calibration method and device, electronic equipment and storage medium Pending CN113973200A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010720582.6A CN113973200A (en) 2020-07-24 2020-07-24 Zoom magnification calibration method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010720582.6A CN113973200A (en) 2020-07-24 2020-07-24 Zoom magnification calibration method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113973200A true CN113973200A (en) 2022-01-25

Family

ID=79585508

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010720582.6A Pending CN113973200A (en) 2020-07-24 2020-07-24 Zoom magnification calibration method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113973200A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117061731A (en) * 2023-10-12 2023-11-14 荣耀终端有限公司 Zoom performance detection method and device, electronic equipment and medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117061731A (en) * 2023-10-12 2023-11-14 荣耀终端有限公司 Zoom performance detection method and device, electronic equipment and medium
CN117061731B (en) * 2023-10-12 2024-04-12 荣耀终端有限公司 Zoom performance detection method and device, electronic equipment and medium

Similar Documents

Publication Publication Date Title
US8897539B2 (en) Using images to create measurements of structures through the videogrammetric process
DE112017003205T5 (en) Compact, cost-effective VCSEL projector for high performance stereo depth camera
CN104811608B (en) Image capturing apparatus and image defect correction method thereof
WO2015100105A1 (en) Improving plenoptic camera resolution
CN104253939A (en) Focusing position adjusting method and electronic device
KR20150120317A (en) Method and electronic device for implementing refocusing
US20180173083A1 (en) Projection device, projection method, and program storage medium
CN109934773A (en) A kind of image processing method, device, electronic equipment and computer-readable medium
CN109146781A (en) Method for correcting image and device, electronic equipment in laser cutting
CN109005367B (en) High dynamic range image generation method, mobile terminal and storage medium
CN107534731B (en) Image processing apparatus, image processing method, and program
KR20160118948A (en) Method for determination of focal length for a zoom lens
CN111650744B (en) Method, device and equipment for adjusting parameters of galvanometer and readable storage medium
CN113973200A (en) Zoom magnification calibration method and device, electronic equipment and storage medium
US20160189350A1 (en) System and method for remapping of image to correct optical distortions
WO2019096057A1 (en) Dynamic image generation method, and processing device
CN112598719B (en) Depth imaging system, calibration method thereof, depth imaging method and storage medium
CN116182786A (en) Monocular vision ranging method, camera and medium
CN111768406A (en) Cell image processing method, device, equipment and storage medium
CN111630840B (en) Super-resolution image acquisition method and device and image sensor
CN110853087B (en) Parallax estimation method, device, storage medium and terminal
JP6849763B2 (en) Human body recognition methods, devices, devices and computer-readable storage media
CN114359401A (en) Calibration method, system and equipment
US20210027488A1 (en) General monocular machine vision system and method for identifying locations of target elements
JP6819629B2 (en) Image sensor

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20220125