WO2022161058A1 - 一种全景图像的拍摄方法及电子设备 - Google Patents

一种全景图像的拍摄方法及电子设备 Download PDF

Info

Publication number
WO2022161058A1
WO2022161058A1 PCT/CN2021/141343 CN2021141343W WO2022161058A1 WO 2022161058 A1 WO2022161058 A1 WO 2022161058A1 CN 2021141343 W CN2021141343 W CN 2021141343W WO 2022161058 A1 WO2022161058 A1 WO 2022161058A1
Authority
WO
WIPO (PCT)
Prior art keywords
electronic device
image
images
preview
camera
Prior art date
Application number
PCT/CN2021/141343
Other languages
English (en)
French (fr)
Inventor
黄聪
冯可荣
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2022161058A1 publication Critical patent/WO2022161058A1/zh

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/698Control of cameras or camera modules for achieving an enlarged field of view, e.g. panoramic image capture
    • 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
    • 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/66Remote control of cameras or camera parts, e.g. by remote control devices
    • H04N23/661Transmitting camera control signals through networks, e.g. control via the Internet

Definitions

  • the present application relates to the field of terminal technologies, and in particular, to a method and electronic device for shooting panoramic images.
  • the image capturing function is one of the functions frequently used by users.
  • the panoramic image can express the surrounding environment as much as possible by means of wide-angle expression, for example, the panoramic image can be browsed freely at a fixed observation point from 90 degrees to 360 degrees in the horizontal direction and 180 degrees in the vertical direction. Therefore, more and more users have a demand for shooting panoramic images.
  • the purpose of the embodiments of the present application is to provide a method and an electronic device for shooting a panoramic image, so that the first electronic device controls at least one second electronic device to shoot, so that multiple electronic devices can shoot at the same time, thus being suitable for shooting Panoramic images of stills or non-stills.
  • an embodiment of the present application provides a method for capturing a panoramic image, and the method can be applied to a first electronic device.
  • the first electronic device detects a first operation for capturing a panoramic image, and responds to the The first operation is to acquire m first images, and send at least one shooting command to the second electronic device, so that the second electronic device acquires m second images according to the at least one shooting command;
  • the m second images of the The first target image, the m second images include the second target image, the target panoramic image is obtained by splicing the first target image and the second target image, and m is an integer not greater than 1.
  • the first electronic device since the first electronic device can send a shooting command to the second electronic device, the first electronic device can control the second electronic device to shoot, so that the first electronic device and the second electronic device can perform distributed shooting at the same time , so that it can be applied to shooting panoramic images of still pictures and panoramic images of non-still pictures.
  • the feature matching value of the first target image and the second target image is greater than or equal to the first threshold.
  • the first electronic device can send at least one shooting command to the second electronic device
  • m panoramic images can be obtained by splicing subsequently, and the one with better stitching effect can be selected from the m panoramic images according to the feature matching value.
  • Target panoramic images to improve user experience.
  • the method further includes: displaying the target panoramic image in the first window.
  • the method further includes: displaying the first target image in the second window, and displaying the second target image in the third window; wherein the first window, the second window and the third window are located in the same UI.
  • the target panoramic image, the first target image and the second target image can be displayed on the same display interface, thereby facilitating simultaneous viewing by the user and improving user experience.
  • sending at least one shooting command to the second electronic device includes: sending at least one shooting command to the second electronic device through the connection between the first electronic device and the second electronic device;
  • the cloud server sends at least one shooting command to the second electronic device.
  • the method before splicing m panoramic images according to m first images and m second images, the method further includes: performing frame synchronization on m first images and m second images ; wherein, the first target image and the second target image are two frame-synchronized images.
  • the method before detecting the first operation for capturing a panoramic image, the method further includes: entering a panoramic mode; acquiring a first preview image, and sending a preview command to the second electronic device, so that the first The second electronic device obtains the second preview image according to the preview command; receives the second preview image from the second electronic device; splices the preview panoramic image according to the first preview image and the second preview image; displays the preview panoramic image in the first window .
  • the first electronic device can send a preview command to the second electronic device, so that the preview image data streams can be obtained through multiple electronic devices respectively, and the preview panoramic image can be displayed on the viewfinder interface of the first electronic device, so that the user can Determine the right time to shoot by viewing the preview panorama image.
  • the method further includes: displaying the first preview image in the second window, and displaying the second preview image in the third window; wherein the first window, the second window and the third window are located in the same UI.
  • the method further includes: acquiring the feature matching value of the first preview image and the second preview image; if the feature matching value is less than the second threshold, displaying prompt information, where the prompt information is used to prompt the user to adjust The shooting angle and/or position of the first electronic device and/or the second electronic device.
  • entering the panorama mode includes: detecting a second operation for entering the panorama mode, and entering the panorama mode in response to the second operation; or detecting a camera for starting the first electronic device In the third operation of the application, if it is determined that a connection with the second electronic device is established, the panorama mode is entered.
  • an embodiment of the present application provides a method for shooting a panoramic image (or may also be referred to as a panoramic video recording method), and the method can be applied to a first electronic device.
  • the first operation of panoramic video recording in response to the first operation, obtaining the first video recording data stream, and sending a video recording command to the second electronic device, so that the second electronic device obtains the second video recording data stream according to the video recording command;
  • the method further includes: playing in the first window according to the panoramic video data stream.
  • the method further includes: playing in the second window according to the first video recording data stream; and playing in the third window according to the second video recording data stream;
  • the second window and the third window are located on the same display interface.
  • sending a video recording command to the second electronic device includes: sending a video recording command to the second electronic device through a connection between the first electronic device and the second electronic device.
  • the method before the first operation for panoramic video recording is detected, the method further includes: entering a panoramic mode; acquiring a first preview image, and sending a preview command to the second electronic device, so that the second The electronic device obtains the second preview image according to the preview command; receives the second preview image from the second electronic device; stitches the first preview image and the second preview image to obtain the preview panorama image; and displays the preview panorama image in the first window.
  • the method further includes: displaying the first preview image in the second window, and displaying the second preview image in the third window; wherein the first window, the second window and the third window are located in the same UI.
  • the method further includes: acquiring the feature matching value of the first preview image and the second preview image; if the feature matching value is less than the second threshold, displaying prompt information, where the prompt information is used to prompt the user to adjust The shooting angle and/or position of the first electronic device and/or the second electronic device.
  • entering the panorama mode includes: detecting a second operation for entering the panorama mode, and entering the panorama mode in response to the second operation; or detecting a camera for starting the first electronic device In the third operation of the application, if it is determined that a connection with the second electronic device is established, the panorama mode is entered.
  • the panoramic video recording method provided by the second aspect and the panoramic image shooting method provided by the first aspect are based on the same inventive idea, and the difference between the two is that in the first aspect, the first electronic device At least one shooting command may be sent to the second electronic device, and the second electronic device may perform a shooting operation according to the at least one shooting command; in addition, the first electronic device obtains a target panoramic image; and in the second aspect, the first electronic device The device can send a video recording command to the second electronic device, and the second electronic device can perform a video recording operation according to the video recording command; in addition, the first electronic device obtains a panoramic image data stream (which can be understood as a panoramic video). Therefore, for the beneficial effects of the related technical features of the second aspect, reference may be made to the first aspect, and details are not repeated here.
  • an embodiment of the present application provides a method for capturing a panoramic image, and the method can be applied to a first electronic device.
  • the first electronic device detects a first operation for capturing a panoramic image;
  • m first images are acquired, and m first images are sent to the cloud server; and at least one shooting command is sent to the second electronic device, so that the second electronic device acquires m first images according to the at least one shooting command.
  • m first images include the first target image
  • m second images include the second target image
  • the target panoramic image is obtained by splicing the first target image and the second target image
  • m is not Integer less than 1.
  • the cloud server can obtain m panoramic images by splicing m first images and m second images, and select a target panoramic image to send to the first electronic device, without the need for the first electronic device to perform splicing and The operation of selecting the target panoramic image can effectively reduce the processing burden of the first electronic device.
  • the feature matching value of the first target image and the second target image is greater than or equal to the first threshold.
  • the method further includes: displaying the target panoramic image; or, saving the target panoramic image.
  • sending at least one shooting command to the second electronic device includes: sending at least one shooting command to the second electronic device through a cloud server.
  • the method before detecting the first operation for capturing a panoramic image, the method further includes: entering a panoramic mode; acquiring a first preview image, sending the first preview image to the cloud server, and sending the first preview image to the third
  • the second electronic device sends a preview command, so that the second electronic device obtains a second preview image according to the preview command and sends it to the cloud server; receives the preview panoramic image sent by the cloud server, and the preview panoramic image is based on the first preview image and the second preview image. obtained by splicing; and, displaying the preview panorama image.
  • the method further includes: receiving indication information sent by the cloud server, where the indication information is used to indicate that the feature matching value of the first preview image and the second preview image is less than a second threshold; according to the indication information, displaying Prompt information, where the prompt information is used to prompt the user to adjust the shooting angle and/or position of the first electronic device and/or the second electronic device.
  • entering the panorama mode includes: detecting a second operation for entering the panorama mode, and entering the panorama mode in response to the second operation.
  • an embodiment of the present application provides a method for capturing a panoramic image, and the method can be applied to a first electronic device.
  • the first electronic device detects a first operation for capturing a panoramic image;
  • m first images are acquired, and m first images are sent to the cloud server; and at least one shooting command is sent to the second electronic device, so that the second electronic device acquires m first images according to the at least one shooting command.
  • the cloud server receives m panoramic images sent by the cloud server, the m panoramic images are obtained by splicing m first images and m second images; select a target panoramic image from the m panoramic images image; wherein, the m first images include the first target image, the m second images include the second target image, the target panoramic image is obtained by splicing the first target image and the second target image, and m is not less than 1 Integer.
  • m panoramic images can be obtained by splicing m first images and m second images by the cloud server, and sent to the first electronic device without the need for the first electronic device to perform a splicing operation, thereby effectively reducing Processing burden of the first electronic device.
  • the feature matching value of the first target image and the second target image is greater than or equal to the first threshold.
  • the method further includes: displaying the target panoramic image; or, saving the target panoramic image.
  • sending at least one shooting command to the second electronic device includes: sending at least one shooting command to the second electronic device through a cloud server.
  • the method before detecting the first operation for capturing a panoramic image, the method further includes: entering a panoramic mode; acquiring a first preview image, sending the first preview image to the cloud server, and sending the first preview image to the third
  • the second electronic device sends a preview command, so that the second electronic device obtains a second preview image according to the preview command and sends it to the cloud server; receives the preview panoramic image sent by the cloud server, and the preview panoramic image is based on the first preview image and the second preview image. Stitched; displays the preview panorama image.
  • the method further includes: receiving indication information sent by the cloud server, where the indication information is used to indicate that the feature matching value of the first preview image and the second preview image is less than a second threshold; according to the indication information, displaying Prompt information, where the prompt information is used to prompt the user to adjust the shooting angle and/or position of the first electronic device and/or the second electronic device.
  • entering the panorama mode includes: detecting a second operation for entering the panorama mode, and entering the panorama mode in response to the second operation.
  • an embodiment of the present application provides a method for shooting a panoramic image, and the method can be applied to a second electronic device.
  • the second electronic device receives at least one shooting command from the first electronic device;
  • One shooting command acquires m second images, and the m second images are used for stitching to obtain m panoramic images.
  • receiving at least one shooting command from the first electronic device includes: receiving at least one shooting command from the first electronic device through a connection between the first electronic device and the second electronic device.
  • receiving at least one shooting command from the first electronic device includes: receiving at least one shooting command from the first electronic device sent by a cloud server.
  • the method further includes: sending m second images to the first electronic device.
  • the method further includes: sending m second images to the cloud server.
  • the method further includes: receiving a preview command from the first electronic device; acquiring a second preview image according to the preview command, and the second preview image is used for stitching to obtain a preview panoramic image.
  • the method further includes: sending the second preview image to the first electronic device.
  • the method further includes: sending the second preview image to the cloud server.
  • an embodiment of the present application provides a method for shooting a panoramic image, which can be applied to a cloud server.
  • the cloud server receives at least one shooting command sent by the first electronic device
  • the The device sends at least one shooting command, so that the second electronic device obtains m second images according to the at least one shooting command; receives m first images sent by the first electronic device, and receives m second images sent by the second electronic device image; according to m first images and m second images, splicing to obtain m panoramic images; sending m panoramic images to the first electronic device; or, selecting a target panoramic image from the m panoramic images, and sending the The first electronic device sends the target panoramic image.
  • the present application provides an electronic device (such as the above-mentioned first electronic device), comprising: a display screen, a communication module, one or more processors, one or more memories, one or more cameras, and one or more A computer program; wherein, the processor is coupled with the communication module, the display screen, the camera and the memory, the above-mentioned one or more computer programs are stored in the memory, and when the electronic device runs, the processor executes one or more stored in the memory.
  • a plurality of computer programs to cause the first electronic device to perform the method according to any one of the above-mentioned first to fourth aspects.
  • the present application provides an electronic device (such as the above-mentioned second electronic device), comprising: a communication module, one or more processors, one or more memories, one or more cameras, and one or more computer programs wherein, the processor is coupled with the communication module and the memory, and the above-mentioned one or more computer programs are stored in the memory, and when the electronic device runs, the processor executes the one or more computer programs stored in the memory to make the electronic The device performs the photographing method described in the fifth aspect.
  • the present application provides a cloud server, comprising a communication interface, one or more processors, one or more memories, and one or more computer programs; wherein, the processor is coupled to the communication interface and the memory, and one of the above One or more computer programs are stored in the memory, and when the cloud server runs, the processor executes the one or more computer programs stored in the memory, so that the cloud server executes the shooting method described in the sixth aspect.
  • the present application provides a photographing system
  • the photographing system may include the above-mentioned first electronic device and the second electronic device, and the first electronic device and the second electronic device can perform the above-mentioned method through interaction.
  • the photographing system may include the first electronic device, the second electronic device, and the cloud server, and the first electronic device, the second electronic device, and the cloud server can perform the above-described method through interaction.
  • the present application provides a computer-readable storage medium, comprising computer instructions, when the computer instructions are executed on the first electronic device (or the second electronic device or the cloud server), the first electronic device (or the second electronic device or the cloud server) is executed.
  • the second electronic device or cloud server executes the method described above.
  • the present application provides a computer program product that, when the computer program product runs on the first electronic device (or the second electronic device or the cloud server), enables the first electronic device (or the second electronic device or the cloud server) server) to perform the method described above.
  • FIG. 1 is a schematic diagram of a panoramic image captured by a single device according to an embodiment of the present application
  • FIG. 2 is a schematic diagram of a panoramic image captured by multiple devices according to an embodiment of the present application
  • FIG. 3 is a schematic diagram of a possible hardware structure of an electronic device provided by an embodiment of the present application.
  • FIG. 4 is a block diagram of a software structure of an electronic device provided by an embodiment of the present application.
  • 5A is a schematic diagram of an application scenario provided by an embodiment of the present application.
  • 5B is a block diagram of the software structure of the electronic device in the application scenario illustrated in FIG. 5A;
  • FIG. 6 is a schematic diagram of another application scenario provided by an embodiment of the present application.
  • FIG. 7 is a schematic flowchart corresponding to the method for capturing a panoramic image provided in Embodiment 1 of the present application.
  • FIG. 8 is an example diagram of an interface displayed by a first electronic device according to an embodiment of the present application.
  • FIG. 9 is a schematic diagram of transmission of a preview command and a preview image data stream provided by an embodiment of the present application.
  • FIG. 10 is a schematic diagram of a transmission of a shooting order and an image provided by an embodiment of the present application
  • FIG. 11 is a schematic flowchart corresponding to the method for capturing a panoramic image according to Embodiment 2 of the present application.
  • FIG. 12 is another schematic diagram of transmission of a preview command and a preview image data stream provided by an embodiment of the present application.
  • FIG. 13 is another schematic diagram of transmission of a shooting order and an image provided by an embodiment of the present application.
  • FIG. 14 is a schematic structural diagram of an electronic device provided by an embodiment of the application.
  • FIG. 15 is another schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • FIG. 16 is a schematic structural diagram of a cloud server provided by an embodiment of the present application.
  • Electronic device It may be a portable electronic device including at least one camera (or having a shooting function), such as a mobile phone, a tablet computer, a vehicle-mounted device, a wearable device, and the like.
  • the above-mentioned portable electronic devices may also be other portable electronic devices, such as digital cameras, laptops. It should also be understood that, in some other possible embodiments, the above-mentioned electronic device may not be a portable electronic device, but a desktop computer with a camera, etc.
  • the embodiment of the present application does not impose any limitation on the specific type of the electronic device.
  • electronic devices can support multiple applications. Such as one or more of the following applications: camera application, instant messaging application, etc. Among them, there can be various instant messaging applications, such as WeChat, Welink, and so on. Users can send text, voice, pictures, video files and various other files to other contacts through instant messaging applications; or users can implement voice and video calls with other contacts through instant messaging applications.
  • the application may be an application that comes with the electronic device when it leaves the factory, or an application that the electronic device downloads and installs from the network side, or an application that the electronic device receives from other electronic devices, which is not limited in this embodiment of the present application.
  • OS Operating system
  • Preview image refers to the image displayed in the viewfinder interface of the electronic device.
  • the mobile phone starts a camera application, turns on the camera, and displays a viewfinder interface, where a preview image is displayed.
  • the mobile phone activates the video call function, the camera is turned on, and a viewfinder interface is displayed, and a preview image is displayed in the viewfinder interface.
  • the preview image may be a panoramic image (in this case, the preview image may be referred to as a preview panoramic image), or the preview image includes a panoramic image.
  • the first way is to obtain a panoramic image by performing panoramic shooting with special equipment. This method is simple to operate, but requires special equipment, which leads to high cost.
  • the second way is: firstly shoot to obtain multiple images, and then stitch the multiple images to obtain a panoramic image; further, the second way can be subdivided into single-device shooting (or single-machine shooting) and multi-device shooting.
  • the single-device shooting refers to using the image shooting function of a single device to successively shoot multiple times to obtain multiple images, and then stitch the multiple images to obtain a panoramic image.
  • a complete panoramic shot may include multiple ordinary shots.
  • the image data will be algorithmically synthesized, the stitching will be completed, and finally a complete panoramic image will be synthesized.
  • FIG. 1 which is a schematic diagram of shooting a panoramic image for a single device, as shown in FIG. 1 , during the shooting process, the user needs to align and shoot according to the center horizontal line. In this way, the user is required to align the center horizontal line continuously.
  • the captured images will not be on the same horizontal line, thus causing the panoramic image to be faulty; It takes a long time and consumes a lot of resources; in addition, since multiple images are captured by a single device at different times, such as multiple images including image 1 to image 3, image 1 is captured at time t1, and image 2 is Image 3 is captured at time t2, and image 3 is captured at time t3. Therefore, this method is suitable for capturing images that are in a static state from time t1 to time t3. If the image changes from time t1 to time t3, it will be As a result, the synthesized panoramic image does not match the actual image, so this method cannot capture non-still images.
  • Multi-device shooting means that multiple images are shot independently by multiple devices, and then multiple images are collected and stitched together with a stitching algorithm to obtain a panoramic image.
  • the user obtains an image through device 1, which includes character 1 and character 2, and obtains an image through device 2, including character 3 and character 4, and then collects and copies it to device 3 (usually a desktop computer and other equipment), use a stitching algorithm or image processing software to process and stitch into a panoramic image, and the panoramic image includes person 1, person 2, person 3 and person 4.
  • device 3 usually a desktop computer and other equipment
  • the panoramic image includes person 1, person 2, person 3 and person 4.
  • post-processing is required after shooting, which results in a long time-consuming process; moreover, it is difficult to shoot non-still images, and it is necessary to strictly control two devices (such as device 1 and device 2) to shoot at the same time.
  • An embodiment of the present application provides a method for capturing a panoramic image.
  • a first electronic device detects a first operation for capturing a panoramic image, and in response to the first operation, m first images can be acquired, and The second electronic device sends at least one shooting command, so that the second electronic device can acquire m second images according to the at least one shooting command; and then receives the m second images from the second electronic device, according to the m second images
  • One image and m second images are stitched to obtain m panoramic images, and a target panoramic image is selected from the m panoramic images.
  • first electronic device may be referred to as a master electronic device (or master device), and the second electronic device may be referred to as a slave electronic device (or slave device); or, the first electronic device may be referred to as the local terminal
  • the electronic device and the second electronic device may be called a peer electronic device or a remote electronic device, which is not specifically limited.
  • the first electronic device and the second electronic device may be electronic devices of the same device type, for example, both the first electronic device and the second electronic device are mobile phones, or both are tablet computers.
  • the first electronic device and the second electronic device may also be electronic devices of different device types, for example, the first electronic device is a mobile phone, and the second electronic device is a tablet computer.
  • the plurality of second electronic devices may be electronic devices of the same type, such as a plurality of first electronic devices Both electronic devices are mobile phones, or both are tablet computers.
  • the plurality of second electronic devices may also be electronic devices of different device types, for example, the second electronic device 1 is a mobile phone, and the second electronic device 2 is a tablet computer.
  • FIG. 3 is a schematic diagram of a possible hardware structure of an electronic device provided by an embodiment of the present application.
  • the electronic device may be the first electronic device, or may also be the second electronic device.
  • the electronic device may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, Antenna 1, Antenna 2, Mobile Communication Module 150, Wireless Communication Module 160, Audio Module 170, Speaker 170A, Receiver 170B, Microphone 170C, Headphone Interface 170D, Sensor Module 180, Key 190, Motor 191, Indicator 192, Camera 193, Display screen 194, and subscriber identification module (subscriber identification module, SIM) card interface 195 and the like.
  • SIM subscriber identification module
  • Processor 110 may include one or more processing units.
  • the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video Codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (neural-network processing unit, NPU), etc.
  • AP application processor
  • GPU graphics processing unit
  • ISP image signal processor
  • controller a video Codec
  • digital signal processor digital signal processor
  • DSP digital signal processor
  • baseband processor baseband processor
  • neural-network processing unit neural-network processing unit
  • NPU neural-network processing unit
  • a controller can be the nerve center and command center of an electronic device. The controller can generate an operation control signal according to the instruction operation code and timing signal, and complete the control of fetching and executing instructions.
  • a memory may also be provided in the processor 110 for storing instructions and data.
  • the memory in processor 110 is cache memory. This memory may hold instructions or data that have just been used or recycled by the processor 110 . If the processor 110 needs to use the instruction or data again, it can be called directly from the memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby increasing the efficiency of the system.
  • the processor 110 may include one or more interfaces.
  • the interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous transceiver (universal asynchronous transmitter) receiver/transmitter, UART) interface, mobile industry processor interface (MIPI), general-purpose input/output (GPIO) interface, subscriber identity module (SIM) interface, and / or universal serial bus (universal serial bus, USB) interface, etc.
  • I2C integrated circuit
  • I2S integrated circuit built-in audio
  • PCM pulse code modulation
  • PCM pulse code modulation
  • UART universal asynchronous transceiver
  • MIPI mobile industry processor interface
  • GPIO general-purpose input/output
  • SIM subscriber identity module
  • USB universal serial bus
  • the USB interface 130 is an interface that conforms to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, and the like.
  • the USB interface 130 can be used to connect a charger to charge the electronic device, and can also be used to transmit data between the electronic device and peripheral devices.
  • the USB interface 130 can also be used to connect an earphone, and play audio through the earphone.
  • the interface can also be used to connect other electronic devices.
  • the charging management module 140 is used to receive charging input from the charger.
  • the charger may be a wireless charger or a wired charger.
  • the charging management module 140 may receive charging input from the wired charger through the USB interface 130 .
  • the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device. While the charging management module 140 charges the battery 142 , it can also supply power to the electronic device through the power management module 141 .
  • the power management module 141 is used for connecting the battery 142 , the charging management module 140 and the processor 110 .
  • the power management module 141 receives input from the battery 142 and/or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, the wireless communication module 160, and the like.
  • the power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle times, battery health status (leakage, impedance).
  • the power management module 141 may also be provided in the processor 110 .
  • the power management module 141 and the charging management module 140 may also be provided in the same device.
  • the wireless communication function of the electronic device may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modulation and demodulation processor, the baseband processor, and the like.
  • Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in an electronic device can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization.
  • the antenna 1 can be multiplexed as a diversity antenna of the wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
  • the mobile communication module 150 can provide a wireless communication solution including 2G/3G/4G/5G etc. applied on the electronic device.
  • the mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), and the like.
  • the mobile communication module 150 can receive electromagnetic waves from the antenna 1, filter and amplify the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation.
  • the mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and then turn it into an electromagnetic wave for radiation through the antenna 1 .
  • at least part of the functional modules of the mobile communication module 150 may be provided in the processor 110 .
  • at least part of the functional modules of the mobile communication module 150 may be provided in the same device as at least part of the modules of the processor 110 .
  • the modem processor may include a modulator and a demodulator.
  • the modulator is used to modulate the low frequency baseband signal to be sent into a medium and high frequency signal.
  • the demodulator is used to demodulate the received electromagnetic wave signal into a low frequency baseband signal. Then the demodulator transmits the demodulated low-frequency baseband signal to the baseband processor for processing.
  • the low frequency baseband signal is processed by the baseband processor and passed to the application processor.
  • the application processor outputs sound signals through audio devices (not limited to the speaker 170A, the receiver 170B, etc.), or displays images or videos through the display screen 194 .
  • the modem processor may be a stand-alone device.
  • the modem processor may be independent of the processor 110, and may be provided in the same device as the mobile communication module 150 or other functional modules.
  • the wireless communication module 160 can provide wireless local area networks (WLAN) (such as Wi-Fi networks), bluetooth (BT), and global navigation satellite systems (GNSS) for applications on electronic devices. , frequency modulation (frequency modulation, FM), near field communication technology (near field communication, NFC), infrared technology (infrared, IR) and other wireless communication solutions.
  • the wireless communication module 160 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 160 receives electromagnetic waves via the antenna 2 , frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110 .
  • the wireless communication module 160 can also receive the signal to be sent from the processor 110 , perform frequency modulation and amplification on the signal, and then convert it into electromagnetic waves for radiation through the antenna 2 .
  • the antenna 1 of the electronic device is coupled with the mobile communication module 150, and the antenna 2 is coupled with the wireless communication module 160, so that the electronic device can communicate with the network and other devices through wireless communication technology.
  • the wireless communication technologies may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), broadband Code Division Multiple Access (WCDMA), Time Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), 5G and subsequent standards, BT, GNSS, WLAN, NFC, FM and/or IR technologies, etc.
  • the GNSS may include a global positioning system (global positioning system, GPS), a global navigation satellite system (GLONASS), a Beidou satellite navigation system (beidou navigation satellite system, BDS), a quasi-zenith satellite system (quasi -zenith satellite system, QZSS) and/or satellite based augmentation systems (SBAS).
  • GPS global positioning system
  • GLONASS global navigation satellite system
  • BDS Beidou satellite navigation system
  • BDS Beidou navigation satellite system
  • QZSS quasi-zenith satellite system
  • SBAS satellite based augmentation systems
  • the electronic device implements a display function through a GPU, a display screen 194, an application processor, and the like.
  • the GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor.
  • the GPU is used to perform mathematical and geometric calculations for graphics rendering.
  • Processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
  • the display screen 194 is used to display images, videos, and the like.
  • the display screen 194 includes a display panel, and the display panel may adopt a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active matrix organic light emitting diode or an active matrix organic light emitting diode.
  • Body active-matrix organic light emitting diode, AMOLED
  • flexible light emitting diode flex light-emitting diode, FLED
  • Miniled MicroLed, Micro-oLed, quantum dot light emitting diode (quantum dot light emitting diodes, QLED), etc.
  • the electronic device may include 1 or N display screens 194 , where N is a positive integer greater than 1.
  • the electronic device can realize the shooting function through the ISP, the camera 193, the video codec, the GPU, the display screen 194, and the application processor, etc., such as shooting a panoramic image.
  • the ISP is used to process the data fed back by the camera 193 .
  • the shutter is opened, the light is transmitted to the camera photosensitive element through the lens, the light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing, and converts it into an image visible to the naked eye.
  • ISP can also perform algorithm optimization on image noise, brightness, and skin tone. ISP can also optimize parameters such as exposure and color temperature of the shooting scene.
  • the ISP may be provided in the camera 193 .
  • Camera 193 is used to capture still images or video.
  • the object is projected through the lens to generate an optical image onto the photosensitive element.
  • the photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor.
  • CMOS complementary metal-oxide-semiconductor
  • the photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal.
  • the ISP outputs the digital image signal to the DSP for processing.
  • DSP converts digital image signals into standard RGB, YUV and other formats of image signals.
  • the electronic device may include 1 or N cameras 193 , where N is a positive integer greater than 1.
  • Video codecs are used to compress or decompress digital video.
  • An electronic device may support one or more video codecs.
  • the electronic device can play or record videos of various encoding formats, such as: Moving Picture Experts Group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4, and so on.
  • MPEG Moving Picture Experts Group
  • the external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device.
  • the external memory card communicates with the processor 110 through the external memory interface 120 to realize the data storage function. For example, save files such as music, video, etc. in an external memory card.
  • the user can specify whether to store the image (such as a captured panoramic image) in the internal memory 121 or the external memory. For example, when the electronic device is currently connected to the external memory, if the electronic device captures a panoramic image, a prompt message may pop up to prompt the user to store the panoramic image in the external memory or the internal memory 121; of course, there are other specifying methods.
  • the embodiment of the present application is not limited; or, when the electronic device detects that the memory amount of the internal memory 121 is less than the preset amount, the panoramic image may be automatically stored in the external memory.
  • Internal memory 121 may be used to store computer executable program code, which includes instructions.
  • the processor 110 executes various functional applications and data processing of the electronic device by executing the instructions stored in the internal memory 121 .
  • the internal memory 121 may include a storage program area and a storage data area.
  • the storage program area can store an operating system, an application program required for at least one function (such as a sound playback function, an image playback function, etc.), and the like.
  • the storage data area can store data (such as audio data, phone book, etc.) created during the use of the electronic device.
  • the internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (UFS), and the like.
  • the sensor module 180 may include a pressure sensor 180A, a gyro sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, and an ambient light sensor 180L, bone conduction sensor 180M, etc.
  • the electronic device may implement audio functions, such as music playback, recording, etc., through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
  • the keys 190 include a power-on key, a volume key, and the like. Keys 190 may be mechanical keys. It can also be a touch key.
  • the electronic device may receive key input and generate key signal input related to user settings and function control of the electronic device.
  • the electronic device may receive key 190 inputs and generate key signal inputs related to user settings and function control of the electronic device.
  • the electronic device can use the motor 191 to generate vibration alerts (eg, vibration alerts for incoming calls).
  • the indicator 192 in the electronic device can be an indicator light, which can be used to indicate a charging state, a change in power, and can also be used to indicate a message, a missed call, a notification, and the like.
  • the SIM card interface 195 in the electronic device is used to connect the SIM card. The SIM card can be inserted into the SIM card interface 195 or pulled out from the SIM card interface 195 to achieve contact and separation with the electronic device.
  • the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the electronic device.
  • the electronic device may include more or less components than shown, or combine some components, or separate some components, or arrange different components.
  • the illustrated components may be implemented in hardware, software, or a combination of software and hardware.
  • the software system of the electronic device in the embodiment of the present application may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture.
  • the embodiments of the present application take an Android operating system with a layered architecture as an example to exemplarily describe the software structure of an electronic device.
  • Android operating system with a layered architecture as an example to exemplarily describe the software structure of an electronic device.
  • other operating systems eg, Hongmeng system, Linux system, etc.
  • the solution of the present application can also be implemented.
  • FIG. 4 shows a block diagram of a software structure of an electronic device according to an embodiment of the present application, and the electronic device may be a first electronic device or a second electronic device.
  • the layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Layers communicate with each other through software interfaces.
  • the Android system is divided into five layers, which are, from top to bottom, an application layer, an application framework (framework, FWK) layer, an Android runtime (android runtime), a system library, and a hardware abstraction layer (hardware). abstract layer, HAL) and the kernel layer.
  • Each layer is described in detail below.
  • the application layer can include a series of application packages. As shown in FIG. 4 , applications (application, APP) such as call, memo, browser, contact, gallery, calendar, map, Bluetooth, music, video, and short message can be installed in the application layer.
  • applications application, APP
  • an application with a shooting function such as a camera application
  • the camera application is at the top of the entire camera system framework, and bears the responsibility of directly interacting with the user, and undertakes a series of specific control instructions (or control commands) directly or indirectly from the user, such as preview/shoot/record.
  • UI user interface
  • the camera frame returns processing results, including image data, which the camera application can then feed back to the user in some way, such as displaying an image on the display.
  • the camera application can also be called to realize the shooting function.
  • the application framework layer provides an application programming interface (API) and a programming framework for the applications of the application layer.
  • the application framework layer can include some predefined functions.
  • the application framework layer may include a window manager, a content provider, a view system, a resource manager, a notification manager, and the like, which are not limited in this embodiment of the present application.
  • the above-mentioned window manager is used for managing window programs.
  • the window manager can get the size of the display screen, determine whether there is a status bar, lock the screen, take screenshots, etc.
  • the above content providers are used to store and retrieve data and make these data accessible to applications.
  • the data may include video, images, audio, calls made and received, browsing history and bookmarks, phone book, etc.
  • the view system described above can be used to build the display interface of an application.
  • Each display interface can consist of one or more controls.
  • controls may include interface elements such as icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, and widgets.
  • the above resource managers provide various resources for the application, such as localized strings, icons, pictures, layout files, video files, and so on.
  • the notification manager described above enables applications to display notification information in the status bar, which can be used to convey notification-type messages, and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc.
  • the notification manager can also display notifications in the status bar at the top of the system in the form of graphs or scroll bar text, such as notifications of applications running in the background, and notifications on the screen in the form of dialog windows. For example, prompt text information in the status bar, send out a sound, vibrate, and flash the indicator light, etc.
  • the application framework layer may include a camera framework.
  • the camera framework encapsulates the implementation details of the camera API v2, provides it to the camera application to call, and then receives the control command from the camera application, while maintaining the business logic of the internal flow of the control command, and finally through the calling interface (such as the camera Android interface definition
  • the language (Android interface definition language, AIDL) interface) sends the control command to the camera service (camera service) for processing, and waits for the return processing result of the camera service, and then sends the final result to the camera application.
  • Android runtime includes core library and virtual machine, and Android runtime is responsible for scheduling and management of Android system.
  • the core library consists of two parts: one part is the function functions that the java language needs to call, and the other part is the core library of Android.
  • the application layer and the application framework layer run in virtual machines.
  • the virtual machine executes the java files of the application layer and the application framework layer as binary files.
  • the virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, safety and exception management, and garbage collection.
  • the system library may include multiple functional modules, such as: surface manager (surface manager), 3D graphics processing library (eg: OpenGL ES), 2D graphics engine (eg: SGL) and so on.
  • the surface manager is used to manage the display subsystem and provides the fusion of 2D and 3D layers for multiple applications.
  • the 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
  • 2D graphics engine is a drawing engine for 2D drawing.
  • the system library may include a camera service.
  • the camera service encapsulates the implementation details of the camera AIDL interface, provides it to the camera framework for calling, and then receives control commands from the camera framework. Send the control command to the camera HAL, and wait for the result to be returned, and then upload the result to the camera frame.
  • the hardware abstraction layer is a transition layer between hardware and software. Its function is to adapt the changes brought by hardware changes in this transition layer, so that the upper-layer business software is unaware of hardware changes or only needs to It is intended to run on new hardware platforms with only minor changes.
  • the hardware abstraction layer may include a camera HAL
  • the camera HAL encapsulates the implementation details of the camera HAL3 interface, provides the camera service for invocation, and receives control instructions from the camera service. Further, after receiving the control command from the camera service, the camera HAL can send the control command to the camera driver, wait for the result of the camera driver to return, and then report it to the camera service.
  • the kernel layer contains at least display driver, audio driver, and sensor driver.
  • the kernel layer may include a camera driver.
  • the camera driver can drive hardware devices such as cameras to collect image data, and report the collected image data to the camera HAL.
  • the camera can transmit each frame of image data collected to the camera HAL through the camera driver according to a certain frame rate.
  • the transfer process of the above-described control instructions within the operating system can refer to the specific transfer process of the control flow in FIG. 4.
  • the specific delivery process of the data flow can refer to the specific transfer process of the control flow in FIG. 4.
  • FIG. 5A is a schematic diagram of a possible application scenario to which the embodiments of the present application are applicable.
  • the application scenario includes a first electronic device and at least one second electronic device (such as a second electronic device 1 and a second electronic device 2).
  • second electronic devices such as a second electronic device 1 and a second electronic device 2.
  • a device virtualization (device virtualization, DV) application for realizing a distributed shooting function may be pre-installed in the application layer of the first electronic device.
  • the DV application may run resident in the first electronic device as a system application, or, the functions implemented by the DV application may also run resident in the first electronic device in the form of a system service.
  • a proxy application for realizing the distributed shooting function may be pre-installed on the application layer of the second electronic device.
  • the DV application of the first electronic device can The second electronic device establishes a connection with the first electronic device as a slave device of the first electronic device. As shown in FIG. 5B , when the first electronic device establishes a connection with the second electronic device, the second electronic device may be triggered to start the proxy application. Further, the DV application of the first electronic device may acquire the shooting capability parameter of the second electronic device based on the connection, where the shooting capability parameter is used to indicate the shooting capability of the second electronic device.
  • the shooting capability parameter may include a specific image processing algorithm supported by the second electronic device, relevant hardware parameters of the camera in the second electronic device, and the like.
  • the DV application of the first electronic device can call the preset interface of the HAL, and input the acquired shooting capability parameters into the preset interface, thereby creating a HAL corresponding to the second electronic device in the HAL.
  • the HAL created by the DV application of the first electronic device according to the shooting capability parameters of the second electronic device may be referred to as DMSDP (distributed mobile sensing development platform) HAL, which may also be referred to as a DMSDP (distributed mobile sensing development platform) HAL.
  • Virtual camera HAL Different from the traditional camera HAL in the first electronic device, the virtual camera HAL does not correspond to the actual hardware device of the first electronic device, but corresponds to the second electronic device currently connected to the first electronic device.
  • the first electronic device can be used as the main device to transmit control instructions (or image data) through the virtual camera HAL and the proxy application of the second electronic device, so that the second electronic device is used as a virtual device of the first electronic device, and the second electronic device is used as a virtual device.
  • the electronic equipment cooperates to complete various services in the distributed shooting scene.
  • the DV application of the first electronic device can also send the shooting capability parameters of the second electronic device to the camera service of the first electronic device for saving, That is, the current shooting capability of the second electronic device is registered in the camera service.
  • the camera service can determine the shooting in the shooting process in real time according to the control instructions (such as preview/shooting/recording and other control instructions) issued by the camera application and in combination with the shooting capability of the second electronic device Strategy.
  • the camera service may send a control instruction corresponding to the shooting strategy to the second electronic device through the virtual camera HAL.
  • FIG. 6 is a schematic diagram of another possible application scenario to which the embodiments of the present application are applicable, and the application scenario includes a first electronic device, at least one second electronic device (such as a second electronic device 1, a second electronic device 2), and a Cloud Server.
  • the cloud server 200 may include one or more desktop computers, which is not specifically limited.
  • the first electronic device can communicate with the cloud server, and the second electronic device can also communicate with the cloud server.
  • the first electronic device (or the second electronic device) may communicate with the cloud server through a mobile communication network.
  • the mobile communication network may be a mobile communication network defined by 2G, 3G, 4G, 5G or subsequent standard protocols, which is not specifically limited.
  • the first electronic device can communicate with the second electronic device through the cloud server.
  • the first electronic device sends a control command (such as a preview command, a shooting command, etc.) to the second electronic device through the cloud server.
  • the electronic device sends the control command to the cloud server, and after receiving the control command, the cloud server can send the control command to the second electronic device.
  • multiple electronic devices can be registered with the cloud server, and the registration process of the second electronic device 1 is as follows
  • the second electronic device 1 may send the registration information of the second electronic device 1 to the cloud server, where the registration information includes the capability information of the second electronic device 1 (such as whether it has a shooting function), the identifier of the second electronic device 1, the second electronic device 1
  • the identifier of the electronic device 1 may be the device serial number of the second electronic device 1, which is not specifically limited.
  • the cloud server can store the registration information of the second electronic device 1 .
  • the first electronic device When the first electronic device needs to use the cameras of other electronic devices to realize the distributed shooting function (for example, the first electronic device enters the panoramic mode), the first electronic device can send a query request to the cloud server, and the query request is used to query the camera with the shooting function and the cloud server can feed back the identification of the electronic devices with the shooting function (these electronic devices can be understood as candidate electronic devices) to the first electronic device; further, the first electronic device can select at least one electronic device from the candidate electronic devices The second electronic device, or, the user may manually select at least one second electronic device from the candidate electronic devices, which is not specifically limited. In this case, the first electronic device sends a control command to the second electronic device through the cloud server.
  • the first electronic device sends the control command and the identifier of the second electronic device to the cloud server, and then the cloud server can send the control command to the cloud server according to the second electronic device.
  • the identification of the electronic device sends the control command to the second electronic device.
  • the cloud server may record the account logged in by the electronic device and whether the electronic device has a shooting function.
  • the first electronic device sends a control command to the second electronic device through the cloud server, which may specifically be: the first electronic device sends a control command to the cloud server, and after the cloud server receives the control command, it can query the first electronic device.
  • the device logs in to the second electronic device with the same account and has a shooting function, and then sends a control command to the second electronic device.
  • the application layer of the first electronic device may not To install a DV application, of course, a DV application may also be installed, and the proxy application may not be installed in the application layer of the second electronic device, of course, a proxy application may also be installed, which is not specifically limited in this embodiment of the present application.
  • Embodiment 1 a possible implementation process will be described based on the application scenario shown in FIG. 5A .
  • FIG. 7 is a schematic flowchart corresponding to the method for capturing a panoramic image according to Embodiment 1 of the present application.
  • FIG. 7 will take the interaction between the first electronic device and one second electronic device as an example for description, and this process can also be extended to the interaction between the first electronic device and a plurality of second electronic devices. As shown in Figure 7, the process can include:
  • the first electronic device detects an operation for launching a camera application (referred to as operation 1).
  • the display screen 194 of the first electronic device displays a main interface, and the main interface includes icons of various application programs (such as a camera application icon).
  • the first electronic device detects the user's operation on the display screen 194 through the touch sensor 180K disposed on the display screen 194.
  • Operation 1 may be an operation of clicking the camera application icon in the main interface, as shown in (a) of FIG. 8 .
  • operation 1 may also be other possible operations, such as an operation of sliding on the lock screen interface or an operation of long pressing the volume key, etc., as long as it is an operation that can start the camera application, which is not limited in the embodiments of the present application.
  • the first electronic device starts the camera application, enters the normal shooting mode, and displays a preview image on the viewfinder interface, as shown in (b) of FIG. 8 .
  • the preview image displayed in the viewfinder interface may be as shown in (b) in FIG. 8 .
  • the preview image is not a panoramic image.
  • the first electronic device detects an operation for entering the panorama mode (referred to as operation 2).
  • the first electronic device detects the user's operation on the display screen 194 through the touch sensor 180K disposed on the display screen 194, and the operation 2 may be an operation of clicking "panorama", as shown in (b) of FIG. 8 .
  • operation 2 also includes a voice command or a hovering operation.
  • the first electronic device in response to operation 2, the first electronic device establishes a connection with the second electronic device.
  • the first electronic device may display an interface as shown in (c) in FIG. 8 on the display screen, and the interface may include one or more options (such as “whether or not Search for other devices" option). If the user triggers "Yes", the DV application of the first electronic device can trigger the first electronic device to search for other electronic devices, and after the search is completed, an interface as shown in (d) in FIG. 8 is displayed.
  • the identifiers of other electronic devices searched (these electronic devices may be referred to as candidate electronic devices) are included, such as the identifiers of the second electronic device.
  • the identifier of the second electronic device may include brand information and series information of the second electronic device, or may also include other information for identifying the second electronic device, which is not specifically limited. If the user triggers the "identification of the second electronic device", that is, the user selects the second electronic device from one or more candidate electronic devices, the first electronic device can establish a connection with the second electronic device.
  • the first electronic device can use Bluetooth (or other possible methods, such as Wi-Fi, mobile communication network (such as 2G, 3G, 4G, 5G or a mobile communication network defined by subsequent standard protocols) , short-range communication protocol (such as NFC) connection, infrared connection, ultra wideband (UWB) connection, ZigBee (purple peak protocol) to search for other electronic devices, if the first electronic device discovers the second electronic device through Bluetooth, the first electronic device An electronic device may use the second electronic device as a candidate electronic device.
  • Wi-Fi wireless local area network
  • mobile communication network such as 2G, 3G, 4G, 5G or a mobile communication network defined by subsequent standard protocols
  • short-range communication protocol such as NFC
  • infrared connection such as infrared connection
  • ultra wideband (UWB) connection such as ultra wideband (UWB) connection
  • ZigBee purple peak protocol
  • the first electronic device may search for electronic devices located in the same Wi-Fi network as the first electronic device. For example, the first electronic device may send a query request to each electronic device in the same Wi-Fi network, and trigger the electronic device that receives the query request to send a response message to the first electronic device, where the response message may indicate whether it has a shooting function. Then, the first electronic device may determine, according to the received response message, an electronic device with a photographing function in the current Wi-Fi network. Furthermore, the first electronic device may use an electronic device with a photographing function as a candidate electronic device.
  • the account logged in by each electronic device and whether each electronic device has a photographing function may be recorded in the server.
  • the first electronic device can query the server for an electronic device with a photographing function that is logged into the same account (eg, a Huawei account) as the first electronic device.
  • the first electronic device may use the queried electronic device as a candidate electronic device.
  • an application for managing smart home devices (such as a TV, etc.) in the home may be installed in the first electronic device.
  • the user can add one or more smart home devices in the smart home application, so that the smart home device added by the user is associated with the first electronic device.
  • a two-dimensional code containing device information such as a device identification can be set on the smart home device.
  • the corresponding smart home device can be added to the smart home application. Thereby, an association relationship between the smart home device and the first electronic device is established.
  • the first electronic device when one or more smart home devices added to the smart home application go online, for example, when the first electronic device detects a Wi-Fi signal sent by the added smart home device, the first electronic device The smart home device can be used as a candidate electronic device, and the user is prompted to choose to use the corresponding smart home device and the first electronic device to capture a panoramic image.
  • the first electronic device may also search for other electronic devices in other possible manners, and the specific implementation of the first electronic device searching for other electronic devices may not be limited in this embodiment of the present application.
  • the first electronic device can establish a connection with the second electronic device through Bluetooth, or can also establish a connection with the second electronic device through Wi-Fi.
  • the first electronic device will establish a connection with the second electronic device through Wi-Fi as: example is described.
  • connection established between the first electronic device and the second electronic device may also include, but is not limited to, a short-range wireless connection (the short-range wireless connection includes but is not limited to NFC connection, infrared connection, ultra-wideband connection, etc.) and mobile Communication network connection (the mobile communication network includes but is not limited to mobile communication networks supporting 2G, 3G, 4G, 5G and subsequent standard protocols).
  • a short-range wireless connection includes but is not limited to NFC connection, infrared connection, ultra-wideband connection, etc.
  • mobile Communication network connection the mobile communication network includes but is not limited to mobile communication networks supporting 2G, 3G, 4G, 5G and subsequent standard protocols.
  • the above S701 to S704 are a possible implementation process.
  • the first electronic device may search for one or more electronic devices with a photographing function according to the above method.
  • the mobile phone can automatically establish a connection with each candidate electronic device that has been searched, and execute the following method flow. At this time, the user does not need to manually select a specific device to establish a connection with the first electronic device, and the first electronic device does not need to display the interface shown in (d) of FIG. 8 .
  • the first electronic device may have established a connection with one or more electronic devices with a photographing function. For example, before the user clicks the function button "Yes" indicated by (c) in FIG. 8 , the first electronic device has established a Bluetooth connection with the second electronic device. Subsequently, if the first electronic device detects that the user clicks the function button "Yes", the first electronic device may no longer perform the process of searching for an electronic device with a photographing function and establishing a connection with the searched electronic device, but executes the following process: method flow. At this time, the user does not need to manually select a specific device to establish a connection with the first electronic device, and the first electronic device does not need to display the interface shown in (d) of FIG. 8 .
  • the first electronic device may have established a connection with one or more electronic devices having a photographing function. For example, before the user opens the panorama mode of the camera application of the first electronic device, the first electronic device has established a Bluetooth connection with the second electronic device. Furthermore, after detecting that the user has opened the camera application, the first electronic device can automatically enter the panorama mode of the camera application, and execute the following method flow. At this time, the user does not need to manually turn on the panorama mode, nor does the user need to manually select a specific device to establish a connection with the first electronic device, and the first electronic device does not need to display the interfaces shown in (c) and (d) of FIG. 8 .
  • first electronic device and the second electronic device may perform S705, where S705 may include S705a, S705b, S705c, S705d and S705e.
  • the first electronic device acquires a preview image data stream 1, where the preview image data stream 1 includes k first preview images, where k is an integer not less than 1.
  • the first electronic device sends a preview command to the second electronic device.
  • the second electronic device can obtain a preview image data stream 2, and the preview image data stream 2 includes k second preview images.
  • the second electronic device sends the preview image data stream 2 to the first electronic device, and correspondingly, the first electronic device may receive the preview image data stream 2.
  • each first preview image in the preview image data stream 1 obtained by the first electronic device in the above S705a may carry time information (or time stamp), and the time information is used to indicate the shooting of the first preview image time or acquisition time.
  • each second preview image in the preview image data stream 2 sent by the second electronic device to the first electronic device in the above S705c may also carry time information, and the time information is used to indicate the shooting time of the second preview image or Collection time.
  • the first electronic device performs frame synchronization on the images in the preview image data stream 1 and the preview image data stream 2, and stitches the two preview images after frame synchronization to obtain n preview panoramic images.
  • the preview image data stream 1 includes a first preview image 1, a first preview image 2, and a first preview image 3, and the preview image data stream 2 includes a second preview image 1, a second preview image 2, and a second preview image 3;
  • the shooting time of the first preview image 1 is t1, the shooting time of the first preview image 2 is t2, the shooting time of the first preview image 3 is t3; the shooting time of the second preview image 1 is t1, and the shooting time of the second preview image
  • the shooting time of 2 is t2, and the shooting time of the second preview image 3 is t3.
  • the first electronic device can consider the first preview image 1 and the second preview image 1 to be two preview images with frame synchronization, and then for the first preview image 1 and the second preview image 1 1 establishes an association relationship, and an association relationship can be established for the first preview image 2 and the second preview image 2 , and an association relationship can be established for the first preview image 3 and the second preview image 3 .
  • the first electronic device can stitch the first preview image 1 and the second preview image 1 to obtain the preview panoramic image 1; stitch the first preview image 2 and the second preview image 2 to obtain the preview panoramic image 2; And, stitching the first preview image 3 and the second preview image 3 to obtain a preview panoramic image 3 .
  • the first electronic device enters the panorama mode, and displays n preview panorama images on the viewfinder interface.
  • the first electronic device may display n preview panoramic images in real time on the viewfinder interface, it should be understood that n is less than or equal to k, and n is an integer greater than or equal to 1.
  • preview images shown in (b) and (e) of FIG. 8 above are only simple examples.
  • the preview images may fill the entire viewfinder interface, or may also occupy a part of the viewfinder interface. , there is no specific limitation.
  • the first electronic device detects an operation for capturing a panoramic image (referred to as operation 3).
  • the first electronic device detects the user's operation on the display screen 194 through the touch sensor 180K disposed on the display screen 194 , and operation 3 may be an operation of clicking the shutter icon, as shown in (f) of FIG. 8 .
  • the first electronic device and the second electronic device may perform S707, where S707 may include S707a, S707b, S707c, S707d, and S707e.
  • the first electronic device acquires m first images, where m is an integer not less than 1.
  • the camera application of the first electronic device can issue at least one shooting command, and then the first electronic device can acquire m first images, such as at least one shooting command Including shooting order 1, shooting order 2, ..., shooting order m, the m first images include first image 1, first image 2, ..., first image m.
  • one shooting command may correspond to one second image.
  • the first electronic device sends at least one shooting command to the second electronic device, and accordingly, the second electronic device acquires m second images according to the at least one shooting command.
  • the camera application of the first electronic device can issue at least one shooting command, so that the first electronic device can send at least one shooting command to the second electronic device
  • the at least one photographing command may include photographing command 1, photographing command 2, . . . , photographing command m.
  • the second electronic device After the second electronic device receives at least one shooting command, it may acquire m second images, and the second images may include second image 1, second image 2, . . . , second image m. Wherein, one shooting command may correspond to one second image.
  • the second electronic device sends m second images to the first electronic device, correspondingly, the first electronic device may receive m second images.
  • each first image acquired by the first electronic device in the above S707a may carry time information, where the time information is used to indicate the shooting time of the first image.
  • each second image sent by the second electronic device to the first electronic device in the above S707c may also carry time information, where the time information is used to indicate the shooting time of the second image.
  • the first electronic device performs frame synchronization on the m first images and the m second images, and stitches the two frame-synchronized images to obtain m panoramic images. Further, the first electronic device may select a target panoramic image from the m panoramic images according to the feature matching value of the two images obtained when splicing the panoramic images.
  • the numbers of the first images and the second images obtained by the first electronic device are the same, optional, and may also be different (for example, the second electronic device is transmitting m-th images to the first electronic device. When there are two images, the transmission of one or several second images may fail, resulting in m second images captured by the second electronic device, but less than m second images transmitted to the first electronic device) .
  • m first images include first image 1, first image 2, and first image 3, and m second images include The second image 1, the second image 2, and the second image 3; wherein, the shooting time of the first image 1 is t1, the shooting time of the first image 2 is t2, and the shooting time of the first image 3 is t3; the second image The shooting time of 1 is t1, the shooting time of the second image 2 is t2, and the shooting time of the second image 3 is t3.
  • the first electronic device can consider that the first image 1 and the second image 1 are two images with frame synchronization, and then establish an association relationship between the first image 1 and the second image 1, and can An association relationship is established for the first image 2 and the second image 2 , and an association relationship is established for the first image 3 and the second image 3 .
  • the first electronic device can stitch the first image 1 and the second image 1 to obtain the panoramic image 1; stitch the first image 2 and the second image 2 to obtain the panoramic image 2; and, the first image 3 and the second image 3 are stitched to obtain a panoramic image 3 .
  • the feature matching value of the two images can be calculated according to a preset algorithm, and the feature matching value can represent the splicing effect of the two images, such as the feature matching value.
  • the higher the value the better the stitching effect of the two images.
  • the first electronic device may select the panorama image with the highest feature matching value as the target panorama image according to the feature matching values corresponding to the panorama image 1, the panorama image 2, and the panorama image 3.
  • the first electronic device may also select one panoramic image as the target panoramic image from among the panoramic images whose feature matching value is greater than or equal to the first threshold.
  • the first threshold may be set according to actual needs.
  • the above description takes the determination of the target panoramic image by the first electronic device according to the feature matching value corresponding to the panoramic image as an example.
  • the first electronic device may also determine the target panoramic image according to other parameters.
  • the application embodiments do not limit this.
  • the first electronic device obtains the number of m first images and f second images
  • the m first images include first image 1, first image 2, first image 3, f
  • the second images include a second image 1 and a second image 2; wherein, the first image 1 and the second image 1 are two frame-synchronized images, and the first image 2 and the second image 2 are two frame-synchronized images , the first image 3 does not have a frame-synchronized second image, then the first electronic device can discard the first image 3, and stitch the first image 1 and the second image 1 to obtain a panoramic image 1; and the first image 2 and the second image 2 is stitched to obtain a panoramic image 2 .
  • the target panoramic image may be selected according to the feature matching values corresponding to the panoramic image 1 and the panoramic image 2 .
  • the first electronic device displays the target panoramic image, as shown in (g) of FIG. 8 .
  • the first electronic device may save the target panoramic image into the memory of the first electronic device after detecting that the user clicks the function button "save".
  • the first electronic device after the first electronic device obtains the target panoramic image, it can also be automatically saved without the user manually performing the saving operation; optionally, after the user performs the viewing operation, the first electronic device displays the target panoramic image image.
  • panoramic image captured in S707 and the previewed panoramic image in S705 may be the same, or may be different, which is not specifically limited.
  • the display interface may include multiple windows, such as the display interface It includes three windows, namely window 1, window 2 and window 3, wherein, window 1 is used to display the first image captured by the first electronic device, and window 2 is used to display the second image captured by the second electronic device. , and window 3 is used to display the target panoramic image obtained by splicing.
  • the number of windows included in the display interface may be the same as the number of devices participating in distributed shooting.
  • the devices participating in distributed shooting include a first electronic device and a second electronic device
  • the display interface may display two windows, One of the windows is used to display the first image captured by the first electronic device, the other window is used to display the second image captured by the second electronic device, and the target panoramic image can be displayed on another interface, and the user can slide the screen to view the target panorama image displayed on another interface.
  • the number of windows included in the display interface can be greater than the number of devices participating in distributed shooting. For example, if the devices participating in distributed shooting include a first electronic device and a second electronic device, the display interface can display three windows ( Referring to (h)) in FIG. 8 , one window is used to display the first image captured by the first electronic device, the other window is used to display the second image captured by the second electronic device, and another window displays the target panorama image.
  • the embodiment of the present application does not limit the manner of displaying the preview image.
  • the viewfinder interface may include three windows, which are windows respectively. 1. Window 2 and Window 3, the first preview image captured by the first electronic device is displayed in window 1, the second preview image captured by the second electronic device is displayed in window 2, and the preview panorama obtained by splicing is displayed in window 3 image.
  • the target panoramic image in the embodiment of the present application is for a certain scene, and the picture in the scene may be a still picture or a non-still picture.
  • the target panoramic image is obtained by splicing a first target image in at least one first image and a second target image in at least one second image, then the first target image may be a part of the target scene (called the first target image).
  • the second target image is obtained by photographing another part of the target scene (referred to as the second frame).
  • the first picture and the second picture may partially overlap (for example, the first picture includes Person 1, Person 2, and Person 3, and the second picture includes Person 2, Person 3, and Person 4), or the first picture and the second picture are adjacent and do not overlap (for example, the first picture includes person 1 and person 2, and the second picture includes person 3 and person 4), which is not specifically limited.
  • a plurality of electronic devices can be used to capture a plurality of images respectively, and then stitch them together to obtain a panoramic image.
  • One of the electronic devices is the master electronic device, and the other electronic devices are slave electronic devices.
  • the master electronic device controls the slave electronic devices to perform shooting operations, so that multiple devices can shoot at the same time, which is suitable for shooting still images. and shooting scenes other than still images.
  • the user can obtain a panoramic image by performing an operation (such as the above operation 3), which can effectively improve the user experience compared to the above-mentioned method that requires the user to perform multiple shots to obtain a panoramic image. .
  • a panoramic image with a larger angle can be captured, which fully meets the needs of users.
  • multiple electronic devices can also be used to obtain the preview image data stream respectively, and the preview panoramic image can be displayed on the viewfinder interface of the master electronic device, so that the user can determine the appropriate shooting time by viewing the preview panoramic image.
  • a panoramic image can be obtained by stitching multiple images through the camera application of the main control electronic device, the time consumption is shorter and the response is faster.
  • the implementation of S705 may include two stages, namely stage 1 and stage 2, where stage 1 is a preview command transmission stage; and stage 2 is a preview image data stream transmission stage.
  • the camera application in the first electronic device can send a preview command to the camera frame, for example, the camera application sends a preview command to the camera frame by calling camera API v2.
  • the camera framework can send the preview command to the camera service.
  • the camera framework sends the preview command to the camera service by calling the camera AIDL interface.
  • the camera service can send the preview command to the camera HAL, and send the preview command to the virtual camera HAL.
  • the camera HAL can send the preview command to the camera driver, and after receiving the preview command, the camera driver can call the camera to collect the preview image data stream (referred to as preview image data stream 1).
  • the virtual camera HAL may send the preview command to the proxy application of the second electronic device.
  • the proxy application of the second electronic device may send the preview command to the camera frame of the second electronic device.
  • the camera frame of the second electronic device may send the preview command to the camera service.
  • the camera service After the camera service receives the preview command, it can send the preview command to the camera HAL.
  • the camera HAL can send the preview command to the camera driver, and after receiving the preview command, the camera driver can call the camera to collect the preview image data stream (referred to as preview image data stream 2).
  • the camera HAL in the second electronic device acquires the preview image data stream 2 and sends the preview image data stream 2 to the camera service.
  • the camera service sends the preview image data stream 2 to the camera framework.
  • the camera framework can send the preview image data stream 2 to the proxy application of the second electronic device.
  • the proxy application of the second electronic device may send the preview image data stream 2 to the virtual camera HAL of the first electronic device.
  • the camera HAL of the first electronic device acquires the preview image data stream 1 and sends the preview image data stream 1 to the camera service.
  • the virtual camera HAL of the first electronic device can send the preview image data stream 2 to the camera service.
  • the camera service can send the preview image data stream 1 and the preview image data stream 2 to the camera framework.
  • the camera framework can according to the time information of each preview image in the preview image data stream 1 (a preview image can be understood as a frame) and The time information of each preview image is frame-synchronized.
  • the camera framework sends the frame-synchronized preview image data stream 1 and preview image data stream 2 to the camera application.
  • a panoramic image stitching algorithm can be used. Stitching is performed to obtain a preview panorama image (for example, a preview panorama image 1), and then the preview panorama image 1 is displayed on the viewfinder interface.
  • the feature matching value of the first preview image 1 and the second preview image 1 can be obtained by calculation, If it is determined that the feature matching value of the first preview image 1 and the second preview image 1 is smaller than the second threshold, prompt information may be displayed, and the prompt information may be used to prompt the user to adjust the shooting of the first electronic device and/or the second electronic device angle and/or location.
  • the second threshold can be set according to actual needs.
  • frame synchronization may also be performed by other modules.
  • frame synchronization may be performed by a camera service, or frame synchronization may be performed by a camera application, and the module for performing frame synchronization may not be limited in this embodiment of the present application.
  • the implementation of the above S707 is described below with reference to FIG. 10 .
  • the implementation of S707 may include two stages, namely stage 1 and stage 2, where stage 1 is a shooting command transmission stage; and stage 2 is an image transmission stage.
  • the camera application in the first electronic device can send at least one shooting command to the camera frame, such as shooting command 1, shooting command 2, ..., shooting command n, and shooting command 1 is used as an example for description here .
  • the camera framework receives the shooting command 1, it can send the shooting command 1 to the camera service.
  • the camera service can send the shooting command 1 to the camera HAL, and send the shooting command 1 to the virtual camera HAL.
  • the camera HAL can send the shooting command 1 to the camera driver, and after receiving the shooting command 1, the camera driver can call the camera to collect the first image 1 (corresponding to the shooting command 1).
  • the virtual camera HAL may send the shooting command 1 to the proxy application of the second electronic device.
  • the proxy application of the second electronic device can send the shooting command 1 to the camera frame of the second electronic device.
  • the camera frame of the second electronic device may send the shooting command 1 to the camera service.
  • the camera service receives the shooting command 1, it can send the shooting command 1 to the camera HAL.
  • the camera HAL can send the shooting command 1 to the camera driver, and after receiving the shooting command 1, the camera driver can call the camera to collect the second image 1 (corresponding to the shooting command 1).
  • the camera HAL in the second electronic device acquires m second images (for example, the second image 1 corresponding to the shooting command 1, the second image 2 corresponding to the shooting command 2, ..., the shooting command m corresponding to , the second image m is shown in Figure 10 as an example), and the m second images are sent to the camera service; after the camera service receives the m second images, the m second images are sent to the camera service.
  • the image is sent to the camera frame; after the camera frame receives m second images, it can send m second images to the proxy application of the second electronic device, and after the proxy application of the second electronic device receives the m second images, it can send m second images to the proxy application of the second electronic device.
  • the m second images are sent to the virtual camera HAL of the first electronic device.
  • the camera HAL in the first electronic device acquires m first images (for example, the first image 1 corresponding to the shooting command 1, the first image 2 corresponding to the shooting command 2, ..., the shooting command m corresponding to , the first image m is shown in FIG. 10 as an example), and the m first images are sent to the camera service; after the camera service receives the m first images, the m first images are sent to the camera service.
  • the image is sent to the camera frame; after the camera frame receives the m first images, the m first images can be put into the buffer queue.
  • the virtual camera HAL in the first electronic device receives the m second images, it can send the m second images to the camera service.
  • the camera service After the camera service receives the m second images, it sends the m second images to the camera framework. Further, the camera frame performs frame synchronization on the m first images and the m second images.
  • the camera framework sends frame-synchronized m first images and m second images to the camera application.
  • the camera application can stitch two frame-synchronized images to obtain a panoramic image. Further, when the camera application stitches the two images, the feature matching value of the two images can be obtained, and the target panoramic image can be determined according to the feature matching value, and then the target panoramic image can be displayed.
  • Embodiment 2 a possible implementation process will be described based on the application scenario shown in FIG. 6 above.
  • FIG. 11 is a schematic flowchart corresponding to a method for capturing a panoramic image according to Embodiment 2 of the present application.
  • FIG. 11 will take the interaction between the first electronic device and a second electronic device as an example for description, and this process can also be extended to the interaction between the first electronic device and a plurality of second electronic devices. As shown in Figure 11, the process may include:
  • the first electronic device detects an operation for starting the camera application (referred to as operation 1), as shown in (a) of FIG. 8 .
  • the first electronic device starts the camera application, enters the normal shooting mode, and displays a preview image on the viewfinder interface, as shown in (b) of FIG. 8 .
  • the first electronic device detects an operation for entering the panorama mode (referred to as operation 2).
  • the first electronic device, the second electronic device and the cloud server may perform S1104, where S1104 may include S1104a to S1104g.
  • the first electronic device acquires a preview image data stream 1, where the preview image data stream 1 includes k first preview images.
  • the first electronic device sends a preview command to the cloud server; correspondingly, after receiving the preview command, the cloud server sends the preview command to the second electronic device.
  • the second electronic device may obtain a preview image data stream 2, where the preview image data stream 2 includes k second preview images.
  • the first electronic device sends the preview image data stream 1 to the cloud server, and accordingly, the cloud server may receive the preview image data stream 1.
  • the second electronic device sends the preview image data stream 2 to the cloud server, and accordingly, the cloud server may receive the preview image data stream 2.
  • the cloud server performs frame synchronization on the images in the preview image data stream 1 and the preview image data stream 2, and splices the two images after frame synchronization (such as the first preview image 1 and the second preview image 1) to obtain a preview panorama image, and send the preview panorama image to the first electronic device.
  • the cloud server can obtain the feature matching values of the first preview image 1 and the second preview image 1, and if it is determined that the feature matching values of the first preview image 1 and the second preview image 1 are smaller than the second threshold
  • the first electronic device sends indication information, where the indication information is used to indicate that the feature matching value of the first preview image 1 and the second preview image 1 is smaller than the second threshold; further, the first electronic device can display prompt information according to the indication information, and the prompt information It is used to prompt the user to adjust the shooting angle and/or position of the first electronic device and/or the second electronic device.
  • the cloud server may also send the feature matching values of the first preview image 1 and the second preview image 1 to the first electronic device, and the first electronic device may display prompt information after determining that the feature matching value is less than the second threshold.
  • the first electronic device receives the preview panorama image, enters the panorama mode, and displays the preview panorama image on the viewfinder interface, as shown in (e) of FIG. 8 .
  • the first electronic device detects an operation for capturing a panoramic image (referred to as operation 3).
  • the first electronic device, the second electronic device, and the cloud server may perform S1106, where S1106 may include S1106a to S1106f.
  • the first electronic device acquires m first images.
  • the first electronic device sends at least one shooting command to the cloud server; correspondingly, after receiving the at least one shooting command, the cloud server sends the at least one shooting command to the second electronic device.
  • the second electronic device may receive at least one shooting command, and acquire m second images according to the at least one shooting command.
  • the first electronic device sends m first images to the cloud server, and accordingly, the cloud server may receive m first images.
  • the second electronic device sends m second images to the cloud server, and accordingly, the cloud server may receive m second images.
  • the cloud server performs frame synchronization on the m first images and the m second images, and stitches the two frame-synchronized images to obtain m panoramic images. Further, the cloud server may select a target panoramic image from the m panoramic images, and send the target panoramic image to the first electronic device.
  • the first electronic device displays the target panoramic image, as shown in (g) of FIG. 8 .
  • the cloud server selects a target panoramic image from m panoramic images and sends it to the first electronic device as an example for description.
  • the cloud server may also store m panoramic images. The image (and the corresponding feature matching value) is sent to the first electronic device, and the first electronic device selects a target panoramic image from the m panoramic images.
  • the cloud server obtains m panoramic images by splicing m first images and m second images as an example. In other possible embodiments, the cloud server receives the data sent by the second electronic device.
  • the m second images may be sent to the first electronic device, and then the first electronic device obtains m panoramic images by splicing the m first images and the m second images, and obtains m panoramic images from the m second images.
  • One target panoramic image is selected from the panoramic images (in this case, after the first electronic device acquires m first images, it may not be sent to the cloud server).
  • the images in the preview image data stream 1 and the preview image data stream 2 can also be spliced by the first electronic device.
  • multiple electronic devices can be used to capture multiple images, and the multiple images can be stitched to obtain a panoramic image.
  • One of the electronic devices is the master electronic device, and the other electronic devices are slave electronic devices.
  • the master electronic device controls the slave electronic devices to perform shooting operations, so that multiple devices can shoot at the same time, which is suitable for shooting still images. and shooting non-still images; in addition, since a panoramic image can be obtained by splicing multiple images through a cloud server, the processing burden of the main control electronic device can be effectively reduced.
  • the implementation of S1104 may include two stages, namely stage 1 and stage 2, stage 1 is the preview command transmission stage; stage 2 is the preview image data stream transmission stage.
  • the camera application in the first electronic device may send a preview command to the camera framework. After the camera framework receives the preview command, it can send the preview command to the camera service. After the camera service receives the preview command, it can send the preview command to the camera HAL. After receiving the preview command, the camera HAL can send the preview command to the camera driver, and after receiving the preview command, the camera driver can call the camera to collect the preview image data stream (referred to as preview image data stream 1). And, the camera application in the first electronic device may also send a preview command to the cloud server.
  • the cloud server after receiving the preview command sent by the camera application in the first electronic device, the cloud server can send the preview command to the camera application in the second electronic device.
  • the camera application of the second electronic device may send the preview command to the camera frame of the second electronic device.
  • the camera frame of the second electronic device may send the preview command to the camera service.
  • the camera service After the camera service receives the preview command, it can send the preview command to the camera HAL.
  • the camera HAL can send the preview command to the camera driver, and after receiving the preview command, the camera driver can call the camera to collect the preview image data stream (referred to as preview image data stream 2).
  • the camera HAL of the first electronic device acquires the preview image data stream 1 and sends the preview image data stream 1 to the camera service.
  • the camera service sends the preview image data stream 1 to the camera framework.
  • the camera framework sends the preview image data stream 1 to the camera application.
  • the camera application can send the preview image data stream 1 to the cloud server.
  • the camera HAL in the second electronic device acquires the preview image data stream 2 and sends the preview image data stream 2 to the camera service.
  • the camera service sends the preview image data stream 2 to the camera framework.
  • the camera framework can send the preview image data stream 2 to the camera application.
  • the camera application can send the preview image data stream 2 to the cloud server.
  • the cloud server after receiving the preview image data stream 1 and the preview image data stream 2, the cloud server can perform frame synchronization on the images in the preview image data stream 1 and the preview image data stream 1.
  • a panoramic image stitching algorithm can be used to stitch to obtain a preview panoramic image, and the preview panoramic image is sent to the first electronic device, and then the first The electronic device can display the preview panoramic image on the viewfinder interface of the display screen.
  • the implementation of the above S1106 is described below with reference to FIG. 13 .
  • the implementation of S1106 may include two stages, namely stage 1 and stage 2, where stage 1 is a shooting command transmission stage; and stage 2 is an image transmission stage.
  • the camera application in the first electronic device can send at least one shooting command to the camera frame, such as shooting command 1, shooting command 2, ..., shooting command m, and shooting command 1 is used as an example for description here .
  • the camera framework receives the shooting command 1, it can send the shooting command 1 to the camera service.
  • the camera service receives the shooting command 1, it can send the shooting command 1 to the camera HAL.
  • the camera HAL can send the shooting command 1 to the camera driver, and after receiving the shooting command 1, the camera driver can call the camera to collect the first image 1 (corresponding to the shooting command 1).
  • the camera application in the first electronic device may also send at least one shooting command to the cloud server, such as shooting command 1, shooting command 2, . . .
  • the cloud server after receiving the shooting command 1 sent by the camera application in the first electronic device, the cloud server can send the shooting command 1 to the camera application in the second electronic device.
  • the camera application of the second electronic device can send the shooting command 1 to the camera frame of the second electronic device.
  • the camera frame of the second electronic device may send the shooting command 1 to the camera service.
  • the camera service receives the shooting command 1, it can send the shooting command 1 to the camera HAL.
  • the camera HAL can send the shooting command 1 to the camera driver, and after receiving the shooting command 1, the camera driver can call the camera to collect the second image 1 (corresponding to the shooting command 1).
  • the camera HAL of the first electronic device acquires the first image 1 and sends the first image 1 to the camera service. After the camera service receives the first image 1, it sends the first image 1 to the camera framework. After receiving the first image 1, the camera framework sends the first image 1 to the camera application. After receiving the first image 1, the camera application may send the first image 1 to the cloud server. In addition, the first electronic device may also acquire other first images (such as the first image 2, the first image 3, ..., the first image m), and send the first image 2, the first image 3, ... to the cloud server ..., the first image m.
  • first images such as the first image 2, the first image 3, ..., the first image m
  • the camera HAL in the second electronic device acquires the second image 1 and sends the second image 1 to the camera service.
  • the camera service receives the second image 1, it sends the second image 1 to the camera framework.
  • the camera framework can send the second image 1 to the camera application.
  • the camera application may send the second image 1 to the cloud server.
  • the second electronic device may also acquire other second images (such as the second image 2, the second image 3, ..., the second image m), and send the second image 2, the second image 3, ... to the cloud server ..., the second image m.
  • the cloud server can Frame synchronization is performed on the second image, for example, the first image 1 and the second image 1 frame synchronization, the first image 2 and the second image 2 frame synchronization, and so on.
  • the cloud server can splicing two frame-synchronized images to obtain a panoramic image, for example, splicing the first image 1 and the second image 1 to obtain the panoramic image 1, and splicing the first image 2 and the second image 2 to obtain the panoramic image 2 , and so on; in this way, the cloud server can obtain panoramic image 1, panoramic image 2, ... panoramic image m.
  • the feature matching value of the two images can be obtained. If the feature matching value corresponding to the panoramic image 1 is determined (that is, the feature matching value of the first image 1 and the second image 1) If it is greater than or equal to the feature matching value corresponding to other panoramic images (such as panoramic image 2, . . . panoramic image m), then panoramic image 1 can be used as the target panoramic image and sent to the first electronic device.
  • the first and second embodiments above are described by taking the shooting of a panoramic image as an example.
  • the method in the embodiment of the present application can also be extended to the scene of panoramic video recording.
  • the first electronic device detects that the user can click on the panoramic image.
  • the camera application of the first electronic device can issue a video recording command, and then the first electronic device can capture data stream 1 (including multiple images), and the second electronic device can capture data stream 2 (including multiple images). image), data stream 1 and data stream 2 can be spliced to obtain a panoramic video data stream (or panoramic video stream), and then the first electronic device can play the panoramic video.
  • a user is watching a concert or a football match, he can use a distributed camera composed of multiple devices to record video, and then can record a wider scene, live broadcast or record it for later viewing.
  • step numbers of the flowcharts described in Embodiment 1 and Embodiment 2 are only an example of the execution process, and do not constitute a restriction on the sequence of execution of the steps. There is no sequence between the embodiments of this application. There is no strict order of execution between the steps of a dependency. In addition, not all the steps shown in each flowchart are steps that must be executed, and some steps may be added or deleted on the basis of each flowchart according to actual needs.
  • the first electronic device and the second electronic device can communicate through the connection between the first electronic device and the second electronic device.
  • the first electronic device and the second electronic device The devices communicate with each other through the cloud server.
  • those skilled in the art can also make adaptive modifications based on the first and second embodiments.
  • the first electronic device and the second electronic device can The connection between the electronic device and the second electronic device transmits control commands, and in the data (such as the preview image data stream, the captured image) transmission stage, the first electronic device can transfer the preview image data stream 1 (or the first image 1 ) to the cloud server, and the second electronic device may send the preview image data stream 2 (or the second image 1 ) to the cloud server, which is not specifically limited.
  • the Android system is used as an example to illustrate the specific method for realizing the distributed shooting function among the various functional modules. It is understood that the corresponding The function module implements the above method. As long as the functions implemented by various devices and functional modules are similar to the embodiments of the present application, they fall within the scope of the claims of the present application and their technical equivalents.
  • an embodiment of the present application discloses an electronic device, and the electronic device may be the above-mentioned first electronic device or a main electronic device (eg, a mobile phone).
  • the electronic device may specifically include: a touch screen 1401, the touch screen 1401 includes a touch sensor 1406 and a display screen 1407; one or more processors 1402; a memory 1403; a communication module 1408; one or more cameras 1409; one or more applications programs (not shown); and one or more computer programs 1404, the various devices may be connected by one or more communication buses 1405.
  • the above-mentioned one or more computer programs 1404 are stored in the above-mentioned memory 1403 and configured to be executed by the one or more processors 1402, and the one or more computer programs 1404 include instructions that can be used to execute the above-mentioned Relevant steps performed by the first electronic device in the embodiment.
  • an embodiment of the present application discloses an electronic device, which may be the above-mentioned second electronic device or a secondary electronic device (eg, a mobile phone, a smart large screen, a tablet computer, a vehicle-mounted device).
  • the electronic device may specifically include: one or more processors 1502; a memory 1503; a communication module 1506; one or more application programs (not shown); one or more cameras 1501; and one or more computer programs 1504,
  • the various devices described above may be connected by one or more communication buses 1505 .
  • a device such as a touch screen may also be set in the slave device, which is not limited in this embodiment of the present application.
  • the above-mentioned one or more computer programs 1504 are stored in the above-mentioned memory 1503 and configured to be executed by the one or more processors 1502, and the one or more computer programs 1504 include instructions that can be used to execute the above-mentioned Relevant steps performed by the device in the embodiment.
  • the cloud server may include a communication interface 1601 , a processor 1602 and a memory 1603 . Further, the cloud server may further include a bus system, wherein the processor 1602, the memory 1603, and the communication interface 1601 may be connected through the bus system.
  • the processor 1602 may be a chip.
  • the processor 1602 may be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), or a system on chip (SoC). It can be a central processor unit (CPU), a network processor (NP), a DSP, a microcontroller unit (MCU), or a programmable Controller (programmable logic device, PLD) or other integrated chips.
  • Memory 1603 may be volatile memory or nonvolatile memory, or may include both volatile and nonvolatile memory.
  • Communication interface 1601 which can be used to input and/or output information.
  • the cloud server includes a transceiver
  • the method steps performed by the communication interface 1601 may also be performed by the transceiver.
  • the memory 1603 is used for storing instructions for executing the embodiments of the present application.
  • the processor 1602 is configured to execute the instructions stored in the memory 1603, thereby implementing the methods provided in the embodiments of the present application. Or, optionally, in this embodiment of the present application, the processor 1602 may also perform functions related to processing in the method provided by the embodiment of the present application, and the communication interface 1601 is responsible for communicating with other devices or communication networks. This is not specifically limited.
  • the instructions in the embodiments of the present application may also be referred to as application program codes or computer programs, which are not specifically limited in the embodiments of the present application.
  • references in this specification to "one embodiment” or “some embodiments” and the like mean that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application.
  • appearances of the phrases “in one embodiment,” “in some embodiments,” “in other embodiments,” “in other embodiments,” etc. in various places in this specification are not necessarily All refer to the same embodiment, but mean “one or more but not all embodiments” unless specifically emphasized otherwise.
  • the terms “including”, “including”, “having” and their variants mean “including but not limited to” unless specifically emphasized otherwise.
  • the above-mentioned embodiments it may be implemented in whole or in part by software, hardware, firmware or any combination thereof.
  • software it can be implemented in whole or in part in the form of a computer program product.
  • the computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated.
  • the computer may be a general purpose computer, special purpose computer, computer network, or other programmable device.
  • the computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be downloaded from a website site, computer, server, or data center Transmission to another website site, computer, server, or data center is by wire (eg, coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (eg, infrared, wireless, microwave, etc.).
  • the computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, a data center, or the like that includes an integration of one or more available media.
  • the available media may be magnetic media (e.g., floppy disk, hard disk, magnetic tape), optical media (e.g., DVD), or semiconductor media (e.g., Solid State Disk (SSD)), and the like.
  • magnetic media e.g., floppy disk, hard disk, magnetic tape
  • optical media e.g., DVD
  • semiconductor media e.g., Solid State Disk (SSD)

Landscapes

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

Abstract

一种全景图像的拍摄方法及电子设备。其中方法包括:第一电子设备检测到用于拍摄全景图像的第一操作,响应于第一操作,可以获取m个第一图像,以及向第二电子设备发送至少一次拍摄命令,以使得第二电子设备可以根据至少一次拍摄命令获取m个第二图像;进而接收来自于第二电子设备的所述m个第二图像,根据m个第一图像和m个第二图像,拼接得到m个全景图像,并从m个全景图像中选择目标全景图像。如此,可以由第一电子设备控制第二电子设备拍摄,使得第一电子设备和第二电子设备能够在同一时间进行拍摄,从而可以适用拍摄静止画面的场景和拍摄非静止画面的场景。

Description

一种全景图像的拍摄方法及电子设备
相关申请的交叉引用
本申请要求在2021年01月29日提交中国专利局、申请号为202110127000.8、申请名称为“一种全景图像的拍摄方法及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及终端技术领域,尤其涉及一种全景图像的拍摄方法及电子设备。
背景技术
随着技术的进步,电子设备的各种功能不断完善。以手机为例,图像拍摄功能是用户使用频率较高的功能之一。
由于全景图像可以通过广角的表现手段,尽可能多地表现出周围的环境,比如全景图像可以在一个固定的观察点、提供水平方向上90度到360度、垂直方向上180度的自由浏览,因此,越来越多的用户有拍摄全景图像的需求。
发明内容
本申请实施例的目的在于提供一种全景图像的拍摄方法及电子设备,实现由第一电子设备控制至少一个第二电子设备拍摄,使得多个电子设备可以在同一时间进行拍摄,从而适用于拍摄静止画面或非静止画面的全景图像。
第一方面,本申请实施例提供一种全景图像的拍摄方法,该方法可以适用于第一电子设备,在该方法中,第一电子设备检测到用于拍摄全景图像的第一操作,响应于第一操作,获取m个第一图像,以及向第二电子设备发送至少一次拍摄命令,以使第二电子设备根据至少一次拍摄命令获取m个第二图像;接收来自于所述第二电子设备的所述m个第二图像;根据m个第一图像和m个第二图像,拼接得到m个全景图像;从m个全景图像中,选择一个目标全景图像;其中,m个第一图像包括第一目标图像,m个第二图像包括第二目标图像,目标全景图像是根据第一目标图像和第二目标图像拼接得到的,m为不大于1的整数。
采用上述方法,由于第一电子设备可以向第二电子设备发送拍摄命令,因此第一电子设备可以控制第二电子设备拍摄,使得第一电子设备和第二电子设备能够在同一时间进行分布式拍摄,从而可以适用拍摄静止画面的全景图像和拍摄非静止画面的全景图像。
在一种可能的实现方式中,第一目标图像和第二目标图像的特征匹配值大于或等于第一阈值。
采用上述方法,由于第一电子设备可以向第二电子设备发送至少一次拍摄命令,从而使得后续可以拼接得到m个全景图像,并可以根据特征匹配值从m个全景图像中选择拼接效果较好的目标全景图像,提高用户体验。
在一种可能的实现方式中,该方法还包括:在第一窗口显示目标全景图像。
在一种可能的实现方式中,该方法还包括:在第二窗口显示第一目标图像,以及在第三窗口显示第二目标图像;其中,第一窗口、第二窗口和第三窗口位于同一显示界面。
采用上述方法,由于可以在同一显示界面上显示目标全景图像、第一目标图像和第二目标图像,从而便于用户进行同时查看,提高用户体验。
在一种可能的实现方式中,向第二电子设备发送至少一次拍摄命令,包括:通过第一电子设备与第二电子设备之间的连接向第二电子设备发送至少一次拍摄命令;或者,通过云服务器向第二电子设备发送至少一次拍摄命令。
在一种可能的实现方式中,根据m个第一图像和m个第二图像,拼接得到m个全景图像之前,该方法还包括:对m个第一图像和m个第二图像进行帧同步;其中,第一目标图像和第二目标图像为帧同步的两个图像。
在一种可能的实现方式中,检测到用于拍摄全景图像的第一操作之前,该方法还包括:进入全景模式;获取第一预览图像,以及向第二电子设备发送预览命令,以使第二电子设备根据预览命令获取第二预览图像;接收来自于第二电子设备的第二预览图像;根据第一预览图像和第二预览图像,拼接得到预览全景图像;在第一窗口显示预览全景图像。
采用上述方法,第一电子设备可以向第二电子设备发送预览命令,从而可以通过多个电子设备来分别获取预览图像数据流,以及在第一电子设备的取景界面显示预览全景图像,使得用户可以通过观看预览全景图像,确定合适的拍摄时机。
在一种可能的实现方式中,该方法还包括:在第二窗口显示第一预览图像,以及在第三窗口显示第二预览图像;其中,第一窗口、第二窗口和第三窗口位于同一显示界面。
在一种可能的实现方式中,该方法还包括:获取第一预览图像和第二预览图像的特征匹配值;若特征匹配值小于第二阈值,则显示提示信息,提示信息用于提示用户调整第一电子设备和/或第二电子设备的拍摄角度和/或位置。
在一种可能的实现方式中,进入全景模式,包括:检测到用于进入全景模式的第二操作,响应于第二操作,进入全景模式;或者,检测到用于启动第一电子设备的相机应用的第三操作,若确定与第二电子设备建立有连接,则进入全景模式。
第二方面,本申请实施例提供一种全景图像的拍摄方法(或者也可以称为全景录像方法),该方法可以适用于第一电子设备,在该方法中,第一电子设备检测到用于全景录像的第一操作;响应于第一操作,获取第一录像数据流,以及向第二电子设备发送录像命令,以使第二电子设备根据录像命令获取第二录像数据流;接收来自于第二电子设备的第二录像数据流;根据第一录像数据流和第二录像数据流,拼接得到全景录像数据流。
在一种可能的实现方式中,该方法还包括:根据全景录像数据流,在第一窗口进行播放。
在一种可能的实现方式中,该方法还包括:根据第一录像数据流,在第二窗口进行播放;以及根据第二录像数据流,在第三窗口进行播放;其中,第一窗口、第二窗口和第三窗口位于同一显示界面。
在一种可能的实现方式中,向第二电子设备发送录像命令,包括:通过第一电子设备与第二电子设备之间的连接向第二电子设备发送录像命令。
在一种可能的实现方式中,检测到用于全景录像的第一操作之前,该方法还包括:进入全景模式;获取第一预览图像,以及向第二电子设备发送预览命令,以使第二电子设备根据预览命令获取第二预览图像;接收来自于第二电子设备的第二预览图像;根据第一预 览图像和第二预览图像,拼接得到预览全景图像;在第一窗口显示预览全景图像。
在一种可能的实现方式中,该方法还包括:在第二窗口显示第一预览图像,以及在第三窗口显示第二预览图像;其中,第一窗口、第二窗口和第三窗口位于同一显示界面。
在一种可能的实现方式中,该方法还包括:获取第一预览图像和第二预览图像的特征匹配值;若特征匹配值小于第二阈值,则显示提示信息,提示信息用于提示用户调整第一电子设备和/或第二电子设备的拍摄角度和/或位置。
在一种可能的实现方式中,进入全景模式,包括:检测到用于进入全景模式的第二操作,响应于第二操作,进入全景模式;或者,检测到用于启动第一电子设备的相机应用的第三操作,若确定与第二电子设备建立有连接,则进入全景模式。
需要说明的是,上述第二方面所提供的全景录像方法与上述第一方面所提供的全景图像的拍摄方法是基于同一发明思路的,二者的区别在于:第一方面中,第一电子设备可以向第二电子设备发送至少一次拍摄命令,进而第二电子设备可以根据至少一次拍摄命令执行拍摄操作;此外,第一电子设备获得的为一个目标全景图像;而第二方面中,第一电子设备可以向第二电子设备发送录像命令,进而第二电子设备可以根据录像命令执行录像操作;此外,第一电子设备获得为全景图像数据流(可以理解为全景视频)。因此,第二方面相关技术特征的有益效果可以参照第一方面,不再赘述。
第三方面,本申请实施例提供一种全景图像的拍摄方法,该方法可以适用于第一电子设备,在该方法中,第一电子设备检测到用于拍摄全景图像的第一操作;响应于第一操作,获取m个第一图像,并向云服务器发送m个第一图像;以及,向第二电子设备发送至少一次拍摄命令,以使第二电子设备根据至少一次拍摄命令获取m个第二图像并发送给云服务器;接收云服务器发送的一个目标全景图像;其中,目标全景图像是从m个全景图像中选择出的,m个全景图像是根据m个第一图像和m个第二图像拼接得到的;其中,m个第一图像包括第一目标图像,m个第二图像包括第二目标图像,目标全景图像是根据第一目标图像和第二目标图像拼接得到的,m为不小于1的整数。
采用上述方法,可以由云服务器根据m个第一图像和m个第二图像进行拼接得到m个全景图像,并选择一个目标全景图像发送给第一电子设备,而无需第一电子设备执行拼接和选择目标全景图像的操作,从而能够有效降低第一电子设备的处理负担。
在一种可能的实现方式中,第一目标图像和第二目标图像的特征匹配值大于或等于第一阈值。
在一种可能的实现方式中,该方法还包括:显示目标全景图像;或者,保存目标全景图像。
在一种可能的实现方式中,向第二电子设备发送至少一次拍摄命令,包括:通过云服务器向第二电子设备发送至少一次拍摄命令。
在一种可能的实现方式中,检测到用于拍摄全景图像的第一操作之前,该方法还包括:进入全景模式;获取第一预览图像,并向云服务器发送第一预览图像,以及向第二电子设备发送预览命令,以使第二电子设备根据预览命令获取第二预览图像并发送给云服务器;接收云服务器发送的预览全景图像,预览全景图像是根据第一预览图像和第二预览图像拼接得到的;以及,显示预览全景图像。
在一种可能的实现方式中,该方法还包括:接收云服务器发送的指示信息,指示信息用于指示第一预览图像和第二预览图像的特征匹配值小于第二阈值;根据指示信息,显示 提示信息,提示信息用于提示用户调整第一电子设备和/或第二电子设备的拍摄角度和/或位置。
在一种可能的实现方式中,进入全景模式,包括:检测到用于进入全景模式的第二操作,响应于第二操作,进入全景模式。
第四方面,本申请实施例提供一种全景图像的拍摄方法,该方法可以适用于第一电子设备,在该方法中,第一电子设备检测到用于拍摄全景图像的第一操作;响应于第一操作,获取m个第一图像,并向云服务器发送m个第一图像;以及,向第二电子设备发送至少一次拍摄命令,以使第二电子设备根据至少一次拍摄命令获取m个第二图像并发送给云服务器;接收云服务器发送的m个全景图像,m个全景图像是根据m个第一图像和m个第二图像拼接得到的;从m个全景图像中,选择一个目标全景图像;其中,m个第一图像包括第一目标图像,m个第二图像包括第二目标图像,目标全景图像是根据第一目标图像和第二目标图像拼接得到的,m为不小于1的整数。
采用上述方法,可以由云服务器根据m个第一图像和m个第二图像进行拼接得到m个全景图像,并发送给第一电子设备,而无需第一电子设备执行拼接操作,从而能够有效降低第一电子设备的处理负担。
在一种可能的实现方式中,第一目标图像和第二目标图像的特征匹配值大于或等于第一阈值。
在一种可能的实现方式中,该方法还包括:显示目标全景图像;或者,保存目标全景图像。
在一种可能的实现方式中,向第二电子设备发送至少一次拍摄命令,包括:通过云服务器向第二电子设备发送至少一次拍摄命令。
在一种可能的实现方式中,检测到用于拍摄全景图像的第一操作之前,该方法还包括:进入全景模式;获取第一预览图像,并向云服务器发送第一预览图像,以及向第二电子设备发送预览命令,以使第二电子设备根据预览命令获取第二预览图像并发送给云服务器;接收云服务器发送的预览全景图像,预览全景图像是根据第一预览图像和第二预览图像拼接得到的;显示预览全景图像。
在一种可能的实现方式中,该方法还包括:接收云服务器发送的指示信息,指示信息用于指示第一预览图像和第二预览图像的特征匹配值小于第二阈值;根据指示信息,显示提示信息,提示信息用于提示用户调整第一电子设备和/或第二电子设备的拍摄角度和/或位置。
在一种可能的实现方式中,进入全景模式,包括:检测到用于进入全景模式的第二操作,响应于第二操作,进入全景模式。
第五方面,本申请实施例提供一种全景图像的拍摄方法,该方法可以适用于第二电子设备,在该方法中,第二电子设备接收来自第一电子设备的至少一次拍摄命令;根据至少一次拍摄命令获取m个第二图像,m个第二图像用于拼接得到m个全景图像。
在一种可能的实现方式中,接收来自第一电子设备的至少一次拍摄命令,包括:通过第一电子设备与第二电子设备之间的连接接收来自第一电子设备的至少一次拍摄命令。
在一种可能的实现方式中,接收来自第一电子设备的至少一次拍摄命令,包括:接收云服务器发送的来自第一电子设备的至少一次拍摄命令。
在一种可能的实现方式中,该方法还包括:向第一电子设备发送m个第二图像。
在一种可能的实现方式中,该方法还包括:向云服务器发送m个第二图像。
在一种可能的实现方式中,该方法还包括:接收来自第一电子设备的预览命令;根据预览命令获取第二预览图像,第二预览图像用于拼接得到预览全景图像。
在一种可能的实现方式中,该方法还包括:向第一电子设备发送第二预览图像。
在一种可能的实现方式中,该方法还包括:向云服务器发送第二预览图像。
第六方面,本申请实施例提供一种全景图像的拍摄方法,该方法可以适用于云服务器,在该方法中,云服务器接收到第一电子设备发送的至少一次拍摄命令后,向第二电子设备发送至少一次拍摄命令,以使第二电子设备根据至少一次拍摄命令获取m个第二图像;接收第一电子设备发送的m个第一图像,以及接收第二电子设备发送的m个第二图像;根据m个第一图像和m个第二图像,拼接得到m个全景图像;向第一电子设备发送m个全景图像;或者,从m个全景图像中,选择一个目标全景图像,并向第一电子设备发送该目标全景图像。
需要说明的是,上述第五方面和第六方面中相关技术特征的有益效果可以参照前述第一方面、第三方面和第四方面中的描述,不再赘述。
第七方面,本申请提供一种电子设备(例如上述第一电子设备),包括:显示屏、通信模块、一个或多个处理器、一个或多个存储器、一个或多个摄像头以及一个或多个计算机程序;其中,处理器与通信模块、显示屏、摄像头以及存储器均耦合,上述一个或多个计算机程序被存储在存储器中,当电子设备运行时,该处理器执行该存储器存储的一个或多个计算机程序,以使第一电子设备执行上述第一方面至第四方面中任一方面所述的方法。
第八方面,本申请提供一种电子设备(例如上述第二电子设备),包括:通信模块、一个或多个处理器、一个或多个存储器、一个或多个摄像头以及一个或多个计算机程序;其中,处理器与通信模块、存储器均耦合,上述一个或多个计算机程序被存储在存储器中,当电子设备运行时,该处理器执行该存储器存储的一个或多个计算机程序,以使电子设备执行上述第五方面中所述的拍摄方法。
第九方面,本申请提供一种云服务器,包括通信接口、一个或多个处理器、一个或多个存储器以及一个或多个计算机程序;其中,处理器与通信接口、存储器均耦合,上述一个或多个计算机程序被存储在存储器中,当云服务器运行时,该处理器执行该存储器存储的一个或多个计算机程序,以使云服务器执行上述第六方面中所述的拍摄方法。
第十方面,本申请提供一种拍摄系统,该拍摄系统可以包括上述第一电子设备和第二电子设备,第一电子设备和第二电子设备通过交互可执行上述所述的方法。或者,该拍摄系统可以包括上述第一电子设备、第二电子设备和云服务器,第一电子设备、第二电子设备和云服务器通过交互可执行上述所述的方法。
第十一方面,本申请提供一种计算机可读存储介质,包括计算机指令,当计算机指令在上述第一电子设备(或第二电子设备或云服务器)上运行时,使得第一电子设备(或第二电子设备或云服务器)执行上述所述的方法。
第十二方面,本申请提供一种计算机程序产品,当计算机程序产品在第一电子设备(或第二电子设备或云服务器)上运行时,使得第一电子设备(或第二电子设备或云服务器)执行上述所述的方法。
可以理解地,上述各个方面所提供的电子设备、拍摄系统、计算机可读存储介质以及计算机程序产品均应用于上文所提供的对应方法,因此,其所能达到的有益效果可参考上 文所提供的对应方法中的有益效果,此处不再赘述。
附图说明
图1为本申请实施例提供的单设备拍摄全景图像示意图;
图2为本申请实施例提供的多设备拍摄全景图像示意图;
图3为本申请实施例提供的电子设备的一种可能的硬件结构示意图;
图4本申请实施例提供的电子设备的软件结构框图;
图5A为本申请实施例提供的一种应用场景的示意图;
图5B为图5A所示意的应用场景中电子设备的软件结构框图;
图6为本申请实施例提供的又一种应用场景的示意图;
图7为本申请实施例一提供的全景图像的拍摄方法所对应的流程示意图;
图8为本申请实施例提供的第一电子设备显示的界面示例图;
图9为本申请实施例提供的预览命令和预览图像数据流的一种传输示意图;
图10为本申请实施例提供的拍摄命令和图像的一种传输示意图;
图11为本申请实施例二提供的全景图像的拍摄方法所对应的流程示意图;
图12为本申请实施例提供的预览命令和预览图像数据流的又一种传输示意图;
图13为本申请实施例提供的拍摄命令和图像的又一种传输示意图;
图14为本申请实施例提供的电子设备的一种结构示意图;
图15为本申请实施例提供的电子设备的又一种结构示意图;
图16为本申请实施例提供的云服务器的结构示意图。
具体实施方式
首先,对本申请实施例涉及的部分用语进行解释说明。
(1)电子设备:可以是包含至少一个摄像头(或者说具有拍摄功能)的便携式电子设备,诸如手机、平板电脑、车载设备,可穿戴设备等。上述便携式电子设备也可以是其它便携式电子设备,例如数码相机、膝上型计算机(laptop)。还应当理解的是,在其它一些可能的实施例中,上述电子设备也可以不是便携式电子设备,而是具有一个摄像头的台式计算机等,本申请实施例对电子设备的具体类型不作任何限制。
通常情况下,电子设备可以支持多种应用。比如以下应用中的一个或多个:相机应用、即时消息收发应用等。其中,即时消息收发应用可以有多种,比如微信、Welink等。用户通过即时消息收发应用,可以将文字、语音、图片、视频文件以及其他各种文件等信息发送给其他联系人;或者用户可以通过即时消息收发应用与其他联系人实现语音、视频通话等。应用可以是电子设备出厂时自带的应用,也可以是电子设备从网络侧下载并安装的应用,或者是电子设备接收其它电子设备发送的应用,本申请实施例不作限定。
(2)操作系统(operating system,OS):是运行在电子设备上的最基本的系统软件,例如
Figure PCTCN2021141343-appb-000001
以手机为例,操作系统可以是
Figure PCTCN2021141343-appb-000002
Figure PCTCN2021141343-appb-000003
Figure PCTCN2021141343-appb-000004
Figure PCTCN2021141343-appb-000005
Figure PCTCN2021141343-appb-000006
本申请实施例主要以
Figure PCTCN2021141343-appb-000007
为例进行介绍。本领域技术人员可以理解,其它操作系统中,也可以采用类似的算法实现。
(3)预览图像:是指电子设备的取景界面中显示的图像。比如,电子设备是手机时, 手机启动相机应用,打开摄像头,显示取景界面,该取景界面中显示预览图像。继续以手机为例,手机启动视频通话功能时,打开摄像头,显示取景界面,该取景界面中显示预览图像。本申请实施例中,预览图像可以为全景图像(此种情形下,预览图像可以称为预览全景图像),或,预览图像包括全景图像。
以上内容是与本申请相关的名称解释。下面结合附图介绍本申请实施例提供的技术方案。
如背景技术所述,越来越多的用户有拍摄全景图像的需求,因此,为满足用户拍摄全景图像的需求,目前提供有两种拍摄全景图像的方式。其中,方式一为:通过特殊的设备进行全景拍摄得到全景图像,该种方法操作简单,但是由于需要特殊的设备,从而导致成本较高。方式二为:先拍摄得到多个图像,然后将多个图像通过拼接来获得全景图像;进一步地,方式二又可以细分为单设备拍摄(或者说单机拍摄)和多设备拍摄。
其中,单设备拍摄是指,使用单设备的图像拍摄功能先后进行多次拍摄得到多个图像,然后将多个图像进行拼接得到全景图像。此种情形下,一次完整的全景拍摄可以包含多次普通拍摄,每一次拍摄之后会将图像数据进行算法合成,完成拼接,最后合成一个完整的全景图像。参见图1所示,为单设备拍摄全景图像示意图,如图1所示,在拍摄过程中,用户需要根据中心水平线进行对齐拍摄。采用该种方式,需要用户不断地对齐中心水平线,若用户未准确对齐中心水平线,则会导致拍摄的图像不在同一水平线,从而使得全景图像出现断层;而且,由于需要不断地拍摄并且裁剪图像,导致耗时较长、资源消耗较大;此外,由于多个图像是单设备在不同时刻拍摄得到的,比如多个图像包括图像1至图像3,图像1是在时刻t1拍摄得到的,图像2是在时刻t2拍摄得到的,图像3是在时刻t3拍摄得到的,因此,该方式适用于拍摄在时刻t1至时刻t3处于静止状态的画面,若画面在时刻t1至时刻t3发生了变化,则会导致合成得到的全景图像与实际画面不符,因此该方式无法拍摄非静止画面。
多设备拍摄是指,通过多个设备分别独立拍摄得到多个图像,然后将多个图像收集起来用拼接算法进行拼接得到全景图像。如图2所示,用户通过设备1拍摄得到一个图像,该图像中包括人物1和人物2,以及通过设备2拍摄得到一个图像,该图像中包括人物3和人物4,然后收集拷贝到设备3(一般是台式计算机等设备),用拼接算法或图片处理软件处理拼接成全景图像,该全景图像中包括人物1、人物2、人物3和人物4。采用该种方式,由于拍摄完成后需要后期处理,从而导致耗时较长;而且,拍摄非静止画面难度较大,需严格控制两个设备(比如设备1和设备2)在同一时间进行拍摄。
本申请实施例提供一种全景图像的拍摄方法,在该方法中,第一电子设备检测到用于拍摄全景图像的第一操作,响应于第一操作,可以获取m个第一图像,以及向第二电子设备发送至少一次拍摄命令,以使得第二电子设备可以根据至少一次拍摄命令获取m个第二图像;进而接收来自于第二电子设备的所述m个第二图像,根据m个第一图像和m个第二图像,拼接得到m个全景图像,并从m个全景图像中选择目标全景图像。如此,可以由第一电子设备控制至少一个第二电子设备拍摄,使得第一电子设备和至少一个第二电子设备能够在同一时间进行拍摄,从而可以适用拍摄静止画面的场景和拍摄非静止画面的场景。
需要说明的是,上述第一电子设备可以称为主控电子设备(或主设备),第二电子设 备可以称为从电子设备(或从设备);或者,第一电子设备可以称为本端电子设备,第二电子设备可以称为对端电子设备或远端电子设备,具体不做限定。示例性地,第一电子设备和第二电子设备可以为相同设备类型的电子设备,比如第一电子设备和第二电子设备均为手机,或者均为平板电脑。或者,第一电子设备和第二电子设备也可以为不同设备类型的电子设备,比如第一电子设备为手机,第二电子设备为平板电脑。此外,当至少一个第二电子设备包括多个第二电子设备(比如第二电子设备1、第二电子设备2)时,多个第二电子设备可以为相同类型的电子设备,比如多个第二电子设备均为手机,或者均为平板电脑。或者,多个第二电子设备也可以为不同设备类型的电子设备,比如第二电子设备1为手机,第二电子设备2为平板电脑。
下面对本申请实施例所涉及的电子设备的硬件结构进行描述。
图3为本申请实施例提供的电子设备的一种可能的硬件结构示意图。该电子设备可以为第一电子设备,或者也可以为第二电子设备。如图3所示,电子设备可以包括处理器110、外部存储器接口120、内部存储器121、通用串行总线(universal serial bus,USB)接口130、充电管理模块140、电源管理模块141、电池142、天线1、天线2、移动通信模块150、无线通信模块160、音频模块170、扬声器170A、受话器170B、麦克风170C、耳机接口170D、传感器模块180、按键190、马达191、指示器192、摄像头193、显示屏194、以及用户标识模块(subscriber identification module,SIM)卡接口195等。
处理器110可以包括一个或多个处理单元。例如:处理器110可以包括应用处理器(application processor,AP)、调制解调处理器、图形处理器(graphics processing unit,GPU)、图像信号处理器(image signal processor,ISP)、控制器、视频编解码器、数字信号处理器(digital signal processor,DSP)、基带处理器、和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,或者,两个或更多个不同的处理单元也可以集成在一个器件中。控制器可以是电子设备的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口、集成电路内置音频(inter-integrated circuit sound,I2S)接口、脉冲编码调制(pulse code modulation,PCM)接口、通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口、移动产业处理器接口(mobile industry processor interface,MIPI)、通用输入输出(general-purpose input/output,GPIO)接口、用户标识模块(subscriber identity module,SIM)接口、和/或通用串行总线(universal serial bus,USB)接口等。
USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口、Micro USB接口、USB Type C接口等。USB接口130可以用于连接充电器为电子设备充电,也可以用于电子设备与外围设备之间传输数据。USB接口130还可以用于连接耳机,通过耳机播放音频。该接口还可以用于连接其他电子设备。
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块140可以通过USB接口130接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块140可以通过电子设备的无线充电线圈接收无线充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为电子设备供电。
电源管理模块141用于连接电池142、充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110、内部存储器121、外部存储器、显示屏194、摄像头193和无线通信模块160等供电。电源管理模块141还可以用于监测电池容量、电池循环次数、电池健康状态(漏电、阻抗)等参数。在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。
电子设备的无线通信功能可以通过天线1、天线2、移动通信模块150、无线通信模块160、调制解调处理器以及基带处理器等实现。天线1和天线2用于发射和接收电磁波信号。电子设备中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。
移动通信模块150可以提供应用在电子设备上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器、开关、功率放大器、低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波、放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器170A,受话器170B等)输出声音信号,或通过显示屏194显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器110,与移动通信模块150或其他功能模块设置在同一个器件中。
无线通信模块160可以提供应用在电子设备上的包括无线局域网(wireless local area networks,WLAN)(如Wi-Fi网络)、蓝牙(bluetooth,BT)、全球导航卫星系统(global navigation satellite system,GNSS)、调频(frequency modulation,FM)、近距离无线通信技术(near field communication,NFC)、红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频、放大,经天线2转为电磁波辐射出去。
在一些实施例中,电子设备的天线1和移动通信模块150耦合,天线2和无线通信模 块160耦合,使得电子设备可以通过无线通信技术与网络以及其他设备通信。所述无线通信技术可以包括全球移动通讯系统(global system for mobile communications,GSM)、通用分组无线服务(general packet radio service,GPRS)、码分多址接入(code division multiple access,CDMA)、宽带码分多址(wideband code division multiple access,WCDMA)、时分码分多址(time-division code division multiple access,TD-SCDMA)、长期演进(long term evolution,LTE)、5G以及后续标准、BT、GNSS、WLAN、NFC、FM和/或IR技术等。所述GNSS可以包括全球卫星定位系统(global positioning system,GPS)、全球导航卫星系统(global navigation satellite system,GLONASS)、北斗卫星导航系统(beidou navigation satellite system,BDS)、准天顶卫星系统(quasi-zenith satellite system,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)。
电子设备通过GPU、显示屏194以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
显示屏194用于显示图像、视频等。显示屏194包括显示面板,显示面板可以采用液晶显示屏(liquid crystal display,LCD)、有机发光二极管(organic light-emitting diode,OLED)、有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED)、柔性发光二极管(flex light-emitting diode,FLED)、Miniled、MicroLed、Micro-oLed、量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,电子设备可以包括1个或N个显示屏194,N为大于1的正整数。
电子设备可以通过ISP、摄像头193、视频编解码器、GPU、显示屏194以及应用处理器等实现拍摄功能,比如拍摄全景图像。
ISP用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光、色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。
摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB、YUV等格式的图像信号。在一些实施例中,电子设备可以包括1个或N个摄像头193,N为大于1的正整数。
视频编解码器用于对数字视频压缩或解压缩。电子设备可以支持一种或多种视频编解码器。这样,电子设备可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1、MPEG2、MPEG3、MPEG4等。
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐、视频等文件保存在外部存储卡中。应理解,用户可以指定将图像(比如拍摄得到的全景图像)存储在内部存储器121还是外部存储器中。比如,电子设备当前与外部存储器连接时,若电子设备拍摄得到一个全景图像时,可以弹出提示信息,以提示用户将 全景图像存储在外部存储器还是内部存储器121;当然,还有其它的指定方式,本申请实施例不作限定;或者,电子设备检测到内部存储器121的内存量小于预设量时,可以自动将全景图像存储在外部存储器中。
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行电子设备的各种功能应用以及数据处理。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等。存储数据区可存储电子设备使用过程中所创建的数据(比如音频数据、电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、通用闪存存储器(universal flash storage,UFS)等。
传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。
另外,电子设备可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能,例如音乐播放,录音等。按键190包括开机键,音量键等。按键190可以是机械按键。也可以是触摸式按键。电子设备可以接收按键输入,产生与电子设备的用户设置以及功能控制有关的键信号输入。电子设备可以接收按键190输入,产生与电子设备的用户设置以及功能控制有关的键信号输入。电子设备可以利用马达191产生振动提示(比如来电振动提示)。电子设备中的指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。电子设备中的SIM卡接口195用于连接SIM卡。SIM卡可以通过插入SIM卡接口195,或从SIM卡接口195拔出,实现和电子设备的接触和分离。
可以理解的是,本发明实施例示意的结构并不构成对电子设备的具体限定。在本申请另一些实施例中,电子设备可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
下面对本申请实施例所涉及的电子设备的软件结构进行描述。
本申请实施例中电子设备的软件系统可以采用分层架构、事件驱动架构、微核架构、微服务架构、或云架构。本申请实施例以分层架构的Android操作系统为例,示例性说明电子设备的软件结构。当然,在其他操作系统中(例如鸿蒙系统、Linux系统等),只要各个功能模块实现的功能和本申请的实施例类似也能实现本申请的方案。
具体的,图4示出了本申请实施例的电子设备的一种软件结构框图,该电子设备可以为第一电子设备,或者也可以为第二电子设备。分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为五层,从上至下分别为应用程序层、应用程序框架(framework,FWK)层、安卓运行时(android runtime)和系统库、硬件抽象层(hardware abstract layer,HAL)以及内核层。下面分别对各层进行详细描述。
(1)应用程序层可以包括一系列应用程序包。如图4所示,应用程序层中可以安装通话、备忘录、浏览器、联系人、图库、日历、地图、蓝牙、音乐、视频、短信息等应用 (application,APP)。
在本申请实施例中,应用程序层中可以安装具有拍摄功能的应用,例如相机(camera)应用。相机应用处于整个相机系统框架的顶端,承担着与用户直接进行交互的责任,承接来自用户直接或者间接的比如预览/拍摄/录像等一系列具体的控制指令(或者说控制命令)。当接收到用户相关用户界面(user interface,UI)的操作后,便会通过应用编程接口(application programming interface,API)(比如camera API v2)将控制指令发送至相机框架(camera framework),并且等待相机框架的回传处理结果,其中包括图像数据,之后相机应用可以将结果以一定方式反馈给用户,比如在显示屏上显示图像。当然,其他应用需要使用拍摄功能时,也可以调用相机应用实现拍摄功能。
(2)应用程序框架层为应用程序层的应用提供应用编程接口(application programming interface,API)和编程框架。应用程序框架层可以包括一些预先定义的函数。如图4所示,应用程序框架层可以包括窗口管理器、内容提供器、视图系统、资源管理器、通知管理器等,本申请实施例对此不做限制。其中,上述窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。上述内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。上述视图系统可用于构建应用程序的显示界面。每个显示界面可以由一个或多个控件组成。一般而言,控件可以包括图标、按钮、菜单、选项卡、文本框、对话框、状态栏、导航栏、微件(Widget)等界面元素。上述资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。上述通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,振动,指示灯闪烁等。
在本申请实施例中,应用程序框架层可以包括相机框架。相机框架封装了camera API v2的实现细节,提供给相机应用进行调用,进而接收来自相机应用的控制指令,同时维护着该控制指令在内部流转的业务逻辑,最终通过调用接口(比如camera Android接口定义语言(Android interface definition language,AIDL)接口)将控制指令发送至相机服务(camera service)进行处理,并等待相机服务的回传处理结果,进而将最终结果发送至相机应用。
(3)Android runtime包括核心库和虚拟机,Android runtime负责安卓系统的调度和管理。其中,核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。系统库可以包括多个功能模块,例如:表面管理器(surface manager),三维图形处理库(例如:OpenGL ES),2D图形引擎(例如:SGL)等。其中,表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。三维图形处理库用于实现三维图形绘图,图像渲染,合成,和图层处理等。2D图形引擎是2D绘图的绘图引擎。
在本申请实施例中,系统库中可以包括相机服务。相机服务封装了camera AIDL接口的实现细节,提供给相机框架进行调用,进而接收来自相机框架的控制指令,同时内部维 护着该控制指令在该层的处理逻辑,最终通过调用接口(比如camera HAL3)将控制指令下发到相机HAL中,并且等待结果的回传,进而将结果上传至相机框架中。
(4)硬件抽象层是硬件和软件之间的一个过渡层,它的作用是硬件变更带来的改动都在此过渡层中来适配,以达到上层业务软件对于硬件变更无感知或只需少量改动即可在新的硬件平台上运行的目的。
在本申请实施例中,硬件抽象层可以包括相机HAL,相机HAL封装了camera HAL3接口的实现细节,提供给相机服务进行调用,接收来自相机服务的控制指令。进一步地,相机HAL接收到来自相机服务的控制指令后,可以将控制指令下发至相机驱动,并且等待相机驱动的结果回传,进而上报给相机服务。
(5)内核层至少包含显示驱动,音频驱动,传感器驱动。
在本申请实施例中,内核层可以包括相机驱动。相机驱动接收到来自相机HAL的控制指令后,可驱动摄像头等硬件设备来采集图像数据,并将采集到的图像数据上报给相机HAL。例如,摄像头可按照一定的帧率,将采集到的每一帧图像数据通过相机驱动传递给相机HAL。
针对于相机应用来说,以上所描述的控制指令在操作系统内部的传递过程可参见图4中控制流的具体传递过程,以及,以上所描述的图像数据在操作系统内部的传递过程可参见图4中数据流的具体传递过程。
下面对本申请实施例适用的应用场景进行描述。
图5A为本申请实施例适用的一种可能的应用场景的示意图,该应用场景中包括第一电子设备、至少一个第二电子设备(比如第二电子设备1、第二电子设备2),应理解:为了描述方便,本申请实施例中在第一电子设备与其他具有摄像头的电子设备连接并拍摄全景图像的时候,其他具有摄像头的电子设备都可以称为第二电子设备。
在该应用场景中,如图5B所示,可在第一电子设备的应用程序层中预先安装用于实现分布式拍摄功能的设备虚拟化(device virtualization,DV)应用。DV应用可作为系统应用常驻在第一电子设备中运行,或者,也可将DV应用实现的功能以系统服务的形式常驻在第一电子设备中运行。以及,可在第二电子设备的应用程序层预先安装用于实现分布式拍摄功能的代理应用。
当第一电子设备需要使用其他电子设备(比如至少一个第二电子设备,此处以一个第二电子设备为例进行描述)的摄像头实现分布式拍摄功能时,第一电子设备的DV应用可将第二电子设备作为第一电子设备的从设备与第一电子设备建立连接。如图5B所示,当第一电子设备与第二电子设备建立连接时,可以触发第二电子设备启动代理应用。进一步地,第一电子设备的DV应用可基于该连接获取第二电子设备的拍摄能力参数,该拍摄能力参数用于指示第二电子设备的拍摄能力。例如,该拍摄能力参数中可以包括第二电子设备支持的具体图像处理算法、第二电子设备中摄像头的相关硬件参数等。进而,第一电子设备的DV应用可调用HAL的预设接口,向预设接口中输入获取到的拍摄能力参数,从而在HAL中创建与第二电子设备对应的HAL。
本申请实施例中可将第一电子设备的DV应用按照第二电子设备的拍摄能力参数创建的HAL称为DMSDP(distributed mobile sensing development platform,分布式移动传感开发平台)HAL,也可称为虚拟相机HAL。与第一电子设备中传统的相机HAL不同的是, 虚拟相机HAL并不与第一电子设备实际的硬件设备相对应,而是与第一电子设备当前连接的第二电子设备对应。第一电子设备可作为主设备通过虚拟相机HAL与第二电子设备的代理应用进行控制指令(或图像数据)的传输,从而将第二电子设备作为第一电子设备的一个虚拟设备,与第二电子设备协同完成分布式拍摄场景中的各项业务。
此外,第一电子设备的DV应用除了在HAL中为第二电子设备创建对应的虚拟相机HAL之外,还可以将第二电子设备的拍摄能力参数发送至第一电子设备的相机服务进行保存,也即在相机服务中注册当前第二电子设备的拍摄能力。后续,当第一电子设备运行相机应用时,相机服务能够根据相机应用下发的控制指令(例如预览/拍摄/录像等控制指令),结合第二电子设备的拍摄能力实时确定拍摄过程中的拍摄策略。进而,相机服务可通过虚拟相机HAL向第二电子设备发送与拍摄策略对应的控制指令。
图6为本申请实施例适用的又一种可能的应用场景的示意图,该应用场景中包括第一电子设备、至少一个第二电子设备(比如第二电子设备1、第二电子设备2)和云服务器。其中,云服务器200可以包括一台或多台台式计算机,具体不做限定。
第一电子设备可以和云服务器进行通信,第二电子设备也可以和云服务器进行通信。示例性地,第一电子设备(或第二电子设备)可以通过移动通信网络和云服务器进行通信。移动通信网络可以为2G,3G,4G,5G或后续标准协议所定义的移动通信网络,具体不做限定。此外,第一电子设备可以通过云服务器与第二电子设备进行通信,比如第一电子设备通过云服务器向第二电子设备发送控制命令(如预览命令、拍摄命令等),具体来说,第一电子设备将控制命令发送给云服务器,云服务器接收到控制命令后,可以将控制命令发送给第二电子设备。
针对于该应用场景,在一种可能的实现方式中,多个电子设备(比如第一电子设备、至少一个第二电子设备)可以向云服务器进行注册,以第二电子设备1的注册过程为例,第二电子设备1可以向云服务器发送第二电子设备1的注册信息,注册信息包括第二电子设备1的能力信息(比如是否具有拍摄功能)、第二电子设备1的标识,第二电子设备1的标识可以为第二电子设备1的设备序列号,具体不做限定。如此,云服务器接收到第二电子设备1的注册信息后,可以存储第二电子设备1的注册信息。当第一电子设备需要使用其他电子设备的摄像头实现分布式拍摄功能(比如第一电子设备进入了全景模式)时,第一电子设备可以向云服务器发送查询请求,查询请求用于查询具有拍摄功能的电子设备,进而云服务器可以将具有拍摄功能的电子设备(这些电子设备可以理解为候选电子设备)的标识反馈给第一电子设备;进而,第一电子设备可以从候选电子设备中选择至少一个第二电子设备,或者,也可以由用户手动从候选电子设备中选择至少一个第二电子设备,具体不做限定。此种情形下,第一电子设备通过云服务器向第二电子设备发送控制命令,具体可以为:第一电子设备向云服务器发送控制命令和第二电子设备的标识,进而云服务器可以根据第二电子设备的标识,将控制命令发送给第二电子设备。
在又一种可能的实现方式中,云服务器中可以记录电子设备登录的账号以及电子设备是否具有拍摄功能。此种情形下,第一电子设备通过云服务器向第二电子设备发送控制命令,具体可以为:第一电子设备向云服务器发送控制命令,云服务器接收到控制命令后,可以查询与第一电子设备登录同一账号,且具有拍摄功能的第二电子设备,进而向第二电子设备发送控制命令。
需要说明的是,在图6所示意的应用场景中,由于第一电子设备与第二电子设备不是直接通信,而是通过云服务器进行通信,因此,第一电子设备的应用程序层中可以不安装DV应用,当然也可以安装DV应用,第二电子设备的应用程序层中可以不安装代理应用,当然也可以安装代理应用,本申请实施例具体不做限定。
基于上述描述,下面结合实施例一和实施例二对本申请实施例提供的全景图像的拍摄方法进行详细描述。
实施例一
在实施例一中,将基于图5A所示意的应用场景,描述一种可能的实现流程。
图7为本申请实施例一提供的全景图像的拍摄方法所对应的流程示意图。为便于描述,图7中将以第一电子设备与一个第二电子设备之间的交互为例进行描述,该流程也可以扩展到第一电子设备与多个第二电子设备之间的交互。如图7所示,该流程可以包括:
S701,第一电子设备检测到用于启动相机应用的操作(称为操作1)。
示例性地,第一电子设备的显示屏194显示主界面,主界面中包括各个应用程序的图标(比如相机应用图标)。第一电子设备通过设置于显示屏194上的触摸传感器180K检测用户在显示屏194上的操作,操作1可以是点击主界面中的相机应用图标的操作,参见图8中的(a)所示。当然,操作1还可以是其它可能的操作,比如在锁屏界面上滑的操作或者长按音量键的操作等,只要是能够启动相机应用的操作即可,本申请实施例不作限定。
S702,响应于操作1,第一电子设备启动相机应用,进入普通拍摄模式,并在取景界面显示预览图像,参见图8中的(b)所示。
此处,由于是普通拍摄模式,因此取景界面中显示的预览图像可以如图8中的(b)所示,此种情形下,预览图像不是全景图像。
S703,第一电子设备检测到用于进入全景模式的操作(称为操作2)。
示例性地,第一电子设备通过设置于显示屏194上的触摸传感器180K检测用户在显示屏194上的操作,操作2可以是点击“全景”的操作,参见图8中的(b)所示。可选的,操作2也包括语音指令或悬浮操作。
S704,响应于操作2,第一电子设备与第二电子设备建立连接。
作为一种可能的实现,响应于操作2,第一电子设备可以在显示屏上可以显示如图8中的(c)所示意的界面,该界面中可以包括一个或多个选项(比如“是否搜索其它设备”选项)。若用户触发“是”,则第一电子设备的DV应用可以触发第一电子设备搜索其他电子设备,并在搜索完毕后,显示如图8中的(d)所示意的界面,该界面中可以包括搜索到的其他电子设备(这些电子设备可以称为候选电子设备)的标识,比如第二电子设备的标识。示例性地,第二电子设备的标识可以包括第二电子设备的品牌信息、系列信息,或者也可以包括其它用于标识第二电子设备的信息,具体不做限定。若用户触发“第二电子设备的标识”,即用户从一个或多个候选电子设备中选择了第二电子设备,则第一电子设备可以与第二电子设备建立连接。
(1)针对上述搜索过程,第一电子设备可以通过蓝牙(或其他可能的方式,比如Wi-Fi,移动通信网络(例如2G,3G,4G,5G或后续标准协议所定义的移动通信网络),近距离通信协议(例如NFC)连接,红外线连接,超宽带(ultra wideband,UWB)连接,ZigBee(紫峰协议)来搜索其他电子设备,若第一电子设备通过蓝牙发现第二电子设备,则第一电子设备可以将第二电子设备作为候选电子设备。
或者,第一电子设备可以搜索与第一电子设备位于同一Wi-Fi网络中的电子设备。比如,第一电子设备可向同一Wi-Fi网络中的各个电子设备发送查询请求,触发接收到查询请求的电子设备向第一电子设备发送响应消息,响应消息中可以指示自身是否具有拍摄功能。那么,第一电子设备可以根据接收到的响应消息确定出当前Wi-Fi网络中具有拍摄功能的电子设备。进而,第一电子设备可将具有拍摄功能的电子设备作为候选电子设备。
又或者,可以在服务器中记录每个电子设备登录的账号以及每个电子设备是否具有拍摄功能。如此,第一电子设备可以在服务器中查询与第一电子设备登录同一账号(例如华为账号)的具有拍摄功能的电子设备。进而,第一电子设备可将查询到的电子设备作为候选电子设备。
又或者,第一电子设备中可安装用于管理家庭内智能家居设备(例如电视等)的应用。以智能家居应用举例,用户可以在智能家居应用中添加一个或多个智能家居设备,使得用户添加的智能家居设备与第一电子设备建立关联。例如,智能家居设备上可以设置包含设备标识等设备信息的二维码,用户使用第一电子设备的智能家居应用扫描该二维码后,可将对应的智能家居设备添加至智能家居应用中,从而建立智能家居设备与第一电子设备的关联关系。在本申请实施例中,当智能家居应用中添加的一个或多个智能家居设备上线时,例如,当第一电子设备检测到已添加智能家居设备发送的Wi-Fi信号时,第一电子设备可将该智能家居设备作为候选电子设备,并提示用户选择使用相应的智能家居设备与第一电子设备来拍摄全景图像。
可以理解地,第一电子设备也可以通过其他可能的方式来搜索其他电子设备,本申请实施例对第一电子设备搜索其他电子设备的具体实现可以不做限定。
(2)针对于上述连接建立过程,第一电子设备可以通过蓝牙与第二电子设备建立连接,或者,也可以通过Wi-Fi与第二电子设备建立连接。考虑到蓝牙的传输能力有限,为更好地实现第一电子设备和第二电子设备之间的通信,本申请实施例中将以第一电子设备通过Wi-Fi与第二电子设备建立连接为例进行描述。应理解,第一电子设备与第二电子设备之间建立的连接还可包括但不限于短距离无线连接(该短距离无线连接包括但不限于NFC连接,红外线连接,超宽带连接等)和移动通信网络连接(该移动通信网络包括但不限于支持2G,3G,4G,5G以及后续标准协议的移动通信网络)。
需要说明的是,上述S701至S704为一种可能的实现流程,在其它可能的实施例中,第一电子设备检测到用户触发图8中的(c)中所示意的功能按钮“是”后,第一电子设备可按照上述方法搜索具有拍摄功能的一个或多个电子设备。进而,手机可自动与搜索到的各个候选电子设备建立连接,并执行下述方法流程。此时,无需用户手动选择与第一电子设备建立连接的具体设备,第一电子设备也无需显示图8中的(d)所示意的界面。
或者,在用户触发搜索具有拍摄功能的电子设备之前,第一电子设备可能已经与一个或多个具有拍摄功能的电子设备建立了连接。例如,在用户点击图8中的(c)所示意的功能按钮“是”之前,第一电子设备已经与第二电子设备建立了蓝牙连接。后续,第一电子设备如果检测到用户点击功能按钮“是”,则第一电子设备可以不再执行搜索具有拍摄功能的电子设备以及与搜索到的电子设备建立连接的流程,而是执行下述方法流程。此时,无需用户手动选择与第一电子设备建立连接的具体设备,第一电子设备也无需显示图8中的(d)所示意的界面。
又或者,在用户打开相机应用的全景模式(即执行操作2)之前,第一电子设备可能 已经与一个或多个具有拍摄功能的电子设备建立了连接。例如,在用户打开第一电子设备的相机应用的全景模式之前,第一电子设备已经与第二电子设备建立了蓝牙连接。进而,第一电子设备在检测到用户打开相机应用后,可自动进入相机应用的全景模式,并执行下述方法流程。此时,无需用户手动开启全景模式,也无需用户手动选择与第一电子设备建立连接的具体设备,第一电子设备也无需显示图8中的(c)和(d)所示意的界面。
进一步地,第一电子设备和第二电子设备可以执行S705,其中,S705可以包括S705a、S705b、S705c、S705d和S705e。
S705a,第一电子设备获取预览图像数据流1,预览图像数据流1中包括k个第一预览图像,k为不小于1的整数。
S705b,第一电子设备向第二电子设备发送预览命令,相应地,第二电子设备接收到预览命令后,可以获取预览图像数据流2,预览图像数据流2中包括k个第二预览图像。
S705c,第二电子设备向第一电子设备发送预览图像数据流2,相应地,第一电子设备可以接收预览图像数据流2。
需要说明的是,上述S705a中第一电子设备获取的预览图像数据流1中的每个第一预览图像可以携带有时间信息(或时间戳),该时间信息用于指示第一预览图像的拍摄时间或采集时间。以及,上述S705c中第二电子设备发送给第一电子设备的预览图像数据流2中的每个第二预览图像也可以携带有时间信息,该时间信息用于指示第二预览图像的拍摄时间或采集时间。
S705d,第一电子设备对预览图像数据流1和预览图像数据流2中的图像进行帧同步,并对帧同步后的两个预览图像进行拼接,得到n个预览全景图像。
比如,预览图像数据流1包括第一预览图像1、第一预览图像2、第一预览图像3,预览图像数据流2包括第二预览图像1、第二预览图像2、第二预览图像3;其中,第一预览图像1的拍摄时间为t1,第一预览图像2的拍摄时间为t2,第一预览图像3的拍摄时间为t3;第二预览图像1的拍摄时间为t1,第二预览图像2的拍摄时间为t2,第二预览图像3的拍摄时间为t3。由于第一预览图像1的拍摄时间和第二预览图像1的拍摄时间相同(应理解,此处的拍摄时间相同并非是绝对相同,比如当二者的拍摄时间的差异在一定的范围之内时,均可以理解为拍摄时间相同),因此,第一电子设备可以认为第一预览图像1和第二预览图像1为帧同步的两个预览图像,进而针对第一预览图像1和第二预览图像1建立关联关系,以及可以针对第一预览图像2和第二预览图像2建立关联关系,针对第一预览图像3和第二预览图像3建立关联关系。进一步地,第一电子设备可以对第一预览图像1和第二预览图像1进行拼接,得到预览全景图像1;对第一预览图像2和第二预览图像2进行拼接,得到预览全景图像2;以及,对第一预览图像3和第二预览图像3进行拼接,得到预览全景图像3。
S705e,第一电子设备进入全景模式,并在取景界面显示n个预览全景图像。示例性地,第一电子设备可以在取景界面上实时显示n个预览全景图像,应理解n小于或等于k,且n为大于或等于1的整数。
需要说明的是,上述图8中的(b)和(e)所示意的预览图像仅为简单示例,具体实施中,预览图像可以填满整个取景界面,或者也可以占用取景界面中的一部分界面,具体不做限定。
S706,第一电子设备检测到用于拍摄全景图像的操作(称为操作3)。
示例性地,第一电子设备通过设置于显示屏194上的触摸传感器180K检测用户在显示屏194上的操作,操作3可以是点击快门图标的操作,参见图8中的(f)所示。
响应于操作3,第一电子设备和第二电子设备可以执行S707,其中,S707可以包括S707a、S707b、S707c、S707d和S707e。
S707a,第一电子设备获取m个第一图像,m为不小于1的整数。
此处,第一电子设备检测到用户执行了一次操作3后,第一电子设备的相机应用可以下发至少一次拍摄命令,进而第一电子设备可以获取m个第一图像,比如至少一次拍摄命令包括拍摄命令1、拍摄命令2、……、拍摄命令m,m个第一图像包括第一图像1、第一图像2、……、第一图像m。其中,一次拍摄命令可以对应一个第二图像。
S707b,第一电子设备向第二电子设备发送至少一次拍摄命令,相应地,第二电子设备根据至少一次拍摄命令获取m个第二图像。
此处,第一电子设备检测到用户执行了一次操作3后,第一电子设备的相机应用可以下发至少一次拍摄命令,如此,第一电子设备可以向第二电子设备发送至少一次拍摄命令,至少一次拍摄命令可以包括拍摄命令1、拍摄命令2、……、拍摄命令m。第二电子设备接收到至少一次拍摄命令后,可以获取m个第二图像,第二图像可以包括第二图像1、第二图像2、……、第二图像m。其中,一次拍摄命令可以对应一个第二图像。
S707c,第二电子设备向第一电子设备发送m个第二图像,相应地,第一电子设备可以接收m个第二图像。
需要说明的是,上述S707a中第一电子设备获取的每个第一图像可以携带有时间信息,该时间信息用于指示第一图像的拍摄时间。以及,上述S707c中第二电子设备发送给第一电子设备的每个第二图像也可以携带有时间信息,该时间信息用于指示第二图像的拍摄时间。
S707d,第一电子设备对m个第一图像和m个第二图像进行帧同步,并对帧同步的两个图像进行拼接,得到m个全景图像。进一步地,第一电子设备可以根据拼接全景图像时获取的两个图像的特征匹配值,从m个全景图像中选择一个目标全景图像。
应理解,此处第一电子设备获取到的第一图像和第二图像的个数是相同的,可选的,也可能不相同(比如第二电子设备在向第一电子设备传输m个第二图像时,可能出现某一个或某几个第二图像传输失败的情形,进而导致第二电子设备拍摄了m个第二图像,但传输给第一电子设备的第二图像少于m个)。
以第一电子设备获取到m个第一图像和m个第二图像为例,比如,m个第一图像包括第一图像1、第一图像2、第一图像3,m个第二图像包括第二图像1、第二图像2、第二图像3;其中,第一图像1的拍摄时间为t1,第一图像2的拍摄时间为t2,第一图像3的拍摄时间为t3;第二图像1的拍摄时间为t1,第二图像2的拍摄时间为t2,第二图像3的拍摄时间为t3。由于第一图像1的拍摄时间和第二图像1的拍摄时间相同(应理解,此处的拍摄时间相同并非是绝对相同,比如当二者的拍摄时间的差异在一定的范围之内时,均可以理解为拍摄时间相同),因此,第一电子设备可以认为第一图像1和第二图像1为帧同步的两个图像,进而针对第一图像1和第二图像1建立关联关系,以及可以针对第一图像2和第二图像2建立关联关系,针对第一图像3和第二图像3建立关联关系。进一步地,第一电子设备可以对第一图像1和第二图像1进行拼接,得到全景图像1;对第一图像2和第二图像2进行拼接,得到全景图像2;以及,对第一图像3和第二图像3进行拼 接,得到全景图像3。
进一步地,在第一电子设备对帧同步的两个图像进行拼接时,可以根据预设算法计算得到两个图像的特征匹配值,特征匹配值可以表征两个图像的拼接效果,比如特征匹配值越高说明两个图像的拼接效果越好。比如,在对第一图像1和第二图像1进行拼接时,可以得到第一图像1和第二图像1的特征匹配值(或者说全景图像1对应的特征匹配值)。如此,第一电子设备可以根据全景图像1、全景图像2和全景图像3对应的特征匹配值,选择特征匹配值最高的全景图像作为目标全景图像。或者,第一电子设备也可以从特征匹配值大于或等于第一阈值的全景图像中选择一个全景图像作为目标全景图像。其中,第一阈值可以根据实际需要进行设置。
上述是以第一电子设备根据全景图像对应的特征匹配值来确定目标全景图像为例进行描述的,在其它可能的实施例中,第一电子设备也可以依据其它参数来确定目标全景图像,本申请实施例对此不做限定。
需要说明的是,若第一电子设备获取到m个第一图像和f个第二图像的个数,比如m个第一图像包括第一图像1、第一图像2、第一图像3,f个第二图像包括第二图像1、第二图像2;其中,第一图像1和第二图像1为帧同步的两个图像,第一图像2和第二图像2为帧同步的两个图像,第一图像3没有帧同步的第二图像,则第一电子设备可以丢弃第一图像3,并对第一图像1和第二图像1进行拼接,得到全景图像1;以及对第一图像2和第二图像2进行拼接,得到全景图像2。进而,可以根据全景图像1和全景图像2对应的特征匹配值选择目标全景图像。
S707e,第一电子设备显示目标全景图像,参见图8中的(g)所示。
示例性地,第一电子设备可以在检测到用户点击功能按钮“保存”后,将目标全景图像保存到第一电子设备的存储器中。
在其它可能的实施例中,第一电子设备在获得目标全景图像后,也可以自动保存,而无需用户手动执行保存操作;可选地,在用户执行查看操作后,第一电子设备显示目标全景图像。
需要说明的是:(1)S707中拍摄得到全景图像与S705中的预览全景图像可能是相同,或者可能是不相同的,具体不做限定。
(2)本申请实施例对显示目标全景图像的方式不做限定,比如在其它可能的实施例中,参见图8中的(h)所示,显示界面上可以包括多个窗口,比如显示界面上包括三个窗口,分别为窗口1、窗口2和窗口3,其中,窗口1用于显示第一电子设备拍摄得到的第一图像,窗口2用于显示第二电子设备拍摄得到的第二图像,窗口3用于显示拼接得到的目标全景图像。或者,显示界面所包括的窗口个数可以与参与分布式拍摄的设备的个数相同,比如参与分布式拍摄的设备包括第一电子设备和第二电子设备,则显示界面可以显示两个窗口,其中一个窗口用于显示第一电子设备拍摄得到的第一图像,另一个窗口用于显示第二电子设备拍摄得到的第二图像,而目标全景图像可以显示在另一界面上,用户可以通过滑动屏幕来查看显示在另一界面上的目标全景图像。或者,显示界面所包括的窗口个数可以大于参与分布式拍摄的设备的个数,例如,参与分布式拍摄的设备包括第一电子设备和第二电子设备,则显示界面可以显示三个窗口(参见图8中的(h)),其中一个窗口用于显示第一电子设备拍摄得到的第一图像,另一个窗口用于显示第二电子设备拍摄得到的第二图像,再一个窗口显示目标全景图像。
可以理解地,本申请实施例对上述显示预览图像的方式也可以不做限定,比如也可以采用类似图8中的(h)所示意的方式,即取景界面可以包括三个窗口,分别为窗口1、窗口2和窗口3,在窗口1显示第一电子设备拍摄得到的第一预览图像,在窗口2显示第二电子设备拍摄得到的第二预览图像,以及在窗口3显示拼接得到的预览全景图像。
(3)本申请实施例中的目标全景图像是针对某一场景来说的,该场景中的画面可以是静止画面,或者也可以是非静止画面。比如目标全景图像是根据至少一个第一图像中的第一目标图像和至少一个第二图像中的第二目标图像拼接得到的,则第一目标图像可以是针对目标场景的一部分画面(称为第一画面)进行拍摄得到的,第二目标图像是针对目标场景的另一部分画面(称为第二画面)进行拍摄得到的。其中,第一画面和第二画面可以存在部分重叠(比如第一画面包括人物1、人物2和人物3,第二画面包括人物2、人物3和人物4),或者第一画面和第二画面是相邻且不重叠的(比如第一画面包括人物1和人物2,第二画面包括人物3和人物4),具体不做限定。
采用上述方法,可以使用多个电子设备(比如上述第一电子设备和第二电子设备)来分别拍摄多个图像,进而拼接得到全景图像。其中一个电子设备为主控电子设备,其它电子设备为从电子设备,由主控电子设备控制从电子设备执行拍摄操作,使得多个设备可以在同一时间进行拍摄,从而可以适用拍摄静止画面的场景和拍摄非静止画面的场景。此外,一方面,用户执行一次操作(比如上述操作3),即可获取到全景图像,相比于上述单设备拍摄需要用户进行多次拍摄来获得全景图像的方式来说,能够有效提高用户体验。又一方面,由于可以使用多个电子设备来拍摄多个图像,从而能够拍摄角度更大的全景图像,充分满足用户的需求。又一方面,由于还可以使用多个电子设备来分别获取预览图像数据流,以及在主控电子设备的取景界面显示预览全景图像,从而使得用户可以通过观看预览全景图像,确定合适的拍摄时机。又一方面,由于可以通过主控电子设备的相机应用来对多个图像进行拼接得到全景图像,从而使得耗时较短,响应较快。
基于图4和图5B所示意的软件结构,下面结合图9对上述S705的实现进行描述。如图9所示,S705的实现可以包括两个阶段,分别为阶段一和阶段二,阶段一为预览命令传输阶段;阶段二为预览图像数据流传输阶段。
(1)阶段一
针对于第一电子设备:第一电子设备中的相机应用可以向相机框架发送预览命令,比如相机应用通过调用camera API v2向相机框架发送预览命令。相机框架接收到预览命令后,可以向相机服务发送预览命令,比如相机框架通过调用camera AIDL接口向相机服务发送预览命令。相机服务接收到预览命令后,可以向相机HAL发送预览命令,以及向虚拟相机HAL发送预览命令。相机HAL接收到预览命令后,可以向相机驱动发送预览命令,进而相机驱动接收到预览命令后,可以调用摄像头采集预览图像数据流(称为预览图像数据流1)。虚拟相机HAL接收到预览命令后,可以向第二电子设备的代理应用发送预览命令。
针对于第二电子设备:第二电子设备的代理应用接收到预览命令后,可以向第二电子设备的相机框架发送预览命令。第二电子设备的相机框架接收到预览命令后,可以向相机服务发送预览命令。相机服务接收到预览命令后,可以向相机HAL发送预览命令。相机HAL接收到预览命令后,可以向相机驱动发送预览命令,进而相机驱动接收到预览命令后,可以调用摄像头采集预览图像数据流(称为预览图像数据流2)。
(2)阶段二
针对于第二电子设备:第二电子设备中的相机HAL获取预览图像数据流2,并将预览图像数据流2发送给相机服务。相机服务接收到预览图像数据流2后,将预览图像数据流2发送给相机框架。相机框架接收到预览图像数据流2后,可以向第二电子设备的代理应用发送预览图像数据流2。第二电子设备的代理应用接收到预览图像数据流2后,可以向第一电子设备的虚拟相机HAL发送预览图像数据流2。
针对于第一电子设备:第一电子设备的相机HAL获取预览图像数据流1,并将预览图像数据流1发送给相机服务。第一电子设备的虚拟相机HAL接收到预览图像数据流2后,可以将预览图像数据流2发送给相机服务。相机服务接收到预览图像数据流1和预览图像数据流2后,可以将预览图像数据流1和预览图像数据流2发送给相机框架。相机框架接收到预览图像数据流1和预览图像数据流2后,可以根据预览图像数据流1中每个预览图像(一个预览图像可以理解为一个帧)的时间信息以及预览图像数据流2中每个预览图像的时间信息进行帧同步。相机框架将帧同步后的预览图像数据流1和预览图像数据流2发送给相机应用。相机应用接收到帧同步后的预览图像数据流1和预览图像数据流2后,针对帧同步的两个预览图像(比如第一预览图像1和第二预览图像1),可以采用全景图像拼接算法进行拼接得到预览全景图像(比如预览全景图像1),进而在取景界面显示预览全景图像1。
作为一种可能的实现,相机应用在采用全景图像拼接算法对第一预览图像1和第二预览图像1进行拼接时,可以计算得到第一预览图像1和第二预览图像1的特征匹配值,若确定第一预览图像1和第二预览图像1的特征匹配值小于第二阈值,则可以显示提示信息,该提示信息可以用于提示用户调整第一电子设备和/或第二电子设备的拍摄角度和/或位置。其中,第二阈值可以根据实际需要进行设置。
需要说明的是:上述是以相机框架执行帧同步为例进行描述的,在其它可能的实施例中,也可以由其它模块执行帧同步。比如,可以由相机服务执行帧同步,或者也可以由相机应用执行帧同步,本申请实施例中对执行帧同步的模块可以不做限定。
基于图4和图5B所示意的软件结构,下面结合图10对上述S707的实现进行描述。如图9所示,S707的实现可以包括两个阶段,分别为阶段一和阶段二,阶段一为拍摄命令传输阶段;阶段二为图像传输阶段。
(1)阶段一
针对于第一电子设备:第一电子设备中的相机应用可以向相机框架发送至少一次拍摄命令,比如拍摄命令1、拍摄命令2、……、拍摄命令n,此处以拍摄命令1为例进行描述。相机框架接收到拍摄命令1后,可以向相机服务发送拍摄命令1。相机服务接收到拍摄命令1后,可以向相机HAL发送拍摄命令1,以及向虚拟相机HAL发送拍摄命令1。相机HAL接收到拍摄命令1后,可以向相机驱动发送拍摄命令1,进而相机驱动接收到拍摄命令1后,可以调用摄像头采集第一图像1(对应拍摄命令1)。虚拟相机HAL接收到拍摄命令1后,可以向第二电子设备的代理应用发送拍摄命令1。
针对于第二电子设备:第二电子设备的代理应用接收到拍摄命令1后,可以向第二电子设备的相机框架发送拍摄命令1。第二电子设备的相机框架接收到拍摄命令1后,可以向相机服务发送拍摄命令1。相机服务接收到拍摄命令1后,可以向相机HAL发送拍摄命令1。相机HAL接收到拍摄命令1后,可以向相机驱动发送拍摄命令1,进而相机驱动接收到拍摄命令1后,可以调用摄像头采集第二图像1(对应拍摄命令1)。
(2)阶段二
针对于第二电子设备:第二电子设备中的相机HAL获取m个第二图像(比如拍摄命令1对应的第二图像1、拍摄命令2对应的第二图像2、……、拍摄命令m对应的第二图像m,图10中是以第二图像1为例进行示意的),并将m个第二图像发送给相机服务;相机服务接收到m个第二图像后,将m个第二图像发送给相机框架;相机框架接收到m个第二图像后,可以向第二电子设备的代理应用发送m个第二图像,第二电子设备的代理应用接收到m个第二图像后,可以向第一电子设备的虚拟相机HAL发送m个第二图像。
针对于第一电子设备:第一电子设备中的相机HAL获取m个第一图像(比如拍摄命令1对应的第一图像1、拍摄命令2对应的第一图像2、……、拍摄命令m对应的第一图像m,图10中是以第一图像1为例进行示意的),并将m个第一图像发送给相机服务;相机服务接收到m个第一图像后,将m个第一图像发送给相机框架;相机框架接收到m个第一图像后可以将m个第一图像放入缓存队列。以及,第一电子设备中的虚拟相机HAL接收m个第二图像后,可以将m个第二图像发送给相机服务。相机服务接收到m个第二图像后,将m个第二图像发送给相机框架。进一步地,相机框架对m个第一图像和m个第二图像进行帧同步。相机框架将帧同步的m个第一图像和m个第二图像发送给相机应用。相机应用可以对帧同步的两个图像进行拼接得到全景图像。进一步地,相机应用在对两个图像进行拼接时,可以得到两个图像的特征匹配值,并根据特征匹配值确定目标全景图像,进而显示目标全景图像。
实施例二
在实施例二中,将基于上述图6所示意的应用场景,描述一种可能的实现流程。
图11为本申请实施例二提供的全景图像的拍摄方法所对应的流程示意图。为便于描述,图11中将以第一电子设备与一个第二电子设备之间的交互为例进行描述,该流程也可以扩展到第一电子设备与多个第二电子设备之间的交互。如图11所示,该流程可以包括:
S1101,第一电子设备检测到用于启动相机应用的操作(称为操作1),参见图8中的(a)所示。
S1102,响应于操作1,第一电子设备启动相机应用,进入普通拍摄模式,并在取景界面显示预览图像,参见图8中的(b)所示。
S1103,第一电子设备检测到用于进入全景模式的操作(称为操作2)。
响应于操作2,第一电子设备、第二电子设备和云服务器可以执行S1104,其中,S1104可以包括S1104a至S1104g。
S1104a,第一电子设备获取预览图像数据流1,预览图像数据流1中包括k个第一预览图像。
S1104b,第一电子设备向云服务器发送预览命令;相应地,云服务器接收到预览命令后,将预览命令发送给第二电子设备。
S1104c,第二电子设备从云服务器接收到预览命令后,可以获取预览图像数据流2,预览图像数据流2中包括k个第二预览图像。
S1104d,第一电子设备向云服务器发送预览图像数据流1,相应地,云服务器可以接收预览图像数据流1。
S1104e,第二电子设备向云服务器发送预览图像数据流2,相应地,云服务器可以接收预览图像数据流2。
S1104f,云服务器对预览图像数据流1和预览图像数据流2中的图像进行帧同步,并对帧同步后的两个图像(比如第一预览图像1和第二预览图像1)进行拼接得到预览全景图像,并将预览全景图像发送给第一电子设备。
示例性地,云服务器可以获取第一预览图像1和第二预览图像1的特征匹配值,若确定第一预览图像1和第二预览图像1的特征匹配值小于第二阈值,则还可以向第一电子设备发送指示信息,指示信息用于指示第一预览图像1和第二预览图像1的特征匹配值小于第二阈值;进而,第一电子设备可以根据指示信息,显示提示信息,提示信息用于提示用户调整所述第一电子设备和/或所述第二电子设备的拍摄角度和/或位置。或者,云服务器也可以将第一预览图像1和第二预览图像1的特征匹配值发送给第一电子设备,进而,第一电子设备确定特征匹配值小于第二阈值后,可以显示提示信息。
S1104g,第一电子设备接收预览全景图像,进入全景模式,并在取景界面显示预览全景图像,参见图8中的(e)所示。
S1105,第一电子设备检测到用于拍摄全景图像的操作(称为操作3)。
响应于操作3,第一电子设备、第二电子设备和云服务器可以执行S1106,其中,S1106可以包括S1106a至S1106f。
S1106a,第一电子设备获取m个第一图像。
S1106b,第一电子设备向云服务器发送至少一次拍摄命令;相应地,云服务器接收到至少一次拍摄命令后,将至少一次拍摄命令发送给第二电子设备。
S1106c,第二电子设备可以接收至少一次拍摄命令,并根据至少一次拍摄命令获取m个第二图像。
S1106d,第一电子设备向云服务器发送m个第一图像,相应地,云服务器可以接收m个第一图像。
S1106e,第二电子设备向云服务器发送m个第二图像,相应地,云服务器可以接收m个第二图像。
S1106f,云服务器对m个第一图像和m个第二图像进行帧同步,并对帧同步的两个图像进行拼接,得到m个全景图像。进一步地,云服务器可以从m个全景图像中选择一个目标全景图像,并将目标全景图像发送给第一电子设备。
S1106g,第一电子设备显示目标全景图像,参见图8中的(g)所示。
需要说明的是,上文中是以云服务器从m个全景图像中选择一个目标全景图像并发送给第一电子设备为例进行描述,在其它可能的实施例中,云服务器也可以将m个全景图像(以及对应的特征匹配值)发送给第一电子设备,由第一电子设备从m个全景图像中选择一个目标全景图像。或者,上文中是以云服务器根据m个第一图像和m个第二图像拼接得到m个全景图像为例进行描述的,在其它可能的实施例中,云服务器接收到第二电子设备发送的m个第二图像后,可以将m个第二图像发送给第一电子设备,进而由第一电子设备根据m个第一图像和m个第二图像拼接得到m个全景图像,并从m个全景图像中选择一个目标全景图像(此种情形下,第一电子设备获取m个第一图像后,可以不发送给云服务器)。类似地,也可以由第一电子设备对预览图像数据流1和预览图像数据流2中的图像进行拼接。
采用上述方法,可以使用多个电子设备(比如上述第一电子设备和第二电子设备)来拍摄多个图像,多个图像可以拼接得到全景图像。其中一个电子设备为主控电子设备,其 它电子设备为从电子设备,由主控电子设备控制从电子设备执行拍摄操作,使得多个设备可以在同一时间进行拍摄,从而可以适用拍摄静止画面的场景和拍摄非静止画面的场景;此外,由于可以通过云服务器对多个图像进行拼接得到全景图像,从而能够有效降低主控电子设备的处理负担。
基于图4所示意的软件结构,下面结合图12对上述S1104的实现进行描述。如图12所示,S1104的实现可以包括两个阶段,分别为阶段一和阶段二,阶段一为预览命令传输阶段;阶段二为预览图像数据流传输阶段。
(1)阶段一
针对于第一电子设备:第一电子设备中的相机应用可以向相机框架发送预览命令。相机框架接收到预览命令后,可以向相机服务发送预览命令。相机服务接收到预览命令后,可以向相机HAL发送预览命令。相机HAL接收到预览命令后,可以向相机驱动发送预览命令,进而相机驱动接收到预览命令后,可以调用摄像头采集预览图像数据流(称为预览图像数据流1)。以及,第一电子设备中的相机应用还可以向云服务器发送预览命令。
针对于云服务器:云服务器接收到第一电子设备中的相机应用发送的预览命令后,可以向第二电子设备中的相机应用发送预览命令。
针对于第二电子设备:第二电子设备的相机应用接收到云服务器发送的预览命令后,可以向第二电子设备的相机框架发送预览命令。第二电子设备的相机框架接收到预览命令后,可以向相机服务发送预览命令。相机服务接收到预览命令后,可以向相机HAL发送预览命令。相机HAL接收到预览命令后,可以向相机驱动发送预览命令,进而相机驱动接收到预览命令后,可以调用摄像头采集预览图像数据流(称为预览图像数据流2)。
(2)阶段二
针对于第一电子设备:第一电子设备的相机HAL获取预览图像数据流1,并将预览图像数据流1发送给相机服务。相机服务接收到预览图像数据流1后,将预览图像数据流1发送给相机框架。相机框架接收到预览图像数据流1后,将预览图像数据流1发送给相机应用。相机应用接收到预览图像数据流1后,可以将预览图像数据流1发送给云服务器。
针对于第二电子设备:第二电子设备中的相机HAL获取预览图像数据流2,并将预览图像数据流2发送给相机服务。相机服务接收到预览图像数据流2后,将预览图像数据流2发送给相机框架。相机框架接收到预览图像数据流2后,可以向相机应用发送预览图像数据流2。相机应用接收到预览图像数据流2后,可以向云服务器发送预览图像数据流2。
针对于云服务器:云服务器接收到预览图像数据流1和预览图像数据流2后,可以对预览图像数据流1和预览图像数据流1中的图像进行帧同步。针对帧同步的两个图像(比如第一预览图像1和第二预览图像1),可以采用全景图像拼接算法进行拼接得到预览全景图像,并将预览全景图像发送给第一电子设备,进而第一电子设备可以在显示屏的取景界面显示预览全景图像。
基于图4所示意的软件结构,下面结合图13对上述S1106的实现进行描述。如图13所示,S1106的实现可以包括两个阶段,分别为阶段一和阶段二,阶段一为拍摄命令传输阶段;阶段二为图像传输阶段。
(1)阶段一
针对于第一电子设备:第一电子设备中的相机应用可以向相机框架发送至少一次拍摄命令,比如拍摄命令1、拍摄命令2、……、拍摄命令m,此处以拍摄命令1为例进行描 述。相机框架接收到拍摄命令1后,可以向相机服务发送拍摄命令1。相机服务接收到拍摄命令1后,可以向相机HAL发送拍摄命令1。相机HAL接收到拍摄命令1后,可以向相机驱动发送拍摄命令1,进而相机驱动接收到拍摄命令1后,可以调用摄像头采集第一图像1(对应拍摄命令1)。以及,第一电子设备中的相机应用还可以向云服务器发送至少一次拍摄命令,比如拍摄命令1、拍摄命令2、……、拍摄命令m,此处以拍摄命令1为例进行描述。
针对于云服务器:云服务器接收到第一电子设备中的相机应用发送的拍摄命令1后,可以向第二电子设备中的相机应用发送拍摄命令1。
针对于第二电子设备:第二电子设备的相机应用接收到云服务器发送的拍摄命令1后,可以向第二电子设备的相机框架发送拍摄命令1。第二电子设备的相机框架接收到拍摄命令1后,可以向相机服务发送拍摄命令1。相机服务接收到拍摄命令1后,可以向相机HAL发送拍摄命令1。相机HAL接收到拍摄命令1后,可以向相机驱动发送拍摄命令1,进而相机驱动接收到拍摄命令1后,可以调用摄像头采集第二图像1(对应拍摄命令1)。
(2)阶段二
针对于第一电子设备:第一电子设备的相机HAL获取第一图像1,并将第一图像1发送给相机服务。相机服务接收到第一图像1后,将第一图像1发送给相机框架。相机框架接收到第一图像1后,将第一图像1发送给相机应用。相机应用接收到第一图像1后,可以向云服务器发送第一图像1。此外,第一电子设备还可以获取其它第一图像(比如第一图像2、第一图像3、……、第一图像m),并向云服务器发送第一图像2、第一图像3、……、第一图像m。
针对于第二电子设备:第二电子设备中的相机HAL获取第二图像1,并将第二图像1发送给相机服务。相机服务接收到第二图像1后,将第二图像1发送给相机框架。相机框架接收到第二图像1后,可以向相机应用发送第二图像1。相机应用接收到第二图像1后,可以向云服务器发送第二图像1。此外,第二电子设备还可以获取其它第二图像(比如第二图像2、第二图像3、……、第二图像m),并向云服务器发送第二图像2、第二图像3、……、第二图像m。
针对于云服务器:云服务器接收到第一电子设备的相机应用发送的m个第一图像和第二电子设备的相机应用发送的m个第二图像后,可以对m个第一图像和m个第二图像进行帧同步,比如第一图像1和第二图像1帧同步,第一图像2和第二图像2帧同步,以此类推。云服务器可以对帧同步的两个图像进行拼接得到全景图像,比如对第一图像1和第二图像1进行拼接得到全景图像1,对第一图像2和第二图像2进行拼接得到全景图像2,以此类推;如此,云服务器可以得到全景图像1、全景图像2、……全景图像m。进一步地,云服务器在对两个图像进行拼接时,可以得到两个图像的特征匹配值,若确定全景图像1对应的特征匹配值(即第一图像1和第二图像1的特征匹配值)大于或等于其它全景图像(比如全景图像2、……全景图像m)对应的特征匹配值,则可以将全景图像1作为目标全景图像,并发送给第一电子设备。
针对上述实施例一和实施例二,需要说明的是:
(1)上述实施例一和实施例二中是以拍摄全景图像为例进行描述的,本申请实施例中的方法也可以扩展到全景录像的场景,比如第一电子设备检测到用户可以点击全景录像的图标后,第一电子设备的相机应用可以下发录像命令,进而第一电子设备可 以拍摄得到数据流1(包括多个图像),以及第二电子设备可以拍摄得到数据流2(包括多个图像),数据流1和数据流2可以拼接得到全景录像数据流(或全景视频流),进而第一电子设备可以播放全景视频。如此,用户在观看演唱会或者足球比赛的时候,可以使用多台设备组成的分布式相机进行录像,进而可以将更宽阔的场景录制进来,进行直播或者记录下来以后观看。
(2)实施例一和实施例二所描述的各个流程图的步骤编号仅为执行流程的一种示例,并不构成对步骤执行的先后顺序的限制,本申请实施例中相互之间没有时序依赖关系的步骤之间没有严格的执行顺序。此外,各个流程图中所示意的步骤并非全部是必须执行的步骤,可以根据实际需要在各个流程图的基础上增添或者删除部分步骤。
(3)上述侧重描述了实施例一和实施例二中不同实施例之间的差异之处,除差异之处的其它内容,实施例一和实施例二之间可以相互参照。
(4)上述实施例一中,第一电子设备与第二电子设备可以通过第一电子设备与第二电子设备之间的连接进行通信,上述实施例二中,第一电子设备与第二电子设备之间通过可以云服务器进行通信。此外,本领域技术人员也可以基于上述实施例一和实施例二进行适应性变形,比如在控制命令(比如预览命令、拍摄命令)传输阶段,第一电子设备和第二电子设备可以通过第一电子设备与第二电子设备之间的连接传输控制命令,而在数据(比如预览图像数据流、拍摄得到的图像)传输阶段,第一电子设备可以将预览图像数据流1(或第一图像1)发送给云服务器,第二电子设备可以将预览图像数据流2(或第二图像1)发送给云服务器,具体不做限定。
(5)上述实施例中是以Android系统为例阐述的各个功能模块之间实现分布式拍摄功能的具体方法,可以理解的是,也可以在其他操作系统(例如鸿蒙系统等)中设置相应的功能模块实现上述方法。只要各个设备和功能模块实现的功能和本申请的实施例类似,即属于本申请权利要求及其等同技术的范围之内。
如图14所示,本申请实施例公开了一种电子设备,该电子设备可以为上述第一电子设备或主电子设备(例如手机)。该电子设备具体可以包括:触摸屏1401,所述触摸屏1401包括触摸传感器1406和显示屏1407;一个或多个处理器1402;存储器1403;通信模块1408;一个或多个摄像头1409;一个或多个应用程序(未示出);以及一个或多个计算机程序1404,上述各器件可以通过一个或多个通信总线1405连接。其中,上述一个或多个计算机程序1404被存储在上述存储器1403中并被配置为被该一个或多个处理器1402执行,该一个或多个计算机程序1404包括指令,该指令可以用于执行上述实施例中第一电子设备执行的相关步骤。
如图15所示,本申请实施例公开了一种电子设备,该电子设备可以为上述第二电子设备或从电子设备(例如手机、智慧大屏、平板电脑、车载设备)。该电子设备具体可以包括:一个或多个处理器1502;存储器1503;通信模块1506;一个或多个应用程序(未示出);一个或多个摄像头1501;以及一个或多个计算机程序1504,上述各器件可以通过一个或多个通信总线1505连接。当然,从设备中也可以设置触摸屏等器件,本申请实施例对此不做任何限制。其中,上述一个或多个计算机程序1504被存储在上述存储器1503中并被配置为被该一个或多个处理器1502执行,该一个或多个计算机程序1504包括指令,该指令可以用于执行上述实施例中从设备执行的相关步骤。
如图16所示,本申请实施例公开了一种云服务器。该云服务器可以包括通信接口1601、 处理器1602和存储器1603。进一步地,该云服务器还可以进一步包括总线系统,其中,处理器1602、存储器1603、通信接口1601可以通过总线系统相连。
处理器1602可以是一个芯片。例如,该处理器1602可以是现场可编程门阵列(field programmable gate array,FPGA),可以是专用集成芯片(application specific integrated circuit,ASIC),还可以是系统芯片(system on chip,SoC),还可以是中央处理器(central processor unit,CPU),还可以是网络处理器(network processor,NP),还可以是DSP,还可以是微控制器(micro controller unit,MCU),还可以是可编程控制器(programmable logic device,PLD)或其他集成芯片。存储器1603可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。通信接口1601,可以用于输入和/或输出信息。一种可选地实施方案中,当云服务器包括有收发器,则通信接口1601所执行的方法步骤也可以由收发器来执行。
其中,存储器1603用于存储执行本申请实施例的指令。处理器1602用于执行存储器1603中存储的指令,从而实现本申请实施例中提供的方法。或者,可选地,本申请实施例中,也可以是处理器1602执行本申请实施例提供的方法中的处理相关的功能,通信接口1601负责与其他设备或通信网络通信,本申请实施例对此不做具体限定。可选地,本申请实施例中的指令也可以称之为应用程序代码或计算机程序,本申请实施例对此不做具体限定。
以上实施例中所用,根据上下文,术语“当…时”或“当…后”可以被解释为意思是“如果…”或“在…后”或“响应于确定…”或“响应于检测到…”。类似地,根据上下文,短语“在确定…时”或“如果检测到(所陈述的条件或事件)”可以被解释为意思是“如果确定…”或“响应于确定…”或“在检测到(所陈述的条件或事件)时”或“响应于检测到(所陈述的条件或事件)”。另外,在上述实施例中,使用诸如第一、第二之类的关系术语来区份一个实体和另一个实体,而并不限制这些实体之间的任何实际的关系和顺序。
在本说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本发明实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介 质(例如固态硬盘Solid State Disk(SSD))等。在不冲突的情况下,以上各实施例的方案都可以组合使用。

Claims (12)

  1. 一种全景图像的拍摄方法,其特征在于,所述方法适用于第一电子设备,所述方法包括:
    检测到用于拍摄全景图像的第一操作;
    响应于所述第一操作,获取m个第一图像,以及向第二电子设备发送至少一次拍摄命令,以使所述第二电子设备根据所述至少一次拍摄命令获取m个第二图像,m为不小于1的整数;
    接收来自于所述第二电子设备的所述m个第二图像;
    根据所述m个第一图像和所述m个第二图像,拼接得到m个全景图像;
    从所述m个全景图像中,选择一个目标全景图像;其中,所述m个第一图像包括第一目标图像,所述m个第二图像包括第二目标图像,所述目标全景图像是根据所述第一目标图像和所述第二目标图像拼接得到的。
  2. 根据权利要求1所述的方法,其特征在于,所述第一目标图像和所述第二目标图像的特征匹配值大于或等于第一阈值。
  3. 根据权利要求1或2所述的方法,其特征在于,所述方法还包括:
    在第一窗口显示所述目标全景图像。
  4. 根据权利要求3所述的方法,其特征在于,所述方法还包括:
    在第二窗口显示所述第一目标图像,以及在第三窗口显示所述第二目标图像;
    其中,所述第一窗口、所述第二窗口和所述第三窗口位于同一显示界面。
  5. 根据权利要求1至4中任一项所述的方法,其特征在于,向第二电子设备发送至少一次拍摄命令,包括:
    通过所述第一电子设备与所述第二电子设备之间的连接向所述第二电子设备发送所述至少一次拍摄命令。
  6. 根据权利要求1至5中任一项所述的方法,其特征在于,根据所述m个第一图像和所述m个第二图像,拼接得到m个全景图像之前,所述方法还包括:
    对所述m个第一图像和所述m个第二图像进行帧同步;其中,所述第一目标图像和所述第二目标图像为帧同步的两个图像。
  7. 根据权利要求1至6中任一项所述的方法,其特征在于,检测到用于拍摄全景图像的第一操作之前,所述方法还包括:
    进入全景模式;
    获取第一预览图像,以及向所述第二电子设备发送预览命令,以使所述第二电子设备根据所述预览命令获取第二预览图像;
    接收来自于所述第二电子设备的所述第二预览图像;
    根据所述第一预览图像和所述第二预览图像,拼接得到预览全景图像;
    在第一窗口显示所述预览全景图像。
  8. 根据权利要求7所述的方法,其特征在于,所述方法还包括:
    在第二窗口显示所述第一预览图像,以及在第三窗口显示所述第二预览图像;
    其中,所述第一窗口、所述第二窗口和所述第三窗口位于同一显示界面。
  9. 根据权利要求7或8所述的方法,其特征在于,所述方法还包括:
    获取所述第一预览图像和所述第二预览图像的特征匹配值;
    若所述特征匹配值小于第二阈值,则显示提示信息,所述提示信息用于提示用户调整所述第一电子设备和/或所述第二电子设备的拍摄角度和/或位置。
  10. 根据权利要求7至9中任一项所述的方法,其特征在于,所述进入全景模式,包括:
    检测到用于进入所述全景模式的第二操作,响应于所述第二操作,进入所述全景模式;或者,
    检测到用于启动所述第一电子设备的相机应用的第三操作,若确定与所述第二电子设备建立有连接,则进入所述全景模式。
  11. 一种电子设备,其特征在于,所述电子设备包括:
    一个或多个摄像头;
    一个或多个处理器;
    存储器;
    通信模块;
    其中,所述存储器中存储有一个或多个计算机程序,所述一个或多个计算机程序包括指令,当所述指令被所述电子设备执行时,使得所述电子设备执行如权利要求1-10中任一项所述的方法。
  12. 一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,其特征在于,当所述指令在电子设备上运行时,使得所述电子设备执行如权利要求1-10中任一项所述的方法。
PCT/CN2021/141343 2021-01-29 2021-12-24 一种全景图像的拍摄方法及电子设备 WO2022161058A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110127000.8 2021-01-29
CN202110127000.8A CN114827439A (zh) 2021-01-29 2021-01-29 一种全景图像的拍摄方法及电子设备

Publications (1)

Publication Number Publication Date
WO2022161058A1 true WO2022161058A1 (zh) 2022-08-04

Family

ID=82525760

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/141343 WO2022161058A1 (zh) 2021-01-29 2021-12-24 一种全景图像的拍摄方法及电子设备

Country Status (2)

Country Link
CN (1) CN114827439A (zh)
WO (1) WO2022161058A1 (zh)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104427228A (zh) * 2013-08-22 2015-03-18 展讯通信(上海)有限公司 协作拍摄系统及其拍摄方法
US20160077422A1 (en) * 2014-09-12 2016-03-17 Adobe Systems Incorporated Collaborative synchronized multi-device photography
CN105979148A (zh) * 2016-06-23 2016-09-28 努比亚技术有限公司 全景拍照设备、系统及方法
CN107395989A (zh) * 2017-08-31 2017-11-24 广东欧珀移动通信有限公司 图像拼接方法、用于图像拼接的移动终端和系统
CN108900764A (zh) * 2018-06-06 2018-11-27 三星电子(中国)研发中心 拍摄方法和电子装置以及拍摄控制方法和服务器
CN109639969A (zh) * 2018-12-12 2019-04-16 维沃移动通信(杭州)有限公司 一种图像处理方法、终端及服务器

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104427228A (zh) * 2013-08-22 2015-03-18 展讯通信(上海)有限公司 协作拍摄系统及其拍摄方法
US20160077422A1 (en) * 2014-09-12 2016-03-17 Adobe Systems Incorporated Collaborative synchronized multi-device photography
CN105979148A (zh) * 2016-06-23 2016-09-28 努比亚技术有限公司 全景拍照设备、系统及方法
CN107395989A (zh) * 2017-08-31 2017-11-24 广东欧珀移动通信有限公司 图像拼接方法、用于图像拼接的移动终端和系统
CN108900764A (zh) * 2018-06-06 2018-11-27 三星电子(中国)研发中心 拍摄方法和电子装置以及拍摄控制方法和服务器
CN109639969A (zh) * 2018-12-12 2019-04-16 维沃移动通信(杭州)有限公司 一种图像处理方法、终端及服务器

Also Published As

Publication number Publication date
CN114827439A (zh) 2022-07-29

Similar Documents

Publication Publication Date Title
WO2020233553A1 (zh) 一种拍摄方法及终端
WO2021013158A1 (zh) 显示方法及相关装置
WO2021052147A1 (zh) 一种数据传输的方法及相关设备
WO2020103764A1 (zh) 一种语音控制方法及电子设备
WO2021139768A1 (zh) 跨设备任务处理的交互方法、电子设备及存储介质
WO2022257977A1 (zh) 电子设备的投屏方法和电子设备
WO2020000448A1 (zh) 一种柔性屏幕的显示方法及终端
WO2021213341A1 (zh) 视频拍摄方法及电子设备
WO2021159746A1 (zh) 文件共享方法、系统及相关设备
WO2021082835A1 (zh) 启动功能的方法及电子设备
CN117008777A (zh) 一种跨设备的内容分享方法、电子设备及系统
WO2022068483A1 (zh) 应用启动方法、装置和电子设备
CN113961157B (zh) 显示交互系统、显示方法及设备
WO2020238759A1 (zh) 一种界面显示方法和电子设备
CN112130788A (zh) 一种内容分享方法及其装置
WO2020134892A1 (zh) 一种媒体文件裁剪的方法、电子设备和服务器
WO2023130921A1 (zh) 一种适配多设备的页面布局的方法及电子设备
WO2022160985A1 (zh) 一种分布式拍摄方法,电子设备及介质
WO2022007678A1 (zh) 一种打开文件的方法及设备
WO2022206764A1 (zh) 一种显示方法、电子设备和系统
WO2022161058A1 (zh) 一种全景图像的拍摄方法及电子设备
WO2022052706A1 (zh) 一种服务的分享方法、系统及电子设备
WO2021204103A1 (zh) 照片预览方法、电子设备和存储介质
CN114079691B (zh) 一种设备识别方法及相关装置
WO2022111701A1 (zh) 投屏方法及系统

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21922648

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21922648

Country of ref document: EP

Kind code of ref document: A1