WO2021238317A1 - Panoramic image capture method and device - Google Patents

Panoramic image capture method and device Download PDF

Info

Publication number
WO2021238317A1
WO2021238317A1 PCT/CN2021/078666 CN2021078666W WO2021238317A1 WO 2021238317 A1 WO2021238317 A1 WO 2021238317A1 CN 2021078666 W CN2021078666 W CN 2021078666W WO 2021238317 A1 WO2021238317 A1 WO 2021238317A1
Authority
WO
WIPO (PCT)
Prior art keywords
path
sub
electronic device
image
deviation
Prior art date
Application number
PCT/CN2021/078666
Other languages
French (fr)
Chinese (zh)
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 WO2021238317A1 publication Critical patent/WO2021238317A1/en

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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformation in the plane of the image
    • G06T3/40Scaling the whole image or part thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformation in the plane of the image
    • G06T3/40Scaling the whole image or part thereof
    • G06T3/4038Scaling the whole image or part thereof for image mosaicing, i.e. plane images composed of plane sub-images
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/30Determination of transform parameters for the alignment of images, i.e. image registration
    • 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/95Computational photography systems, e.g. light-field imaging systems
    • H04N23/951Computational photography systems, e.g. light-field imaging systems by using two or more images to influence resolution, frame rate or aspect ratio

Definitions

  • the embodiments of the present application relate to the field of electronic technology, and in particular to a panoramic shooting method and device.
  • the electronic device can support multiple shooting modes and functions.
  • the electronic device can support night scene shooting, skin beautification shooting, time-lapse photography shooting, or panoramic shooting.
  • the mobile phone in the panoramic shooting, can guide the user to turn the mobile phone according to the guide line 01 shown in Figure 1, so that the mobile phone collects multiple frames of images with different angles, and stitches the images with different angles in the extension direction of the guide line 01 , So as to form a panoramic image with a wide field of view.
  • this panoramic shooting method lacks novelty and cannot meet the growing diverse shooting needs of users.
  • the embodiments of the present application provide a panoramic shooting method and device, which can respectively stitch images collected from different angles in two mutually perpendicular directions to generate a panoramic image, so that the angle of view of the panoramic image can be expanded in two directions , Improve the user's panoramic shooting experience.
  • an embodiment of the present application provides a panoramic shooting method, including: an electronic device enters a panoramic shooting mode of a camera application.
  • the electronic device displays the first guide information on the preview interface, and the first guide information includes the first guide path.
  • the first guide path includes at least two sub-paths that are arranged along a first direction and are parallel to each other, the first direction is parallel to a side of the electronic device, and the first guide path is used to guide the user along the first guide path during the shooting process. Turn the electronic device.
  • a guide path is displayed on the preview interface, and the guide path includes at least two sub-paths arranged in a first direction and parallel to each other, so as to guide the user to rotate the electronic device along the guide path during the shooting process.
  • the angle of view of the panoramic image in the first direction can be expanded;
  • the panoramic image can be expanded in a second direction perpendicular to the first direction while expanding the angle of view of the panoramic image in the first direction. The angle of view.
  • the coordinate ranges corresponding to the different sub-paths set along the first direction overlap in the first direction.
  • different sub-paths set along the first direction correspond to the same coordinate range in the first direction.
  • the two ends of the different sub-paths arranged along the first direction are respectively aligned, and the different sub-paths have the same length.
  • the preview interface also includes a splicing preview window for displaying thumbnails of the images collected by the electronic device. Moreover, the splicing preview window is located at the beginning of the first guide path. In this way, in some cases, the stitching preview window may be blocked and occupy a part of the guide path.
  • the entire guide path is a continuous complete path.
  • the sub-paths set along the second direction can guide the user to take the sequence of different sub-paths set along the first direction when shooting.
  • the method further includes: after the electronic device detects the shooting operation, displaying second guide information on the shooting interface.
  • the second guide information includes a splicing preview window, a second guide path, and a deviation indicator.
  • the deviation indicator is used to indicate the position of the center line of the image collected by the electronic device, and the deviation indicator moves along the second guide path during the shooting.
  • the second guide path includes a portion of the first guide path that does not deviate from the indicator mark.
  • the electronic device displays the target image obtained by splicing the images collected by the electronic device when the deviation indicator mark moves along the sub-path in the first direction in the stitching preview window; the electronic device stops shooting after the deviation indicator mark reaches the end of the second guide path, and the electronic device
  • the target image obtained by the splicing of the equipment is the panoramic image.
  • the electronic device can rotate along the guide path, and stitch the images collected when the sub path rotates along the first direction to generate a panoramic image.
  • the shooting interface only displays a guide path that deviates from the unfinished shooting part where the indicating arrow has not passed.
  • the deviation range indicator line is used to indicate the maximum range within which the center line of the image collected by the electronic device can deviate from the guide path. If the deviation indicator mark exceeds the range indicated by the deviation range indicator line, the center of the image collected by the electronic device exceeds the maximum range that can be deviated. At this time, the image may not include the image within the cropping range required for stitching, and thus cannot be performed. Image splicing, so the electronic device can stop the panoramic image shooting process.
  • the first guide path includes a first sub-path and a third sub-path that are arranged along the first direction and are parallel to each other, and the first sub-path is the initial sub-path.
  • the first guide path further includes a second sub-path arranged along the second direction, and the second sub-path is used to connect the first sub-path and the third sub-path.
  • the deviation indicator mark moves along the first sub-path, the second sub-path, and the third sub-path in sequence.
  • the guide path includes three sub-paths arranged along the first direction and two sub-paths arranged along the second direction.
  • the second guide path when the deviation indicator moves along the first sub-path, includes the portion of the first sub-path that the deviation indicator does not pass and the second sub-path to the first sub-path.
  • Five sub-paths, and deviation range indication lines are displayed on both sides of the first sub-path; the stitching preview window displays the target image obtained by splicing the images collected by the electronic device when the deviation indicating mark moves along the first sub-path.
  • the second guide path includes the portion of the second sub-path that the deviation indicator does not pass and the third to fifth sub-paths, and deviations are displayed on both sides of the second sub-path Range indicator line;
  • the target image displayed in the splicing preview window is the splicing result corresponding to the first path obtained by splicing the images collected by the electronic device after the deviation indicator mark moves to the end of the first sub-path.
  • the second guide path includes the part of the third sub-path that the deviation indicator does not pass, the fourth and fifth sub-paths, and deviations are displayed on both sides of the third sub-path Range indicator line;
  • the target image displayed in the splicing preview window is an image obtained by splicing the image collected by the electronic device to the splicing result corresponding to the first sub-path when the deviation indicator mark moves along the second sub-path.
  • the electronic device displays the guide path of the unfinished shooting and the deviation range indication line of the sub-path along which the electronic device is currently moving.
  • the target image in the preview splicing window is an image generated by splicing the electronic device along the sub-paths in the first direction, rather than the image generated by splicing the electronic device along all the sub-paths.
  • the electronic device displays in the mosaic preview window when the deviation indicator moves along the first sub-path, the image collected by the electronic device is spliced
  • the target image of includes: the electronic device maps the i-th frame image I i of the first sub-path to the cylindrical surface to obtain an image i is an integer greater than 1.
  • Electronic equipment extraction with The feature points F I,i and F I,i-1 It is the image obtained after the i-1th frame image I i-1 of the first subpath is mapped to the cylindrical surface.
  • the electronic device calculates the matching result of F I,i and F I,i-1. According to the matching result of F I,i and F I,i-1, the electronic equipment will Towards Map it.
  • the electronic device will be mapped
  • the part within the preset first cropping range is spliced with the spliced image RI(i-1) of the first sub-path, so as to obtain the spliced image RIi of the first sub-path.
  • the first clipping range includes a clipping line corresponding to the deviation range indication line of the first sub-path and a range defined by a left boundary line and a right boundary line preset by the electronic device.
  • the electronic device rotates along the first sub-path, and the electronic device performs cylindrical mapping on two adjacent frames of images collected during the rotation and extracts the feature points, and
  • the matching result is calculated according to the feature points, and the homography matrix is calculated according to the matching result, so that the next frame image is mapped to the previous frame image according to the homography matrix, and the next frame image after the mapping is cropped to match the previous frame image.
  • the splicing results of the splicing are spliced, and a new splicing result is obtained.
  • the cylindrical mapping of images from different angles taken by the electronic device in different postures can match the mapped size and imaging characteristics of the same object on the images taken at different angles, and then perform registration and stitching to generate a panoramic image , In order to meet the visual effect of the same image size of each part of the panorama.
  • the method further includes: the electronic device obtains multiple key frames from the image frames collected while rotating along the sub-path in the first direction.
  • the electronic device can display the target image obtained by splicing the images collected by the electronic device when the deviation indicator moves along the third sub-path in the mosaic preview window according to the key frame.
  • the electronic device may display the target image obtained by splicing the images collected by the electronic device when the deviation indicator moves along the fifth sub-path in the mosaic preview window according to the key frame.
  • the electronic device displays in the stitching preview window the image obtained by splicing the image collected by the electronic device when the deviation indicator moves along the sub-path in the first direction.
  • the target image includes: the electronic device obtains a target key frame G f1 that matches the first frame image A 1 of the third sub-path from a plurality of key frames.
  • the electronic device maps G f1 to the cylindrical surface to get the image
  • the electronic device maps A 1 to the cylindrical surface to get the image Electronic equipment extraction with The feature points F A,1 and F A,f1 .
  • the electronic device calculates the matching result of F A,1 and F A,f1.
  • the electronic device will Towards Map it.
  • the electronic device will be mapped
  • the part within the preset second cropping range is spliced with the corresponding splicing result of the first sub-path to obtain the spliced image RA1 of the second sub-path.
  • the second clipping range includes a clipping line corresponding to the deviation range indication line of the third subpath and a range defined by a left boundary line and a right boundary line preset by the electronic device.
  • the electronic device when the deviation indicator moves along the third sub-path, the electronic device rotates along the third sub-path, the electronic device determines the target key frame corresponding to the first frame of image After the image and the target key frame are mapped to the cylindrical surface, the feature points are extracted, and the matching results are calculated according to the feature points, and the homography matrix is calculated according to the matching results, so that the first frame image is mapped to the target key frame image according to the homography matrix.
  • the first frame image after the mapping is cropped, so that the splicing result corresponding to the first sub-path is spliced, and a new splicing result is obtained.
  • the electronic device registers the image of the third sub-path with the key frame in the image of the first sub-path, and can timely correct the misalignment error between the image of the third sub-path and the image of the first sub-path during the splicing of the images of the third sub-path, so that the first sub-path
  • the images of the three sub-paths are accurately registered with the splicing result of the first sub-path, thereby realizing global registration.
  • the splicing result of the third sub-path and the splicing result of the first sub-path can form a smooth and natural transition overall image.
  • the lens of the electronic device camera is located on the xy plane of the xyz three-dimensional coordinate system; the interval of the rotation angle around the y axis corresponding to the key frame is greater than or equal to the preset value ⁇ ; Among the multiple key frames, the difference between the rotation angle around the y axis corresponding to the target key frame G f1 and the rotation angle around the y axis corresponding to A 1 is the smallest.
  • the image misalignment error of the image of the target key frame and the third sub-path is the smallest when stitching, and the image after the two are mapped to the cylindrical surface is easier to be registered.
  • the electronic device displays in the stitching preview window the image obtained by splicing the image collected by the electronic device when the deviation indicator moves along the sub-path in the first direction.
  • target image further comprising: an electronic device to acquire the i-th third sub-frame image a i path matches the i-th keyframe G fi target from the plurality of keyframes.
  • the electronic device maps the G fi to the cylindrical surface to obtain the image
  • the electronic device to obtain an image A i is mapped to the cylindrical surface Electronic equipment extraction with Feature points F A,i , F A,i-1 and F A,fi , It is the image obtained after the i-1th frame image Ai-1 of the second subpath is mapped to the cylindrical surface.
  • the electronic device calculates the matching results of F A,i , F A,i-1 and F A,fi. According to the matching results of F A,i , F A,i-1 and F A,fi, the electronic equipment will Towards with Map it. The electronic device will be mapped For the part within the preset second cropping range, the stitching result corresponding to the first sub-path and the stitched image RA(i-1) of the second sub-path are stitched to obtain the stitched image RAi of the second sub-path.
  • the electronic device when the electronic device rotates along the third sub-path, the electronic device can perform registration, mapping, and splicing of images other than the first frame image according to the previous frame image and the determined target key frame.
  • the electronic device displays in the stitching preview window the image obtained by splicing the image collected by the electronic device when the deviation indicator moves along the sub-path in the first direction.
  • the target image includes: the electronic device splicing the image collected while rotating along the fifth sub-path with the splicing result corresponding to the first sub-path according to a plurality of key frames.
  • the electronic device splices the image collected while rotating along the fifth sub-path with the splicing result corresponding to the first sub-path according to a plurality of key frames
  • the splicing result corresponding to the first sub-path may already be the same as the splicing result of the first sub-path.
  • the splicing results of the three sub-paths are spliced. That is, the electronic device splices the image collected while rotating along the fifth sub-path with the splicing result of the first sub-path and the splicing result of the third sub-path, thereby forming a spliced image with a larger field of view.
  • the lens of the electronic device camera is located on the xy plane of the xyz three-dimensional coordinate system.
  • the electronic device is preset with a left boundary line, a left baseline, a left clipping line, a right clipping line, a right baseline and a right boundary line; the left baseline corresponds to the fourth sub-path, the left baseline corresponds to the rotation angle around the y axis is 0, and the right baseline corresponds to
  • the second subpath corresponds to the rotation angle around the y axis corresponding to the right baseline is ⁇ r , the rotation angle around the y axis corresponding to the left clipping line is ⁇ 2 , and the rotation angle around the y axis corresponding to the right clipping line is ⁇ 3 ,
  • the rotation angle around the y-axis corresponding to the left boundary line is ⁇ 1
  • the rotation angle around the y-axis corresponding to the right boundary line is ⁇ 4 .
  • the electronic device is also preset with upper, middle, and lower baselines, as well as the first cutting line, the second cutting line, the third cutting line, and the fourth cutting line; among them, the upper, middle, and lower baselines are the same as the third The sub-path, the first sub-path and the fifth sub-path correspond to each other, the first and second cutting lines correspond to the deviation range indication lines of the third sub-path, and the second and third cutting lines correspond to the deviation of the first sub-path.
  • the deviation range indicator line corresponds to the third cutting line and the fourth cutting line correspond to the deviation range indicator line of the fifth subpath; the first cutting line, the upper baseline, the second cutting line, the middle line, the third cutting line, the lower baseline
  • the rotation angles around the x-axis corresponding to the fourth cutting line are ⁇ 1 , ⁇ t , ⁇ 2 , 0, ⁇ 3 , ⁇ b , and ⁇ 4, respectively .
  • the method further includes: when the deviation indicator moves along the first sub-path, if the rotation angle of the electronic device around the x axis is ⁇ > ⁇ 1 or ⁇ 2 , the electronic device stops shooting.
  • the deviation indicator When the rotation angle ⁇ 0 of the electronic device around the y-axis, the deviation indicator will switch from moving along the third sub-path to moving along the fourth sub-path; when the rotation angle ⁇ > ⁇ 2 or ⁇ of the electronic device around the y-axis ⁇ when ⁇ 1, the electronic device to stop recording.
  • the electronic device about the x axis rotation angle ⁇ ⁇ When ⁇ b, departing from the indicating mark is moved by the switching path is traversed along fourth sub fifth sub path; when the electronic device about the x axis rotation angle ⁇ > ⁇ 3 or When ⁇ 4 , the electronic device stops shooting.
  • the electronic device about the y-axis rotational angle ⁇ > ⁇ r the electronic device to stop recording.
  • the electronic device can determine whether to switch the sub-path along which it rotates, and determine whether the center line of the image collected by the electronic device exceeds the cropping range, etc., according to the size of the rotation angle around the x-axis or the y-axis.
  • an embodiment of the present application provides a photographing device, which is included in an electronic device.
  • the device has the function of realizing the behavior of the electronic device in any method in the foregoing aspects and possible designs, so that the electronic device executes the panoramic shooting method executed by the electronic device in any of the foregoing aspects in a possible design.
  • This function can be realized by hardware, or by hardware executing corresponding software.
  • the hardware or software includes at least one module or unit corresponding to the above-mentioned functions.
  • the device may include a processing unit, a display unit, a detection unit, and so on.
  • an embodiment of the present application provides an electronic device, including: a camera for capturing images; a screen for displaying an interface; one or more processors; and a memory in which codes are stored.
  • the code is executed by the electronic device, the electronic device is caused to execute the panoramic photography method executed by the electronic device in any one of the possible designs in the foregoing aspects.
  • an embodiment of the present application provides an electronic device, including: one or more processors; and a memory, in which code is stored.
  • the electronic device is caused to execute the panoramic photography method executed by the electronic device in any one of the possible designs in the foregoing aspects.
  • an embodiment of the present application provides a computer-readable storage medium, including computer instructions, which, when the computer instructions run on an electronic device, cause the electronic device to execute the panoramic photography method in any one of the possible designs in the foregoing aspects.
  • an embodiment of the present application provides a computer program product, which when the computer program product runs on a computer, causes the computer to execute the panoramic shooting method executed by the electronic device in any one of the above-mentioned possible designs.
  • an embodiment of the present application provides a chip system, which is applied to an electronic device.
  • the chip system includes one or more interface circuits and one or more processors; the interface circuit and the processor are interconnected by wires; the interface circuit is used to receive signals from the memory of the electronic device and send signals to the processor.
  • the signals include the memory Stored computer instructions; when the processor executes the computer instructions, it causes the electronic device to execute any one of the above-mentioned aspects of the possible design of the panoramic photography method.
  • FIG. 1 is a schematic diagram of a preview interface for panoramic shooting in the prior art
  • FIG. 2 is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the application.
  • FIG. 3 is a flowchart of a panoramic shooting provided by an embodiment of the application.
  • 4A is a schematic diagram of a set of interfaces provided by an embodiment of the application.
  • 4B is a schematic diagram of a set of guide paths provided by an embodiment of the application.
  • Figure 5 is a schematic diagram of a set of guidance information provided by an embodiment of the application.
  • FIG. 6 is a schematic diagram of another set of interfaces provided by an embodiment of the application.
  • FIG. 7 is a schematic diagram of a set of rule lines provided by an embodiment of the application.
  • FIG. 8 is a schematic diagram of a coordinate system provided by an embodiment of the application, and a schematic diagram of the quantitative relationship between image frames and gyroscope data;
  • FIG. 9 is a schematic diagram of a set of cylindrical surface mapping effects provided by an embodiment of the application.
  • FIG. 10 is a schematic diagram of a splicing effect provided by an embodiment of this application.
  • FIG. 11 is a schematic diagram of a comparison of feature points provided by an embodiment of this application.
  • FIG. 12 is a schematic diagram of a set of splicing effects provided by an embodiment of the application.
  • FIG. 13 is a schematic diagram of a set of key frames provided by an embodiment of the application.
  • 14A is a schematic diagram of another set of interfaces provided by an embodiment of the application.
  • 14B is a schematic diagram of a set of guide paths on a shooting interface provided by an embodiment of the application.
  • FIG. 15 is a schematic diagram of another interface provided by an embodiment of the application.
  • 16A is a schematic diagram of another interface provided by an embodiment of the application.
  • 16B is a schematic diagram of another splicing effect provided by an embodiment of the application.
  • 16C is a schematic diagram of comparison between a set of upper baseline images and target key frames provided by an embodiment of the application;
  • 16D is a schematic diagram of another splicing effect provided by an embodiment of the application.
  • 16E is a schematic diagram of another splicing effect provided by an embodiment of the application.
  • FIG. 17 is a schematic diagram of another splicing effect provided by an embodiment of the application.
  • FIG. 18 is a schematic diagram of another set of splicing effects provided by an embodiment of the application.
  • FIG. 19 is a schematic diagram of another set of interfaces provided by an embodiment of the application.
  • FIG. 20 is a schematic diagram of another set of guide paths provided by an embodiment of this application.
  • FIG. 21 is a schematic diagram of another interface provided by an embodiment of this application.
  • 22A is a schematic diagram of another interface provided by an embodiment of the application.
  • 22B is a schematic diagram of another set of guide paths provided by an embodiment of the application.
  • 22C is a schematic diagram of another splicing effect provided by an embodiment of the application.
  • FIG. 23 is a schematic diagram of a set of guide paths and panoramic images obtained by stitching provided by an embodiment of the application.
  • 24 is a schematic diagram of another set of guide paths and panoramic images obtained by stitching provided by an embodiment of the application.
  • 25 is a schematic diagram of another set of guide paths and panoramic images obtained by stitching provided by an embodiment of the application.
  • FIG. 26 is a schematic structural diagram of an electronic device provided by an embodiment of this application.
  • first and second are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Therefore, the features defined with “first” and “second” may explicitly or implicitly include one or more of these features. In the description of the present embodiment, unless otherwise specified, “plurality” means two or more.
  • the embodiment of the present application provides a panoramic shooting method, which can stitch images collected from different angles in two mutually perpendicular directions to generate a panoramic image, so that the view of the stitched and synthesized image can be expanded in two directions.
  • Field angle to obtain panoramic images that can cover a larger viewing angle in both directions, and improve the user's shooting experience.
  • the panoramic shooting method provided in the embodiments of the present application can be applied to electronic devices.
  • the electronic device may be a mobile phone, a tablet computer, a wearable device, a vehicle-mounted device, an augmented reality (AR)/virtual reality (VR) device, a notebook computer, an ultra-mobile personal computer (ultra-mobile personal computer).
  • Computers, UMPCs), netbooks, personal digital assistants (personal digital assistants, PDAs) and other devices can also be professional cameras and other devices.
  • the embodiments of the present application do not impose any restrictions on the specific types of electronic devices.
  • FIG. 2 shows a schematic structural diagram of the electronic device 100.
  • the electronic device 100 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, an antenna 1, and an antenna 2.
  • Mobile communication module 150 wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, earphone jack 170D, sensor module 180, buttons 190, motor 191, indicator 192, camera 193, display screen 194, and Subscriber identification module (subscriber identification module, SIM) card interface 195, etc.
  • SIM Subscriber identification module
  • the sensor module 180 may include a pressure sensor 180A, a gyroscope 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 ambient light Sensor 180L, bone conduction sensor 180M, etc.
  • the 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), and an image signal processor. (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (NPU) Wait.
  • AP application processor
  • modem processor modem processor
  • GPU graphics processing unit
  • image signal processor image signal processor
  • ISP image signal processor
  • controller memory
  • video codec digital signal processor
  • DSP digital signal processor
  • NPU neural-network processing unit
  • the different processing units may be independent devices or integrated in one or more processors.
  • the controller may be the nerve center and command center of the electronic device 100.
  • the controller can generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching and executing instructions.
  • a memory may also be provided in the processor 110 to store instructions and data.
  • the memory in the processor 110 is a cache memory.
  • the memory can store 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 directly called from the memory. Repeated accesses are avoided, the waiting time of the processor 110 is reduced, and the efficiency of the system is improved.
  • the electronic device 100 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, connected to the display 194 and the application processor.
  • the GPU is used to perform mathematical and geometric calculations and is used for graphics rendering.
  • the processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
  • the display screen 194 is used to display images, videos, and the like.
  • the display screen 194 may display a preview interface and a shooting interface in the panoramic shooting mode.
  • the display screen 194 includes a display panel.
  • the display panel can adopt liquid crystal display (LCD), organic light-emitting diode (OLED), active matrix organic light-emitting diode or active-matrix organic light-emitting diode (active-matrix organic light-emitting diode).
  • LCD liquid crystal display
  • OLED organic light-emitting diode
  • active matrix organic light-emitting diode active-matrix organic light-emitting diode
  • active-matrix organic light-emitting diode active-matrix organic light-emitting diode
  • AMOLED flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diode (QLED), etc.
  • the electronic device 100 may
  • the electronic device 100 can realize a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.
  • the ISP is used to process the data fed back from the camera 193. For example, when taking a picture, the shutter is opened, and the light is transmitted to the photosensitive element of the camera through the lens, the light signal is converted into an electrical signal, and the photosensitive element of the camera transmits the electrical signal to the ISP for processing, which is converted into an image visible to the naked eye.
  • ISP can also optimize the image noise, brightness, and skin color. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene.
  • the ISP may be provided in the camera 193.
  • the camera 193 is used to capture still images or videos.
  • the object generates an optical image through the lens and is projected to 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 transfers the electrical signal to the ISP to convert it into a digital image signal.
  • ISP outputs digital image signals to DSP for processing.
  • DSP converts digital image signals into standard RGB, YUV and other formats of image signals.
  • the electronic device 100 may include one or N cameras 193, and N is a positive integer greater than one.
  • the camera 193 may include a front camera and/or a rear camera.
  • the camera 193 may also include multiple types.
  • the camera 193 may include a telephoto camera, a wide-angle camera, an ultra-wide-angle camera, etc. whose field of view angle varies from small to large.
  • the electronic device 100 in the panoramic shooting mode, may use a camera with a larger field of view (for example, an ultra-wide-angle camera or a wide-angle camera) to collect multiple frames of images at different angles, so as to have a larger view of the captured images. After cropping multiple frames of images in the viewing angle range, they are stitched into a panoramic image with a larger viewing angle range.
  • Digital signal processors are used to process digital signals. In addition to digital image signals, they can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the energy of the frequency point.
  • Video codecs are used to compress or decompress digital video.
  • the electronic device 100 may support one or more video codecs. In this way, the electronic device 100 can play or record videos in multiple encoding formats, such as: moving picture experts group (MPEG) 1, MPEG2, MPEG3, MPEG4, and so on.
  • MPEG moving picture experts group
  • MPEG2 MPEG2, MPEG3, MPEG4, and so on.
  • NPU is a neural-network (NN) computing processor.
  • NN neural-network
  • the NPU can realize applications such as intelligent cognition of the electronic device 100, such as image recognition, face recognition, voice recognition, text understanding, and so on.
  • the internal memory 121 may be used to store computer executable program code, and the executable program code includes instructions.
  • the processor 110 executes various functional applications and data processing of the electronic device 100 by running 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, at least one application program (such as a sound playback function, an image playback function, etc.) required by at least one function.
  • the data storage area can store data (such as audio data, phone book, etc.) created during the use of the electronic device 100.
  • the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash storage (UFS), and the like.
  • UFS universal flash storage
  • the processor 110 runs the instructions stored in the internal memory 121 to stitch images collected from different angles by the camera 193 in two mutually perpendicular directions to generate a panoramic image. Expand the angle of view of the panoramic image in two directions.
  • the electronic device 100 can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor. For example, music playback, recording, etc.
  • the gyro sensor 180B may be used to determine the movement posture of the electronic device 100.
  • the angular velocity of the electronic device 100 around three axes ie, x, y, and z axes
  • the gyro sensor 180B can be used for image stabilization.
  • the gyro sensor 180B detects the shake angle of the electronic device 100, calculates the distance that the lens module needs to compensate according to the angle, and allows the lens to counteract the shake of the electronic device 100 through reverse movement to achieve anti-shake.
  • the gyro sensor 180B can also be used for navigation and somatosensory game scenes.
  • the gyroscope sensor 180B may be used to calculate the rotation angle ⁇ of the mobile phone around the x-axis and the rotation angle ⁇ around the y-axis in the panoramic shooting process.
  • the rotation angle ⁇ and the rotation angle ⁇ can be used to determine the shooting stage of the panoramic shooting process, determine the position of the deviation indicator corresponding to the center of the image frame, and determine whether the deviation range of the current image frame exceeds the maximum deviation range, and so on.
  • Touch sensor 180K also called “touch panel”.
  • the touch sensor 180K may be provided on the display screen 194, and the touch screen is composed of the touch sensor 180K and the display screen 194, which is also called a “touch screen”.
  • the touch sensor 180K is used to detect a touch operation acting on or near it, for example, a touch operation used to instruct to take a panoramic image.
  • the touch sensor can pass the detected touch operation to the application processor to determine the type of touch event.
  • the visual output related to the touch operation can be provided through the display screen 194.
  • the touch sensor 180K may also be disposed on the surface of the electronic device 100, which is different from the position of the display screen 194.
  • the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100.
  • the electronic device 100 may include more or fewer components than shown, or combine certain components, or split certain components, or arrange different components.
  • the illustrated components can be implemented in hardware, software, or a combination of software and hardware.
  • the camera 193 in the panoramic shooting mode, can collect multiple frames of images at different angles.
  • the display screen 194 can display the preview interface and the shooting interface in the panoramic shooting mode.
  • the processor 110 by running the instructions stored in the internal memory 121, stitches the images collected by the camera 193 from different angles in two mutually perpendicular directions to generate a panoramic image, so that the panoramic image can be expanded in two directions.
  • the gyro sensor 180B can be used to calculate the rotation angle ⁇ of the mobile phone around the x-axis and the rotation angle ⁇ around the y-axis in the panoramic shooting process.
  • the rotation angle ⁇ and the rotation angle ⁇ can be used to determine the shooting stage of the panoramic shooting process, determine the position of the deviation indicator corresponding to the center of the image frame, and determine whether the deviation range of the current image frame exceeds the maximum deviation range, and so on.
  • the method may include:
  • a guide path is displayed on a preview interface, and the guide path includes at least two parallel sub-paths set along a first direction.
  • the mobile phone After the mobile phone detects that the user has clicked the camera icon 401 shown in (a) in FIG. 4A, it starts the camera application and enters the photographing mode shown in (b) in FIG. 4A.
  • the mobile phone detects that the user has clicked the operation of the panoramic shooting control 402 shown in (b) in FIG. 4A, it enters the panoramic shooting mode and displays the preview interface as shown in (c) in FIG. 4A.
  • the mobile phone detects that the user clicks on the control 403 shown in (b) in FIG. 4A, it displays the interface shown in (d) in FIG. 4A; after the mobile phone detects that the user clicks on the control 404, , Enter the panoramic shooting mode, and display the preview interface as shown in (c) in Figure 4A.
  • the mobile phone can also enter the panoramic shooting mode in response to other touch operations, voice commands, or shortcut gestures of the user.
  • the embodiment of the present application does not limit the operation of triggering the mobile phone to enter the panoramic shooting mode.
  • the preview interface in the panoramic shooting mode includes guide information for panoramic shooting.
  • the guidance information includes the guidance path.
  • the guide path is used to guide the user to rotate (and/or move) the mobile phone along the guide path during the shooting process, so that the center line of the image collected by the mobile phone moves along the guide path to complete panoramic shooting.
  • the guide path includes at least two sub-paths arranged along the first direction and parallel to each other. The mobile phone can collect images from different angles along the sub-paths in the first direction, and stitch them along each sub-path to generate a panoramic image.
  • the angle of view of the panoramic image in the first direction can be expanded; when the sub-path in the first direction includes multiple sub-paths, the field of view in the first direction is expanded.
  • the mobile phone can also expand the angle of view of the panoramic image in the second direction perpendicular to the first direction.
  • the different sub-paths set along the first direction are used to guide the user to take multiple shots back and forth along the first direction to expand the angle of view of the panoramic image in the second direction perpendicular to the first direction.
  • This kind of guidance can be precise guidance or general trend guidance.
  • the guide path includes a middle sub-path 41, an upper sub-path 42 and a lower sub-path 43 arranged along the first direction, and the middle sub-path 41, the upper sub-path 42 and the lower sub-path
  • the coordinate ranges corresponding to the path 43 in the first direction are the same.
  • the guide path includes a middle sub-path 41, an upper sub-path 42 and a lower sub-path 43 arranged along the first direction, and the middle sub-path 41, the upper sub-path 42 and the lower sub-path There is a partial overlap between the corresponding coordinate ranges of the path 43 in the first direction.
  • the sub-path set along the first direction may be provided with a direction indicator (for example, an arrow on the sub-path) to guide the direction of rotation when the mobile phone rotates along the sub-path.
  • a direction indicator for example, an arrow on the sub-path
  • the sub-path set along the first direction may not be provided with a direction indication mark, and the user only needs to complete the rotation along the sub-path, and the specific rotation direction of the user is not limited.
  • the mobile phone can remind the user of the sequence of shooting along different sub-paths in the first direction by means of display information or voice broadcast.
  • the mobile phone can prompt the user through text messages to first rotate along the middle sub-path during the shooting, and then rotate along the upper sub-path and the lower sub-path to shoot.
  • the mobile phone can remind the user of the sequence of shooting along different sub-paths by indicating arrows or other indicating methods.
  • the arrow 44 is used to instruct the user to first turn and shoot along the middle sub-path, and then to rotate along the upper sub-path to shoot; the arrow 45 is used to instruct the user to rotate and shoot along the upper sub-path , And then rotate and shoot along the sub-path below.
  • the guide path may further include at least one sub-path arranged along the second direction.
  • the sub-paths set along the second direction are used to remind the user of the sequence of shooting of different sub-paths along the first direction.
  • the guide path further includes a right sub-path 46 and a left sub-path 47.
  • the right sub-path 46 is used to instruct the user to first follow the middle sub-path.
  • the path rotates and shoots, and then rotates along the upper sub-path to shoot;
  • the left sub-path 47 is used to instruct the user to rotate along the upper sub-path for shooting, and then rotate along the lower sub-path to shoot.
  • the sub-path in the second direction is used to connect the sub-path in the first direction, and the entire guide path is a continuous path.
  • the multiple sub-paths are parallel to each other.
  • the guide path may refer to the path 405 shown in (c) in FIG. 4A.
  • the mobile phone can also remind the user of the sequence of shooting along different sub-paths in the first direction in various other ways, which is not limited in the embodiment of the present application.
  • first direction and the second direction may be two directions respectively parallel to two adjacent sides of the mobile phone, and the second direction is perpendicular to the first direction.
  • one side of the mobile phone is usually parallel to the horizontal direction (or the angle between one side of the mobile phone and the horizontal direction is less than or equal to the preset value, that is, one side of the mobile phone is basically parallel to the horizontal direction.
  • the other side adjacent to the side is usually parallel to the vertical direction (or the angle between the other side of the mobile phone and the vertical direction is less than or equal to the preset value, that is, the other side of the mobile phone is The vertical direction is basically parallel). That is, the first direction and the second direction may be a horizontal direction and a vertical direction.
  • the first direction is the horizontal direction (or horizontal direction), and the second direction is the vertical direction (or vertical direction).
  • the guide path includes horizontal and vertical sub-paths, and the horizontal sub-path may include at least two, and the vertical sub-path is used for Connect the sub-paths in the horizontal direction.
  • the guide path includes three sub-paths: the middle sub-path 501, the upper sub-path 502, and the lower sub-path 503 in the horizontal direction, and the left sub-path 504 and the lower sub-path 503 in the vertical direction.
  • the right sub-path 505 is two sub-paths.
  • the guide path on the preview interface is used to remind the user of the complete path that needs to be taken during the entire shooting process.
  • the guide information on the preview interface may also include a deviation indicator mark, which is used to indicate the position of the center line (ie, the horizontal center line) of the image currently collected by the camera in real time in the first direction.
  • the deviation indicator arrow may also point to the direction to be moved of the deviation indicator arrow, that is, to the end direction of the initial sub-path, that is, to the direction to be rotated of the mobile phone.
  • the deviation indicator is located at the beginning of the starting sub-path. Exemplarily, in the case shown in (b) in FIG.
  • the deviation indicator mark may be a deviation indicator arrow 506, the starting sub-path is the middle sub-path 501, and the deviation indicator arrow 506 is located on the middle sub-path 501 on the preview interface. The left end of and points to the right end of the middle sub-path 501. It is understandable that the deviation indicator mark may also be a deviation indicator line or other forms, which is not limited in the embodiment of the present application. The following will take the deviation indicator as the deviation indicator arrow as an example for description.
  • the guidance information on the preview interface may also include a deviation range indication line of the sub-path. Since the user is prone to shaking when holding the mobile phone, the position of the horizontal center line of the image collected by the mobile phone will usually change, and the position of the deviation indicator arrow will also change.
  • the deviation range indicator line is located on both sides of the sub-path, and is parallel to the sub-path, and is used to indicate the maximum allowable range of the deviation indicator arrow from the sub-path.
  • the mobile phone can only display the deviation range indicator line of the starting sub-path. Exemplarily, in the case shown in (b) of FIG. 5, the starting sub-path is the middle sub-path, and the deviation range indication lines 501a-501b may be located on both sides of the middle sub-path 501, and are in line with the middle sub-path. 501 Parallel dotted lines.
  • the mobile phone may prompt the user by displaying information or voice broadcast, etc., that the deviation indicator arrow overlaps with the guide path as much as possible, and should not exceed the deviation range indicator line.
  • the mobile phone can prompt the user through text messages on the preview interface: After starting to shoot, slowly turn the mobile phone so that the arrow moves along the guide path and does not exceed the range of the dotted line.
  • the preview interface may further include a splicing preview window 507.
  • the splicing preview window is located at the beginning of the guide path, and the deviation indicator arrow can be located beside the splicing preview window and on the side where the end of the starting sub-path is located.
  • the splicing preview window is located at the beginning of the starting sub-path 501, and the deviation indicating arrow is located on the right side of the splicing preview window.
  • the stitching preview window is used to display the thumbnail of the preview image currently displayed on the preview interface (or called the preview image of the preview image).
  • the stitching preview window will occupy or block a part of the guide path. It can be seen from Fig. 5(b) that the lengths of the sub-path 501, the sub-path 502 and the sub-path 503 are equal, but because the splicing preview window will block a part of the guide path, as shown in Fig. 5(b), the sub-path 502 and sub-path 503 are indented compared to the left end of sub-path 501, and the right ends of the three sub-paths are aligned.
  • the length of the sub-path 501 itself is smaller than the sub-path 502 and the sub-path 503, and compared with the sub-path 502 and the sub-path 503, the left end of the sub-path 501 is reduced. Then, the left ends of the sub-path 502 and the sub-path 503 are aligned, and the right ends of the three sub-paths are also aligned.
  • the mobile phone After the mobile phone detects the user's shooting operation, it displays an image obtained by splicing images collected according to the guide path on the shooting interface.
  • the mobile phone detects that the user has clicked the operation of the shooting control 406 shown in (c) of FIG. 4A, it starts to shoot a panoramic image and displays the shooting interface.
  • the mobile phone displays the images collected by the camera on the shooting interface in real time. It is understandable that the mobile phone can also start panoramic image shooting in response to operations such as voice instructions or shortcut gestures of the user.
  • the embodiment of the present application does not limit the operation of triggering the mobile phone to start panoramic image shooting.
  • the mobile phone displays guide information on the shooting interface, and the guide information includes a guide path, a deviation indicator arrow, and a deviation range indicator line.
  • the displayed shooting interface may refer to (a) in FIG. 6.
  • the deviation indicator arrow is used to remind the user of the position of the center line of the image currently collected by the camera and the degree of deviation between the position of the center line and the target sub-path.
  • the deviation indicator arrow may also point to the direction to be moved of the deviation indicator arrow, that is, to the end direction of the target sub-path, that is, to the direction to be rotated of the mobile phone.
  • the target sub-path is a sub-path that deviates from the indicated arrow currently moving along it.
  • the target sub-path is the starting sub-path (for example, the intermediate sub-path described above), and as the shooting process proceeds, the target sub-path will switch.
  • the target sub-path is a horizontal sub-path (that is, a sub-path set in the horizontal direction)
  • the deviation indicating arrow moves along the horizontal sub-path
  • the deviation indicating arrow is used to indicate the position of the horizontal center line of the image collected by the mobile phone.
  • the horizontal center lines of the different images move along the horizontal sub-path.
  • the deviation indicating arrow moves along the vertical sub-path, and the deviation indicating arrow is used to indicate the position of the vertical center line of the image collected by the mobile phone.
  • the vertical center lines of the different images collected by the mobile phone move along the vertical sub-path.
  • the mobile phone can prompt the user by displaying information or voice broadcast, etc., slowly turning the mobile phone along the guide path, and the deviation indicator arrow should coincide with the guide path as much as possible, and do not exceed the deviation range indicator line.
  • the mobile phone can prompt the user through a text message: Please turn the mobile phone slowly so that the arrow moves along the guide path and does not exceed the range of the dotted line.
  • the mobile phone can prompt the user to move the mobile phone to coincide the deviation indicator arrow with the target sub-path.
  • the mobile phone may prompt the user: Please move up so that the arrow coincides with the guide path.
  • the guide path displayed on the shooting interface is a complete guide path.
  • the mobile phone rotates to the right so that the deviation indicator arrow moves to the right along the horizontal sub-path.
  • the phone keeps turning to collect images from different angles, so that the deviation indicator arrow moves to the right along the middle sub-path, upwards along the right sub-path, and to the left along the upper sub-path, along the The left sub-path moves down, and moves to the right along the lower sub-path, until the entire guide path is taken.
  • the sub-path that deviates from the current movement of the indicating arrow is the target sub-path. For example, when the deviation indicating arrow moves along the middle sub-path, the target sub-path is the middle sub-path; when the deviation indicating arrow moves along the right sub-path, the target sub-path is the right sub-path.
  • the guide path displayed on the shooting interface will change with the user's shooting process, and the shooting interface may only display the guide path of the unfinished shooting. , That is, the part of the guide path displayed on the preview interface that deviates from the indicated arrow.
  • the deviation indicator arrow can also fluctuate within the deviation range indicator line when it moves along the guide path. Therefore, it can be understood that deviation from the guide path that the indicating arrow passes includes, but is not limited to, the part that the deviation indicating arrow passes through when the indicating arrow coincides with the guide path, and also includes the deviation indicating arrow that does not coincide with the guide path and is along the deviation range indicating line.
  • the mobile phone only displays the current target sub-path.
  • the mobile phone displays the complete guide path on the shooting interface, and the display mode of the guide path for the completed shooting and the guide path for the incomplete shooting is different.
  • the guide path for unfinished shooting is a solid line
  • the guide path for completed shooting is a dotted line.
  • the mobile phone displays the complete guide path on the shooting interface until the shooting is completed.
  • the shooting interface also includes a stitching preview window, which is used to display thumbnails (or called previews of stitched images) of images obtained by stitching by mobile phones during shooting.
  • the deviation indicator arrow can be located beside the stitching preview window and on the side where the end of the target subpath is located.
  • the size, position, and shape of the stitching preview window correspond to the guide path of the completed shooting.
  • the stitching preview window on the shooting interface can cover the guide path of the completed shooting.
  • the shooting angle and shooting range of the camera also change, so that images from different angles can be collected.
  • the phone can stitch images from different angles and display them in the stitching preview window.
  • the image displayed by the mobile phone in the splicing preview window can be specifically the target image obtained by splicing the collected images when the mobile phone rotates along the horizontal sub-path in the first direction, that is, when the deviation indicator moves along the horizontal sub-path in the first direction
  • the target image obtained by splicing the collected images by the mobile phone can be specifically the target image obtained by splicing the collected images when the mobile phone rotates along the horizontal sub-path in the first direction, that is, when the deviation indicator moves along the horizontal sub-path in the first direction.
  • the rule line includes an upper baseline, a middle baseline, and a lower baseline, which correspond to the upper sub-path, the middle sub-path, and the lower sub-path in the horizontal direction, respectively.
  • the rule line also includes the first cutting line, the second cutting line, the third cutting line, and the fourth cutting line.
  • the first cutting line and the second cutting line are located on both sides of the upper baseline, and respectively correspond to the deviation range indication lines on both sides of the upper sub-path in the horizontal direction.
  • the first cropping line and the second cropping line constitute the upper and lower cropping ranges of the upper baseline image (that is, the image collected when the mobile phone rotates along the upper sub-path), which limits the images collected during the process of the mobile phone rotating along the upper sub-path.
  • the second cutting line and the third cutting line are located on both sides of the middle baseline, and respectively correspond to the deviation range indication lines on both sides of the middle sub-path in the horizontal direction.
  • the second cropping line and the third cropping line constitute the upper and lower cropping ranges of the mid-baseline image (that is, the image collected when the mobile phone rotates along the middle sub-path), which limits the image collected during the shooting of the mobile phone while rotating along the middle sub-path
  • the maximum deviation range of the horizontal centerline The 3rd cutting line and the 4th cutting line are located on both sides of the lower baseline, and respectively correspond to the deviation range indicator lines on both sides of the upper and lower subpaths in the horizontal direction.
  • the 3rd and 4th cutting lines form the upper and lower cutting ranges of the lower baseline image (that is, the image collected when the mobile phone rotates along the lower sub-path), which limits the images collected during the process of the mobile phone rotating along the lower sub-path.
  • the maximum deviation range of the horizontal centerline The maximum deviation range of the horizontal centerline.
  • the ruled line also includes a left baseline and a right baseline, which respectively correspond to the left sub-path and the right sub-path in the vertical direction.
  • the rule line also includes a left boundary, a left clipping line, a right clipping line, and a right boundary.
  • the left border and the left clipping line are located on both sides of the left baseline, and respectively correspond to the deviation range indication lines on both sides of the left sub-path in the vertical direction.
  • the left border and the left crop line define the left and right maximum deviation range of the vertical center line of the left baseline image (ie, the image collected when the mobile phone rotates along the left sub-path).
  • the left border also defines the left border when stitching the panoramic image, and the part of the image beyond the left border can be directly cut off when stitching.
  • the right border and the right clipping line are located on both sides of the right baseline, and respectively correspond to the deviation range indication lines on both sides of the right sub-path in the vertical direction.
  • the right border and the right crop line define the left and right maximum deviation range of the vertical center line of the right baseline image (that is, the image collected when the mobile phone rotates along the right sub-path).
  • the right border also defines the right border when stitching the panoramic image, and the part of the image beyond the right border can be directly cut off when stitching.
  • each of the regular lines shown in FIG. 7 is a straight line on a plane, and in fact, each regular line is a curve on a cylindrical surface.
  • the posture of the mobile phone when the image is collected and the image collection time can be used to mark the position deviating from the indicator arrow, to switch the target sub-path, and to determine whether the center line of the image exceeds the cropping range, etc.
  • the three-dimensional coordinate axes include x-axis, y-axis, and z-axis.
  • the plane where the mobile phone lens is located is on the xy plane or parallel to the xy plane, and the z axis is perpendicular to the plane where the mobile phone lens is located.
  • the plane where the lens of the mobile phone is located is also parallel to the screen where the screen of the mobile phone is located.
  • the posture of the mobile phone when collecting images can be represented by the rotation angle of the mobile phone around the x-axis, y-axis, and z-axis.
  • the mobile phone rotates along the horizontal sub-path the mobile phone rotates around the y-axis.
  • the mobile phone rotates along the vertical sub-path the mobile phone rotates around the x-axis.
  • Equation 1 the rotation angle ⁇ 'of the mobile phone around the x-axis between the collection moments of two adjacent frames of images.
  • T 0 represents the time corresponding to the previous frame
  • T 1 represents the time corresponding to the next frame
  • t k represents the time corresponding to the k-th gyroscope data
  • t k-1 represents the time corresponding to the k-1th gyroscope data
  • t 0 represents the time corresponding to the 0th gyroscope data
  • It represents the rotational angular velocity of the Nth gyroscope between T 0 and T 1
  • t N represents the time corresponding to the Nth gyroscope data.
  • the mobile phone can also obtain the rotation angle of the mobile phone around the y-axis between the collection moments of two adjacent frames of images.
  • the rotation angle ⁇ of the phone around the x-axis and the rotation angle ⁇ around the y-axis at the time of collection of any frame of image can be obtained (also called the rotation angle ⁇ corresponding to any frame of image And the rotation angle ⁇ ).
  • the horizontal centerline of the first frame of image mapped to the cylindrical surface coincides with the center baseline on the cylindrical surface.
  • the upper and lower baselines are rotated by a certain angle around the x-axis relative to the middle baseline, and the rotation angles are denoted by ⁇ t and ⁇ b respectively .
  • the rotation angles of the horizontal cutting lines 1-4 around the x-axis can also be denoted as ⁇ 1 , ⁇ 2 , ⁇ 3 , and ⁇ 4, respectively .
  • the values of these rotation angles can be used to adjust the extension range of the vertical view angle when stitching panoramic images, and the maximum range within which the horizontal center line of the image can deviate from the baseline.
  • the right baseline rotates a certain angle around the y axis relative to the left baseline, which is recorded as ⁇ r .
  • the rotation angles of the left border, the left clipping line, the right clipping line, and the right border around the y-axis can be denoted as ⁇ 1 , ⁇ 2 , ⁇ 3 , ⁇ 4, respectively .
  • the corresponding relationship between each ruled line and the rotation angle can be seen in FIG. 7.
  • the mobile phone can determine the horizontal centerline of the current image by the rotation angle ⁇ of the mobile phone when each frame of image is collected, thereby drawing a deviation indicator arrow corresponding to the rotation angle ⁇ on the shooting interface.
  • the mobile phone can determine whether the deviation indicator arrow exceeds the deviation range indicator line of the horizontal sub-path according to the rotation angle ⁇ , and the mobile phone can also determine whether the deviation indicator arrow exceeds the deviation range indicator line of the vertical sub-path according to the rotation angle ⁇ .
  • the mobile phone can also determine whether to switch the target sub-path according to the rotation angle ⁇ and the rotation angle ⁇ .
  • the target sub-path is different
  • the image stitching method is also different.
  • the guide path shown in (a) of FIG. 4A will be used as an example for description.
  • the target sub-path is the middle sub-path, and the baseline image is spliced
  • the phone After shooting, the phone first rotates to the right along the middle sub-path.
  • the image collected by the phone can be called the middle baseline image or the image of the middle sub-path.
  • the target sub-path is the middle sub-path, and the rotation angle ⁇ Constantly changing from 0.
  • the mobile phone After the mobile phone collects the baseline image in the first frame (that is, the first frame image of the intermediate sub-path), it performs cylindrical mapping on the first frame image according to formula 2-4 to obtain the baseline image' in the first frame on the cylindrical surface.
  • the phone rotates upward by a certain angle, and the scale change of the upper boundary of the image after mapping is greater than the scale change of the lower boundary.
  • the phone rotates downward by a certain angle, and the scale change of the upper boundary of the image after mapping is smaller than the scale change of the lower boundary.
  • the mapping result of the baseline image in the first frame is symmetric with respect to the middle baseline level.
  • the left edge of the baseline image in the first frame is the left edge of the entire panoramic image. See Figure 10.
  • the part of the baseline image in the first frame that lies within the cropping range is the initial mid-baseline image stitching result RI1, that is, the deviation indicating arrow edge
  • the initial target image RI1 obtained by stitching when the middle sub-path moves.
  • the mobile phone displays the middle baseline image stitching result RI1 in the stitching preview window.
  • the mobile phone further calculates according to the matching result with The homography matrix H. See (a) in Figure 12, the mobile phone will Towards Map it. The phone will be mapped The rectangular part within the cropping range (that is, the rectangular part filled with horizontal lines in (a) in Figure 12) is cropped and spliced to the middle baseline image stitching result RI(i-1) (that is, in (a) in Figure 12). The right side of the rectangular part filled with stripes); thereby forming the middle baseline image stitching result RIi, that is, the target image RIi obtained by stitching when the deviation indicator arrow moves along the middle sub-path.
  • the cropping range corresponding to the middle baseline image is the range defined by the second cropping line, the third cropping line, the left boundary line, and the right boundary line.
  • the mid-baseline image stitching result RIi displayed in the stitching preview window of the mobile phone can be seen in (b) in FIG. 12.
  • the user continues to turn the phone along the middle sub-path.
  • the mobile phone repeats the above collection, mapping and splicing process until ⁇ > ⁇ r .
  • all the mid-baseline image frames collected by the mobile phone along the middle sub-path are stitched, thereby generating a middle-baseline image stitching result RI, that is, the stitching result RI corresponding to the middle sub-path.
  • cut lines may be used as the right boundary of the right side thereof, beyond the right boundary portion may be cut.
  • the mobile phone can select key frames according to the preset algorithm and combined with the rotation angle ⁇ corresponding to the mid-baseline image, so that these key frames overlap partially and are basically evenly distributed.
  • These key frames can make the upper and lower baseline image stitching results and the middle baseline image stitching results better match and merge.
  • the interval ⁇ of the rotation angle around the y-axis between adjacent key frames can be flexibly set according to factors such as the size of the buffer or actual requirements.
  • FIG. 13 for a schematic diagram of the key frames acquired in the mid-baseline image.
  • the rotation angle ⁇ changes continuously with the rotation of the mobile phone.
  • the mobile phone displays the middle sub-path, the right sub-path, the upper sub-path, the left sub-path, and the lower sub-path that have not been photographed.
  • the mobile phone see (a) in Figure 14A, the mobile phone only displays the currently targeted middle sub-path; see (b) in Figure 14A, and then display the right sub-path when it is about to switch to the right sub-path .
  • the mobile phone displays the complete shooting path on the shooting interface, and the guide path for the completed shooting is a dotted line, and the guide path for the unfinished shooting is a solid line. In other embodiments, the mobile phone still displays the complete guidance path.
  • the mobile phone can prompt the user to take the sequence of different sub-paths in the first direction through the sub-path in the second direction.
  • the mobile phone can prompt the user to take pictures along the different sub-paths by means of display information or voice broadcast. A description will be given by taking the guide path as the path shown in (a) in FIG. 4B as an example.
  • the mobile phone displays the middle sub-path, upper sub-path and lower sub-path that have not been photographed.
  • the deviating indicator arrow reaches the end of the middle sub-path
  • the mobile phone highlights the upper sub-path to prompt the user to follow the upper sub-path next.
  • the path turns the phone to shoot.
  • deviation range indication lines are displayed on both sides of the middle sub-path.
  • the shooting along the middle sub-path that is, when the target sub-path is the middle sub-path, if ⁇ 3 ⁇ 2 , then the deviation indication
  • the arrow is located within the maximum deviation range of the middle sub-path; if ⁇ > ⁇ 2 , or ⁇ 3 , the deviation indicator arrow exceeds the maximum deviation range of the middle sub-path, and the mobile phone stops shooting.
  • the image collected by the mobile phone may not include the complete cropping range.
  • the size of the image retained by the mobile phone after cropping according to the preset cropping range is smaller than the cropping range, that is, less than The other images captured by the camera are cropped and retained. Therefore, after the retained image is spliced to the panoramic image, the panoramic image will have blank parts, which will result in poor splicing effect. Therefore, the mobile phone can stop the shooting process.
  • the mobile phone may also prompt the user on the shooting interface or by voice or other means that the camera has automatically stopped shooting if the maximum deviation range is exceeded.
  • the target sub-path is the right sub-path
  • the deviating indicator arrow When the deviating indicator arrow reaches the end of the middle sub-path, and the rotation angle of the phone ⁇ > ⁇ r or ⁇ 3 ⁇ ⁇ 4 , the image on the middle sub-path has been taken, and the user is guided to turn the phone upwards along the right sub-path. Make the deviation indicator arrow move upward along the right sub-path. In the process of deviating the indicating arrow and moving upward along the right sub-path, the rotation angle ⁇ changes continuously with the rotation of the mobile phone. In some technical solutions, referring to FIG. 15, the mobile phone displays the unfinished right sub-path 1501, the upper sub-path, the left sub-path, and the lower sub-path 1501.
  • the dotted lines on both sides of the right sub-path 1501 represent the deviation range indicator line
  • the arrow 1502 represents the deviation indicator arrow.
  • the mobile phone only displays the currently targeted right sub-path.
  • the mobile phone displays the complete shooting path on the shooting interface, and the guide path for the completed shooting is a dotted line, and the guide path for the unfinished shooting is a solid line. In other embodiments, the mobile phone still displays the complete guidance path.
  • the mobile phone may not perform image stitching.
  • the target sub-path is the upper sub-path, and the baseline image is spliced
  • the deviation indicator arrow When the deviation indicator arrow reaches the end of the right sub-path, and the rotation angle of the mobile phone is ⁇ > ⁇ t or ⁇ 2 ⁇ 1 , the user is guided to turn the mobile phone to the left along the upper sub-path, so that the deviation indicator arrow follows the upper sub-path move to the left.
  • the image collected by the mobile phone can be called the upper baseline image or the image of the upper sub-path, and the target sub-path is the upper sub-path. It is understandable that the first frame of the upper baseline image taken by the mobile phone along the upper sub-path is also the last frame of the image taken along the right sub-path.
  • the rotation angle ⁇ changes continuously with the rotation of the mobile phone.
  • the mobile phone displays the upper sub-path 1601, the left sub-path, and the lower sub-path that have not been photographed.
  • the dotted lines on both sides of the upper sub-path 1601 represent the deviation range indicator line
  • the arrow 1602 represents the deviation indicator arrow.
  • the mobile phone only displays the currently targeted upper sub-path.
  • the mobile phone displays the complete shooting path on the shooting interface, and the guide path for the completed shooting is a dotted line, and the guide path for the unfinished shooting is a solid line. In other embodiments, the mobile phone still displays the complete guidance path.
  • the deviation range indicator lines are displayed on both sides of the upper sub-path.
  • the deviation indicator arrow is located within the maximum deviation range of the upper sub-path; if ⁇ > ⁇ 1 , or ⁇ 2 , the deviation indicator arrow exceeds the maximum deviation range of the upper sub-path, and the mobile phone stops shooting.
  • the mobile phone may also prompt the user on the shooting interface or by voice or other means that the camera has automatically stopped shooting if the maximum deviation range is exceeded.
  • the mobile phone stitches the upper baseline image, which specifically includes processes such as cylindrical surface mapping, feature extraction, feature matching, and image stitching.
  • the mobile phone determines a target key frame whose rotation angle ⁇ is closest to the rotation angle ⁇ 1 corresponding to the baseline image on the first frame from the above key frames according to a preset algorithm as the reference frame G f1 , that is, G f1 is a key frame matching A 1.
  • G f1 is a key frame matching A 1.
  • the difference between the rotation angles around the y axis corresponding to G f1 and A 1 is the smallest.
  • the mobile phone extracts the image after G f1 cylindrical surface mapping The feature points F A, f1 .
  • the mobile phone maps the upper baseline image A 1 in the first frame to the cylindrical surface according to the above formula 2-4 to obtain the upper baseline image in the first frame. And get the baseline image on the first frame' The feature points F A, f1 .
  • the mobile phone calculates the matching result of F A,1 and F A,f1 , and calculates the homography matrix H according to the matching result.
  • the H matrix obtained according to the target key frame is more accurate, and can be better registered with the key frame in the mid-baseline image, so that it can be matched with the mid-baseline splicing result.
  • Phone will Towards Map it.
  • the mobile phone will map the The rectangular part within the cropping range is cropped and stitched to the upper right of the middle baseline image stitching result RI to form the upper baseline image stitching result RA1 (that is, the horizontal line filling part), that is, stitching when the deviation indicator arrow moves along the upper sub-path
  • the cropping range corresponding to the upper baseline image is the range defined by the first cropping line, the second cropping line, the left boundary line, and the right boundary line.
  • the first I (an integer greater than 1) a baseline frame of image A i, the mobile phone according to a preset algorithm, determining a rotation angle beta] and A i ⁇ i closest to the rotational angle of the target from said key frames in the key frame as a reference frame G fi . That is, G fi is a key frame that matches A i.
  • the mobile phone extracts the image after the G fi cylindrical surface mapping
  • the feature point F A,fi of the mobile phone maps A i to the cylindrical surface according to the above formula 2-4, so as to obtain the baseline image on the i-th frame.
  • the feature points F A,fi of the mobile phone can also extract the baseline image A i-1 on the i-1th frame after mapping it to the cylindrical surface, and the baseline image on the i-1th frame is obtained.
  • the feature point F A,i-1 The mobile phone calculates the matching results of F A,i , F A,i-1 , and F A,fi to calculate the homography matrix H.
  • the H matrix obtained in this way is more accurate, and can be better registered with the key frame while registering with the baseline image on the previous frame. Phone will Towards with Map it.
  • the phone will map The rectangular part within the cropping range is cropped and stitched to the left of the upper baseline image stitching result RA(i-1) and the upper side of the middle baseline image stitching result RI, thereby forming the upper baseline image stitching result RAi (i.e. horizontal Line filling part), that is, the target image RAi obtained by stitching when the deviation indicator arrow moves along the upper sub-path.
  • the mobile phone displays the upper baseline image stitching result RAi that is stitched above the middle baseline image stitching result RI in the stitching preview window.
  • the user continues to turn the phone along the upper sub-path.
  • the mobile phone repeats the above collection, mapping and splicing process until ⁇ 0.
  • all the upper baseline image frames collected by the mobile phone along the middle sub-path are spliced, thereby generating the upper baseline image splicing result RA, that is, the splicing result RA corresponding to the upper sub-path.
  • the left border can be used as the left side of the crop line, and the part beyond the left border can be cut off.
  • the mobile phone registers the key frames in the upper baseline image and the middle baseline image, which can correct the misalignment error between the upper baseline image and the middle baseline splicing result in time, so that the upper baseline image and the middle baseline image are spliced
  • the results are accurately registered to achieve global registration.
  • the upper baseline image stitching result and the middle baseline image stitching result can form a smooth, natural transition overall image.
  • the target sub-path is the left sub-path
  • the deviating indicator arrow When the deviating indicator arrow reaches the end of the upper sub-path, and the rotation angle of the phone ⁇ 0 or ⁇ 1 ⁇ 2 , the image on the upper sub-path has been taken, and the user is guided to turn the phone down along the left sub-path. Make the deviation indicator arrow move down along the left sub-path. In the process of deviating the indicating arrow and moving down the left sub-path, the rotation angle ⁇ changes continuously with the rotation of the mobile phone.
  • the mobile phone displays the left sub-path 1701 and the lower sub-path that have not been photographed. Among them, the dashed lines on both sides of the left sub-path 1701 represent the deviation range indicator line, and the arrow 1702 represents the deviation indicator arrow.
  • the mobile phone only displays the currently targeted left sub-path. In some other technical solutions, the mobile phone displays the complete shooting path on the shooting interface, and the guide path for the completed shooting is a dotted line, and the guide path for the unfinished shooting is a solid line. In other embodiments, the mobile phone still displays the complete guidance path.
  • the deviation range indicator line is displayed on both sides of the left sub-path.
  • the deviation indicates the maximum deviation of the arrow on the left sub-path Within the range; if the rotation angle ⁇ 1 or ⁇ > ⁇ 2 , the deviation indicator arrow exceeds the maximum deviation range of the left sub-path, and the phone stops shooting.
  • the target sub-path is the lower sub-path, and the baseline image is stitched together
  • the deviating arrow When the deviating arrow reaches the end of the left sub-path, and the rotation angle of the phone is ⁇ b or ⁇ 3 ⁇ 4 , guide the user to turn the phone to the right along the lower sub-path, so that the deviating arrow follows the lower sub-path move to the right.
  • the image collected by the mobile phone can be called the lower baseline image or the image of the lower sub-path, and the target sub-path is the lower sub-path. It is understandable that the first frame of the lower baseline image taken by the mobile phone along the lower sub-path is also the last frame of the image taken along the left sub-path.
  • the rotation angle ⁇ changes continuously with the rotation of the mobile phone.
  • the mobile phone displays the lower sub-path 1801 that has not been photographed.
  • the dashed lines on both sides of the lower sub-path 1801 represent the deviation range indicator line
  • the arrow 1802 represents the deviation indicator arrow.
  • the mobile phone displays the complete upper sub-path that is currently targeted.
  • the mobile phone displays the complete shooting path on the shooting interface, and the guide path for the completed shooting is a dotted line, and the guide path for the unfinished shooting is a solid line. In other embodiments, the mobile phone still displays the complete guidance path.
  • the method of stitching the lower baseline image by the mobile phone is the same as that of the lower baseline image.
  • the mobile phone determines a rotation angle ⁇ and the first frame from the above key frames according to a preset algorithm.
  • the target key frame with the closest rotation angle ⁇ 1 corresponding to the baseline image under the frame is used as the reference frame C f1 , and the image after the cylindrical surface mapping of C f1 is extracted Feature points F C,f1 .
  • the mobile phone maps the lower baseline image B 1 in the first frame to the cylindrical surface according to the above formula 2-4 to obtain the lower baseline image in the first frame.
  • the mobile phone calculates the matching result of F B,1 and F C,f1 , thereby calculating the homography matrix H according to the matching result. Then, according to the matrix H, the mobile phone will Towards Map it.
  • the H matrix obtained by combining the target key frame is more accurate, which enables the lower baseline image to be better registered with the key frame, so that the registration can be replaced with the middle baseline splicing result.
  • the phone will map The rectangular part within the cropping range is cropped and stitched to the lower left of the middle baseline image stitching result RI to form the lower baseline image stitching result RB1, that is, the target image RB1 obtained by stitching when the deviation indicator arrow moves along the lower sub-path.
  • the cropping range corresponding to the lower baseline image is the range defined by the third cropping line, the fourth cropping line, the left boundary line, and the right boundary line.
  • the mobile phone displays the lower baseline image stitching result RB1 stitched below the middle baseline stitching result RI on the shooting interface, see (b) in FIG. 18.
  • the upper baseline splicing result RA is also spliced above the middle baseline splicing result RI.
  • the mobile phone determines a target key frame whose rotation angle ⁇ is closest to the rotation angle ⁇ i of I i from the above key frames according to a preset algorithm as the reference frame C fi , and extract the image after C fi cylindrical surface mapping Feature points F c,fi .
  • the mobile phone maps B i to the cylindrical surface according to the above formula 2-4 to obtain the baseline image under the i-th frame' The feature point F B,i .
  • the mobile phone calculates F B,i , the image after the baseline image B i-1 is mapped to the cylindrical surface in the i-1th frame Feature points F B,i-1 , and the matching results of F c,fi to calculate the homography matrix H.
  • the H matrix obtained in this way is more accurate, and can be better registered with the key frame while registering with the baseline image of the previous frame.
  • Phone will Towards with Map it. The phone will be mapped The rectangular part within the cropping range is cropped and stitched to the right of the lower baseline image stitching result RB(i-1) to form the lower baseline image stitching result RBi, which is obtained by stitching when the deviation indicator arrow moves along the lower sub-path The target image RBi.
  • the user continues to turn the phone along the sub-path below.
  • the mobile phone repeats the above collection, mapping and splicing process until ⁇ > ⁇ r .
  • all the lower baseline image frames collected by the mobile phone along the middle sub-path are stitched together, and the lower baseline image stitching result RB is generated, that is, the stitching result RB corresponding to the lower sub-path, the entire panoramic image stitching is completed, and the entire shooting process ends.
  • cut lines may be used as the right boundary of the right side thereof, beyond the right boundary portion may be cut.
  • a schematic diagram of the stitching result of the baseline image in the last frame see (c) in FIG. 18.
  • the mobile phone registers the key frames in the lower baseline image and the middle baseline image, which can correct the misalignment error between the lower baseline image and the middle baseline splicing result in time, so that the lower baseline image and the middle baseline image splicing result can be accurately matched.
  • the stitching result of the lower baseline image and the middle baseline image can form a smooth, natural transition overall image.
  • the panoramic image generated by the mobile phone may refer to the thumbnail 1901 shown in (a) in FIG. 19 and the thumbnail 1902 in the gallery shown in (b) in FIG. 19.
  • the mobile phone detects the user's operation to stop shooting (for example, the user clicks the operation of the stop shooting control 1803 shown in (b) in FIG. 18), the shooting of the panoramic image is stopped.
  • the mobile phone stops shooting.
  • the mobile phone detects the user's operation to stop shooting, it will stop shooting.
  • the target sub-path is the middle sub-path when the shooting is suspended
  • the obtained panoramic image is the result of the middle baseline image stitching when the shooting is suspended.
  • the panoramic image obtained by the mobile phone is the complete mid-baseline image stitching result. If the target sub-path is the left sub-path or the lower sub-path when the shooting is stopped, the panoramic image obtained by the mobile phone is the complete middle baseline image and the upper baseline image stitching result. In this way, it can be avoided that in the panoramic image captured by the mobile phone, the field angle of the middle baseline image stitching result is larger and the field angle of the upper baseline image or the lower baseline image stitching result is smaller, resulting in irregular and irregular panoramic images obtained. whole.
  • the mobile phone can also generate a video after stopping shooting, and the video image is the spliced image displayed in the splicing preview window during the shooting process.
  • the mobile phone can dynamically present the image splicing process during the shooting process to the user.
  • the mobile phone may also save the image sequence collected according to the guide path during the shooting process, and in response to the user's editing operation of the image sequence, the mobile phone may generate a panoramic image.
  • the mobile phone can expand the field of view of the panoramic image in the horizontal direction by splicing the upper baseline image, upper baseline image, or lower baseline image in the horizontal direction; by combining the upper baseline image and the middle baseline image Perform registration and stitching, and register and stitch the lower baseline image and the middle baseline image. It can also expand the angle of view of the panoramic image in the vertical direction, thereby making the entire angle of view of the panoramic image larger and improving the user Shooting experience.
  • cylindrical mapping can match the size and imaging characteristics of the same object after mapping on the image taken by the mobile phone from different angles, so that the images taken from different angles can be registered and stitched.
  • a panoramic image is generated, which can conform to the visual effect that the image size of each part of the panoramic image is basically the same.
  • the panoramic image is not a simple combination of the splicing results of the upper, middle, and lower baseline images.
  • Each kind of baseline image stitching result is obtained by registration and stitching based on multiple homography matrices H, and each small part corresponds to a different homography matrix H, so different types of baseline image stitching results cannot be calculated between A homography matrix H enables good correspondence and matching between the parts of the two baseline image stitching results, so it is impossible to simply directly stitch the upper, middle, and lower baseline image stitching results.
  • the upper baseline image and the lower baseline image are also registered and spliced according to the key frame of the middle baseline.
  • the misalignment error of the splicing result of the upper and lower baseline images and the middle baseline can be corrected in time, so that the upper baseline The image, the lower baseline image and the middle baseline image stitching results are accurately registered to achieve global registration.
  • the upper baseline image stitching results, the middle baseline image stitching results, and the lower baseline image stitching results can be better integrated to form An overall image with a smooth, natural transition.
  • the beginning of the guide path is the left end of the middle sub-path
  • the end of the guide path is the end of the lower sub-path.
  • the guide paths of different start and end can refer to (a)-(f) in FIG. 20. It is understandable that in case 1, other guiding paths other than the example shown in FIG. 20 may also be included, which are not limited in the embodiment of the present application.
  • the guide path when the mobile phone is in a different state such as a vertical screen or a horizontal screen, the guide path will change accordingly with the state of the mobile phone.
  • a different state such as a vertical screen or a horizontal screen
  • the guide path will change accordingly with the state of the mobile phone.
  • the preview interface displayed by the mobile phone can be seen in FIG. 21.
  • the first direction is the vertical direction
  • the second direction is the horizontal direction
  • the first direction is the vertical direction
  • the second direction is the horizontal direction.
  • the guide path includes at least two sub-paths in the vertical direction.
  • the guide path may further include at least one horizontal sub-path for connecting the vertical sub-path.
  • a schematic diagram of a preview interface displayed by the mobile phone can be seen in FIG. 22A.
  • the guide path can also take many different forms according to the beginning, end, or running direction. Exemplarily, the different start and end guide paths can be referred to (a)-(c) in FIG. 22B. It is understandable that in case 1, other guiding paths other than the example illustrated in FIG.
  • case 22B may be included, which are not limited in the embodiment of the present application.
  • the panoramic shooting method corresponding to case 2 is similar to case 1, and will not be repeated here. The difference is: in case 1, the mobile phone stitches the images according to the three baselines in the horizontal direction; and in case 2, the mobile phone uses the vertical direction The three baselines of the image are stitched together.
  • case 1 is suitable for shooting scenes with a large field of view in the horizontal direction
  • case 2 is suitable for shooting scenes with a large field of view in the vertical direction (for example, shooting high-rise buildings).
  • the schematic diagram of the image splicing result in the splicing preview window can be seen in FIG. 22C.
  • the mobile phone can expand the angle of view of the panoramic image in the vertical direction by stitching the images collected along a certain vertical sub-path;
  • the splicing of the images collected by the sub-path can also expand the angle of view of the panoramic image in the horizontal direction, thereby making the entire angle of view of the panoramic image larger and improving the user's shooting experience.
  • the user can select or switch the guide path mode corresponding to the situation 1 or the situation 2 to take the panoramic image according to the actual needs of the shooting scene.
  • the guide path may refer to (a) in FIG. 24, and the panoramic image obtained by shooting may refer to FIG. (B) in 24. It is understandable that when the start, end, or running direction is different, the guide path can also take many different forms.
  • the guide path when the guide path includes two sub-paths, although the guide path reduces one sub-path in the first direction, it can still expand the field of view in the second direction and simplify the panoramic view. The shooting process of the image.
  • the first direction may also include more than three sub-paths
  • the second direction may include multiple sub-paths for connecting the sub-paths in the first direction.
  • the guide path including 4 sub-paths in the horizontal direction can be seen in (a)-(b) in FIG. 25, and the panoramic image obtained by shooting can be seen in (c) in FIG. 25.
  • the mobile phone can expand the range of the field of view in the second direction perpendicular to the first direction.
  • the electronic device is a mobile phone.
  • the method described in the above embodiment can also be used to perform panoramic shooting, which will not be repeated here.
  • the electronic device includes hardware and/or software modules corresponding to each function.
  • the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed by hardware or computer software-driven hardware depends on the specific application and design constraint conditions of the technical solution. Those skilled in the art can use different methods for each specific application in combination with the embodiments to implement the described functions, but such implementation should not be considered as going beyond the scope of the present application.
  • the electronic device can be divided into functional modules according to the foregoing method examples.
  • each functional module can be divided corresponding to each function, or two or more functions can be integrated into one processing module.
  • the above-mentioned integrated modules can be implemented in the form of hardware. It should be noted that the division of modules in this embodiment is illustrative, and is only a logical function division, and there may be other division methods in actual implementation.
  • the electronic device 2600 may include a camera 2601, an ISP 2602, an input buffer unit 2603, a calculation processing unit 2604, an inertial measurement unit (IMU) 2605, and an output buffer unit 2606 , Encoder 2607, display unit 2608, and other units/modules.
  • a camera 2601 an ISP 2602, an input buffer unit 2603, a calculation processing unit 2604, an inertial measurement unit (IMU) 2605, and an output buffer unit 2606 , Encoder 2607, display unit 2608, and other units/modules.
  • IMU inertial measurement unit
  • the ISP processes the image frames collected by the camera and outputs them to the input buffer unit.
  • the calculation processing unit performs corresponding cropping and splicing processing on the image data in the input buffer unit according to the data of the IMU, and outputs the processing result to the output buffer unit.
  • the display unit displays the interface and guide information according to the processing result in the output buffer unit.
  • the encoder encodes the image data in the processing result and outputs it to a gallery or other applications.
  • the calculation processing unit initializes various parameters in the scene, including the rotation angle ⁇ t around the x axis corresponding to the upper and lower baselines, ⁇ b (the middle baseline rotation angle ⁇ is 0), first, 2,3,4 The rotation angle corresponding to the clipping boundary ⁇ 1 , ⁇ 2 , ⁇ 3 , ⁇ 4 , the rotation angle ⁇ r around the y-axis corresponding to the right baseline (the left baseline rotation angle ⁇ is 0), the left boundary and the left clipping The rotation angles ⁇ 1 , ⁇ 2 , ⁇ 3 , ⁇ 4 corresponding to the line, the right clipping line, and the right border, and the key frame interval ⁇ , etc.
  • the calculation processing unit determines the position of the guidance information according to the rotation angle.
  • the display screen can display a preview interface as shown in (b) of FIG. 4A, and the preview interface includes guidance information.
  • the ISP processes the image frame received by the camera and sends it to the calculation processing unit.
  • the calculation processing unit refreshes the interface in real time according to the shooting process, and the display screen displays the shooting interface as shown in (a) in FIG. 6.
  • the calculation and processing unit stitches the mid-baseline images collected by the camera.
  • the output buffer unit buffers the key frames and the splicing result, and the display screen displays the splicing result.
  • the display shows the screen shown in FIG shot 15, to guide the user rotates the electronic device upwards.
  • the display screen displays the shooting interface as shown in Fig. 16A to guide the user to turn the electronic device to the left, and the calculation processing unit stitches the upper baseline image collected by the camera according to the key frame .
  • the output buffer unit buffers the splicing result, and the display screen displays the splicing result.
  • the display screen displays the shooting interface as shown in FIG. 17 to guide the user to turn the electronic device downward.
  • the rotation angle ⁇ ⁇ b of the electronic device the screen display shown in FIG.
  • An embodiment of the present application also provides an electronic device, including: a camera for collecting images; a display screen for displaying an interface; one or more processors and one or more memories.
  • the one or more memories are coupled with one or more processors, and the one or more memories are used to store computer program codes.
  • the computer program codes include computer instructions.
  • the electronic device executes The above-mentioned related method steps implement the panoramic shooting method in the above-mentioned embodiment.
  • An embodiment of the present application also provides an electronic device including one or more processors and one or more memories.
  • the one or more memories are coupled with one or more processors, and the one or more memories are used to store computer program codes.
  • the computer program codes include computer instructions.
  • the electronic device executes The above-mentioned related method steps implement the panoramic shooting method in the above-mentioned embodiment.
  • the embodiments of the present application also provide a computer-readable storage medium that stores computer instructions in the computer-readable storage medium.
  • the computer instructions run on an electronic device, the electronic device executes the above-mentioned related method steps to implement the above-mentioned embodiments. Panorama shooting method in.
  • the embodiments of the present application also provide a computer program product, which when the computer program product runs on a computer, causes the computer to execute the above-mentioned related steps, so as to realize the panoramic photography method executed by the electronic device in the above-mentioned embodiment.
  • the embodiments of the present application also provide a device.
  • the device may specifically be a chip, component, or module.
  • the device may include a processor and a memory connected to each other.
  • the memory is used to store computer execution instructions.
  • the processor can execute the computer-executable instructions stored in the memory, so that the chip executes the panoramic shooting method executed by the electronic device in the foregoing method embodiments.
  • the electronic device, computer readable storage medium, computer program product, or chip provided in this embodiment are all used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the above provided The beneficial effects of the corresponding method will not be repeated here.
  • the disclosed device and method can be implemented in other ways.
  • the device embodiments described above are merely illustrative.
  • the division of the modules or units is only a logical function division.
  • there may be other division methods for example, multiple units or components may be It can be combined or integrated into another device, or some features can be omitted or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate parts may or may not be physically separate.
  • the parts displayed as units may be one physical unit or multiple physical units, that is, they may be located in one place, or they may be distributed to multiple different places. . Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium.
  • the technical solutions of the embodiments of the present application are essentially or the part that contributes to the prior art, or all or part of the technical solutions can be embodied in the form of a software product, and the software product is stored in a storage medium. It includes several instructions to make a device (may be a single-chip microcomputer, a chip, etc.) or a processor (processor) execute all or part of the steps of the method described in each embodiment of the present application.
  • the aforementioned storage media include: U disk, mobile hard disk, read only memory (read only memory, ROM), random access memory (random access memory, RAM), magnetic disk or optical disk and other media that can store program codes.

Abstract

Embodiments of the present application relate to the field of electronic technology, and provided therein are a panoramic image capture method and device, which can splice images, acquired from different angles, in two directions perpendicular to one another so as to generate a panoramic image, so that the field of view of the panoramic image can be expanded in the two directions, improving the panoramic image capture experience of a user. The specific solution being: an electronic device enters a panoramic image capture mode of a camera application; the electronic device displays first guidance information on a preview interface, the first guidance information comprises a first guide path, the first guide path comprises at least two sub-paths that are disposed along a first direction and that are parallel to one another, the first direction is parallel to a side edge of the electronic device, and the first guide path is used to guide a user to rotate the electronic device along the first guide path during an image capture process. The embodiments of the present invention are used for image capturing panoramic images.

Description

一种全景拍摄方法及设备Method and equipment for panoramic shooting
本申请要求于2020年05月29日提交国家知识产权局、申请号为202010478652.1、申请名称为“一种全景拍摄方法及设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the State Intellectual Property Office on May 29, 2020, the application number is 202010478652.1, and the application name is "a method and equipment for panoramic shooting", the entire content of which is incorporated into this application by reference middle.
技术领域Technical field
本申请实施例涉及电子技术领域,尤其涉及一种全景拍摄方法及设备。The embodiments of the present application relate to the field of electronic technology, and in particular to a panoramic shooting method and device.
背景技术Background technique
随着电子技术的发展,手机等电子设备的相机功能越来越强大。电子设备可以支持多种拍摄模式和功能。比如,电子设备可以支持夜景拍摄、美肤拍摄、延时摄影拍摄或全景拍摄等。其中,在全景拍摄时,手机可以按照如图1所示的引导线01引导用户转动手机,使得手机采集多帧不同角度的图像,并将不同角度的图像在引导线01的延伸方向上进行拼接,从而形成一个视场角较广的全景图像。然而,这种全景拍摄方式缺少新意,无法满足用户日益增长的多样化拍摄需求。With the development of electronic technology, the camera functions of mobile phones and other electronic devices have become more and more powerful. The electronic device can support multiple shooting modes and functions. For example, the electronic device can support night scene shooting, skin beautification shooting, time-lapse photography shooting, or panoramic shooting. Among them, in the panoramic shooting, the mobile phone can guide the user to turn the mobile phone according to the guide line 01 shown in Figure 1, so that the mobile phone collects multiple frames of images with different angles, and stitches the images with different angles in the extension direction of the guide line 01 , So as to form a panoramic image with a wide field of view. However, this panoramic shooting method lacks novelty and cannot meet the growing diverse shooting needs of users.
发明内容Summary of the invention
本申请实施例提供一种全景拍摄方法及设备,能够将不同角度采集的图像在相互垂直的两个方向上分别进行拼接以生成全景图像,从而可以在两个方向上扩展全景图像的视场角,提高用户的全景拍摄体验。The embodiments of the present application provide a panoramic shooting method and device, which can respectively stitch images collected from different angles in two mutually perpendicular directions to generate a panoramic image, so that the angle of view of the panoramic image can be expanded in two directions , Improve the user's panoramic shooting experience.
为达到上述目的,本申请实施例采用如下技术方案:In order to achieve the foregoing objectives, the following technical solutions are adopted in the embodiments of the present application:
一方面,本申请实施例提供了一种全景拍摄方法,包括:电子设备进入相机应用的全景拍摄模式。电子设备在预览界面上显示第一引导信息,第一引导信息包括第一引导路径。其中,第一引导路径包括沿第一方向设置且相互平行的至少两条子路径,第一方向与电子设备的一条侧边平行,第一引导路径用于引导用户在拍摄过程中沿第一引导路径转动电子设备。On the one hand, an embodiment of the present application provides a panoramic shooting method, including: an electronic device enters a panoramic shooting mode of a camera application. The electronic device displays the first guide information on the preview interface, and the first guide information includes the first guide path. Wherein, the first guide path includes at least two sub-paths that are arranged along a first direction and are parallel to each other, the first direction is parallel to a side of the electronic device, and the first guide path is used to guide the user along the first guide path during the shooting process. Turn the electronic device.
在该方案中,预览界面上显示有引导路径,该引导路径包括沿第一方向设置且相互平行的至少两条子路径,以引导用户在拍摄过程中沿该引导路径转动电子设备。这样,在全景图像的拍摄过程中,电子设备沿着某条沿第一方向设置的子路径采集图像并进行图像拼接时,可以扩展全景图像在第一方向的视场角;当电子设备沿着多条沿第一方向设置的子路径采集图像并进行图像拼接时,可以在扩展全景图像在第一方向的视场角的同时,还可以扩展全景图像在与第一方向垂直的第二方向上的视场角。In this solution, a guide path is displayed on the preview interface, and the guide path includes at least two sub-paths arranged in a first direction and parallel to each other, so as to guide the user to rotate the electronic device along the guide path during the shooting process. In this way, in the process of shooting a panoramic image, when the electronic device collects images along a certain sub-path set along the first direction and performs image splicing, the angle of view of the panoramic image in the first direction can be expanded; When multiple sub-paths set along the first direction collect images and perform image stitching, the panoramic image can be expanded in a second direction perpendicular to the first direction while expanding the angle of view of the panoramic image in the first direction. The angle of view.
在一种可能的设计中,沿第一方向设置的不同子路径,在第一方向上对应的坐标范围存在重叠。In a possible design, the coordinate ranges corresponding to the different sub-paths set along the first direction overlap in the first direction.
也就是说,沿第一方向设置且相互平行的不同子路径不是完全错开的。In other words, the different sub-paths that are arranged along the first direction and are parallel to each other are not completely staggered.
在另一种可能的设计中,沿第一方向设置的不同子路径,在第一方向上对应的坐标范围相同。In another possible design, different sub-paths set along the first direction correspond to the same coordinate range in the first direction.
也就是说,沿第一方向设置的不同子路径的两端分别对齐,且不同子路径具有相同的长度。That is, the two ends of the different sub-paths arranged along the first direction are respectively aligned, and the different sub-paths have the same length.
在另一种可能的设计中,预览界面上还包括拼接预览窗口,用于显示电子设备采集到的图像的缩略图。并且,该拼接预览窗口位于第一引导路径的始端。这样,在一些情况下,拼接预览窗口可能会遮挡会占用一部分引导路径。In another possible design, the preview interface also includes a splicing preview window for displaying thumbnails of the images collected by the electronic device. Moreover, the splicing preview window is located at the beginning of the first guide path. In this way, in some cases, the stitching preview window may be blocked and occupy a part of the guide path.
在另一种可能的设计中,第一引导路径还包括沿第二方向设置的至少一条子路径,至少一条子路径用于连接沿第一方向设置的至少两条子路径,第二方向与第一方向垂直。In another possible design, the first guide path further includes at least one sub-path arranged along the second direction, and the at least one sub-path is used to connect at least two sub-paths arranged along the first direction, and the second direction is connected to the first direction. The direction is vertical.
这样,整个引导路径为连续的完整路径。沿第二方向设置的子路径可以引导用户沿第一方向设置的不同子路径拍摄时的先后顺序。In this way, the entire guide path is a continuous complete path. The sub-paths set along the second direction can guide the user to take the sequence of different sub-paths set along the first direction when shooting.
在另一种可能的设计中,该方法还包括:电子设备检测到拍摄操作后,在拍摄界面上显示第二引导信息,第二引导信息包括拼接预览窗口、第二引导路径和偏离指示标记。偏离指示标记用于表示电子设备采集的图像的中心线的位置,偏离指示标记在拍摄过程中沿着第二引导路径移动。第二引导路径包括第一引导路径上偏离指示标记未经过的部分。电子设备在拼接预览窗口内显示偏离指示标记沿第一方向的子路径移动时,电子设备采集的图像拼接获得的目标图像;电子设备在偏离指示标记到达第二引导路径的末端后停止拍摄,电子设备拼接获得的目标图像即为全景图像。In another possible design, the method further includes: after the electronic device detects the shooting operation, displaying second guide information on the shooting interface. The second guide information includes a splicing preview window, a second guide path, and a deviation indicator. The deviation indicator is used to indicate the position of the center line of the image collected by the electronic device, and the deviation indicator moves along the second guide path during the shooting. The second guide path includes a portion of the first guide path that does not deviate from the indicator mark. The electronic device displays the target image obtained by splicing the images collected by the electronic device when the deviation indicator mark moves along the sub-path in the first direction in the stitching preview window; the electronic device stops shooting after the deviation indicator mark reaches the end of the second guide path, and the electronic device The target image obtained by the splicing of the equipment is the panoramic image.
也就是说,在拍摄过程中,电子设备可以沿着引导路径转动,并将沿第一方向的子路径转动时采集的图像进行拼接,从而生成全景图像。并且,为了更好地引导用户转动电子设备,拍摄界面上仅显示偏离指示箭头未经过的未完成拍摄部分的引导路径。That is to say, during the shooting process, the electronic device can rotate along the guide path, and stitch the images collected when the sub path rotates along the first direction to generate a panoramic image. In addition, in order to better guide the user to turn the electronic device, the shooting interface only displays a guide path that deviates from the unfinished shooting part where the indicating arrow has not passed.
在另一种可能的设计中,当偏离指示标记沿着第二引导路径中的任一子路径移动时,第二引导信息还包括位于该任一子路径两侧且与该任一子路径平行的偏离范围指示线。该方法还包括:若偏离指示标记超出偏离范围指示线所指示的范围,则电子设备停止拍摄。In another possible design, when the deviation indicator moves along any sub-path in the second guide path, the second guide information further includes that it is located on both sides of the any sub-path and is parallel to the any sub-path. The deviation range indicator line. The method further includes: if the deviation indicator mark exceeds the range indicated by the deviation range indicator line, the electronic device stops shooting.
其中,偏离范围指示线用于表示电子设备采集的图像的中心线可偏离引导路径的最大范围。若偏离指示标记超出偏离范围指示线指示的范围,则电子设备采集的图像的中心超出了可偏离的最大范围,此时该图像可能并不能包括拼接时需要的裁剪范围内的图像,从而无法进行图像拼接,因而电子设备可以停止全景图像的拍摄过程。Wherein, the deviation range indicator line is used to indicate the maximum range within which the center line of the image collected by the electronic device can deviate from the guide path. If the deviation indicator mark exceeds the range indicated by the deviation range indicator line, the center of the image collected by the electronic device exceeds the maximum range that can be deviated. At this time, the image may not include the image within the cropping range required for stitching, and thus cannot be performed. Image splicing, so the electronic device can stop the panoramic image shooting process.
在另一种可能的设计中,第一引导路径包括沿第一方向设置且相互平行的第一子路径和第三子路径,且第一子路径为起始子路径。第一引导路径还包括沿第二方向设置的第二子路径,第二子路径用于连接第一子路径和第三子路径。在拍摄过程中,偏离指示标记依次沿着第一子路径、第二子路径和第三子路径移动。In another possible design, the first guide path includes a first sub-path and a third sub-path that are arranged along the first direction and are parallel to each other, and the first sub-path is the initial sub-path. The first guide path further includes a second sub-path arranged along the second direction, and the second sub-path is used to connect the first sub-path and the third sub-path. During the shooting, the deviation indicator mark moves along the first sub-path, the second sub-path, and the third sub-path in sequence.
在该方案中,引导路径包括沿第一方向设置的两条子路径,以及沿第二方向设置的一条子路径。In this solution, the guide path includes two sub-paths arranged along the first direction and one sub-path arranged along the second direction.
在另一种可能的设计中,第一引导路径还包括沿第一方向设置且与第一子路径平行的第五子路径,第三子路径和第五子路径位于第一子路径的两侧。第一引导路径还包括沿第二方向设置且与第二子路径平行的第四子路径,第四子路径用于连接第三子路径和第五子路径。在拍摄过程中,偏离指示标记依次沿着第一子路径、第二子路径、第三子路径、第四子路径以及第五子路径移动。In another possible design, the first guide path further includes a fifth sub-path arranged along the first direction and parallel to the first sub-path, and the third sub-path and the fifth sub-path are located on both sides of the first sub-path . The first guide path further includes a fourth sub-path arranged along the second direction and parallel to the second sub-path, and the fourth sub-path is used to connect the third sub-path and the fifth sub-path. During the shooting process, the deviation indicator mark moves along the first sub-path, the second sub-path, the third sub-path, the fourth sub-path, and the fifth sub-path in sequence.
在该方案中,引导路径包括沿第一方向设置的三条子路径,以及沿第二方向设置的两条子路径。In this solution, the guide path includes three sub-paths arranged along the first direction and two sub-paths arranged along the second direction.
在另一种可能的设计中,在拍摄过程中,当偏离指示标记沿第一子路径移动时,第二引导路径包括第一子路径上偏离指示标记未经过的部分以及第二子路径至第五子路径,且第一子路径两侧显示有偏离范围指示线;拼接预览窗口内显示偏离指示标记沿着第一子路径移动时,电子设备采集的图像拼接获得的目标图像。当偏离指示标记沿第二子路径移动时,第二引导路径包括第二子路径上偏离指示标记未经过的部分以及第三子路径至第五子路径,且第二子路径两侧显示有偏离范围指示线;拼接预览窗口内显示的目标图像为偏离指示标记移动到第一子路径的末端后,电子设备采集的图像拼接获得的第一路径对应的拼接结果。当偏离指示标记沿第三子路径移动时,第二引导路径包括第三子路径上偏离指示标记未经过的部分以及第四子路径和第五子路径,且第三子路径两侧显示有偏离范围指示线;拼接预览窗口内显示的目标图像为偏离指示标记沿着第二子路径移动时,电子设备采集的图像向第一子路径对应的拼接结果拼接获得的图像。In another possible design, during the shooting process, when the deviation indicator moves along the first sub-path, the second guide path includes the portion of the first sub-path that the deviation indicator does not pass and the second sub-path to the first sub-path. Five sub-paths, and deviation range indication lines are displayed on both sides of the first sub-path; the stitching preview window displays the target image obtained by splicing the images collected by the electronic device when the deviation indicating mark moves along the first sub-path. When the deviation indicator moves along the second sub-path, the second guide path includes the portion of the second sub-path that the deviation indicator does not pass and the third to fifth sub-paths, and deviations are displayed on both sides of the second sub-path Range indicator line; the target image displayed in the splicing preview window is the splicing result corresponding to the first path obtained by splicing the images collected by the electronic device after the deviation indicator mark moves to the end of the first sub-path. When the deviation indicator moves along the third sub-path, the second guide path includes the part of the third sub-path that the deviation indicator does not pass, the fourth and fifth sub-paths, and deviations are displayed on both sides of the third sub-path Range indicator line; the target image displayed in the splicing preview window is an image obtained by splicing the image collected by the electronic device to the splicing result corresponding to the first sub-path when the deviation indicator mark moves along the second sub-path.
也就是说,在拍摄界面上,电子设备显示未完成拍摄的引导路径,以及当前电子设备正在沿着其移动的子路径的偏离范围指示线。并且,预览拼接窗口中的目标图像为电子设备沿着第一方向的子路径拼接生成的图像,而并不是电子设备沿所有子路径拼接生成的图像。That is, on the shooting interface, the electronic device displays the guide path of the unfinished shooting and the deviation range indication line of the sub-path along which the electronic device is currently moving. In addition, the target image in the preview splicing window is an image generated by splicing the electronic device along the sub-paths in the first direction, rather than the image generated by splicing the electronic device along all the sub-paths.
在另一种可能的设计中,当偏离指示标记沿第一子路径移动时,电子设备在拼接预览窗口内显示偏离指示标记沿着第一方向的子路径移动时,电子设备采集的图像拼接获得的目标图像,包括:电子设备将第一子路径的第i帧图像I i映射到圆柱面上得到图像
Figure PCTCN2021078666-appb-000001
i为大于1的整数。电子设备提取
Figure PCTCN2021078666-appb-000002
Figure PCTCN2021078666-appb-000003
的特征点F I,i和F I,i-1
Figure PCTCN2021078666-appb-000004
为第一子路径的第i-1帧图像I i-1映射到圆柱面后得到的图像。电子设备计算F I,i和F I,i-1的匹配结果。电子设备根据F I,i和F I,i-1的匹配结果,将
Figure PCTCN2021078666-appb-000005
Figure PCTCN2021078666-appb-000006
进行映射。电子设备将映射后的
Figure PCTCN2021078666-appb-000007
处于预设的第一裁剪范围内的部分,与第一子路径的拼接图像RI(i-1)拼接,从而获得第一子路径的拼接图像RIi。其中,第一裁剪范围包括第一子路径的偏离范围指示线对应的裁剪线以及电子设备预设的左边界线和右边界线限定的范围。
In another possible design, when the deviation indicator moves along the first sub-path, the electronic device displays in the mosaic preview window when the deviation indicator moves along the first sub-path, the image collected by the electronic device is spliced The target image of includes: the electronic device maps the i-th frame image I i of the first sub-path to the cylindrical surface to obtain an image
Figure PCTCN2021078666-appb-000001
i is an integer greater than 1. Electronic equipment extraction
Figure PCTCN2021078666-appb-000002
with
Figure PCTCN2021078666-appb-000003
The feature points F I,i and F I,i-1 ,
Figure PCTCN2021078666-appb-000004
It is the image obtained after the i-1th frame image I i-1 of the first subpath is mapped to the cylindrical surface. The electronic device calculates the matching result of F I,i and F I,i-1. According to the matching result of F I,i and F I,i-1, the electronic equipment will
Figure PCTCN2021078666-appb-000005
Towards
Figure PCTCN2021078666-appb-000006
Map it. The electronic device will be mapped
Figure PCTCN2021078666-appb-000007
The part within the preset first cropping range is spliced with the spliced image RI(i-1) of the first sub-path, so as to obtain the spliced image RIi of the first sub-path. Wherein, the first clipping range includes a clipping line corresponding to the deviation range indication line of the first sub-path and a range defined by a left boundary line and a right boundary line preset by the electronic device.
在该方案中,当偏离指示标记沿第一子路径移动时,电子设备沿第一子路径转动,电子设备对转动过程中采集到的相邻两帧图像进行圆柱面映射后提取特征点,并根据特征点计算匹配结果,根据匹配结果计算单应性矩阵,从而根据单应性矩阵将后一帧图像映射到前一帧图像上,并对映射后的后一帧图像进行裁剪,从而与之前的拼接结果拼接,得到新的拼接结果。In this solution, when the deviation indicator moves along the first sub-path, the electronic device rotates along the first sub-path, and the electronic device performs cylindrical mapping on two adjacent frames of images collected during the rotation and extracts the feature points, and The matching result is calculated according to the feature points, and the homography matrix is calculated according to the matching result, so that the next frame image is mapped to the previous frame image according to the homography matrix, and the next frame image after the mapping is cropped to match the previous frame image. The splicing results of the splicing are spliced, and a new splicing result is obtained.
并且,电子设备在不同姿态下拍摄的不同角度的图像进行圆柱面映射,可以使得不同角度拍摄的图像上同一对象映射后的尺寸和成像特征相匹配,而后再进行配准和拼接以生成全景图像,以便符合全景图各部分图像尺寸基本一致的视觉效果。In addition, the cylindrical mapping of images from different angles taken by the electronic device in different postures can match the mapped size and imaging characteristics of the same object on the images taken at different angles, and then perform registration and stitching to generate a panoramic image , In order to meet the visual effect of the same image size of each part of the panorama.
在另一种可能的设计中,当偏离指示标记沿第一子路径移动时,该方法还包括:电子设备从沿着第一方向的子路径转动时采集的图像帧中获取多个关键帧。In another possible design, when the deviation indicator moves along the first sub-path, the method further includes: the electronic device obtains multiple key frames from the image frames collected while rotating along the sub-path in the first direction.
这样,当偏离指示标记沿第三子路径移动时,电子设备可以根据关键帧,在拼接预览窗口内显示偏离指示标记沿着第三子路径移动时电子设备采集的图像拼接获得的目标图像。当偏离指示标记沿第五子路径移动时,电子设备可以根据关键帧,在拼接预览窗口内显示偏离指示标记沿着第五子路径移动时电子设备采集的图像拼接获得的 目标图像。In this way, when the deviation indicator moves along the third sub-path, the electronic device can display the target image obtained by splicing the images collected by the electronic device when the deviation indicator moves along the third sub-path in the mosaic preview window according to the key frame. When the deviation indicator moves along the fifth sub-path, the electronic device may display the target image obtained by splicing the images collected by the electronic device when the deviation indicator moves along the fifth sub-path in the mosaic preview window according to the key frame.
在另一种可能的设计中,当偏离指示标记沿第三子路径移动时,电子设备在拼接预览窗口内显示偏离指示标记沿着第一方向的子路径移动时电子设备采集的图像拼接获得的目标图像,包括:电子设备从多个关键帧中获取与第三子路径的第一帧图像A 1匹配的目标关键帧G f1。电子设备将G f1映射到圆柱面上得到图像
Figure PCTCN2021078666-appb-000008
电子设备将A 1映射到圆柱面上得到图像
Figure PCTCN2021078666-appb-000009
电子设备提取
Figure PCTCN2021078666-appb-000010
Figure PCTCN2021078666-appb-000011
的特征点F A,1和F A,f1。电子设备计算F A,1和F A,f1的匹配结果。电子设备根据F A,1和F A,f1的匹配结果,将
Figure PCTCN2021078666-appb-000012
Figure PCTCN2021078666-appb-000013
进行映射。电子设备将映射后的
Figure PCTCN2021078666-appb-000014
处于预设的第二裁剪范围内的部分,与第一子路径的对应的拼接结果进行拼接,获得第二子路径的拼接图像RA1。其中,第二裁剪范围包括第三子路径的偏离范围指示线对应的裁剪线以及电子设备预设的左边界线和右边界线限定的范围。
In another possible design, when the deviation indicator moves along the third sub-path, the electronic device displays in the stitching preview window the image obtained by splicing the image collected by the electronic device when the deviation indicator moves along the sub-path in the first direction. The target image includes: the electronic device obtains a target key frame G f1 that matches the first frame image A 1 of the third sub-path from a plurality of key frames. The electronic device maps G f1 to the cylindrical surface to get the image
Figure PCTCN2021078666-appb-000008
The electronic device maps A 1 to the cylindrical surface to get the image
Figure PCTCN2021078666-appb-000009
Electronic equipment extraction
Figure PCTCN2021078666-appb-000010
with
Figure PCTCN2021078666-appb-000011
The feature points F A,1 and F A,f1 . The electronic device calculates the matching result of F A,1 and F A,f1. According to the matching results of F A,1 and F A,f1, the electronic device will
Figure PCTCN2021078666-appb-000012
Towards
Figure PCTCN2021078666-appb-000013
Map it. The electronic device will be mapped
Figure PCTCN2021078666-appb-000014
The part within the preset second cropping range is spliced with the corresponding splicing result of the first sub-path to obtain the spliced image RA1 of the second sub-path. Wherein, the second clipping range includes a clipping line corresponding to the deviation range indication line of the third subpath and a range defined by a left boundary line and a right boundary line preset by the electronic device.
在该方案中,当偏离指示标记沿第三子路径移动时,电子设备沿第三子路径转动,电子设备确定转动过程中采集到的第一帧图像对应的目标关键帧,并对第一帧图像和目标关键帧进行圆柱面映射后提取特征点,并根据特征点计算匹配结果,根据匹配结果计算单应性矩阵,从而根据单应性矩阵将第一帧图像映射到目标关键帧图像上,并对映射后的第一帧图像进行裁剪,从而与第一子路径对应的拼接结果进行拼接,得到新的拼接结果。In this solution, when the deviation indicator moves along the third sub-path, the electronic device rotates along the third sub-path, the electronic device determines the target key frame corresponding to the first frame of image After the image and the target key frame are mapped to the cylindrical surface, the feature points are extracted, and the matching results are calculated according to the feature points, and the homography matrix is calculated according to the matching results, so that the first frame image is mapped to the target key frame image according to the homography matrix. The first frame image after the mapping is cropped, so that the splicing result corresponding to the first sub-path is spliced, and a new splicing result is obtained.
并且,电子设备将第三子路径的图像与第一子路径的图像中的关键帧进行配准,可以及时修正第三子路径的图像拼接时与第一子路径的图像的错位误差,使得第三子路径的图像与第一子路径的拼接结果进行精确配准,从而实现全局的配准,第三子路径拼接结果和第一子路径拼接结果可以形成一个平滑、自然过渡的整体图像。In addition, the electronic device registers the image of the third sub-path with the key frame in the image of the first sub-path, and can timely correct the misalignment error between the image of the third sub-path and the image of the first sub-path during the splicing of the images of the third sub-path, so that the first sub-path The images of the three sub-paths are accurately registered with the splicing result of the first sub-path, thereby realizing global registration. The splicing result of the third sub-path and the splicing result of the first sub-path can form a smooth and natural transition overall image.
在另一种可能的设计中,在xyz坐标系中,电子设备摄像头的镜头位于xyz三维坐标系的xy平面;关键帧对应的绕y轴的旋转角的间隔大于或者等于预设值Δβ;其中,在多个关键帧中,目标关键帧G f1对应的绕y轴的旋转角与A 1对应的绕y轴的旋转角的差值最小。 In another possible design, in the xyz coordinate system, the lens of the electronic device camera is located on the xy plane of the xyz three-dimensional coordinate system; the interval of the rotation angle around the y axis corresponding to the key frame is greater than or equal to the preset value Δβ; Among the multiple key frames, the difference between the rotation angle around the y axis corresponding to the target key frame G f1 and the rotation angle around the y axis corresponding to A 1 is the smallest.
这样,不同关键帧之间可以有部分重叠,且基本均匀地分布在第一子路径上。目标关键帧与第三子路径的图像在拼接时的图像错位误差最小,两者映射到圆柱面后的图像更容易进行配准。In this way, there may be partial overlap between different key frames, and they are basically evenly distributed on the first sub-path. The image misalignment error of the image of the target key frame and the third sub-path is the smallest when stitching, and the image after the two are mapped to the cylindrical surface is easier to be registered.
在另一种可能的设计中,当偏离指示标记沿第三子路径移动时,电子设备在拼接预览窗口内显示偏离指示标记沿着第一方向的子路径移动时电子设备采集的图像拼接获得的目标图像,还包括:电子设备从多个关键帧中获取与第三子路径的第i帧图像A i匹配的第i目标关键帧G fi。电子设备将G fi映射到圆柱面上得到图像
Figure PCTCN2021078666-appb-000015
电子设备将A i映射到圆柱面上得到图像
Figure PCTCN2021078666-appb-000016
电子设备提取
Figure PCTCN2021078666-appb-000017
Figure PCTCN2021078666-appb-000018
的特征点F A,i、F A,i-1和F A,fi
Figure PCTCN2021078666-appb-000019
为第二子路径的第i-1帧图像A i-1映射到圆柱面后得到的图像。电子设备计算F A,i,F A,i-1和F A,fi的匹配结果。电子设备根据F A,i,F A,i-1和F A,fi的匹配结果,将
Figure PCTCN2021078666-appb-000020
Figure PCTCN2021078666-appb-000021
Figure PCTCN2021078666-appb-000022
进行映射。电子设备将映射后的
Figure PCTCN2021078666-appb-000023
处于预设的第二裁剪范围内的部分,与第一子路径对应的拼接结果和第二子路径的拼接图像RA(i-1)进行拼接,获得第二子路径的拼接图像RAi。
In another possible design, when the deviation indicator moves along the third sub-path, the electronic device displays in the stitching preview window the image obtained by splicing the image collected by the electronic device when the deviation indicator moves along the sub-path in the first direction. target image, further comprising: an electronic device to acquire the i-th third sub-frame image a i path matches the i-th keyframe G fi target from the plurality of keyframes. The electronic device maps the G fi to the cylindrical surface to obtain the image
Figure PCTCN2021078666-appb-000015
The electronic device to obtain an image A i is mapped to the cylindrical surface
Figure PCTCN2021078666-appb-000016
Electronic equipment extraction
Figure PCTCN2021078666-appb-000017
with
Figure PCTCN2021078666-appb-000018
Feature points F A,i , F A,i-1 and F A,fi ,
Figure PCTCN2021078666-appb-000019
It is the image obtained after the i-1th frame image Ai-1 of the second subpath is mapped to the cylindrical surface. The electronic device calculates the matching results of F A,i , F A,i-1 and F A,fi. According to the matching results of F A,i , F A,i-1 and F A,fi, the electronic equipment will
Figure PCTCN2021078666-appb-000020
Towards
Figure PCTCN2021078666-appb-000021
with
Figure PCTCN2021078666-appb-000022
Map it. The electronic device will be mapped
Figure PCTCN2021078666-appb-000023
For the part within the preset second cropping range, the stitching result corresponding to the first sub-path and the stitched image RA(i-1) of the second sub-path are stitched to obtain the stitched image RAi of the second sub-path.
在该方案中,当电子设备沿第三子路径转动时,对于第一帧图像以外的其他图像,电子设备可以根据上一帧图像以及确定的目标关键帧进行配准、映射和拼接。In this solution, when the electronic device rotates along the third sub-path, the electronic device can perform registration, mapping, and splicing of images other than the first frame image according to the previous frame image and the determined target key frame.
在另一种可能的设计中,当偏离指示标记沿第五子路径移动时,电子设备在拼接预览窗口内显示偏离指示标记沿着第一方向的子路径移动时电子设备采集的图像拼接获得的目标图像,包括:电子设备根据多个关键帧,将沿着第五子路径转动时采集的图像与第一子路径对应的拼接结果进行拼接。In another possible design, when the deviation indicator moves along the fifth sub-path, the electronic device displays in the stitching preview window the image obtained by splicing the image collected by the electronic device when the deviation indicator moves along the sub-path in the first direction. The target image includes: the electronic device splicing the image collected while rotating along the fifth sub-path with the splicing result corresponding to the first sub-path according to a plurality of key frames.
可以理解的是,电子设备根据多个关键帧,将沿着第五子路径转动时采集的图像与第一子路径对应的拼接结果进行拼接时,第一子路径对应的拼接结果可能已经与第三子路径的拼接结果进行了拼接。也就是说,电子设备将沿着第五子路径转动时采集的图像,与第一子路径的拼接结果和第三子路径的拼接结果进行拼接,从而形成一个视场角较大的拼接图像。It is understandable that when the electronic device splices the image collected while rotating along the fifth sub-path with the splicing result corresponding to the first sub-path according to a plurality of key frames, the splicing result corresponding to the first sub-path may already be the same as the splicing result of the first sub-path. The splicing results of the three sub-paths are spliced. That is, the electronic device splices the image collected while rotating along the fifth sub-path with the splicing result of the first sub-path and the splicing result of the third sub-path, thereby forming a spliced image with a larger field of view.
在另一种可能的设计中,在xyz坐标系中,电子设备摄像头的镜头位于xyz三维坐标系的xy平面。电子设备预设有左边界线、左基线、左裁剪线、右裁剪线、右基线和右边界线;左基线与第四子路径对应,左基线对应的绕y轴的旋转角为0,右基线与第二子路径对应,右基线对应的绕y轴的旋转角为β r,左裁剪线对应的绕y轴的旋转角为β 2,右裁剪线对应的绕y轴的旋转角为β 3,左边界线对应的绕y轴的旋转角为β 1,右边界线对应的绕y轴的旋转角为β 4。电子设备还预设有上基线、中基线、下基线,以及第一裁剪线、第二裁剪线、第三裁剪线和第四裁剪线;其中,上基线、中基线和下基线分别与第三子路径、第一子路径和第五子路径对应,第一裁剪线和第二裁剪线与第三子路径的偏离范围指示线对应,第二裁剪线和第三裁剪线与第一子路径的偏离范围指示线对应,第三裁剪线和第四裁剪线与第五子路径的偏离范围指示线对应;第一裁剪线、上基线、第二裁剪线、中间线、第三裁剪线、下基线和第四裁剪线对应的绕x轴的旋转角分别为α 1,α t,α 2,0,α 3,α b,α 4。该方法还包括:当偏离指示标记沿着第一子路径移动时,若电子设备绕x轴的旋转角α>α 1或α<α 2,则电子设备停止拍摄。当电子设备绕y轴的旋转角β>β r时,偏离指示标记由沿着第一子路径移动切换为沿着第二子路径移动;若电子设备绕y轴的旋转角β>β 4或β<β 3,则电子设备停止拍摄。当电子设备绕x轴的旋转角α>α t时,偏离指示标记由沿着第二子路径移动切换为沿着第三子路径移动;当电子设备绕x轴的旋转角α>α 1或α<α 2时,电子设备停止拍摄。当电子设备绕y轴的旋转角β<0时,偏离指示标记由沿着第三子路径移动切换为沿者第四子路径移动;当电子设备绕y轴的旋转角β>β 2或β<β 1时,电子设备停止拍摄。当电子设备绕x轴的旋转角α<α b时,偏离指示标记由沿着第四子路径移动切换为沿着第五子路径移动;当电子设备绕x轴的旋转角α>α 3或α<α 4时,电子设备停止拍摄。当电子设备绕y轴的旋转角β>β r时,电子设备停止拍摄。 In another possible design, in the xyz coordinate system, the lens of the electronic device camera is located on the xy plane of the xyz three-dimensional coordinate system. The electronic device is preset with a left boundary line, a left baseline, a left clipping line, a right clipping line, a right baseline and a right boundary line; the left baseline corresponds to the fourth sub-path, the left baseline corresponds to the rotation angle around the y axis is 0, and the right baseline corresponds to The second subpath corresponds to the rotation angle around the y axis corresponding to the right baseline is β r , the rotation angle around the y axis corresponding to the left clipping line is β 2 , and the rotation angle around the y axis corresponding to the right clipping line is β 3 , The rotation angle around the y-axis corresponding to the left boundary line is β 1 , and the rotation angle around the y-axis corresponding to the right boundary line is β 4 . The electronic device is also preset with upper, middle, and lower baselines, as well as the first cutting line, the second cutting line, the third cutting line, and the fourth cutting line; among them, the upper, middle, and lower baselines are the same as the third The sub-path, the first sub-path and the fifth sub-path correspond to each other, the first and second cutting lines correspond to the deviation range indication lines of the third sub-path, and the second and third cutting lines correspond to the deviation of the first sub-path. The deviation range indicator line corresponds to the third cutting line and the fourth cutting line correspond to the deviation range indicator line of the fifth subpath; the first cutting line, the upper baseline, the second cutting line, the middle line, the third cutting line, the lower baseline The rotation angles around the x-axis corresponding to the fourth cutting line are α 1 , α t , α 2 , 0, α 3 , α b , and α 4, respectively . The method further includes: when the deviation indicator moves along the first sub-path, if the rotation angle of the electronic device around the x axis is α>α 1 or α<α 2 , the electronic device stops shooting. When the electronic device about the y-axis rotational angle β> β r, departing from the indicating mark is moved by a first switch to a second sub-path is traversed along a sub-path; beta] the rotation angle around the y axis when the electronic device is> β 4 or β<β 3 , the electronic device stops shooting. When the rotation angle of the electronic device around the x-axis α>α t , the deviation indicator switch is switched from moving along the second sub-path to moving along the third sub-path; when the rotation angle of the electronic device around the x-axis α>α 1 or α <when α 2, the electronic device to stop recording. When the rotation angle β<0 of the electronic device around the y-axis, the deviation indicator will switch from moving along the third sub-path to moving along the fourth sub-path; when the rotation angle β>β 2 or β of the electronic device around the y-axis <when β 1, the electronic device to stop recording. When the electronic device about the x axis rotation angle α <When α b, departing from the indicating mark is moved by the switching path is traversed along fourth sub fifth sub path; when the electronic device about the x axis rotation angle α> α 3 or When α<α 4 , the electronic device stops shooting. When the electronic device about the y-axis rotational angle β> β r, the electronic device to stop recording.
也就是说,电子设备可以根据绕x轴或绕y轴的旋转角的大小,确定是否切换沿着其转动的子路径,以及确定电子设备采集的图像的中心线是否超出裁剪范围等。In other words, the electronic device can determine whether to switch the sub-path along which it rotates, and determine whether the center line of the image collected by the electronic device exceeds the cropping range, etc., according to the size of the rotation angle around the x-axis or the y-axis.
另一方面,本申请实施例提供了一种拍摄装置,该装置包含在电子设备中。该装置具有实现上述方面及可能的设计中任一方法中电子设备行为的功能,使得电子设备执行上述方面任一项可能的设计中电子设备执行的全景拍摄方法。该功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。硬件或软件包括至少一个与上述功能相对应的模块或单元。例如,该装置可以包括处理单元、显示单元和检测单元等。On the other hand, an embodiment of the present application provides a photographing device, which is included in an electronic device. The device has the function of realizing the behavior of the electronic device in any method in the foregoing aspects and possible designs, so that the electronic device executes the panoramic shooting method executed by the electronic device in any of the foregoing aspects in a possible design. This function can be realized by hardware, or by hardware executing corresponding software. The hardware or software includes at least one module or unit corresponding to the above-mentioned functions. For example, the device may include a processing unit, a display unit, a detection unit, and so on.
又一方面,本申请实施例提供了一种电子设备,包括:摄像头,用于采集图像; 屏幕,用于显示界面;一个或多个处理器;以及存储器,存储器中存储有代码。当代码被电子设备执行时,使得电子设备执行上述方面任一项可能的设计中电子设备执行的全景拍摄方法。In yet another aspect, an embodiment of the present application provides an electronic device, including: a camera for capturing images; a screen for displaying an interface; one or more processors; and a memory in which codes are stored. When the code is executed by the electronic device, the electronic device is caused to execute the panoramic photography method executed by the electronic device in any one of the possible designs in the foregoing aspects.
又一方面,本申请实施例提供了一种电子设备,包括:一个或多个处理器;以及存储器,存储器中存储有代码。当代码被电子设备执行时,使得电子设备执行上述方面任一项可能的设计中电子设备执行的全景拍摄方法。In another aspect, an embodiment of the present application provides an electronic device, including: one or more processors; and a memory, in which code is stored. When the code is executed by the electronic device, the electronic device is caused to execute the panoramic photography method executed by the electronic device in any one of the possible designs in the foregoing aspects.
另一方面,本申请实施例提供了一种计算机可读存储介质,包括计算机指令,当计算机指令在电子设备上运行时,使得电子设备执行上述方面任一项可能的设计中的全景拍摄方法。On the other hand, an embodiment of the present application provides a computer-readable storage medium, including computer instructions, which, when the computer instructions run on an electronic device, cause the electronic device to execute the panoramic photography method in any one of the possible designs in the foregoing aspects.
又一方面,本申请实施例提供了一种计算机程序产品,当计算机程序产品在计算机上运行时,使得计算机执行上述方面任一项可能的设计中电子设备执行的全景拍摄方法。In another aspect, an embodiment of the present application provides a computer program product, which when the computer program product runs on a computer, causes the computer to execute the panoramic shooting method executed by the electronic device in any one of the above-mentioned possible designs.
另一方面,本申请实施例提供了一种芯片系统,该芯片系统应用于电子设备。该芯片系统包括一个或多个接口电路和一个或多个处理器;接口电路和处理器通过线路互联;接口电路用于从电子设备的存储器接收信号,并向处理器发送信号,信号包括存储器中存储的计算机指令;当处理器执行计算机指令时,使得电子设备执行上述方面任一项可能的设计中的全景拍摄方法。On the other hand, an embodiment of the present application provides a chip system, which is applied to an electronic device. The chip system includes one or more interface circuits and one or more processors; the interface circuit and the processor are interconnected by wires; the interface circuit is used to receive signals from the memory of the electronic device and send signals to the processor. The signals include the memory Stored computer instructions; when the processor executes the computer instructions, it causes the electronic device to execute any one of the above-mentioned aspects of the possible design of the panoramic photography method.
上述其他方面对应的有益效果,可以参见关于方法方面的有益效果的描述,此处不予赘述。For the corresponding beneficial effects of the other aspects mentioned above, please refer to the description of the beneficial effects of the method, which will not be repeated here.
附图说明Description of the drawings
图1为现有技术中的一种全景拍摄的预览界面示意图;FIG. 1 is a schematic diagram of a preview interface for panoramic shooting in the prior art;
图2为本申请实施例提供的一种电子设备的硬件结构示意图;2 is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the application;
图3为本申请实施例提供的一种全景拍摄的流程图;FIG. 3 is a flowchart of a panoramic shooting provided by an embodiment of the application;
图4A为本申请实施例提供的一组界面示意图;4A is a schematic diagram of a set of interfaces provided by an embodiment of the application;
图4B为本申请实施例提供的一组引导路径示意图;4B is a schematic diagram of a set of guide paths provided by an embodiment of the application;
图5为本申请实施例提供的一组引导信息示意图;Figure 5 is a schematic diagram of a set of guidance information provided by an embodiment of the application;
图6为本申请实施例提供的另一组界面示意图;FIG. 6 is a schematic diagram of another set of interfaces provided by an embodiment of the application;
图7为本申请实施例提供的一组规则线的示意图;FIG. 7 is a schematic diagram of a set of rule lines provided by an embodiment of the application;
图8为本申请实施例提供的一种坐标系的示意图,以及图像帧与陀螺仪数据的数量关系示意图;8 is a schematic diagram of a coordinate system provided by an embodiment of the application, and a schematic diagram of the quantitative relationship between image frames and gyroscope data;
图9为本申请实施例提供的一组圆柱面映射效果示意图;FIG. 9 is a schematic diagram of a set of cylindrical surface mapping effects provided by an embodiment of the application;
图10为本申请实施例提供的一种拼接效果示意图;FIG. 10 is a schematic diagram of a splicing effect provided by an embodiment of this application;
图11为本申请实施例提供的一种特征点的对照示意图;FIG. 11 is a schematic diagram of a comparison of feature points provided by an embodiment of this application;
图12为本申请实施例提供的一组拼接效果示意图;FIG. 12 is a schematic diagram of a set of splicing effects provided by an embodiment of the application;
图13为本申请实施例提供的一组关键帧的示意图;FIG. 13 is a schematic diagram of a set of key frames provided by an embodiment of the application;
图14A为本申请实施例提供的另一组界面示意图;14A is a schematic diagram of another set of interfaces provided by an embodiment of the application;
图14B为本申请实施例提供的一组拍摄界面上的引导路径的示意图;14B is a schematic diagram of a set of guide paths on a shooting interface provided by an embodiment of the application;
图15为本申请实施例提供的另一种界面示意图;FIG. 15 is a schematic diagram of another interface provided by an embodiment of the application;
图16A为本申请实施例提供的另一种界面示意图;16A is a schematic diagram of another interface provided by an embodiment of the application;
图16B为本申请实施例提供的另一种拼接效果示意图;16B is a schematic diagram of another splicing effect provided by an embodiment of the application;
图16C为本申请实施例提供的一组上基线图像和目标关键帧的对比示意图;16C is a schematic diagram of comparison between a set of upper baseline images and target key frames provided by an embodiment of the application;
图16D为本申请实施例提供的另一种拼接效果示意图;16D is a schematic diagram of another splicing effect provided by an embodiment of the application;
图16E为本申请实施例提供的另一种拼接效果示意图;16E is a schematic diagram of another splicing effect provided by an embodiment of the application;
图17为本申请实施例提供的另一种拼接效果示意图;FIG. 17 is a schematic diagram of another splicing effect provided by an embodiment of the application;
图18为本申请实施例提供的另一组拼接效果示意图;FIG. 18 is a schematic diagram of another set of splicing effects provided by an embodiment of the application;
图19为本申请实施例提供的另一组界面示意图;FIG. 19 is a schematic diagram of another set of interfaces provided by an embodiment of the application;
图20为本申请实施例提供的另一组引导路径示意图;FIG. 20 is a schematic diagram of another set of guide paths provided by an embodiment of this application;
图21为本申请实施例提供的另一种界面示意图;FIG. 21 is a schematic diagram of another interface provided by an embodiment of this application;
图22A为本申请实施例提供的另一种界面示意图;22A is a schematic diagram of another interface provided by an embodiment of the application;
图22B为本申请实施例提供的另一组引导路径示意图;22B is a schematic diagram of another set of guide paths provided by an embodiment of the application;
图22C为本申请实施例提供的另一种拼接效果示意图;22C is a schematic diagram of another splicing effect provided by an embodiment of the application;
图23为本申请实施例提供的一组引导路径与拼接获得的全景图像的示意图;FIG. 23 is a schematic diagram of a set of guide paths and panoramic images obtained by stitching provided by an embodiment of the application; FIG.
图24为本申请实施例提供的另一组引导路径与拼接获得的全景图像的示意图;24 is a schematic diagram of another set of guide paths and panoramic images obtained by stitching provided by an embodiment of the application;
图25为本申请实施例提供的另一组引导路径与拼接获得的全景图像的示意图;25 is a schematic diagram of another set of guide paths and panoramic images obtained by stitching provided by an embodiment of the application;
图26为本申请实施例提供的一种电子设备的结构示意图。FIG. 26 is a schematic structural diagram of an electronic device provided by an embodiment of this application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。其中,在本申请实施例的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;本文中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,在本申请实施例的描述中,“多个”是指两个或多于两个。The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application. Among them, in the description of the embodiments of the present application, unless otherwise specified, "/" means or, for example, A/B can mean A or B; "and/or" in this document is only a description of related objects The association relationship of indicates that there can be three kinds of relationships, for example, A and/or B, which can indicate: A alone exists, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "plurality" refers to two or more than two.
以下,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。在本实施例的描述中,除非另有说明,“多个”的含义是两个或两个以上。Hereinafter, the terms "first" and "second" are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Therefore, the features defined with "first" and "second" may explicitly or implicitly include one or more of these features. In the description of the present embodiment, unless otherwise specified, "plurality" means two or more.
本申请实施例提供了一种全景拍摄方法,能够将不同角度采集的图像,在相互垂直的两个方向上分别进行拼接以生成全景图像,从而可以在两个方向上扩展拼接合成的图像的视场角,获得两个方向上均能够覆盖更大视角范围的全景图像,提高用户拍摄体验。The embodiment of the present application provides a panoramic shooting method, which can stitch images collected from different angles in two mutually perpendicular directions to generate a panoramic image, so that the view of the stitched and synthesized image can be expanded in two directions. Field angle, to obtain panoramic images that can cover a larger viewing angle in both directions, and improve the user's shooting experience.
本申请实施例提供的全景拍摄方法可以应用于电子设备。例如,该电子设备可以是手机、平板电脑、可穿戴设备、车载设备、增强现实(augmented reality,AR)/虚拟现实(virtual reality,VR)设备、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本、个人数字助理(personal digital assistant,PDA)等设备,也可以是专业的相机等设备,本申请实施例对电子设备的具体类型不作任何限制。The panoramic shooting method provided in the embodiments of the present application can be applied to electronic devices. For example, the electronic device may be a mobile phone, a tablet computer, a wearable device, a vehicle-mounted device, an augmented reality (AR)/virtual reality (VR) device, a notebook computer, an ultra-mobile personal computer (ultra-mobile personal computer). Computers, UMPCs), netbooks, personal digital assistants (personal digital assistants, PDAs) and other devices can also be professional cameras and other devices. The embodiments of the present application do not impose any restrictions on the specific types of electronic devices.
示例性的,图2示出了电子设备100的结构示意图。电子设备100可以包括处理器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等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。Exemplarily, FIG. 2 shows a schematic structural diagram of the electronic device 100. The electronic device 100 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, an antenna 1, and an antenna 2. , Mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, earphone jack 170D, sensor module 180, buttons 190, motor 191, indicator 192, camera 193, display screen 194, and Subscriber identification module (subscriber identification module, SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope 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 ambient light Sensor 180L, bone conduction sensor 180M, etc.
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), and an image signal processor. (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (NPU) Wait. Among them, the different processing units may be independent devices or integrated in one or more processors.
其中,控制器可以是电子设备100的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。The controller may be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching and executing instructions.
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。A memory may also be provided in the processor 110 to store instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory can store 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 directly called from the memory. Repeated accesses are avoided, the waiting time of the processor 110 is reduced, and the efficiency of the system is improved.
电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The electronic device 100 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, connected to the display 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and is used for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
显示屏194用于显示图像,视频等。例如,显示屏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)等。在一些实施例中,电子设备100可以包括1个或N个显示屏194,N为大于1的正整数。The display screen 194 is used to display images, videos, and the like. For example, the display screen 194 may display a preview interface and a shooting interface in the panoramic shooting mode. The display screen 194 includes a display panel. The display panel can adopt liquid crystal display (LCD), organic light-emitting diode (OLED), active matrix organic light-emitting diode or active-matrix organic light-emitting diode (active-matrix organic light-emitting diode). AMOLED, flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include one or N display screens 194, and N is a positive integer greater than one.
电子设备100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。The electronic device 100 can realize a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.
ISP用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。The ISP is used to process the data fed back from the camera 193. For example, when taking a picture, the shutter is opened, and the light is transmitted to the photosensitive element of the camera through the lens, the light signal is converted into an electrical signal, and the photosensitive element of the camera transmits the electrical signal to the ISP for processing, which is converted into an image visible to the naked eye. ISP can also optimize the image noise, brightness, and skin color. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP may be provided in the camera 193.
摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元 件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,电子设备100可以包括1个或N个摄像头193,N为大于1的正整数。The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and is projected to the photosensitive element. The photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transfers the electrical signal to the ISP to convert it into a digital image signal. ISP outputs digital image signals to DSP for processing. DSP converts digital image signals into standard RGB, YUV and other formats of image signals. In some embodiments, the electronic device 100 may include one or N cameras 193, and N is a positive integer greater than one.
其中,摄像头193可以包括前置摄像头和/或后置摄像头。摄像头193还可以包括多种类型。例如,摄像头193可以包括视场角从小到大变化的长焦摄像头、广角摄像头和超广角摄像头等。在本申请实施例中,在全景拍摄模式下,电子设备100可以采用视场角较大的摄像头(例如超广角摄像头或广角摄像头)采集不同角度的多帧图像,以便对采集到的具有较大视角范围的多帧图像进行裁剪后,拼接成具有更大视角范围的全景图像。The camera 193 may include a front camera and/or a rear camera. The camera 193 may also include multiple types. For example, the camera 193 may include a telephoto camera, a wide-angle camera, an ultra-wide-angle camera, etc. whose field of view angle varies from small to large. In the embodiment of the present application, in the panoramic shooting mode, the electronic device 100 may use a camera with a larger field of view (for example, an ultra-wide-angle camera or a wide-angle camera) to collect multiple frames of images at different angles, so as to have a larger view of the captured images. After cropping multiple frames of images in the viewing angle range, they are stitched into a panoramic image with a larger viewing angle range.
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当电子设备100在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。Digital signal processors are used to process digital signals. In addition to digital image signals, they can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the energy of the frequency point.
视频编解码器用于对数字视频压缩或解压缩。电子设备100可以支持一种或多种视频编解码器。这样,电子设备100可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。Video codecs are used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 can play or record videos in multiple encoding formats, such as: moving picture experts group (MPEG) 1, MPEG2, MPEG3, MPEG4, and so on.
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现电子设备100的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。NPU is a neural-network (NN) computing processor. By drawing on the structure of biological neural networks, for example, the transfer mode between human brain neurons, it can quickly process input information, and it can also continuously self-learn. The NPU can realize applications such as intelligent cognition of the electronic device 100, such as image recognition, face recognition, voice recognition, text understanding, and so on.
内部存储器121可以用于存储计算机可执行程序代码,可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行电子设备100的各种功能应用以及数据处理。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。The internal memory 121 may be used to store computer executable program code, and the executable program code includes instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running instructions stored in the internal memory 121. The internal memory 121 may include a storage program area and a storage data area. Among them, the storage program area can store an operating system, at least one application program (such as a sound playback function, an image playback function, etc.) required by at least one function. The data storage area can store data (such as audio data, phone book, etc.) created during the use of the electronic device 100. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash storage (UFS), and the like.
在本申请的实施例中,处理器110通过运行存储在内部存储器121的指令,将摄像头193采集的不同角度采集的图像在相互垂直的两个方向上分别进行拼接以生成全景图像,从而可以在两个方向上扩展全景图像的视场角。In the embodiment of the present application, the processor 110 runs the instructions stored in the internal memory 121 to stitch images collected from different angles by the camera 193 in two mutually perpendicular directions to generate a panoramic image. Expand the angle of view of the panoramic image in two directions.
电子设备100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。The electronic device 100 can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor. For example, music playback, recording, etc.
陀螺仪传感器180B可以用于确定电子设备100的运动姿态。在一些实施例中,可以通过陀螺仪传感器180B确定电子设备100围绕三个轴(即,x,y和z轴)的角速度。陀螺仪传感器180B可以用于拍摄防抖。示例性的,当按下快门,陀螺仪传感器180B检测电子设备100抖动的角度,根据角度计算出镜头模组需要补偿的距离,让镜头通 过反向运动抵消电子设备100的抖动,实现防抖。陀螺仪传感器180B还可以用于导航,体感游戏场景。The gyro sensor 180B may be used to determine the movement posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (ie, x, y, and z axes) can be determined by the gyroscope sensor 180B. The gyro sensor 180B can be used for image stabilization. Exemplarily, when the shutter is pressed, the gyro sensor 180B detects the shake angle of the electronic device 100, calculates the distance that the lens module needs to compensate according to the angle, and allows the lens to counteract the shake of the electronic device 100 through reverse movement to achieve anti-shake. The gyro sensor 180B can also be used for navigation and somatosensory game scenes.
在本申请的实施例中,陀螺仪传感器180B可以用于计算全景拍摄过程中,手机绕x轴的旋转角α和绕y轴的旋转角β。旋转角α和旋转角β可以用于确定全景拍摄过程的拍摄阶段,确定用于指示图像帧中心对应的偏离指示标记的位置,以及确定当前图像帧的偏离范围是否超出最大偏离范围等。In the embodiment of the present application, the gyroscope sensor 180B may be used to calculate the rotation angle α of the mobile phone around the x-axis and the rotation angle β around the y-axis in the panoramic shooting process. The rotation angle α and the rotation angle β can be used to determine the shooting stage of the panoramic shooting process, determine the position of the deviation indicator corresponding to the center of the image frame, and determine whether the deviation range of the current image frame exceeds the maximum deviation range, and so on.
触摸传感器180K,也称“触控面板”。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称“触控屏”。触摸传感器180K用于检测作用于其上或附近的触摸操作,例如用于指示拍摄全景图像的触摸操作等。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏194提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器180K也可以设置于电子设备100的表面,与显示屏194所处的位置不同。Touch sensor 180K, also called "touch panel". The touch sensor 180K may be provided on the display screen 194, and the touch screen is composed of the touch sensor 180K and the display screen 194, which is also called a “touch screen”. The touch sensor 180K is used to detect a touch operation acting on or near it, for example, a touch operation used to instruct to take a panoramic image. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. The visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K may also be disposed on the surface of the electronic device 100, which is different from the position of the display screen 194.
可以理解的是,本申请实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or combine certain components, or split certain components, or arrange different components. The illustrated components can be implemented in hardware, software, or a combination of software and hardware.
在本申请的实施例中,在全景拍摄模式下,摄像头193可以采集不同角度的多帧图像。显示屏194可以显示全景拍摄模式下的预览界面和拍摄界面。处理器110通过运行存储在内部存储器121的指令,将摄像头193采集的不同角度采集的图像在相互垂直的两个方向上分别进行拼接以生成全景图像,从而可以在两个方向上扩展全景图像的视场角。陀螺仪传感器180B可以用于计算全景拍摄过程中,手机绕x轴的旋转角α和绕y轴的旋转角β。旋转角α和旋转角β可以用于确定全景拍摄过程的拍摄阶段,确定用于指示图像帧中心对应的偏离指示标记的位置,以及确定当前图像帧的偏离范围是否超出最大偏离范围等。In the embodiment of the present application, in the panoramic shooting mode, the camera 193 can collect multiple frames of images at different angles. The display screen 194 can display the preview interface and the shooting interface in the panoramic shooting mode. The processor 110, by running the instructions stored in the internal memory 121, stitches the images collected by the camera 193 from different angles in two mutually perpendicular directions to generate a panoramic image, so that the panoramic image can be expanded in two directions. Angle of view. The gyro sensor 180B can be used to calculate the rotation angle α of the mobile phone around the x-axis and the rotation angle β around the y-axis in the panoramic shooting process. The rotation angle α and the rotation angle β can be used to determine the shooting stage of the panoramic shooting process, determine the position of the deviation indicator corresponding to the center of the image frame, and determine whether the deviation range of the current image frame exceeds the maximum deviation range, and so on.
以下将以电子设备为手机,手机的屏幕为触摸屏为例,对本申请实施例提供的全景拍摄方法进行阐述。参见图3,该方法可以包括:The following will take the electronic device as a mobile phone and the screen of the mobile phone as a touch screen as an example to describe the panoramic shooting method provided in the embodiment of the present application. Referring to Figure 3, the method may include:
301、手机进入全景拍摄模式后,在预览界面上显示引导路径,该引导路径包括沿第一方向设置的至少两条平行的子路径。301. After the mobile phone enters the panoramic shooting mode, a guide path is displayed on a preview interface, and the guide path includes at least two parallel sub-paths set along a first direction.
例如,手机检测到用户点击图4A中的(a)所示的相机图标401的操作后,启动相机应用,并进入如图4A中的(b)所示的拍照模式。示例性的,手机检测到用户点击图4A中的(b)所示的全景拍摄控件402的操作后,进入全景拍摄模式,显示如图4A中的(c)所示的预览界面。再示例性的,手机检测到用户点击图4A中的(b)所示的控件403的操作后,显示如图4A中的(d)所示的界面;手机检测到用户点击控件404的操作后,进入全景拍摄模式,并显示如图4A中的(c)所示的预览界面。For example, after the mobile phone detects that the user has clicked the camera icon 401 shown in (a) in FIG. 4A, it starts the camera application and enters the photographing mode shown in (b) in FIG. 4A. Exemplarily, after the mobile phone detects that the user has clicked the operation of the panoramic shooting control 402 shown in (b) in FIG. 4A, it enters the panoramic shooting mode and displays the preview interface as shown in (c) in FIG. 4A. For another example, after the mobile phone detects that the user clicks on the control 403 shown in (b) in FIG. 4A, it displays the interface shown in (d) in FIG. 4A; after the mobile phone detects that the user clicks on the control 404, , Enter the panoramic shooting mode, and display the preview interface as shown in (c) in Figure 4A.
需要说明的是,手机还可以响应于用户的其他触摸操作、语音指令或快捷手势等操作进入全景拍摄模式,本申请实施例对触发手机进入全景拍摄模式的操作不作限定。It should be noted that the mobile phone can also enter the panoramic shooting mode in response to other touch operations, voice commands, or shortcut gestures of the user. The embodiment of the present application does not limit the operation of triggering the mobile phone to enter the panoramic shooting mode.
其中,全景拍摄模式下的预览界面包括全景拍摄的引导信息。该引导信息包括引导路径。该引导路径用于指引用户在拍摄过程中沿该引导路径转动(和/或移动)手机,以使得手机采集的图像的中心线沿着引导路径移动从而完成全景拍摄。该引导路径包 括沿第一方向设置且相互平行的至少两条子路径。手机可以沿着第一方向的子路径采集不同角度的图像,并分别沿着每条子路径进行拼接,从而生成全景图像。当手机沿着某条第一方向的子路径拼接图像时,可以扩展全景图像在第一方向上的视场角;当第一方向的子路径包括多条时,在扩展第一方向的视场角的同时,手机还可以扩展全景图像在与第一方向垂直的第二方向上的视场角。Among them, the preview interface in the panoramic shooting mode includes guide information for panoramic shooting. The guidance information includes the guidance path. The guide path is used to guide the user to rotate (and/or move) the mobile phone along the guide path during the shooting process, so that the center line of the image collected by the mobile phone moves along the guide path to complete panoramic shooting. The guide path includes at least two sub-paths arranged along the first direction and parallel to each other. The mobile phone can collect images from different angles along the sub-paths in the first direction, and stitch them along each sub-path to generate a panoramic image. When the mobile phone stitches images along a sub-path in the first direction, the angle of view of the panoramic image in the first direction can be expanded; when the sub-path in the first direction includes multiple sub-paths, the field of view in the first direction is expanded At the same time, the mobile phone can also expand the angle of view of the panoramic image in the second direction perpendicular to the first direction.
在本申请的实施例中,沿第一方向设置的不同子路径用于引导用户沿第一方向来回多次拍摄,以扩展全景图像在与第一方向垂直的第二方向上的视场角。该种引导可以是精准的引导,也可以是大概趋势的引导。In the embodiment of the present application, the different sub-paths set along the first direction are used to guide the user to take multiple shots back and forth along the first direction to expand the angle of view of the panoramic image in the second direction perpendicular to the first direction. This kind of guidance can be precise guidance or general trend guidance.
例如,沿第一方向设置的不同子路径,在第一方向上对应的坐标范围相同。沿第一方向设置的不同子路径的两端分别对齐,且不同子路径具有相同的长度,从而通过各子路径对用户拍摄方向给予精确的引导。示例性的,参见图4B中的(a),引导路径包括沿第一方向设置的中间子路径41、上方子路径42和下方子路径43,且中间子路径41、上方子路径42和下方子路径43在第一方向上对应的坐标范围相同。For example, different sub-paths set along the first direction correspond to the same coordinate range in the first direction. The two ends of the different sub-paths arranged along the first direction are respectively aligned, and the different sub-paths have the same length, so that the user's shooting direction is accurately guided through each sub-path. Exemplarily, referring to (a) in FIG. 4B, the guide path includes a middle sub-path 41, an upper sub-path 42 and a lower sub-path 43 arranged along the first direction, and the middle sub-path 41, the upper sub-path 42 and the lower sub-path The coordinate ranges corresponding to the path 43 in the first direction are the same.
再例如,引导路径沿第一方向设置的不同子路径,在第一方向上对应的坐标范围之间存在重叠,沿所述第一方向设置且相互平行的不同子路径不是完全错开的。不同子路径的两端并未对齐,且不同子路径的也并不等长,从而通过引导路径对用户拍摄方向给予大概趋势的引导。示例性的,参见图4B中的(b),引导路径包括沿第一方向设置的中间子路径41、上方子路径42和下方子路径43,且中间子路径41、上方子路径42和下方子路径43在第一方向上对应的坐标范围之间存在部分重叠。For another example, different sub-paths arranged along the first direction of the guide path overlap between corresponding coordinate ranges in the first direction, and the different sub-paths arranged along the first direction and parallel to each other are not completely staggered. The two ends of the different sub-paths are not aligned, and the lengths of the different sub-paths are not equal, so that the user's shooting direction is guided by the guide path. Exemplarily, referring to (b) in FIG. 4B, the guide path includes a middle sub-path 41, an upper sub-path 42 and a lower sub-path 43 arranged along the first direction, and the middle sub-path 41, the upper sub-path 42 and the lower sub-path There is a partial overlap between the corresponding coordinate ranges of the path 43 in the first direction.
并且,如图4B中的(a)所示,沿第一方向设置的子路径上可以设置有方向指示标识(例如子路径上的箭头),以引导手机沿该子路径转动时的转动方向。当然,如图4B中的(b)所示,沿第一方向设置的子路径上也可以不设置方向指示标识,用户沿该子路径转动完成即可,不限定用户的具体转动方向。In addition, as shown in (a) of FIG. 4B, the sub-path set along the first direction may be provided with a direction indicator (for example, an arrow on the sub-path) to guide the direction of rotation when the mobile phone rotates along the sub-path. Of course, as shown in (b) of FIG. 4B, the sub-path set along the first direction may not be provided with a direction indication mark, and the user only needs to complete the rotation along the sub-path, and the specific rotation direction of the user is not limited.
此外,手机可以通过显示信息或语音播报等方式提示用户沿第一方向的不同子路径拍摄的先后关系。比如,手机可以通过文字信息提示用户,请在拍摄过程中先沿中间子路径转动拍摄,然后再分别沿上方子路径和下方子路径转动拍摄。再比如,手机可以通过指示箭头或其他指示方式,来提示用户沿不同子路径拍摄的先后关系。示例性的,参见图4B中的(c),箭头44用于指示用户先沿中间子路径转动拍摄,然后再沿上方子路径转动拍摄;箭头45用于指示用户在沿上方子路径转动拍摄之后,再沿下方子路径转动拍摄。In addition, the mobile phone can remind the user of the sequence of shooting along different sub-paths in the first direction by means of display information or voice broadcast. For example, the mobile phone can prompt the user through text messages to first rotate along the middle sub-path during the shooting, and then rotate along the upper sub-path and the lower sub-path to shoot. For another example, the mobile phone can remind the user of the sequence of shooting along different sub-paths by indicating arrows or other indicating methods. Exemplarily, referring to (c) in Figure 4B, the arrow 44 is used to instruct the user to first turn and shoot along the middle sub-path, and then to rotate along the upper sub-path to shoot; the arrow 45 is used to instruct the user to rotate and shoot along the upper sub-path , And then rotate and shoot along the sub-path below.
在一些实施例中,引导路径还可以包括沿第二方向设置的至少一条子路径。沿第二方向设置的子路径用于提示用户沿第一方向的不同子路径拍摄的先后关系。在一种可能的实现方式中,如图4B中的(d)所示,该引导路径还包括右方子路径46和左方子路径47,右方子路径46用于指示用户先沿中间子路径转动拍摄,然后再沿上方子路径转动拍摄;左方子路径47用于指示用户在沿上方子路径转动拍摄之后,再沿下方子路径转动拍摄。In some embodiments, the guide path may further include at least one sub-path arranged along the second direction. The sub-paths set along the second direction are used to remind the user of the sequence of shooting of different sub-paths along the first direction. In a possible implementation, as shown in (d) in FIG. 4B, the guide path further includes a right sub-path 46 and a left sub-path 47. The right sub-path 46 is used to instruct the user to first follow the middle sub-path. The path rotates and shoots, and then rotates along the upper sub-path to shoot; the left sub-path 47 is used to instruct the user to rotate along the upper sub-path for shooting, and then rotate along the lower sub-path to shoot.
在另一种可能的实现中,第二方向的子路径用于连接第一方向的子路径,整个引导路径为连续的路径。当沿第二方向设置的子路径包括多条时,该多条子路径相互平行。示例性的,该引导路径可以参见图4A中的(c)所示的路径405。In another possible implementation, the sub-path in the second direction is used to connect the sub-path in the first direction, and the entire guide path is a continuous path. When the sub-paths arranged along the second direction include multiple sub-paths, the multiple sub-paths are parallel to each other. Exemplarily, the guide path may refer to the path 405 shown in (c) in FIG. 4A.
可以理解的是,手机还可以通过其他多种方式提示用户沿第一方向的不同子路径拍摄的先后关系,本申请实施例不予限定。It is understandable that the mobile phone can also remind the user of the sequence of shooting along different sub-paths in the first direction in various other ways, which is not limited in the embodiment of the present application.
其中,第一方向和第二方向可以是与手机的相邻两条侧边分别平行的两个方向,且第二方向与第一方向垂直。Wherein, the first direction and the second direction may be two directions respectively parallel to two adjacent sides of the mobile phone, and the second direction is perpendicular to the first direction.
当用户握持手机进行全景拍摄时,手机的一条侧边通常与水平方向平行(或手机的一条侧边与水平方向的夹角小于或者等于预设值,即手机的一条侧边与水平方向基本平行),与该侧边相邻的另一条侧边通常与竖直方向平行(或手机的另一条侧边与竖直方向的夹角小于或者等于预设值,即手机的另一条侧边与竖直方向基本平行)。也就是说,第一方向和第二方向可以为水平方向和竖直方向。When the user holds the mobile phone for panoramic shooting, one side of the mobile phone is usually parallel to the horizontal direction (or the angle between one side of the mobile phone and the horizontal direction is less than or equal to the preset value, that is, one side of the mobile phone is basically parallel to the horizontal direction. Parallel), the other side adjacent to the side is usually parallel to the vertical direction (or the angle between the other side of the mobile phone and the vertical direction is less than or equal to the preset value, that is, the other side of the mobile phone is The vertical direction is basically parallel). That is, the first direction and the second direction may be a horizontal direction and a vertical direction.
以下针对第一方向和第二方向的不同方向情况分别进行说明:The following describes the different directions of the first direction and the second direction respectively:
情况1、第一方向为水平方向(或称横向),第二方向为竖直方向(或称纵向)。 Case 1. The first direction is the horizontal direction (or horizontal direction), and the second direction is the vertical direction (or vertical direction).
当第一方向为水平方向,第二方向为竖直方向时,引导路径包括水平方向和竖直方向的子路径,且水平方向的子路径可以包括至少两条,竖直方向的子路径用于连接水平方向的子路径。示例性的,参见图5中的(a),引导路径在水平方向上包括中间子路径501、上方子路径502和下方子路径503这三条子路径,竖直方向上包括左方子路径504和右方子路径505这两条子路径。预览界面上的引导路径用于提示用户整个拍摄过程中需要拍摄完成的完整路径。When the first direction is the horizontal direction and the second direction is the vertical direction, the guide path includes horizontal and vertical sub-paths, and the horizontal sub-path may include at least two, and the vertical sub-path is used for Connect the sub-paths in the horizontal direction. Exemplarily, referring to (a) in FIG. 5, the guide path includes three sub-paths: the middle sub-path 501, the upper sub-path 502, and the lower sub-path 503 in the horizontal direction, and the left sub-path 504 and the lower sub-path 503 in the vertical direction. The right sub-path 505 is two sub-paths. The guide path on the preview interface is used to remind the user of the complete path that needs to be taken during the entire shooting process.
在全景拍摄模式下,预览界面上的引导信息还可以包括偏离指示标记,用于指示摄像头当前实时采集到的图像在第一方向的中心线(即水平中心线)的位置。在一些实施例中,偏离指示箭头还可以指向该偏离指示箭头的待移动方向,即指向起始子路径的末端方向,也就是指向手机的待转动方向。在预览界面上,偏离指示标记位于起始子路径的始端位置。示例性的,在图5中的(b)所示的情况下,偏离指示标记可以为偏离指示箭头506,起始子路径为中间子路径501,偏离指示箭头506位于预览界面上中间子路径501的左端,且指向中间子路径501的右端。可以理解的是,偏离指示标记也可以为偏离指示线或其他形式,本申请实施例不予限定。以下将以偏离指示标记为偏离指示箭头为例进行说明。In the panoramic shooting mode, the guide information on the preview interface may also include a deviation indicator mark, which is used to indicate the position of the center line (ie, the horizontal center line) of the image currently collected by the camera in real time in the first direction. In some embodiments, the deviation indicator arrow may also point to the direction to be moved of the deviation indicator arrow, that is, to the end direction of the initial sub-path, that is, to the direction to be rotated of the mobile phone. On the preview interface, the deviation indicator is located at the beginning of the starting sub-path. Exemplarily, in the case shown in (b) in FIG. 5, the deviation indicator mark may be a deviation indicator arrow 506, the starting sub-path is the middle sub-path 501, and the deviation indicator arrow 506 is located on the middle sub-path 501 on the preview interface. The left end of and points to the right end of the middle sub-path 501. It is understandable that the deviation indicator mark may also be a deviation indicator line or other forms, which is not limited in the embodiment of the present application. The following will take the deviation indicator as the deviation indicator arrow as an example for description.
在一些实施例中,预览界面上的引导信息还可以包括子路径的偏离范围指示线。由于用户握持手机时容易发生抖动,因而手机采集的图像的水平中心线的位置通常也会发生变化,偏离指示箭头的位置也会发生变化。偏离范围指示线位于子路径的两侧,且与子路径平行,用于表示偏离指示箭头偏离子路径的最大允许范围。在预览界面上,手机可以仅显示起始子路径的偏离范围指示线。示例性的,在图5中的(b)所示的情况下,起始子路径为中间子路径,偏离范围指示线501a-501b可以为位于中间子路径501的两侧,且与中间子路径501平行的虚线。In some embodiments, the guidance information on the preview interface may also include a deviation range indication line of the sub-path. Since the user is prone to shaking when holding the mobile phone, the position of the horizontal center line of the image collected by the mobile phone will usually change, and the position of the deviation indicator arrow will also change. The deviation range indicator line is located on both sides of the sub-path, and is parallel to the sub-path, and is used to indicate the maximum allowable range of the deviation indicator arrow from the sub-path. On the preview interface, the mobile phone can only display the deviation range indicator line of the starting sub-path. Exemplarily, in the case shown in (b) of FIG. 5, the starting sub-path is the middle sub-path, and the deviation range indication lines 501a-501b may be located on both sides of the middle sub-path 501, and are in line with the middle sub-path. 501 Parallel dotted lines.
在一些实施例中,在预览状态下,手机可以通过显示信息或语音播报等方式提示用户,偏离指示箭头尽量与引导路径重合,且不要超出偏离范围指示线。示例性的,参见图4A中的(c),手机可以在预览界面上通过文字信息提示用户:开始拍摄后请慢慢转动手机,以使得箭头沿引导路径移动且不要超出虚线范围。In some embodiments, in the preview state, the mobile phone may prompt the user by displaying information or voice broadcast, etc., that the deviation indicator arrow overlaps with the guide path as much as possible, and should not exceed the deviation range indicator line. Exemplarily, referring to (c) in FIG. 4A, the mobile phone can prompt the user through text messages on the preview interface: After starting to shoot, slowly turn the mobile phone so that the arrow moves along the guide path and does not exceed the range of the dotted line.
在一些实施例中,参见图5中的(b),预览界面上还可以包括拼接预览窗口507。在预览界面上,拼接预览窗口位于引导路径的始端,偏离指示箭头可以位于拼接预览 窗口的旁边,且位于起始子路径的末端所在的一侧。例如,如图5中的(b)所示,拼接预览窗口位于起始子路径501的始端,且偏离指示箭头位于拼接预览窗口的右侧。如图4A中的(c)所示,在预览状态下,拼接预览窗口用于显示预览界面上当前显示的预览图像的缩略图(或称预览图像的预览图)。In some embodiments, referring to (b) in FIG. 5, the preview interface may further include a splicing preview window 507. On the preview interface, the splicing preview window is located at the beginning of the guide path, and the deviation indicator arrow can be located beside the splicing preview window and on the side where the end of the starting sub-path is located. For example, as shown in FIG. 5(b), the splicing preview window is located at the beginning of the starting sub-path 501, and the deviation indicating arrow is located on the right side of the splicing preview window. As shown in (c) of FIG. 4A, in the preview state, the stitching preview window is used to display the thumbnail of the preview image currently displayed on the preview interface (or called the preview image of the preview image).
在一些实施例中,拼接预览窗口会占用或遮挡一部分引导路径。由图5中的(b)可知,子路径501、子路径502和子路径503的长度相等,但由于拼接预览窗口会遮挡一部分引导路径,因而如图5中的(b)所示,与子路径502和子路径503相比子路径501的左端有缩进,且这三条子路径的右端对齐。在另一些实现方案中,由于拼接预览窗口会占用一定的面积,因而子路径501的长度本身就小于子路径502和子路径503,且与子路径502和子路径503相比子路径501的左端有缩进,子路径502和子路径503的左端对齐,且这三条子路径的右端也对齐。In some embodiments, the stitching preview window will occupy or block a part of the guide path. It can be seen from Fig. 5(b) that the lengths of the sub-path 501, the sub-path 502 and the sub-path 503 are equal, but because the splicing preview window will block a part of the guide path, as shown in Fig. 5(b), the sub-path 502 and sub-path 503 are indented compared to the left end of sub-path 501, and the right ends of the three sub-paths are aligned. In other implementations, since the splicing preview window occupies a certain area, the length of the sub-path 501 itself is smaller than the sub-path 502 and the sub-path 503, and compared with the sub-path 502 and the sub-path 503, the left end of the sub-path 501 is reduced. Then, the left ends of the sub-path 502 and the sub-path 503 are aligned, and the right ends of the three sub-paths are also aligned.
302、手机检测到用户的拍摄操作后,在拍摄界面上显示根据引导路径采集的图像拼接获得的图像。302. After the mobile phone detects the user's shooting operation, it displays an image obtained by splicing images collected according to the guide path on the shooting interface.
示例性的,手机检测到用户点击如图4A中的(c)所示的拍摄控件406的操作后,开始拍摄全景图像并显示拍摄界面。手机在拍摄界面上实时显示摄像头采集到的图像。可以理解的是,手机还可以响应于用户的语音指令或快捷手势等操作开始进行全景图像拍摄,本申请实施例对触发手机开始全景图像拍摄的操作不予限定。Exemplarily, after the mobile phone detects that the user has clicked the operation of the shooting control 406 shown in (c) of FIG. 4A, it starts to shoot a panoramic image and displays the shooting interface. The mobile phone displays the images collected by the camera on the shooting interface in real time. It is understandable that the mobile phone can also start panoramic image shooting in response to operations such as voice instructions or shortcut gestures of the user. The embodiment of the present application does not limit the operation of triggering the mobile phone to start panoramic image shooting.
手机在拍摄界面上显示引导信息,该引导信息包括引导路径、偏离指示箭头和偏离范围指示线。示例性的,手机检测到拍摄操作后,显示的拍摄界面可以参见图6中的(a)。其中,偏离指示箭头用于提示用户摄像头当前采集的图像中心线的位置,以及该中心线的位置与目标子路径的偏离程度。在一些实施例中,偏离指示箭头还可以指向该偏离指示箭头的待移动方向,即指向目标子路径的末端方向,也就是指向手机的待转动方向。其中,目标子路径为偏离指示箭头当前沿着其移动的子路径。在刚开始拍摄后,目标子路径为起始子路径(例如上述中间子路径),随着拍摄过程的进行,目标子路径会发生切换。其中,当目标子路径为水平子路径(即沿水平方向设置的子路径)时,偏离指示箭头沿水平子路径移动,偏离指示箭头用于表示手机采集的图像的水平中心线的位置,手机采集的不同图像的水平中心线沿水平子路径移动。当目标子路径为竖直子路径(即沿竖直方向设置的子路径)时,偏离指示箭头沿竖直子路径移动,偏离指示箭头用于表示手机采集的图像的竖直中心线的位置,手机采集的不同图像的竖直中心线沿竖直子路径移动。The mobile phone displays guide information on the shooting interface, and the guide information includes a guide path, a deviation indicator arrow, and a deviation range indicator line. Exemplarily, after the mobile phone detects the shooting operation, the displayed shooting interface may refer to (a) in FIG. 6. Wherein, the deviation indicator arrow is used to remind the user of the position of the center line of the image currently collected by the camera and the degree of deviation between the position of the center line and the target sub-path. In some embodiments, the deviation indicator arrow may also point to the direction to be moved of the deviation indicator arrow, that is, to the end direction of the target sub-path, that is, to the direction to be rotated of the mobile phone. Wherein, the target sub-path is a sub-path that deviates from the indicated arrow currently moving along it. After the shooting starts, the target sub-path is the starting sub-path (for example, the intermediate sub-path described above), and as the shooting process proceeds, the target sub-path will switch. Wherein, when the target sub-path is a horizontal sub-path (that is, a sub-path set in the horizontal direction), the deviation indicating arrow moves along the horizontal sub-path, and the deviation indicating arrow is used to indicate the position of the horizontal center line of the image collected by the mobile phone. The horizontal center lines of the different images move along the horizontal sub-path. When the target sub-path is a vertical sub-path (that is, a sub-path set in the vertical direction), the deviation indicating arrow moves along the vertical sub-path, and the deviation indicating arrow is used to indicate the position of the vertical center line of the image collected by the mobile phone. The vertical center lines of the different images collected by the mobile phone move along the vertical sub-path.
在拍摄过程中,手机可以通过显示信息或语音播报等方式提示用户,沿着引导路径慢慢转动手机,偏离指示箭头尽量与引导路径重合,且不要超出偏离范围指示线。示例性的,参见图6中的(a),手机可以通过文字信息提示用户:请慢慢转动手机,以使得箭头沿引导路径移动且不要超出虚线范围。当偏离指示箭头偏离目标子路径时,手机可以提示用户移动手机以将偏离指示箭头与目标子路径重合。示例性的,参见图6中的(b),当偏离指示箭头位于中间子路径的下方时,手机可以提示用户:请上移,使箭头与引导路径重合。During the shooting process, the mobile phone can prompt the user by displaying information or voice broadcast, etc., slowly turning the mobile phone along the guide path, and the deviation indicator arrow should coincide with the guide path as much as possible, and do not exceed the deviation range indicator line. Exemplarily, referring to (a) in FIG. 6, the mobile phone can prompt the user through a text message: Please turn the mobile phone slowly so that the arrow moves along the guide path and does not exceed the range of the dotted line. When the deviation indicator arrow deviates from the target sub-path, the mobile phone can prompt the user to move the mobile phone to coincide the deviation indicator arrow with the target sub-path. Exemplarily, referring to (b) in FIG. 6, when the deviation indicating arrow is located below the middle sub-path, the mobile phone may prompt the user: Please move up so that the arrow coincides with the guide path.
在刚进入拍摄过程后,拍摄界面上显示的引导路径为完整的引导路径。而后,手机向右转动以使得偏离指示箭头沿着水平子路径向右移动。在拍摄过程中,手机不断 转动从而采集不同角度的图像,以使得偏离指示箭头依次沿着中间子路径向右移动,沿着右方子路径向上移动,沿着上方子路径向左移动,沿着左方子路径向下移动,沿着下方子路径向右移动,直至完成整个引导路径的拍摄。在拍摄过程中,偏离指示箭头当前沿着其移动的子路径为目标子路径。例如,当偏离指示箭头沿着中间子路径移动时,目标子路径为中间子路径;当偏离指示箭头沿着右边子路径移动时,目标子路径为右方子路径。Just after entering the shooting process, the guide path displayed on the shooting interface is a complete guide path. Then, the mobile phone rotates to the right so that the deviation indicator arrow moves to the right along the horizontal sub-path. During the shooting process, the phone keeps turning to collect images from different angles, so that the deviation indicator arrow moves to the right along the middle sub-path, upwards along the right sub-path, and to the left along the upper sub-path, along the The left sub-path moves down, and moves to the right along the lower sub-path, until the entire guide path is taken. During the shooting process, the sub-path that deviates from the current movement of the indicating arrow is the target sub-path. For example, when the deviation indicating arrow moves along the middle sub-path, the target sub-path is the middle sub-path; when the deviation indicating arrow moves along the right sub-path, the target sub-path is the right sub-path.
在一些实施例中,为了更好的引导用户进行拍摄,在不同的拍摄阶段,拍摄界面上显示的引导路径会随着用户的拍摄过程而变化,拍摄界面上可以仅显示未完成拍摄的引导路径,即预览界面显示的引导路径上偏离指示箭头未经过的部分。其中,由于在拍摄过程中,偏离指示箭头在沿引导路径移动时,还可以在偏离范围指示线内波动。因而,可以理解的是,偏离指示箭头经过的引导路径,包括但不限于偏离指示箭头与引导路径重合时经过的部分,还包括偏离指示箭头未与引导路径重合且在偏离范围指示线范围内沿引导路径移动时经过的部分。在另一些实施例中,手机仅显示当前的目标子路径。在另一些实施例中,手机在拍摄界面上显示完整的引导路径,且已完成拍摄的引导路径和未完成拍摄的引导路径的显示方式不同。例如,未完成拍摄的引导路径为实线,已完成拍摄的引导路径为虚线。在另一些实施例中,手机在拍摄界面上显示完整的引导路径,直至完成拍摄。In some embodiments, in order to better guide the user to shoot, in different shooting stages, the guide path displayed on the shooting interface will change with the user's shooting process, and the shooting interface may only display the guide path of the unfinished shooting. , That is, the part of the guide path displayed on the preview interface that deviates from the indicated arrow. Among them, because in the shooting process, the deviation indicator arrow can also fluctuate within the deviation range indicator line when it moves along the guide path. Therefore, it can be understood that deviation from the guide path that the indicating arrow passes includes, but is not limited to, the part that the deviation indicating arrow passes through when the indicating arrow coincides with the guide path, and also includes the deviation indicating arrow that does not coincide with the guide path and is along the deviation range indicating line. The part of the guide path when it moves. In other embodiments, the mobile phone only displays the current target sub-path. In other embodiments, the mobile phone displays the complete guide path on the shooting interface, and the display mode of the guide path for the completed shooting and the guide path for the incomplete shooting is different. For example, the guide path for unfinished shooting is a solid line, and the guide path for completed shooting is a dotted line. In other embodiments, the mobile phone displays the complete guide path on the shooting interface until the shooting is completed.
此外,拍摄界面上还包括拼接预览窗口,用于显示拍摄过程中手机拼接获得的图像的缩略图(或称拼接图像的预览图)。在拍摄界面上,偏离指示箭头可以位于拼接预览窗口的旁边,且位于目标子路径的末端所在的一侧。在拍摄界面上,拼接预览窗口的大小、位置和形状等特征与已完成拍摄的引导路径相对应。例如,拍摄界面上的拼接预览窗口可以覆盖已完成拍摄的引导路径。在开始拍摄后,手机采集到图像1,手机在拍摄界面上显示图像1,并在拼接预览窗口中显示图像1。在拍摄过程中,手机沿着引导路径转动时,摄像头的拍摄角度和拍摄范围也发生变化,从而可以采集不同角度的图像,手机可以将不同角度的图像拼接后显示在拼接预览窗口内。手机在拼接预览窗口内显示的图像,具体可以为手机沿第一方向的水平子路径转动时对采集的图像拼接获得的目标图像,也即偏离指示标记沿着第一方向的水平子路径移动时手机对采集的图像拼接获得的目标图像。In addition, the shooting interface also includes a stitching preview window, which is used to display thumbnails (or called previews of stitched images) of images obtained by stitching by mobile phones during shooting. On the shooting interface, the deviation indicator arrow can be located beside the stitching preview window and on the side where the end of the target subpath is located. On the shooting interface, the size, position, and shape of the stitching preview window correspond to the guide path of the completed shooting. For example, the stitching preview window on the shooting interface can cover the guide path of the completed shooting. After the start of shooting, the mobile phone collects image 1, the mobile phone displays image 1 on the shooting interface, and displays image 1 in the stitching preview window. During the shooting process, when the phone rotates along the guide path, the shooting angle and shooting range of the camera also change, so that images from different angles can be collected. The phone can stitch images from different angles and display them in the stitching preview window. The image displayed by the mobile phone in the splicing preview window can be specifically the target image obtained by splicing the collected images when the mobile phone rotates along the horizontal sub-path in the first direction, that is, when the deviation indicator moves along the horizontal sub-path in the first direction The target image obtained by splicing the collected images by the mobile phone.
在拍摄过程中,手机采集到的不同角度的图像可以根据预设的规则线进行裁剪和拼接。如图7所示,该规则线包括上基线、中基线和下基线,分别对应水平方向的上方子路径、中间子路径和下方子路径。该规则线还包括第1裁剪线、第2裁剪线、第3裁剪线和第4裁剪线。其中,第1裁剪线和第2裁剪线位于上基线的两侧,且分别与水平方向的上方子路径两侧的偏离范围指示线对应。第1裁剪线和第2裁剪线组成了上基线图像(即手机沿着上方子路径转动时采集的图像)的上、下裁剪范围,限定了手机沿上方子路径转动拍摄的过程中采集的图像的水平中心线的最大偏离范围。第2裁剪线和第3裁剪线位于中基线的两侧,且分别与水平方向上中间子路径两侧的偏离范围指示线对应。第2裁剪线和第3裁剪线组成了中基线图像(即手机沿着中间子路径转动时采集的图像)的上、下裁剪范围,限定了手机沿中间子路径转动拍摄的过程中采集的图像的水平中心线的最大偏离范围。第3裁剪线和第4裁剪线位于下基线 的两侧,且分别与水平方向上下方子路径两侧的偏离范围指示线对应。第3裁剪线和第4裁剪线组成了下基线图像(即手机沿着下方子路径转动时采集的图像)的上、下裁剪范围,限定了手机沿下方子路径转动拍摄的过程中采集的图像的水平中心线的最大偏离范围。During the shooting process, images of different angles collected by the mobile phone can be cropped and stitched according to preset rule lines. As shown in FIG. 7, the rule line includes an upper baseline, a middle baseline, and a lower baseline, which correspond to the upper sub-path, the middle sub-path, and the lower sub-path in the horizontal direction, respectively. The rule line also includes the first cutting line, the second cutting line, the third cutting line, and the fourth cutting line. Wherein, the first cutting line and the second cutting line are located on both sides of the upper baseline, and respectively correspond to the deviation range indication lines on both sides of the upper sub-path in the horizontal direction. The first cropping line and the second cropping line constitute the upper and lower cropping ranges of the upper baseline image (that is, the image collected when the mobile phone rotates along the upper sub-path), which limits the images collected during the process of the mobile phone rotating along the upper sub-path. The maximum deviation range of the horizontal centerline. The second cutting line and the third cutting line are located on both sides of the middle baseline, and respectively correspond to the deviation range indication lines on both sides of the middle sub-path in the horizontal direction. The second cropping line and the third cropping line constitute the upper and lower cropping ranges of the mid-baseline image (that is, the image collected when the mobile phone rotates along the middle sub-path), which limits the image collected during the shooting of the mobile phone while rotating along the middle sub-path The maximum deviation range of the horizontal centerline. The 3rd cutting line and the 4th cutting line are located on both sides of the lower baseline, and respectively correspond to the deviation range indicator lines on both sides of the upper and lower subpaths in the horizontal direction. The 3rd and 4th cutting lines form the upper and lower cutting ranges of the lower baseline image (that is, the image collected when the mobile phone rotates along the lower sub-path), which limits the images collected during the process of the mobile phone rotating along the lower sub-path. The maximum deviation range of the horizontal centerline.
此外,该规则线还包括左基线和右基线,分别对应竖直方向上的左方子路径和右方子路径。并且,该规则线还包括左边界、左裁剪线、右裁剪线和右边界。其中,左边界和左裁剪线位于左基线的两侧,且分别与竖直方向上左方子路径两侧的偏离范围指示线对应。左边界和左裁剪线限定了左基线图像(即手机沿着左方子路径转动时采集的图像)的竖直中心线的左、右最大偏离范围。并且,左边界还定义了拼接全景图像时的左侧边界,超出左边界的图像部分在拼接时可以直接裁掉。In addition, the ruled line also includes a left baseline and a right baseline, which respectively correspond to the left sub-path and the right sub-path in the vertical direction. And, the rule line also includes a left boundary, a left clipping line, a right clipping line, and a right boundary. Among them, the left border and the left clipping line are located on both sides of the left baseline, and respectively correspond to the deviation range indication lines on both sides of the left sub-path in the vertical direction. The left border and the left crop line define the left and right maximum deviation range of the vertical center line of the left baseline image (ie, the image collected when the mobile phone rotates along the left sub-path). In addition, the left border also defines the left border when stitching the panoramic image, and the part of the image beyond the left border can be directly cut off when stitching.
右边界和右裁剪线位于右基线的两侧,且分别与竖直方向上右方子路径两侧的偏离范围指示线对应。右边界和右裁剪线限定了右基线图像(即手机沿着右方子路径转动时采集的图像)的竖直中心线的左、右最大偏离范围。并且,右边界还定义了拼接全景图像时的右侧边界,超出右边界的图像部分在拼接时可以直接裁掉。The right border and the right clipping line are located on both sides of the right baseline, and respectively correspond to the deviation range indication lines on both sides of the right sub-path in the vertical direction. The right border and the right crop line define the left and right maximum deviation range of the vertical center line of the right baseline image (that is, the image collected when the mobile phone rotates along the right sub-path). In addition, the right border also defines the right border when stitching the panoramic image, and the part of the image beyond the right border can be directly cut off when stitching.
其中,不同基线对应的偏离指示范围的大小可以相同也可以不同。需要说明的是,为便于示意,图7所示的各条规则线为平面上的直线,实际上各条规则线为圆柱面上的曲线。Wherein, the size of the deviation indication range corresponding to different baselines may be the same or different. It should be noted that, for ease of illustration, each of the regular lines shown in FIG. 7 is a straight line on a plane, and in fact, each regular line is a curve on a cylindrical surface.
在全景图像的拍摄过程中,手机采集图像时的姿态和图像采集时间可以用于标示偏离指示箭头的位置,用于切换目标子路径,以及用于确定图像的中心线是否超出裁剪范围等。示例性的,在图8中的(a)所示的一种三维坐标系中,三维坐标轴包括x轴、y轴和z轴。手机镜头所在的平面在xy平面上或与xy平面平行,z轴垂直于手机镜头所在的平面。手机镜头所在的平面还与手机屏幕所在的屏幕平行。在该三维坐标系中,手机采集图像时的姿态可以通过手机绕x轴、y轴和z轴的旋转角来表示。在手机沿水平子路径转动的过程中,手机绕y轴转动。在手机沿竖直子路径转动的过程中,手机绕x轴转动。In the panoramic image shooting process, the posture of the mobile phone when the image is collected and the image collection time can be used to mark the position deviating from the indicator arrow, to switch the target sub-path, and to determine whether the center line of the image exceeds the cropping range, etc. Exemplarily, in a three-dimensional coordinate system shown in (a) of FIG. 8, the three-dimensional coordinate axes include x-axis, y-axis, and z-axis. The plane where the mobile phone lens is located is on the xy plane or parallel to the xy plane, and the z axis is perpendicular to the plane where the mobile phone lens is located. The plane where the lens of the mobile phone is located is also parallel to the screen where the screen of the mobile phone is located. In this three-dimensional coordinate system, the posture of the mobile phone when collecting images can be represented by the rotation angle of the mobile phone around the x-axis, y-axis, and z-axis. When the mobile phone rotates along the horizontal sub-path, the mobile phone rotates around the y-axis. When the mobile phone rotates along the vertical sub-path, the mobile phone rotates around the x-axis.
手机陀螺仪按照预设频率输出对应时刻手机的三轴旋转角速度ρ α,ρ β,ρ γ。同时,手机给陀螺仪数据添加一个对应的时间戳t。此外,手机会在图像帧的生成时刻打上一个对应的时间戳T。一般地,参见图8中的(b),陀螺仪的采样频率远高于视频帧,所以相邻两帧图像之间可能包含多个陀螺仪数据。 The mobile phone gyroscope outputs the three-axis rotational angular velocity ρ α , ρ β , ρ γ of the mobile phone at the corresponding time according to the preset frequency. At the same time, the mobile phone adds a corresponding time stamp t to the gyroscope data. In addition, the mobile phone will stamp a corresponding timestamp T at the moment when the image frame is generated. Generally, referring to (b) in Figure 8, the sampling frequency of the gyroscope is much higher than the video frame, so there may be multiple gyroscope data between two adjacent frames.
其中,手机在相邻两帧图像的采集时刻之间绕x轴的旋转角α′可以通过式1得到:Among them, the rotation angle α'of the mobile phone around the x-axis between the collection moments of two adjacent frames of images can be obtained by Equation 1:
Figure PCTCN2021078666-appb-000024
Figure PCTCN2021078666-appb-000024
在式1中,T 0表示前一帧对应时刻,T 1表示后一帧对应时刻,
Figure PCTCN2021078666-appb-000025
表示T 0与T 1之间第k个陀螺仪的旋转角速度,
Figure PCTCN2021078666-appb-000026
表示T 0与T 1之间第k-1个陀螺仪的旋转角速度,t k表示第k个陀螺仪数据对应的时刻,t k-1表示第k-1个陀螺仪数据对应的时刻,
Figure PCTCN2021078666-appb-000027
表示T 0与T 1之间第0个陀螺仪的旋转角速度,t 0表示第0个陀螺仪数据对应的时刻,
Figure PCTCN2021078666-appb-000028
表示T 0与T 1之间第N个陀螺仪的旋转角速度,t N表示第N个陀螺仪数据对应的时刻。其中,T 0与T 1之间共有0-N个陀螺仪数据。
In formula 1, T 0 represents the time corresponding to the previous frame, and T 1 represents the time corresponding to the next frame,
Figure PCTCN2021078666-appb-000025
Represents the rotational angular velocity of the k-th gyroscope between T 0 and T 1,
Figure PCTCN2021078666-appb-000026
Represents the rotational angular velocity of the k-1th gyroscope between T 0 and T 1 , t k represents the time corresponding to the k-th gyroscope data, t k-1 represents the time corresponding to the k-1th gyroscope data,
Figure PCTCN2021078666-appb-000027
Represents the rotational angular velocity of the 0th gyroscope between T 0 and T 1 , t 0 represents the time corresponding to the 0th gyroscope data,
Figure PCTCN2021078666-appb-000028
It represents the rotational angular velocity of the Nth gyroscope between T 0 and T 1 , and t N represents the time corresponding to the Nth gyroscope data. Among them, there are 0-N gyroscope data between T 0 and T 1.
类似地,手机也可以得到手机在相邻两帧图像的采集时刻之间绕y轴的旋转角。通过将帧与帧之间手机的旋转角累加,可以得到任意一帧图像的采集时刻手机绕x轴 的旋转角α和绕y轴的旋转角β(也称任意一帧图像对应的旋转角α和旋转角β)。Similarly, the mobile phone can also obtain the rotation angle of the mobile phone around the y-axis between the collection moments of two adjacent frames of images. By accumulating the rotation angle of the phone between frames, the rotation angle α of the phone around the x-axis and the rotation angle β around the y-axis at the time of collection of any frame of image can be obtained (also called the rotation angle α corresponding to any frame of image And the rotation angle β).
其中,中基线与开始拍摄后手机采集到的首帧图像的水平中心线对应,也就是α=0。首帧图像映射到圆柱面后的水平中心线与圆柱面上的中基线重合。上基线和下基线则相对于中基线绕x轴旋转了一定的角度,旋转角分别记为α t和α b。而水平裁剪线1-4绕x轴的旋转角也可以分别记为α 1,α 2,α 3,α 4。这些旋转角的数值可以用于调节拼接全景图像时在竖直方向的视场角的扩展范围,以及图像的水平中心线能够偏离基线的最大范围。 Among them, the middle baseline corresponds to the horizontal center line of the first frame image collected by the mobile phone after the start of shooting, that is, α=0. The horizontal centerline of the first frame of image mapped to the cylindrical surface coincides with the center baseline on the cylindrical surface. The upper and lower baselines are rotated by a certain angle around the x-axis relative to the middle baseline, and the rotation angles are denoted by α t and α b respectively . The rotation angles of the horizontal cutting lines 1-4 around the x-axis can also be denoted as α 1 , α 2 , α 3 , and α 4, respectively . The values of these rotation angles can be used to adjust the extension range of the vertical view angle when stitching panoramic images, and the maximum range within which the horizontal center line of the image can deviate from the baseline.
类似地,左基线与开始拍摄后手机采集到的首帧图像的竖直中心线对应,也就是β=0。右基线相对于左基线绕y轴旋转了一定的角度,记为β r。左边界、左裁剪线、右裁剪线和右边界绕y轴的旋转角可以分别记为β 1,β 2,β 3,β 4。其中,各条规则线与旋转角的对应关系可以参见图7。 Similarly, the left baseline corresponds to the vertical center line of the first frame image collected by the mobile phone after the start of shooting, that is, β=0. The right baseline rotates a certain angle around the y axis relative to the left baseline, which is recorded as β r . The rotation angles of the left border, the left clipping line, the right clipping line, and the right border around the y-axis can be denoted as β 1 , β 2 , β 3 , β 4, respectively . Among them, the corresponding relationship between each ruled line and the rotation angle can be seen in FIG. 7.
手机可以通过采集每一帧图像时手机的旋转角α确定当前图像的水平中心线,从而在拍摄界面上画出与旋转角α对应的偏离指示箭头。手机可以根据旋转角α确定偏离指示箭头是否超出水平方向子路径的偏离范围指示线,手机还可以根据旋转角β确定偏离指示箭头是否超出竖直方向子路径的偏离范围指示线。手机还可以根据旋转角α和旋转角β确定是否切换目标子路径。并且,目标子路径不同,图像的拼接方式也不同。以下将以图4A中的(a)所示的引导路径为例进行说明。The mobile phone can determine the horizontal centerline of the current image by the rotation angle α of the mobile phone when each frame of image is collected, thereby drawing a deviation indicator arrow corresponding to the rotation angle α on the shooting interface. The mobile phone can determine whether the deviation indicator arrow exceeds the deviation range indicator line of the horizontal sub-path according to the rotation angle α, and the mobile phone can also determine whether the deviation indicator arrow exceeds the deviation range indicator line of the vertical sub-path according to the rotation angle β. The mobile phone can also determine whether to switch the target sub-path according to the rotation angle α and the rotation angle β. Moreover, the target sub-path is different, the image stitching method is also different. Hereinafter, the guide path shown in (a) of FIG. 4A will be used as an example for description.
(1)、目标子路径为中间子路径,拼接上基线图像(1) The target sub-path is the middle sub-path, and the baseline image is spliced
在开始拍摄后,手机首先沿着中间子路径向右转动,手机采集到的图像可以称为中基线图像,也可以称为中间子路径的图像,目标子路径为中间子路径,旋转角β由0开始不断变化。After shooting, the phone first rotates to the right along the middle sub-path. The image collected by the phone can be called the middle baseline image or the image of the middle sub-path. The target sub-path is the middle sub-path, and the rotation angle β Constantly changing from 0.
手机采集到第一帧中基线图像(即中间子路径的第一帧图像)后,按照式2-4对第一帧图像进行圆柱面映射,得到圆柱面上的第一帧中基线图像’。After the mobile phone collects the baseline image in the first frame (that is, the first frame image of the intermediate sub-path), it performs cylindrical mapping on the first frame image according to formula 2-4 to obtain the baseline image' in the first frame on the cylindrical surface.
Figure PCTCN2021078666-appb-000029
Figure PCTCN2021078666-appb-000029
Figure PCTCN2021078666-appb-000030
Figure PCTCN2021078666-appb-000030
Figure PCTCN2021078666-appb-000031
Figure PCTCN2021078666-appb-000031
其中,α表示手机绕x轴的旋转角,f表示手机镜头的焦距参数,(c x,c y)是图像中心点的坐标,(x,y)和(x′,y′)分别表示映射前后图像中对应的像素点。示例性的,对于摄像头采集到的图像帧,当旋转角α=0,α>0和α<0时,对应的圆柱面映射结果分别可以参见图9中的(a)、(b)和(c)。其中,当α=0时,映射后图像上、下边界的尺度变化是对称的。当α>0时,手机向上旋转了一定的角度,映射后图像上边界的尺度变化大于下边界的尺度变化。当α<0时,手机向下旋转了一定的角度,映射后图像上边界的尺度变化小于下边界的尺度变化。 Among them, α represents the rotation angle of the mobile phone around the x axis, f represents the focal length parameter of the mobile phone lens, (c x , c y ) is the coordinate of the image center point, (x, y) and (x', y') respectively represent the mapping Corresponding pixels in the front and back images. Exemplarily, for the image frame collected by the camera, when the rotation angle α=0, α>0 and α<0, the corresponding cylindrical surface mapping results can be seen in (a), (b) and ( c). Among them, when α=0, the scale changes of the upper and lower boundaries of the image after mapping are symmetrical. When α>0, the phone rotates upward by a certain angle, and the scale change of the upper boundary of the image after mapping is greater than the scale change of the lower boundary. When α<0, the phone rotates downward by a certain angle, and the scale change of the upper boundary of the image after mapping is smaller than the scale change of the lower boundary.
其中,由于中基线的位置是根据第一帧中基线图像的水平中心线定义的,因而第一帧中基线图像对应的旋转角α=0(即手机采集第一帧中基线图像时手机的旋转角α=0),第一帧中基线图像的映射结果相对于中基线水平对称。第一帧中基线图像的左边界即为整个全景图像的左边界,参见图10,第一帧中基线图像位于裁剪范围内的部分即为初始的中基线图像拼接结果RI1,即偏离指示箭头沿中间子路径移动时拼接获 得的初始目标图像RI1。示例性的,参见图6中的(a),手机在拼接预览窗口内显示中基线图像拼接结果RI1。Among them, since the position of the middle baseline is defined according to the horizontal center line of the baseline image in the first frame, the rotation angle α = 0 corresponding to the baseline image in the first frame (that is, the rotation of the mobile phone when the mobile phone collects the baseline image in the first frame) Angle α=0), the mapping result of the baseline image in the first frame is symmetric with respect to the middle baseline level. The left edge of the baseline image in the first frame is the left edge of the entire panoramic image. See Figure 10. The part of the baseline image in the first frame that lies within the cropping range is the initial mid-baseline image stitching result RI1, that is, the deviation indicating arrow edge The initial target image RI1 obtained by stitching when the middle sub-path moves. Exemplarily, referring to (a) in Figure 6, the mobile phone displays the middle baseline image stitching result RI1 in the stitching preview window.
可以理解的是,当手机在不同姿态下拍摄图像时,拍摄图像的角度不同,同一对象在不同角度拍摄的图像上的尺寸和成像特征也不同,因而无法直接将不同角度拍摄的图像进行配准和拼接,从而生成全景图像。在本申请实施例中,不同姿态下拍摄的不同角度的图像可以先进行圆柱面映射,使得不同角度拍摄的图像上同一对象映射后的尺寸和成像特征相匹配,从而可以进行配准和拼接以生成全景图像,因而可以符合全景图各部分图像尺寸基本一致的视觉效果。It is understandable that when the mobile phone shoots images in different postures, the angles of the captured images are different, and the size and imaging characteristics of the same object on the images shot at different angles are also different, so it is impossible to directly register the images shot at different angles. And stitching to generate a panoramic image. In the embodiment of the present application, images with different angles taken in different poses can be first mapped to a cylindrical surface, so that the size and imaging characteristics of the same object on the images taken at different angles can be matched, so that registration and stitching can be performed. Generate a panoramic image, which can meet the visual effect of basically the same size of each part of the panoramic image.
而后,用户沿着中间子路径转动手机,手机采集到第i帧中基线图像(i为大于1的整数),记为I i,手机根据式2-4对第i帧中基线图像进行圆柱面映射后得到第i帧中基线图像’
Figure PCTCN2021078666-appb-000032
第i帧中基线图像I i的前一帧图像为第i-1帧中基线图像,记为I i-1。I i-1的圆柱面映射结果记为
Figure PCTCN2021078666-appb-000033
如图11所示,手机根据预设算法提取
Figure PCTCN2021078666-appb-000034
Figure PCTCN2021078666-appb-000035
的特征点F I,i和F I,i-1然后计算F I,i和F I,i-1的匹配结果。该匹配结果用于表示F I,i和F I,i-1中相互匹配的特征点的对应关系。比如,该匹配结果可以是一个结合,包括多个匹配的特征点对。
Then, the user rotates the mobile phone along the middle sub-path, the mobile phone collects the baseline image in the i-th frame (i is an integer greater than 1), denoted as I i , the mobile phone performs a cylindrical surface on the baseline image in the i-th frame After mapping, get the baseline image in the i-th frame'
Figure PCTCN2021078666-appb-000032
The previous frame image of the baseline image I i in the i-th frame is the baseline image in the i-1th frame, denoted as I i-1 . The cylindrical surface mapping result of I i-1 is recorded as
Figure PCTCN2021078666-appb-000033
As shown in Figure 11, the mobile phone extracts according to the preset algorithm
Figure PCTCN2021078666-appb-000034
with
Figure PCTCN2021078666-appb-000035
Feature point F I, i and F I, i-1 and then calculate F I, i and F I, i-1 the matching result. The matching result is used to indicate the corresponding relationship between the feature points that match each other in F I,i and F I,i-1. For example, the matching result may be a combination, including multiple matching feature point pairs.
手机根据该匹配结果进一步计算
Figure PCTCN2021078666-appb-000036
Figure PCTCN2021078666-appb-000037
的单应性矩阵H。参见图12中的(a),手机根据单应性矩阵H将
Figure PCTCN2021078666-appb-000038
Figure PCTCN2021078666-appb-000039
进行映射。手机将映射后的
Figure PCTCN2021078666-appb-000040
处于裁剪范围内的矩形部分(即图12中的(a)中横线填充的矩形部分)裁剪下来,拼接到中基线图像拼接结果RI(i-1)(即图12中的(a)中条纹填充的矩形部分)的右侧;从而形成中基线图像拼接结果RIi,即偏离指示箭头沿中间子路径移动时拼接获得的目标图像RIi。其中,中基线图像对应的裁剪范围为第2裁剪线、第3裁剪线、左边界线和右边界线限定的范围。示例性的,手机在拼接预览窗口内显示的中基线图像拼接结果RIi可以参见图12中的(b)。
The mobile phone further calculates according to the matching result
Figure PCTCN2021078666-appb-000036
with
Figure PCTCN2021078666-appb-000037
The homography matrix H. See (a) in Figure 12, the mobile phone will
Figure PCTCN2021078666-appb-000038
Towards
Figure PCTCN2021078666-appb-000039
Map it. The phone will be mapped
Figure PCTCN2021078666-appb-000040
The rectangular part within the cropping range (that is, the rectangular part filled with horizontal lines in (a) in Figure 12) is cropped and spliced to the middle baseline image stitching result RI(i-1) (that is, in (a) in Figure 12). The right side of the rectangular part filled with stripes); thereby forming the middle baseline image stitching result RIi, that is, the target image RIi obtained by stitching when the deviation indicator arrow moves along the middle sub-path. Among them, the cropping range corresponding to the middle baseline image is the range defined by the second cropping line, the third cropping line, the left boundary line, and the right boundary line. Exemplarily, the mid-baseline image stitching result RIi displayed in the stitching preview window of the mobile phone can be seen in (b) in FIG. 12.
而后,用户沿着中间子路径继续转动手机。手机重复上述采集、映射和拼接过程,直至β>β r。此时,手机沿着中间子路径采集的所有中基线图像帧都拼接完成,从而生成中基线图像拼接结果RI,即中间子路径对应的拼接结果RI。需要说明的是,对于β≤β r情况下的最后一帧中基线图像映射到圆柱面后的图像,右边界可以作为其右侧的裁剪线,超出右边界的部分可以被裁掉。 Then, the user continues to turn the phone along the middle sub-path. The mobile phone repeats the above collection, mapping and splicing process until β>β r . At this time, all the mid-baseline image frames collected by the mobile phone along the middle sub-path are stitched, thereby generating a middle-baseline image stitching result RI, that is, the stitching result RI corresponding to the middle sub-path. Note that, in the final baseline image for a case in β≤β r mapped to image the cylindrical surface, cut lines may be used as the right boundary of the right side thereof, beyond the right boundary portion may be cut.
需要说明的是,在中基线图像的拼接过程中,手机可以根据预设算法,并结合中基线图像对应的旋转角α选取关键帧,使得这些关键帧之间有部分重叠,且基本均匀地分布在中基线上。这些关键帧可以使得上、下基线图像拼接结果与中基线图像拼接结果能够更好的匹配和融合。其中,相邻关键帧之间对应的绕y轴的旋转角的间隔Δβ,可以根据缓存大小或实际需求等因素灵活设置。示例性的,中基线图像中获取的关键帧的示意图可以参见图13。It should be noted that during the stitching process of the mid-baseline image, the mobile phone can select key frames according to the preset algorithm and combined with the rotation angle α corresponding to the mid-baseline image, so that these key frames overlap partially and are basically evenly distributed. On the midline. These key frames can make the upper and lower baseline image stitching results and the middle baseline image stitching results better match and merge. Among them, the interval Δβ of the rotation angle around the y-axis between adjacent key frames can be flexibly set according to factors such as the size of the buffer or actual requirements. Exemplarily, refer to FIG. 13 for a schematic diagram of the key frames acquired in the mid-baseline image.
其中,在偏离指示箭头沿中间子路径向右移动的过程中,旋转角β随着手机的转动而不断变化。在一些技术方案中,参见图12中的(b)所示,手机显示未完成拍摄的中间子路径、右方子路径、上方子路径、左方子路径和下方子路径。在另一些技术方案中,参见图14A中的(a),手机仅显示当前针对的中间子路径;参见图14A中的(b),在将要切换到右方子路径时再显示右方子路径。在另一些技术方案中,手机在拍摄界面上显示完整的拍摄路径,且已完成拍摄的引导路径为虚线,未完成拍摄的引 导路径为实线。在另一些实施例中,手机仍显示完整的引导路径。Wherein, in the process of the deviation indicating arrow moving to the right along the middle sub-path, the rotation angle β changes continuously with the rotation of the mobile phone. In some technical solutions, referring to (b) in FIG. 12, the mobile phone displays the middle sub-path, the right sub-path, the upper sub-path, the left sub-path, and the lower sub-path that have not been photographed. In other technical solutions, see (a) in Figure 14A, the mobile phone only displays the currently targeted middle sub-path; see (b) in Figure 14A, and then display the right sub-path when it is about to switch to the right sub-path . In some other technical solutions, the mobile phone displays the complete shooting path on the shooting interface, and the guide path for the completed shooting is a dotted line, and the guide path for the unfinished shooting is a solid line. In other embodiments, the mobile phone still displays the complete guidance path.
在拍摄过程中,当引导路径不包括第二方向的子路径时,手机可以通过第二方向的子路径提示用户沿第一方向的不同子路径拍摄的先后关系。在拍摄过程中,当引导路径不包括第二方向的子路径时,手机可以通过显示信息或语音播报等方式提示用户沿不同子路径拍摄的先后关系。以引导路径为图4B中的(a)所示的路径为例进行说明。示例性的,参见图14B中的(a),手机显示未完成拍摄的中间子路径(即中间子路径上偏离指示箭头未经过的部分)、上方子路径以及指向上方子路径的箭头,该箭头用于提示用户在沿着中间子路径拍摄完成后,沿着上方子路径继续拍摄。再示例性的,参见图14B中的(b),手机显示未完成拍摄的中间子路径、上方子路径、下方子路径以及指向上方子路径的箭头,该箭头用于提示用户在沿着中间子路径拍摄完成后,沿着上方子路径继续拍摄。再例如,手机显示未完成拍摄的中间子路径、上方子路径以及下方子路径,当偏离指示箭头到达中间子路径的末端时,手机高亮显示上方子路径,以提示用户接下来沿着上方子路径转动手机进行拍摄。During the shooting process, when the guide path does not include the sub-path in the second direction, the mobile phone can prompt the user to take the sequence of different sub-paths in the first direction through the sub-path in the second direction. During the shooting process, when the guide path does not include the sub-paths in the second direction, the mobile phone can prompt the user to take pictures along the different sub-paths by means of display information or voice broadcast. A description will be given by taking the guide path as the path shown in (a) in FIG. 4B as an example. Exemplarily, referring to (a) in Figure 14B, the mobile phone displays the middle sub-path (that is, the part of the middle sub-path that deviates from the indicating arrow that has not passed), the upper sub-path, and the arrow pointing to the upper sub-path. It is used to remind the user to continue shooting along the upper sub-path after the shooting along the middle sub-path is completed. For another example, referring to (b) in Figure 14B, the mobile phone displays the middle sub-path, the upper sub-path, the lower sub-path and the arrow pointing to the upper sub-path of the unfinished shooting. The arrow is used to prompt the user to move along the middle sub-path. After the path shooting is completed, continue shooting along the upper sub-path. For another example, the mobile phone displays the middle sub-path, upper sub-path and lower sub-path that have not been photographed. When the deviating indicator arrow reaches the end of the middle sub-path, the mobile phone highlights the upper sub-path to prompt the user to follow the upper sub-path next. The path turns the phone to shoot.
在拍摄界面上,中间子路径的两侧显示有偏离范围指示线,在沿中间子路径拍摄的过程中,即目标子路径为中间子路径时,若α 3<α<α 2,则偏离指示箭头位于中间子路径的最大偏离范围内;若α>α 2,或α<α 3,则偏离指示箭头超出中间子路径的最大偏离范围,手机停止拍摄。 On the shooting interface, deviation range indication lines are displayed on both sides of the middle sub-path. During the shooting along the middle sub-path, that is, when the target sub-path is the middle sub-path, if α 3 <α<α 2 , then the deviation indication The arrow is located within the maximum deviation range of the middle sub-path; if α>α 2 , or α<α 3 , the deviation indicator arrow exceeds the maximum deviation range of the middle sub-path, and the mobile phone stops shooting.
其中,当偏离指示箭头超出中间子路径的最大偏离范围时,手机采集到的图像可能无法包括完整的裁剪范围,手机本次根据预设裁剪范围裁剪后保留的图像的尺寸小于裁剪范围,即小于摄像头采集的其他图像裁剪后保留的图像,因而本次保留的图像拼接到全景图像之后全景图像会留有空白部分从而导致拼接效果较差,因此手机可以停止拍摄过程。在一些实施例中,手机还可以在拍摄界面上或通过语音等方式提示用户:超出最大偏离范围,已自动停止拍摄。Among them, when the deviation indicator arrow exceeds the maximum deviation range of the middle sub-path, the image collected by the mobile phone may not include the complete cropping range. The size of the image retained by the mobile phone after cropping according to the preset cropping range is smaller than the cropping range, that is, less than The other images captured by the camera are cropped and retained. Therefore, after the retained image is spliced to the panoramic image, the panoramic image will have blank parts, which will result in poor splicing effect. Therefore, the mobile phone can stop the shooting process. In some embodiments, the mobile phone may also prompt the user on the shooting interface or by voice or other means that the camera has automatically stopped shooting if the maximum deviation range is exceeded.
(2)、目标子路径为右方子路径(2), the target sub-path is the right sub-path
当偏离指示箭头到达中间子路径的末端,手机的旋转角β>β r或β 3<β<β 4时,中间子路径上的图像已经拍摄完成,引导用户沿右方子路径向上转动手机,使得偏离指示箭头沿着右方子路径向上移动。在偏离指示箭头沿右方子路径向上移动的过程中,旋转角α随着手机的转动而不断变化。在一些技术方案中,参见图15,手机显示未完成拍摄的右方子路径1501、上方子路径、左方子路径和下方子路径。其中,右方子路径1501两侧的虚线表示偏离范围指示线,箭头1502表示偏离指示箭头。在另一些技术方案中,手机仅显示当前针对的右方子路径。在另一些技术方案中,手机在拍摄界面上显示完整的拍摄路径,且已完成拍摄的引导路径为虚线,未完成拍摄的引导路径为实线。在另一些实施例中,手机仍显示完整的引导路径。 When the deviating indicator arrow reaches the end of the middle sub-path, and the rotation angle of the phone β> β r or β 3 <β< β 4 , the image on the middle sub-path has been taken, and the user is guided to turn the phone upwards along the right sub-path. Make the deviation indicator arrow move upward along the right sub-path. In the process of deviating the indicating arrow and moving upward along the right sub-path, the rotation angle α changes continuously with the rotation of the mobile phone. In some technical solutions, referring to FIG. 15, the mobile phone displays the unfinished right sub-path 1501, the upper sub-path, the left sub-path, and the lower sub-path 1501. Among them, the dotted lines on both sides of the right sub-path 1501 represent the deviation range indicator line, and the arrow 1502 represents the deviation indicator arrow. In some other technical solutions, the mobile phone only displays the currently targeted right sub-path. In some other technical solutions, the mobile phone displays the complete shooting path on the shooting interface, and the guide path for the completed shooting is a dotted line, and the guide path for the unfinished shooting is a solid line. In other embodiments, the mobile phone still displays the complete guidance path.
其中,右方子路径的两侧显示有偏离范围指示线,在沿右方子路径拍摄的过程中,若旋转角β 3<β<β 4,则偏离指示箭头在右方子路径的最大偏离范围内,可以使得手机沿右方子路径拍摄的最后一帧图像即第一帧上基线图像在合适的范围内,从而进行裁剪和拼接;若旋转角β<β 3或者β>β 4,则偏离指示箭头超出右方子路径的最大偏离范围,则容易使得手机沿右方子路径拍摄的最后一帧图像即第一帧上基线图像超出裁剪范围,因而手机可以停止拍摄。例如,当β>β 4时,手机还可以在拍摄界面上或通 过语音等方式提示用户:超出右侧边界,已自动停止拍摄。 Among them, the deviation range indicator lines are displayed on both sides of the right sub-path. During the shooting along the right sub-path, if the rotation angle β 3 <β <β 4 , the deviation indicates the maximum deviation of the arrow on the right sub-path Within the range, the last frame image taken by the mobile phone along the right sub-path, that is, the baseline image on the first frame, can be cropped and spliced; if the rotation angle β<β 3 or β>β 4 , then If the deviation indicator arrow exceeds the maximum deviation range of the right sub-path, it is easy to make the last frame of the image taken by the mobile phone along the right sub-path, that is, the baseline image on the first frame, exceeds the cropping range, so the mobile phone can stop shooting. For example, when β>β 4 , the mobile phone can also prompt the user on the shooting interface or through voice and other means: beyond the right boundary, the shooting has been automatically stopped.
需要说明的是,在目标子路径为右方子路径的拍摄过程中,手机可以不进行图像拼接。It should be noted that during the shooting process where the target sub-path is the right sub-path, the mobile phone may not perform image stitching.
(3)、目标子路径为上方子路径,拼接上基线图像(3) The target sub-path is the upper sub-path, and the baseline image is spliced
当偏离指示箭头到达右方子路径的末端,手机的旋转角α>α t或α 2<α<α 1时,引导用户沿上方子路径向左转动手机,使得偏离指示箭头沿上方子路径向左移动。在手机沿着上方子路径转动的过程中,手机采集到的图像可以称为上基线图像,也可以称为上方子路径的图像,目标子路径为上方子路径。可以理解的是,手机沿上方子路径拍摄的第一帧上基线图像,也是沿右方子路径拍摄的最后一帧图像。在偏离指示箭头沿上方子路径向左移动的过程中,旋转角β随着手机的转动而不断变化。在一些技术方案中,参见图16A,手机显示未完成拍摄的上方子路径1601、左方子路径和下方子路径。其中,上方子路径1601两侧的虚线表示偏离范围指示线,箭头1602表示偏离指示箭头。在另一些技术方案中,手机仅显示当前针对的上方子路径。在另一些技术方案中,手机在拍摄界面上显示完整的拍摄路径,且已完成拍摄的引导路径为虚线,未完成拍摄的引导路径为实线。在另一些实施例中,手机仍显示完整的引导路径。 When the deviation indicator arrow reaches the end of the right sub-path, and the rotation angle of the mobile phone is α>α t or α 2 <α<α 1 , the user is guided to turn the mobile phone to the left along the upper sub-path, so that the deviation indicator arrow follows the upper sub-path move to the left. When the mobile phone rotates along the upper sub-path, the image collected by the mobile phone can be called the upper baseline image or the image of the upper sub-path, and the target sub-path is the upper sub-path. It is understandable that the first frame of the upper baseline image taken by the mobile phone along the upper sub-path is also the last frame of the image taken along the right sub-path. In the process of deviating the indicating arrow and moving to the left along the upper sub-path, the rotation angle β changes continuously with the rotation of the mobile phone. In some technical solutions, referring to FIG. 16A, the mobile phone displays the upper sub-path 1601, the left sub-path, and the lower sub-path that have not been photographed. Among them, the dotted lines on both sides of the upper sub-path 1601 represent the deviation range indicator line, and the arrow 1602 represents the deviation indicator arrow. In some other technical solutions, the mobile phone only displays the currently targeted upper sub-path. In some other technical solutions, the mobile phone displays the complete shooting path on the shooting interface, and the guide path for the completed shooting is a dotted line, and the guide path for the unfinished shooting is a solid line. In other embodiments, the mobile phone still displays the complete guidance path.
其中,上方子路径的两侧显示有偏离范围指示线,在沿上方子路径拍摄的过程中,若α 2<α<α 1,则偏离指示箭头位于上方子路径的最大偏离范围内;若α>α 1,或α<α 2,则偏离指示箭头超出上方子路径的最大偏离范围,手机停止拍摄。在一些实施例中,手机还可以在拍摄界面上或通过语音等方式提示用户:超出最大偏离范围,已自动停止拍摄。 Among them, the deviation range indicator lines are displayed on both sides of the upper sub-path. During the shooting along the upper sub-path, if α 2 <α<α 1 , the deviation indicator arrow is located within the maximum deviation range of the upper sub-path; if α >α 1 , or α<α 2 , the deviation indicator arrow exceeds the maximum deviation range of the upper sub-path, and the mobile phone stops shooting. In some embodiments, the mobile phone may also prompt the user on the shooting interface or by voice or other means that the camera has automatically stopped shooting if the maximum deviation range is exceeded.
手机对上基线图像进行拼接,具体包括圆柱面映射、特征提取、特征匹配和图像拼接等过程。其中,对于第一帧上基线图像A 1,手机根据预设算法,从上述关键帧中确定一个旋转角β与第一帧上基线图像对应的旋转角β 1最接近的目标关键帧作为参考帧G f1,即G f1为与A 1匹配的关键帧,上述关键帧中,G f1与A 1对应的绕y轴的旋转角的差值最小。这样,G f1与A 1图像在拼接时的图像错位误差最小,两者映射到圆柱面后的图像更容易进行配准。而后,手机提取G f1圆柱面映射后的图像
Figure PCTCN2021078666-appb-000041
的特征点F A,f1。手机根据上述式2-4将第一帧上基线图像A 1映射到圆柱面上,得到第一帧上基线图像’
Figure PCTCN2021078666-appb-000042
并获得第一帧上基线图像’
Figure PCTCN2021078666-appb-000043
的特征点F A,f1。手机计算F A,1与F A,f1的匹配结果,从而根据该匹配结果计算单应性矩阵H。根据目标关键帧得到的H矩阵更为准确,能够与中基线图像中的关键帧进行更好的配准,从而可以与中基线拼接结果进行匹配。手机将
Figure PCTCN2021078666-appb-000044
Figure PCTCN2021078666-appb-000045
进行映射。参见图16B,手机将映射后的
Figure PCTCN2021078666-appb-000046
处于裁剪范围内的矩形部分裁剪下来,并拼接到中基线图像拼接结果RI的右上方,从而形成上基线图像拼接结果RA1(即横线填充部分),即偏离指示箭头沿上方子路径移动时拼接获得的目标图像RA1。其中,上基线图像对应的裁剪范围为第1裁剪线、第2裁剪线、左边界线和右边界线限定的范围。示例性的,手机在拍摄界面上显示的拼接到中基线图像拼接结果RI上方的上基线图像拼接结果RA1的示意图可以参见图16A。
The mobile phone stitches the upper baseline image, which specifically includes processes such as cylindrical surface mapping, feature extraction, feature matching, and image stitching. Among them, for the baseline image A 1 on the first frame, the mobile phone determines a target key frame whose rotation angle β is closest to the rotation angle β 1 corresponding to the baseline image on the first frame from the above key frames according to a preset algorithm as the reference frame G f1 , that is, G f1 is a key frame matching A 1. In the above key frames, the difference between the rotation angles around the y axis corresponding to G f1 and A 1 is the smallest. In this way, the image misalignment error of the G f1 and A 1 images during stitching is the smallest, and the images after the two are mapped to the cylindrical surface are easier to register. Then, the mobile phone extracts the image after G f1 cylindrical surface mapping
Figure PCTCN2021078666-appb-000041
The feature points F A, f1 . The mobile phone maps the upper baseline image A 1 in the first frame to the cylindrical surface according to the above formula 2-4 to obtain the upper baseline image in the first frame.
Figure PCTCN2021078666-appb-000042
And get the baseline image on the first frame'
Figure PCTCN2021078666-appb-000043
The feature points F A, f1 . The mobile phone calculates the matching result of F A,1 and F A,f1 , and calculates the homography matrix H according to the matching result. The H matrix obtained according to the target key frame is more accurate, and can be better registered with the key frame in the mid-baseline image, so that it can be matched with the mid-baseline splicing result. Phone will
Figure PCTCN2021078666-appb-000044
Towards
Figure PCTCN2021078666-appb-000045
Map it. Refer to Figure 16B, the mobile phone will map the
Figure PCTCN2021078666-appb-000046
The rectangular part within the cropping range is cropped and stitched to the upper right of the middle baseline image stitching result RI to form the upper baseline image stitching result RA1 (that is, the horizontal line filling part), that is, stitching when the deviation indicator arrow moves along the upper sub-path The obtained target image RA1. Wherein, the cropping range corresponding to the upper baseline image is the range defined by the first cropping line, the second cropping line, the left boundary line, and the right boundary line. Exemplarily, for a schematic diagram of the upper baseline image splicing result RA1 spliced above the middle baseline image splicing result RI displayed on the shooting interface of the mobile phone, please refer to FIG. 16A.
对第i(为大于1的整数)帧上基线图像A i,手机根据预设算法,从上述关键帧中 确定一个旋转角β与A i的旋转角β i最接近的目标关键帧作为参考帧G fi。即,G fi为与A i匹配的关键帧。参见图16C,手机提取G fi圆柱面映射后的图像
Figure PCTCN2021078666-appb-000047
的特征点F A,fi;手机根据上述式2-4将A i映射到圆柱面上,从而获得第i帧上基线图像’
Figure PCTCN2021078666-appb-000048
的特征点F A,fi;手机还可以提取第i-1帧上基线图像A i-1映射到圆柱面后得到的第i-1帧上基线图像’
Figure PCTCN2021078666-appb-000049
的特征点F A,i-1。手机计算F A,i,F A,i-1,以及F A,fi的匹配结果,从而计算单应性矩阵H。这样得到的H矩阵更为准确,能够在与上一帧上基线图像配准的同时,还能和关键帧进行更好的配准。手机将
Figure PCTCN2021078666-appb-000050
Figure PCTCN2021078666-appb-000051
Figure PCTCN2021078666-appb-000052
进行映射。参见图16D,手机将映射后的
Figure PCTCN2021078666-appb-000053
处于裁剪范围内的矩形部分裁剪下来,并拼接到上基线图像拼接结果RA(i-1)的左侧,以及中基线图像拼接结果RI的上侧,从而形成上基线图像拼接结果RAi(即横线填充部分),即偏离指示箭头沿上方子路径移动时拼接获得的目标图像RAi。示例性的,参见图16E,手机在拼接预览窗口内显示拼接到中基线图像拼接结果RI上方的上基线图像拼接结果RAi。
The first I (an integer greater than 1) a baseline frame of image A i, the mobile phone according to a preset algorithm, determining a rotation angle beta] and A i β i closest to the rotational angle of the target from said key frames in the key frame as a reference frame G fi . That is, G fi is a key frame that matches A i. Refer to Figure 16C, the mobile phone extracts the image after the G fi cylindrical surface mapping
Figure PCTCN2021078666-appb-000047
The feature point F A,fi of , the mobile phone maps A i to the cylindrical surface according to the above formula 2-4, so as to obtain the baseline image on the i-th frame.
Figure PCTCN2021078666-appb-000048
The feature points F A,fi of the mobile phone can also extract the baseline image A i-1 on the i-1th frame after mapping it to the cylindrical surface, and the baseline image on the i-1th frame is obtained.
Figure PCTCN2021078666-appb-000049
The feature point F A,i-1 . The mobile phone calculates the matching results of F A,i , F A,i-1 , and F A,fi to calculate the homography matrix H. The H matrix obtained in this way is more accurate, and can be better registered with the key frame while registering with the baseline image on the previous frame. Phone will
Figure PCTCN2021078666-appb-000050
Towards
Figure PCTCN2021078666-appb-000051
with
Figure PCTCN2021078666-appb-000052
Map it. See Figure 16D, the phone will map
Figure PCTCN2021078666-appb-000053
The rectangular part within the cropping range is cropped and stitched to the left of the upper baseline image stitching result RA(i-1) and the upper side of the middle baseline image stitching result RI, thereby forming the upper baseline image stitching result RAi (i.e. horizontal Line filling part), that is, the target image RAi obtained by stitching when the deviation indicator arrow moves along the upper sub-path. Exemplarily, referring to FIG. 16E, the mobile phone displays the upper baseline image stitching result RAi that is stitched above the middle baseline image stitching result RI in the stitching preview window.
而后,用户沿着上方子路径继续转动手机。手机重复上述采集、映射和拼接过程,直至β<0。此时,手机沿着中间子路径采集的所有上基线图像帧都拼接完成,从而生成上基线图像拼接结果RA,即上方子路径对应的拼接结果RA。需要说明的是,对于β≤0情况下的最后一帧上基线图像映射到圆柱面后的图像,左边界可以作为其左侧的裁剪线,超出左边界的部分可以被裁掉。Then, the user continues to turn the phone along the upper sub-path. The mobile phone repeats the above collection, mapping and splicing process until β<0. At this time, all the upper baseline image frames collected by the mobile phone along the middle sub-path are spliced, thereby generating the upper baseline image splicing result RA, that is, the splicing result RA corresponding to the upper sub-path. It should be noted that for the image where the baseline image on the last frame is mapped to the cylindrical surface under the condition of β≤0, the left border can be used as the left side of the crop line, and the part beyond the left border can be cut off.
需要说明的是,若上基线图像不根据关键帧进行配置,则中基线图像的配准和上基线的配准是分别进行的,两个过程是分离的,上基线图像拼接结果和中基线图像拼接结果无法对应,两种基线图像拼接结果的拼接误差容易累计,从而使得两种基线图像拼接结果产生较大错位。在本申请实施例中,手机将上基线图像与中基线图像中的关键帧进行配准,可以及时修正上基线图像拼接时与中基线拼接结果的错位误差,使得上基线图像与中基线图像拼接结果进行精确配准,从而实现全局的配准,上基线图像拼接结果和中基线图像拼接结果可以形成一个平滑、自然过渡的整体图像。It should be noted that if the upper baseline image is not configured according to the key frame, the registration of the middle baseline image and the registration of the upper baseline are performed separately, and the two processes are separate, the upper baseline image stitching result and the middle baseline image The stitching results cannot correspond, and the stitching errors of the two baseline image stitching results are easy to accumulate, which causes a large misalignment in the stitching results of the two baseline images. In the embodiment of the present application, the mobile phone registers the key frames in the upper baseline image and the middle baseline image, which can correct the misalignment error between the upper baseline image and the middle baseline splicing result in time, so that the upper baseline image and the middle baseline image are spliced The results are accurately registered to achieve global registration. The upper baseline image stitching result and the middle baseline image stitching result can form a smooth, natural transition overall image.
(4)、目标子路径为左方子路径(4), the target sub-path is the left sub-path
当偏离指示箭头到达上方子路径的末端,手机的旋转角β<0或β 1<β<β 2时,上方子路径上的图像已经拍摄完成,引导用户沿左方子路径向下转动手机,使得偏离指示箭头沿着左方子路径向下移动。在偏离指示箭头沿左方子路径向下移动的过程中,旋转角α随着手机的转动而不断变化。在一些技术方案中,参见图17,手机显示未完成拍摄的左方子路径1701和下方子路径。其中,左方子路径1701两侧的虚线表示偏离范围指示线,箭头1702表示偏离指示箭头。在另一些技术方案中,手机仅显示当前针对的左方子路径。在另一些技术方案中,手机在拍摄界面上显示完整的拍摄路径,且已完成拍摄的引导路径为虚线,未完成拍摄的引导路径为实线。在另一些实施例中,手机仍显示完整的引导路径。 When the deviating indicator arrow reaches the end of the upper sub-path, and the rotation angle of the phone β<0 or β 1 <β<β 2 , the image on the upper sub-path has been taken, and the user is guided to turn the phone down along the left sub-path. Make the deviation indicator arrow move down along the left sub-path. In the process of deviating the indicating arrow and moving down the left sub-path, the rotation angle α changes continuously with the rotation of the mobile phone. In some technical solutions, referring to FIG. 17, the mobile phone displays the left sub-path 1701 and the lower sub-path that have not been photographed. Among them, the dashed lines on both sides of the left sub-path 1701 represent the deviation range indicator line, and the arrow 1702 represents the deviation indicator arrow. In some other technical solutions, the mobile phone only displays the currently targeted left sub-path. In some other technical solutions, the mobile phone displays the complete shooting path on the shooting interface, and the guide path for the completed shooting is a dotted line, and the guide path for the unfinished shooting is a solid line. In other embodiments, the mobile phone still displays the complete guidance path.
其中,左方子路径的两侧显示有偏离范围指示线,在沿左方子路径拍摄的过程中,若旋转角β 1<β<β 2,则偏离指示箭头在左方子路径的最大偏离范围内;若旋转角β<β 1或者β>β 2,则偏离指示箭头超出左方子路径的最大偏离范围,手机停止拍摄。 Among them, the deviation range indicator line is displayed on both sides of the left sub-path. During the shooting along the left sub-path, if the rotation angle β 1 <β <β 2 , the deviation indicates the maximum deviation of the arrow on the left sub-path Within the range; if the rotation angle β<β 1 or β>β 2 , the deviation indicator arrow exceeds the maximum deviation range of the left sub-path, and the phone stops shooting.
需要说明的是,在目标子路径为左方子路径的拍摄过程中,手机可以不进行图像 拼接。It should be noted that in the shooting process where the target sub-path is the left sub-path, the mobile phone may not perform image stitching.
(5)、目标子路径为下方子路径,拼接下基线图像(5) The target sub-path is the lower sub-path, and the baseline image is stitched together
当偏离指示箭头到达左方子路径的末端,手机的旋转角α<α b或α 3<α<α 4时,引导用户沿下方子路径向右转动手机,使得偏离指示箭头沿下方子路径向右移动。在手机沿着下方子路径转动的过程中,手机采集到的图像可以称为下基线图像,也可以称为下方子路径的图像,目标子路径为下方子路径。可以理解的是,手机沿下方子路径拍摄的第一帧下基线图像,也是沿左方子路径拍摄的最后一帧图像。在偏离指示箭头沿下方子路径向左移动的过程中,旋转角β随着手机的转动而不断变化。在一些技术方案中,参见图18中的(b),手机显示未完成拍摄的下方子路径1801。其中,下方子路径1801两侧的虚线表示偏离范围指示线,箭头1802表示偏离指示箭头。在另一些技术方案中,手机显示当前针对的完整的上方子路径。在另一些技术方案中,手机在拍摄界面上显示完整的拍摄路径,且已完成拍摄的引导路径为虚线,未完成拍摄的引导路径为实线。在另一些实施例中,手机仍显示完整的引导路径。 When the deviating arrow reaches the end of the left sub-path, and the rotation angle of the phone is α<α b or α 3 <α<α 4 , guide the user to turn the phone to the right along the lower sub-path, so that the deviating arrow follows the lower sub-path move to the right. When the mobile phone rotates along the lower sub-path, the image collected by the mobile phone can be called the lower baseline image or the image of the lower sub-path, and the target sub-path is the lower sub-path. It is understandable that the first frame of the lower baseline image taken by the mobile phone along the lower sub-path is also the last frame of the image taken along the left sub-path. In the process of deviating the indicating arrow and moving to the left along the lower sub-path, the rotation angle β changes continuously with the rotation of the mobile phone. In some technical solutions, referring to (b) in FIG. 18, the mobile phone displays the lower sub-path 1801 that has not been photographed. Among them, the dashed lines on both sides of the lower sub-path 1801 represent the deviation range indicator line, and the arrow 1802 represents the deviation indicator arrow. In some other technical solutions, the mobile phone displays the complete upper sub-path that is currently targeted. In some other technical solutions, the mobile phone displays the complete shooting path on the shooting interface, and the guide path for the completed shooting is a dotted line, and the guide path for the unfinished shooting is a solid line. In other embodiments, the mobile phone still displays the complete guidance path.
其中,下方子路径的两侧显示有偏离范围指示线,在沿下方子路径拍摄的过程中,若α 3<α<α 4,则偏离指示箭头位于下方子路径的最大偏离范围内;若α>α 4,或α<α 3,则偏离指示箭头超出下方子路径的最大偏离范围,手机停止拍摄。 Among them, the deviation range indicator lines are displayed on both sides of the lower sub-path. During the shooting along the lower sub-path, if α 3 <α<α 4 , the deviation indicator arrow is located within the maximum deviation range of the lower sub-path; if α >α 4 , or α<α 3 , the deviation indicator arrow exceeds the maximum deviation range of the lower sub-path, and the mobile phone stops shooting.
手机对下基线图像进行拼接的方式与下基线图像的拼接方式相同。其中,对于第一帧下基线图像B 1(也即手机沿着右方子路径转动时采集的最后一帧图像),手机根据预设算法,从上述关键帧中确定一个旋转角β与第一帧下基线图像对应的旋转角β 1最接近的目标关键帧作为参考帧C f1,并提取C f1圆柱面映射后的图像
Figure PCTCN2021078666-appb-000054
的特征点F C,f1。手机根据上述式2-4将第一帧下基线图像B 1映射到圆柱面上,得到第一帧下基线图像’
Figure PCTCN2021078666-appb-000055
并获得第一帧下基线图像’
Figure PCTCN2021078666-appb-000056
的特征点F B,1。手机计算F B,1与F C,f1的匹配结果,从而根据该匹配结果计算单应性矩阵H。而后,手机根据矩阵H,将
Figure PCTCN2021078666-appb-000057
Figure PCTCN2021078666-appb-000058
进行映射。结合目标关键帧获得的H矩阵更为准确,能够使得下基线图像与关键帧进行更好的配准,从而能够与中基线拼接结果更换地配准。参见图18中的(a),手机将映射后的
Figure PCTCN2021078666-appb-000059
处于裁剪范围内的矩形部分裁剪下来,并拼接到中基线图像拼接结果RI的左下方,从而形成下基线图像拼接结果RB1,即偏离指示箭头沿下方子路径移动时拼接获得的目标图像RB1。其中,下基线图像对应的裁剪范围为第3裁剪线、第4裁剪线、左边界线和右边界线限定的范围。示例性的,手机在拍摄界面上显示拼接到中基线拼接结果RI下方的下基线图像拼接结果RB1的示意图可以参见图18中的(b)。需要说明的是,中基线拼接结果RI的上方还拼接有上基线拼接结果RA。
The method of stitching the lower baseline image by the mobile phone is the same as that of the lower baseline image. Among them, for the first frame of the baseline image B 1 (that is, the last frame of image collected when the mobile phone rotates along the right sub-path), the mobile phone determines a rotation angle β and the first frame from the above key frames according to a preset algorithm. The target key frame with the closest rotation angle β 1 corresponding to the baseline image under the frame is used as the reference frame C f1 , and the image after the cylindrical surface mapping of C f1 is extracted
Figure PCTCN2021078666-appb-000054
Feature points F C,f1 . The mobile phone maps the lower baseline image B 1 in the first frame to the cylindrical surface according to the above formula 2-4 to obtain the lower baseline image in the first frame.
Figure PCTCN2021078666-appb-000055
And get the baseline image under the first frame'
Figure PCTCN2021078666-appb-000056
The characteristic point F B,1 . The mobile phone calculates the matching result of F B,1 and F C,f1 , thereby calculating the homography matrix H according to the matching result. Then, according to the matrix H, the mobile phone will
Figure PCTCN2021078666-appb-000057
Towards
Figure PCTCN2021078666-appb-000058
Map it. The H matrix obtained by combining the target key frame is more accurate, which enables the lower baseline image to be better registered with the key frame, so that the registration can be replaced with the middle baseline splicing result. See (a) in Figure 18, the phone will map
Figure PCTCN2021078666-appb-000059
The rectangular part within the cropping range is cropped and stitched to the lower left of the middle baseline image stitching result RI to form the lower baseline image stitching result RB1, that is, the target image RB1 obtained by stitching when the deviation indicator arrow moves along the lower sub-path. Among them, the cropping range corresponding to the lower baseline image is the range defined by the third cropping line, the fourth cropping line, the left boundary line, and the right boundary line. Exemplarily, the mobile phone displays the lower baseline image stitching result RB1 stitched below the middle baseline stitching result RI on the shooting interface, see (b) in FIG. 18. It should be noted that the upper baseline splicing result RA is also spliced above the middle baseline splicing result RI.
对第i(为大于1的整数)帧下基线图像B i,手机根据预设算法,从上述关键帧中确定一个旋转角β与I i的旋转角β i最接近的目标关键帧作为参考帧C fi,并提取C fi圆柱面映射后的图像
Figure PCTCN2021078666-appb-000060
的特征点F c,fi。手机根据上述式2-4将B i映射到圆柱面上,从而获得第i帧下基线图像’
Figure PCTCN2021078666-appb-000061
的特征点F B,i。手机计算F B,i,第i-1帧下基线图像B i-1映射到圆柱面后的图像
Figure PCTCN2021078666-appb-000062
的特征点F B,i-1,以及F c,fi的匹配结果,从而计算单应性矩阵H。这样得到的H矩阵更为准确,能够在与上一帧下基线图像配准的同时,还能和关键帧进行更 好的配准。手机将
Figure PCTCN2021078666-appb-000063
Figure PCTCN2021078666-appb-000064
Figure PCTCN2021078666-appb-000065
进行映射。手机将映射后的
Figure PCTCN2021078666-appb-000066
处于裁剪范围内的矩形部分裁剪下来,并拼接到下基线图像拼接结果RB(i-1)的右侧,从而形成下基线图像拼接结果RBi,即偏离指示箭头沿下方子路径移动时拼接获得的目标图像RBi。
For the baseline image B i in the i-th frame (which is an integer greater than 1), the mobile phone determines a target key frame whose rotation angle β is closest to the rotation angle β i of I i from the above key frames according to a preset algorithm as the reference frame C fi , and extract the image after C fi cylindrical surface mapping
Figure PCTCN2021078666-appb-000060
Feature points F c,fi . The mobile phone maps B i to the cylindrical surface according to the above formula 2-4 to obtain the baseline image under the i-th frame'
Figure PCTCN2021078666-appb-000061
The feature point F B,i . The mobile phone calculates F B,i , the image after the baseline image B i-1 is mapped to the cylindrical surface in the i-1th frame
Figure PCTCN2021078666-appb-000062
Feature points F B,i-1 , and the matching results of F c,fi to calculate the homography matrix H. The H matrix obtained in this way is more accurate, and can be better registered with the key frame while registering with the baseline image of the previous frame. Phone will
Figure PCTCN2021078666-appb-000063
Towards
Figure PCTCN2021078666-appb-000064
with
Figure PCTCN2021078666-appb-000065
Map it. The phone will be mapped
Figure PCTCN2021078666-appb-000066
The rectangular part within the cropping range is cropped and stitched to the right of the lower baseline image stitching result RB(i-1) to form the lower baseline image stitching result RBi, which is obtained by stitching when the deviation indicator arrow moves along the lower sub-path The target image RBi.
而后,用户沿着下方子路径继续转动手机。手机重复上述采集、映射和拼接过程,直至β>β r。此时,手机沿着中间子路径采集的所有下基线图像帧都拼接完成,生成下基线图像拼接结果RB,即下方子路径对应的拼接结果RB,整个全景图像拼接完成,整个拍摄过程结束。需要说明的是,对于β≥β r情况下的最后一帧下基线图像映射到圆柱面后的图像,右边界可以作为其右侧的裁剪线,超出右边界的部分可以被裁掉。示例性的,最后一帧下基线图像拼接结果的示意图可以参见图18中的(c)。 Then, the user continues to turn the phone along the sub-path below. The mobile phone repeats the above collection, mapping and splicing process until β>β r . At this time, all the lower baseline image frames collected by the mobile phone along the middle sub-path are stitched together, and the lower baseline image stitching result RB is generated, that is, the stitching result RB corresponding to the lower sub-path, the entire panoramic image stitching is completed, and the entire shooting process ends. Incidentally, for the last one in the baseline image β≥β r case where the image mapped to the cylindrical surface, cut lines may be used as the right boundary of the right side thereof, beyond the right boundary portion may be cut. Exemplarily, for a schematic diagram of the stitching result of the baseline image in the last frame, see (c) in FIG. 18.
同样地,手机将下基线图像与中基线图像中的关键帧进行配准,可以及时修正下基线图像拼接时与中基线拼接结果的错位误差,使得下基线图像与中基线图像拼接结果进行精确配准,从而实现全局的配准,下基线图像和中基线图像拼接结果可以形成一个平滑、自然过渡的整体图像。Similarly, the mobile phone registers the key frames in the lower baseline image and the middle baseline image, which can correct the misalignment error between the lower baseline image and the middle baseline splicing result in time, so that the lower baseline image and the middle baseline image splicing result can be accurately matched. In order to achieve global registration, the stitching result of the lower baseline image and the middle baseline image can form a smooth, natural transition overall image.
303、手机在停止拍摄后,生成全景图像。303. After the mobile phone stops shooting, it generates a panoramic image.
当用户沿着下方子路径转动手机,偏离指示箭头到达下方子路径的末端后,旋转角β>β r,手机结束用户引导,停止显示引导路径,下基线图像拼接完成后生成全景图像。示例性的,手机生成的全景图像可以参见图19中的(a)所示的缩略图1901,和图19中的(b)所示的图库中的缩略图1902。 When the user turns the phone along the downward sub-path, an indicator arrow departing from reaching the end of the downward sub-path, the rotation angle β> β r, the end of the phone guide the user, stops displaying the guide route, after the panoramic image is generated at a baseline image stitching is completed. Exemplarily, the panoramic image generated by the mobile phone may refer to the thumbnail 1901 shown in (a) in FIG. 19 and the thumbnail 1902 in the gallery shown in (b) in FIG. 19.
或者,在拍摄过程中,若手机检测到用户停止拍摄的操作(例如用户点击图18中的(b)所示的停止拍摄控件1803的操作)后,停止全景图像的拍摄。或者,如以上实施例所述,若在之前的拍摄过程中偏离指示箭头超出目标子路径的最大偏离范围,则手机中止拍摄。或者,在拍摄过程中,若手机检测到用户停止拍摄的操作,则中止拍摄。其中,若中止拍摄时目标子路径为中间子路径,则获得的全景图像为中止拍摄时的中基线图像拼接结果。此外,若中止拍摄时目标子路径为右方子路径或上方子路径,则手机获得的全景图像为完整的中基线图像拼接结果。若中止拍摄时目标子路径为左方子路径或下方子路径,则手机获得的全景图像为完整的中基线图像及上基线图像拼接结果。这样,可以避免手机拍摄获得的全景图像上,中基线图像拼接结果的视场角较大而上基线图像或下基线图像拼接结果的视场角较小,从而导致获得的全景图像不规则、不完整。Or, during the shooting process, if the mobile phone detects the user's operation to stop shooting (for example, the user clicks the operation of the stop shooting control 1803 shown in (b) in FIG. 18), the shooting of the panoramic image is stopped. Or, as described in the above embodiment, if the deviation indicator arrow exceeds the maximum deviation range of the target sub-path in the previous shooting process, the mobile phone stops shooting. Or, during the shooting process, if the mobile phone detects the user's operation to stop shooting, it will stop shooting. Wherein, if the target sub-path is the middle sub-path when the shooting is suspended, the obtained panoramic image is the result of the middle baseline image stitching when the shooting is suspended. In addition, if the target sub-path is the right sub-path or the upper sub-path when the shooting is stopped, the panoramic image obtained by the mobile phone is the complete mid-baseline image stitching result. If the target sub-path is the left sub-path or the lower sub-path when the shooting is stopped, the panoramic image obtained by the mobile phone is the complete middle baseline image and the upper baseline image stitching result. In this way, it can be avoided that in the panoramic image captured by the mobile phone, the field angle of the middle baseline image stitching result is larger and the field angle of the upper baseline image or the lower baseline image stitching result is smaller, resulting in irregular and irregular panoramic images obtained. whole.
此外,在一些实施例中,手机在停止拍摄后还可以生成一个视频,该视频图像为拍摄过程中拼接预览窗口内显示的各拼接后的图像。当用户指示播放该视频时,手机可以将拍摄过程中图像拼接过程动态地呈现给用户。In addition, in some embodiments, the mobile phone can also generate a video after stopping shooting, and the video image is the spliced image displayed in the splicing preview window during the shooting process. When the user instructs to play the video, the mobile phone can dynamically present the image splicing process during the shooting process to the user.
在另一些实施例中,手机还可以保存拍摄过程中根据引导路径采集到的图像序列,响应于用户对该图像序列的编辑操作,手机可以生成全景图像。In other embodiments, the mobile phone may also save the image sequence collected according to the guide path during the shooting process, and in response to the user's editing operation of the image sequence, the mobile phone may generate a panoramic image.
在本申请的实施例中,手机通过对水平方向上中基线图像、上基线图像或下基线图像进行拼接,可以在水平方向上扩展全景图像的视场角;通过将上基线图像与中基线图像进行配准和拼接,并将下基线图像与中基线图像进行配准和拼接,还可以在竖直方向上扩展全景图像的视场角,从而使得全景图像的整个视场角更大,提高用户拍摄体验。In the embodiment of the present application, the mobile phone can expand the field of view of the panoramic image in the horizontal direction by splicing the upper baseline image, upper baseline image, or lower baseline image in the horizontal direction; by combining the upper baseline image and the middle baseline image Perform registration and stitching, and register and stitch the lower baseline image and the middle baseline image. It can also expand the angle of view of the panoramic image in the vertical direction, thereby making the entire angle of view of the panoramic image larger and improving the user Shooting experience.
并且,在本申请的实时中,采用圆柱面映射可以使得手机从不同角度拍摄的图像上,同一对象映射后的尺寸和成像特征相匹配,从而使得不同角度拍摄的图像可以进行配准和拼接,进而生成全景图像,因而可以符合全景图各部分图像尺寸基本一致的视觉效果。In addition, in the real-time application of this application, the use of cylindrical mapping can match the size and imaging characteristics of the same object after mapping on the image taken by the mobile phone from different angles, so that the images taken from different angles can be registered and stitched. In turn, a panoramic image is generated, which can conform to the visual effect that the image size of each part of the panoramic image is basically the same.
此外,全景图像并不是单纯的上、中、下基线图像拼接结果的简单组合。每种基线图像拼接结果都是根据多个单应性矩阵H配准和拼接获得的,每个小部分都对应不同的单应性矩阵H,因而不同种类的基线图像拼接结果之间无法计算获得一个单应性矩阵H,使得两个基线图像拼接结果各部分之间都能进行很好的对应和匹配,因而无法简单地对上、中、下基线图像拼接结果直接进行拼接。在本申请的实施例中,上基线图像和下基线图像还根据中基线的关键帧进行配准和拼接,可以及时修正上、下基线图像拼接时与中基线拼接结果的错位误差,使得上基线图像、下基线图像与中基线图像拼接结果进行精确配准,从而实现全局的配准,上基线图像拼接结果、中基线图像拼接结果和下基线图像拼接结果可以更好地融合在一起,从而形成一个平滑、自然过渡的整体图像。In addition, the panoramic image is not a simple combination of the splicing results of the upper, middle, and lower baseline images. Each kind of baseline image stitching result is obtained by registration and stitching based on multiple homography matrices H, and each small part corresponds to a different homography matrix H, so different types of baseline image stitching results cannot be calculated between A homography matrix H enables good correspondence and matching between the parts of the two baseline image stitching results, so it is impossible to simply directly stitch the upper, middle, and lower baseline image stitching results. In the embodiment of the present application, the upper baseline image and the lower baseline image are also registered and spliced according to the key frame of the middle baseline. The misalignment error of the splicing result of the upper and lower baseline images and the middle baseline can be corrected in time, so that the upper baseline The image, the lower baseline image and the middle baseline image stitching results are accurately registered to achieve global registration. The upper baseline image stitching results, the middle baseline image stitching results, and the lower baseline image stitching results can be better integrated to form An overall image with a smooth, natural transition.
在以上实施例中,引导路径的始端为中间子路径的左端,引导路径的末端为下方子路径的末端。可以理解的是,在情况1所示的第一方向为水平方向且第二方向为竖直方向的场景下,根据始端、末端或变化方向(或称运行方向)不同,引导路径还可以有多种不同的形式。示例性的,不同始端和末端的引导路径可以参见图20中的(a)-(f)。可以理解的是,情况1下还可以包括图20所举示例以外的其他引导路径,本申请实施例不予限定。In the above embodiment, the beginning of the guide path is the left end of the middle sub-path, and the end of the guide path is the end of the lower sub-path. It is understandable that in the scenario where the first direction is the horizontal direction and the second direction is the vertical direction shown in case 1, depending on the beginning, end, or changing direction (or running direction), there can be more guide paths. Different forms. Exemplarily, the guide paths of different start and end can refer to (a)-(f) in FIG. 20. It is understandable that in case 1, other guiding paths other than the example shown in FIG. 20 may also be included, which are not limited in the embodiment of the present application.
在本申请的一些实施例中,当手机处于竖屏或横屏等不同状态下,引导路径会随着手机的状态相应变化。示例性的,在图4A中的(b)所示的场景下,若手机切换为竖屏状态,则手机显示的预览界面示意图可以参见图21。In some embodiments of the present application, when the mobile phone is in a different state such as a vertical screen or a horizontal screen, the guide path will change accordingly with the state of the mobile phone. Exemplarily, in the scenario shown in (b) of FIG. 4A, if the mobile phone is switched to the vertical screen state, the preview interface displayed by the mobile phone can be seen in FIG. 21.
情况2、第一方向为竖直方向,第二方向为水平方向。Case 2. The first direction is the vertical direction, and the second direction is the horizontal direction.
在情况2下,第一方向为竖直方向,第二方向为水平方向。与情况1相比,第一方向为竖直方向,竖直方向的子路径较长,引导路径包括至少两条竖直方向的子路径。引导路径还可以包括用于连接竖直方向的子路径的至少一条水平方向的子路径。类似地,在情况2对应的一种引导路径下,手机显示的一种预览界面示意图可以参见图22A。在情况2下,根据始端、末端或运行方向不同,引导路径还可以有多种不同的形式。示例性的,不同始端和末端的引导路径可以参见图22B中的(a)-(c)。可以理解的是,情况1下还可以包括图22B所举示例以外的其他引导路径,本申请实施例不予限定。情况2对应的全景拍摄方法与情况1类似,这里不再赘述,不同之处在于:在情况1中,手机根据水平方向的三条基线对图像进行拼接;而在情况2中,手机根据竖直方向的三条基线对图像进行拼接。In case 2, the first direction is the vertical direction, and the second direction is the horizontal direction. Compared with case 1, the first direction is a vertical direction, the sub-path in the vertical direction is longer, and the guide path includes at least two sub-paths in the vertical direction. The guide path may further include at least one horizontal sub-path for connecting the vertical sub-path. Similarly, in a guidance path corresponding to case 2, a schematic diagram of a preview interface displayed by the mobile phone can be seen in FIG. 22A. In case 2, the guide path can also take many different forms according to the beginning, end, or running direction. Exemplarily, the different start and end guide paths can be referred to (a)-(c) in FIG. 22B. It is understandable that in case 1, other guiding paths other than the example illustrated in FIG. 22B may be included, which are not limited in the embodiment of the present application. The panoramic shooting method corresponding to case 2 is similar to case 1, and will not be repeated here. The difference is: in case 1, the mobile phone stitches the images according to the three baselines in the horizontal direction; and in case 2, the mobile phone uses the vertical direction The three baselines of the image are stitched together.
可以理解的是,情况1适于拍摄水平方向上的视场角范围较大的拍摄场景;情况2适于拍摄竖直方向上的视场角范围较大的拍摄场景(例如拍摄高楼大厦)。示例性的,情况2对应的拍摄即将结束时,拼接预览窗口中的图像拼接结果示意图可以参见图22C。It can be understood that case 1 is suitable for shooting scenes with a large field of view in the horizontal direction; case 2 is suitable for shooting scenes with a large field of view in the vertical direction (for example, shooting high-rise buildings). Exemplarily, when the shooting corresponding to Case 2 is about to end, the schematic diagram of the image splicing result in the splicing preview window can be seen in FIG. 22C.
在情况2中,手机通过对沿着某条竖直方向上的子路径采集的图像进行拼接,可 以在竖直方向上扩展全景图像的视场角;通过对沿着多条竖直方向上的子路径采集的图像进行拼接,还可以在水平方向上扩展全景图像的视场角,从而使得全景图像的整个视场角更大,提高用户拍摄体验。In case 2, the mobile phone can expand the angle of view of the panoramic image in the vertical direction by stitching the images collected along a certain vertical sub-path; The splicing of the images collected by the sub-path can also expand the angle of view of the panoramic image in the horizontal direction, thereby making the entire angle of view of the panoramic image larger and improving the user's shooting experience.
在本申请的实施例中,用户可以根据拍摄场景的实际需求,选择或切换情况1或情况2对应的引导路径模式进行全景图像的拍摄。In the embodiment of the present application, the user can select or switch the guide path mode corresponding to the situation 1 or the situation 2 to take the panoramic image according to the actual needs of the shooting scene.
以上实施例是以第一方向包括三条子路径为例进行说明的。在其他一些实施例中,第一方向也可以仅包括两条子路径,第二方向可以包括多条用于连接第一子方向的子路径的子路径。示例性的,当第一方向为水平方向,第二方向为水平方向,且第一方向包括两条子路径时,引导路径可以参见图23中的(a),拍摄获得的全景图像可以参见图23中的(b)。可以理解的是,当始端、末端或运行方向不同时,引导路径还可以有多种不同的形式。The above embodiments are described by taking the first direction including three sub-paths as an example. In some other embodiments, the first direction may also include only two sub-paths, and the second direction may include multiple sub-paths for connecting the sub-paths of the first sub-direction. Exemplarily, when the first direction is the horizontal direction, the second direction is the horizontal direction, and the first direction includes two sub-paths, the guide path may refer to (a) in FIG. 23, and the panoramic image obtained by shooting may refer to FIG. 23 In (b). It is understandable that when the start, end, or running direction is different, the guide path can also take many different forms.
再示例性的,当第一方向为水平方向,第二方向为水平方向,且第一方向包括两条子路径时,引导路径可以参见图24中的(a),拍摄获得的全景图像可以参见图24中的(b)。可以理解的是,当始端、末端或运行方向不同时,引导路径还可以有多种不同的形式。As another example, when the first direction is the horizontal direction, the second direction is the horizontal direction, and the first direction includes two sub-paths, the guide path may refer to (a) in FIG. 24, and the panoramic image obtained by shooting may refer to FIG. (B) in 24. It is understandable that when the start, end, or running direction is different, the guide path can also take many different forms.
与第一方向包括三条子路径相比,当引导路径包括两条子路径时,引导路径虽然减少了第一方向的一条子路径,但仍然可以扩展第二方向的视场角,同时还可以简化全景图像的拍摄过程。Compared with the first direction including three sub-paths, when the guide path includes two sub-paths, although the guide path reduces one sub-path in the first direction, it can still expand the field of view in the second direction and simplify the panoramic view. The shooting process of the image.
在其他一些实施例中,第一方向也可以包括三条以上的子路径,第二方向可以包括多条用于连接第一方向的子路径的子路径。示例性的,在情况1中,在水平方向上包括4条子路径的引导路径可以参见图25中的(a)-(b),拍摄获得的全景图像可以参见图25中的(c)。当第一方向上的子路径的条数更多时,手机可以更大地扩展与第一方向垂直的第二方向上的视场角范围。In some other embodiments, the first direction may also include more than three sub-paths, and the second direction may include multiple sub-paths for connecting the sub-paths in the first direction. Exemplarily, in case 1, the guide path including 4 sub-paths in the horizontal direction can be seen in (a)-(b) in FIG. 25, and the panoramic image obtained by shooting can be seen in (c) in FIG. 25. When the number of sub-paths in the first direction is greater, the mobile phone can expand the range of the field of view in the second direction perpendicular to the first direction.
以上是以后置全景拍摄为例进行说明的,对于前置全景拍摄,手机同样可以采用以上实施例描述的方法拍摄全景图像,此处不予赘述。The above is an example of rear panoramic shooting. For front panoramic shooting, the mobile phone can also use the method described in the above embodiment to shoot panoramic images, which will not be repeated here.
以上是以电子设备为手机为例进行说明的,当电子设备为手机以外的其他设备时,同样可以采用以上实施例描述的方法进行全景拍摄,此处不予赘述。The above description is based on an example in which the electronic device is a mobile phone. When the electronic device is a device other than a mobile phone, the method described in the above embodiment can also be used to perform panoramic shooting, which will not be repeated here.
可以理解的是,为了实现上述功能,电子设备包含了执行各个功能相应的硬件和/或软件模块。结合本文中所公开的实施例描述的各示例的算法步骤,本申请能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。本领域技术人员可以结合实施例对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。It can be understood that, in order to realize the above-mentioned functions, the electronic device includes hardware and/or software modules corresponding to each function. In combination with the algorithm steps of the examples described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed by hardware or computer software-driven hardware depends on the specific application and design constraint conditions of the technical solution. Those skilled in the art can use different methods for each specific application in combination with the embodiments to implement the described functions, but such implementation should not be considered as going beyond the scope of the present application.
本实施例可以根据上述方法示例对电子设备进行功能模块的划分,例如,可以对应各个功能划分各个功能模块,也可以将两个或两个以上的功能集成在一个处理模块中。上述集成的模块可以采用硬件的形式实现。需要说明的是,本实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。In this embodiment, the electronic device can be divided into functional modules according to the foregoing method examples. For example, each functional module can be divided corresponding to each function, or two or more functions can be integrated into one processing module. The above-mentioned integrated modules can be implemented in the form of hardware. It should be noted that the division of modules in this embodiment is illustrative, and is only a logical function division, and there may be other division methods in actual implementation.
比如,在一种划分方式中,参见图26,电子设备2600可以包括摄像头2601、ISP 2602,输入缓存单元2603,计算处理单元2604,惯性测量单元(inertial measurement unit, IMU)2605,输出缓存单元2606,编码器2607,显示单元2608,以及其他单元/模块。For example, in a division method, referring to FIG. 26, the electronic device 2600 may include a camera 2601, an ISP 2602, an input buffer unit 2603, a calculation processing unit 2604, an inertial measurement unit (IMU) 2605, and an output buffer unit 2606 , Encoder 2607, display unit 2608, and other units/modules.
其中,ISP将摄像头采集到的图像帧进行处理后,输出至输入缓存单元。计算处理单元根据IMU的数据对输入缓存单元中的图像数据进行相应的裁剪和拼接等处理,并将处理结果输出至输出缓存单元。显示单元根据输出缓存单元中的处理结果显示界面和引导信息。在拼接过程完成后,编码器将处理结果中的图像数据编码后输出给图库或其他应用。Among them, the ISP processes the image frames collected by the camera and outputs them to the input buffer unit. The calculation processing unit performs corresponding cropping and splicing processing on the image data in the input buffer unit according to the data of the IMU, and outputs the processing result to the output buffer unit. The display unit displays the interface and guide information according to the processing result in the output buffer unit. After the splicing process is completed, the encoder encodes the image data in the processing result and outputs it to a gallery or other applications.
示例性的,以情况1所示的包括三条水平子路径的情况为例进行说明。当用户进入全景拍摄模式后,计算处理单元初始化该场景下的各个参数,包括上、下基线对应的绕x轴的旋转角α t,α b(中基线旋转角α为0),第1,2,3,4裁剪边界对应的旋转角α 1,α 2,α 3,α 4,右基线对应的绕y轴的旋转角β r(左基线旋转角β为0),左边界、左裁剪线、右裁剪线和右边界对应的旋转角β 1,β 2,β 3,β 4,以及关键帧的间隔Δβ等。计算处理单元根据旋转角确定引导信息的位置。显示屏可以显示如图4A中的(b)所示的预览界面,预览界面上包括引导信息。当电子设备检测到用户的拍摄操作后,ISP将摄像头接收的图像帧进行处理后送给计算处理单元。计算处理单元根据拍摄进程对界面进行实时刷新,显示屏显示如图6中的(a)所示的拍摄界面。计算处理单元对摄像头采集到的中基线图像进行拼接。输出缓存单元缓存关键帧和拼接结果,显示屏显示拼接结果。当电子设备的旋转角β>β r后,显示屏显示如图15所示的拍摄界面,以引导用户向上转动电子设备。当电子设备的旋转角α>α t后,显示屏显示如图16A所示的拍摄界面,以引导用户向左转动电子设备,计算处理单元根据关键帧对摄像头采集到的上基线图像进行拼接。输出缓存单元缓存拼接结果,显示屏显示拼接结果。当电子设备的旋转角β<0后,显示屏显示如图17所示的拍摄界面,以引导用户向下转动电子设备。当电子设备的旋转角α<α b后,显示屏显示如图18中的(b)所示的拍摄界面,以引导用户向右转动电子设备,计算处理单元根据关键帧对摄像头采集到的下基线图像进行拼接。输出缓存单元缓存拼接结果,显示屏显示拼接结果。当电子设备的旋转角β>β r后,全景图像拼接完成。 Exemplarily, the case including three horizontal sub-paths shown in case 1 is taken as an example for description. When the user enters the panoramic shooting mode, the calculation processing unit initializes various parameters in the scene, including the rotation angle α t around the x axis corresponding to the upper and lower baselines, α b (the middle baseline rotation angle α is 0), first, 2,3,4 The rotation angle corresponding to the clipping boundary α 1 , α 2 , α 3 , α 4 , the rotation angle β r around the y-axis corresponding to the right baseline (the left baseline rotation angle β is 0), the left boundary and the left clipping The rotation angles β 1 , β 2 , β 3 , β 4 corresponding to the line, the right clipping line, and the right border, and the key frame interval Δβ, etc. The calculation processing unit determines the position of the guidance information according to the rotation angle. The display screen can display a preview interface as shown in (b) of FIG. 4A, and the preview interface includes guidance information. When the electronic device detects the user's shooting operation, the ISP processes the image frame received by the camera and sends it to the calculation processing unit. The calculation processing unit refreshes the interface in real time according to the shooting process, and the display screen displays the shooting interface as shown in (a) in FIG. 6. The calculation and processing unit stitches the mid-baseline images collected by the camera. The output buffer unit buffers the key frames and the splicing result, and the display screen displays the splicing result. When the rotation angle of the electronic device beta]> β r, the display shows the screen shown in FIG shot 15, to guide the user rotates the electronic device upwards. When the rotation angle of the electronic device α>α t , the display screen displays the shooting interface as shown in Fig. 16A to guide the user to turn the electronic device to the left, and the calculation processing unit stitches the upper baseline image collected by the camera according to the key frame . The output buffer unit buffers the splicing result, and the display screen displays the splicing result. When the rotation angle β of the electronic device is less than 0, the display screen displays the shooting interface as shown in FIG. 17 to guide the user to turn the electronic device downward. When the rotation angle α <α b of the electronic device, the screen display shown in FIG. 18 (b) capturing interface shown, to guide the user rotates the electronic device to the right, the calculation processing unit according to key frames captured by the camera to The lower baseline image is stitched. The output buffer unit buffers the splicing result, and the display screen displays the splicing result. When the rotation angle of the electronic device beta]> β r, panoramic image stitching is completed.
本申请实施例还提供一种电子设备,包括:摄像头,用于采集图像;显示屏,用于显示界面;一个或多个处理器以及一个或多个存储器。该一个或多个存储器与一个或多个处理器耦合,一个或多个存储器用于存储计算机程序代码,计算机程序代码包括计算机指令,当一个或多个处理器执行计算机指令时,使得电子设备执行上述相关方法步骤实现上述实施例中的全景拍摄方法。An embodiment of the present application also provides an electronic device, including: a camera for collecting images; a display screen for displaying an interface; one or more processors and one or more memories. The one or more memories are coupled with one or more processors, and the one or more memories are used to store computer program codes. The computer program codes include computer instructions. When the one or more processors execute the computer instructions, the electronic device executes The above-mentioned related method steps implement the panoramic shooting method in the above-mentioned embodiment.
本申请实施例还提供一种电子设备,包括一个或多个处理器以及一个或多个存储器。该一个或多个存储器与一个或多个处理器耦合,一个或多个存储器用于存储计算机程序代码,计算机程序代码包括计算机指令,当一个或多个处理器执行计算机指令时,使得电子设备执行上述相关方法步骤实现上述实施例中的全景拍摄方法。An embodiment of the present application also provides an electronic device including one or more processors and one or more memories. The one or more memories are coupled with one or more processors, and the one or more memories are used to store computer program codes. The computer program codes include computer instructions. When the one or more processors execute the computer instructions, the electronic device executes The above-mentioned related method steps implement the panoramic shooting method in the above-mentioned embodiment.
本申请的实施例还提供一种计算机可读存储介质,该计算机可读存储介质中存储有计算机指令,当该计算机指令在电子设备上运行时,使得电子设备执行上述相关方法步骤实现上述实施例中的全景拍摄方法。The embodiments of the present application also provide a computer-readable storage medium that stores computer instructions in the computer-readable storage medium. When the computer instructions run on an electronic device, the electronic device executes the above-mentioned related method steps to implement the above-mentioned embodiments. Panorama shooting method in.
本申请的实施例还提供了一种计算机程序产品,当该计算机程序产品在计算机上运行时,使得计算机执行上述相关步骤,以实现上述实施例中电子设备执行的全景拍 摄方法。The embodiments of the present application also provide a computer program product, which when the computer program product runs on a computer, causes the computer to execute the above-mentioned related steps, so as to realize the panoramic photography method executed by the electronic device in the above-mentioned embodiment.
另外,本申请的实施例还提供一种装置,这个装置具体可以是芯片,组件或模块,该装置可包括相连的处理器和存储器;其中,存储器用于存储计算机执行指令,当装置运行时,处理器可执行存储器存储的计算机执行指令,以使芯片执行上述各方法实施例中电子设备执行的全景拍摄方法。In addition, the embodiments of the present application also provide a device. The device may specifically be a chip, component, or module. The device may include a processor and a memory connected to each other. The memory is used to store computer execution instructions. When the device is running, The processor can execute the computer-executable instructions stored in the memory, so that the chip executes the panoramic shooting method executed by the electronic device in the foregoing method embodiments.
其中,本实施例提供的电子设备、计算机可读存储介质、计算机程序产品或芯片均用于执行上文所提供的对应的方法,因此,其所能达到的有益效果可参考上文所提供的对应的方法中的有益效果,此处不再赘述。Among them, the electronic device, computer readable storage medium, computer program product, or chip provided in this embodiment are all used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the above provided The beneficial effects of the corresponding method will not be repeated here.
通过以上实施方式的描述,所属领域的技术人员可以了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。Through the description of the above embodiments, those skilled in the art can understand that for the convenience and brevity of the description, only the division of the above-mentioned functional modules is used as an example for illustration. In practical applications, the above-mentioned functions can be allocated to different functions as required. The function module is completed, that is, the internal structure of the device is divided into different function modules to complete all or part of the functions described above.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed device and method can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods, for example, multiple units or components may be It can be combined or integrated into another device, or some features can be omitted or not implemented. In addition, the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是一个物理单元或多个物理单元,即可以位于一个地方,或者也可以分布到多个不同地方。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate parts may or may not be physically separate. The parts displayed as units may be one physical unit or multiple physical units, that is, they may be located in one place, or they may be distributed to multiple different places. . Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of the present application are essentially or the part that contributes to the prior art, or all or part of the technical solutions can be embodied in the form of a software product, and the software product is stored in a storage medium. It includes several instructions to make a device (may be a single-chip microcomputer, a chip, etc.) or a processor (processor) execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage media include: U disk, mobile hard disk, read only memory (read only memory, ROM), random access memory (random access memory, RAM), magnetic disk or optical disk and other media that can store program codes.
以上内容,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above content is only the specific implementation manners of this application, but the protection scope of this application is not limited to this. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in this application. Covered in the scope of protection of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.

Claims (19)

  1. 一种全景拍摄方法,其特征在于,包括:A panoramic shooting method, characterized in that it comprises:
    电子设备进入相机应用的全景拍摄模式;The electronic device enters the panoramic shooting mode of the camera application;
    所述电子设备在预览界面上显示第一引导信息,所述第一引导信息包括第一引导路径;所述第一引导路径包括沿第一方向设置且相互平行的至少两条子路径,所述第一方向与所述电子设备的一条侧边平行,所述第一引导路径用于引导用户在拍摄过程中沿所述第一引导路径转动所述电子设备。The electronic device displays first guide information on the preview interface, the first guide information includes a first guide path; the first guide path includes at least two sub-paths that are arranged along a first direction and are parallel to each other, the first A direction is parallel to a side of the electronic device, and the first guide path is used to guide the user to rotate the electronic device along the first guide path during the shooting process.
  2. 根据权利要求1所述的方法,其特征在于,沿所述第一方向设置的不同子路径,在所述第一方向上对应的坐标范围存在重叠。The method according to claim 1, wherein the coordinate ranges corresponding to the different sub-paths set along the first direction overlap in the first direction.
  3. 根据权利要求2所述的方法,其特征在于,沿所述第一方向设置的不同子路径,在所述第一方向上对应的坐标范围相同。The method according to claim 2, wherein the different sub-paths set along the first direction correspond to the same coordinate range in the first direction.
  4. 根据权利要求1-3任一项所述的方法,其特征在于,所述第一引导路径还包括沿第二方向设置的至少一条子路径,所述至少一条子路径用于连接沿所述第一方向设置的至少两条子路径,所述第二方向与所述第一方向垂直。The method according to any one of claims 1 to 3, wherein the first guide path further comprises at least one sub-path arranged along the second direction, and the at least one sub-path is used to connect along the first guide path. At least two sub-paths are arranged in one direction, and the second direction is perpendicular to the first direction.
  5. 根据权利要求1-4任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1-4, wherein the method further comprises:
    所述电子设备检测到拍摄操作后,在拍摄界面上显示第二引导信息,所述第二引导信息包括拼接预览窗口、第二引导路径和偏离指示标记;其中,所述偏离指示标记用于表示所述电子设备采集的图像的中心线的位置,所述偏离指示标记在拍摄过程中沿着所述第二引导路径移动;所述第二引导路径包括所述第一引导路径上所述偏离指示标记未经过的部分;After the electronic device detects the shooting operation, the second guide information is displayed on the shooting interface. The second guide information includes a splicing preview window, a second guide path, and a deviation indicator; wherein, the deviation indicator is used to indicate The position of the center line of the image collected by the electronic device, the deviation indication mark moves along the second guide path during the shooting process; the second guide path includes the deviation indication on the first guide path Mark the unpassed part;
    所述电子设备在所述拼接预览窗口内显示所述偏离指示标记沿所述第一方向的子路径移动时,所述电子设备采集的图像拼接获得的目标图像;The electronic device displays the target image obtained by splicing images collected by the electronic device when the deviation indicator mark moves along the sub-path in the first direction in the splicing preview window;
    所述电子设备在所述偏离指示标记到达所述第二引导路径的末端后停止拍摄,所述电子设备拼接获得的目标图像即为全景图像。The electronic device stops shooting after the deviation indication mark reaches the end of the second guide path, and the target image obtained by splicing by the electronic device is a panoramic image.
  6. 根据权利要求5所述的方法,其特征在于,当所述偏离指示标记沿着所述第二引导路径中的任一子路径移动时,所述第二引导信息还包括位于所述任一子路径两侧且与所述任一子路径平行的偏离范围指示线;所述方法还包括:The method according to claim 5, wherein when the deviation indication mark moves along any sub-path of the second guide path, the second guide information further includes the The deviation range indicator lines on both sides of the path and parallel to any one of the sub-paths; the method further includes:
    若所述偏离指示标记超出所述偏离范围指示线所指示的范围,则所述电子设备停止拍摄。If the deviation indicator mark exceeds the range indicated by the deviation range indicator line, the electronic device stops shooting.
  7. 根据权利要求6所述的方法,其特征在于,所述第一引导路径包括沿第一方向设置且相互平行的第一子路径和第三子路径,且所述第一子路径为起始子路径;The method according to claim 6, wherein the first guide path includes a first sub-path and a third sub-path that are arranged along a first direction and are parallel to each other, and the first sub-path is the initial sub-path. path;
    所述第一引导路径还包括沿第二方向设置的第二子路径,所述第二子路径用于连接所述第一子路径和所述第三子路径;The first guide path further includes a second sub-path arranged along a second direction, and the second sub-path is used to connect the first sub-path and the third sub-path;
    在拍摄过程中,所述偏离指示标记依次沿着所述第一子路径、所述第二子路径和所述第三子路径移动。During the shooting process, the deviation indicator mark sequentially moves along the first sub-path, the second sub-path, and the third sub-path.
  8. 根据权利要求7所述的方法,其特征在于,所述第一引导路径还包括沿所述第一方向设置且与所述第一子路径平行的第五子路径,所述第三子路径和所述第五子路径位于所述第一子路径的两侧;The method according to claim 7, wherein the first guide path further comprises a fifth sub-path arranged along the first direction and parallel to the first sub-path, the third sub-path and The fifth sub-path is located on both sides of the first sub-path;
    所述第一引导路径还包括沿所述第二方向设置且与所述第二子路径平行的第四子 路径,所述第四子路径用于连接所述第三子路径和所述第五子路径;The first guide path further includes a fourth sub-path arranged along the second direction and parallel to the second sub-path, and the fourth sub-path is used to connect the third sub-path and the fifth sub-path. Subpath
    在拍摄过程中,所述偏离指示标记依次沿着所述第一子路径、所述第二子路径、所述第三子路径、所述第四子路径以及所述第五子路径移动。During the shooting process, the deviation indicator mark moves along the first sub-path, the second sub-path, the third sub-path, the fourth sub-path, and the fifth sub-path in sequence.
  9. 根据权利要求8所述的方法,其特征在于,在拍摄过程中,当所述偏离指示标记沿所述第一子路径移动时,所述第二引导路径包括所述第一子路径上所述偏离指示标记未经过的部分以及所述第二子路径至所述第五子路径,且所述第一子路径两侧显示有偏离范围指示线;所述拼接预览窗口内显示所述偏离指示标记沿着所述第一子路径移动时,所述电子设备采集的图像拼接获得的目标图像;8. The method according to claim 8, characterized in that, during the shooting process, when the deviation indicator mark moves along the first sub-path, the second guide path includes the first sub-path. The part that the deviation indicator does not pass and the second sub-path to the fifth sub-path, and the deviation range indicator line is displayed on both sides of the first sub-path; the deviation indicator is displayed in the splicing preview window When moving along the first sub-path, a target image obtained by splicing images collected by the electronic device;
    当所述偏离指示标记沿所述第二子路径移动时,所述第二引导路径包括所述第二子路径上所述偏离指示标记未经过的部分以及所述第三子路径至所述第五子路径,且所述第二子路径两侧显示有偏离范围指示线;所述拼接预览窗口内显示的所述目标图像为所述偏离指示标记移动到所述第一子路径的末端后,所述电子设备采集的图像拼接获得的所述第一路径对应的拼接结果;When the deviation indicator moves along the second sub-path, the second guide path includes the portion of the second sub-path that the deviation indicator does not pass and the third sub-path to the first sub-path. Five sub-paths, and deviation range indicator lines are displayed on both sides of the second sub-path; the target image displayed in the stitching preview window is after the deviation indicator mark moves to the end of the first sub-path, The splicing result corresponding to the first path obtained by splicing the images collected by the electronic device;
    当所述偏离指示标记沿所述第三子路径移动时,所述第二引导路径包括所述第三子路径上所述偏离指示标记未经过的部分以及所述第四子路径和所述第五子路径,且所述第三子路径两侧显示有偏离范围指示线;所述拼接预览窗口内显示的所述目标图像为所述偏离指示标记沿着所述第二子路径移动时,所述电子设备采集的图像与所述第一子路径对应的拼接结果进行拼接获得的图像。When the deviation indicator moves along the third sub-path, the second guide path includes the portion of the third sub-path that the deviation indicator does not pass, and the fourth sub-path and the first Five sub-paths, and deviation range indication lines are displayed on both sides of the third sub-path; the target image displayed in the stitching preview window is when the deviation indication mark moves along the second sub-path An image obtained by splicing the image collected by the electronic device with the splicing result corresponding to the first sub-path.
  10. 根据权利要求9所述的方法,其特征在于,当所述偏离指示标记沿所述第一子路径移动时,所述电子设备在所述拼接预览窗口内显示所述偏离指示标记沿着所述第一方向的子路径移动时,所述电子设备采集的图像拼接获得的目标图像,包括:The method according to claim 9, wherein when the deviation indicator mark moves along the first sub-path, the electronic device displays the deviation indicator mark along the When the sub-path in the first direction moves, the target image obtained by splicing the images collected by the electronic device includes:
    所述电子设备将所述第一子路径的第i帧图像I i映射到圆柱面上得到图像
    Figure PCTCN2021078666-appb-100001
    i为大于1的整数;
    The electronic device maps the i-th frame image I i of the first sub-path to a cylindrical surface to obtain an image
    Figure PCTCN2021078666-appb-100001
    i is an integer greater than 1;
    所述电子设备提取所述
    Figure PCTCN2021078666-appb-100002
    Figure PCTCN2021078666-appb-100003
    的特征点F I,i和F I,i-1,所述
    Figure PCTCN2021078666-appb-100004
    为所述第一子路径的第i-1帧图像I i-1映射到圆柱面后得到的图像;
    The electronic device extracts the
    Figure PCTCN2021078666-appb-100002
    with
    Figure PCTCN2021078666-appb-100003
    Feature points F I,i and F I,i-1 , the
    Figure PCTCN2021078666-appb-100004
    Is an image obtained after the i-1th frame image I i-1 of the first subpath is mapped to a cylindrical surface;
    所述电子设备计算所述F I,i和所述F I,i-1的匹配结果; The electronic device calculates the matching result of the F I,i and the F I,i-1;
    所述电子设备根据所述F I,i和所述F I,i-1的匹配结果,将所述
    Figure PCTCN2021078666-appb-100005
    向所述
    Figure PCTCN2021078666-appb-100006
    进行映射;
    According to the matching result of the F I,i and the F I,i-1, the electronic device converts the
    Figure PCTCN2021078666-appb-100005
    To said
    Figure PCTCN2021078666-appb-100006
    To map;
    所述电子设备将映射后的
    Figure PCTCN2021078666-appb-100007
    处于预设的第一裁剪范围内的部分,与所述第一子路径的拼接图像RI(i-1)拼接,从而获得所述第一子路径的拼接图像RIi;
    The electronic device will be mapped
    Figure PCTCN2021078666-appb-100007
    The part within the preset first cropping range is spliced with the spliced image RI(i-1) of the first sub-path, so as to obtain the spliced image RIi of the first sub-path;
    其中,所述第一裁剪范围包括所述第一子路径的偏离范围指示线对应的裁剪线以及所述电子设备预设的左边界线和右边界线限定的范围。Wherein, the first clipping range includes a clipping line corresponding to the deviation range indication line of the first sub-path and a range defined by a left boundary line and a right boundary line preset by the electronic device.
  11. 根据权利要求10所述的方法,其特征在于,当所述偏离指示标记沿所述第一子路径移动时,所述方法还包括:The method according to claim 10, wherein when the deviation indicator moves along the first sub-path, the method further comprises:
    所述电子设备从沿着所述第一方向的子路径转动时采集的图像帧中获取多个关键帧。The electronic device obtains a plurality of key frames from image frames collected while rotating along the sub-path in the first direction.
  12. 根据权利要求11所述的方法,其特征在于,当所述偏离指示标记沿所述第三子路径移动时,所述电子设备在所述拼接预览窗口内显示所述偏离指示标记沿着所述第一方向的子路径移动时所述电子设备采集的图像拼接获得的目标图像,包括:The method according to claim 11, wherein when the deviation indication mark moves along the third sub-path, the electronic device displays the deviation indication mark along the The target image obtained by splicing the images collected by the electronic device when the subpath in the first direction moves includes:
    所述电子设备从所述多个关键帧中获取与所述第三子路径的第一帧图像A 1匹配的 目标关键帧G f1The electronic device obtains, from the plurality of key frames, a target key frame G f1 that matches the first frame image A 1 of the third sub-path;
    所述电子设备将所述G f1映射到圆柱面上得到图像
    Figure PCTCN2021078666-appb-100008
    The electronic device maps the G f1 to a cylindrical surface to obtain an image
    Figure PCTCN2021078666-appb-100008
    所述电子设备将所述A 1映射到圆柱面上得到图像
    Figure PCTCN2021078666-appb-100009
    The electronic device maps the A 1 to a cylindrical surface to obtain an image
    Figure PCTCN2021078666-appb-100009
    所述电子设备提取所述
    Figure PCTCN2021078666-appb-100010
    和所述
    Figure PCTCN2021078666-appb-100011
    的特征点F A,1和F A,f1
    The electronic device extracts the
    Figure PCTCN2021078666-appb-100010
    And said
    Figure PCTCN2021078666-appb-100011
    Feature points F A,1 and F A,f1 ;
    所述电子设备计算所述F A,1和所述F A,f1的匹配结果; Calculating, by the electronic device, a matching result of the FA,1 and the FA ,f1;
    所述电子设备根据所述F A,1和所述F A,f1的匹配结果,将所述
    Figure PCTCN2021078666-appb-100012
    向所述
    Figure PCTCN2021078666-appb-100013
    进行映射;
    According to the matching result of the FA,1 and the FA ,f1, the electronic device converts the
    Figure PCTCN2021078666-appb-100012
    To said
    Figure PCTCN2021078666-appb-100013
    To map;
    所述电子设备将映射后的
    Figure PCTCN2021078666-appb-100014
    处于预设的第二裁剪范围内的部分,与所述第一子路径对应的拼接结果进行拼接,获得所述第二子路径的拼接图像RA1;
    The electronic device will be mapped
    Figure PCTCN2021078666-appb-100014
    The part within the preset second cropping range is spliced with the splicing result corresponding to the first sub-path to obtain the spliced image RA1 of the second sub-path;
    其中,所述第二裁剪范围包括所述第三子路径的偏离范围指示线对应的裁剪线以及所述电子设备预设的左边界线和右边界线限定的范围。Wherein, the second clipping range includes a clipping line corresponding to the deviation range indication line of the third sub-path and a range defined by a left boundary line and a right boundary line preset by the electronic device.
  13. 根据权利要求12所述的方法,其特征在于,在xyz坐标系中,所述电子设备摄像头的镜头位于xyz三维坐标系的xy平面;所述关键帧对应的绕y轴的旋转角的间隔大于或者等于预设值Δβ;其中,在所述多个关键帧中,所述目标关键帧G f1对应的绕y轴的旋转角与所述A 1对应的绕y轴的旋转角的差值最小。 The method according to claim 12, wherein, in the xyz coordinate system, the lens of the electronic device camera is located on the xy plane of the xyz three-dimensional coordinate system; the interval of the rotation angle around the y axis corresponding to the key frame is greater than Or equal to the preset value Δβ; wherein, among the multiple key frames, the difference between the rotation angle around the y axis corresponding to the target key frame G f1 and the rotation angle around the y axis corresponding to the A 1 is the smallest .
  14. 根据权利要求12或13所述的方法,其特征在于,当所述偏离指示标记沿所述第三子路径移动时,所述电子设备在所述拼接预览窗口内显示所述偏离指示标记沿着所述第一方向的子路径移动时所述电子设备采集的图像拼接获得的目标图像,还包括:The method according to claim 12 or 13, wherein when the deviation indication mark moves along the third sub-path, the electronic device displays the deviation indication mark along the splicing preview window. The target image obtained by splicing the images collected by the electronic device when the sub-path in the first direction moves, further includes:
    所述电子设备从所述多个关键帧中获取与所述第三子路径的第i帧图像A i匹配的第i目标关键帧G fiThe electronic device acquires the i-th frame image A of the third sub-path of the i-i matches the target keyframe G fi from the plurality of key frames;
    所述电子设备将所述G fi映射到圆柱面上得到图像
    Figure PCTCN2021078666-appb-100015
    The electronic device maps the G fi to a cylindrical surface to obtain an image
    Figure PCTCN2021078666-appb-100015
    所述电子设备将所述A i映射到圆柱面上得到图像
    Figure PCTCN2021078666-appb-100016
    The electronic device, the cylindrical surface A i to obtain an image map
    Figure PCTCN2021078666-appb-100016
    所述电子设备提取所述
    Figure PCTCN2021078666-appb-100017
    和所述
    Figure PCTCN2021078666-appb-100018
    的特征点F A,i、F A,i-1和F A,fi,所述
    Figure PCTCN2021078666-appb-100019
    为所述第二子路径的第i-1帧图像A i-1映射到圆柱面后得到的图像;
    The electronic device extracts the
    Figure PCTCN2021078666-appb-100017
    And said
    Figure PCTCN2021078666-appb-100018
    The feature points F A,i , F A,i-1 and F A,fi , the
    Figure PCTCN2021078666-appb-100019
    Is an image obtained after the i-1th frame image Ai-1 of the second subpath is mapped to a cylindrical surface;
    所述电子设备计算所述F A,i,所述F A,i-1和所述F A,fi的匹配结果; The electronic device calculates the matching result of the FA,i , the FA ,i-1 and the FA ,fi;
    所述电子设备根据所述F A,i,所述F A,i-1和所述F A,fi的匹配结果,将所述
    Figure PCTCN2021078666-appb-100020
    向所述
    Figure PCTCN2021078666-appb-100021
    和所述
    Figure PCTCN2021078666-appb-100022
    进行映射;
    According to the matching result of the F A,i , the F A,i-1 and the F A,fi, the electronic device converts the
    Figure PCTCN2021078666-appb-100020
    To said
    Figure PCTCN2021078666-appb-100021
    And said
    Figure PCTCN2021078666-appb-100022
    To map;
    所述电子设备将映射后的
    Figure PCTCN2021078666-appb-100023
    处于预设的所述第二裁剪范围内的部分,与所述第一子路径对应的拼接结果和所述第二子路径的拼接图像RA(i-1)进行拼接,获得所述第二子路径的拼接图像RAi。
    The electronic device will be mapped
    Figure PCTCN2021078666-appb-100023
    For the part within the preset second cropping range, the splicing result corresponding to the first sub-path and the spliced image RA(i-1) of the second sub-path are spliced to obtain the second sub-path The stitched image RAi of the path.
  15. 根据权利要求11-14任一项所述的方法,其特征在于,当所述偏离指示标记沿所述第五子路径移动时,所述电子设备在所述拼接预览窗口内显示所述偏离指示标记沿着所述第一方向的子路径移动时所述电子设备采集的图像拼接获得的目标图像,包括:The method according to any one of claims 11-14, wherein when the deviation indication mark moves along the fifth sub-path, the electronic device displays the deviation indication in the splicing preview window The target image obtained by splicing the images collected by the electronic device when the marker moves along the sub-path in the first direction includes:
    所述电子设备根据所述多个关键帧,将沿着所述第五子路径转动时采集的图像与所述第一子路径对应的拼接结果进行拼接。According to the plurality of key frames, the electronic device splices the image collected while rotating along the fifth sub-path with the splicing result corresponding to the first sub-path.
  16. 根据权利要求8-15任一项所述的方法,其特征在于,在xyz坐标系中,所述电子设备摄像头的镜头位于xyz三维坐标系的xy平面;The method according to any one of claims 8-15, wherein in the xyz coordinate system, the lens of the electronic device camera is located on the xy plane of the xyz three-dimensional coordinate system;
    所述电子设备预设有左边界线、左基线、左裁剪线、右裁剪线、右基线和右边界 线;所述左基线与所述第四子路径对应,所述左基线对应的绕y轴的旋转角为0,所述右基线与所述第二子路径对应,所述右基线对应的绕y轴的旋转角为β r,所述左裁剪线对应的绕y轴的旋转角为β 2,所述右裁剪线对应的绕y轴的旋转角为β 3,所述左边界线对应的绕y轴的旋转角为β 1,所述右边界线对应的绕y轴的旋转角为β 4The electronic device is preset with a left boundary line, a left baseline, a left clipping line, a right clipping line, a right baseline, and a right boundary line; the left baseline corresponds to the fourth sub-path, and the left baseline corresponds to a line around the y-axis The rotation angle is 0, the right baseline corresponds to the second subpath, the rotation angle about the y-axis corresponding to the right baseline is β r , and the rotation angle about the y-axis corresponding to the left clipping line is β 2 , The rotation angle around the y-axis corresponding to the right clipping line is β 3 , the rotation angle around the y-axis corresponding to the left boundary line is β 1 , and the rotation angle around the y-axis corresponding to the right boundary line is β 4 ;
    所述电子设备还预设有上基线、中基线、下基线,以及第一裁剪线、第二裁剪线、第三裁剪线和第四裁剪线;其中,所述上基线、所述中基线和所述下基线分别与所述第三子路径、所述第一子路径和所述第五子路径对应,所述第一裁剪线和所述第二裁剪线与所述第三子路径的偏离范围指示线对应,所述第二裁剪线和所述第三裁剪线与所述第一子路径的偏离范围指示线对应,所述第三裁剪线和所述第四裁剪线与所述第五子路径的偏离范围指示线对应;所述第一裁剪线、所述上基线、所述第二裁剪线、所述中间线、所述第三裁剪线、所述下基线和所述第四裁剪线对应的绕x轴的旋转角分别为α 1,α t,α 2,0,α 3,α b,α 4;所述方法还包括: The electronic device is also preset with an upper baseline, a middle baseline, and a lower baseline, as well as a first cutting line, a second cutting line, a third cutting line, and a fourth cutting line; wherein, the upper baseline, the middle baseline, and the The lower baseline corresponds to the third sub-path, the first sub-path, and the fifth sub-path respectively, and the deviation of the first cutting line and the second cutting line from the third sub-path The range indication line corresponds, the second cutting line and the third cutting line correspond to the deviation range indication line of the first sub-path, and the third cutting line and the fourth cutting line correspond to the fifth cutting line. The deviation range indication line of the sub-path corresponds to; the first cutting line, the upper baseline, the second cutting line, the middle line, the third cutting line, the lower baseline, and the fourth cutting The rotation angles around the x-axis corresponding to the lines are α 1 , α t , α 2 , 0, α 3 , α b , and α 4 respectively ; the method further includes:
    当所述偏离指示标记沿着所述第一子路径移动时,若所述电子设备绕x轴的旋转角α>α 1或α<α 2,则所述电子设备停止拍摄; When the deviation indication mark moves along the first sub-path, if the rotation angle of the electronic device around the x axis is α>α 1 or α<α 2 , the electronic device stops shooting;
    当所述电子设备绕y轴的旋转角β>β r时,所述偏离指示标记由沿着所述第一子路径移动切换为沿着所述第二子路径移动;若所述电子设备绕y轴的旋转角β>β 4或β<β 3,则所述电子设备停止拍摄; When the electronic device about the y-axis rotational angle β> β r, is moved by the deviation indicator is switched to the first sub-movement along a path along the second sub-path; if the electronic device about If the rotation angle of the y axis β>β 4 or β<β 3 , the electronic device stops shooting;
    当所述电子设备绕x轴的旋转角α>α t时,所述偏离指示标记由沿着所述第二子路径移动切换为沿着所述第三子路径移动;当所述电子设备绕x轴的旋转角α>α 1或α<α 2时,所述电子设备停止拍摄; When the rotation angle of the electronic device around the x axis is α>α t , the deviation indication mark is switched from moving along the second sub-path to moving along the third sub-path; When the x-axis rotation angle α>α 1 or α<α 2 , the electronic device stops shooting;
    当电子设备绕y轴的旋转角β<0时,所述偏离指示标记由沿着所述第三子路径移动切换为沿者所述第四子路径移动;当所述电子设备绕y轴的旋转角β>β 2或β<β 1时,所述电子设备停止拍摄; When the rotation angle β of the electronic device around the y-axis is less than 0, the deviation indication mark is switched from moving along the third sub-path to moving along the fourth sub-path; when the electronic device is moving around the y-axis rotation angle β> β 2, or when β <β 1, the electronic device to stop recording;
    当所述电子设备绕x轴的旋转角α<α b时,所述偏离指示标记由沿着所述第四子路径移动切换为沿着所述第五子路径移动;当所述电子设备绕x轴的旋转角α>α 3或α<α 4时,所述电子设备停止拍摄; When the electronic device about the x axis rotation angle α <α b, the deviation indicator is moved by the switching path of movement along the fourth sub-sub-path along the fifth; about when the electronic device When the x-axis rotation angle α>α 3 or α<α 4 , the electronic device stops shooting;
    当所述电子设备绕y轴的旋转角β>β r时,所述电子设备停止拍摄。 When the electronic device about the y-axis rotational angle β> β r, the electronic device to stop recording.
  17. 一种电子设备,其特征在于,包括:An electronic device, characterized in that it comprises:
    摄像头,用于采集图像;Camera, used to collect images;
    屏幕,用于显示界面;Screen, used to display the interface;
    一个或多个处理器;One or more processors;
    存储器;Memory
    以及一个或多个计算机程序,其中所述一个或多个计算机程序被存储在所述存储器中,所述一个或多个计算机程序包括指令;当所述指令被所述电子设备执行时,使得所述电子设备执行如权利要求1-16中任一项所述的全景拍摄方法。And one or more computer programs, wherein the one or more computer programs are stored in the memory, and the one or more computer programs include instructions; when the instructions are executed by the electronic device, the The electronic device executes the panoramic shooting method according to any one of claims 1-16.
  18. 一种计算机可读存储介质,其特征在于,包括计算机指令,当所述计算机指令在计算机上运行时,使得所述计算机执行如权利要求1-16中任一项所述的全景拍摄方法。A computer-readable storage medium, characterized by comprising computer instructions, when the computer instructions are run on a computer, the computer is caused to execute the panoramic shooting method according to any one of claims 1-16.
  19. 一种计算机程序产品,其特征在于,当所述计算机程序产品在计算机上运行时, 使得所述计算机执行如权利要求1-16中任一项所述的全景拍摄方法。A computer program product, characterized in that, when the computer program product runs on a computer, the computer is caused to execute the panoramic shooting method according to any one of claims 1-16.
PCT/CN2021/078666 2020-05-29 2021-03-02 Panoramic image capture method and device WO2021238317A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010478652.1 2020-05-29
CN202010478652.1A CN113747044B (en) 2020-05-29 2020-05-29 Panoramic shooting method and equipment

Publications (1)

Publication Number Publication Date
WO2021238317A1 true WO2021238317A1 (en) 2021-12-02

Family

ID=78724968

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/078666 WO2021238317A1 (en) 2020-05-29 2021-03-02 Panoramic image capture method and device

Country Status (2)

Country Link
CN (1) CN113747044B (en)
WO (1) WO2021238317A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117135259A (en) * 2023-04-11 2023-11-28 荣耀终端有限公司 Camera switching method and electronic equipment

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114827472B (en) * 2022-04-29 2023-05-30 北京城市网邻信息技术有限公司 Panoramic shooting method and device, electronic equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101964869A (en) * 2009-07-23 2011-02-02 华晶科技股份有限公司 Directed shooting method for panoramic picture
CN102201115A (en) * 2011-04-07 2011-09-28 湖南天幕智能科技有限公司 Real-time panoramic image stitching method of aerial videos shot by unmanned plane
CN103430530A (en) * 2011-03-30 2013-12-04 Nec卡西欧移动通信株式会社 Imaging device, photographing guide displaying method for imaging device, and non-transitory computer readable medium
CN105957008A (en) * 2016-05-10 2016-09-21 厦门美图之家科技有限公司 Panoramic image real-time stitching method and panoramic image real-time stitching system based on mobile terminal
US9716828B2 (en) * 2013-08-28 2017-07-25 Samsung Electronics Co., Ltd. Method for shooting image and electronic device thereof
CN107545538A (en) * 2016-06-24 2018-01-05 清华大学深圳研究生院 A kind of Panorama Mosaic method and device based on unmanned plane
US20190182422A1 (en) * 2017-12-11 2019-06-13 Canon Kabushiki Kaisha Image capturing apparatus and control method for image capturing apparatus

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103176347B (en) * 2011-12-22 2016-07-27 百度在线网络技术(北京)有限公司 Panorama sketch image pickup method and filming apparatus and electronic equipment
KR102021857B1 (en) * 2013-07-23 2019-09-17 엘지전자 주식회사 Mobile terminal and panorama capturing method thereof
CN104394321B (en) * 2014-11-28 2017-05-24 广东欧珀移动通信有限公司 Mobile terminal and imaging method of mobile terminal
CN105657257B (en) * 2015-12-29 2018-07-17 广东欧珀移动通信有限公司 Image pickup method, device, system, mobile terminal and the self-shooting bar of distant view photograph
CN110012209B (en) * 2018-01-05 2020-08-14 Oppo广东移动通信有限公司 Panoramic image generation method and device, storage medium and electronic equipment
CN108259762A (en) * 2018-03-23 2018-07-06 南京嘉码信息科技有限公司 A kind of roaming type panorama sketch automatic shooting system and method
CN109087244B (en) * 2018-07-26 2023-04-18 深圳禾苗通信科技有限公司 Panoramic image splicing method, intelligent terminal and storage medium
CN110505401A (en) * 2019-08-16 2019-11-26 维沃移动通信有限公司 A kind of camera control method and electronic equipment
CN110675319B (en) * 2019-09-12 2020-11-03 创新奇智(成都)科技有限公司 Mobile phone photographing panoramic image splicing method based on minimum spanning tree

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101964869A (en) * 2009-07-23 2011-02-02 华晶科技股份有限公司 Directed shooting method for panoramic picture
CN103430530A (en) * 2011-03-30 2013-12-04 Nec卡西欧移动通信株式会社 Imaging device, photographing guide displaying method for imaging device, and non-transitory computer readable medium
CN102201115A (en) * 2011-04-07 2011-09-28 湖南天幕智能科技有限公司 Real-time panoramic image stitching method of aerial videos shot by unmanned plane
US9716828B2 (en) * 2013-08-28 2017-07-25 Samsung Electronics Co., Ltd. Method for shooting image and electronic device thereof
CN105957008A (en) * 2016-05-10 2016-09-21 厦门美图之家科技有限公司 Panoramic image real-time stitching method and panoramic image real-time stitching system based on mobile terminal
CN107545538A (en) * 2016-06-24 2018-01-05 清华大学深圳研究生院 A kind of Panorama Mosaic method and device based on unmanned plane
US20190182422A1 (en) * 2017-12-11 2019-06-13 Canon Kabushiki Kaisha Image capturing apparatus and control method for image capturing apparatus

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117135259A (en) * 2023-04-11 2023-11-28 荣耀终端有限公司 Camera switching method and electronic equipment

Also Published As

Publication number Publication date
CN113747044B (en) 2023-05-02
CN113747044A (en) 2021-12-03

Similar Documents

Publication Publication Date Title
CN110555883B (en) Repositioning method and device for camera attitude tracking process and storage medium
WO2021238325A1 (en) Image processing method and apparatus
WO2022062318A1 (en) Photographing method and device
KR102222073B1 (en) Method and electronic device for taking a photograph
WO2017088678A1 (en) Long-exposure panoramic image shooting apparatus and method
WO2019134516A1 (en) Method and device for generating panoramic image, storage medium, and electronic apparatus
WO2021223500A1 (en) Photographing method and device
WO2013015147A1 (en) Image processing system, information processing device, program, and image processing method
WO2022022715A1 (en) Photographing method and device
WO2021238317A1 (en) Panoramic image capture method and device
CN110636276B (en) Video shooting method and device, storage medium and electronic equipment
US8400532B2 (en) Digital image capturing device providing photographing composition and method thereof
CN114390213B (en) Shooting method and equipment
WO2021244104A1 (en) Time-lapse photography method and device
WO2022022726A1 (en) Image capture method and device
CN114339102B (en) Video recording method and equipment
WO2017054185A1 (en) Method, device, and terminal for displaying panoramic visual content
WO2021185374A1 (en) Image capturing method and electronic device
US11657477B2 (en) Image processing device, image processing system, imaging device, image processing method, and recording medium storing program code
CN114390186B (en) Video shooting method and electronic equipment
WO2023231697A1 (en) Photographing method and related device
US8665317B2 (en) Imaging apparatus, imaging method and recording medium
CN116051361B (en) Image dimension data processing method and device
CN114898084B (en) Visual positioning method, device and storage medium
CN114697530B (en) Photographing method and device for intelligent view finding recommendation

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: 21813319

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: 21813319

Country of ref document: EP

Kind code of ref document: A1