Same-camera shooting method, electronic device, storage medium and program product

By determining the marking points and counterpoint points in electronic devices and adjusting the camera position using the six-degree of freedom parameters, the existing complex and cost-effective shooting methods of the same camera position are solved, and simple and low-cost shooting of the same camera position is achieved Effect.

CN118540575BActive Publication Date: 2024-12-06HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410994783.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-24
Publication Date
2024-12-06
Estimated Expiration
2044-07-24

AI Technical Summary

Technical Problem

The existing methods of shooting at the same camera are complex and costly, making it difficult to achieve simple and economical shooting at the same camera.

Method used

By using the camera and a display screen in an electronic device, at least three marking points are determined based on the pre-shot reference image, the corresponding counterpoint points are determined, and the camera position of the camera is adjusted through the six-degree of freedom parameter to capture it with the reference image The camera position is consistent, and the camera position is shot.

Benefits of technology

Simple and low-cost camera shooting is realized, and the camera position can be adjusted according to the preview screen of the three-dimensional scene and the reference image to ensure that the captured photos or videos are consistent with the camera position of the reference image.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118540575B_ABST
    Figure CN118540575B_ABST
Patent Text Reader

Abstract

The present application provides a same-camera shooting method, electronic device, storage medium and program product, which relate to the field of computer vision technology. In the same-camera shooting method, at least three identification points on a reference image obtained by pre-shooting and at least three alignment points in the first preview image acquired by the camera that correspond one to one to the at least three identification points are determined, and the six-degree-of-freedom parameters of the projection plane determined by the at least three alignment points are determined to be transformed to the projection plane determined by the at least three identification points. According to the six-degree-of-freedom parameters, it is determined whether the camera position is the same as the shooting position of the reference image. In the embodiment of the present application, only the preview image of the camera corresponding to the three-dimensional scene and the reference image can be used to adjust the camera position to the same as the shooting position of the reference image by the method in the embodiment of the present application. The method is simple, does not require external equipment, and is low in cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer vision technology, and in particular to a same-camera shooting method, electronic equipment, storage medium and program product. Background Art

[0002] Shooting from the same camera position can ensure that the shooting angle and position of the photo or video are consistent. Currently, finding the same camera position for shooting is widely used in all aspects of life. For example, in the fields of monitoring environmental changes, urban planning and disaster response, by comparing images taken from the same camera position at different time points, surface changes such as urban expansion, deforestation or the impact of natural disasters can be detected and analyzed. For example, when traveling, you can use the photos taken by others as a benchmark to find the same camera position to check in and take photos.

[0003] The known methods of finding the same camera position for shooting are relatively complicated and costly. Therefore, a simple and low-cost same camera position shooting method is urgently needed. Summary of the invention

[0004] The present application provides a same-camera shooting method, electronic equipment, storage medium and program product, which is simple and low-cost.

[0005] In order to achieve the above objectives, this application adopts the following technical solutions:

[0006] In the first aspect, a same-camera shooting method is provided, which is applied to an electronic device, wherein the electronic device includes a camera and a display screen, and the method includes: first, determining at least three identification points based on a reference image obtained in advance, wherein the at least three identification points are not on the same straight line; and determining at least three alignment points corresponding to the at least three identification points in the first preview image acquired by the camera, wherein the at least three identification points correspond to the at least three alignment points one by one, and the corresponding identification points correspond to the same points in the world coordinate system as the alignment points, and the first preview image corresponds to the same scene as the reference image. Afterwards, according to the coordinates of the at least three identification points and the coordinates of the at least three alignment points, the six-degree-of-freedom parameters of the transformation from the projection plane determined by the at least three alignment points to the projection plane determined by the at least three identification points are determined, and according to the six-degree-of-freedom parameters, it is determined whether the camera position is the same as the shooting position of the reference image. In the case where the position of the camera is different from the shooting position of the reference image, if a change in the position of the camera is detected, a second preview screen is obtained, the second preview screen is a preview screen corresponding to the change in the position of the camera, and the at least three alignment points are re-determined in the second preview screen, and the six-degree-of-freedom parameters are re-determined based on the coordinates of the at least three identification points and the coordinates of the re-determined at least three alignment points, until it is determined that the position of the camera is the same as the shooting position of the reference image according to the re-determined six-degree-of-freedom parameters; when the position of the camera is the same as the shooting position of the reference image, the camera is enabled to shoot.

[0007] In an embodiment of the present application, first, at least three identification points on a reference image obtained by pre-shooting and at least three alignment points in a first preview image obtained by a camera corresponding to the at least three identification points are determined, and the reference image and the first preview image correspond to the same scene; secondly, the six degrees of freedom parameters of the projection plane determined by the at least three alignment points are determined to be transformed to the projection plane determined by the at least three identification points. Since the image obtained by the electronic device after shooting a three-dimensional scene is a two-dimensional projection of the three-dimensional scene on the image sensor, if the two-dimensional projections of the same three-dimensional scene in the two images are the same, the shooting positions of the two images are the same, that is, when the projection plane determined by the at least three alignment points is the same as the projection plane determined by the at least three identification points, the shooting positions of the two images are the same. Therefore, it can be determined whether the camera position is the same as the shooting position of the reference image by checking whether the six degrees of freedom parameters of the projection plane determined by the at least three alignment points to the projection plane determined by the at least three identification points are close to 0. In the case where the position of the camera is different from the shooting position of the reference image, if it is detected that the position of the camera has changed, a second preview screen is obtained, and the six-degree-of-freedom parameters are re-determined according to at least three identification points of the reference image and at least three alignment points re-determined in the second preview screen, until the position of the camera is determined to be the same as the shooting position of the reference image according to the re-determined six-degree-of-freedom parameters. In this embodiment, the position of the camera can be adjusted to be the same as the shooting position of the reference image by the method in this embodiment only according to the preview screen of the camera corresponding to the three-dimensional scene and the reference image. The method is simple, does not require external equipment, and has low cost. In the case where the position of the camera is the same as the shooting position of the reference image, the camera can be enabled for shooting, and a photo or video with the same shooting position as the reference image can be obtained.

[0008] In a possible implementation of the first aspect, the redetermining the at least three alignment points in the second preview screen includes: in a case where a second operation is detected, in response to the second operation, redetermining the at least three alignment points in the second preview screen, wherein the second operation is used to select the at least three alignment points in the second preview screen. In this implementation, the redetermining of the at least three alignment points in the second preview screen can be determined by manual operation of the user.

[0009] In a possible implementation of the first aspect, after determining the at least three alignment points corresponding to the at least three identification points in the first preview screen acquired by the camera, it also includes: identifying the image features corresponding to the at least three alignment points in the first preview screen, and establishing a mapping relationship between the at least three alignment points and the image features; the re-determining the at least three alignment points in the second preview screen includes: identifying the coordinates of the image features in the second preview screen; and re-determining the at least three alignment points in the second preview screen according to the coordinates of the image features and the mapping relationship. In this implementation, the electronic device automatically re-determines the at least three alignment points in the second preview screen without manual operation by the user.

[0010] In a possible implementation of the first aspect, the at least three identification points include a first identification point, a second identification point and a third identification point, the first identification point and the second identification point form a first vector, the second identification point and the third identification point form a second vector; the at least three alignment points include a first alignment point, a second alignment point and a third alignment point, the first alignment point and the second alignment point form a third vector, the second alignment point and the third alignment point form a fourth vector; the first identification point and the second alignment point correspond to the same point in a world coordinate system, the second identification point and the second alignment point correspond to the same point in a world coordinate system, and the third identification point and the third alignment point correspond to the same point in a world coordinate system; the coordinates of the at least three identification points and the coordinates of the at least three alignment points are determined from the at least three alignment points. The six-degree-of-freedom parameters of the projection plane transformed to the projection plane determined by the at least three identification points include: determining a first vector and a second vector according to the coordinates of the at least three identification points, the starting point of the first vector corresponds to the first identification point, the end point of the first vector corresponds to the second identification point, the starting point of the second vector corresponds to the second identification point, and the end point of the second vector corresponds to the third identification point; determining a third vector and a fourth vector according to the coordinates of the at least three alignment points, the starting point of the third vector corresponds to the first alignment point, the end point of the third vector corresponds to the second alignment point, the starting point of the fourth vector corresponds to the second alignment point, and the end point of the fourth vector corresponds to the third alignment point; determining the six-degree-of-freedom parameters of the projection plane transformed from the projection plane determined by the third vector and the fourth vector to the projection plane determined by the first vector and the second vector.

[0011] In this implementation, the six degrees of freedom parameters required for transforming the two-dimensional projection surface of the three-dimensional scene in the first preview interface to the two-dimensional projection surface of the three-dimensional scene in the reference image are determined by using two vectors, a first vector and a second vector, in the reference image, and two vectors, a third vector and a fourth vector in the first preview interface.

[0012] In a possible implementation of the first aspect, the method further includes: when the position of the camera is different from the shooting position of the reference image, displaying the six-degree-of-freedom parameters in the first preview screen. In this implementation, by displaying the six-degree-of-freedom parameters in the first preview screen, it is convenient for the user to refer to the six-degree-of-freedom parameters to move the position of the camera of the electronic device.

[0013] In a possible implementation of the first aspect, the method further includes: displaying the re-determined six-degree-of-freedom parameters in the second preview screen. In this implementation, when the six-degree-of-freedom parameters are changed, the re-determined six-degree-of-freedom parameters are displayed in the second preview screen to provide feedback to the user, and the user can determine whether the adjusted direction and angle are correct by viewing the changes in the six-degree-of-freedom parameters.

[0014] In a possible implementation of the first aspect, the determining of at least three alignment points corresponding to the at least three identification points in the first preview image acquired by the camera includes: in the case of detecting a third operation, in response to the third operation, determining at least three alignment points corresponding to the at least three identification points in the first preview image acquired by the camera, the third operation being used to select the at least three alignment points in the first preview image, a floating window being further displayed on the first preview image, the reference image and the at least three identification points being displayed in the floating window. In this implementation, the at least three alignment points corresponding to the at least three identification points in the first preview image can be determined by manual operation of the user.

[0015] In a possible implementation manner of the first aspect, the method further includes: determining whether the position of the camera changes by detecting whether the camera moves or detecting whether the first preview image or the second preview image acquired by the camera changes.

[0016] In a possible implementation of the first aspect, the at least three identification points are determined based on a pre-photographed reference image, and the at least three identification points are not on the same straight line, including: binarization processing is performed based on the pre-photographed reference image to obtain a binarized image; in each sub-region of three regions preset in the binarized image, all pixel points of the sub-region are traversed with a preset size, and the pixel region with the largest difference in grayscale value with the adjacent pixel region is used as the identification point of the sub-region, and the size of the pixel region is the same as the preset size. In this implementation, the electronic device can automatically determine at least three identification points in the reference image.

[0017] In a possible implementation of the first aspect, the determining of at least three identification points based on a pre-captured reference image, wherein the at least three identification points are not on the same straight line, includes: when the camera is started, if a fourth operation is detected, in response to the fourth operation, determining the at least three identification points in the pre-captured reference image, wherein the fourth operation is used to determine the at least three identification points in the reference image. In this implementation, the at least three identification points in the reference image can be determined manually by the user.

[0018] In a second aspect, an electronic device is provided, including a camera, a display screen, a processor and a memory, wherein the camera is used to obtain a preview image, the display screen is used to display the preview image, the memory is used to store a computer program that can be run on the processor, and the processor is used to execute the steps of processing in the first aspect or any one of the methods in the first aspect.

[0019] In a third aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor executes the steps of processing in the first aspect or any one of the methods in the first aspect.

[0020] In a fourth aspect, a computer program product is provided, the computer program product comprising: a computer program code, when the computer program code is executed by an electronic device, the electronic device executes the steps of processing in the first aspect or any one of the methods in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application;

[0022] Figure 2 It is a software structure block diagram of an electronic device provided in an embodiment of the present application;

[0023] FIG3 (1) is a scene diagram of a same-camera shooting method provided in an embodiment of the present application;

[0024] FIG3 (2) is a scene diagram of a same-camera shooting method provided in an embodiment of the present application;

[0025] Figure 4 It is a flowchart of a same-camera shooting method provided in an embodiment of the present application;

[0026] Figure 5 is a schematic diagram of selecting a marker point in a reference image provided by an embodiment of the present application;

[0027] Figure 6It is a schematic diagram of the principle of obtaining a three-dimensional scene by a camera provided in an embodiment of the present application;

[0028] Figure 7 is a schematic diagram of determining a vector in a reference image provided by an embodiment of the present application;

[0029] Figure 8 is a schematic diagram of determining a vector in a first preview image provided by an embodiment of the present application;

[0030] Fig. 9 It is a structural schematic diagram of a device for same-camera shooting provided in an embodiment of the present application;

[0031] Fig.10 It is a schematic diagram of the structure of a chip provided in an embodiment of the present application. DETAILED DESCRIPTION

[0032] The technical solution in this application will be described below in conjunction with the accompanying drawings.

[0033] 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 article is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.

[0034] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this embodiment, unless otherwise specified, "plurality" means two or more.

[0035] First, some terms in the embodiments of the present application are explained to facilitate understanding by those skilled in the art.

[0036] 1. World Coordinate System

[0037] The world coordinate system (also known as the Cartesian coordinate system) is a three-dimensional coordinate system represented by three axes, namely the x-axis, y-axis, and z-axis. This coordinate system is often used to describe specific locations on the earth, where the x-axis represents the east-west direction, the y-axis represents the north-south direction, and the z-axis represents the height or altitude. In the world coordinate system, each point has a unique coordinate value that can be expressed in the form of (x, y, z). The world coordinate system can be used to describe the position of cameras and objects. This coordinate system is called the world coordinate system.

[0038] 2. Camera coordinate system

[0039] The camera coordinate system is a three-dimensional coordinate system whose origin is usually located at the optical center of the camera, that is, the optical center of the lens.

[0040] In this coordinate system, the X-axis and Y-axis are usually parallel to the image plane, while the Z-axis is perpendicular to the image plane and points to the front of the camera. The camera coordinate system is used to describe points in three-dimensional space that are imaged on the image plane through the camera lens.

[0041] 3. Image coordinate system

[0042] The image coordinate system is a two-dimensional coordinate system used to describe the position of a point imaged on the image plane. Usually, the origin of the image coordinate system is located at the center of the image, and the x-axis and y-axis are parallel to the two sides of the image plane. The coordinates in the image coordinate system are usually in meters or centimeters, indicating the distance from the point to the center of the image.

[0043] 4. Six degrees of freedom parameters

[0044] The six degrees of freedom (6DOF) parameters describe the degrees of freedom of an object in three-dimensional space, that is, it can move and rotate in six directions. These six degrees of freedom usually include: translational freedom and rotational freedom. Translational freedom includes: X-axis translation: the movement of the object on the X-axis, also known as the lateral distance. Y-axis translation: the movement of the object on the Y-axis, also known as the forward distance. Z-axis translation: the movement of the object on the Z-axis, also known as the height. Rotational freedom includes: X-axis rotation: the rotation of the object around the X-axis, also known as the pitch angle. Y-axis rotation: the rotation of the object around the Y-axis, also known as the roll angle. Z-axis rotation: the rotation of the object around the Z-axis, also known as the yaw angle. These degrees of freedom allow objects to move in all directions in three-dimensional space.

[0045] The above is a brief introduction to the terms involved in the embodiments of the present application, which will not be repeated below.

[0046] The term "same camera" is often used in photography, videography, or filmmaking to refer to a shoot where the photographer or videographer uses the same camera position but may change the focal length, angle, or focus of the lens. Same camera shooting can be used to show different perspectives or details of the same scene without changing the camera position.

[0047] For a photo, finding the same camera position means finding the position and angle of the camera in the world coordinate system when the photo was taken. Finding the same camera position for shooting can ensure that the shooting angle and position of the photo or video remain consistent. Currently, finding the same camera position for shooting is widely used in all aspects of life. For example, in the fields of monitoring environmental changes, urban planning, and disaster response, by comparing images taken from the same camera position at different time points, surface changes such as urban expansion, deforestation, or the effects of natural disasters can be detected and analyzed. For example, when traveling, you can use photos taken by others as a benchmark to find the same camera position to check in and take photos.

[0048] The known methods of finding the same camera position for shooting are relatively complicated and costly. Therefore, a simple and low-cost same camera position shooting method is urgently needed.

[0049] In view of this, an embodiment of the present application provides a same-camera shooting method, which is applied to an electronic device, and the electronic device includes a camera and a display screen. The method includes: first, determining at least three identification points based on a reference image obtained in advance, and at least three identification points are not on the same straight line; and determining at least three alignment points corresponding to the at least three identification points in the first preview image, at least three identification points correspond to at least three alignment points one by one, and the corresponding identification points and alignment points correspond to the same point in the world coordinate system, and the first preview image and the reference image correspond to the same scene. Afterwards, according to the coordinates of the at least three identification points and the coordinates of the at least three alignment points, determine the six-degree-of-freedom parameters of the transformation from the projection plane determined by the at least three alignment points to the projection plane determined by the at least three identification points, and according to the six-degree-of-freedom parameters, determine whether the camera position is the same as the shooting position of the reference image. When the camera position is different from the shooting position of the reference image, if it is detected that the camera position has changed, a second preview picture is obtained, and the second preview picture is the preview picture corresponding to the camera position change, and at least three alignment points are re-determined in the second preview picture, and the six-degree-of-freedom parameters are re-determined based on the coordinates of at least three identification points and the coordinates of the re-determined at least three alignment points, until it is determined that the camera position is the same as the shooting position of the reference image according to the re-determined six-degree-of-freedom parameters; when the camera position is the same as the shooting position of the reference image, the camera is enabled for shooting.

[0050] In an embodiment of the present application, first, at least three identification points on a reference image obtained by pre-shooting and at least three alignment points in the first preview screen of the camera corresponding to the at least three identification points are determined, and the reference image and the first preview screen correspond to the same scene. Secondly, the six degrees of freedom parameters of the projection plane determined by the at least three alignment points are determined to be transformed to the projection plane determined by the at least three identification points. Since the image obtained by the electronic device after shooting the three-dimensional scene is a two-dimensional projection of the three-dimensional scene on the image sensor, if the two-dimensional projections of the same three-dimensional scene in the two images are the same, the shooting positions of the two images are the same, that is, when the projection plane determined by the at least three alignment points is the same as the projection plane determined by the at least three identification points, the shooting positions of the two images are the same. Therefore, it can be determined whether the camera position is the same as the shooting position of the reference image by checking whether the six degrees of freedom parameters of the projection plane determined by the at least three alignment points to the projection plane determined by the at least three identification points are close to 0. In the case where the position of the camera is different from the shooting position of the reference image, if it is detected that the position of the camera has changed, a second preview screen is obtained, and the six-degree-of-freedom parameters are re-determined according to at least three identification points of the reference image and at least three alignment points re-determined in the second preview screen, until the position of the camera is determined to be the same as the shooting position of the reference image according to the re-determined six-degree-of-freedom parameters. In this embodiment, the position of the camera can be adjusted to be the same as the shooting position of the reference image by the method in this embodiment only according to the preview screen of the camera corresponding to the three-dimensional scene and the reference image. The method is simple, does not require external equipment, and has low cost. In the case where the position of the camera is the same as the shooting position of the reference image, the camera can be enabled for shooting, and a photo or video with the same shooting position as the reference image can be obtained.

[0051] The same-camera shooting method provided in the embodiment of the present application can be applied to electronic devices including cameras and display screens. The electronic device can be a mobile phone, a camera, a gimbal, a drone, a wearable device, a tablet computer (Pad), a virtual reality (VR) device, an augmented reality (AR) device, a wireless terminal in industrial control, a wireless terminal in self-driving, a wireless terminal in remote medical surgery, a wireless terminal in smart grid, a wireless terminal in transportation safety, a wireless terminal in smart city, a wireless terminal in smart home, etc. The embodiment of the present application does not limit the specific technology and specific device form adopted by the electronic device.

[0052] In order to better understand the embodiments of the present application, the following takes the electronic device as a mobile phone as an example. Figure 1 The structure of the electronic device 100 according to the embodiment of the present application is introduced.

[0053] 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, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.

[0054] It is to 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 in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0055] 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 processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0056] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.

[0057] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0058] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. While the charging management module 140 is charging the battery 142, it may also power the electronic device through the power management module 141.

[0059] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.

[0060] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0061] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc.

[0062] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and filters it, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0063] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, so that electronic device 100 can communicate with the network and other devices through wireless communication technology.

[0064] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

[0065] The display screen 194 is used to display images, display videos, and receive sliding operations, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light emitting diode or an active-matrix organic light emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include one or more display screens 194.

[0066] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.

[0067] The ISP is used to process the data fed back by the camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the image sensor of the camera through the lens. The light signal is converted into an electrical signal, and the image sensor of the camera transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. The ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. The ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP can be set in the camera 193.

[0068] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the image sensor. The image sensor can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The image sensor converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include one or more cameras 193.

[0069] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.

[0070] The internal memory 121 can be used to store computer executable program codes, and the executable program codes include instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. 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 disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the electronic device 100 by running instructions stored in the internal memory 121 and / or instructions stored in a memory provided in the processor.

[0071] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0072] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100.

[0073] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. Indicator 192 can be an indicator light, which can be used to indicate charging status, power changes, messages, missed calls, notifications, etc.

[0074] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to or disconnected from the electronic device 100 by inserting the SIM card interface 195 or removing the SIM card from the SIM card interface 195 .

[0075] It is to 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 in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0076] For example, a "module" may be a software program, a hardware circuit, or a combination of the two that implements the above functions. The hardware circuit may include an application specific integrated circuit (ASIC), an electronic circuit, a processor (such as a shared processor, a dedicated processor, or a group processor, etc.) and a memory for executing one or more software or firmware programs, a combined logic circuit, and / or other suitable components that support the described functions.

[0077] Therefore, the modules of each example described in the embodiments of the present application can be implemented with electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present application.

[0078] The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present invention takes the Android system of the layered architecture as an example to illustrate the software structure of the electronic device 100. It should be noted that in the embodiment of the present application, the operating system of the electronic device may include but is not limited to Symbian®, Android®, Windows®, Apple® (iOS), Blackberry®, HarmonyOS and other operating systems, and this application does not make any limitation.

[0079] Figure 2 1 is a software structure block diagram of the electronic device 100 according to an embodiment of the present invention.

[0080] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system library, and the kernel layer.

[0081] The application layer can include a series of application packages.

[0082] like Figure 2 As shown, the application package may include applications such as camera, calendar, map, gallery, video, etc. Among them, the camera application is an application with the function of shooting and recording, and the electronic device can respond to the user's operation of opening the camera application to take pictures or record videos. It is understandable that the camera application's photo and video functions can also be called by other applications. The gallery stores images and videos taken by the electronic device, and can also store images or videos obtained through Bluetooth transmission or other means.

[0083] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.

[0084] like Figure 2 As shown, the application framework layer may include a window manager, a content provider, a notification manager, a view system, a file system, and the like.

[0085] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.

[0086] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0087] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.

[0088] The view system includes visual controls, such as controls that display text, controls that display images, etc. The view system can be used to build applications. A user interface can be composed of one or more views. For example, a user interface that includes a text notification icon can include a view that displays text and a view that displays an image.

[0089] The file system allows applications to read the contents of the file system and display them through the application.

[0090] Android Runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.

[0091] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.

[0092] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.

[0093] The system library may include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), image processing module, etc.

[0094] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.

[0095] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0096] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0097] The image processing module is used to edit images.

[0098] The kernel layer is a layer between hardware and software. The kernel layer at least includes a display driver, a camera driver, etc. In some embodiments, the camera driver is used to control the operation of the camera, and the display driver is used to control the display screen to display images.

[0099] The following specific embodiments are used to describe in detail the technical solution of the present application and how the technical solution of the present application solves the above technical problems. The following specific embodiments can be implemented independently or in combination with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.

[0100] For ease of understanding, the embodiment of the present application uses a mobile phone as an electronic device, and first describes the application scenarios of the same-camera shooting method in combination with some user interfaces shown in the embodiment of the present application.

[0101] As shown in FIG3 (1), when the user turns on the screen of the electronic device and controls the electronic device to be in an unlocked state, the electronic device may display the first interface 301 as shown in (a) of FIG3 (1). The first interface 301 may be the desktop of the electronic device, on which icons of multiple installed applications are displayed, such as a clock application icon, a calendar application icon, a gallery application icon 3012, a memo application icon, a weather application icon, a settings application icon, a music application icon, a calculator application icon, a camera application icon 3011, an address book application icon, a phone application icon, a message application icon, etc.

[0102] The user can perform a touch operation on the camera application icon 3011, and the touch operation can be a click operation, a long press operation, etc., so that the electronic device receives the user's touch operation on the camera application icon 3011, and the electronic device starts the camera application in response to the touch operation.

[0103] After the camera application is started, the electronic device may display the second interface 302 as shown in (b) of FIG3 (1). The second interface 302 may be a preview interface provided by the camera application for implementing the shooting function, which includes function controls corresponding to various shooting parameters (such as setting controls), a preview box 3021, a shooting control 3023, and function controls corresponding to various shooting modes. The shooting control is used to trigger the shooting operation of the electronic device. The function controls corresponding to various shooting modes may include a night scene mode control, a portrait mode control, a photo mode control, a video mode control, a professional mode control, and more controls for opening more functions in the camera application. The photo mode control includes two sub-controls, a normal mode sub-control and a same-camera mode sub-control 3022. The normal mode sub-control corresponds to the normal shooting mode, and the same-camera mode sub-control 3022 corresponds to the same-camera shooting mode.

[0104] The user can perform a touch operation on the same-camera mode subcontrol 3022, so that the electronic device receives the user's touch operation on the same-camera mode subcontrol 3022. In response to the touch operation, the electronic device can display the third interface 303 as shown in (c) of Figure 3 (1). The third interface 303 is an interface provided by the gallery application. The user can perform a touch operation on the image of the gallery application on the third interface 303, so that after the electronic device receives the user's touch operation on the image, it determines that the image selected by the user is the reference image. Afterwards, the gallery application can display the selected reference image, such as the fourth interface 304 shown in (d) of Figure 3 (1). At this time, the user can select at least three identification points in the reference image. If the electronic device detects a touch operation on the reference image, it determines at least three identification points in the reference image in response to the touch operation. After that, the fifth interface 305 as shown in (e) of FIG. 3 (2) is entered. The fifth interface 305 is a preview interface of the same camera position mode. The fifth interface 305 is substantially the same as the second interface 302, except that a floating window 3051 is displayed in the fifth interface 305. The floating window 3051 displays a reference image selected by the user and at least three identification points. The electronic device displays the reference image with at least three identification points in the form of a floating window 3051 on the preview interface 3052 of the camera, so that the user can select the alignment points by comparing the identification points in the reference image.

[0105] The user can touch the floating window 3051, and the electronic device will display the reference image in full screen in response to the touch operation, so that the user can observe the positions of at least three identification points. The user can also return to the floating window 3051 display by touching the reference image displayed in full screen.

[0106] It is worth noting that the preview screen 3021 in the second interface 302 shown in (b) of Figure 3 (1) and the preview screen 3052 in the fifth interface 305 shown in (e) of Figure 3 (2) show the projection of the scene at which the camera of the electronic device is pointed on the camera imaging plane. (b) of Figure 3 (1) and (e) of Figure 3 (2) are not shown. The scene at which the camera of the electronic device is pointed can be a three-dimensional scene corresponding to the reference image or other scenes, which is not limited in this embodiment.

[0107] After the user selects the reference image and determines at least three identification points, the camera of the mobile electronic device displays the three-dimensional scene corresponding to the reference image in the preview interface. At this time, the sixth interface 306 shown in (f) of FIG. 3 (2) is entered. At this time, the preview interface 3061 of the camera application displays the first preview screen. The first preview screen corresponds to the same three-dimensional scene as the reference image. The user can manually touch and select at least three alignment points for the first preview screen. The at least three identification points correspond to the at least three alignment points one by one. The corresponding identification points and the alignment points correspond to the same points in the world coordinate system. At this time, the electronic device determines the six-degree-of-freedom parameters of the transformation from the projection plane determined by the at least three alignment points to the projection plane determined by the at least three identification points based on the coordinates of the at least three identification points and the coordinates of the at least three alignment points, and displays the six-degree-of-freedom parameters on the first preview screen. As shown in (f) of FIG. 3 (2), the six-degree-of-freedom parameters in the first preview screen include the pitch angle θ, the yaw angle δ and the roll angle , forward distance p, lateral distance q and height h.

[0108] It is worth noting that after the user selects at least three alignment points, the electronic device can collapse the reference image in the form of label 3062 and display it on the border of the preview interface without affecting the display of the six-degree-of-freedom parameters.

[0109] At this time, the user can move the position of the electronic device according to the prompt of the six-degree-of-freedom parameters on the first preview interface to change the position of the camera of the electronic device. At this time, the seventh interface shown as (g) in Figure 3 (2) is entered, and the electronic device can obtain a second preview screen. The second preview screen is displayed in the preview interface 3071 of the camera application. The second preview screen is the preview screen corresponding to the change of the camera position. At this time, at least three alignment points can be re-determined in the second preview screen, and the six-degree-of-freedom parameters can be re-determined based on the coordinates of the at least three identification points and the coordinates of the at least three re-determined alignment points. At this time, the re-determined six-degree-of-freedom parameters are displayed in the second preview screen.

[0110] It is worth noting that the electronic device can fold the reference image in the form of a label 3073 and display it on the border of the preview interface 3071, which does not affect the display of the six-degree-of-freedom parameters.

[0111] When the electronic device determines that the camera position is the same as the shooting position of the reference image based on the re-determined six-degree-of-freedom parameters, the six-degree-of-freedom parameters may not be displayed, and the user may be prompted to shoot in the preview interface 3071. At this time, the position of the electronic device is the same as the shooting position of the reference image. The user clicks the shooting control 3072 to shoot. At this time, the photo or video taken by the electronic device has the same shooting position as the reference image, that is, the electronic device has achieved same-position shooting.

[0112] It is worth noting that the scenarios in the above examples are only illustrative and can also be applied to other scenarios, which will not be described in detail in this embodiment.

[0113] For example, Figure 4 This is a flowchart of a same-camera shooting method provided in an embodiment of the present application, which can be applied to electronic devices. Figure 4 As shown, the same-camera shooting method in the embodiment of the present application may include the following steps:

[0114] S410: Determine at least three identification points based on a reference image captured in advance.

[0115] As shown in FIG3 (1), when the camera is activated, the user can select a photo in the gallery application of the electronic device as a reference image. The reference image can be an image pre-captured by the camera of the electronic device, or an image captured by other electronic devices obtained by the electronic device through wired or wireless means.

[0116] The shooting position of the reference image is the "same camera position" sought in this embodiment. Two implementation methods for determining at least three identification points in the reference image are given below:

[0117] In one implementation, a binarization process is performed based on a reference image captured in advance to obtain a binarized image; in each sub-region of the three regions preset in the binarized image, all pixel points of the sub-region are traversed with a preset size, and the pixel region with the largest difference in grayscale value with the adjacent pixel region is used as the identification point of the sub-region, and the size of the pixel region is the same as the preset size.

[0118] First, if the reference image is a color image, it is necessary to convert the reference image into a grayscale image, and perform binarization on the grayscale image to obtain a binary image corresponding to the reference image. After that, the electronic device divides the binary image into N regions, where N is an integer greater than or equal to 3. After that, in each sub-region of the three preset regions in the N regions, all pixel points of the sub-region are traversed with a preset size, and the pixel region with the largest difference in grayscale value with the adjacent pixel region is used as the identification point of the sub-region. Figure 5 As shown, N can be 9, the electronic device divides the binary image into 9 equal parts, and determines three identification points k0, m0 and n0 in the preset three areas 1, 3 and 6. The preset size can be w*l, which can be set as needed. The values ​​of w and l must meet the size that the user can directly and clearly observe. The pixel area in the preset sub-area with the largest difference in grayscale value with the adjacent pixel area is the area where the identification point of the sub-area is located.

[0119] It is worth noting that since the two-dimensional plane of the three-dimensional scene on the imaging plane of the electronic device needs to be determined based on at least three identification points, at least three identification points are not on the same straight line. In order to calculate the accuracy of the result, the identification points should be determined as close to the corner of the reference image as possible.

[0120] In another implementation, when the camera is started, if the fourth operation is detected, in response to the fourth operation, at least three identification points are determined in the reference image captured in advance, and the fourth operation is used to determine at least three identification points in the reference image.

[0121] As shown in Figures 3 (1) and 3 (2), if the camera application interface detects a user's touch operation on the same camera position mode control, and then enters the display interface of the gallery application, after the user selects a reference image in the gallery application, the gallery application can display the selected reference image. At this time, the user can select at least three identification points in the reference image. If the electronic device detects a fourth operation, the fourth operation is used to determine at least three identification points in the reference image. In response to the fourth operation, at least three identification points are determined in the reference image. After the fourth operation is completed, the electronic device can display the reference image with at least three identification points in the form of a floating window on the camera's preview interface, so that the user can select the reference points by comparing the identification points in the reference image.

[0122] The user can touch the floating window, and the electronic device will display the reference image in full screen in response to the touch operation, so that the user can observe the positions of at least three identification points. The user can also return to the floating window display by touching the reference image displayed in full screen.

[0123] In this embodiment, after determining at least three identification points in the reference image, the user can move the camera so that the camera can capture the objects corresponding to the three identification points in the picture. As shown in FIG3 (1) and FIG3 (2), the objects corresponding to the at least three identification points are two houses and a tree. Then, when the user moves the electronic device, the camera needs to capture the two houses and the tree in the picture so that the reference image and the first preview picture captured by the camera correspond to the same scene, thereby completing the rough positioning.

[0124] S420: Determine at least three alignment points corresponding to at least three identification points in the first preview image acquired by the camera.

[0125] After completing the rough positioning, the electronic device obtains the first preview screen. At this time, it is necessary to determine at least three alignment points corresponding to at least three identification points in the first preview screen. The at least three identification points correspond one-to-one to the at least three alignment points, and the corresponding identification points and alignment points correspond to the same points in the world coordinate system.

[0126] Exemplarily, when the third operation is detected, in response to the third operation, at least three alignment points in the first preview screen acquired by the camera corresponding to the at least three identification points are determined, and the third operation is used to select at least three alignment points in the first preview screen. A floating window is also displayed on the first preview screen, and a reference image and at least three identification points are displayed in the floating window.

[0127] As shown in FIG3 (1) and FIG3 (2), a floating window is displayed in the fourth interface, and the reference image and three identification points selected by the user are displayed in the floating window. The first preview screen in the fourth interface corresponds to the same scene as the reference image, and the user can manually touch and select the alignment point on the first preview screen. The electronic device detects a third operation, and the third operation is used to select at least three alignment points in the first preview screen. At this time, in response to the third operation, the electronic device determines three alignment points in the first preview screen that correspond one to one with the three identification points.

[0128] S430, determining six degrees of freedom parameters of a transformation from a projection plane determined by at least three alignment points to a projection plane determined by at least three identification points based on the coordinates of at least three identification points and the coordinates of at least three alignment points.

[0129] When shooting a 3D scene, the resulting photo is actually a 2D projection of the 3D scene on the camera image sensor, that is, a 2D projection on the camera coordinate system. Changing the position of the camera is called transforming the camera coordinate system, which will also change the 2D projection of the 3D scene on the camera coordinate system. To ensure the same camera position, it is necessary to adjust the camera coordinate system so that the 2D projection of the 3D scene on the camera coordinate system is the same as the 2D projection in the reference image.

[0130] like Figure 6 As shown, assuming that G is a three-dimensional scene, the shooting position of the reference image is the camera coordinate system XYZ, and the reference image is a projection on the XY plane, that is, g; and in the actual shooting process, the camera position is the camera coordinate system X`Y`Z`, and the three-dimensional scene obtained by the camera is a projection on the X`Y plane, that is, g`. If the same camera position is to be ensured, g and g` must be made the same, then a coordinate system transformation is required to transform X`Y`Z` into XYZ. Corresponding to this embodiment, a coordinate system transformation is required to transform the projection plane determined by at least three alignment points into a projection plane determined by at least three identification points.

[0131] Exemplarily, at least three identification points include a first identification point, a second identification point and a third identification point, the first identification point and the second identification point form a first vector, and the second identification point and the third identification point form a second vector; at least three alignment points include a first alignment point, a second alignment point and a third alignment point, the first alignment point and the second alignment point form a third vector, and the second alignment point and the third alignment point form a fourth vector; the first identification point and the second alignment point correspond to the same point in the world coordinate system, the second identification point and the second alignment point correspond to the same point in the world coordinate system, and the third identification point and the third alignment point correspond to the same point in the world coordinate system; according to the coordinates of the at least three identification points and the coordinates of the at least three alignment points, determine the projection determined from the at least three alignment points. The six-degree-of-freedom parameters of a plane transformed to a projection plane determined by at least three identification points include: determining a first vector and a second vector according to the coordinates of at least three identification points, the starting point of the first vector corresponds to the first identification point, the end point of the first vector corresponds to the second identification point, the starting point of the second vector corresponds to the second identification point, and the end point of the second vector corresponds to the third identification point; determining a third vector and a fourth vector according to the coordinates of at least three alignment points, the starting point of the third vector corresponds to the first alignment point, the end point of the third vector corresponds to the second alignment point, the starting point of the fourth vector corresponds to the second alignment point, and the end point of the fourth vector corresponds to the third alignment point; determining the six-degree-of-freedom parameters of the projection plane transformed from the third vector and the fourth vector to the projection plane determined by the first vector and the second vector.

[0132] like Figure 7 As shown, the three marking points include a first marking point k0, a second marking point n0 and a third marking point m0. The three marking points k0, n0 and m0 are coplanar. The first marking point k0 and the second marking point n0 form a first vector , the first vector The starting point corresponds to the first identification point k0, and the first vector The end point of corresponds to the second identification point n0. The second identification point n0 and the third identification point m0 ​​form a second vector , the second vector The starting point corresponds to the second identification point n0, and the second vector The end point of corresponds to the third mark point m0. The first vector and the second vector The identification surface S0 can be determined.

[0133] like Figure 8 As shown, the three alignment points in the first preview screen include a first alignment point k1, a second alignment point n1 and a third alignment point m1. The first alignment point k1 and the second alignment point n1 form a third vector , the third vector The starting point corresponds to the first pair of points k1, and the third vector The end point of corresponds to the second pair of points n1. The fourth vector The starting point corresponds to the second pair of points n1, and the fourth vector The end point of corresponds to the third pair of points m1. The third vector and the fourth vector The imaging surface S1 can be determined.

[0134] Among them, the first identification point k0 and the first alignment point k1 correspond to the same point in the world coordinate system, the second identification point n0 and the second alignment point n1 correspond to the same point in the world coordinate system, and the third identification point m0 ​​and the third alignment point m1 correspond to the same point in the world coordinate system.

[0135] To ensure the same camera position, the camera coordinate system needs to be adjusted so that the shooting surface S1 is the same as the identification surface S0. At this time, the camera coordinate system X1Y1Z1 of the shooting surface S1 is the same as the camera coordinate system X0Y0Z0 of the identification surface S0.

[0136] Therefore, in this embodiment, the six degrees of freedom parameters of the shooting surface S1 transformed to the logo surface S0 can be obtained by determining the rotation and translation matrix of the shooting surface S1 transformed to the logo surface S0. When the six degrees of freedom parameters are all 0, that is, when no rotation and translation are required, it can be determined that the shooting surface S1 is exactly the same as the logo surface S0. At this time, the camera position is exactly the same as the shooting position of the reference image.

[0137] In this embodiment, the specific steps of calculating the six-degree-of-freedom parameters of the transformation from the shooting surface S1 to the marking surface S0 are as follows:

[0138] First, the rotation and translation matrix for transforming from the imaging plane S1 to the identification plane S0 is as follows.

[0139] The rotation matrix R can be expressed as follows:

[0140]

[0141] Where Rx is the rotation matrix around the x-axis, where the angle γ is the pitch angle, and Rx is shown in the following equation (2).

[0142]

[0143] Where Ry is the rotation matrix around the y-axis, where angle α is the roll angle, and Ry is shown in the following formula (3).

[0144]

[0145] Where Rz is the rotation matrix around the z-axis, where angle β is the yaw angle, and Rz is shown in the following equation (4).

[0146]

[0147] The translation matrix T can be expressed as follows:

[0148]

[0149] Among them, Tx is the translation matrix along the x-axis, where the distance t x That is, the lateral displacement distance, Tx, is shown in the following formula (6).

[0150]

[0151] Among them, Ty is the translation matrix along the y-axis, where the distance t y That is, the forward distance, Ty is expressed as follows (7).

[0152]

[0153] Among them, Tz is the translation matrix along the z axis, where the distance t z That is, the height, Tz is as shown in the following formula (8).

[0154]

[0155] Writing the rotation matrix R and the translation matrix T together, the rotation and translation matrix can be represented by the homogeneous matrix K, as shown in the following equation (9).

[0156]

[0157] Then, the homogeneous matrix K can be used to represent the third vector in the shooting plane S1: The first vector transformed to the identification plane S0 The process is shown in the following formula (10).

[0158]

[0159] Similarly, the homogeneous matrix K can also be used to represent the fourth vector in the shooting plane S1: The second vector transformed to the identification plane S0 The process is shown in the following formula (11).

[0160]

[0161] If the third vector Expressed as (x 11 ,y 11 , z 11 , 1), the first vector Expressed as (x 01 ,y 01 , z 01 , 1) indicates , substituting into the above formula (10), we can get the three sets of equations shown in the following formula (12).

[0162]

[0163] Similarly, if the fourth vector Expressed as (x 12 ,y 12 , z 12 , 1), the second vector Expressed as (x 02 ,y 02 , z 02 , 1), substituting into the above formula (11), we can get three sets of equations as shown in the following formula (13).

[0164]

[0165] Solving the six six-variable equations of formula (12) and formula (13) simultaneously, we can get six solutions, namely, pitch angle γ, yaw angle α, roll angle β, lateral displacement distance t x , Advance distance t y , height t z , the six degrees of freedom parameters can be obtained.

[0166] S440, determining whether the camera position is the same as the shooting position of the reference image according to the six degrees of freedom parameters. If they are not the same, executing step S450; if they are the same, executing step S490.

[0167] The above six degrees of freedom parameters are unitless values. Therefore, it is necessary to multiply the above six degrees of freedom parameters by the actual unit coefficient of the camera to obtain the six degrees of freedom parameters with units: pitch angle θ, yaw angle δ and roll angle , forward distance p, lateral distance q and height h, the above six-degree-of-freedom parameters with units are displayed on the first preview interface to guide the user to adjust the camera position, see Figure 3 (2).

[0168] In combination with the above, it can be known that when the six degrees of freedom parameters are all 0, that is, when no rotation or translation is required, it can be determined that the shooting surface S1 is exactly the same as the identification surface S0. At this time, the position of the camera is exactly the same as the shooting position of the reference image. However, in actual applications, the user may not be able to accurately move the position of the electronic device so that the six degrees of freedom parameters are all 0. Therefore, in this embodiment, a preset threshold value can be set for the six degrees of freedom parameters. When the six degrees of freedom parameters are less than the preset threshold value, it is considered that the position of the camera is the same as the shooting position of the reference image. Therefore, in this embodiment, it can be determined whether the position of the camera is the same as the shooting position of the reference image by judging whether the six degrees of freedom parameters are less than the preset threshold value. When the position of the camera is different from the shooting position of the reference image, step S450 is executed; when the position of the camera is the same as the shooting position of the reference image, step S490 is executed.

[0169] S450, prompting the user to move the camera or move the camera position.

[0170] In this embodiment, when the position of the camera is different from the shooting position of the reference image, if the electronic device cannot realize autonomous camera movement, such as a mobile phone, VR device, etc., the user can be prompted to move the camera in the first preview interface. Specifically, the six-degree-of-freedom parameters with units can be displayed in the first preview screen, and the user can adjust the camera position with reference to the six-degree-of-freedom parameters. If the electronic device can realize autonomous camera movement, such as a pan-tilt device, the electronic device can control the camera movement according to the six-degree-of-freedom parameters to adjust the camera position.

[0171] S460: Detect that the camera position has changed, and obtain a second preview image.

[0172] Exemplarily, in this embodiment, whether the position of the camera has changed may be determined by detecting whether the camera has moved or detecting whether the first preview image acquired by the camera has changed.

[0173] If the electronic device cannot realize autonomous camera movement, it can determine whether the camera position has changed by detecting whether the first preview image of the camera has changed; if the electronic device can realize autonomous camera movement, it can directly detect whether the camera has moved to determine whether the camera position has changed. If it is detected that the camera position has changed, a second preview image is obtained, and the second preview image is the preview image corresponding to the camera position change.

[0174] S470: Re-determine at least three alignment points in the second preview image.

[0175] Since the camera position changes, the second preview image is different from the first preview image, and the positions of at least three alignment points in the second preview image also change accordingly, so it is necessary to redefine at least three alignment points in the second preview image. Two implementation methods for redefining at least three alignment points in the second preview image are given below.

[0176] In one implementation, redetermining at least three alignment points in the second preview screen includes: when a second operation is detected, responding to the second operation, redetermining at least three alignment points in the second preview screen, the second operation being used to select at least three alignment points in the second preview screen.

[0177] As shown in Figures 3 (1) and 3 (2), the user can manually select an alignment point in the second preview screen. After the electronic device receives the second operation of the user in the second preview screen, the second operation is used to select at least three alignment points in the second preview screen. In response to the second operation, the electronic device redefines at least three alignment points in the second preview screen, and the positions of the at least three alignment points are the same as the touch positions of the user in the second preview screen. In this implementation, manual redefinition of at least three alignment points in the second preview screen is achieved.

[0178] In another implementation, after determining at least three alignment points corresponding to at least three identification points in the first preview screen acquired by the camera, it also includes: identifying image features corresponding to the at least three alignment points in the first preview screen, and establishing a mapping relationship between the at least three alignment points and the image features; redetermining at least three alignment points in the second preview screen, including: identifying the coordinates of the image features in the second preview screen; and redetermining at least three alignment points in the second preview screen based on the coordinates of the image features and the mapping relationship.

[0179] In this embodiment, after determining at least three alignment points corresponding to at least three identification points in the first preview image acquired by the camera, the electronic device identifies the image features corresponding to the at least three alignment points in the first preview image. The image features corresponding to the alignment points can be image features of the pixel area covered by the alignment points, or image features within a preset area to which the pixel area covered by the alignment points belongs. Here, the preset area includes the pixel area covered by the alignment points. Figure 6As shown, the image feature corresponding to the first alignment point k0 is a part of the roof of the house, and the image feature corresponding to the second alignment point n0 is a part of the trunk. The electronic device extracts the image features corresponding to the at least three alignment points in the first preview screen, and establishes a mapping relationship between the at least three alignment points and the image features. In this way, the electronic device can identify the coordinates of the image features in the second preview screen, and re-determine the at least three alignment points in the second preview screen according to the coordinates of the image features and the mapping relationship, that is, the electronic device automatically determines the at least three alignment points in the second preview screen without the need for the user to manually select.

[0180] It is worth noting that, since the image feature covers multiple pixels, the image feature corresponds to multiple coordinates. In this embodiment, the coordinates of the center position of the image feature can be determined as the coordinates of the alignment point corresponding to the image feature. Similarly, the pixel area corresponding to the identification point also includes multiple pixels, and the center point of the pixel area can be selected as the coordinate of the identification point.

[0181] It is feasible that after redetermining at least three alignment points in the second preview screen, the method further includes: determining whether the at least three redetermined alignment points have drifted relative to the image features, and in the case where the at least three alignment points have drifted relative to the image features, at least one alignment point cannot cover the image features; if it is determined to be negative, then executing the step of redetermining the six-degree-of-freedom parameters based on the coordinates of the at least three identification points and the coordinates of the at least three redetermined alignment points, until the position of the camera is determined to be the same as the shooting position of the reference image according to the redetermined six-degree-of-freedom parameters; if it is determined to be positive, then prompting the user that the alignment point has drifted, and in the case where the first operation is detected, in response to the first operation, redetermining at least three alignment points in the second preview screen, the first operation being used to select at least three alignment points in the second preview screen, and then returning to execute the step of determining whether the at least three redetermined alignment points have drifted relative to the image features.

[0182] After the electronic device re-determines at least three alignment points in the second preview screen, there may be an inaccurate alignment situation, that is, whether the at least three alignment points re-determined have drifted relative to the image feature. In the case that the at least three alignment points re-determined have drifted relative to the image feature, at least one alignment point cannot cover the image feature. Here, the image feature corresponding to the alignment point can be the image feature of the pixel area covered by the alignment point. If the at least three alignment points re-determined have not drifted relative to the image feature, the step of re-determining the six-degree-of-freedom parameters based on the coordinates of the at least three identification points and the coordinates of the at least three alignment points re-determined is performed until the camera position is determined to be the same as the shooting position of the reference image according to the re-determined six-degree-of-freedom parameters. If the at least three alignment points re-determined have drifted relative to the image feature, the user is prompted that the alignment points have drifted, and when a first operation of manually selecting an alignment point in the second preview screen is detected, the electronic device responds to the first operation, re-determines at least three alignment points in the second preview screen, and the first operation is used to select at least three alignment points in the second preview screen, and then returns to the step of determining whether the at least three alignment points re-determined have drifted relative to the image feature. In this embodiment, after the electronic device redetermines at least three alignment points in the second preview screen, it determines whether the positions of the at least three redetermined alignment points are accurate by determining whether the at least three redetermined alignment points drift relative to the image features. If it is determined that the positions of the at least three redetermined alignment points are not accurate, the user is prompted to manually select the alignment points, thereby improving the accuracy of the selection of the alignment points.

[0183] S480, re-determine the six-degree-of-freedom parameters based on the coordinates of at least three identification points and the re-determined coordinates of at least three alignment points.

[0184] This step S480 is substantially the same as the above step S430 and will not be described again herein.

[0185] After executing step S480, the process returns to executing step S440, and determines whether the camera position is the same as the shooting position of the reference image according to the re-determined six-degree-of-freedom parameters.

[0186] If the camera position is determined to be different from the shooting position of the reference image according to the re-determined six-degree-of-freedom parameters, continue to execute steps S450 to S480 until the camera position is determined to be the same as the shooting position of the reference image according to the re-determined six-degree-of-freedom parameters.

[0187] For example, if the position of the camera is determined to be different from the shooting position of the reference image according to the re-determined six-degree-of-freedom parameters, the re-determined six-degree-of-freedom parameters can be displayed in the second preview screen to prompt the user to move the electronic device to change the position of the camera. Of course, if the electronic device can achieve autonomous movement, such as a pan-tilt device, it is not necessary to display the re-determined six-degree-of-freedom parameters in the second preview screen, and the electronic device can directly control the movement of the camera according to the six-degree-of-freedom parameters to change the position of the camera.

[0188] S490, enable the camera to shoot.

[0189] When the position of the camera is the same as the shooting position of the reference image, the photo or video obtained by enabling the camera to shoot has the same shooting position as the reference image.

[0190] In an embodiment of the present application, first, at least three identification points on a reference image obtained by pre-shooting and at least three alignment points in a first preview image obtained by a camera corresponding to the at least three identification points are determined, and the reference image and the first preview image correspond to the same scene; secondly, the six degrees of freedom parameters of the projection plane determined by the at least three alignment points are determined to be transformed to the projection plane determined by the at least three identification points. Since the image obtained by the electronic device after shooting a three-dimensional scene is a two-dimensional projection of the three-dimensional scene on the image sensor, if the two-dimensional projections of the same three-dimensional scene in the two images are the same, the shooting positions of the two images are the same, that is, when the projection plane determined by the at least three alignment points is the same as the projection plane determined by the at least three identification points, the shooting positions of the two images are the same. Therefore, it can be determined whether the camera position is the same as the shooting position of the reference image by checking whether the six degrees of freedom parameters of the projection plane determined by the at least three alignment points to the projection plane determined by the at least three identification points are close to 0. In the case where the position of the camera is different from the shooting position of the reference image, if it is detected that the position of the camera has changed, a second preview screen is obtained, and the six-degree-of-freedom parameters are re-determined according to at least three identification points of the reference image and at least three alignment points re-determined in the second preview screen, until the position of the camera is determined to be the same as the shooting position of the reference image according to the re-determined six-degree-of-freedom parameters. In this embodiment, the position of the camera can be adjusted to be the same as the shooting position of the reference image by the method in this embodiment only according to the preview screen of the camera corresponding to the three-dimensional scene and the reference image. The method is simple, does not require external equipment, and has low cost. In the case where the position of the camera is the same as the shooting position of the reference image, the camera can be enabled for shooting, and a photo or video with the same shooting position as the reference image can be obtained.

[0191] Combined with the above Figures 1 to 8, the same-camera shooting method provided in the embodiment of the present application is described, and the device for executing the above method provided in the embodiment of the present application is described below. Fig. 9 As shown, Fig. 9 The schematic diagram of the structure of a device 910 for shooting from the same camera position provided in an embodiment of the present application. The device 910 for shooting from the same camera position may be an electronic device in an embodiment of the present application, or a chip or chip system in an electronic device.

[0192] like Fig. 9 As shown, the same-camera shooting device 910 may include: a camera unit 9101, a display unit 9102, and a processing unit 9103. The camera unit 9101 is used to support the same-camera shooting device 910 to perform the above steps of obtaining the first preview image and the second preview image, the display unit 9102 is used to support the same-camera shooting device 910 to perform the above display steps, and the processing unit 9103 is used to support the same-camera shooting device 910 to perform the above processing steps.

[0193] Specifically, when the camera is activated, the processing unit 9103 determines at least three identification points in the reference image based on the acquired reference image, and the at least three identification points are not on the same straight line. The display unit 9102 can display the acquired reference image and the at least three identification points in the reference image.

[0194] The camera unit 9101 is used to obtain a first preview image, and the display unit 9102 displays the first preview image. The processing unit 9103 is used to determine at least three alignment points corresponding to at least three identification points in the first preview image obtained by the camera, the at least three identification points correspond to the at least three alignment points one by one, the corresponding identification points and alignment points correspond to the same point in the world coordinate system, and the first preview image and the reference image correspond to the same scene; according to the coordinates of the at least three identification points and the coordinates of the at least three alignment points, determine the six-degree-of-freedom parameters of the projection plane determined by the at least three alignment points to the projection plane determined by the at least three identification points; according to the six-degree-of-freedom parameters, determine whether the camera position is the same as the shooting position of the reference image.

[0195] The processing unit 9103 is also used for, when the camera position is different from the shooting position of the reference image, if the camera position is detected to have changed, the camera unit 9101 obtains a second preview screen, and the second preview screen is a preview screen corresponding to the camera position change. The processing unit 9103 is used to redetermine at least three alignment points in the second preview screen, and redetermine the six-degree-of-freedom parameters based on the coordinates of the at least three identification points and the coordinates of the redetermined at least three alignment points, until it is determined that the camera position is the same as the shooting position of the reference image according to the redetermined six-degree-of-freedom parameters.

[0196] The display unit 9102 is also used to display the six-degree-of-freedom parameters in the first preview screen when the camera position is different from the shooting position of the reference image, so that the user can move the electronic device to change the camera position.

[0197] The processing unit 9103 is further configured to enable the camera to shoot when the camera position is the same as the shooting position of the reference image.

[0198] In a possible implementation, the same-camera shooting device 910 further includes a storage unit 9104. The storage unit 9104 is connected to the processing unit 9103 via a line. The storage unit 9104 may include one or more memories, and the memory may be a device used to store programs or data in one or more devices or circuits. The storage unit 9104 may exist independently and be connected to the processing unit 9103 via a communication bus. The storage unit 9104 may also be integrated with the processing unit 9103.

[0199] The storage unit 9104 can store computer-executable instructions of the method in the electronic device so that the processing unit 9103 executes the method in the above embodiment. The storage unit 9104 can be a register, a cache, or a random access memory (RAM), etc. The storage unit 9104 can be integrated with the processing unit 9103. The storage unit 9104 can be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, and the storage unit 9104 can be independent of the processing unit 9103.

[0200] Fig.10 FIG. 1 is a schematic diagram of the structure of a chip 1010 provided in an embodiment of the present application. Fig.10 As shown, the chip 1010 includes one or more (including two) processors 1011 , a communication line 1012 and a communication interface 1013 . Optionally, the chip 1010 also includes a memory 1014 .

[0201] In some implementations, the memory 1014 stores the following elements: executable modules or data structures, or a subset thereof, or an extended set thereof.

[0202] The method described in the above embodiment of the present application can be applied to the processor 1011, or implemented by the processor 1011. The processor 1011 may be an integrated circuit chip 1010, which has the ability to process signals. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor 1011 or an instruction in the form of software. The above processor 1011 can be a general processor 1011 (for example, a microprocessor 1011 or a conventional processor 1011), a digital signal processor 1011, an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates, transistor logic devices or discrete hardware components. The processor 10111301 can implement or execute the disclosed methods, steps and logic block diagrams in the embodiments of the present application.

[0203] The steps of the method disclosed in the embodiment of the present application can be directly embodied as being executed by the hardware decoding processor 1011, or being executed by a combination of hardware and software modules in the decoding processor 1011. Among them, the software module can be located in a mature storage medium in the field such as a random access memory 1014, a read-only memory 1014, a programmable read-only memory 1014, or an electrically erasable programmable read only memory 1014 (EEPROM). The storage medium is located in the memory 10142204, and the processor 1011 reads the information in the memory 1014 and completes the steps of the above method in combination with its hardware.

[0204] The processor 1011 , the memory 1014 , and the communication interface 1013 may communicate with each other via the communication line 1012 .

[0205] In the above embodiment, the instructions stored in the memory 1014 for execution by the processor 1011 may be implemented in the form of a computer program product. The computer program product may be pre-written in the memory 1014 or downloaded and installed in the memory 1014 in the form of software.

[0206] The embodiment of the present application also provides a computer program product, which includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server or data center that includes one or more available media integrated. For example, the available medium may include a magnetic medium (e.g., a floppy disk, a hard disk or a tape), an optical medium (e.g., a digital versatile disc (DVD)), or a semiconductor medium (e.g., a solid state disk (SSD)), etc.

[0207] An embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory is used to store a computer program, and the processor is used to execute the computer program to execute the above-mentioned same-camera shooting method.

[0208] The embodiment of the present application provides a chip. The chip includes a processor, and the processor is used to call a computer program in a memory to execute the above-mentioned same-camera shooting method. Its implementation principle and technical effect are similar to those of the above-mentioned related embodiments, and will not be repeated here.

[0209] The embodiments of the present application also provide a computer-readable storage medium. The computer-readable storage medium stores a computer program or instruction. When the computer program or instruction is executed by the processor, the above-mentioned same-camera shooting method is implemented. The method described in the above embodiment can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. If implemented in software, the function can be stored as one or more instructions or codes on a computer-readable medium or transmitted on a computer-readable medium. Computer-readable media may include computer storage media and communication media, and may also include any medium that can transfer a computer program from one place to another. The storage medium may be any target medium that can be accessed by a computer.

[0210] As a possible design, the computer-readable medium may include a compact disc read-only memory (CD-ROM), RAM, ROM, EEPROM or other optical disk storage; the computer-readable medium may include a magnetic disk storage or other magnetic disk storage device. Moreover, any connection line may also be appropriately referred to as a computer-readable medium. For example, if the software is transmitted from a website, server or other remote source using a coaxial cable, fiber optic cable, twisted pair, DSL or wireless technology such as infrared, radio and microwave, the coaxial cable, fiber optic cable, twisted pair, DSL or wireless technology such as infrared, radio and microwave are included in the definition of the medium. Disks and optical disks as used herein include compact disks (CDs), laser disks, optical disks, DVDs, floppy disks and Blu-ray disks, where disks usually reproduce data magnetically, while optical disks reproduce data optically using lasers. Combinations of the above should also be included in the scope of computer-readable media.

[0211] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processing unit of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0212] The above specific implementation methods further illustrate the purpose, technical solutions and beneficial effects of the present application in detail. It should be understood that the above are only specific implementation methods of the present application and are not used to limit the protection scope of the present application. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solutions of the present application should be included in the protection scope of the present application.

Claims

1. A same-camera shooting method, characterized in that: Applied to an electronic device, the electronic device includes a camera and a display screen, and the method includes: Determine at least three identification points according to a reference image captured in advance, wherein the at least three identification points are not on the same straight line; Determine at least three alignment points in a first preview image acquired by the camera that correspond to the at least three identification points, the at least three identification points correspond to the at least three alignment points one-to-one, the corresponding identification points and the alignment points correspond to the same point in the world coordinate system, and the first preview image and the reference image correspond to the same scene; Determine six degrees of freedom parameters for transforming a projection plane determined by the at least three alignment points to a projection plane determined by the at least three identification points according to the coordinates of the at least three identification points and the coordinates of the at least three alignment points; Determining, according to the six-degree-of-freedom parameters, whether the position of the camera is the same as the shooting position of the reference image; In the case where the position of the camera is different from the shooting position of the reference image, if a change in the position of the camera is detected, a second preview picture is obtained, the second preview picture being a preview picture corresponding to the change in the position of the camera, and the at least three alignment points are re-determined in the second preview picture, and the six-degree-of-freedom parameters are re-determined based on the coordinates of the at least three identification points and the coordinates of the at least three alignment points that are re-determined, until it is determined that the position of the camera is the same as the shooting position of the reference image according to the re-determined six-degree-of-freedom parameters; When the position of the camera is the same as the shooting position of the reference image, the camera is enabled for shooting.

2. The same-camera shooting method according to claim 1, characterized in that: The re-determining the at least three alignment points in the second preview picture includes: In the case where a second operation is detected, the at least three alignment points are redetermined in the second preview picture in response to the second operation, and the second operation is used to select the at least three alignment points in the second preview picture.

3. The same-camera shooting method according to claim 1, characterized in that: After determining at least three alignment points corresponding to the at least three identification points in the first preview image acquired by the camera, the method further includes: Identify image features corresponding to the at least three alignment points in the first preview image, and establish a mapping relationship between the at least three alignment points and the image features; The re-determining the at least three alignment points in the second preview picture includes: Identifying the coordinates of the image features in the second preview image; The at least three alignment points are re-determined in the second preview image according to the coordinates of the image features and the mapping relationship.

4. The same-camera shooting method according to claim 3, characterized in that: After re-determining the at least three alignment points in the second preview picture, the method further includes: Determining whether the at least three alignment points that are re-determined drift relative to the image feature, when the at least three alignment points drift relative to the image feature, at least one of the alignment points cannot cover the image feature; If the determination is no, the step of re-determining the six-degree-of-freedom parameters based on the coordinates of the at least three identification points and the re-determined coordinates of the at least three alignment points is performed until it is determined that the position of the camera is the same as the shooting position of the reference image according to the re-determined six-degree-of-freedom parameters; If the judgment is yes, the user is prompted that the alignment point has drifted, and when a first operation is detected, in response to the first operation, the at least three alignment points are redetermined in the second preview screen, the first operation is used to select the at least three alignment points in the second preview screen, and then return to execute the step of determining whether the at least three redetermined alignment points have drifted relative to the image features.

5. The same-camera shooting method according to any one of claims 1 to 4, characterized in that: The at least three identification points include a first identification point, a second identification point and a third identification point, the first identification point and the second identification point form a first vector, the second identification point and the third identification point form a second vector; the at least three alignment points include a first alignment point, a second alignment point and a third alignment point, the first alignment point and the second alignment point form a third vector, the second alignment point and the third alignment point form a fourth vector; the first identification point and the second alignment point correspond to the same point in the world coordinate system, the second identification point and the second alignment point correspond to the same point in the world coordinate system, and the third identification point and the third alignment point correspond to the same point in the world coordinate system; The step of determining six-degree-of-freedom parameters of transforming a projection plane determined by the at least three alignment points to a projection plane determined by the at least three identification points according to the coordinates of the at least three identification points and the coordinates of the at least three alignment points comprises: Determine a first vector and a second vector according to the coordinates of the at least three identification points, wherein the starting point of the first vector corresponds to the first identification point, the end point of the first vector corresponds to the second identification point, the starting point of the second vector corresponds to the second identification point, and the end point of the second vector corresponds to the third identification point; Determine a third vector and a fourth vector according to the coordinates of the at least three alignment points, wherein the starting point of the third vector corresponds to the first alignment point, the end point of the third vector corresponds to the second alignment point, the starting point of the fourth vector corresponds to the second alignment point, and the end point of the fourth vector corresponds to the third alignment point; Determine six degrees of freedom parameters for transforming from a projection plane defined by the third vector and the fourth vector to a projection plane defined by the first vector and the second vector.

6. The same-camera shooting method according to any one of claims 1 to 4, characterized in that: The method further comprises: When the position of the camera is different from the shooting position of the reference image, the six-degree-of-freedom parameters are displayed in the first preview image.

7. The same-camera shooting method according to any one of claims 1 to 4, characterized in that: The method further comprises: The re-determined six-degree-of-freedom parameters are displayed in the second preview screen.

8. The same-camera shooting method according to any one of claims 1 to 4, characterized in that: The determining of at least three alignment points corresponding to the at least three identification points in the first preview image acquired by the camera includes: When a third operation is detected, in response to the third operation, at least three alignment points in the first preview picture acquired by the camera corresponding to the at least three identification points are determined, and the third operation is used to select the at least three alignment points in the first preview picture. A floating window is also displayed on the first preview picture, and the reference image and the at least three identification points are displayed in the floating window.

9. The same-camera shooting method according to any one of claims 1 to 4, characterized in that: The method further comprises: Whether the position of the camera has changed is determined by detecting whether the camera has moved or detecting whether the first preview image or the second preview image acquired by the camera has changed.

10. The same-camera shooting method according to any one of claims 1 to 4, characterized in that: The step of determining at least three identification points based on a reference image captured in advance, wherein the at least three identification points are not on the same straight line, includes: Performing binarization processing based on the reference image captured in advance to obtain a binarized image; In each sub-region of the three regions preset in the binary image, all pixel points of the sub-region are traversed with a preset size, and the pixel region with the largest difference in grayscale value with the adjacent pixel region is used as the identification point of the sub-region, and the size of the pixel region is the same as the preset size.

11. The same-camera shooting method according to any one of claims 1 to 4, characterized in that: The step of determining at least three identification points based on a reference image captured in advance, wherein the at least three identification points are not on the same straight line, includes: When the camera is started, if a fourth operation is detected, in response to the fourth operation, the at least three identification points are determined in the reference image captured in advance, and the fourth operation is used to determine the at least three identification points in the reference image.

12. An electronic device, characterized in that: It includes a camera, a display screen, a processor and a memory, the camera is used to obtain a preview image, the display screen is used to display the preview image, the memory is used to store a computer program that can be run on the processor, and the processor is used to execute the steps of processing in the same-camera shooting method as described in any one of claims 1 to 11.

13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor executes the same-camera shooting method according to any one of claims 1 to 11.

14. A computer program product, characterized in that The computer program product comprises: a computer program code, and when the computer program code is executed by an electronic device, the electronic device executes the same-camera shooting method as claimed in any one of claims 1 to 11.