CN114339018A - Lens switching method and device and storage medium - Google Patents
Lens switching method and device and storage medium Download PDFInfo
- Publication number
- CN114339018A CN114339018A CN202011057991.9A CN202011057991A CN114339018A CN 114339018 A CN114339018 A CN 114339018A CN 202011057991 A CN202011057991 A CN 202011057991A CN 114339018 A CN114339018 A CN 114339018A
- Authority
- CN
- China
- Prior art keywords
- image
- target object
- area
- lens
- 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.)
- Granted
Links
Images
Landscapes
- Studio Devices (AREA)
Abstract
The present disclosure relates to a method, apparatus, and storage medium for shot switching. The method comprises the following steps: acquiring first image data of a target object within a first image within 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, the display area of the target object in the second image is adjusted from a first area to a 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 in the field of view of the second lens according to the displacement amount of the target object in the first image in the field of view of the first lens and the displacement amount of the target object in the second image in the field of view of the second lens, so as to avoid obvious jump of the target object when the first lens is switched to the second lens.
Description
Technical Field
The present disclosure relates to the field of image data processing, and in particular, to a method and an apparatus for switching a lens, and a storage medium.
Background
In the related art, a plurality of lenses are often arranged on a terminal device, and the plurality of lenses are arranged at a certain distance and angle. Due to the difference of the distance and the angle between the lenses, when the lenses are switched, the pictures jump obviously. For example, in a multi-depth picture, due to the distance and angle between two lenses, when the lenses are switched, the two lenses have different field ranges, so that the parallax of a near object is large, and the parallax of a far object is small. When the lens is switched, the jump of an object in the picture, especially a near object, is obvious. For example, as shown in fig. 1, fig. 1 shows a schematic diagram of comparison of pictures acquired by two shots when the two shots are switched. 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, where the picture numbered 1 is a picture obtained by the telephoto lens, and the picture numbered 1' is a picture obtained by the wide-angle lens. The position of the same object in the two frames has a jump, for example, the picture taken by the telephoto lens, the picture numbered 1, the picture taken by the wide-angle lens with the object numbered 100, the picture numbered 1 ', and the object numbered 100' have a jump. In the prior art, the fluency Of lens switching is poor, the jump Of a Field Of View (FOV) is obvious, and the user experience is poor. The technical problem to be solved urgently is to provide a method for switching a lens, which has good fluency of lens switching and unobvious jump of a view angle range.
Disclosure of Invention
To overcome the problems in the related art, the present disclosure provides a method, an apparatus, and a storage medium for lens switching.
According to a first aspect of the embodiments of the present disclosure, there is provided a method for switching a lens, which is applied to a terminal, the method for switching a lens including:
acquiring first image data of a target object within a first image within 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, the display area of the target object in the second image is adjusted from a first area to a second area based on the displacement amount, and the adjusted second image is displayed.
Wherein, after 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 and before displaying the adjusted second image, the method further comprises:
and adjusting the background image data of the first area in the second image based on the image data of the target area in the first image, wherein the target area is the 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:
determining a displacement amount of the position of the target object within the second image relative to the position within the first image according to the position information of the target object within the first image and the position information of the target object within the second image.
Wherein the adjusting the display area of the target object within the second image from a first area to a second area based on the displacement amount comprises:
and moving a display area of the target object in the second image from the first area to the second area by a preset distance along a direction opposite to the displacement generating the displacement amount, wherein the preset distance is less than or equal to the displacement amount.
Wherein the first image data comprises depth information of the target object within the first image; the second image data comprises depth information of the target object within the second image;
the 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 comprises:
and determining whether the target object is a preset adjustment object or not 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 an object where the focus point is located in the first image, and if the depth of field of the object where the focus point is located is different from the depth of field of the object where the focus point is located, determining that the object is a preset adjustment object.
The method for switching the lens 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 the 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 within a first image within 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 adjusting and displaying 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 amount 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 of the display area of the target object within the second image from the first area to the second area based on the displacement amount, before the displaying of the adjusted second image:
and adjusting the background image data of the first area in the second image based on the image data of the target area in the first image, wherein the target area is the 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:
determining a displacement amount of the position of the target object within the second image relative to the position within the first image according to the position information of the target object within the first image and the position information of the target object within 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 by a preset distance along a direction opposite to the displacement generating the displacement amount, wherein the preset distance is less than or equal to the displacement amount.
Wherein the first image data comprises depth information of the target object within the first image; the second image data comprises 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 or not 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 an object where the focus point is located in the first image, and if the depth of field of the object where the focus point is located is different from the depth of field of the object where the focus point is located, determining that the object is a preset adjustment object.
Wherein, the device for switching the lens further comprises:
a moving distance adjusting module configured to reduce a moving distance of the target object according to a preset rule so that a display area of the target object in the second image is restored from the second area to the first area when the focal length adjustment is performed under the second lens.
According to a third aspect of the embodiments of the present disclosure, there is provided a lens switching apparatus including:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
acquiring first image data of a target object within a first image within 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, the display area of the target object in the second image is adjusted from a first area to a second area based on the displacement amount, 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 having instructions therein, which when executed by a processor of a mobile terminal, enable the mobile terminal to perform a method of shot switching, the method comprising:
acquiring first image data of a target object within a first image within 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, the display area of the target object in the second image is adjusted from a first area to a second area based on the displacement amount, and the adjusted second image is displayed.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects: according to the displacement amounts of the target object in the first image in the field of view of the first lens and 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 the target object is prevented from generating obvious jumping when the first lens is switched to the second lens, the switching fluency 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 is a schematic diagram showing a comparison of pictures acquired by two shots when the two shots are switched. (ii) a
FIG. 2 illustrates a method of shot cuts in accordance with an exemplary embodiment;
FIG. 3 shows a flow chart of a method of determining an amount of displacement of a target object;
FIG. 4 is a flowchart illustrating a method for adjusting a display area of the target object in the second image from a first area to a second area based on the amount of displacement;
FIG. 5 shows a schematic diagram of a picture taken at the same magnification by a wide-angle lens and a telephoto lens when the wide-angle lens is hopped to the telephoto lens;
FIG. 6 is a flowchart illustrating a method for adjusting a display area of the target object in the second image from a first area to a second area based on the amount of displacement;
fig. 7 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 a second image;
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 a second image;
fig. 9 is a flowchart showing an adjustment method of the moving distance of the target object;
FIG. 10 is a block diagram illustrating an apparatus for lens switching in accordance with an exemplary embodiment;
fig. 11 shows a block diagram of a lens switching apparatus (general structure of a mobile terminal) shown according to an exemplary embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the invention, as detailed in the appended claims.
Fig. 2 illustrates a method of shot cut according to an exemplary embodiment, and as shown in fig. 2, the method of shot cut 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 within a first image within 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;
adjusting a display area of the target object within the second image from the first area to the second area based on the displacement amount when the first lens is switched to the second lens in step S14;
in step S15, the adjusted second image is displayed.
In the lens switching method provided by the present 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 amount of displacement of the target object, i.e., the amount of jump of the target object when the first shot is switched to the second shot, can 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 amount so as to avoid obvious jump of the target object when the two lenses are switched.
The target object may be a scene displayed within the first image within the field of view of the first lens or may be a pixel within the first image within 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 and the adjusted second image is displayed according to the displacement amounts of the target object in the first image in the field of view of the first lens and the second image in the field of view of the second lens, so that the target object is prevented from generating obvious jumping when the first lens is switched to the second lens, the switching fluency is improved, and the user experience is improved.
In the method for switching lens provided by the present disclosure, in order to avoid generating a blank in the image data of the display area before adjustment due to the adjustment of the display area of the target object, as shown in a dotted line portion in fig. 2, the dotted line portion in fig. 2 shows that, after 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 before the adjusted second image is displayed, the method may further include the following steps:
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 the area in the first image corresponding to the first area in the second image.
In the method for switching lens provided by the present 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 up the blank, the image data of the area corresponding to the first area in the second image in the first image may be fused into the background image of the first area in the second image. This can effectively avoid the loss of the image data of the second image due to the generation of the blank data.
In the method for lens switching provided by the present disclosure, a method for determining a displacement amount of a target object is further provided, as shown in fig. 3, and fig. 3 shows a flowchart of the method for determining the displacement amount of the target object, in the method shown in fig. 3, the first image data may include position information of the target object within the first image, and the second image data may include position information of the target object within the second image.
In step S131, the displacement amount of the position of the target object within the second image with respect to the position within the first image is determined based on the position information of the target object within the first image and the position information of the target object within the second image.
In the method of lens switching provided by the present disclosure, the displacement amount of the position of the target object within the second image with respect to the position within the first image may be determined according to the position information of the target object within the first image and the position information within the second image. The amount of displacement is determined from the change in position of the target object within the first image and within the second image. When the two lenses are switched, the jumping state of the target object is reflected in the position jumping of the target object in the first image and the second image, the displacement is determined according to the position change of the target object reflected in the jumping 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 switching lens provided by the present disclosure, there is further provided an adjusting 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, where fig. 4 is 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 a displacement amount:
in step S141, the display region of the target object in the second image is moved from the first region to the second region by a predetermined distance in a direction opposite to the displacement that generates the displacement amount, wherein the predetermined distance is equal to or less than the displacement amount.
In the method of lens switching provided by the present disclosure, the display region of the target object within the second image may be moved by a preset distance from the first region in a direction opposite to the displacement that generates 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, where the picture numbered 10 is a picture obtained by the telephoto lens, and the picture numbered 10' is a picture obtained by the wide-angle lens. The same first object in both pictures has a jump in position, for example, in the picture taken at telephoto lens, the picture numbered 10, the first object numbered 101 in the picture numbered 10 ' in the picture taken at wide-angle lens, and the first object numbered 101 ' in the picture numbered 10 ' has a jump in position by a displacement amount T. In order to avoid a significant jump of the first object during the switching between the telephoto lens and the wide-angle lens, the first object is moved by a predetermined distance in a direction opposite to the displacement that generates the displacement amount T, i.e., in a direction indicated by an arrow d, so that the first object can be smoothly switched during the switching between the telephoto lens and the wide-angle lens. The preset distance can be equal to the displacement T or slightly smaller than the displacement T, and after the first object moves the preset distance, no jump is generated and smooth transition is achieved. As shown in fig. 5, the preset distance shown in fig. 5 is smaller than the displacement amount T.
In a method of shot cut provided by the present disclosure, the first image data includes depth information of a target object within the first image; the second image data includes depth information of the target object within the second image. A method for determining whether a target object is a preset adjustment object is further provided in the method, as shown in fig. 6, and fig. 6 is a flowchart illustrating a method for 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:
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 within the second image is adjusted from the first area to the second area based on the displacement amount.
In the method for switching shots provided by the present 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 within the second image may be adjusted from the first area to the second area based on the displacement amount.
The depth information may indicate how far and how close an 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, where fig. 7 shows a flowchart of a method for 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 S1421, determining a 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;
in step S1422, it is determined whether the depth of field of the target object is smaller than a preset threshold, and if so, the target object is determined to be a preset adjustment object.
In the process of switching the two lenses, due to the difference of the distance and the angle of the two lenses, the field range of each lens is different, so that 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, the first object in fig. 5 is a near object, i.e., an object with a small depth of field. The second object is a distant object, i.e., an object with a large depth of field. The second object is the object referenced 201 in the picture referenced 10 and 201 'in the picture referenced 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 a large displacement can be adjusted. Whether the target object is an adjustment object may 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, it indicates that the target object has a smaller depth of field, is a close object, and has a larger jump degree when the lens is switched, and the target object may 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, the depth of field of the target object is larger and the target object is a distant object, the jumping degree is smaller during lens switching, 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 jump may be adjusted in units of pixels.
In the method for switching shots provided by 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 a second image:
in step S1423, the depth of field of the object where the focus point 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 where the focus point is located, the target object is determined to be a preset adjustment object.
During the process of taking a picture, there may be objects of more interest, and in order to make the object of interest take a clearer picture, the picture may be focused on the object of interest. When the two lenses are switched, whether the target object is a preset adjustment object may be determined in consideration of the focusing state. For example, when the lens focuses on the object of interest, the depth of field of the object or the object at which the focus point is located in the first image is acquired, and if the depth of field of the target object is different from the depth of field of the object at which the focus point is located, the target object is a preset adjustment object. The object or object having the same depth of field as the object at which the focus is located is not taken as the preset adjustment object. Therefore, in the process of shooting the picture, the object or the object with the same depth of field as the object with the focus can be correspondingly adjusted without adjusting the object or the object with the same depth of field as the object with the focus, so that the accuracy and the definition of the object concerned in the process of shooting the picture are ensured.
In the method for switching lens provided by 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 shows a flowchart of the method for adjusting a moving distance of a target object:
in step S17, when focus 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 within 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 moves by the preset distance. In order to enable the second image captured by the second lens to display its original state, the display area of the moving target object needs to be restored from the second area to the first area. The restoring method may perform restoring 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 or gradually reduced by a gradually increasing distance difference every time the predetermined scale is enlarged or reduced.
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 from the second area to the first area by adjusting the moving distance of the target object, so as to avoid distortion of the second image.
In one exemplary embodiment of the present disclosure, a lens switching apparatus is provided. As shown in fig. 10, fig. 10 is a block diagram illustrating a lens switching apparatus according to an exemplary embodiment. Referring to fig. 10, the apparatus includes an obtaining module 1001, a first determining module 1002, a second determining module 1003, an adjusting display module 1004, and an outputting 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 determination module 1003 configured to determine a displacement amount of the target object based on the first image data and the second image data;
an adjusting and displaying 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 of the display area of the target object within the second image from the first area to the second area based on the displacement amount, before the displaying of the adjusted second image:
and adjusting the background image data of the first area in the second image based on the image data of the target area in the first image, wherein the target area is the 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:
determining a displacement amount of the position of the target object within the second image relative to the position within the first image according to the position information of the target object within the first image and the position information of the target object within 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 by a preset distance along a direction opposite to the displacement generating the displacement amount, wherein the preset distance is less than or equal to the displacement amount.
Wherein the first image data comprises depth information of the target object within the first image; the second image data comprises 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 or not 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 an object where the focus point is located in the first image, and if the depth of field of the object where the focus point is located is different from the depth of field of the object where the focus point is located, determining that the object is a preset adjustment object.
Wherein, the device for switching the lens further comprises:
a moving distance adjusting module 1005 configured to reduce the moving distance of the target object according to a preset rule when performing the focus adjustment under the second lens, so that the display area of the target object in the second image is restored from the second area to the first area.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Fig. 11 illustrates a block diagram of a lens-switching apparatus 1100 according to an exemplary embodiment. For example, the apparatus 1100 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and 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 the overall operation of the device 1100, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing components 1102 may include one or more processors 1120 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 1102 may include one or more modules that facilitate interaction 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.
The memory 1104 is configured to store various types of data to support operation at the device 1100. Examples of such data include instructions for any application or method operating on device 1100, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 1104 may be implemented by any type or combination of volatile or non-volatile 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 disks.
The multimedia component 1108 includes a screen that provides an output interface between the device 1100 and a user. 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 an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 1108 includes a front facing camera and/or a rear facing camera. The front-facing camera and/or the rear-facing camera may receive external multimedia data when the device 1100 is in an operating 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 a focal length and optical zoom capability.
The audio component 1110 is configured to output and/or input audio signals. For example, the audio component 1110 includes a Microphone (MIC) configured to receive external audio signals when the apparatus 1100 is in operating modes, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 1104 or transmitted via the communication component 1116. In some embodiments, the audio assembly 1110 further includes 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: a home button, a volume button, a start button, and a lock button.
The sensor assembly 1114 includes one or more sensors for providing various aspects of state assessment for the apparatus 1100. For example, the sensor assembly 1114 may detect an open/closed state of the device 1100, the relative positioning of components, such as a 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, an 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 a nearby object without 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 gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 1116 is configured to facilitate wired or wireless communication between the apparatus 1100 and other devices. The apparatus 1100 may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 1116 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 1116 also includes a Near Field Communication (NFC) module to facilitate short-range communications. 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, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer-readable storage medium comprising instructions, such as the memory 1104 comprising instructions, executable by the processor 1120 of the apparatus 1100 to perform the method described above is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like. The instructions in the storage medium, when executed by a processor of a mobile terminal, enable the mobile terminal to perform a method of shot switching, the method comprising:
acquiring first image data of a target object within a first image within 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, the display area of the target object in the second image is adjusted from a first area to a second area based on the displacement amount, and the adjusted second image is displayed.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the invention is limited only by the appended claims.
Claims (18)
1. A method for switching a lens is applied to a terminal, and is characterized in that the method for switching the lens comprises the following steps:
acquiring first image data of a target object within a first image within 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, the display area of the target object in the second image is adjusted from a first area to a second area based on the displacement amount, and the adjusted second image is displayed.
2. The method of claim 1, 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 before the displaying the adjusted second image further comprises:
and adjusting the background image data of the first area in the second image based on the image data of the target area in the first image, wherein the target area is the area corresponding to the first area in the second image in the first image.
3. The method of 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:
determining a displacement amount of the position of the target object within the second image relative to the position within the first image according to the position information of the target object within the first image and the position information of the target object within the second image.
4. The method of claim 3, wherein the adjusting the display area of the target object in the second image from a first area to a second area based on the displacement comprises:
and moving a display area of the target object in the second image from the first area to the second area by a preset distance along a direction opposite to the displacement generating the displacement amount, wherein the preset distance is less than or equal to the displacement amount.
5. The method of claim 1, wherein the first image data comprises depth information of the target object within the first image; the second image data comprises depth information of the target object within the second image;
the 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 comprises:
and determining whether the target object is a preset adjustment object or not 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 of claim 5, 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 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 of claim 5, 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 comprises:
and acquiring the depth of field of an object where the focus point is located in the first image, and if the depth of field of the object where the focus point is located is different from the depth of field of the object where the focus point is located, determining that the object is a preset adjustment object.
8. The method of shot-cut as claimed in 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 apparatus, comprising:
an acquisition module 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 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 adjusting and displaying 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 amount when the first lens is switched to the second lens, and display the adjusted second image.
10. The apparatus for lens switching according to claim 9, wherein the adjusting display module is further configured to:
after the adjusting of the display area of the target object within the second image from the first area to the second area based on the displacement amount, before the displaying of the adjusted second image:
and adjusting the background image data of the first area in the second image based on the image data of the target area in the first image, wherein the target area is the 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:
determining a displacement amount of the position of the target object within the second image relative to the position within the first image according to the position information of the target object within the first image and the position information of the target object within the second image.
12. The apparatus for lens switching according to claim 11, wherein the adjusting 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 by a preset distance along a direction opposite to the displacement generating the displacement amount, wherein the preset distance is less than or equal to the displacement amount.
13. The apparatus for lens switching according to claim 9, wherein the first image data includes depth information of the target object within the first image; the second image data comprises 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 or not 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 apparatus for lens switching according to claim 13, wherein the adjusting 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 apparatus for lens switching according to claim 13, wherein the adjusting display module is configured to:
and acquiring the depth of field of an object where the focus point is located in the first image, and if the depth of field of the object where the focus point is located is different from the depth of field of the object where the focus point is located, determining that the object is a preset adjustment object.
16. The lens switching apparatus according to claim 12, further comprising:
a moving distance adjusting module configured to reduce a moving distance of the target object according to a preset rule so that a display area of the target object in the second image is restored from the second area to the first area when the focal length adjustment is performed under the second lens.
17. A lens switching apparatus, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
acquiring first image data of a target object within a first image within 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, the display area of the target object in the second image is adjusted from a first area to a second area based on the displacement amount, and the adjusted second image is displayed.
18. A non-transitory computer readable storage medium having instructions therein which, when executed by a processor of a mobile terminal, enable the mobile terminal to perform a method of shot switching, the method comprising:
acquiring first image data of a target object within a first image within 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, the display area of the target object in the second image is adjusted from a first area to a second area based on the displacement amount, and the adjusted second image is displayed.
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 true CN114339018A (en) | 2022-04-12 |
CN114339018B 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 (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105491267A (en) * | 2014-09-16 | 2016-04-13 | 聚晶半导体股份有限公司 | Image capturing device and digital zooming method |
US20160105615A1 (en) * | 2014-10-09 | 2016-04-14 | Altek Semiconductor Corporation | Image processing system and method for object-tracing |
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 |
US20180160046A1 (en) * | 2016-12-06 | 2018-06-07 | Qualcomm Incorporated | Depth-based zoom function using multiple cameras |
CN111464734A (en) * | 2019-01-18 | 2020-07-28 | 北京小米移动软件有限公司 | Method and device for processing image data |
-
2020
- 2020-09-30 CN CN202011057991.9A patent/CN114339018B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105491267A (en) * | 2014-09-16 | 2016-04-13 | 聚晶半导体股份有限公司 | Image capturing device and digital zooming method |
US20160105615A1 (en) * | 2014-10-09 | 2016-04-14 | Altek Semiconductor Corporation | Image processing system and method for object-tracing |
CN107800953A (en) * | 2016-09-02 | 2018-03-13 | 聚晶半导体股份有限公司 | The method of image acquiring device and its zoomed image |
US20180160046A1 (en) * | 2016-12-06 | 2018-06-07 | Qualcomm Incorporated | Depth-based zoom function using multiple cameras |
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 |
---|---|
CN114339018B (en) | 2023-08-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110557547B (en) | Lens position adjusting method and device | |
CN110493526B (en) | Image processing method, device, equipment and medium based on multiple camera modules | |
CN110769147B (en) | Shooting method and electronic equipment | |
CN111294511B (en) | Focusing method and device of camera module and storage medium | |
CN115134505B (en) | Preview picture generation method and device, electronic equipment and storage medium | |
CN107241535B (en) | Flash lamp adjusting device and terminal equipment | |
CN112188096A (en) | Photographing method and device, terminal and storage medium | |
CN108108668B (en) | Age prediction method and device based on image | |
CN114666490B (en) | Focusing method, focusing device, electronic equipment and storage medium | |
CN117522942A (en) | Depth distance measuring method, depth distance measuring device, electronic equipment and readable storage medium | |
CN112866555B (en) | Shooting method, shooting device, shooting equipment and storage medium | |
CN114339018B (en) | Method and device for switching lenses and storage medium | |
CN115134517A (en) | Shooting control method and device and storage medium | |
CN106131403B (en) | Touch focusing method and device | |
CN114268731B (en) | Camera switching method, camera switching device and storage medium | |
CN114339017B (en) | Distant view focusing method, device and storage medium | |
CN109447929B (en) | Image synthesis method and device | |
CN116402695B (en) | Video data processing method, device and storage medium | |
CN106713748B (en) | Method and device for sending pictures | |
CN117546071A (en) | Zoom method, zoom device, electronic apparatus, and storage medium | |
CN117412168A (en) | Focusing method, device, equipment and storage medium | |
CN115134513A (en) | Shooting method and device | |
CN118433527A (en) | Focusing method, device, equipment and storage medium | |
CN118175420A (en) | Image acquisition method, device, equipment and storage medium | |
CN115550538A (en) | Tracking shooting method, device and 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 |