Image angle switching adjustment method and device, computer equipment and storage medium
By obtaining the camera posture and direction vector of the panoramic camera, calculating the fusion vector, and adjusting the camera posture angle, the image flipping problem of the panoramic camera in critical posture is solved and stable image display is achieved.
Patent Information
- Application Number
- CN202510610023.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-12
- Publication Date
- 2025-09-12
AI Technical Summary
In the pan/tilt shooting mode of a panoramic camera, when the camera posture reaches a critical posture, the image will frequently switch between ±180°, affecting the normal shooting of videos and images.
By obtaining the camera pose of the panoramic camera, determining the pose orientation value of the reference target position, calculating the fusion vector, and combining the preset pose threshold and direction vector, adjusting the camera pose angle to avoid image flipping.
It effectively avoids the 180° flipping of the image at critical postures, ensures the stable display of the captured image, and provides a good visual experience.
Smart Images

Figure CN120640122A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of image processing technology, and in particular to an image angle switching adjustment method, device, computer equipment, and storage medium. Background Art
[0002] When using a panoramic camera to achieve independent control of multiple axes of view (in gimbal mode), the image may suddenly flip 180° when the camera reaches certain critical positions. For example, the two lenses of a panoramic camera are typically mounted one in front of the other, and the camera is initially positioned vertically. When the camera's position is adjusted to horizontal, the positions of the front and rear lenses shift, causing the content captured by the front and rear cameras to swap. This can affect the video capture experience. Furthermore, when the camera is mounted in these critical positions, vibration can cause the image to frequently switch between ±180°, affecting both video and image capture. Summary of the Invention
[0003] Based on this, it is necessary to provide an image angle switching adjustment method, device, computer equipment, and storage medium to address the above technical problems.
[0004] In a first aspect, the present disclosure provides a method for adjusting image angle switching. The method comprises:
[0005] Get the camera posture of the panoramic camera when it is in gimbal shooting mode;
[0006] Determining a reference target position in the panoramic camera, and determining a posture orientation value of the reference target position based on a preset direction vector of each position of the panoramic camera and the camera posture;
[0007] Calculating a fusion vector of the posture orientation value and the direction vector based on the posture orientation value and a preset posture threshold corresponding to the reference target position;
[0008] Calculating a change in the attitude angle of the panoramic camera based on the fusion vector and the direction vectors of each position of the panoramic camera;
[0009] The image displayed in the panoramic camera is adjusted based on the change in the attitude angle of the panoramic camera and the three-axis attitude angle determined when in the pan-tilt shooting mode.
[0010] In one embodiment, the reference target position includes: the front side of the camera and the bottom side of the camera, the preset posture threshold corresponding to the reference target position includes: a first posture threshold corresponding to the front side of the camera and a second posture threshold corresponding to the bottom side of the camera; the calculating the fusion vector of the posture orientation value and the direction vector based on the posture orientation value and the preset posture threshold corresponding to the reference target position includes:
[0011] Determining the lens orientation of the front side of the camera based on the posture orientation value of the front side of the camera and the first posture threshold, and calculating a fusion vector according to the lens orientation of the front side of the camera, the posture orientation value, and the direction vectors of each position of the panoramic camera;
[0012] Based on the posture orientation value of the bottom side of the camera and the second posture threshold, the lens orientation of the bottom side of the camera is determined, and a fusion vector is calculated according to the lens orientation of the bottom side of the camera, the posture orientation value and the direction vector of each position of the panoramic camera.
[0013] In one embodiment, the direction vectors of each position of the panoramic camera include: a front direction vector, a back direction vector, a bottom direction vector, and a top direction vector, and calculating the fusion vector according to the lens orientation of the front side of the camera, the posture orientation value, and the direction vectors of each position of the panoramic camera includes:
[0014] In response to the lens of the front side of the camera being directed upward, calculating a fusion vector based on the posture orientation value, the bottom direction vector, and the camera posture;
[0015] In response to the lens of the front side of the camera being oriented downward, a fusion vector is calculated based on the attitude orientation value, the top direction vector, and the camera attitude.
[0016] In one embodiment, the direction vectors of each position of the panoramic camera include: a front direction vector, a back direction vector, a bottom direction vector, and a top direction vector, and calculating the fusion vector according to the lens orientation of the bottom side of the camera and the direction vectors of each position of the panoramic camera includes:
[0017] In response to the lens of the bottom side of the camera being directed upward, calculating a fusion vector based on the posture orientation value, the front direction vector, and the camera posture;
[0018] In response to the lens orientation of the bottom side of the camera being downward, a fusion vector is calculated based on the attitude orientation value, the back direction vector, and the camera attitude.
[0019] In one embodiment, the direction vectors at each position of the panoramic camera include: a front direction vector, a back direction vector, a bottom direction vector, and a top direction vector; the change in attitude angle includes: a yaw angle change, a pitch angle change, and a roll angle change; and calculating the change in attitude angle of the panoramic camera based on the fusion vector and the direction vectors at each position of the panoramic camera includes:
[0020] Calculating the projection of the fusion vector on the horizontal and vertical planes to obtain a projected fusion vector;
[0021] Calculating a first rotation quaternion from the front direction vector to the projected fusion vector to obtain a yaw angle change;
[0022] Calculating a second rotation quaternion from the projection vector to the projected fusion vector to obtain a pitch angle change;
[0023] A roll angle change is obtained based on the camera posture, the yaw angle change, and the pitch angle change.
[0024] In one embodiment, obtaining the camera posture of the panoramic camera when in the pan-tilt shooting mode includes:
[0025] Determining the camera posture of the panoramic camera at an initial moment and a current moment in a pan-tilt shooting mode;
[0026] Calculating the camera pose angle between the camera poses at the initial moment and the current moment based on the camera poses at the two moments, and adjusting the pose angle based on the pose angle and a preset threshold to obtain a smooth pose angle;
[0027] Determining an intermediate moment in the gimbal shooting mode;
[0028] Based on the intermediate moment, the smoothed attitude angle, the camera attitude at the initial moment and the current moment, a quaternion spherical linear interpolation algorithm is used to determine the camera attitude of the panoramic camera when it is in the pan-tilt shooting mode.
[0029] In a second aspect, the present disclosure further provides an image angle switching and adjustment device. The device comprises:
[0030] The camera attitude acquisition module is used to obtain the camera attitude of the panoramic camera when it is in the pan-tilt shooting mode;
[0031] a posture direction value calculation module, configured to determine a reference target position in the panoramic camera, and determine a posture direction value of the reference target position based on a preset direction vector of each position of the panoramic camera and the camera posture;
[0032] a fusion vector calculation module, configured to calculate a fusion vector of the posture orientation value and the direction vector based on the posture orientation value and a preset posture threshold corresponding to the reference target position;
[0033] a variation calculation module, configured to calculate a variation of the attitude angle of the panoramic camera based on the fusion vector and the direction vectors of each position of the panoramic camera;
[0034] The image adjustment module is used to adjust the image displayed in the panoramic camera based on the change in the attitude angle of the panoramic camera and the three-axis attitude angle determined when in the pan-tilt shooting mode.
[0035] In a third aspect, the present disclosure further provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any of the above method embodiments when executing the computer program.
[0036] In a fourth aspect, the present disclosure further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in any of the above method embodiments.
[0037] In a fifth aspect, the present disclosure further provides a computer program product, which includes a computer program that implements the steps of any of the above method embodiments when executed by a processor.
[0038] In each of the above-described embodiments, by acquiring the camera's posture in real time and combining it with a preset direction vector to determine the orientation value of a reference target position (e.g., the camera center), it is possible to accurately determine whether the camera is in a critical posture. Calculating a fusion vector based on the orientation value and a preset attitude threshold effectively prevents image flipping caused by the critical posture. When the camera's posture approaches the critical posture, the fusion vector comprehensively considers the camera's current posture and preset conditions, and rationally fuses the orientation vectors. When calculating the fusion vector based on the reference target position, an appropriate orientation vector is selected for fusion based on the relationship between the orientation value and the threshold. This allows adjustment of the fusion vector to prevent a 180° image flip when the camera's posture approaches the critical state, ensuring normal display of the captured image. Calculating the attitude angle change using the fusion vector and the orientation vectors at each position, combined with the three-axis attitude angle adjustment in gimbal mode, further stabilizes the image. When image flipping occurs, the calculation of the attitude angle change takes into account the information in the fusion vector, allowing precise adjustment of the camera's pitch, roll, and yaw angles. In different gimbal modes, the attitude angle change is processed based on the specific characteristics of the mode to ensure stable camera posture and, consequently, stable image display. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the specific embodiments of the present disclosure or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the specific embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0040] Figure 1 is a schematic diagram of the camera posture;
[0041] Figure 2 1 is a flow chart of an image angle switching and adjustment method according to an embodiment;
[0042] Figure 3 Schematic diagram of the process of step S106 in one embodiment;
[0043] Figure 4 Schematic diagram of the process of step S202 in one embodiment;
[0044] Figure 5 Schematic diagram of the process of step S204 in one embodiment;
[0045] Figure 6 Schematic diagram of the process of step S108 in one embodiment;
[0046] Figure 7 Schematic diagram of the process of step S102 in one embodiment;
[0047] Figure 8 is a schematic block diagram of the structure of an image angle switching and adjusting device in one embodiment;
[0048] Figure 9 Schematic diagram of the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0049] In order to make the purpose, technical solutions and advantages of the present disclosure more clearly understood, the present disclosure is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present disclosure and are not intended to limit the present disclosure.
[0050] It should be noted that the terms "first," "second," and the like in the specification and claims herein and in the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a particular order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, apparatus, product, or device comprising a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to these processes, methods, products, or devices.
[0051] In this document, the term "and / or" simply describes a relationship between related objects, indicating that three possible relationships exist. For example, "A and / or B" could mean: A exists alone, A and B exist simultaneously, or B exists alone. Furthermore, the character " / " in this document generally indicates an "or" relationship between the related objects.
[0052] As described in the background technology, when the panoramic camera is in the pan-tilt shooting mode, the camera's posture at this time can be as follows: Figure 1 As shown in the initial pose, when the panoramic camera's pose changes and reaches the critical pose, due to the gimbal shooting mode, the image captured by lens A and the field of view of lens B will change to ensure image stability and consistency. To ensure that the image does not change, the image captured by lens A is replaced and alternated with the image captured by lens B. However, when shooting at the critical pose, the camera sometimes shakes, causing the camera to fluctuate between the critical poses. This causes the image presented by the panoramic camera to flip back and forth, affecting normal shooting.
[0053] In one embodiment, Figure 2 As shown, a method for switching and adjusting an image angle is provided. This embodiment uses the method applied to a terminal as an example for illustration, and includes the following steps:
[0054] S102: Obtain the camera posture of the panoramic camera when it is in the pan / tilt shooting mode.
[0055] Among them, the gimbal shooting mode can be a shooting mode of a panoramic camera, including pitch lock, global follow, full lock, follow and other modes. In this mode, the camera posture can achieve a control effect similar to that of a gimbal, and by decoupling and fusing IMU data processing and posture, a stable shooting effect under different shooting requirements can be achieved. The camera posture can be used to describe the position and direction of the camera in space, and in some embodiments of the present disclosure, it can be represented by quaternions. The panoramic camera involved in some embodiments of the present disclosure is a front and rear dual-lens panoramic camera.
[0056] Specifically, after the panoramic camera is powered on and initialized, the panoramic image corresponding to this time is read. And the IMU data aligned with the timestamp of the frame image is obtained, including angular velocity, acceleration and other information. The initial attitude quaternion of the camera is determined in combination with the IMU external parameters (i.e., the rotation quaternion from the IMU to the camera). Using the relationship of the quaternion derivative in the current state, the quaternion is updated by the first-order or second-order Picard method to obtain the camera attitude quaternion at each moment. The obtained camera attitude quaternion is decoupled into three-axis attitude angles, namely pitch angle, roll angle, and yaw angle. According to the specific gimbal shooting mode of the camera (follow, pitch lock, global follow, full lock), the decoupled three-axis attitude angle is processed accordingly. For example, in Follow mode, the roll angle is locked, while the pitch and yaw angles are used as active axes to follow the camera's free rotation. Decoupled RPY (Roll, Pitch, Yaw) is used to update the new camera quaternion by locking the roll angle. In Global Follow mode, the pitch, roll, and yaw angles are all active axes, and the camera pose is a weighted value of the camera pose in that mode and the camera pose in the three-axis image stabilization state. Through these methods, the camera pose that meets the requirements of the gimbal shooting mode is determined.
[0057] S104: Determine a reference target position in the panoramic camera, and determine a posture orientation value of the reference target position according to a preset direction vector of each position of the panoramic camera and the camera posture.
[0058] The reference target position can be understood as the camera center. It marks a specific location in space for the panoramic camera and serves as a key reference point for subsequently determining the pose and orientation value. A direction vector can be a pre-set vector for each position of the panoramic camera, describing the camera's orientation at different locations. These vectors are pre-set based on the camera's physical structure and design, providing basic directional data for determining the pose and orientation of the reference target position. The pose and orientation value can refer to the orientation information of the reference target position under the current camera pose. It combines the camera pose and the pre-set direction vector to quantitatively represent the orientation of the camera at a specific position.
[0059] Specifically, when the panoramic camera system is initialized, the position of the camera center is determined based on the physical structure and design of the camera. This position is usually fixed and serves as an important reference point in subsequent calculations and processing. For example, the front of the camera or the bottom of the camera can be selected as the reference center. The direction vectors of each position can also be pre-set. These direction vectors describe the direction of the camera at different positions relative to a reference coordinate system. For example, the front, back, bottom, top and other positions of the camera will have corresponding direction vectors. Taking the reference target position (camera center) as the reference, the direction vector and the camera attitude are combined to determine the attitude orientation value of the position. For example, if you are concerned about the orientation of the camera center in a specific direction, you can determine its attitude orientation value based on the adjusted corresponding direction vector.
[0060] In some exemplary embodiments, let the camera pose be q c If the reference target position is the front side of the camera, calculate the camera posture in the front direction vector V front The projection under the current camera posture can be used to obtain the orientation value V1=q of the front side of the camera. c V front If the reference target position is the bottom side of the camera, calculate the camera posture in the bottom direction vector V bottom The projection under the camera can be used to obtain the orientation value V2=q of the bottom side of the camera under the current camera posture. c V bottom .
[0061] S106 , calculating a fusion vector of the posture orientation value and the direction vector based on the posture orientation value and a preset posture threshold corresponding to the reference target position.
[0062] The preset attitude thresholds corresponding to the reference target position can be a series of pre-set values for the reference target position, used to define different camera attitude states. These thresholds are determined based on actual shooting requirements and experience. Typically, different reference target positions correspond to different attitude thresholds. The fusion vector can be a vector obtained by fusing the direction vectors, taking into account the attitude heading value and the preset attitude thresholds.
[0063] Specifically, the current camera orientation can be determined based on the attitude heading value and a preset attitude threshold corresponding to the reference target position. Then, based on the camera orientation position, an appropriate direction vector is selected, and a fusion vector is calculated based on the selected direction vector and the attitude heading value.
[0064] S108 , calculating a change in the attitude angle of the panoramic camera based on the fusion vector and the direction vectors of each position of the panoramic camera.
[0065] The change in attitude angle typically refers to the change in the panoramic camera's attitude angle at different times or under different conditions. By calculating the change in attitude angle, we can track the dynamic changes in the camera's attitude in real time and make precise adjustments to the camera's attitude.
[0066] Specifically, the fused vector is projected onto the XZ plane to obtain the projected vector. This step simplifies subsequent calculations by converting a three-dimensional problem into a two-dimensional one. This projection operation extracts the components of the fused vector on the XZ plane, facilitating analysis and calculation of changes related to the attitude angle. The change in attitude angle is calculated using the camera's front direction vector as a reference.
[0067] S110 , adjusting the image displayed in the panoramic camera based on the change in the attitude angle of the panoramic camera and the three-axis attitude angle determined when in the pan-tilt shooting mode.
[0068] The three-axis attitude angles include pitch, roll, and yaw. The image displayed by the panoramic camera is captured by the camera, and its display quality changes with changes in the camera's attitude. Adjustments are made based on the change in attitude angle and the three-axis attitude angles to achieve a stable display that meets shooting requirements, providing users with a good visual experience.
[0069] Specifically, the current three-axis attitude angle is updated according to the change in attitude angle. For example, if the change in yaw angle is a certain value, the change is added to the current yaw angle to obtain the updated yaw angle; similarly, the pitch angle and roll angle are updated accordingly. Then, using the gimbal shooting mode, the corresponding updated three-axis attitude angle is adjusted and converted into a camera attitude quaternion. Because quaternions can more conveniently perform rotation operations in camera attitude calculation and processing. Using the corresponding conversion formula, the Euler angle (i.e., the three-axis attitude angle) is converted into a quaternion form for subsequent image rotation operations. During the gimbal shooting mode, there are some situations where the image display needs to remain unchanged, but at this time the attitude of the panoramic camera is constantly changing, so it is necessary to use the updated three-axis attitude angle to make adjustments to keep the image display unchanged.
[0070] In the above-described image angle switching and adjustment method, real-time camera pose acquisition and combined with preset direction vectors determine the pose orientation value of a reference target position (e.g., camera center), enabling accurate determination of whether the camera is in a critical pose. Calculating a fusion vector based on the pose orientation value and a preset pose threshold effectively prevents image flipping caused by critical poses. When the camera pose approaches the critical pose, the fusion vector comprehensively considers the current camera pose and preset conditions to optimally fuse the direction vectors. When calculating the fusion vector based on the reference target position, an appropriate direction vector is selected for fusion based on the relationship between the pose orientation value and the threshold. This allows adjustment of the fusion vector to prevent 180° image flipping when the camera pose approaches the critical state, ensuring proper image display. The fusion vector and the direction vectors at each position are used to calculate the pose angle change, which is then combined with the three-axis pose angle adjustment in gimbal mode to further stabilize the image. When image flipping occurs, the pose angle change calculation incorporates information from the fusion vector to precisely adjust the camera's pitch, roll, and yaw angles. In different gimbal modes, the pose angle change is processed based on the specific characteristics of the mode to ensure stable camera pose and, consequently, image display.
[0071] In one embodiment, the reference target position includes: the front side of the camera and the bottom side of the camera, and the preset posture threshold corresponding to the reference target position includes: a first posture threshold corresponding to the front side of the camera and a second posture threshold corresponding to the bottom side of the camera; Figure 3 As shown, the step of calculating a fusion vector of the posture orientation value and the direction vector based on the posture orientation value and a preset posture threshold corresponding to the reference target position includes:
[0072] S202: Determine the lens orientation of the front side of the camera based on the posture orientation value of the front side of the camera and the first posture threshold, and calculate a fusion vector according to the lens orientation of the front side of the camera, the posture orientation value, and the direction vectors of each position of the panoramic camera.
[0073] Specifically, the obtained camera front posture orientation value is compared with the first posture threshold value. Assuming that the camera front posture orientation value is V1(1) (where V1(1) is the projection of the camera posture under the front direction vector, (1) represents the first component of the projection vector), if V1(1)>0, it is determined that the camera front lens is facing upward; if V1(1)<0, it is determined that the camera front lens is facing downward. This judgment result will determine the subsequent calculation method of the fusion vector. According to the different camera front lens orientations, the corresponding direction vector is selected, and the fusion vector is calculated using the posture orientation value. When the camera front is used as the camera center for calculation, the first posture threshold is set to 0. The camera front lens facing upward or downward are two clearly different states, with 0 as the boundary. A value greater than 0 represents that the camera front lens is facing upward, and a value less than 0 represents that the camera front lens is facing downward. This simple setting with 0 as the boundary can directly distinguish the up and down orientation states of the camera front lens.
[0074] S204: Determine the lens orientation of the bottom side of the camera based on the posture orientation value of the bottom side of the camera and the second posture threshold, and calculate a fusion vector according to the lens orientation of the bottom side of the camera, the posture orientation value, and the direction vectors of each position of the panoramic camera.
[0075] Specifically, the obtained attitude orientation value of the bottom side of the camera is compared with the second attitude threshold. Assuming that the attitude orientation value of the bottom side of the camera is V2(1) (where V2(1) is the projection of the camera attitude under the bottom direction vector, (1) represents the first component of the projection vector), when V2(1)>0.9, the bottom side lens of the camera is determined to be facing upward; when V2(1)<-0.9, the bottom side lens of the camera is determined to be facing downward. Here, 0.9 and -0.9 are the second attitude thresholds, and the specific thresholds can be set according to actual conditions and needs. According to the different camera bottom side lens orientations, the corresponding direction vector is selected, and the fusion vector is calculated using the attitude orientation value. The second attitude threshold is set to 0.9 when the bottom side of the camera is the center, because the bottom side lens of the camera facing upward or downward is a relatively special and extreme attitude situation. In actual shooting, the bottom side lens of the camera is generally not in a direction close to upward or downward for a long time when in normal use. It only occurs when a universal lock problem causes an abnormal attitude. The high threshold of 0.9 (close to 1) is set to more strictly judge whether the bottom lens of the camera is actually in the extreme posture of directly above or directly below. The corresponding fusion operation is triggered only when the bottom lens of the camera is facing directly above V2(1)>0.9 or directly below V2(1)<-0.9.
[0076] In this embodiment, the camera's front and bottom posture orientation values are compared with corresponding thresholds to accurately determine the lens orientation. Taking the front of the camera as an example, by comparing the posture orientation value with the first posture threshold, it is clear whether the lens is facing directly upward or downward. Similarly, for the bottom of the camera, comparison with the second posture threshold clearly determines the lens orientation. Based on different lens orientations (e.g., the front lens facing up or down, the bottom lens facing up or down), the image posture can be readjusted by combining the fusion vectors calculated from the direction vectors at each position of the panoramic camera.
[0077] In one embodiment, the direction vectors of each position of the panoramic camera include: a front direction vector, a back direction vector, a bottom direction vector and a top direction vector. Figure 4 As shown, the calculation of the fusion vector according to the lens orientation of the front side of the camera, the posture orientation value and the direction vector of each position of the panoramic camera includes:
[0078] S302 : In response to the lens of the front side of the camera being directed upward, a fusion vector is calculated based on the posture direction value, the bottom direction vector, and the camera posture.
[0079] Specifically, when V1(1)>0, that is, the lens on the front of the camera is facing upward, V1 and the camera bottom direction vector V bottom Fusion, its fusion vector:
[0080] V m1 =q c V bottom V1(1)+q c V front (1-V1(1)).
[0081] Among them, V m1 is the fusion vector; q c is the camera pose, V front is the front direction vector, V1(1) (the first component of V1 vector): Vector V1 is a multidimensional vector (usually a three-dimensional vector in three-dimensional space), V1(1) represents its first component. When calculating the fusion vector, the value of this component participates in the weighted operation and determines V bottom and V front Weight in the fusion vector calculation.
[0082] The overall formula is to calculate the fusion vector V m1 , which is the direction vector V of the bottom side of the camera bottom and the camera front direction vector V front The weights are determined by V1(1):
[0083] The first term q c V bottomV1(1) represents the camera bottom direction vector V bottom Through the camera attitude quaternion q c After the rotation, it is multiplied by the weight V1(1). The larger the value of V1(1), the more the camera's front posture is biased towards a certain direction (depending on the specific calculation logic), and the greater the weight of the camera's bottom direction vector in the fusion vector. The second term q c V front (1-V1(1)) represents the camera front direction vector V front Through the camera attitude quaternion q c After the rotation, multiply it by the weight 1-V1(1). As V1(1) increases, 1-V1(1) decreases, and the weight of the camera front direction vector in the fusion vector becomes smaller, and vice versa. Finally, add these two items together to get the fusion vector V m1 , which integrates the camera's front and bottom direction information and adjusts the weight according to the camera's front posture orientation value.
[0084] S304 : In response to the lens of the front side of the camera being oriented downward, a fusion vector is calculated based on the attitude orientation value, the top direction vector, and the camera attitude.
[0085] Specifically, when V1(1)<0, that is, the front lens of the camera is facing downward, V1 and the camera top direction vector V top Fusion, its fusion vector V m2 =-q c V top V1(1)+q c V front (1+V1(1)).
[0086] Among them, the formula is used to calculate the fusion vector V m2 , is the camera top side direction vector V top and the camera front direction vector V front Perform weighted combination:
[0087] The first item -q c V top V1(1): First, the camera top direction vector V top Through the camera attitude quaternion q c Rotate and then multiply by the weight V1(1). The negative sign indicates the direction of action of this term in the calculation. The larger the V1(1) value, the greater the weight of the camera top side direction vector in the fusion vector (considering the influence of the negative sign). The second term q c V front (1+V1(1)): The camera front direction vector V front Camera attitude quaternion q cAfter rotation, multiply by the weight 1+V1(1). As V1(1) changes, the weight also changes accordingly. When V1(1) increases, the weight of the camera front direction vector in the fusion vector increases. The two operation results are added to get the fusion vector V m2 , which combines the camera's top and front direction information and adjusts the weight according to the camera's front attitude value. c Vector Vt op After the rotation operation, multiplying by a negative sign means performing the reverse processing in the spatial direction. In combination with the panoramic camera posture calculation scenario, when the camera is in a specific posture (such as the front lens of the camera is facing directly downward), the camera top direction vector needs to form a specific direction relationship with other vectors in the fusion vector calculation. Adding a negative sign can make V top After rotation and weighting, its direction meets the requirements of the overall fusion vector for camera posture adjustment. For example, when solving the problem of image flipping in a critical state of camera posture, V is adjusted by a negative sign. top The direction participates in the calculation of the fusion vector, which can avoid abnormal flipping of the image. The two terms in the formula represent the results of the rotation and weighting of the camera's top and front direction vectors respectively. The existence of the negative sign can balance the weight relationship of the two terms in the weighting process. When V1(1) changes, the weights of the first term and the second term with a negative sign will change in different trends, and together they make the fusion vector V m2 It can comprehensively consider the direction vector information of different camera positions and reasonably reflect the current posture of the camera.
[0088] In one embodiment, the direction vectors of each position of the panoramic camera include: a front direction vector, a back direction vector, a bottom direction vector and a top direction vector, such as Figure 5 As shown, the calculation of the fusion vector according to the lens orientation of the bottom side of the camera and the direction vectors of each position of the panoramic camera includes:
[0089] S402 : In response to the lens of the bottom side of the camera being directed upward, a fusion vector is calculated based on the posture direction value, the front direction vector, and the camera posture.
[0090] Specifically, when V2(1)>0.9, that is, the bottom lens of the camera is facing upward, V2 and the camera front direction vector V front Fusion, its fusion vector:
[0091] V m3 =q c V front (10V2(1)-9)+q c V bottom (10-10V2(1))
[0092] Among them, V2 is usually a vector corresponding to the orientation value of the bottom side of the camera, reflecting the orientation of the bottom side of the camera in the current posture, and is usually calculated based on the camera posture and the preset bottom side direction vector of the camera.
[0093] V2(1): The first component of V2 vector. V2 is usually a multi-dimensional vector (commonly seen in three-dimensional space). V2(1) participates in weighted operations and determines V front and V bottom The weight in the calculation of the fusion vector. This formula is used to calculate the fusion vector, V m3 , by the camera front direction vector V front and the camera bottom direction vector V bottom Perform weighted combination to obtain: the first item q c V front (10V2(1)-9): First, the camera front direction vector V front Through the camera attitude quaternion q c Rotate and then multiply by the weight 10V2(1)-9. The value of V2(1) will affect the weight. When V2(1) changes, the weight changes accordingly, thereby adjusting the proportion of the camera front direction vector in the fusion vector. The second term q c V bottom (10-10V2(1)): The camera bottom direction vector V bottom Camera attitude quaternion q c After the rotation, multiply it by the weight 10-10V2(1). Similarly, as V2(1) changes, the weight will also change accordingly, adjusting the proportion of the camera bottom direction vector in the fusion vector. Finally, add these two items together to get the fusion vector V m3 , which integrates the camera's front and bottom direction information, and adjusts the weights through V2(1) according to the camera's bottom attitude value, for subsequent accurate calculation of the camera attitude angle changes and optimization of the camera shooting attitude. In addition, the settings of "10" and "9" in the above formula are mainly to adjust V front and V bottomThe weight in the fusion vector calculation, and the weight change range is controlled. When V2(1) changes within a certain range, the weights of the two items can be changed within a suitable range through calculation methods such as "10V2(1)-9" and "10-10V2(1)". For example, when V2(1) = 0.9, 10V2(1)-9, 10-10V2(1), at this time, the weight of the camera front direction vector in the fusion vector calculation is 0, and the weight of the camera bottom direction vector is 1. In this way, the weight proportion of the two direction vectors in the fusion vector can be flexibly and within a limited range according to the camera bottom posture orientation value. Combined with the camera bottom lens orientation judgment logic mentioned above (when V2(1)>0.9, the camera bottom lens orientation is directly upward), the settings of "10" and "9" are coordinated with this judgment logic. When V2(1) is greater than 0.9 and gradually increases, "10V2(1)-9" will increase, increasing the weight of the camera's front direction vector in the fusion vector; "10-10V2(1)" will decrease, reducing the weight of the camera's bottom direction vector, meeting the requirement of adjusting the fusion vector composition according to the camera's bottom posture, so as to accurately calculate the camera's posture angle change and optimize the camera's shooting posture. It should be noted that the 10 and 9 here are determined based on the second posture threshold.
[0094] S404 : In response to the lens of the bottom side of the camera being oriented downward, a fusion vector is calculated based on the attitude orientation value, the back direction vector, and the camera attitude.
[0095] Specifically, when V2(1)<-0.9, that is, the bottom lens of the camera is facing downward, V2 and the camera back direction vector V back Fusion, its fusion vector:
[0096] V m4 =-q c V back (10V2(1)+9)+q c V bottom (10+10V2(1)) For the specific implementation and limitation of the formula here, please refer to the above embodiment, which will not be repeated here.
[0097] In one embodiment, Figure 6 As shown, the change in attitude angle includes: a change in yaw angle, a change in pitch angle, and a change in roll angle. The calculation of the change in attitude angle of the panoramic camera based on the fusion vector and the direction vectors of each position of the panoramic camera includes:
[0098] S502: Calculate the projection of the fusion vector on the horizontal and vertical planes to obtain a projected fusion vector.
[0099] S504 , calculating a first rotation quaternion from the front direction vector to the projected fusion vector to obtain a yaw angle variation.
[0100] S506 , calculating a second rotation quaternion from the fusion vector to the projected fusion vector to obtain a pitch angle variation.
[0101] S508 : Obtain a roll angle change based on the camera posture, the yaw angle change, and the pitch angle change.
[0102] Among them, the horizontal and vertical planes can be two-dimensional planes defined in three-dimensional space, usually the XZ plane. The projected fusion vector is the vector obtained by projecting the fusion vector onto the horizontal and vertical planes. It retains the effective information of the fusion vector in the horizontal and vertical directions, and is an important basic data for further calculating the change in camera attitude angle. The first rotation quaternion is a quaternion used to describe the rotation relationship from the front direction vector to the projected fusion vector. Quaternion is a mathematical tool for representing rotation in three-dimensional space. The first rotation quaternion contains information such as the rotation axis and rotation angle, through which the yaw angle change can be calculated. The yaw angle change is the change in the camera's rotation angle around the vertical axis (usually defined as the yaw axis). It reflects the rotation of the camera in the horizontal direction and is one of the important parameters for describing the change in camera attitude.
[0103] Specifically, the projection of the fusion vector onto the XZ plane can be calculated to obtain the projected fusion vector. A first rotation quaternion is then calculated from the front direction vector to the projected fusion vector. This first rotation quaternion can be a yaw angle change. A second rotation quaternion is then calculated from the fusion vector to the projected fusion vector, and the pitch angle change is determined using the second rotation quaternion. The roll angle change is then obtained based on the camera pose, the yaw angle change, and the pitch angle change.
[0104] In some exemplary embodiments, the fusion vector V m , by a specific calculation method (with the vector ([1, 0, 1] T Operation), and get its projected fusion vector V′ on the XZ plane m This step is like focusing only on the X and Z directions in a three-dimensional space, projecting the fusion vector onto the XZ "plane" to obtain a new vector for subsequent calculations. Calculate the direction vector V from the front of the camera front Go to the projection vector V′ just obtained m The required rotation quaternion q c1 This q c1 It represents the change in the camera's yaw angle (which can be understood as the angle of the camera's horizontal rotation). It is like the camera was originally facing one direction and now wants to turn to a new direction. c1The change of the yaw angle of this rotation is recorded. Next, the fusion vector V from the XZ plane is calculated. m To its projected fusion vector V′ m The rotation quaternion q c2 This q c2 It represents the change in the camera's pitch angle (the angle at which the camera rotates up and down). Similarly, the calculation between the relevant vectors in the XZ plane is used to obtain the change in the camera's pitch direction. c3 =q c / (q c1 q c2 ) to calculate the change in the camera roll angle (the angle at which the camera rotates around its own axis). Here q c It is the original camera attitude quaternion (camera attitude). Dividing it by the product of the quaternions corresponding to the changes in yaw and pitch angles gives the change in roll angle.
[0105] In this embodiment, since directly processing vectors and rotation relationships in three-dimensional space is relatively complex, projecting the fused vector onto the XZ plane simplifies the problem from three dimensions to two dimensions. For example, calculating the rotation quaternion from the camera's front-facing direction vector to the projected vector is much simpler in two dimensions than in three-dimensional space, reducing computational complexity and improving efficiency. For example, calculating the rotation relationship between two two-dimensional vectors requires significantly fewer variables and computational effort than in three dimensions. A camera's attitude changes can be decomposed into yaw (horizontal rotation), pitch (up and down rotation), and roll (rotation around its axis). The XZ plane is primarily concerned with yaw and pitch, and projecting the fused vector onto this plane facilitates separate analysis and calculation of changes in these two angles. For example, during the calculation of the projected vector, the changes in the camera's yaw and pitch angles can be determined separately, facilitating subsequent precise control of the camera's attitude. In panoramic camera shooting scenarios, yaw and pitch angles significantly impact image stability and shooting direction. Projecting onto the XZ plane prioritizes changes in these two key angles, effectively addressing image flipping. For example, during the shooting process, common camera instability is mostly caused by abnormal rotation in the horizontal or vertical directions. By focusing on the posture changes in the XZ plane and making adjustments, the shooting image quality can be effectively improved to ensure the normal progress of video shooting.
[0106] In one embodiment, Figure 7 As shown, the step of obtaining the camera posture of the panoramic camera when in the pan-tilt shooting mode includes:
[0107] S602: Determine the camera posture of the panoramic camera at an initial moment and a current moment when the panoramic camera is in a pan-tilt shooting mode.
[0108] S604: Calculate the camera posture angle between the camera postures at the initial moment and the current moment based on the camera postures at the two moments, and adjust the posture angle based on the posture angle and a preset threshold to obtain a smooth posture angle.
[0109] Specifically, during the shooting process of the panoramic camera, some scenes may be motion scenes. In this scene, the panoramic camera is constantly moving, so the camera posture of the panoramic camera is constantly changing. If the posture change is abrupt, the video image will "sway" and look very uncomfortable. Therefore, it is necessary to optimize the posture. In actual shooting, the camera movement conditions are complex and diverse. When the camera moves significantly, the posture angle θ between the two moments may be large. If this large angle is directly used for optimization, the calculated camera posture change will be drastic, resulting in unstable images; and when the camera moves slightly, a slight posture change may make θ too small, which will also affect the optimization effect and cause unnecessary fluctuations in the image. Therefore, θ needs to be processed to adapt to different motion conditions. The camera posture of the panoramic camera at the initial moment and the current moment when it is in the gimbal shooting mode can be determined. For example, the initial moment can be t0, and the current moment can be t1. The camera posture at the initial moment can be q t0 , the current camera pose can be q t1 The attitude angle θ′ can be obtained by the following formula:
[0110] θ′=min(cos -1 (q t0 q t1 ) / 60,1)
[0111] Among them, cos -1 (q t0 q t1 ) is to get the original posture angle, and dividing it by 60 is to scale the angle in order to suppress excessive angle changes. In this way, when the camera moves significantly, θ′ will not cause the interpolated posture to change too drastically due to the large original angle. The camera can quickly and stably follow the movement of the subject to avoid screen freezes. Then, the min function takes the smaller value of the scaled angle and 1 as θ′. This is to further limit the size of the angle, prevent θ′ from being too large, and ensure that the camera posture adjustment can remain stable under various circumstances. For example, even if the angle after scaling is still large, as long as it exceeds 1, θ′ will be 1 to ensure that the camera posture change is within a controllable range. 1 can be regarded as a preset threshold.
[0112] S606: Determine the middle moment in the pan / tilt shooting mode.
[0113] S608 : Based on the intermediate moment, the smoothed attitude angle, the initial moment, and the camera attitude at the current moment, a quaternion spherical linear interpolation algorithm is used to determine the camera attitude of the panoramic camera when it is in the gimbal shooting mode.
[0114] The intermediate time can be determined according to actual needs, and in some embodiments of the present disclosure, there is no restriction on the intermediate time. The intermediate time can be a certain moment during the pan-tilt shooting mode.
[0115] Specifically, the quaternion spherical linear interpolation algorithm can be used to calculate the camera posture at the intermediate moment based on the intermediate moment, the smoothed posture angle, the initial moment and the current moment. Then, the camera posture at the intermediate moment can be used to determine the camera posture when in the gimbal shooting mode.
[0116] t m The camera pose at the moment (intermediate moment) is:
[0117]
[0118] Where θ = θ′ = min(cos -1 (q t0 q t1 ) / 60,1). This part indicates that according to t m The ratio of q t0 The initial posture contribution; From q t1 The initial posture contribution. m From 0 to 1, the camera posture will change from q t0 Gradually transition to q t1 , to achieve smooth changes. For example, when t m = 0, q tm =q t0 When t m =1, q tm =q t1 , when t m = 0.5, the camera pose is q t0 and q t1 The result of mixing in a specific ratio makes the camera posture transition smoothly between t0 and t1, thereby determining the camera posture when in gimbal shooting mode.
[0119] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.
[0120] Based on the same inventive concept, embodiments of the present disclosure also provide an image angle switching and adjustment device for implementing the aforementioned image angle switching and adjustment method. The solution provided by this device is similar to the solution described in the aforementioned method. Therefore, the specific limitations of one or more of the following embodiments of the image angle switching and adjustment device can be found in the aforementioned limitations of the image angle switching and adjustment method, and will not be further elaborated here.
[0121] In one embodiment, Figure 8 As shown, an image angle switching adjustment device 700 is provided, comprising: a camera posture acquisition module 702, a posture direction value calculation module 704, a fusion vector calculation module 706, a change calculation module 708 and an image adjustment module 710, wherein:
[0122] The camera attitude acquisition module 702 is used to acquire the camera attitude of the panoramic camera when it is in the pan-tilt shooting mode;
[0123] a posture orientation value calculation module 704 for determining a reference target position in the panoramic camera, and determining a posture orientation value of the reference target position based on a preset direction vector of each panoramic camera position and the camera posture;
[0124] a fusion vector calculation module 706 for calculating a fusion vector of the posture orientation value and the direction vector based on the posture orientation value and a preset posture threshold corresponding to the reference target position;
[0125] a variation calculation module 708 for calculating a variation of the attitude angle of the panoramic camera based on the fusion vector and the direction vectors of each position of the panoramic camera;
[0126] The image adjustment module 710 is configured to adjust the image displayed in the panoramic camera based on the change in the attitude angle of the panoramic camera and the three-axis attitude angle determined when the panoramic camera is in the pan-tilt shooting mode.
[0127] In one embodiment of the device, the reference target position includes: the front side of the camera and the bottom side of the camera, and the preset posture thresholds corresponding to the reference target position include: a first posture threshold corresponding to the front side of the camera and a second posture threshold corresponding to the bottom side of the camera. The fusion vector calculation module 706 includes:
[0128] a first calculation module, configured to determine the lens orientation of the front side of the camera based on the posture orientation value of the front side of the camera and the first posture threshold, and calculate a fusion vector according to the lens orientation of the front side of the camera, the posture orientation value, and the direction vectors of each position of the panoramic camera;
[0129] A second calculation module is used to determine the lens orientation of the bottom side of the camera based on the posture orientation value of the bottom side of the camera and the second posture threshold, and calculate a fusion vector according to the lens orientation of the bottom side of the camera, the posture orientation value and the direction vector of each position of the panoramic camera.
[0130] In one embodiment of the device, the direction vectors at each position of the panoramic camera include a front direction vector, a back direction vector, a bottom direction vector, and a top direction vector. The first calculation module is further configured to calculate a fusion vector based on the posture direction value, the bottom direction vector, and the camera posture in response to the front lens of the camera being oriented upward; and to calculate a fusion vector based on the posture direction value, the top direction vector, and the camera posture in response to the front lens of the camera being oriented downward.
[0131] In one embodiment of the device, the direction vectors of each position of the panoramic camera include: a front direction vector, a back direction vector, a bottom direction vector and a top direction vector, and the second calculation module is further used to calculate the fusion vector based on the posture orientation value, the front direction vector and the camera posture in response to the lens of the bottom side of the camera being directed upward; and calculate the fusion vector based on the posture orientation value, the back direction vector and the camera posture in response to the lens of the bottom side of the camera being directed downward.
[0132] In one embodiment of the device, the variation calculation module 708 includes:
[0133] A projection module, configured to calculate the projection of the fusion vector on the horizontal and vertical planes to obtain a projected fusion vector;
[0134] a yaw angle variation determination module, configured to calculate a first rotation quaternion from the front direction vector to the projected fusion vector to obtain a yaw angle variation;
[0135] A pitch angle variation determination module is configured to calculate a second rotation quaternion from the projection vector to the projected fusion vector to obtain a pitch angle variation;
[0136] The roll angle variation determination module is configured to obtain the roll angle variation based on the camera posture, the yaw angle variation, and the pitch angle variation.
[0137] In one embodiment of the device, the camera posture acquisition module 702 is further used to determine the camera posture of the panoramic camera at the initial moment and the current moment when it is in the gimbal shooting mode; based on the camera postures at the initial moment and the current moment, calculate the posture angle between the camera postures at the two moments, and adjust the posture angle based on the posture angle and a preset threshold to obtain a smooth posture angle; determine the intermediate moment when it is in the gimbal shooting mode; based on the intermediate moment, the smooth posture angle, the camera postures at the initial moment and the current moment, use the quaternion spherical linear interpolation algorithm to determine the camera posture of the panoramic camera when it is in the gimbal shooting mode.
[0138] Each module in the aforementioned image angle switching and adjustment device can be implemented in whole or in part via software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a computer device memory in the form of software, so that the processor can call and execute the corresponding operations of each module.
[0139] In one embodiment, a computer device is provided. The computer device may be a terminal (usually a camera), and its internal structure diagram may be as follows: Figure 9 As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, an image angle switching adjustment method is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad provided on the computer device housing, or an external keyboard, touchpad or mouse.
[0140] Those skilled in the art will understand that Figure 9The structure shown in the figure is merely a block diagram of a portion of the structure related to the solution of the present disclosure, and does not constitute a limitation on the computer device to which the solution of the present disclosure is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0141] In one embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps in the above method embodiments when executing the computer program.
[0142] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0143] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0144] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in the present disclosure may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this disclosure may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processor involved in each embodiment provided in this disclosure may be, but are not limited to, a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, etc.
[0145] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0146] The above-described embodiments merely represent several implementation methods of the present disclosure. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present disclosure. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present disclosure, all of which fall within the scope of protection of the present disclosure. Therefore, the scope of protection of the present disclosure shall be determined by the appended claims.
Claims
1. A method for switching and adjusting an image angle, characterized in that: The method comprises: Get the camera posture of the panoramic camera when it is in gimbal shooting mode; Determining a reference target position in the panoramic camera, and determining a posture orientation value of the reference target position based on a preset direction vector of each position of the panoramic camera and the camera posture; Calculating a fusion vector of the posture orientation value and the direction vector based on the posture orientation value and a preset posture threshold corresponding to the reference target position; Calculating a change in the attitude angle of the panoramic camera based on the fusion vector and the direction vectors of each position of the panoramic camera; The image displayed in the panoramic camera is adjusted based on the change in the attitude angle of the panoramic camera and the three-axis attitude angle determined when in the pan-tilt shooting mode.
2. The method according to claim 1, characterized in that The reference target position includes: a front side of a camera and a bottom side of a camera; the preset attitude thresholds corresponding to the reference target position include: a first attitude threshold corresponding to the front side of the camera and a second attitude threshold corresponding to the bottom side of the camera; and calculating a fusion vector of the attitude orientation value and the direction vector based on the attitude orientation value and the preset attitude threshold corresponding to the reference target position includes: Determining the lens orientation of the front side of the camera based on the posture orientation value of the front side of the camera and the first posture threshold, and calculating a fusion vector according to the lens orientation of the front side of the camera, the posture orientation value, and the direction vectors of each position of the panoramic camera; Based on the posture orientation value of the bottom side of the camera and the second posture threshold, the lens orientation of the bottom side of the camera is determined, and a fusion vector is calculated according to the lens orientation of the bottom side of the camera, the posture orientation value and the direction vector of each position of the panoramic camera.
3. The method according to claim 2, characterized in that The direction vectors of each position of the panoramic camera include: a front direction vector, a back direction vector, a bottom direction vector, and a top direction vector. The calculation of the fusion vector according to the lens orientation of the front side of the camera, the posture orientation value, and the direction vectors of each position of the panoramic camera includes: In response to the lens of the front side of the camera being directed upward, calculating a fusion vector based on the posture orientation value, the bottom direction vector, and the camera posture; In response to the lens of the front side of the camera being oriented downward, a fusion vector is calculated based on the attitude orientation value, the top direction vector, and the camera attitude.
4. The method according to claim 2, characterized in that The direction vectors of each position of the panoramic camera include: a front direction vector, a back direction vector, a bottom direction vector, and a top direction vector. The calculation of the fusion vector according to the lens orientation of the bottom side of the camera and the direction vectors of each position of the panoramic camera includes: In response to the lens of the bottom side of the camera being directed upward, calculating a fusion vector based on the posture orientation value, the front direction vector, and the camera posture; In response to the lens orientation of the bottom side of the camera being downward, a fusion vector is calculated based on the attitude orientation value, the back direction vector, and the camera attitude.
5. The method according to claim 1, wherein The direction vectors of each position of the panoramic camera include: a front direction vector, a back direction vector, a bottom direction vector, and a top direction vector; the change in attitude angle includes: a yaw angle change, a pitch angle change, and a roll angle change; and calculating the change in attitude angle of the panoramic camera based on the fusion vector and the direction vectors of each position of the panoramic camera includes: Calculating the projection of the fusion vector on the horizontal and vertical planes to obtain a projected fusion vector; Calculating a first rotation quaternion from the front direction vector to the projected fusion vector to obtain a yaw angle change; Calculating a second rotation quaternion from the projection vector to the projected fusion vector to obtain a pitch angle change; A roll angle change is obtained based on the camera posture, the yaw angle change, and the pitch angle change.
6. The method according to claim 1, characterized in that The step of obtaining the camera posture of the panoramic camera when in the pan / tilt shooting mode includes: Determining the camera posture of the panoramic camera at an initial moment and a current moment in a pan-tilt shooting mode; Calculating the camera pose angle between the camera poses at the initial moment and the current moment based on the camera poses at the two moments, and adjusting the pose angle based on the pose angle and a preset threshold to obtain a smooth pose angle; Determining an intermediate moment in the gimbal shooting mode; Based on the intermediate moment, the smoothed attitude angle, the camera attitude at the initial moment and the current moment, a quaternion spherical linear interpolation algorithm is used to determine the camera attitude of the panoramic camera when it is in the pan-tilt shooting mode.
7. An image angle switching and adjusting device, characterized in that: The device comprises: The camera attitude acquisition module is used to obtain the camera attitude of the panoramic camera when it is in the pan-tilt shooting mode; a posture direction value calculation module, configured to determine a reference target position in the panoramic camera, and determine a posture direction value of the reference target position based on a preset direction vector of each position of the panoramic camera and the camera posture; a fusion vector calculation module, configured to calculate a fusion vector of the posture orientation value and the direction vector based on the posture orientation value and a preset posture threshold corresponding to the reference target position; a variation calculation module, configured to calculate a variation of the attitude angle of the panoramic camera based on the fusion vector and the direction vectors of each position of the panoramic camera; The image adjustment module is used to adjust the image displayed in the panoramic camera based on the change in the attitude angle of the panoramic camera and the three-axis attitude angle determined when in the pan-tilt shooting mode.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.