CN111654629B - Camera switching method and device, electronic equipment and readable storage medium - Google Patents

Camera switching method and device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN111654629B
CN111654629B CN202010528274.3A CN202010528274A CN111654629B CN 111654629 B CN111654629 B CN 111654629B CN 202010528274 A CN202010528274 A CN 202010528274A CN 111654629 B CN111654629 B CN 111654629B
Authority
CN
China
Prior art keywords
camera
preview image
focal length
preview
image acquired
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
CN202010528274.3A
Other languages
Chinese (zh)
Other versions
CN111654629A (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.)
Spreadtrum Communications Shanghai Co Ltd
Original Assignee
Spreadtrum Communications Shanghai 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 Spreadtrum Communications Shanghai Co Ltd filed Critical Spreadtrum Communications Shanghai Co Ltd
Priority to CN202010528274.3A priority Critical patent/CN111654629B/en
Publication of CN111654629A publication Critical patent/CN111654629A/en
Application granted granted Critical
Publication of CN111654629B publication Critical patent/CN111654629B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/62Control of parameters via user interfaces
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/667Camera operation mode switching, e.g. between still and video, sport and normal or high- and low-resolution modes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/67Focus control based on electronic image sensor signals

Landscapes

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

Abstract

The embodiment of the application provides a camera switching method and device, electronic equipment and a readable storage medium, when responding to a camera starting instruction, the camera switching method and device simultaneously start each camera arranged on the electronic equipment, display a preview image acquired by a default camera in a shooting interface, receive a focal length adjusting instruction of a user, when the focal length adjusted by the user meets a camera switching condition, acquire the preview image acquired by a target camera corresponding to the adjusted focal length, and switch the currently displayed preview image in the shooting interface into the preview image acquired by the target camera. After the camera is started, each camera on the electronic equipment is in an open state, so that in the process of switching the cameras, the preview image currently displayed in the shooting interface can be directly switched into the preview image collected by the target camera without waiting for the target camera to be started, and the problem of unsmooth shooting picture in the switching process of different cameras can be effectively solved.

Description

Camera switching method and device, electronic equipment and readable storage medium
Technical Field
The embodiment of the application relates to the technical field of electronic equipment, in particular to a camera switching method and device, electronic equipment and a readable storage medium.
Background
With the continuous development of electronic technology, electronic devices such as smart phones and tablet computers are equipped with cameras, so that users can shoot interesting things anytime and anywhere by means of the electronic devices, and the lives of people are greatly enriched.
At present, in order to meet the more diversified photographing requirements of people, more and more electronic devices are provided with a plurality of cameras at the same time. The more common configuration modes include: a double-shooting system formed by combining a wide-angle camera and a long-focus camera; the three-camera system is formed by combining an ultra-wide-angle camera, a wide-angle camera and a long-focus camera. When shooting, only one of the cameras is usually in an open state, and the rest are in a closed state. Taking a dual-camera system as an example, when the shooting focal length is less than a certain threshold, the wide-angle camera is started to shoot, the tele camera is in a closed state, and when the shooting focal length is greater than or equal to the threshold, the tele camera is started to shoot, and the wide-angle camera is closed.
In the shooting mode, a certain time is required to start the telephoto camera in the process of switching from the wide-angle camera to the telephoto camera, so that the shooting picture is easy to jump. Namely, in the switching process between different cameras at present, the situation that the shot picture is not smooth exists.
Disclosure of Invention
The embodiment of the application provides a camera switching method and device, electronic equipment and a readable storage medium, which can solve the technical problem that a shot picture is not smooth in the switching process of different cameras at present.
In a first aspect, an embodiment of the present application provides a camera switching method, which is applied to an electronic device, where the electronic device is provided with at least two cameras, and focal lengths of the at least two cameras are different from each other, and the method includes:
responding to a camera starting instruction, simultaneously starting the at least two cameras, and displaying preview images acquired by a default camera in the at least two cameras in a shooting interface;
responding to a focal length adjusting instruction, and detecting whether the adjusted focal length meets a camera switching condition;
and when the adjusted focal length meets the camera switching condition, acquiring a preview image acquired by a target camera corresponding to the adjusted focal length, and switching the preview image acquired by the first camera currently displayed in the shooting interface into the preview image acquired by the target camera.
In one possible design, the simultaneously activating the at least two cameras in response to a camera activation instruction includes:
responding to a camera starting instruction, and simultaneously starting the image sensors corresponding to the cameras;
the displaying the preview image collected by a default camera of the at least two cameras in the shooting interface includes:
sending a preview request to an image sensor corresponding to the default camera, wherein the preview request is used for requesting to send a preview image acquired by the image sensor corresponding to the default camera to the shooting interface for displaying;
and receiving a preview image sent by an image sensor corresponding to the default camera, and outputting the received preview image to the shooting interface for display.
In a possible design, the camera of the electronic device is divided into at least two focal segments, each focal segment corresponds to a different camera, and the detecting whether the adjusted focal length satisfies the camera switching condition in response to the focal length adjusting instruction includes:
in response to a focus slide adjustment operation, when the focus slide adjustment operation adjusts the focus of the camera from one of the at least two focus segments to another adjacent focus segment, determining that the adjusted focus satisfies the camera switching condition.
In a feasible design manner, the acquiring a preview image acquired by a target camera corresponding to the adjusted focal length, and switching a preview image acquired by a first camera currently displayed in the shooting interface to a preview image acquired by the target camera includes:
sending a preview request to the target camera, wherein the preview request is used for requesting to send a preview image acquired by the target camera to the shooting interface for displaying;
receiving a preview image sent by the target camera;
acquiring a first time stamp of a preview image acquired by the first camera last time and a second time stamp of the preview image acquired by the target camera last time;
judging whether the difference value of the first timestamp and the second timestamp is smaller than a preset threshold value or not;
and when the difference value between the first timestamp and the second timestamp is smaller than the preset threshold value, switching the preview image acquired by the first camera currently displayed in the shooting interface into the preview image acquired by the target camera, and stopping sending a preview request to the first camera.
In a possible design, the camera of the electronic device is divided into at least two focal segments, each focal segment corresponds to a different camera, and the detecting whether the adjusted focal length satisfies the camera switching condition in response to the focal length adjusting instruction includes:
responding to a focal length click adjustment operation, and when the focal length click adjustment operation adjusts the focal length of the camera from one focal length to the other focal length of the at least two focal lengths, determining that the adjusted focal length meets the camera switching condition.
In a feasible design manner, the obtaining a preview image acquired by a target camera corresponding to the adjusted focal length, and switching a preview image acquired by a first camera currently displayed in the shooting interface to a preview image acquired by the target camera includes:
sending a preview request to the target camera, wherein the preview request is used for requesting to send a preview image acquired by the target camera to the shooting interface for displaying;
and receiving a preview image sent by the target camera, outputting the received preview image to the shooting interface for display, and stopping issuing a preview request to the first camera.
In a second aspect, an embodiment of the present application provides a camera switching device, which is applied to an electronic device, where the electronic device is provided with at least two cameras, focal lengths of the at least two cameras are different from each other, and the device includes:
the starting module is used for responding to a camera starting instruction, simultaneously starting the at least two cameras and displaying preview images acquired by a default camera in the at least two cameras in a shooting interface;
the detection module is used for responding to the focal length adjusting instruction and detecting whether the adjusted focal length meets the camera switching condition;
and the switching module is used for acquiring the preview image acquired by the target camera corresponding to the adjusted focal length when the adjusted focal length meets the camera switching condition, and switching the preview image acquired by the first camera currently displayed in the shooting interface into the preview image acquired by the target camera.
In a possible design, the starting module is specifically configured to:
responding to a camera starting instruction, and simultaneously starting the image sensors corresponding to the cameras;
sending a preview request to an image sensor corresponding to the default camera, wherein the preview request is used for requesting to send a preview image acquired by the image sensor corresponding to the default camera to the shooting interface for displaying;
and receiving a preview image sent by an image sensor corresponding to the default camera, and outputting the received preview image to the shooting interface for display.
In a possible design manner, a camera of the electronic device is divided into at least two focal segments, and each focal segment corresponds to a different camera, and the detection module is specifically configured to:
in response to a focus slide adjustment operation, when the focus slide adjustment operation adjusts the focus of the camera from one of the at least two focal sections to another adjacent focal section, determining that the adjusted focus satisfies the camera switching condition.
In a possible design, the switching module is specifically configured to:
when the adjusted focal length meets the camera switching condition, sending a preview request to the target camera, wherein the preview request is used for requesting to send a preview image acquired by the target camera to the shooting interface for displaying;
receiving a preview image sent by the target camera;
acquiring a first time stamp of a preview image acquired by the first camera last time and a second time stamp of the preview image acquired by the target camera last time;
judging whether the difference value of the first timestamp and the second timestamp is smaller than a preset threshold value or not;
and when the difference value between the first timestamp and the second timestamp is smaller than the preset threshold value, switching the preview image acquired by the first camera currently displayed in the shooting interface into the preview image acquired by the target camera, and stopping sending a preview request to the first camera.
In a feasible design, a camera of the electronic device is divided into at least two focal segments, each focal segment corresponds to a different camera, and the detection module is specifically configured to:
responding to a focal length click adjustment operation, and when the focal length click adjustment operation adjusts the focal length of the camera from one focal length to the other focal length of the at least two focal lengths, determining that the adjusted focal length meets the camera switching condition.
In a possible design, the switching module is specifically configured to:
sending a preview request to the target camera, wherein the preview request is used for requesting to send a preview image acquired by the target camera to the shooting interface for displaying;
and receiving a preview image sent by the target camera, outputting the received preview image to the shooting interface for display, and stopping issuing a preview request to the first camera.
In a third aspect, an embodiment of the present application provides an electronic device, including: at least one processor and memory;
the memory stores computer execution instructions;
the at least one processor executes computer-executable instructions stored by the memory, causing the at least one processor to perform the camera switching method as provided by the first aspect.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, where a computer executing instruction is stored in the computer-readable storage medium, and when a processor executes the computer executing instruction, the camera switching method according to the first aspect is implemented.
According to the camera switching method and device, the electronic equipment and the readable storage medium, when a camera starting instruction is responded, all cameras arranged on the electronic equipment are started simultaneously, the preview images collected by default cameras are displayed in a shooting interface, a focal length adjusting instruction of a user is received, when the focal length adjusted by the user meets the camera switching condition, the preview images collected by a target camera corresponding to the adjusted focal length are obtained, and the preview images currently displayed in the shooting interface are switched to the preview images collected by the target camera. In the embodiment of the application, because each camera on the electronic device is in the open state after the camera is started, in the process of switching the cameras, the preview image currently displayed in the shooting interface can be directly switched to the preview image collected by the target camera without waiting for the target camera to be started, so that the problem that the shooting pictures are not smooth in the switching process of different cameras can be effectively avoided.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required to be used in the embodiments of the present application or the technical solutions in the prior art are briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without inventive labor.
Fig. 1 is a schematic view of a shooting interface of an electronic device provided in an embodiment of the present application;
fig. 2 is a schematic flowchart of a camera switching method provided in an embodiment of the present application;
FIG. 3 is a schematic view of a scene of adjusting a focal length by sliding in an embodiment of the present application;
FIG. 4 is a schematic view of a scene in which a focus is adjusted by clicking in the embodiment of the present application;
fig. 5 is a schematic diagram of program modules of a camera switching device provided in an embodiment of the present application;
fig. 6 is a schematic hardware structure diagram of an electronic device provided in an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It is to be understood that the terms "first," "second," and the like in the embodiments of the present application are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the designations used as such may be interchanged under appropriate circumstances in order to facilitate describing the embodiments of the application.
The camera switching method provided by the embodiment of the application can be applied to various types of electronic equipment, such as smart phones, tablet computers, cameras, monitoring equipment and the like. The common configuration modes are: a double-shooting system formed by combining a wide-angle camera and a long-focus camera; the three-camera system is formed by combining an ultra-wide-angle camera, a wide-angle camera and a long-focus camera; and a shooting system formed by combining four or more than four cameras with different focal lengths, which is not illustrated in the embodiment of the application.
The wide-angle camera is a lens with a large visual field and a small focal length, and can shoot a scene with a wide visual field generally; the ultra-wide-angle camera is a lens with larger visual field and smaller focal length than a wide-angle lens, and can shoot a scene with larger visual field generally; a telephoto camera is a lens with a small field of view and a large focal length, and can generally shoot scenes with a small field of view but rich details.
At present, when shooting is performed through the electronic device, only one of the plurality of cameras is usually in an on state, and the rest of the plurality of cameras are in an off state. Taking a dual-camera system as an example, when the shooting focal length is less than a certain threshold, the electronic device only starts the wide-angle camera to shoot, the tele camera is in a closed state, and when the shooting focal length is greater than or equal to the threshold, the electronic device starts the tele camera to shoot and simultaneously closes the wide-angle camera. Because a certain time needs to be consumed to start the telephoto camera in the process of switching the shooting mode from the wide-angle camera to the telephoto camera, the shooting picture is easy to jump, and the shooting picture is not smooth enough.
In order to solve the technical problem, in the embodiment provided by the application, after the cameras are started, the cameras are started simultaneously, so that the cameras are all in an open state, and in the process of switching the cameras, a preview image acquired by a certain camera in a shooting interface can be directly switched to a preview image acquired by a target camera without waiting for the target camera to be started, so that the problems of jumping and unsmooth shooting pictures in the switching process of different cameras can be effectively solved.
For better understanding of the embodiments of the present application, an electronic device equipped with a three-camera system including a super wide-angle camera, a wide-angle camera, and a telephoto camera is described below as an example. In the double-shooting system and the shooting system composed of four or more cameras, the switching mode of the cameras is similar to that of the three-shooting system, and details are not repeated in the embodiment of the application.
Referring to fig. 1, fig. 1 is a schematic view of a shooting interface of an electronic device provided in an embodiment of the present application. In fig. 1, the camera of the electronic device is divided into three focal segments, namely [ k1-k2 ], [ k2-k3 ], and [ k3-k4], wherein the values of k1, k2, k3, and k4 increase in sequence. Illustratively, k1 is typically less than 1.0 times the focal length.
When the user adjusts the focal length of the camera to the focal length [ k1-k2), the camera performs photographing using the ultra wide angle camera, when the user adjusts the focal length of the camera to the focal length [ k2-k3), the camera performs photographing using the wide angle camera, and when the user adjusts the focal length of the camera to the focal length [ k3-k4), the camera performs photographing using the tele camera.
Referring to fig. 2, fig. 2 is a schematic flowchart of a camera switching method provided in an embodiment of the present application, and in a possible implementation manner of the present application, the method includes:
s201, responding to a camera starting instruction, starting at least two cameras simultaneously, and displaying preview images acquired by default cameras in the at least two cameras in a shooting interface.
In the embodiment of the application, when the electronic equipment receives a camera starting instruction triggered by a user, all configured cameras are started simultaneously. After each camera is started, sending a preview request to a default camera, acquiring a preview image acquired by the default camera, and displaying the preview image acquired by the default camera in a shooting interface.
In the process of displaying the preview image acquired by the default camera in the shooting interface, the image data acquired by other cameras except the default camera can be directly selected to be discarded without any processing.
After the camera is started, if the default focal length of the camera is located in a focal length [ k2-k3), a preview request is issued to the wide-angle camera, and the wide-angle camera transmits the acquired image data to a shooting interface for display.
S202, responding to the focal length adjusting instruction, and detecting whether the adjusted focal length meets the camera switching condition.
In the shooting process, a user can click or slide the focal length adjusting control to adjust the focal length of the camera on the shooting interface according to the actual framing requirement, or adjust the focal length of the camera through the zooming-in/zooming-out sliding operation of two fingers in the shooting interface, so that the camera is controlled to be switched among different cameras.
When the electronic equipment detects a focal length adjusting instruction triggered by a user, responding to the focal length adjusting instruction, and detecting whether the adjusted focal length meets a camera switching condition or not in real time. When detecting that the focal length of the camera is adjusted from one focal section to another focal section, determining that the adjusted focal length meets the camera switching condition
And S203, when the adjusted focal length meets the camera switching condition, acquiring a preview image acquired by the target camera corresponding to the adjusted focal length, and switching the preview image acquired by the first camera currently displayed in the shooting interface into the preview image acquired by the target camera.
In the embodiment of the application, if the focal length of the camera is adjusted from the focal length [ k2-k3 ] to [ k3-k4] by the user, a preview request is sent to the telephoto camera head, so that the telephoto camera transmits the acquired image data to the shooting interface for display, and meanwhile, the issuing of the preview request to the wide-angle camera is stopped.
And the first camera is a camera corresponding to the preview image displayed in the shooting interface before the camera is switched. For example, when the camera is switched from the wide-angle camera to the tele-camera, the first camera is the wide-angle camera; when the camera is switched to the wide-angle camera from the long-focus camera, the first camera is the long-focus camera.
According to the camera switching method provided by the embodiment of the application, after the camera is started, each camera on the electronic equipment is in the open state, so that in the process of switching the cameras, the preview image currently displayed in the shooting interface can be directly switched into the preview image collected by the target camera without waiting for the target camera to be started, and the problem that the shooting pictures are not smooth in the switching process of different cameras can be effectively solved.
Based on the content described in the foregoing embodiment, in a feasible implementation manner of the present application, when the electronic device receives a camera start instruction, the electronic device simultaneously starts an image sensor (sensor) corresponding to each camera, that is, the image sensor corresponding to each camera is powered on, so that the image sensor corresponding to each camera can acquire a preview image.
After image sensors corresponding to all the cameras are started, sending a preview request to an image sensor corresponding to a default camera, wherein the preview request is used for requesting that a preview image acquired by the image sensor corresponding to the default camera is sent to a shooting interface for displaying; when a preview image sent by an image sensor corresponding to the default camera is received, the received preview image can be output to a shooting interface for display.
The image sensor corresponding to the default camera can directly discard the image data acquired by the image sensor.
It can be understood that, when receiving a camera start instruction, the electronic device in the present application only starts the image sensors of the cameras at the same time, and then issues a preview request to only one of the cameras, so that some data processing related to image preview and the load of the CPU are only for one of the cameras, and thus the power consumption of the whole shooting system can still be close to the power consumption when only one camera is started.
In the camera switching method provided by the embodiment of the application, after the camera is started, the image sensors corresponding to the cameras on the electronic device are started at the same time, but only the preview request is sent to the image sensor corresponding to the default camera, and the preview request does not need to be issued to the image sensors corresponding to the cameras at the same time, so that the power consumption of a CPU and a memory can be effectively reduced.
Based on the description in the foregoing embodiments, in a possible implementation manner, after displaying the preview image captured by the default camera in the shooting interface, the electronic device responds to a focus sliding adjustment operation, and when the focus sliding adjustment operation adjusts the focus of the camera from one focus segment to another adjacent focus segment, determines that the adjusted focus satisfies the camera switching condition.
For better understanding of the embodiment of the present application, referring to fig. 3, fig. 3 is a schematic view of a scene of adjusting the focal length by sliding in the embodiment of the present application. In FIG. 3, the user may slide the focus control 30 from the focal segment [ k2-k3) to the focal segment [ k3-k4] by finger sliding.
When the user slides and adjusts the focal length of the camera from the focal section [ k2-k3 ] to the focal section [ k3-k4], the adjusted focal length can be determined to meet the camera switching condition at the moment when the focal length is changed from being less than k3 to being more than or equal to k 3.
It can be understood that, during the sliding adjustment of the focal length of the camera from the focal length [ k2-k3 ] to the focal length [ k3-k4], if the sliding speed is fast and the difference between the preview images before and after switching is large, the transition of the preview image displayed in the shooting interface during switching is inevitably caused. In order to solve the problem, in the embodiment of the application, when the adjusted focal length meets the camera switching condition, a preview request is sent to a target camera corresponding to the adjusted focal length, and the preview request is used for requesting to send a preview image acquired by the target camera to a shooting interface for displaying; and when the preview image sent by the target camera is received, matching the preview image currently displayed in the shooting interface with the preview image sent by the target camera, and if the matching is successful, switching the preview image currently displayed in the shooting interface into the preview image acquired by the target camera.
Illustratively, when a user slidingly adjusts the focal length of the camera from a focal length [ k2-k3 ] to a focal length [ k3-k4], a preview request is sent to the tele camera, when a preview image sent by the tele camera is received, a first time stamp of a last acquired preview image of the wide camera currently displayed in a shooting interface and a second time stamp of the last acquired preview image of the tele camera are acquired, and then whether the difference value between the first time stamp and the second time stamp is smaller than a preset threshold value is judged; and when the difference value between the first time stamp and the second time stamp is smaller than the preset threshold value, switching the preview image acquired by the first camera currently displayed in the shooting interface into the preview image acquired by the tele-camera, and stopping sending the preview request to the wide-angle camera.
Optionally, when the difference between the first timestamp and the second timestamp is equal to or greater than the preset threshold, a preview image with the smallest difference between a frame of timestamp and the first timestamp may be determined in a plurality of frames of preview images recently acquired by the telephoto camera, and then the preview image acquired by the first camera currently displayed in the shooting interface is switched to the preview image.
According to the camera switching method provided by the embodiment of the application, in the camera switching process, through matching the preview images acquired by the two cameras, the smoothness of a shooting interface in the camera switching process can be further ensured.
Based on the content described in the foregoing embodiments, in another possible implementation manner of the present application, after the preview image captured by the default camera is displayed in the shooting interface, the electronic device responds to a focus click adjustment operation, and when the focus click adjustment operation adjusts the focus of the camera from one focal segment to another focal segment, it is determined that the adjusted focus satisfies the camera switching condition.
That is, in the embodiment of the present application, the user may adjust the focal length of the camera by clicking the shooting interface. For example, when the user needs to adjust the focal length of the camera from focal segment [ k1-k2) directly to focal segment [ k3-k4], a location in focal segment [ k3-k4] can be clicked directly to adjust the focal length of the camera to focal segment [ k3-k4 ].
For better understanding of the embodiment of the present application, referring to fig. 4, fig. 4 is a schematic view of a scene in which a focal length is adjusted by clicking in the embodiment of the present application. In FIG. 4, the user can adjust the focal length of the camera to the focal segment [ k3-k4] by clicking any position in the focal segment [ k3-k4] with a finger.
When the electronic equipment detects that the focal length of the camera is adjusted from a focal length [ k1-k2 ] to a focal length [ k3-k4] through click operation by a user, a preview request is sent to the tele camera, and the preview request is used for requesting to send a preview image acquired by the tele camera to a shooting interface for displaying; and when a preview image sent by the tele camera is received, outputting the received preview image to a shooting interface for displaying, and stopping issuing a preview request to the ultra-wide camera. Therefore, the preview image acquired by the ultra-wide-angle camera currently displayed in the shooting interface can be switched to the preview image acquired by the tele-camera.
It can be understood that, in the camera switching method provided in the embodiment of the present application, only the preview image data collected by one camera is transmitted without switching the cameras, so that power consumption of the camera can be effectively reduced, and meanwhile, in the process of needing to switch the cameras, the preview image currently displayed in the shooting interface can be directly switched to the preview image collected by the target camera without waiting for the target camera to start, so that the problem that the shooting picture is not smooth in the switching process of different cameras can be effectively avoided.
Based on the content described in the foregoing embodiment, an embodiment of the present application further provides a camera switching device, which is applied to the electronic device described in the foregoing embodiment, and referring to fig. 5, fig. 5 is a schematic diagram of program modules of the camera switching device provided in the embodiment of the present application. In the embodiment of the present application, the camera switching device 50 includes a starting module 501, a detecting module 502, and a switching module 503, where:
the starting module 501 is configured to respond to a camera starting instruction, start the at least two cameras simultaneously, and display a preview image acquired by a default camera of the at least two cameras in the shooting interface.
The detecting module 502 is configured to respond to the focal length adjusting instruction and detect whether the adjusted focal length meets a camera switching condition.
The switching module 503 is configured to, when the adjusted focal length meets the camera switching condition, obtain a preview image acquired by the target camera corresponding to the adjusted focal length, and switch the preview image acquired by the first camera currently displayed in the shooting interface to the preview image acquired by the target camera.
According to the camera switching device 50 provided by the embodiment of the application, since each camera on the electronic device is in the open state after the camera is started, in the process of switching the cameras, the preview image currently displayed in the shooting interface can be directly switched to the preview image collected by the target camera without waiting for the target camera to be started, so that the problem that the shooting pictures are not smooth in the switching process of different cameras can be effectively avoided.
In a possible implementation, the starting module 501 is specifically configured to:
responding to a camera starting instruction, and simultaneously starting the image sensors corresponding to the cameras;
sending a preview request to an image sensor corresponding to the default camera, wherein the preview request is used for requesting that a preview image acquired by the image sensor corresponding to the default camera is sent to a shooting interface for displaying;
and receiving a preview image sent by an image sensor corresponding to the default camera, and outputting the received preview image to a shooting interface for display.
In a possible implementation, the camera of the electronic device is divided into at least two focal segments, and each focal segment corresponds to a different camera, and the detection module 502 is specifically configured to:
and in response to the focal length sliding adjustment operation, when the focal length sliding adjustment operation adjusts the focal length of the camera from one focal length to another adjacent focal length in the at least two focal lengths, determining that the adjusted focal length meets the camera switching condition.
In a possible implementation, the switching module 503 is specifically configured to:
when the adjusted focal length meets the camera switching condition, sending a preview request to a target camera, wherein the preview request is used for requesting to send a preview image acquired by the target camera to a shooting interface for displaying;
receiving a preview image sent by a target camera;
acquiring a first time stamp of a preview image acquired by a first camera last time and a second time stamp of the preview image acquired by a target camera last time;
judging whether the difference value of the first time stamp and the second time stamp is smaller than a preset threshold value or not;
and when the difference value between the first time stamp and the second time stamp is smaller than a preset threshold value, switching the preview image acquired by the first camera currently displayed in the shooting interface into the preview image acquired by the target camera, and stopping sending the preview request to the first camera.
In a possible implementation, the camera of the electronic device is divided into at least two focal segments, and each focal segment corresponds to a different camera, and the detection module 502 is specifically configured to:
and responding to the focal length click adjustment operation, and when the focal length click adjustment operation adjusts the focal length of the camera from one focal length to the other focal length of the at least two focal lengths, determining that the adjusted focal length meets the camera switching condition.
In a possible implementation, the switching module 503 is specifically configured to:
sending a preview request to a target camera, wherein the preview request is used for requesting to send a preview image acquired by the target camera to a shooting interface for displaying;
and receiving a preview image sent by the target camera, outputting the received preview image to a shooting interface for displaying, and stopping issuing a preview request to the first camera.
It should be noted that, the content specifically executed by the starting module 501, the detecting module 502, and the switching module 503 may refer to the relevant content in the embodiments shown in fig. 1 to fig. 4, which is not described herein again.
Further, based on the content described in the foregoing embodiments, an electronic device is also provided in the embodiments of the present application, where the electronic device includes at least one processor and a memory; wherein the memory stores computer execution instructions; the at least one processor executes computer-executable instructions stored in the memory to implement the steps performed by the electronic device in the above embodiments, which are not described herein again.
For better understanding of the embodiment of the present application, referring to fig. 6, fig. 6 is a schematic diagram of a hardware structure of an electronic device provided in the embodiment of the present application.
As shown in fig. 6, the electronic device 60 of the present embodiment includes: a processor 601 and a memory 602; wherein:
a memory 602 for storing computer-executable instructions;
the processor 601 is configured to execute the computer-executable instructions stored in the memory to implement the steps performed by the electronic device in the above embodiments. Reference may be made in particular to the description relating to the method embodiments described above.
Alternatively, the memory 602 may be separate or integrated with the processor 601.
When the memory 602 is provided separately, the device further comprises a bus 603 for connecting said memory 602 and the processor 601.
Further, based on the content described in the foregoing embodiments, an embodiment of the present application also provides a computer-readable storage medium, where computer-executable instructions are stored in the computer-readable storage medium, and when a processor executes the computer-executable instructions, the steps performed by the electronic device in the foregoing embodiments are implemented.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described device embodiments are merely illustrative, and for example, the division of the modules is only one logical division, and other divisions may be realized in practice, for example, a plurality of modules may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or modules, and may be in an electrical, mechanical or other form.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present application may be integrated into one processing unit, or each module may exist alone physically, or two or more modules are integrated into one unit. The unit formed by the modules can be realized in a hardware form, and can also be realized in a form of hardware and a software functional unit.
The integrated module implemented in the form of a software functional module may be stored in a computer-readable storage medium. The software functional module is stored in a storage medium and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute some steps of the methods according to the embodiments of the present application.
It should be understood that the Processor may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in the incorporated application may be directly implemented by a hardware processor, or may be implemented by a combination of hardware and software modules in the processor.
The memory may comprise a high-speed RAM memory, and may further comprise a non-volatile storage NVM, such as at least one disk memory, and may also be a usb disk, a removable hard disk, a read-only memory, a magnetic or optical disk, etc.
The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, the buses in the figures of the present application are not limited to only one bus or one type of bus.
The storage medium may be implemented by any type or combination of volatile and 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. A storage media may be any available media that can be accessed by a general purpose or special purpose computer.
An exemplary storage medium is coupled to the processor such the processor can read information from, and write information to, the storage medium. Of course, the storage medium may also be integral to the processor. The processor and the storage medium may reside in an Application Specific Integrated Circuits (ASIC). Of course, the processor and the storage medium may reside as discrete components in an electronic device or host device.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.

Claims (8)

1. A camera switching method is applied to electronic equipment, wherein the electronic equipment is provided with at least two cameras, the focal lengths of the at least two cameras are different from each other, and the method comprises the following steps:
responding to a camera starting instruction, starting the at least two cameras at the same time, and displaying preview images acquired by default cameras in the at least two cameras in a shooting interface;
responding to a focal length adjusting instruction, and detecting whether the adjusted focal length meets a camera switching condition;
when the adjusted focal length meets the camera switching condition, acquiring a preview image acquired by a target camera corresponding to the adjusted focal length, and switching the preview image acquired by a first camera currently displayed in the shooting interface into the preview image acquired by the target camera;
the simultaneously activating the at least two cameras in response to the camera activation instruction includes:
responding to a camera starting instruction, and simultaneously starting the image sensors corresponding to the cameras;
the displaying the preview image collected by a default camera of the at least two cameras in the shooting interface includes:
sending a preview request to an image sensor corresponding to the default camera, wherein the preview request is used for requesting to send a preview image acquired by the image sensor corresponding to the default camera to the shooting interface for displaying;
receiving a preview image sent by an image sensor corresponding to the default camera, and outputting the received preview image to the shooting interface for display;
the camera of the electronic equipment is divided into at least two focal sections, and each focal section corresponds to a different camera;
when the focus adjustment instruction is a focus slide adjustment operation, responding to the focus adjustment instruction, detecting whether the adjusted focus meets a camera switching condition, including:
in response to a focus slide adjustment operation, when the focus slide adjustment operation adjusts the focus of the camera from one of the at least two focus segments to another adjacent focus segment, determining that the adjusted focus satisfies the camera switching condition;
the acquiring of the preview image acquired by the target camera corresponding to the adjusted focal length and the switching of the preview image acquired by the first camera currently displayed in the shooting interface to the preview image acquired by the target camera include:
sending a preview request to the target camera, wherein the preview request is used for requesting to send a preview image acquired by the target camera to the shooting interface for displaying;
receiving a preview image sent by the target camera;
acquiring a first time stamp of a preview image acquired by the first camera last time and a second time stamp of the preview image acquired by the target camera last time;
judging whether the difference value of the first timestamp and the second timestamp is smaller than a preset threshold value or not;
and when the difference value between the first timestamp and the second timestamp is smaller than the preset threshold value, switching the preview image acquired by the first camera currently displayed in the shooting interface into the preview image acquired by the target camera, and stopping sending a preview request to the first camera.
2. The method of claim 1,
when the focus adjustment instruction is a focus click adjustment operation, responding to the focus adjustment instruction, detecting whether the adjusted focus meets a camera switching condition, including:
responding to a focal length click adjustment operation, and when the focal length click adjustment operation adjusts the focal length of the camera from one focal length to the other focal length of the at least two focal lengths, determining that the adjusted focal length meets the camera switching condition.
3. The method according to claim 2, wherein the obtaining of the preview image acquired by the target camera corresponding to the adjusted focal length and switching the preview image acquired by the first camera currently displayed in the shooting interface to the preview image acquired by the target camera comprises:
sending a preview request to the target camera, wherein the preview request is used for requesting to send a preview image acquired by the target camera to the shooting interface for displaying;
and receiving a preview image sent by the target camera, outputting the received preview image to the shooting interface for display, and stopping issuing a preview request to the first camera.
4. The utility model provides a camera auto-change over device which characterized in that is applied to electronic equipment, electronic equipment is provided with two at least cameras, the focus of two at least cameras is mutually different, the device includes:
the starting module is used for responding to a camera starting instruction, starting the at least two cameras simultaneously, and displaying preview images acquired by default cameras in the at least two cameras in a shooting interface;
the detection module is used for responding to the focal length adjusting instruction and detecting whether the adjusted focal length meets the camera switching condition;
the switching module is used for acquiring a preview image acquired by a target camera corresponding to the adjusted focal length when the adjusted focal length meets the camera switching condition, and switching the preview image acquired by a first camera currently displayed in the shooting interface into the preview image acquired by the target camera;
the starting module is specifically configured to:
responding to a camera starting instruction, and simultaneously starting the image sensors corresponding to the cameras;
sending a preview request to an image sensor corresponding to the default camera, wherein the preview request is used for requesting to send a preview image acquired by the image sensor corresponding to the default camera to the shooting interface for displaying;
receiving a preview image sent by an image sensor corresponding to the default camera, and outputting the received preview image to the shooting interface for display;
the camera of the electronic equipment is divided into at least two focal sections, and each focal section corresponds to a different camera;
when the focal length adjustment instruction is a focal length sliding adjustment operation, the detection module is specifically configured to:
in response to a focus slide adjustment operation, when the focus slide adjustment operation adjusts the focus of the camera from one of the at least two focus segments to another adjacent focus segment, determining that the adjusted focus satisfies the camera switching condition;
the switching module is specifically configured to:
when the adjusted focal length meets the camera switching condition, sending a preview request to the target camera, wherein the preview request is used for requesting to send a preview image acquired by the target camera to the shooting interface for displaying;
receiving a preview image sent by the target camera;
acquiring a first time stamp of a preview image acquired by the first camera last time and a second time stamp of the preview image acquired by the target camera last time;
judging whether the difference value of the first timestamp and the second timestamp is smaller than a preset threshold value or not;
and when the difference value between the first timestamp and the second timestamp is smaller than the preset threshold value, switching the preview image acquired by the first camera currently displayed in the shooting interface into the preview image acquired by the target camera, and stopping sending a preview request to the first camera.
5. The apparatus of claim 4,
when the focal length adjusting instruction is a focal length click adjusting operation, the detection module is specifically configured to:
responding to a focal length click adjustment operation, and when the focal length click adjustment operation adjusts the focal length of the camera from one focal length to the other focal length of the at least two focal lengths, determining that the adjusted focal length meets the camera switching condition.
6. The apparatus of claim 5, wherein the switching module is specifically configured to:
sending a preview request to the target camera, wherein the preview request is used for requesting to send a preview image acquired by the target camera to the shooting interface for displaying;
and receiving a preview image sent by the target camera, outputting the received preview image to the shooting interface for display, and stopping issuing a preview request to the first camera.
7. An electronic device, comprising: at least one processor and a memory;
the memory stores computer-executable instructions;
the at least one processor executing the computer-executable instructions stored by the memory causes the at least one processor to perform the camera switching method of any of claims 1 to 3.
8. A computer-readable storage medium having computer-executable instructions stored therein, which when executed by a processor, implement the camera switching method according to any one of claims 1 to 3.
CN202010528274.3A 2020-06-11 2020-06-11 Camera switching method and device, electronic equipment and readable storage medium Active CN111654629B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010528274.3A CN111654629B (en) 2020-06-11 2020-06-11 Camera switching method and device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010528274.3A CN111654629B (en) 2020-06-11 2020-06-11 Camera switching method and device, electronic equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN111654629A CN111654629A (en) 2020-09-11
CN111654629B true CN111654629B (en) 2022-06-24

Family

ID=72350515

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010528274.3A Active CN111654629B (en) 2020-06-11 2020-06-11 Camera switching method and device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN111654629B (en)

Families Citing this family (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111787224B (en) * 2020-07-10 2022-07-12 深圳传音控股股份有限公司 Image acquisition method, terminal device and computer-readable storage medium
CN112073642B (en) * 2020-09-18 2021-09-14 展讯通信(上海)有限公司 Video recording method and device of multi-camera equipment, storage medium and terminal
CN114422687B (en) * 2020-10-28 2024-01-19 北京小米移动软件有限公司 Preview image switching method and device, electronic equipment and storage medium
CN117880634A (en) * 2020-11-30 2024-04-12 华为技术有限公司 Video shooting method and electronic equipment
CN112492212B (en) * 2020-12-02 2022-05-06 维沃移动通信有限公司 Photographing method and device, electronic equipment and storage medium
CN112804450B (en) * 2020-12-31 2022-05-27 Oppo广东移动通信有限公司 Camera starting method, electronic equipment and computer storage medium
CN113014813A (en) * 2021-03-02 2021-06-22 北京蜂巢世纪科技有限公司 Focal length adjusting method and device, electronic equipment and storage medium
CN113014820A (en) * 2021-03-15 2021-06-22 联想(北京)有限公司 Processing method and device and electronic equipment
CN113473002A (en) * 2021-05-21 2021-10-01 闻泰通讯股份有限公司 Display method and device of preview image, computer equipment and storage medium
CN113115031B (en) * 2021-05-27 2023-04-07 闪耀现实(无锡)科技有限公司 Method and system for detecting camera
CN113938587B (en) * 2021-09-14 2024-03-15 青岛海信移动通信技术有限公司 Double-camera-based shooting method and electronic equipment
CN113840092B (en) * 2021-11-25 2022-04-15 荣耀终端有限公司 Camera switching method and electronic equipment
CN116939357A (en) * 2022-04-02 2023-10-24 华为技术有限公司 Macro shooting method, electronic equipment and computer readable storage medium
CN115379118B (en) * 2022-08-26 2024-04-05 维沃移动通信有限公司 Camera switching method and device, electronic equipment and readable storage medium
CN115514871A (en) * 2022-09-30 2022-12-23 读书郎教育科技有限公司 Overturning camera preview optimization system and method based on intelligent terminal
CN115988317A (en) * 2022-12-12 2023-04-18 Oppo广东移动通信有限公司 Image processing method, image processing device, image processing chip, communication device, and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2009073950A1 (en) * 2007-12-13 2009-06-18 Keigo Izuka Camera system and method for amalgamating images to create an omni-focused image
CN109495760A (en) * 2018-12-25 2019-03-19 虎扑(上海)文化传播股份有限公司 A kind of method of multiple groups camera live broadcasting
CN110505389A (en) * 2019-09-03 2019-11-26 RealMe重庆移动通信有限公司 Camera control method, device, storage medium and electronic equipment
CN110809101A (en) * 2019-11-04 2020-02-18 RealMe重庆移动通信有限公司 Image zooming processing method and device, electronic equipment and storage medium
CN111131662A (en) * 2018-10-31 2020-05-08 杭州海康威视数字技术股份有限公司 Image output method, image output apparatus, camera, and storage medium
CN111183632A (en) * 2018-10-12 2020-05-19 华为技术有限公司 Image capturing method and electronic device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2009073950A1 (en) * 2007-12-13 2009-06-18 Keigo Izuka Camera system and method for amalgamating images to create an omni-focused image
CN111183632A (en) * 2018-10-12 2020-05-19 华为技术有限公司 Image capturing method and electronic device
CN111131662A (en) * 2018-10-31 2020-05-08 杭州海康威视数字技术股份有限公司 Image output method, image output apparatus, camera, and storage medium
CN109495760A (en) * 2018-12-25 2019-03-19 虎扑(上海)文化传播股份有限公司 A kind of method of multiple groups camera live broadcasting
CN110505389A (en) * 2019-09-03 2019-11-26 RealMe重庆移动通信有限公司 Camera control method, device, storage medium and electronic equipment
CN110809101A (en) * 2019-11-04 2020-02-18 RealMe重庆移动通信有限公司 Image zooming processing method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN111654629A (en) 2020-09-11

Similar Documents

Publication Publication Date Title
CN111654629B (en) Camera switching method and device, electronic equipment and readable storage medium
US20220366219A1 (en) Systems and Methods for Providing Feedback for Artificial Intelligence-Based Image Capture Devices
WO2017032086A1 (en) Photograph capturing control method and terminal
US8553129B2 (en) Handheld electronic device with two lens modules, dual image capturing method applying for the handheld electronic device, and computer program product for load into the handheld electronic device
CN111491102B (en) Detection method and system for photographing scene, mobile terminal and storage medium
EP2981061A1 (en) Method and apparatus for displaying self-taken images
EP2523450A1 (en) Handheld electronic device with dual image capturing method and computer program product
CN112866576B (en) Image preview method, storage medium and display device
CN115866390B (en) Shooting method, electronic equipment and storage medium
CN112954210B (en) Photographing method and device, electronic equipment and medium
CN113840070B (en) Shooting method, shooting device, electronic equipment and medium
CN108513069B (en) Image processing method, image processing device, storage medium and electronic equipment
WO2022161340A1 (en) Image display method and apparatus, and electronic device
CN107395957B (en) Photographing method and device, storage medium and electronic equipment
CN113347334A (en) Nondestructive photographing method and device for mobile terminal, terminal equipment and storage medium
EP4231625A1 (en) Photographing method and apparatus, and electronic device
CN112188097B (en) Photographing method, photographing apparatus, terminal device, and computer-readable storage medium
JP2023551037A (en) Image capture methods, devices, electronic equipment and readable storage media
CN113840076A (en) Shooting zooming method, electronic equipment and storage medium
WO2022237286A1 (en) Image fusion method and electronic device
US20190356854A1 (en) Portable electronic device and image capturing method thereof
CN108259767B (en) Image processing method, image processing device, storage medium and electronic equipment
WO2024061134A1 (en) Photographing method and apparatus, electronic device, and medium
CN111586305B (en) Anti-shake method, anti-shake device and electronic equipment
CN112136309A (en) System and method for performing rewind operations with a mobile image capture device

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