CN111654631B - Zoom control method, system, device, and medium - Google Patents

Zoom control method, system, device, and medium Download PDF

Info

Publication number
CN111654631B
CN111654631B CN202010565421.4A CN202010565421A CN111654631B CN 111654631 B CN111654631 B CN 111654631B CN 202010565421 A CN202010565421 A CN 202010565421A CN 111654631 B CN111654631 B CN 111654631B
Authority
CN
China
Prior art keywords
camera
image
current
offset
vcm
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.)
Active
Application number
CN202010565421.4A
Other languages
Chinese (zh)
Other versions
CN111654631A (en
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.)
Xiamen Ziguang Zhanrui Technology Co ltd
Original Assignee
Xiamen Ziguang Zhanrui 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 Xiamen Ziguang Zhanrui Technology Co ltd filed Critical Xiamen Ziguang Zhanrui Technology Co ltd
Priority to CN202111564761.6A priority Critical patent/CN114285992B/en
Priority to CN202010565421.4A priority patent/CN111654631B/en
Publication of CN111654631A publication Critical patent/CN111654631A/en
Application granted granted Critical
Publication of CN111654631B publication Critical patent/CN111654631B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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
    • 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/62Control of parameters via user interfaces
    • 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
    • H04N23/675Focus control based on electronic image sensor signals comprising setting of focusing regions

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Human Computer Interaction (AREA)
  • Studio Devices (AREA)

Abstract

The invention discloses a zoom control method, a system, equipment and a medium, wherein the method comprises the following steps: when the first camera is switched to the second camera, calculating the current offset between the second central position of the second image acquired by the second camera and the first central position of the first image acquired by the first camera; adjusting a second central position of a second image acquired by a second camera according to the current offset so as to enable the second central position to coincide with the first central position; and cutting the second image by taking the adjusted second central position as the center. According to the method and the device, when the first camera is switched to the second camera, the center position of the current image shot by the second camera is adjusted to be overlapped with the first center position according to the obtained current offset, and the current image is cut according to the adjusted center position, so that when the terminal equipment with a plurality of cameras switches the cameras, the sudden change feeling generated by pictures shot by different cameras can be reduced, and the shooting experience of a user is improved.

Description

Zoom control method, system, device, and medium
Technical Field
The present invention relates to the field of imaging, and in particular, to a zoom control method, system, device, and medium.
Background
With the development of the smart phone industry, the camera function in the smart phone becomes more and more important, and compared with the gradual improvement of the resolution, the image quality and the frame rate of a camera of the smart phone, the zoom capability is not obviously increased. This is because the mobile phone camera is different from the traditional camera, is limited by the module volume, and cannot achieve the zoom function in the ultra-large range. Fortunately, the number of cameras can be increased, the smart phone gradually evolves from the first camera to the two-shot, three-shot, four-shot, or even five-shot state, and a hybrid zoom technology formed by combining the optical zoom capability of multiple cameras and the digital zoom of an image processor is developed.
Generally, the hybrid zoom module adopts two cameras with different focal lengths to combine, and adopts a long-focus camera to output an image under a higher zoom magnification, and adopts a common camera to output an image under a lower zoom magnification. By adopting the camera switching technology, the zoom in a super large range can be realized, the image quality can not be excessively sacrificed, and even a super wide-angle camera can be added into a camera group, so that a large-range zoom scheme similar to 0.5-1.0 mm, 1.0-5.0 mm and 5.0-20.0 mm can be realized.
Although the hybrid zoom technique solves the problem of zoom range, a new problem is introduced. Because the hardware parameter of different cameras itself is different (like optical center, focal length, FOV (field of view angle), internal parameter such as distortion), and arrange the difference at the installation of module (like the base line of arranging, relative angle, position etc.), make the camera of different focal lengths on the same module when shooing same object, must obtain different FOV, different relative position and the different image that shelters from, lead to different camera output image content can't coincide completely, the picture has sudden change to feel when finally leading to switching the camera, user experience has seriously been influenced. Particularly, in close-range shooting, such a sudden change feeling is more noticeable.
Disclosure of Invention
The technical problem to be solved by the present invention is to provide a simple and low-cost zoom control method, system, device and medium for reducing the sudden change of the image when the camera is switched to zoom, so as to overcome the defect that the image shot by the camera generates the sudden change when the camera is switched to zoom in the terminal device in the prior art.
The invention solves the technical problems through the following technical scheme:
the invention provides a zoom control method, which is applied to terminal equipment, wherein the terminal equipment comprises a plurality of cameras with different zoom ranges, and the zoom control method comprises the following steps:
when a first camera is switched to a second camera, calculating the current offset between the second center position of a second image acquired by the second camera and the first center position of a first image acquired by the first camera, wherein the first image and the second image are respectively images acquired by the first camera and the second camera at the same shooting distance and aiming at the same target shooting object;
adjusting the second center position of the second image acquired by the second camera according to the current offset so as to enable the second center position to coincide with the first center position;
and cutting the second image by taking the adjusted second central position as the center.
Preferably, the zoom control method includes:
presetting a corresponding relation between a reference VCM (voice coil motor) value of the terminal equipment and a reference offset, wherein the reference offset is the offset between the central position of a reference image acquired by the second camera and the central position of a reference image acquired by the first camera under a reference shooting distance;
the step of calculating the current offset between the second center position of the second image acquired by the second camera and the first center position of the first image acquired by the first camera further comprises:
when the second camera is focused with a target shooting object, acquiring a current VCM value of the terminal equipment;
acquiring the maximum VCM value of the terminal equipment;
the step of calculating the current offset between the second center position of the second image acquired by the second camera and the first center position of the first image acquired by the first camera specifically includes:
and calculating the current offset according to the current VCM value, the maximum VCM value, the reference VCM value and the corresponding reference deviation value.
Preferably, the step of calculating a current offset according to the current VCM value, the maximum VCM value, the reference VCM value and the corresponding reference deviation value comprises:
calculating the current offset shift according to a first formula, wherein the first formula is as follows:
Figure BDA0002547465050000031
wherein VCM represents the current VCM value, vcmMax represents the maximum VCM value, vcmCali represents the reference VCM value, shiftcai represents a reference offset corresponding to the reference VCM value, and a represents a current preset coefficient.
Preferably, the current preset coefficient a is obtained by the following steps:
presetting a negative correlation corresponding relation between the range of the shooting distance of the terminal equipment and a preset coefficient;
calculating the current shooting distance when the terminal equipment acquires the second image of the target shooting object;
and acquiring a corresponding current preset coefficient a according to the current shooting distance and the corresponding relation.
Preferably, the step of presetting the corresponding relationship between the reference VCM values and the reference offsets includes:
presetting a corresponding relation between a reference VCM value and a reference offset of the terminal equipment at different shooting distances;
the step of calculating the current offset according to the current VCM value, the maximum VCM value, the reference VCM value and the corresponding reference offset further comprises the following steps:
and acquiring the current shooting distance, and calculating a reference VCM value and a reference offset corresponding to the current shooting distance according to the corresponding relation.
Preferably, the step of calculating a current offset according to the current VCM value, the maximum VCM value, the reference VCM value and a corresponding reference offset comprises:
calculating the current offset shift according to a second formula, wherein the second formula is as follows:
Figure BDA0002547465050000032
and the VCM represents the current VCM value, the vcmMax represents the maximum VCM value, the vcmCali represents the reference VCM value, and the shiftCali represents the reference offset corresponding to the reference VCM value.
Preferably, the zoom control method further includes:
receiving a focal length adjusting instruction, wherein the focal length adjusting instruction is used for representing that the initial zooming magnification of the first camera is adjusted to the target zooming magnification of the second camera;
acquiring the current real zooming magnification according to the corresponding relation between the preset target zooming magnification and the real zooming magnification;
and controlling the first camera to be switched to a second camera and adjusting the zooming magnification of the second camera to the current real zooming magnification.
Preferably, the step of obtaining the current real zoom magnification according to the preset corresponding relationship between the target zoom magnification and the real zoom magnification includes:
obtaining a current real zooming magnification r' according to a third formula:
Figure BDA0002547465050000041
wherein r represents the current target zoom magnification, r' represents the current real zoom magnification, r1A lower limit value representing a zoom magnification of the second camera;
the zoom control method further includes the steps of: obtaining r according to a fourth formula2The fourth formula is:
Figure BDA0002547465050000042
wherein H represents a length of the second image, W represents a width of the second image, shiftY represents a maximum offset amount in the width direction, shiftX represents a maximum offset amount in the length direction, r0Represents a ratio of the FOV area of the second camera to the FOV area of the first camera.
Preferably, the step of cropping the second image with the adjusted second center position as the center includes:
cutting the second image according to the original proportion of the second image by taking the adjusted second central position as a center;
or the like, or, alternatively,
the step of cropping the second image with the adjusted second center position as the center includes:
respectively calculating the distance between each edge of the second image acquired by the second camera and the corresponding edge of the first image acquired by the first camera, and taking the edge of the first image corresponding to the shortest distance as a target edge;
and cutting the second image according to the original proportion of the second image by taking the adjusted second central position as a center to generate a third image, wherein one edge of the third image is superposed with the target edge.
The invention also provides a zoom control system, which is applied to terminal equipment, wherein the terminal equipment comprises a plurality of cameras with different zoom ranges, and the zoom control system comprises: the system comprises a current offset calculation module, a center position adjustment module and an image cutting module;
the current offset calculation module is used for calculating a current offset between a second central position of a second image acquired by a second camera and a first central position of a first image acquired by the first camera when the first camera is switched to the second camera, wherein the first image and the second image are respectively images acquired by the first camera and the second camera at the same shooting distance and aiming at the same target shooting object;
the center position adjusting module is used for adjusting the second center position of the second image acquired by the second camera according to the current offset so as to enable the second center position to be coincident with the first center position;
and the image cutting module is used for cutting the second image by taking the adjusted second central position as the center.
Preferably, the zoom control system comprises: the VCM acquisition module comprises a reference presetting module, a current VCM acquisition module and a maximum VCM acquisition module;
the reference presetting module is used for presetting a corresponding relation between a reference VCM value of the terminal equipment and a reference offset, wherein the reference offset is an offset between the center position of a reference image acquired by the second camera and the center position of the reference image acquired by the first camera at a reference shooting distance;
the current VCM obtaining module is used for obtaining a current VCM value of the terminal equipment when the second camera is focused on a target shooting object;
the maximum VCM obtaining module is used for obtaining the maximum VCM value of the terminal equipment;
the current offset calculation module is specifically configured to calculate a current offset according to the current VCM value, the maximum VCM value, the reference VCM value, and the corresponding reference deviation value.
Preferably, the current offset calculating module is configured to calculate the current offset shift according to a first formula, where the first formula is:
Figure BDA0002547465050000061
wherein VCM represents the current VCM value, vcmMax represents the maximum VCM value, vcmCali represents the reference VCM value, shiftcai represents a reference offset corresponding to the reference VCM value, and a represents a current preset coefficient.
Preferably, the zoom control system further includes a current preset coefficient obtaining module, configured to preset a negative correlation corresponding relationship between a range of the shooting distance of the terminal device and a preset coefficient, calculate a current shooting distance when the terminal device obtains the second image of the target shooting object, and obtain a corresponding current preset coefficient a according to the current shooting distance and the corresponding relationship.
Preferably, the reference presetting module is specifically configured to preset a corresponding relationship between a reference VCM value and a reference offset of the terminal device at different shooting distances, and the zoom control system further includes a current shooting distance obtaining module configured to obtain a current shooting distance, and calculate, according to the corresponding relationship, a reference VCM value and a reference offset corresponding to the current shooting distance.
Preferably, the current offset calculating module is configured to calculate the current offset shift according to a second formula, where the second formula is:
Figure BDA0002547465050000062
and the VCM represents the current VCM value, the vcmMax represents the maximum VCM value, the vcmCali represents the reference VCM value, and the shiftCali represents the reference offset corresponding to the reference VCM value.
Preferably, the zoom control system further comprises: the zoom instruction receiving module, the real magnification acquiring module and the zoom magnification adjusting module;
the zoom instruction receiving module is used for receiving a focal length adjusting instruction, and the focal length adjusting instruction is used for representing that the initial zoom magnification of the first camera is adjusted to the target zoom magnification of the second camera;
the real magnification acquisition module is used for acquiring the current real zooming magnification according to the corresponding relation between the preset target zooming magnification and the real zooming magnification;
the zooming magnification adjusting module is used for controlling the first camera to be switched to the second camera and adjusting the zooming magnification of the second camera to the current real zooming magnification.
Preferably, the real magnification acquiring module is configured to acquire the current real zoom magnification r' according to a third formula:
Figure BDA0002547465050000071
wherein r represents the current target zoom magnification, r' represents the current real zoom magnification, r1A lower limit value representing a zoom magnification of the second camera;
the real multiplying power obtaining module is also used for obtaining r according to a fourth formula2The fourth formula is:
Figure BDA0002547465050000072
wherein H represents a length of the second image, W represents a width of the second image, shiftY represents a maximum offset amount in the width direction, shiftX represents a maximum offset amount in the length direction, r0Represents a ratio of the FOV area of the second camera to the FOV area of the first camera.
Preferably, the image cropping module is configured to crop the second image according to an original proportion of the second image, with the adjusted second central position as a center;
or the like, or, alternatively,
the image cropping module comprises: a distance calculation unit and a clipping unit;
the distance calculation unit is used for calculating the distance between each edge of the second image acquired by the second camera and the corresponding edge of the first image acquired by the first camera respectively, and taking the edge of the first image corresponding to the shortest distance as a target edge;
and the cutting unit is used for cutting the second image according to the original proportion of the second image by taking the adjusted second central position as the center to generate a third image, and one edge of the third image is superposed with the target edge.
The invention also provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the zoom control method as described above when executing the computer program.
The invention also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, carries out the steps of the zoom control method as described above.
The positive progress effects of the invention are as follows: according to the method and the device, when the first camera is switched to the second camera in different zooming ranges, the center position of the second image shot by the second camera is adjusted to be overlapped with the first center position according to the obtained current offset, and the second image is cut according to the adjusted center position, so that when the terminal equipment with a plurality of cameras switches the cameras, sudden change feeling generated by pictures shot by different cameras can be reduced, and the shooting experience of a user is improved.
Drawings
Fig. 1 is a schematic block diagram of a camera module according to embodiment 1 of the present invention.
Fig. 2 is a flowchart of a zoom control method according to embodiment 1 of the present invention.
Fig. 3 is a schematic diagram of an imaging region during switching of image capturing according to embodiment 1 of the present invention.
Fig. 4 is another schematic diagram of an imaging region in switching image capturing according to embodiment 1 of the present invention.
Fig. 5 is a flowchart of a specific implementation manner of step 101 in embodiment 2 of the present invention.
Fig. 6 is a flowchart of an obtaining manner of the current preset coefficient a in embodiment 2 of the present invention.
Fig. 7 is a partial flowchart of a zoom control method according to embodiment 3 of the present invention.
Fig. 8 is a partial flowchart of a zoom control method according to embodiment 4 of the present invention.
Fig. 9 is a flowchart of a specific implementation manner of step 103 in embodiment 4 of the present invention.
Fig. 10 is a schematic diagram of an imaging region during switching of image capturing according to embodiment 4 of the present invention.
Fig. 11 is a schematic block diagram of a zoom control system in embodiment 5 of the present invention.
Fig. 12 is a schematic block diagram of a part of a zoom control system in embodiment 6 of the present invention.
Fig. 13 is a schematic block diagram of a part of a zoom control system in embodiment 8 of the present invention.
Fig. 14 is a module diagram illustrating an implementation manner of an image cropping module in embodiment 8 of the present invention.
Fig. 15 is a block diagram of an electronic device according to embodiment 9 of the present invention.
Detailed Description
The invention is further illustrated by the following examples, which are not intended to limit the scope of the invention.
The terminal device in this embodiment may refer to various forms of User Equipment (UE), an access terminal, a subscriber unit, a subscriber station, a mobile station (mobile station, MS), a remote station, a remote terminal, a mobile device, a user terminal, a wireless communication device, a user agent, or a user equipment. The terminal device may also be a cellular phone, a cordless phone, a Session Initiation Protocol (SIP) phone, a Wireless Local Loop (WLL) station, a Personal Digital Assistant (PDA), a handheld device with a Wireless communication function, a computing device or other processing devices connected to a Wireless modem, a vehicle-mounted device, a wearable device, a terminal device in a future 5G Network or a terminal device in a future evolved Public Land Mobile Network (PLMN), and the like, which is not limited in this embodiment.
The descriptions of the first, second, etc. appearing in the embodiments of the present application are only for illustrating and differentiating the objects, and do not represent the order or the particular limitation of the number of the devices in the embodiments of the present application, and do not constitute any limitation to the embodiments of the present application. For example, a first element could be termed a second element, without departing from the scope of the present disclosure, and, similarly, a second element could be termed a first element.
The term "user" appearing in embodiments of the present application may indicate a person using an electronic device or a device using an electronic device (e.g., an artificial intelligence electronic device).
The zoom control method, system, apparatus, and medium of the present application are described below with reference to specific embodiments.
Example 1
The present embodiment provides a zoom control method, which is applied to a terminal device, where the terminal device includes a plurality of cameras with different zoom ranges, as shown in fig. 1, in a specific example, a camera module 1 of the terminal device includes a wide-angle camera 11, a telephoto camera 12, and an ultra-wide-angle camera 13, it should be understood that the above specific example is only an example of the camera module in the present embodiment, and is not limited thereto, and the position and the shape of the camera module 1 in the terminal device, the shape of the camera included therein, and the positional relationship between the cameras may all be set according to actual requirements.
In this embodiment, in order to facilitate description of the present solution, the following description takes an example in which a terminal device includes two cameras with different zoom ranges, and as shown in fig. 2, the zoom control method in this embodiment includes:
and 101, when the first camera is switched to the second camera, calculating the current offset.
And 102, adjusting a second center position of a second image acquired by a second camera according to the current offset so as to enable the second center position to coincide with the first center position.
And 103, cutting the second image by taking the adjusted second central position as the center.
In step 101, the terminal device is kept still and the first camera is controlled to switch to the second camera, that is, the first image and the second image are respectively images obtained by the first camera and the second camera at the same shooting distance for shooting an object with the same target.
Wherein, the current offset is the current offset between the second center position of the second image acquired by the second camera and the first center position of the first image acquired by the first camera, and the concrete expression form of the current offset can be a vector, such as (a, b), which indicates that the deviation of the second center position of the second image in the first direction is a and the deviation in the second direction is b, and therefore, in step 102, the second center position of the second image is moved in a negative direction of the first direction by a, and moved in a negative direction of the second direction by b so that the second center position of the second image coincides with the first center position, and for example, the vector (a, b) may also indicate that the deviation is b at an angle of a, therefore, in step 102, the second center position of the second image needs to be moved by b toward the negative direction of the angle a, it should be understood that the number of elements in the specific vector and the meaning represented by each element can be set according to actual requirements; the specific expression of the current offset amount may also be coordinates, such as (n, m), which represents that the deviation of the second center position of the second image in the x-axis direction is n and the deviation in the y-axis direction is m, so in step 102, the second center position of the second image needs to be moved n in the negative direction of the x-axis and m in the negative direction of the y-axis so that the second center position of the second image coincides with the first center position, it should be understood that the current offset amount may also be a specific numerical value or any other form that can represent the specific positional relationship between the second center position of the second image and the first center position of the first image, and the specific expression of which represents the current offset amount may be selected according to the actual situation.
It should be understood that clipping in the present embodiment means to correct the display range of the second image, that is, the image range displayed on the display device of the terminal apparatus is a corrected image centered on the adjusted second center position.
For a better understanding of the present embodiment, the principle of the present embodiment is further explained as follows:
for better explanation, a wide-angle camera is taken as a first camera, an ultra-wide-angle camera is taken as a second camera, as shown in fig. 3, when the same object is shot and switched from the wide-angle camera 11 to the ultra-wide-angle camera 13, because the hardware parameters of the wide-angle camera 11 and the ultra-wide-angle camera 13 are different and the installation positions in the terminal equipment are different, the center position 007 of a first image 005 obtained by the wide-angle camera 11 is different from the center position 006 of a second image 004 obtained by the ultra-wide-angle camera 002, when the cameras are switched, the second image 004 obtained by the ultra-wide-angle camera 13 is displaced from the image 005 obtained by the wide-angle camera 11, so that a sudden change feeling is given to the user, especially when the camera is shot at a short distance, the user experience when switching cameras is reduced.
As shown in fig. 4, in the present embodiment, by calculating the current offset amount between the center position 007 of the first image 005 obtained by the wide-angle camera 11 and the center position 006 of the second image 004 obtained by the ultra-wide-angle camera 002, when the camera is switched, the second center position of the second image obtained by the ultra-wide-angle camera 002 is adjusted to coincide with the center position of the first image 005 obtained by the wide-angle camera 11, and the second image 004 is cropped with the adjusted second center position 007 as the center to obtain the cropped image 008, so that the image displayed to the user is prevented from being displaced, and the user experience of the user in the shooting process is improved.
In this embodiment, when switching from a first camera with a different zoom range to a second camera, the center position of a second image captured by the second camera is adjusted to coincide with the first center position according to the obtained current offset, and the second image is cut according to the adjusted center position, so that when switching cameras by a terminal device having a plurality of cameras, abrupt changes generated when capturing pictures by different cameras can be reduced, and the capturing experience of a user is improved.
Example 2
The present embodiment provides a zoom control method, which is a further improvement on embodiment 1, and includes the steps of: and presetting a corresponding relation between a reference VCM value of the terminal equipment and the reference offset.
The reference offset is an offset between the center position of the reference image acquired by the second camera and the center position of the reference image acquired by the first camera at a reference shooting distance, wherein the reference shooting distance is a preset distance between the terminal equipment and the target shooting object when the terminal equipment is kept still.
In a specific embodiment, the correspondence relationship may be preset by:
when the terminal equipment and the object shooting object are under the reference shooting distance, firstly, the first camera can realize the focusing of the object shooting object through an AF (automatic focusing) algorithm, when the first camera is in correct focus, the corresponding first VCM value can be obtained, and at the same time, the first reference center position of the image obtained by the first camera can be obtained, and then, under the condition that the terminal equipment is kept still, the first camera is switched to the second camera, the second camera can realize correct focusing on the same object to be shot through the AF algorithm, a corresponding second VCM value can be obtained, the VCM value at this time is determined as a reference VCM value, and at the same time, a second reference center position of the image obtained by the second camera can be obtained, thus, the offset of the second reference center position from the first reference center position can be determined, which is the reference offset. Therefore, the corresponding relation between the reference VCM value and the reference offset when the second camera is aligned with the target to shoot the object can be determined.
In this embodiment, by presetting a corresponding relationship between a reference VCM value and a reference offset at a reference shooting distance, the zoom control method of this embodiment can be set more simply, and is beneficial for a manufacturer to produce the camera module and the terminal device including the camera module according to the same specification, thereby improving the universality and market applicability of the method.
In an alternative embodiment, as shown in fig. 5, the following steps are further included before calculating the current offset in step 101:
step 201, when a second camera is focused with a target shooting object, acquiring a current VCM value of the terminal equipment;
step 202, obtaining the maximum VCM value of the terminal equipment.
Step 203, obtaining a reference VCM value and a reference offset.
And the maximum VCM value is the maximum VCM value which can be reached by the VCM motor in the current terminal equipment.
In an optional implementation manner, in step 101, the current offset shift may be specifically calculated according to the following formula:
Figure BDA0002547465050000131
the VCm represents a current VCM value when the second camera is aligned with a target to shoot an article, the vcmMax represents a maximum VCM value of the terminal equipment, the vcmmali represents a reference VCM value, the shiftCali represents a reference offset corresponding to the reference VCM value, and a represents a current preset coefficient.
In one specific scenario, such as: when the reference VCM value obtained during calibration is 400, the corresponding reference offset shiftCali is 20, the maximum VCM value vcmMax is 1024, the current VCM value when the second camera aims at the target to shoot the object is 600, and the current preset coefficient at the moment is 0.6, the calculated current offset is approximately equal to 8.75. It should be understood that the above example is only an example of the offset being a specific value, and is not meant to be a limitation of the embodiment of the present invention, and the offset may also be in the form of vector representation, coordinate representation, and any specific positional relationship that may represent the second center position of the second image and the first center position of the first image.
In an alternative embodiment, as shown in fig. 6, the current preset coefficient a may be obtained by the following steps:
and step 204, presetting a negative correlation corresponding relation between the range of the shooting distance of the terminal equipment and a preset coefficient.
And step 205, calculating the current shooting distance when the terminal equipment acquires the second image of the target shooting object.
And step 206, acquiring a corresponding current preset coefficient a according to the current shooting distance and the corresponding relation.
The value of a is larger as the terminal device is farther away from the target shooting object, and the value of a is larger as the terminal device is closer to the target shooting object. In this embodiment, a ranges from 0 to 1.
In this embodiment, by setting the corresponding relationship between the shooting distance and a, the corresponding preset coefficients are preset for different shooting distances, so that the calculated current offset is more accurate.
Example 3
The present embodiment provides a zoom control method, which is a further improvement on embodiment 1, and includes the steps of:
and presetting the corresponding relation between the reference VCM value of the terminal equipment and the reference offset at different shooting distances.
Specifically, the corresponding relationship between the reference VCM value and the reference offset in different shooting distance ranges may be set, or the corresponding relationship between the reference VCM value and the reference offset in each shooting distance may be set.
In an alternative embodiment, as shown in fig. 7, the following steps are further included before calculating the current offset in step 101:
step 301, when the second camera is focused on the target shooting object, obtaining a current VCM value of the terminal device.
And 302, acquiring the maximum VCM value of the terminal equipment.
And 303, acquiring the current shooting distance, and acquiring a reference VCM value and a reference offset corresponding to the current shooting distance according to the corresponding relation.
And the maximum VCM value is the maximum VCM value which can be reached by the VCM motor in the current terminal equipment.
In an optional implementation manner, in step 101, the current offset shift may be specifically calculated according to the following formula:
calculating the current offset shift according to a second formula, wherein the second formula is as follows:
Figure BDA0002547465050000141
the VCm represents a current VCM value when the second camera is aligned with a target to shoot an article, the vcmMax represents a maximum VCM value of the terminal equipment, the vcmmai represents a corresponding reference VCM value under the current shooting distance, and the shiftCali represents a corresponding reference offset under the current shooting distance.
In this embodiment, by setting the corresponding reference VCM value and the reference offset at different shooting distances, the corresponding current offset is obtained for different shooting distances during real shooting, so that the adjustment of the second center position is more accurate.
Example 4
This embodiment provides a zoom control method, which is an improvement on any one of the zoom control methods in embodiments 1 to 3, and as shown in fig. 8, in this embodiment, before step 101, the method further includes:
step 401, receiving a focus adjustment instruction.
And step 402, acquiring the current real zooming magnification according to the corresponding relation between the preset target zooming magnification and the real zooming magnification.
And step 403, controlling the first camera to be switched to the second camera and adjusting the zoom magnification of the second camera to the current real zoom magnification.
And the focal length adjusting instruction is used for representing the adjustment from the initial zooming magnification of the first camera to the target zooming magnification of the second camera.
For better understanding of the present embodiment, the following description will further explain the principle of the present embodiment by taking the wide-angle camera as the first camera and the ultra-wide-angle camera as the second camera as an example:
when zooming is performed, such as when the scene content is increasing in a screen from an initial zoom magnification of 0.9 to a target zoom magnification of 0.6, the wide-angle camera 11 must be switched to the ultra-wide-angle camera 13, the acquired image is accordingly switched from the first image 005 to the second image 004, and the center position of the image is 006 before adjustment of the second image 004, at which time the entire presentation area of the second image 004 can be obtained, but since the center position 006 of the second image 004 needs to be adjusted to coincide with the center position 007 of the first image 005, the entire zoom content of 0.6 times cannot be obtained, which is equivalent to sacrificing a part of the ROI (attention area) area of the second image 004, i.e., the blank area between the cropped image 008 and the second image 004 in fig. 4, in this case, although the zoom magnification requested by the user is 0.6, actually, the actual zoom magnification of the obtained adjusted image 008 is greater than 0.6, therefore, in order to make the zoom magnification of the final image conform to the target zoom magnification requested by the user, a corresponding relationship between the target zoom magnification and the real zoom magnification needs to be set.
In a specific embodiment, in step 402, the current real zoom magnification r' may be obtained according to a third formula:
Figure BDA0002547465050000161
where r represents a current target zoom magnification, specifically, it represents a zoom magnification desired by a current user, for example, it may be represented by a zoom numerical value displayed to the user by a display device of the terminal device.
r' represents the current true zoom magnification, specifically, it represents the true zoom magnification corresponding to the second camera at the current target zoom magnification.
r1Represents a lower limit value of the zoom magnification of the second camera, e.g., when the range of the zoom magnification of the second camera is (c, d), then r is at that time1The value of (a) is c.
In a specific embodiment, a coordinate system is established with the length of the second image as the X-axis and the width of the second image as the Y-axis, and the offset includes the offset in the X-axis direction and the offset in the Y-axis direction, wherein the r can be obtained according to the fourth formula in step 4022The fourth formula is:
Figure BDA0002547465050000162
wherein H represents a width of the second image, W represents a length of the second image, shiftY represents a maximum offset amount in the width direction, shiftX represents a maximum offset amount in the length direction, r0Represents a ratio of the FOV area of the second camera to the FOV area of the first camera.
Wherein, in the current terminal equipment, the VCM valueWhen the lower limit value is obtained, a value of the maximum offset may be obtained, and specifically, the lower limit value may be taken as a specific value of the VCM parameter and substituted into the first formula or the second formula, so as to obtain the corresponding maximum offset. That is, the maximum amount of shift in the X-axis direction and the maximum amount of shift in the Y-axis direction may be taken, respectively, and the specific calculation r may be determined by comparing the value of the maximum amount of shift in the X-axis direction divided by the length of the second image and the value of the maximum amount of shift in the Y-axis direction divided by the width of the second image2So that r can be determined2The value of (c).
In the embodiment, the relation between the target zoom magnification and the real zoom magnification can be obtained through simple linear mapping, so that the complexity of operation is reduced, and the imaging speed during zooming operation is increased.
In an optional implementation manner, step 103 may specifically include:
and cutting the second image according to the original proportion of the second image by taking the adjusted second central position as the center.
In this embodiment, the second image may be cropped in the original proportion of the second image to further reduce the sense of abrupt change of the image presented to the user when the camera is changed.
In an alternative embodiment, as shown in fig. 9, the step 103 may specifically include the following steps:
step 1031, respectively calculating the distance between each edge of the second image acquired by the second camera and the corresponding edge of the first image acquired by the first camera, and taking the edge of the first image corresponding to the shortest distance as a target edge;
and step 1032, cutting the second image according to the original proportion of the second image by taking the adjusted second central position as a center to generate a third image.
Wherein one side of the third image coincides with the target side.
For better understanding of the present embodiment, the following describes the present embodiment by taking a wide-angle camera as a first camera and an ultra-wide-angle camera as a second camera:
as shown in fig. 10, when switching from the wide-angle camera 11 to the ultra-wide-angle camera 13, the acquired image is switched from the first image 005 to the second image 004 accordingly, and after the first image 005 is switched to the second image 004, the offset position of the center position 006 of the second image 004 in the positive y direction is larger than that in the negative x-axis direction, so that the center position 006 of the second image 004 needs to be adjusted to coincide with the center position 007 of the first image, and during the adjustment, in order to avoid the adjusted image from having a black border, that is, to avoid the adjusted image covering a range larger than the image 004 before the adjustment, the position adjustment needs to be performed with reference to the positive y-axis direction having a large offset position, and at this time, the second image 004 is cut out so that one side of the adjusted image (the upper side of the rectangular parallelepiped in the figure) coincides with one side of the first image to obtain the third image, with the center position 007 as the center, and in proportion to the original ratio of the second image 008.
In this embodiment, the distance between the edges corresponding to the second image and the first image is obtained, so that a target edge with the shortest distance can be obtained, and the defect of a black edge of the cut image can be avoided by controlling the coincidence of one edge of the cut third image and the target edge, so that the user experience when the camera is switched is improved.
Example 5
The present embodiment provides a zoom control system, which is applied to a terminal device, where the terminal device includes a plurality of cameras with different zoom ranges, as shown in fig. 1, in a specific example, a camera module 1 of the terminal device includes a wide-angle camera 11, a telephoto camera 12, and an ultra-wide-angle camera 13, it should be understood that the above specific example is only an example of the camera module in the present embodiment, and is not limited thereto, and the position of the camera module 1 in the terminal device, the shape of itself, the shape of the camera included therein, and the positional relationship between the cameras may all be set according to actual requirements.
In this embodiment, in order to facilitate description of the present solution, the following description takes an example in which a terminal device includes two cameras with different zoom ranges, and as shown in fig. 11, the zoom control method in this embodiment includes: a current offset calculation module 501, a center position adjustment module 502, and an image cropping module 503.
The current offset calculation module 501 is used to calculate the current offset.
The center position adjusting module 502 is configured to adjust a second center position of a second image acquired by a second camera according to the current offset, so that the second center position coincides with the first center position.
The image cropping module 503 is configured to crop the second image with the adjusted second center position as the center.
The current offset calculation module 501 is specifically configured to keep the terminal device still and control the first camera to switch to the second camera, that is, the first image and the second image are respectively images obtained by the first camera and the second camera at the same shooting distance for shooting an object with the same target.
The current offset is a current offset between a second center position of a second image acquired by the second camera and a first center position of a first image acquired by the first camera, and a specific expression of the current offset may be a vector, such as (a, b), which indicates that a deviation of the second center position of the second image in a first direction is a and a deviation in a second direction is b, so that, in step 102, the second center position of the second image needs to be moved in a negative direction of the first direction by a and in a negative direction by b so that the second center position of the second image coincides with the first center position, and as vector (a, b) also indicates that a deviation is b at an angle a, the number of elements in the specific vector and the meaning represented by each element may be set according to actual needs; the specific expression of the current offset amount may also be coordinates, such as (n, m), which represents that the deviation of the second center position of the second image in the x-axis direction is n and the deviation in the y-axis direction is m, so in step 102, the second center position of the second image needs to be moved n in the negative direction of the x-axis and m in the negative direction of the y-axis so that the second center position of the second image coincides with the first center position, it should be understood that the current offset amount may also be a specific numerical value or any other form that can represent the specific positional relationship between the second center position of the second image and the first center position of the first image, and the specific expression of which represents the current offset amount may be selected according to the actual situation.
It should be understood that clipping in the present embodiment means to correct the display range of the second image, that is, the image range displayed on the display device of the terminal apparatus is a corrected image centered on the adjusted second center position.
For a better understanding of the present embodiment, the principle of the present embodiment is further explained as follows:
for better explanation, a wide-angle camera is taken as a first camera, an ultra-wide-angle camera is taken as a second camera, as shown in fig. 3, when the same object is shot and switched from the wide-angle camera 11 to the ultra-wide-angle camera 13, because the hardware parameters of the wide-angle camera 11 and the ultra-wide-angle camera 13 are different and the installation positions in the terminal equipment are different, the center position 007 of a first image 005 obtained by the wide-angle camera 11 is different from the center position 006 of a second image 004 obtained by the ultra-wide-angle camera 002, when the cameras are switched, the second image 004 obtained by the ultra-wide-angle camera 13 is displaced from the image 005 obtained by the wide-angle camera 11, so that a sudden change feeling is given to the user, especially when the camera is shot at a short distance, the user experience when switching cameras is reduced.
As shown in fig. 4, in the present embodiment, the current offset amount of the center position 007 of the first image 005 obtained by the wide-angle camera 11 and the current offset amount of the center position 006 of the second image 004 obtained by the ultra-wide-angle camera 002 are calculated by the current offset amount calculation module 501, when the camera is switched, the center position adjustment module 502 adjusts the second center position of the second image obtained by the ultra-wide-angle camera 002 to coincide with the center position of the first image 005 obtained by the wide-angle camera 11, and the image cropping module 503 crops the second image 004 with the adjusted second center position 007 as the center to obtain the cropped image 008, so that the image displayed to the user is prevented from being displaced, and the user experience of the user in the shooting process is improved.
In this embodiment, when switching from a first camera with a different zoom range to a second camera, the center position of the second image captured by the second camera is adjusted to coincide with the first center position by the center position adjusting module according to the obtained current offset, and the second image is clipped by the image clipping module according to the adjusted center position, so that when switching cameras by a terminal device having a plurality of cameras, abrupt changes generated by pictures captured by different cameras can be reduced, thereby improving the shooting experience of a user.
Example 6
This embodiment provides a zoom control system, which is a further improvement of embodiment 5, and as shown in fig. 12, the zoom control system in this embodiment further includes: a reference presetting module 601, a current VCM obtaining module 602, and a maximum VCM obtaining module 603.
The reference presetting module 601 is configured to preset a corresponding relationship between a reference VCM value of the terminal device and a reference offset, where the reference offset is an offset between a center position of a reference image acquired by the second camera and a center position of a reference image acquired by the first camera at a reference shooting distance.
The current VCM obtaining module 602 is configured to obtain a current VCM value of the terminal device when the second camera is focused on the target shooting object.
The maximum VCM obtaining module 603 is configured to obtain a maximum VCM value of the terminal device.
The current offset calculation module 501 is specifically configured to calculate a current offset according to the current VCM value, the maximum VCM value, the reference VCM value, and the corresponding reference deviation value.
In a specific embodiment, the reference presetting module 601 may be configured to preset the correspondence relationship by:
when the terminal equipment and the target shooting object are in a reference shooting distance, firstly, the first camera can realize focusing on the target shooting object through an AF algorithm, when the first camera is correctly focused, a corresponding first VCM value can be obtained, meanwhile, a first reference center position of an image obtained by the first camera can be obtained, then, under the condition that the terminal equipment is kept still, the first camera is switched to a second camera, the second camera can realize correct focusing on the same target shooting object through the AF algorithm, a corresponding second VCM value can be obtained, the VCM value at the moment is determined to be a reference VCM value, meanwhile, a second reference center position of an image obtained by the second camera can be obtained, and therefore, the offset between the second reference center position and the first reference center position can be determined, and the offset is a reference offset. Therefore, the corresponding relation between the reference VCM value and the reference offset when the second camera is aligned with the target to shoot the object can be determined.
In this embodiment, the reference presetting module presets the corresponding relationship between a reference VCM value and a reference offset by presetting the reference VCM value at a reference shooting distance, so that the zoom control method of this embodiment is simpler to set, and is beneficial to a manufacturer to produce the camera module and the terminal device including the camera module according to the same specification, thereby improving the universality and market applicability of the method.
In an alternative embodiment, the current offset calculating module 501 is configured to generate the current offset shift according to a first formula, where the first formula is:
Figure BDA0002547465050000211
the VCm represents a current VCM value when the second camera is aligned with a target to shoot an article, the vcmMax represents a maximum VCM value of the terminal equipment, the vcmmali represents a reference VCM value, the shiftCali represents a reference offset corresponding to the reference VCM value, and a represents a current preset coefficient.
In one specific scenario, such as: when the reference VCM value obtained during calibration is 400, the corresponding reference offset shiftCali is 20, the maximum VCM value vcmMax is 1024, the current VCM value when the second camera aims at the target to shoot the object is 600, and the current preset coefficient at the moment is 0.6, the calculated current offset is approximately equal to 8.75. It should be understood that the above example is only an example of the offset being a specific value, and is not meant to be a limitation of the embodiment of the present invention, and the offset may also be in the form of vector representation, coordinate representation, and any specific positional relationship that may represent the second center position of the second image and the first center position of the first image. In an optional implementation manner, the zoom control system further includes a current preset coefficient obtaining module 604, configured to preset a negative correlation corresponding relationship between a range of the shooting distance of the terminal device and a preset coefficient, calculate a current shooting distance when the terminal device obtains the target shooting object, and obtain a corresponding current preset coefficient a according to the current shooting distance and the corresponding relationship.
The value of a is larger as the terminal device is farther away from the target shooting object, and the value of a is larger as the terminal device is closer to the target shooting object. In this embodiment, a ranges from 0 to 1.
In this embodiment, the corresponding relationship between the shooting distance and the a is set by the current preset coefficient obtaining module, and the corresponding preset coefficients are preset for different shooting distances, so that the calculated current offset is more accurate.
Example 7
The present embodiment provides a zoom control system, which is a further improvement of embodiment 5, where the reference presetting module 601 is specifically configured to preset a corresponding relationship between a reference VCM value and a reference offset of a terminal device at different shooting distances, and the zoom control system in the present embodiment further includes a current shooting distance obtaining module configured to obtain a current shooting distance, and obtain, according to the corresponding relationship, a reference VCM value and a reference offset corresponding to the current shooting distance.
In an alternative embodiment, the current offset calculating module 501 is configured to calculate the current offset shift according to a second formula, where the second formula is:
Figure BDA0002547465050000221
the VCm represents a current VCM value when the second camera is aligned with a target to shoot an article, the vcmMax represents a maximum VCM value of the terminal equipment, the vcmmai represents a corresponding reference VCM value under the current shooting distance, and the shiftCali represents a corresponding reference offset under the current shooting distance.
In this embodiment, by setting the corresponding reference VCM value and the reference offset at different shooting distances, the corresponding current offset is obtained for different shooting distances during real shooting, so that the adjustment of the second center position is more accurate.
Example 8
This embodiment provides a zoom control system, which is an improvement on any one of the zoom control systems of embodiments 5 to 7, and as shown in fig. 13, the zoom control system of this embodiment further includes: a zoom instruction receiving module 801, a real magnification acquiring module 802, and a zoom magnification adjusting module 803.
The zoom instruction receiving module 801 is configured to receive a focal length adjustment instruction.
The real magnification acquisition module 802 is configured to acquire a current real zoom magnification according to a preset correspondence between a target zoom magnification and a real zoom magnification.
The zoom magnification adjustment module 803 is configured to control the first camera to switch to the second camera and adjust the zoom magnification of the second camera to the current real zoom magnification.
And the focal length adjusting instruction is used for representing the adjustment from the initial zooming magnification of the first camera to the target zooming magnification of the second camera.
For better understanding of the present embodiment, the following description will further explain the principle of the present embodiment by taking the wide-angle camera as the first camera and the ultra-wide-angle camera as the second camera as an example:
when zooming is performed, such as when the scene content is increasing from the initial zoom magnification of 0.9 to the target zoom magnification of 0.6, the wide-angle camera 11 is switched to the ultra-wide-angle camera 13, and the acquired image is correspondingly switched from the first image 005 to the second image 004, and the center position of the image is 006 before the adjustment of the second image 004, the entire presentation area of the second image 004 can be obtained, but since the center position 006 of the second image 004 needs to be adjusted to coincide with the center position 007 of the first image 005, the entire zoom content of 0.6 can not be obtained, which is equivalent to sacrificing a part of the ROI area of the second image 004, namely the blank area between the cropped image 008 and the second image 004 in fig. 4, in this case, although the zoom magnification requested by the user is 0.6, actually, the actual zoom magnification of the obtained adjusted image 008 is greater than 0.6, therefore, in order to make the zoom magnification of the final image conform to the target zoom magnification requested by the user, a corresponding relationship between the target zoom magnification and the real zoom magnification needs to be set, and therefore, in this embodiment, through the preset corresponding relationship between the target zoom magnification and the real zoom magnification, when the user performs a zoom operation, the real magnification acquisition module 802 and the zoom magnification adjustment module 803 map the current target zoom magnification to the current real zoom magnification, so that the image conforming to the desired zoom magnification of the user can be presented to the user.
In a specific embodiment, the real magnification acquiring module 802 is configured to acquire the current real zoom magnification r' according to a third formula:
Figure BDA0002547465050000241
where r represents a current target zoom magnification, specifically, it represents a zoom magnification desired by a current user, for example, it may be represented by a zoom numerical value displayed to the user by a display device of the terminal device.
r' represents the current true zoom magnification, specifically, it represents the true zoom magnification corresponding to the second camera at the current target zoom magnification.
r1Representing a lower limit of zoom magnification of the second camera, e.g. when zooming the second cameraWhen the range of magnification is (c, d), then r is at this time1The value of (a) is c.
In a specific embodiment, the coordinate system is established with the length of the second image as the X-axis and the width of the second image as the Y-axis, and the offset includes an offset in the X-axis direction and an offset in the Y-axis direction, wherein the real-magnification acquiring module 802 may acquire r according to a fourth formula2The fourth formula is:
Figure BDA0002547465050000242
wherein H represents a width of the second image, W represents a length of the second image, shiftY represents a maximum offset amount in the width direction, shiftX represents a maximum offset amount in the length direction, r0Represents a ratio of the FOV area of the second camera to the FOV area of the first camera.
When the VCM value obtains the lower limit value in the current terminal device, the maximum offset value may be obtained, and specifically, the lower limit value may be taken as a specific value of the VCM parameter and introduced into the first formula or the second formula, so as to obtain the corresponding maximum offset. That is, the maximum amount of shift in the X-axis direction and the maximum amount of shift in the Y-axis direction may be taken, respectively, and the specific calculation r may be determined by comparing the value of the maximum amount of shift in the X-axis direction divided by the length of the second image and the value of the maximum amount of shift in the Y-axis direction divided by the width of the second image2So that r can be determined2The value of (c).
In the embodiment, the relation between the target zoom magnification and the real zoom magnification can be obtained through a simple linear mapping, so that the complexity of operation is reduced, and the imaging speed during zooming operation is increased.
In an alternative embodiment, the image cropping module 503 is configured to crop the second image according to the original scale of the second image with the adjusted second center position as the center.
In this embodiment, the second image may be cropped in the original proportion of the second image to further reduce the sense of abrupt change of the image presented to the user when the camera is changed.
In an alternative embodiment, as shown in fig. 14, the image cropping module 503 includes: a distance calculation unit 5031 and a clipping unit 5032.
The distance calculation unit 5031 is configured to calculate distances between each edge of the second image acquired by the second camera and a corresponding edge of the first image acquired by the first camera, respectively, and use the edge of the first image corresponding to the shortest distance as a target edge;
the clipping unit 5032 is configured to clip the second image according to the original ratio of the second image with the adjusted second center position as a center to generate a third image, where one edge of the third image coincides with the target edge.
For better understanding of the present embodiment, the following describes the present embodiment by taking a wide-angle camera as a first camera and an ultra-wide-angle camera as a second camera:
as shown in fig. 10, when switching from the wide-angle camera 11 to the ultra-wide-angle camera 13, the acquired image is switched from the first image 005 to the second image 004 accordingly, and after the first image 005 is switched to the second image 004, the offset position of the center position 006 of the second image 004 in the positive y direction is larger than that in the negative x-axis direction, so that the center position 006 of the second image 004 needs to be adjusted to coincide with the center position 007 of the first image, and during the adjustment, in order to avoid the adjusted image from having a black border, that is, to avoid the adjusted image covering a range larger than the image 004 before the adjustment, the position adjustment needs to be performed with reference to the positive y-axis direction having a large offset position, and at this time, the second image 004 is cut out so that one side of the adjusted image (the upper side of the rectangular parallelepiped in the figure) coincides with one side of the first image to obtain the third image, with the center position 007 as the center, and in proportion to the original ratio of the second image 008.
In this embodiment, the distance calculating unit may obtain a target edge with the shortest distance by obtaining a distance between an edge corresponding to the second image and the first image, and the clipping unit may avoid a defect of a black edge of the clipped image by controlling a side of the clipped third image to coincide with the target edge, so as to improve user experience when the camera is switched.
Example 9
The present embodiment provides an electronic device, which may be represented in the form of a computing device (for example, may be a server device), including a memory, a processor, and a computer program stored in the memory and running on the processor, where the processor executes the computer program to implement any one of the zoom control methods in embodiments 1 to 4.
Fig. 15 shows a schematic diagram of a hardware structure of the present embodiment, and as shown in fig. 15, the electronic device 9 specifically includes:
at least one processor 91, at least one memory 92, and a bus 93 for connecting the various system components (including the processor 91 and the memory 92), wherein:
the bus 93 includes a data bus, an address bus, and a control bus.
Memory 92 includes volatile memory, such as Random Access Memory (RAM)921 and/or cache memory 922, and can further include Read Only Memory (ROM) 923.
Memory 92 also includes a program/utility 925 having a set (at least one) of program modules 924, such program modules 924 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
The processor 91 executes various functional applications and data processing, such as any one of the zoom control methods according to embodiments 1 to 4 of the present invention, by executing the computer program stored in the memory 92.
The electronic device 9 may further communicate with one or more external devices 94 (e.g., a keyboard, a pointing device, etc.). Such communication may be through an input/output (I/O) interface 95. Also, the electronic device 9 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet) via the network adapter 96. The network adapter 96 communicates with the other modules of the electronic device 9 via the bus 93. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the electronic device 9, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID (disk array) systems, tape drives, and data backup storage systems, etc.
It should be noted that although in the above detailed description several units/modules or sub-units/modules of the electronic device are mentioned, such a division is merely exemplary and not mandatory. Indeed, the features and functionality of two or more of the units/modules described above may be embodied in one unit/module, according to embodiments of the application. Conversely, the features and functions of one unit/module described above may be further divided into embodiments by a plurality of units/modules.
Example 10
The present embodiment provides a computer-readable storage medium on which a computer program is stored, the program, when executed by a processor, implementing the steps of any one of the zoom control methods of embodiments 1-4.
More specific examples, among others, that the readable storage medium may employ may include, but are not limited to: a portable disk, a hard disk, random access memory, read only memory, erasable programmable read only memory, optical storage device, magnetic storage device, or any suitable combination of the foregoing.
In a possible implementation manner, the present invention can also be implemented in the form of a program product including program code for causing a terminal device to execute steps of implementing the zoom control method according to any one of embodiments 1 to 4 when the program product is run on the terminal device.
Where program code for carrying out the invention is written in any combination of one or more programming languages, the program code may be executed entirely on the user device, partly on the user device, as a stand-alone software package, partly on the user device and partly on a remote device or entirely on the remote device.
While specific embodiments of the invention have been described above, it will be appreciated by those skilled in the art that this is by way of example only, and that the scope of the invention is defined by the appended claims. Various changes and modifications to these embodiments may be made by those skilled in the art without departing from the spirit and scope of the invention, and these changes and modifications are within the scope of the invention.

Claims (18)

1. A zoom control method is applied to terminal equipment, the terminal equipment comprises a plurality of cameras with different zoom ranges, and the zoom control method comprises the following steps:
when a first camera is switched to a second camera, calculating the current offset between the second center position of a second image acquired by the second camera and the first center position of a first image acquired by the first camera, wherein the first image and the second image are respectively images acquired by the first camera and the second camera at the same shooting distance and aiming at the same target shooting object;
adjusting the second center position of the second image acquired by the second camera according to the current offset so as to enable the second center position to coincide with the first center position;
cutting the second image by taking the adjusted second central position as a center;
the zoom control method includes:
presetting a corresponding relation between a reference VCM value of the terminal equipment and a reference offset, wherein the reference offset is the offset between the center position of a reference image acquired by the second camera and the center position of a reference image acquired by the first camera under a reference shooting distance;
the step of calculating the current offset between the second center position of the second image acquired by the second camera and the first center position of the first image acquired by the first camera further comprises:
when the second camera is focused with a target shooting object, acquiring a current VCM value of the terminal equipment;
acquiring the maximum VCM value of the terminal equipment;
the step of calculating the current offset between the second center position of the second image acquired by the second camera and the first center position of the first image acquired by the first camera specifically includes:
and calculating the current offset according to the current VCM value, the maximum VCM value, the reference VCM value and the corresponding reference deviation value.
2. The zoom control method of claim 1, wherein calculating a current offset from the current VCM value, the maximum VCM value, the reference VCM value, and a corresponding reference offset value comprises:
calculating the current offset shift according to a first formula, wherein the first formula is as follows:
Figure FDA0003281874510000021
wherein VCM represents the current VCM value, vcmMax represents the maximum VCM value, vcmCali represents the reference VCM value, shiftcai represents a reference offset corresponding to the reference VCM value, and a represents a current preset coefficient.
3. The zoom control method according to claim 2, wherein the current preset coefficient a is obtained by:
presetting a negative correlation corresponding relation between the range of the shooting distance of the terminal equipment and a preset coefficient;
calculating the current shooting distance when the terminal equipment acquires the second image of the target shooting object;
and acquiring a corresponding current preset coefficient a according to the current shooting distance and the corresponding relation.
4. The zoom control method according to claim 1, wherein the step of presetting the correspondence of the reference VCM value of the terminal device to the reference offset amount comprises:
presetting a corresponding relation between a reference VCM value and a reference offset of the terminal equipment at different shooting distances;
the step of calculating the current offset according to the current VCM value, the maximum VCM value, the reference VCM value and the corresponding reference offset further comprises the following steps:
and acquiring the current shooting distance, and calculating a reference VCM value and a reference offset corresponding to the current shooting distance according to the corresponding relation.
5. The zoom control method of claim 4, wherein the step of calculating a current offset from the current VCM value, the maximum VCM value, the reference VCM value, and a corresponding reference offset comprises:
calculating the current offset shift according to a second formula, wherein the second formula is as follows:
Figure FDA0003281874510000022
and the VCM represents the current VCM value, the vcmMax represents the maximum VCM value, the vcmCali represents the reference VCM value, and the shiftCali represents the reference offset corresponding to the reference VCM value.
6. The zoom control method of claim 1, further comprising:
receiving a focal length adjusting instruction, wherein the focal length adjusting instruction is used for representing that the initial zooming magnification of the first camera is adjusted to the target zooming magnification of the second camera;
acquiring the current real zooming magnification according to the corresponding relation between the preset target zooming magnification and the real zooming magnification;
and controlling the first camera to be switched to a second camera and adjusting the zooming magnification of the second camera to the current real zooming magnification.
7. The zoom control method according to claim 6, wherein the step of obtaining the current true zoom magnification according to the preset correspondence between the target zoom magnification and the true zoom magnification comprises:
obtaining a current real zooming magnification r' according to a third formula:
Figure FDA0003281874510000031
wherein r represents the current target zoom magnification, r' represents the current real zoom magnification, r1A lower limit value representing a zoom magnification of the second camera;
the zoom control method further includes the steps of: obtaining r according to a fourth formula2The fourth formula is:
Figure FDA0003281874510000032
wherein H represents a width of the second image, W represents a length of the second image, shiftY represents a maximum offset amount in the width direction, shiftX represents a maximum offset amount in the length direction, r0Represents a ratio of the FOV area of the second camera to the FOV area of the first camera.
8. The zoom control method according to claim 1, wherein the step of cropping the second image centering on the adjusted second center position includes:
cutting the second image according to the original proportion of the second image by taking the adjusted second central position as a center;
or the like, or, alternatively,
the step of cropping the second image with the adjusted second center position as the center includes:
respectively calculating the distance between each edge of the second image acquired by the second camera and the corresponding edge of the first image acquired by the first camera, and taking the edge of the first image corresponding to the shortest distance as a target edge;
and cutting the second image according to the original proportion of the second image by taking the adjusted second central position as a center to generate a third image, wherein one edge of the third image is superposed with the target edge.
9. A zoom control system is applied to a terminal device, the terminal device comprises a plurality of cameras with different zoom ranges, and the zoom control system comprises: the system comprises a current offset calculation module, a center position adjustment module and an image cutting module;
the current offset calculation module is used for calculating a current offset between a second central position of a second image acquired by a second camera and a first central position of a first image acquired by the first camera when the first camera is switched to the second camera, wherein the first image and the second image are respectively images acquired by the first camera and the second camera at the same shooting distance and aiming at the same target shooting object;
the center position adjusting module is used for adjusting the second center position of the second image acquired by the second camera according to the current offset so as to enable the second center position to be coincident with the first center position;
the image cutting module is used for cutting the second image by taking the adjusted second central position as a center;
the zoom control system includes: the VCM acquisition module comprises a reference presetting module, a current VCM acquisition module and a maximum VCM acquisition module;
the reference presetting module is used for presetting a corresponding relation between a reference VCM value of the terminal equipment and a reference offset, wherein the reference offset is an offset between the center position of a reference image acquired by the second camera and the center position of the reference image acquired by the first camera at a reference shooting distance;
the current VCM obtaining module is used for obtaining a current VCM value of the terminal equipment when the second camera is focused on a target shooting object;
the maximum VCM obtaining module is used for obtaining the maximum VCM value of the terminal equipment;
the current offset calculation module is specifically configured to calculate a current offset according to the current VCM value, the maximum VCM value, the reference VCM value, and the corresponding reference deviation value.
10. The zoom control system of claim 9, wherein the current offset calculation module is configured to calculate the current offset shift according to a first formula, the first formula being:
Figure FDA0003281874510000051
wherein VCM represents the current VCM value, vcmMax represents the maximum VCM value, vcmCali represents the reference VCM value, shiftcai represents a reference offset corresponding to the reference VCM value, and a represents a current preset coefficient.
11. The zoom control system according to claim 10, further comprising a current preset coefficient obtaining module, configured to preset a negative correlation correspondence between a range of the shooting distance of the terminal device and a preset coefficient, calculate a current shooting distance at which the terminal device obtains the second image of the target shooting object, and obtain a corresponding current preset coefficient a according to the current shooting distance and the correspondence.
12. The zoom control system according to claim 9, wherein the reference presetting module is specifically configured to preset a corresponding relationship between a reference VCM value and a reference offset of the terminal device at different shooting distances, and the zoom control system further comprises a current shooting distance obtaining module configured to obtain a current shooting distance, and calculate the reference VCM value and the reference offset corresponding to the current shooting distance according to the corresponding relationship.
13. The zoom control system of claim 12, wherein the current offset calculation module is configured to calculate the current offset shift according to a second formula, the second formula being:
Figure FDA0003281874510000052
and the VCM represents the current VCM value, the vcmMax represents the maximum VCM value, the vcmCali represents the reference VCM value, and the shiftCali represents the reference offset corresponding to the reference VCM value.
14. The zoom control system of claim 9, further comprising: the zoom instruction receiving module, the real magnification acquiring module and the zoom magnification adjusting module;
the zoom instruction receiving module is used for receiving a focal length adjusting instruction, and the focal length adjusting instruction is used for representing that the initial zoom magnification of the first camera is adjusted to the target zoom magnification of the second camera;
the real magnification acquisition module is used for acquiring the current real zooming magnification according to the corresponding relation between the preset target zooming magnification and the real zooming magnification;
the zooming magnification adjusting module is used for controlling the first camera to be switched to the second camera and adjusting the zooming magnification of the second camera to the current real zooming magnification.
15. The zoom control system of claim 14, wherein the real magnification acquisition module is configured to acquire the current real zoom magnification r' according to a third formula:
Figure FDA0003281874510000061
wherein r represents the current target zoom magnification, r' represents the current real zoom magnification, r1A lower limit value representing a zoom magnification of the second camera;
the real multiplying power obtaining module is also used for obtaining r according to a fourth formula2The fourth formula is:
Figure FDA0003281874510000062
wherein H represents a width of the second image, W represents a length of the second image, shiftY represents a maximum offset amount in the width direction, shiftX represents a maximum offset amount in the length direction, r0Represents a ratio of the FOV area of the second camera to the FOV area of the first camera.
16. The zoom control system of claim 9, wherein the image cropping module is configured to crop the second image according to its original scale centered on the adjusted second center position;
or the like, or, alternatively,
the image cropping module comprises: a distance calculation unit and a clipping unit;
the distance calculation unit is used for calculating the distance between each edge of the second image acquired by the second camera and the corresponding edge of the first image acquired by the first camera respectively, and taking the edge of the first image corresponding to the shortest distance as a target edge;
and the cutting unit is used for cutting the second image according to the original proportion of the second image by taking the adjusted second central position as the center to generate a third image, and one edge of the third image is superposed with the target edge.
17. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the zoom control method of any one of claims 1 to 8 when executing the computer program.
18. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the zoom control method according to any one of claims 1 to 8.
CN202010565421.4A 2020-06-19 2020-06-19 Zoom control method, system, device, and medium Active CN111654631B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202111564761.6A CN114285992B (en) 2020-06-19 2020-06-19 Zoom control method, system, equipment and medium
CN202010565421.4A CN111654631B (en) 2020-06-19 2020-06-19 Zoom control method, system, device, and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010565421.4A CN111654631B (en) 2020-06-19 2020-06-19 Zoom control method, system, device, and medium

Related Child Applications (1)

Application Number Title Priority Date Filing Date
CN202111564761.6A Division CN114285992B (en) 2020-06-19 2020-06-19 Zoom control method, system, equipment and medium

Publications (2)

Publication Number Publication Date
CN111654631A CN111654631A (en) 2020-09-11
CN111654631B true CN111654631B (en) 2021-11-12

Family

ID=72349986

Family Applications (2)

Application Number Title Priority Date Filing Date
CN202111564761.6A Active CN114285992B (en) 2020-06-19 2020-06-19 Zoom control method, system, equipment and medium
CN202010565421.4A Active CN111654631B (en) 2020-06-19 2020-06-19 Zoom control method, system, device, and medium

Family Applications Before (1)

Application Number Title Priority Date Filing Date
CN202111564761.6A Active CN114285992B (en) 2020-06-19 2020-06-19 Zoom control method, system, equipment and medium

Country Status (1)

Country Link
CN (2) CN114285992B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112073642B (en) * 2020-09-18 2021-09-14 展讯通信(上海)有限公司 Video recording method and device of multi-camera equipment, storage medium and terminal
CN115225800B (en) * 2021-04-14 2024-03-05 华为技术有限公司 Multi-camera zooming method, device and equipment
CN115484375A (en) * 2021-05-31 2022-12-16 华为技术有限公司 Shooting method and electronic equipment
CN113630549B (en) * 2021-06-18 2023-07-14 北京旷视科技有限公司 Zoom control method, apparatus, electronic device, and computer-readable storage medium
CN117837159A (en) * 2021-09-24 2024-04-05 深圳市大疆创新科技有限公司 Zooming method and device of image acquisition device
CN114554086B (en) * 2022-02-10 2024-06-25 支付宝(杭州)信息技术有限公司 Auxiliary shooting method and device and electronic equipment
CN117479008B (en) * 2023-12-27 2024-05-03 荣耀终端有限公司 Video processing method, electronic equipment and chip system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106303258A (en) * 2016-09-19 2017-01-04 深圳市金立通信设备有限公司 A kind of image pickup method based on dual camera and terminal
CN108234851A (en) * 2013-06-13 2018-06-29 核心光电有限公司 Based on Dual-Aperture zoom digital camera
CN209170542U (en) * 2018-09-13 2019-07-26 深圳市鸿合创新信息技术有限责任公司 A kind of double-camera video frequency exhibition booth
CN111147755A (en) * 2020-01-02 2020-05-12 普联技术有限公司 Zoom processing method and device for double cameras and terminal equipment
CN111294505A (en) * 2019-07-19 2020-06-16 展讯通信(上海)有限公司 Image processing method and device

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5855341B2 (en) * 2010-12-28 2016-02-09 ローム株式会社 Lens control device and imaging device using the same
US8872944B2 (en) * 2011-12-19 2014-10-28 Pelco, Inc. Method and system for image centering during zooming
JP2016050973A (en) * 2014-08-29 2016-04-11 キヤノン株式会社 Image-capturing device and control method thereof
CN204305162U (en) * 2014-11-28 2015-04-29 广东欧珀移动通信有限公司 Double-camera device and terminal device thereof
CN106464799A (en) * 2015-03-27 2017-02-22 华为技术有限公司 Automatic zooming method and device
US9961246B2 (en) * 2015-06-18 2018-05-01 Google Llc Non-canting VCM-actuated autofocus
WO2020019356A1 (en) * 2018-07-27 2020-01-30 华为技术有限公司 Method for terminal to switch cameras, and terminal
CN110493525B (en) * 2019-09-04 2021-01-22 展讯通信(上海)有限公司 Zoom image determination method and device, storage medium and terminal
CN110995998B (en) * 2019-12-12 2021-06-18 浙江大华技术股份有限公司 Optical axis deviation calibration method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108234851A (en) * 2013-06-13 2018-06-29 核心光电有限公司 Based on Dual-Aperture zoom digital camera
CN106303258A (en) * 2016-09-19 2017-01-04 深圳市金立通信设备有限公司 A kind of image pickup method based on dual camera and terminal
CN209170542U (en) * 2018-09-13 2019-07-26 深圳市鸿合创新信息技术有限责任公司 A kind of double-camera video frequency exhibition booth
CN111294505A (en) * 2019-07-19 2020-06-16 展讯通信(上海)有限公司 Image processing method and device
CN111147755A (en) * 2020-01-02 2020-05-12 普联技术有限公司 Zoom processing method and device for double cameras and terminal equipment

Also Published As

Publication number Publication date
CN111654631A (en) 2020-09-11
CN114285992B (en) 2024-03-05
CN114285992A (en) 2022-04-05

Similar Documents

Publication Publication Date Title
CN111654631B (en) Zoom control method, system, device, and medium
JP2022528659A (en) Projector keystone correction methods, devices, systems and readable storage media
CN110493525B (en) Zoom image determination method and device, storage medium and terminal
US10027909B2 (en) Imaging device, imaging method, and image processing device
CN112261387B (en) Image fusion method and device for multi-camera module, storage medium and mobile terminal
CN111540004A (en) Single-camera polar line correction method and device
CN110248091B (en) Focal length adjusting method and related product
CN109040728B (en) Ultra-short-focus projection equipment with double-camera trapezoidal correction and method thereof
CN107800951B (en) Electronic device and lens switching method thereof
CN111862620B (en) Image fusion processing method and device
CN110533618B (en) Lens distortion correction method and photographic device
US11523056B2 (en) Panoramic photographing method and device, camera and mobile terminal
CN105450907A (en) Intelligent terminal and video image stabilization system model parameter calibration method and device thereof
US20230362477A1 (en) Photographing method and apparatus, electronic device and readable storage medium
CN114339042A (en) Image processing method and device based on multiple cameras and computer readable storage medium
CN110753182A (en) Adjusting method and apparatus of image forming apparatus
CN109996005A (en) A kind of convergence correction method and device
CN106791366B (en) A kind of microshot method and terminal
CN104796615B (en) A kind of big pixel image pickup method, system and the mobile terminal of OIS anti-vibration motor
CN112598751A (en) Calibration method and device, terminal and storage medium
CN103973962A (en) Image processing method and image acquisition device
CN110848907A (en) Control method of air conditioner, air conditioner and computer readable storage medium
CN115174878A (en) Projection picture correction method, apparatus and storage medium
CN114092316A (en) Image processing method, apparatus and storage medium
CN113840083A (en) Camera control method, device and storage medium

Legal Events

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