CN114339018B - Method and device for switching lenses and storage medium - Google Patents

Method and device for switching lenses and storage medium Download PDF

Info

Publication number
CN114339018B
CN114339018B CN202011057991.9A CN202011057991A CN114339018B CN 114339018 B CN114339018 B CN 114339018B CN 202011057991 A CN202011057991 A CN 202011057991A CN 114339018 B CN114339018 B CN 114339018B
Authority
CN
China
Prior art keywords
image
target object
lens
area
image data
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
CN202011057991.9A
Other languages
Chinese (zh)
Other versions
CN114339018A (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.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software 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 Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN202011057991.9A priority Critical patent/CN114339018B/en
Publication of CN114339018A publication Critical patent/CN114339018A/en
Application granted granted Critical
Publication of CN114339018B publication Critical patent/CN114339018B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The present disclosure relates to a method, apparatus and storage medium for lens switching. The method comprises the following steps: acquiring first image data of a target object in a first image in a field of view of a first lens; determining second image data of the target object within a field of view of a second lens; determining a displacement amount of the target object based on the first image data and the second image data; when the first lens is switched to the second lens, based on the displacement, the display area of the target object in the second image is adjusted from a first area to a second area, and the adjusted second image is displayed. According to displacement amounts of the target object in the first image in the field of view of the first lens and in the second image in the field of view of the second lens, a display area of the target object in the second image in the field of view of the second lens is adjusted, and obvious jump of the target object is avoided when the first lens is switched to the second lens.

Description

Method and device for switching lenses and storage medium
Technical Field
The present disclosure relates to the field of image data processing, and in particular, to a method, an apparatus, and a storage medium for lens switching.
Background
In the related art, a terminal device is often provided with a plurality of lenses, and the plurality of lenses are arranged according to a certain distance and angle. Due to the difference of the distance and the angle between the lenses, obvious jump of the picture can occur when the lenses are switched. For example, in a multi-depth-of-field screen, the field ranges of the two lenses are different due to the distance and angle between the two lenses, and the parallax of a near object is large and the parallax of a far object is small when the lenses are switched. When the lens is switched, the jump of objects in the picture, especially near objects, is obvious. For example, as shown in fig. 1, fig. 1 shows a comparative schematic diagram of pictures acquired by two lenses at the time of switching the two lenses. In fig. 1, when the wide-angle lens jumps to the telephoto lens, the wide-angle lens and the telephoto lens obtain pictures at the same magnification, wherein the picture with the reference number 1 is a picture obtained by the telephoto lens, and the picture with the reference number 1' is a picture obtained by the wide-angle lens. The jump occurs at the position of the same object in the two pictures, for example, the picture acquired by the tele lens, the picture with the reference number of 1, the picture acquired by the wide-angle lens, the picture with the reference number of 1 'and the picture with the reference number of 100' generate the jump. In the prior art, the fluency Of shot switching is poor, and the jump Of the Field Of View (FOV) is obvious, so that the user experience is poor. The method for switching the lens is good in smoothness, and the jump of the visual angle range is not obvious, so that the technical problem to be solved is urgent.
Disclosure of Invention
In order to overcome the problems in the related art, the present disclosure provides a method, apparatus, and storage medium for lens switching.
According to a first aspect of embodiments of the present disclosure, there is provided a method for lens switching, applied to a terminal, the method for lens switching including:
acquiring first image data of a target object in a first image in a field of view of a first lens;
determining second image data of the target object within a field of view of a second lens;
determining a displacement amount of the target object based on the first image data and the second image data;
when the first lens is switched to the second lens, based on the displacement, the display area of the target object in the second image is adjusted from a first area to a second area, and the adjusted second image is displayed.
Wherein after the adjusting the display area of the target object in the second image from the first area to the second area based on the displacement amount, before displaying the adjusted second image, the method further includes:
and adjusting background image data of the first area in the second image based on image data of a target area in the first image, wherein the target area is an area corresponding to the first area in the second image in the first image.
Wherein the first image data includes position information of the target object within the first image, and the second image data includes position information of the target object within the second image;
the determining a displacement amount of the target object based on the first image data and the second image data includes:
and determining the displacement of the position of the target object in the second image relative to the position in the first image according to the position information of the target object in the first image and the position information of the target object in the second image.
Wherein the adjusting the display area of the target object in the second image from the first area to the second area based on the displacement amount includes:
and moving a display area of the target object in the second image from the first area to the second area along the direction opposite to the displacement generating the displacement, wherein the preset distance is smaller than or equal to the displacement.
Wherein the first image data includes depth information of the target object within the first image; the second image data includes depth information of the target object within the second image;
The adjusting the display area of the target object in the second image from the first area to the second area based on the displacement amount includes:
and determining whether the target object is a preset adjustment object according to the depth information of the target object in the first image and/or the depth information of the target object in the second image, and if so, adjusting the display area of the target object in the second image from a first area to a second area based on the displacement.
Wherein the determining whether the target object is a preset adjustment object according to the depth information of the target object in the first image and/or the depth information of the target object in the second image includes:
determining the depth of field of the target object according to the depth information of the target object in the first image and/or the depth information of the target object in the second image;
and judging whether the depth of field of the target object is smaller than a preset threshold value, and if so, determining that the target object is a preset adjustment object.
Wherein the determining whether the target object is a preset adjustment object according to the depth information of the target object in the first image and/or the depth information of the target object in the second image includes:
And acquiring the depth of field of the object with the focusing point in the first image, and determining the target object as a preset adjustment object if the depth of field of the target object is different from the depth of field of the object with the focusing point.
The lens switching method further comprises the following steps:
and when the focal length is adjusted under the second lens, reducing the moving distance of the target object according to a preset rule so as to restore the display area of the target object in the second image from the second area to the first area.
According to a second aspect of embodiments of the present disclosure, there is provided a lens switching apparatus, including:
an acquisition module configured to acquire first image data of a target object in a first image in a field of view of a first lens;
a first determination module configured to determine second image data of the target object within a field of view of a second lens;
a second determination module configured to determine a displacement amount of the target object based on the first image data and the second image data;
and the adjustment display module is configured to adjust the display area of the target object in the second image from a first area to a second area based on the displacement when the first lens is switched to the second lens, and display the adjusted second image.
Wherein the adjustment display module is further configured to:
after the adjusting the display area of the target object in the second image from the first area to the second area based on the displacement amount, the displaying the adjusted second image is preceded by:
and adjusting background image data of the first area in the second image based on image data of a target area in the first image, wherein the target area is an area corresponding to the first area in the second image in the first image.
Wherein the first image data includes position information of the target object within the first image, and the second image data includes position information of the target object within the second image;
the second determination module is configured to:
and determining the displacement of the position of the target object in the second image relative to the position in the first image according to the position information of the target object in the first image and the position information of the target object in the second image.
Wherein the adjustment display module is configured to:
and moving a display area of the target object in the second image from the first area to the second area along the direction opposite to the displacement generating the displacement, wherein the preset distance is smaller than or equal to the displacement.
Wherein the first image data includes depth information of the target object within the first image; the second image data includes depth information of the target object within the second image;
the adjustment display module is configured to:
and determining whether the target object is a preset adjustment object according to the depth information of the target object in the first image and/or the depth information of the target object in the second image, and if so, adjusting the display area of the target object in the second image from a first area to a second area based on the displacement.
Wherein the adjustment display module is configured to:
determining the depth of field of the target object according to the depth information of the target object in the first image and/or the depth information of the target object in the second image;
and judging whether the depth of field of the target object is smaller than a preset threshold value, and if so, determining that the target object is a preset adjustment object.
Wherein the adjustment display module is configured to:
and acquiring the depth of field of the object with the focusing point in the first image, and determining the target object as a preset adjustment object if the depth of field of the target object is different from the depth of field of the object with the focusing point.
The device for switching the lens further comprises:
and the moving distance adjusting module is configured to reduce the moving distance of the target object according to a preset rule when the focal length is adjusted under the second lens, so that the display area of the target object in the second image is restored to the first area from the second area.
According to a third aspect of the embodiments of the present disclosure, there is provided an apparatus for lens switching, including:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
acquiring first image data of a target object in a first image in a field of view of a first lens;
determining second image data of the target object within a field of view of a second lens;
determining a displacement amount of the target object based on the first image data and the second image data;
when the first lens is switched to the second lens, based on the displacement, the display area of the target object in the second image is adjusted from a first area to a second area, and the adjusted second image is displayed.
According to a fourth aspect of embodiments of the present disclosure, there is provided a non-transitory computer-readable storage medium, which when executed by a processor of a mobile terminal, causes the mobile terminal to perform a method of lens switching, the method comprising:
Acquiring first image data of a target object in a first image in a field of view of a first lens;
determining second image data of the target object within a field of view of a second lens;
determining a displacement amount of the target object based on the first image data and the second image data;
when the first lens is switched to the second lens, based on the displacement, the display area of the target object in the second image is adjusted from a first area to a second area, and the adjusted second image is displayed.
The technical scheme provided by the embodiment of the disclosure can comprise the following beneficial effects: according to the displacement of the target object in the first image in the field of view of the first lens and the displacement of the target object in the second image in the field of view of the second lens, the display area of the target object in the second image in the field of view of the second lens is adjusted and the adjusted second image is displayed, so that obvious jump of the target object is avoided when the first lens is switched to the second lens, the switching smoothness is improved, and the user experience is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
Fig. 1 shows a comparative schematic diagram of pictures acquired by two lenses at the time of switching the two lenses. The method comprises the steps of carrying out a first treatment on the surface of the
FIG. 2 illustrates a method of shot switching, according to an exemplary embodiment;
FIG. 3 shows a flow chart of a method of determining the displacement of a target object;
FIG. 4 is a flow chart of a method for adjusting a display area of the target object in the second image from the first area to the second area based on the displacement amount;
fig. 5 shows a schematic diagram of a picture obtained by a wide-angle lens and a telephoto lens at the same magnification when the wide-angle lens jumps to the telephoto lens;
FIG. 6 shows a flow chart of a method for adjusting a display area of the target object within the second image from a first area to a second area based on the displacement amount;
FIG. 7 is a flowchart of a method for determining whether a target object is a preset adjustment object based on depth information of the target object in a first image and/or depth information of the target object in a second image;
FIG. 8 shows a flow chart of a method of determining whether a target object is a preset adjustment object based on depth information of the target object within a first image and/or depth information of the target object within a second image;
FIG. 9 shows a flow chart of a method of adjusting a movement distance of a target object;
FIG. 10 is a block diagram illustrating an apparatus for shot switching according to an exemplary embodiment;
fig. 11 shows a block diagram of a lens switching apparatus (a general structure of a mobile terminal) according to an exemplary embodiment.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples do not represent all implementations consistent with the invention. Rather, they are merely examples of apparatus and methods consistent with aspects of the invention as detailed in the accompanying claims.
Fig. 2 illustrates a method of shot switching according to an exemplary embodiment, and as illustrated in fig. 2, the method of shot switching may be applied to a terminal, for example, a mobile phone. The method for switching the lens can comprise the following steps:
In step S11, first image data of a target object in a first image in a field of view of a first lens is acquired;
in step S12, second image data of the target object within the field of view of the second lens is determined;
in step S13, a displacement amount of the target object is determined based on the first image data and the second image data;
when the first lens is switched to the second lens in step S14, adjusting the display area of the target object in the second image from the first area to the second area based on the displacement amount;
in step S15, the adjusted second image is displayed.
In the method for switching the lenses provided by the disclosure, when two lenses are switched, for example, when a first lens is switched to a second lens, first image data of a target object in a first image in a field of view of the first lens is acquired; second image data of the target object within the field of view of the second lens is determined. The displacement amount of the target object, i.e., the amount of jump of the target object at the time of switching the first lens to the second lens, may be determined from the first image data and the second image data. When the first lens is switched to the second lens, the display area of the target object in the second image is adjusted from the first area to the second area based on the displacement amount, and the adjusted second image is displayed. And adjusting the display area of the target object in the second image according to the displacement so as to avoid obvious jump of the target object when the two lenses are switched.
The target object may be a scene displayed in a first image in the field of view of the first lens or may be a pixel in the first image in the field of view of the first lens.
According to the lens switching method, the display area of the target object in the second image in the field of view of the second lens is adjusted according to the displacement of the target object in the first image in the field of view of the first lens and the displacement of the target object in the second image in the field of view of the second lens, and the adjusted second image is displayed, so that when the first lens is switched to the second lens, obvious jump of the target object is avoided, switching smoothness is improved, and user experience is improved.
In the method for lens switching provided in the present disclosure, in order to avoid generating a blank of image data of a display area before adjustment due to adjustment of a display area of a target object, as shown in a dashed line portion in fig. 2, the dashed line portion in fig. 2 shows that after adjusting the display area of the target object in the second image from a first area to a second area based on the displacement amount, the method may further include, before displaying the adjusted second image, the steps of:
in step S16, the background image data of the first area in the second image is adjusted based on the image data of the target area in the first image, where the target area is an area corresponding to the first area in the second image in the first image.
In the method for switching the lens provided by the disclosure, when the display area of the target object is adjusted from the first area to the second area, a blank appears in the image data in the first area, and in order to fill the blank, the image data of the area corresponding to the first area in the first image and the image data of the area corresponding to the second area in the second image can be fused into the background image of the first area in the second image. This can effectively avoid the deletion of the image data of the second image due to the generation of the blank data.
In the method for lens switching provided in the present disclosure, a method for determining a displacement amount of a target object is also provided, as shown in fig. 3, fig. 3 shows a flowchart of a method for determining a displacement amount of a target object, in the method described in fig. 3, the first image data may include position information of the target object in the first image, and the second image data may include position information of the target object in the second image.
In step S131, the displacement amount of the position of the target object in the second image with respect to the position in the first image is determined based on the position information of the target object in the first image and the position information of the target object in the second image.
In the lens switching method provided by the disclosure, the displacement amount of the position of the target object in the second image relative to the position in the first image can be determined according to the position information of the target object in the first image and the position information in the second image. The displacement amount is determined according to the position change of the target object in the first image and in the second image. When the two lenses are switched, the jump state of the target object is reflected in the position jump of the target object in the first image and the second image, the displacement is determined according to the position change of the jump state of the target object in the first image and the second image, and the display area of the target object in the second image can be accurately adjusted from the first area to the second area.
In the method for lens switching provided in the present disclosure, there is further provided a method for adjusting a display area of a target object in a second image from a first area to a second area, as shown in fig. 4, fig. 4 shows a flowchart of a method for adjusting a display area of the target object in the second image from the first area to the second area based on a displacement amount:
in step S141, the display area of the target object in the second image is moved from the first area to the second area by a preset distance in a direction opposite to the displacement generating the displacement amount, wherein the preset distance is less than or equal to the displacement amount.
In the lens switching method provided by the present disclosure, the display area of the target object in the second image may be moved by the first area by a preset distance in a direction opposite to the displacement generating the displacement amount. For example, as shown in fig. 5, fig. 5 shows a schematic diagram of pictures obtained by the wide-angle lens and the telephoto lens at the same magnification when the wide-angle lens jumps to the telephoto lens, wherein the picture with the reference number 10 is a picture obtained by the telephoto lens, and the picture with the reference number 10' is a picture obtained by the wide-angle lens. The jump occurs at the position of the same first object in the two pictures, for example, the picture obtained in the tele lens, the picture with the reference number 10, the first object with the reference number 101 in the picture obtained in the wide-angle lens, the first object with the reference number 101 'in the picture with the reference number 10' generates the jump, and the displacement is T. In order to avoid obvious jump of the first object in the process of switching the tele lens and the wide lens, the first object is moved by a preset distance along the direction opposite to the displacement generating displacement T, namely, the direction indicated by an arrow d, so that the first object can be smoothly switched in the process of switching the tele lens and the wide lens. The preset distance can be equal to or slightly smaller than the displacement T, and the first object does not jump after moving the preset distance, so that the first object can be smoothly transited. As shown in fig. 5, the preset distance shown in fig. 5 is smaller than the displacement amount T.
In the method for lens switching provided by the present disclosure, the first image data includes depth information of the target object in the first image; the second image data includes depth information of the target object within the second image. The method further provides a method for determining whether the target object is a preset adjustment object, as shown in fig. 6, fig. 6 shows a flowchart of a method for adjusting the display area of the target object in the second image from the first area to the second area based on the displacement amount:
in step S142, determining whether the target object is a preset adjustment object according to the depth information of the target object in the first image and/or the depth information of the target object in the second image;
in step S143, the display area of the target object in the second image is adjusted from the first area to the second area based on the displacement amount.
In the method for lens switching provided by the disclosure, whether the target object is a preset adjustment object may be determined according to the depth information of the target object in the first image and/or the depth information of the target object in the second image. If so, the display area of the target object in the second image may be adjusted from the first area to the second area based on the displacement amount.
The depth information may represent how far or near the object is from the lens when the lens is imaging. According to the depth information of the target object in the first image and/or the second image, the depth of field of the target object may be determined, and according to the depth of field of the target object, whether the target object is a preset adjustment object may be determined, as shown in fig. 7, fig. 7 shows a flowchart of a method for determining whether the target object is the preset adjustment object according to the depth information of the target object in the first image and/or the depth information of the target object in the second image:
in step S1421, the depth of field of the target object is determined according to the depth information of the target object in the first image and/or the depth information of the target object in the second image;
in step S1422, it is determined whether the depth of field of the target object is smaller than a preset threshold, and if so, it is determined that the target object is a preset adjustment object.
In the process of switching the two lenses, because of the difference of the distance and the angle of the two lenses, the visual field range of each lens is different, when the lenses are switched, the parallax of a near object is large, the parallax of a far object is small, namely, the parallax of an object with small depth of field is large, and the parallax of an object with large depth of field is small. As shown in fig. 5, fig. 5 shows that the first object is a near object, i.e., an object with small depth of view. The second object is a distant object, i.e. an object with a large depth of view. The second object is the object labeled 201 in the picture labeled 10 and labeled 201 'in the picture labeled 10'. When switching from the telephoto lens to the wide-angle lens, the displacement amount T of the first object is larger than the displacement amount L of the second object. When the target object is adjusted, the object with large displacement can be adjusted. Whether the target object is an adjustment object can be determined according to the depth information of the target object, for example, if the depth of field in the depth information of the target object is smaller than a preset threshold value, the depth of field of the target object is smaller, the target object is a near object, the jump degree is larger during lens switching, and the target object can be a preset adjustment object. If the depth of field in the depth information of the target object is greater than or equal to the preset threshold value, the target object is larger in depth of field, is a distant object, and is smaller in jump degree when the lens is switched, and the target object can not be used as a preset adjustment object.
In the method provided by the disclosure, whether the target object is an adjustment object is determined according to the depth information of the target object, so that the data processing amount can be reduced, and the processing efficiency can be improved. Of course, all the image data generating the transitions may be adjusted in units of pixels.
In the method for lens switching provided in the present disclosure, as shown in fig. 8, fig. 8 shows a flowchart of a method for determining whether a target object is a preset adjustment object according to depth information of the target object in a first image and/or depth information of the target object in the second image:
in step S1423, the depth of field of the object with the focus in the first image is obtained, and if the depth of field of the target object is different from the depth of field of the object with the focus, the target object is determined to be the preset adjustment object.
During the photograph taking process, there may be a relatively interesting object on which the photograph may be focused in order to make the interesting object taking clearer. When the two lenses are switched, the focusing state can be considered to determine whether the target object is a preset adjustment object. For example, when the lens focuses on the object of interest, the depth of field of the object or the object in which the focus is located in the first image is obtained, and if the depth of field of the target object is different from the depth of field of the object in which the focus is located, the target object is a preset adjustment object. The object or object having the same depth of field as the object having the focus is not the preset adjustment object. In this way, in the process of shooting the photo, the object or the object with the same depth of field as the object with the focus can be adjusted correspondingly without being adjusted, so that the accuracy and the definition of the object of interest in shooting the photo are ensured.
In the method for lens switching provided in the present disclosure, there is further provided a method for adjusting a moving distance of a target object after switching to a second lens, as shown in fig. 9, fig. 9 is a flowchart illustrating a method for adjusting a moving distance of a target object:
in step S17, when the focal length adjustment is performed under the second lens, the moving distance of the target object is reduced according to a preset rule so that the display area of the target object in the second image is restored from the second area to the first area.
When the lens is switched to the second lens, the display area of the target object is moved from the first area to the second area due to the fact that the target object is moved by a preset distance. In order to enable the second image acquired by the second lens to display its original state, it is necessary to restore the display area of the moving target object from the second area to the first area. The restoration method may restore according to a preset rule, for example, if the focal length is adjusted under the second lens, that is, when the acquired picture is enlarged or reduced, the moving distance of the target object may be reduced according to the preset rule, so that the display area of the target object in the second image is restored from the second area to the first area. For example, the moving distance of the target object may be gradually reduced by a fixed distance difference every time the predetermined scale is enlarged or reduced, or the moving distance of the target object may be gradually reduced by a gradually increasing distance difference.
In the method for switching the lens, after the display area of the target object is adjusted, the adjusted second image is displayed, and the display area of the target object is restored to the first area from the second area by adjusting the moving distance of the target object, so that distortion of the second image is avoided.
In one exemplary embodiment of the present disclosure, an apparatus for lens switching is provided. As shown in fig. 10, fig. 10 is a block diagram illustrating an apparatus for shot switching according to an exemplary embodiment. Referring to fig. 10, the apparatus includes an acquisition module 1001, a first determination module 1002, a second determination module 1003, an adjustment display module 1004, and an output module 1003.
An acquisition module 1001 configured to acquire first image data of a target object within a first image within a field of view of a first lens;
a first determination module 1002 configured to determine second image data of the target object within a field of view of a second lens;
a second determining module 1003 configured to determine a displacement amount of the target object based on the first image data and the second image data;
and an adjustment display module 1004 configured to adjust a display area of the target object in the second image from a first area to a second area based on the displacement amount when the first lens is switched to the second lens, and display the adjusted second image.
Wherein the adjustment display module 1004 is further configured to:
after the adjusting the display area of the target object in the second image from the first area to the second area based on the displacement amount, the displaying the adjusted second image is preceded by:
and adjusting background image data of the first area in the second image based on image data of a target area in the first image, wherein the target area is an area corresponding to the first area in the second image in the first image.
Wherein the first image data includes position information of the target object within the first image, and the second image data includes position information of the target object within the second image; the second determining module 1003 is configured to:
and determining the displacement of the position of the target object in the second image relative to the position in the first image according to the position information of the target object in the first image and the position information of the target object in the second image.
Wherein the adjustment display module 1004 is configured to:
and moving a display area of the target object in the second image from the first area to the second area along the direction opposite to the displacement generating the displacement, wherein the preset distance is smaller than or equal to the displacement.
Wherein the first image data includes depth information of the target object within the first image; the second image data includes depth information of the target object within the second image; the adjustment display module 1004 is configured to:
and determining whether the target object is a preset adjustment object according to the depth information of the target object in the first image and/or the depth information of the target object in the second image, and if so, adjusting the display area of the target object in the second image from a first area to a second area based on the displacement.
Wherein the adjustment display module 1004 is configured to:
determining the depth of field of the target object according to the depth information of the target object in the first image and/or the depth information of the target object in the second image;
and judging whether the depth of field of the target object is smaller than a preset threshold value, and if so, determining that the target object is a preset adjustment object.
Wherein the adjustment display module 1004 is configured to:
and acquiring the depth of field of the object with the focusing point in the first image, and determining the target object as a preset adjustment object if the depth of field of the target object is different from the depth of field of the object with the focusing point.
The device for switching the lens further comprises:
the moving distance adjustment module 1005 is configured to reduce, according to a preset rule, a moving distance of the target object when performing focal length adjustment under the second lens, so as to restore a display area of the target object in the second image from the second area to the first area.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
Fig. 11 illustrates a block diagram of an apparatus 1100 for shot-switching, according to an example embodiment. For example, apparatus 1100 may be a mobile phone, computer, digital broadcast terminal, messaging device, game console, tablet device, medical device, exercise device, personal digital assistant, or the like.
Referring to fig. 11, apparatus 1100 may include one or more of the following components: a processing component 1102, a memory 1104, a power component 1106, a multimedia component 1108, an audio component 1110, an input/output (I/O) interface 1112, a sensor component 1114, and a communication component 1116.
The processing component 1102 generally controls overall operation of the apparatus 1100, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 1102 may include one or more processors 1120 to execute instructions to perform all or part of the steps of the methods described above. Further, the processing component 1102 can include one or more modules that facilitate interactions between the processing component 1102 and other components. For example, the processing component 1102 may include a multimedia module to facilitate interaction between the multimedia component 1108 and the processing component 1102.
Memory 1104 is configured to store various types of data to support operations at device 1100. Examples of such data include instructions for any application or method operating on the device 1100, contact data, phonebook data, messages, pictures, videos, and the like. The memory 1104 may be implemented by any type or combination of volatile or nonvolatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk.
The power component 1106 provides power to the various components of the device 1100. The power components 1106 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the device 1100.
Multimedia component 1108 includes a screen between the device 1100 and the user that provides an output interface. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may sense not only the boundary of a touch or slide action, but also the duration and pressure associated with the touch or slide operation. In some embodiments, multimedia component 1108 includes a front camera and/or a rear camera. The front-facing camera and/or the rear-facing camera may receive external multimedia data when the device 1100 is in an operational mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
The audio component 1110 is configured to output and/or input an audio signal. For example, the audio component 1110 includes a Microphone (MIC) configured to receive external audio signals when the device 1100 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may be further stored in the memory 1104 or transmitted via the communication component 1116. In some embodiments, the audio component 1110 further comprises a speaker for outputting audio signals.
The I/O interface 1112 provides an interface between the processing component 1102 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: homepage button, volume button, start button, and lock button.
The sensor assembly 1114 includes one or more sensors for providing status assessment of various aspects of the apparatus 1100. For example, the sensor assembly 1114 may detect the on/off state of the device 1100, the relative positioning of the components, such as the display and keypad of the apparatus 1100, the sensor assembly 1114 may also detect a change in position of the apparatus 1100 or a component of the apparatus 1100, the presence or absence of user contact with the apparatus 1100, the orientation or acceleration/deceleration of the apparatus 1100, and a change in temperature of the apparatus 1100. The sensor assembly 1114 may include a proximity sensor configured to detect the presence of nearby objects in the absence of any physical contact. The sensor assembly 1114 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 1114 may also include an acceleration sensor, a gyroscopic sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 1116 is configured to facilitate communication between the apparatus 1100 and other devices in a wired or wireless manner. The device 1100 may access a wireless network based on a communication standard, such as WiFi,2G, or 3G, or a combination thereof. In one exemplary embodiment, the communication component 1116 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, the communication component 1116 further includes a Near Field Communication (NFC) module to facilitate short range communication. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, ultra Wideband (UWB) technology, bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the apparatus 1100 may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic elements for executing the methods described above.
In an exemplary embodiment, a non-transitory computer-readable storage medium is also provided, such as a memory 1104 including instructions executable by the processor 1120 of the apparatus 1100 to perform the above-described method. For example, the non-transitory computer readable storage medium may be ROM, random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc. A method of enabling a mobile terminal to perform a lens switch when instructions in the storage medium are executed by a processor of the mobile terminal, the method comprising:
Acquiring first image data of a target object in a first image in a field of view of a first lens;
determining second image data of the target object within a field of view of a second lens;
determining a displacement amount of the target object based on the first image data and the second image data;
when the first lens is switched to the second lens, based on the displacement, the display area of the target object in the second image is adjusted from a first area to a second area, and the adjusted second image is displayed.
Other embodiments of the application will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. This application is intended to cover any variations, uses, or adaptations of the application following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the application pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
It is to be understood that the application is not limited to the precise arrangements and instrumentalities shown in the drawings, which have been described above, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (18)

1. A method for lens switching, applied to a terminal having a first lens and a second lens, characterized in that the method for lens switching comprises:
acquiring first image data of a target object in a first image in a field of view of a first lens;
determining second image data of the target object in a second image in a field of view of a second lens;
determining a displacement amount of the target object based on the first image data and the second image data;
when the first lens is switched to the second lens, based on the displacement, the display area of the target object in the second image is adjusted from a first area to a second area, and the adjusted second image is displayed.
2. The method of lens switching according to claim 1, wherein after adjusting a display area of the target object in the second image from a first area to a second area based on the displacement amount, before displaying the adjusted second image, further comprises:
and adjusting background image data of the first area in the second image based on image data of a target area in the first image, wherein the target area is an area corresponding to the first area in the second image in the first image.
3. The method of lens switching according to claim 1, wherein the first image data includes position information of the target object within the first image, and the second image data includes position information of the target object within the second image;
the determining a displacement amount of the target object based on the first image data and the second image data includes:
and determining the displacement of the position of the target object in the second image relative to the position in the first image according to the position information of the target object in the first image and the position information of the target object in the second image.
4. The method of lens switching according to claim 3, wherein adjusting a display area of the target object in the second image from a first area to a second area based on the displacement amount includes:
and moving a display area of the target object in the second image from the first area to the second area along the direction opposite to the displacement generating the displacement, wherein the preset distance is smaller than or equal to the displacement.
5. The method of lens switching of claim 1, wherein the first image data includes depth information of the target object within the first image; the second image data includes depth information of the target object within the second image;
the adjusting the display area of the target object in the second image from the first area to the second area based on the displacement amount includes:
and determining whether the target object is a preset adjustment object according to the depth information of the target object in the first image and/or the depth information of the target object in the second image, and if so, adjusting the display area of the target object in the second image from a first area to a second area based on the displacement.
6. The method according to claim 5, wherein determining whether the target object is a preset adjustment object according to the depth information of the target object in the first image and/or the depth information of the target object in the second image comprises:
determining the depth of field of the target object according to the depth information of the target object in the first image and/or the depth information of the target object in the second image;
And judging whether the depth of field of the target object is smaller than a preset threshold value, and if so, determining that the target object is a preset adjustment object.
7. The method according to claim 5, wherein determining whether the target object is a preset adjustment object according to the depth information of the target object in the first image and/or the depth information of the target object in the second image comprises:
and acquiring the depth of field of the object with the focusing point in the first image, and determining the target object as a preset adjustment object if the depth of field of the target object is different from the depth of field of the object with the focusing point.
8. The method of lens switching of claim 4, further comprising:
and when the focal length is adjusted under the second lens, reducing the moving distance of the target object according to a preset rule so as to restore the display area of the target object in the second image from the second area to the first area.
9. A lens switching device applied to a terminal having a first lens and a second lens, characterized in that the lens switching device comprises:
An acquisition module configured to acquire first image data of a target object in a first image in a field of view of a first lens;
a first determination module configured to determine second image data of the target object within a second image within a field of view of a second lens;
a second determination module configured to determine a displacement amount of the target object based on the first image data and the second image data;
and the adjustment display module is configured to adjust the display area of the target object in the second image from a first area to a second area based on the displacement when the first lens is switched to the second lens, and display the adjusted second image.
10. The lens switching apparatus of claim 9, wherein the adjustment display module is further configured to:
after the adjusting the display area of the target object in the second image from the first area to the second area based on the displacement amount, the displaying the adjusted second image is preceded by:
and adjusting background image data of the first area in the second image based on image data of a target area in the first image, wherein the target area is an area corresponding to the first area in the second image in the first image.
11. The apparatus for lens switching according to claim 9, wherein the first image data includes position information of the target object within the first image, and the second image data includes position information of the target object within the second image;
the second determination module is configured to:
and determining the displacement of the position of the target object in the second image relative to the position in the first image according to the position information of the target object in the first image and the position information of the target object in the second image.
12. The lens switching device of claim 11, wherein the adjustment display module is configured to:
and moving a display area of the target object in the second image from the first area to the second area along the direction opposite to the displacement generating the displacement, wherein the preset distance is smaller than or equal to the displacement.
13. The apparatus of claim 9, wherein the first image data includes depth information of the target object within the first image; the second image data includes depth information of the target object within the second image;
The adjustment display module is configured to:
and determining whether the target object is a preset adjustment object according to the depth information of the target object in the first image and/or the depth information of the target object in the second image, and if so, adjusting the display area of the target object in the second image from a first area to a second area based on the displacement.
14. The lens switching apparatus of claim 13, wherein the adjustment display module is configured to:
determining the depth of field of the target object according to the depth information of the target object in the first image and/or the depth information of the target object in the second image;
and judging whether the depth of field of the target object is smaller than a preset threshold value, and if so, determining that the target object is a preset adjustment object.
15. The lens switching apparatus of claim 13, wherein the adjustment display module is configured to:
and acquiring the depth of field of the object with the focusing point in the first image, and determining the target object as a preset adjustment object if the depth of field of the target object is different from the depth of field of the object with the focusing point.
16. The apparatus for lens switching according to claim 12, wherein the apparatus for lens switching further comprises:
and the moving distance adjusting module is configured to reduce the moving distance of the target object according to a preset rule when the focal length is adjusted under the second lens, so that the display area of the target object in the second image is restored to the first area from the second area.
17. A lens switching device applied to a terminal having a first lens and a second lens, comprising:
a processor;
a memory for storing a computer program;
wherein the processor is configured to execute the computer program to implement the steps of:
acquiring first image data of a target object in a first image in a field of view of a first lens;
determining second image data of the target object in a second image in a field of view of a second lens;
determining a displacement amount of the target object based on the first image data and the second image data;
when the first lens is switched to the second lens, based on the displacement, the display area of the target object in the second image is adjusted from a first area to a second area, and the adjusted second image is displayed.
18. A non-transitory computer readable storage medium storing a computer program which, when executed by a processor of a mobile terminal, enables the mobile terminal to perform a method of lens switching, applied to a terminal having a first lens and a second lens, the method comprising:
acquiring first image data of a target object in a first image in a field of view of a first lens;
determining second image data of the target object in a second image in a field of view of a second lens;
determining a displacement amount of the target object based on the first image data and the second image data;
when the first lens is switched to the second lens, based on the displacement, the display area of the target object in the second image is adjusted from a first area to a second area, and the adjusted second image is displayed.
CN202011057991.9A 2020-09-30 2020-09-30 Method and device for switching lenses and storage medium Active CN114339018B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011057991.9A CN114339018B (en) 2020-09-30 2020-09-30 Method and device for switching lenses and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011057991.9A CN114339018B (en) 2020-09-30 2020-09-30 Method and device for switching lenses and storage medium

Publications (2)

Publication Number Publication Date
CN114339018A CN114339018A (en) 2022-04-12
CN114339018B true CN114339018B (en) 2023-08-22

Family

ID=81010770

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011057991.9A Active CN114339018B (en) 2020-09-30 2020-09-30 Method and device for switching lenses and storage medium

Country Status (1)

Country Link
CN (1) CN114339018B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105491267A (en) * 2014-09-16 2016-04-13 聚晶半导体股份有限公司 Image capturing device and digital zooming method
CN107222737A (en) * 2017-07-26 2017-09-29 维沃移动通信有限公司 The processing method and mobile terminal of a kind of depth image data
CN107800953A (en) * 2016-09-02 2018-03-13 聚晶半导体股份有限公司 The method of image acquiring device and its zoomed image
CN111464734A (en) * 2019-01-18 2020-07-28 北京小米移动软件有限公司 Method and device for processing image data

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI539226B (en) * 2014-10-09 2016-06-21 聚晶半導體股份有限公司 Object-tracing image processing method and system thereof
US10389948B2 (en) * 2016-12-06 2019-08-20 Qualcomm Incorporated Depth-based zoom function using multiple cameras

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105491267A (en) * 2014-09-16 2016-04-13 聚晶半导体股份有限公司 Image capturing device and digital zooming method
CN107800953A (en) * 2016-09-02 2018-03-13 聚晶半导体股份有限公司 The method of image acquiring device and its zoomed image
CN107222737A (en) * 2017-07-26 2017-09-29 维沃移动通信有限公司 The processing method and mobile terminal of a kind of depth image data
CN111464734A (en) * 2019-01-18 2020-07-28 北京小米移动软件有限公司 Method and device for processing image data

Also Published As

Publication number Publication date
CN114339018A (en) 2022-04-12

Similar Documents

Publication Publication Date Title
CN110557547B (en) Lens position adjusting method and device
CN106657780B (en) Image preview method and device
CN111294511B (en) Focusing method and device of camera module and storage medium
CN107241535B (en) Flash lamp adjusting device and terminal equipment
CN112188096A (en) Photographing method and device, terminal and storage medium
CN114339018B (en) Method and device for switching lenses and storage medium
CN114666490B (en) Focusing method, focusing device, electronic equipment and storage medium
CN112235509B (en) Focal length adjusting method and device, mobile terminal and storage medium
CN114339019B (en) Focusing method, focusing device and storage medium
CN111461950B (en) Image processing method and device
CN107682623B (en) Photographing method and device
CN106131403B (en) Touch focusing method and device
CN112866555A (en) Shooting method, shooting device, shooting equipment and storage medium
CN114339017B (en) Distant view focusing method, device and storage medium
CN114268731B (en) Camera switching method, camera switching device and storage medium
CN113766115B (en) Image acquisition method, mobile terminal, device and storage medium
CN110955328B (en) Control method and device of electronic equipment and storage medium
CN117546071A (en) Zoom method, zoom device, electronic apparatus, and storage medium
CN116402695A (en) Video data processing method, device and storage medium
CN106959875B (en) Front camera opening method, device and equipment
CN117412168A (en) Focusing method, device, equipment and storage medium
CN116489507A (en) Focusing method, focusing device, electronic equipment and storage medium
CN115550538A (en) Tracking shooting method, device and medium
CN117876275A (en) Image processing method, device, terminal and storage medium
CN116419069A (en) Image preview method, device, terminal equipment and readable 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