Panoramic shooting visual angle control method and device, computer equipment and storage medium
Through the panoramic viewing angle control method, the image processing and motion data of the panoramic camera are used to automatically adjust the focus and transition method, which solves the problem of inconvenient viewing angle control of the traditional panoramic camera and achieves a more efficient and high-quality shooting and editing process.
Patent Information
- Application Number
- CN202510097196.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-21
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2045-01-21
AI Technical Summary
Traditional panoramic cameras have inconvenient viewing angle control during shooting and post-editing. Users need to manually adjust the camera, which is cumbersome and easy to miss the shooting time.
A panoramic shooting perspective control method is provided, by obtaining the current panoramic image of the panoramic camera, determining the focus, and determining the transition mode according to the movement speed of the camera, the movement trajectory and the positional relationship between the focus, so as to achieve a smooth transition from the first focus to the second focus.
Simplifies the operation process, automatically tracks focus changes, ensures that the focus switches naturally and smoothly between different objects, improving the shooting quality and convenience of post-editing.
Smart Images

Figure CN120017973A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data processing technology, and in particular to a panoramic shooting viewing angle control method, device, computer equipment, and storage medium. Background Art
[0002] With the development of panoramic technology, more and more users are using cameras or smartphones to take photos. However, when taking photos with traditional cameras and smartphones, users need to manually adjust the camera to aim at the target. This shooting method is not only cumbersome, but also easy to miss the shooting opportunity.
[0003] Panoramic cameras have greater shooting freedom and flexibility due to their omnidirectional shooting characteristics. However, current panoramic cameras have not fully utilized this feature. Traditional panoramic cameras have many inconveniences when using selfie sticks for flat video shooting and post-editing. Summary of the invention
[0004] Based on this, it is necessary to provide a panoramic shooting angle control method, device, computer equipment, and storage medium to address the above technical problems.
[0005] In a first aspect, the present disclosure provides a method for controlling a panoramic shooting viewing angle. The method is applied to a panoramic camera, and the method comprises:
[0006] In response to the panoramic camera entering a planar shooting mode, acquiring a first panoramic image of the panoramic camera at a current moment, determining a first focus based on the first panoramic image, and adjusting a panoramic picture in the panoramic camera at a current moment by using the first focus to obtain a first picture;
[0007] In response to detecting the movement of the panoramic camera, acquiring a moving speed, a moving trajectory, and a second panoramic image after the movement of the panoramic camera, and determining a second focus based on the second panoramic image;
[0008] Determining a transition mode according to a moving speed and a moving trajectory of the panoramic camera and a positional relationship between the first focus and the second focus;
[0009] Based on the transition mode, the first picture is transitioned to a second picture, where the second picture is determined according to the second focus.
[0010] In one embodiment, determining the transition mode according to the moving speed and moving trajectory of the panoramic camera and the positional relationship between the first focus and the second focus includes:
[0011] Based on the position relationship and the movement trajectory, determining a transition direction and a transition distance;
[0012] In response to the moving speed of the panoramic camera being greater than a preset speed threshold, determining that the transition type is a nonlinear transition type, and determining a first transition mode based on the transition direction, the transition distance and the moving speed and according to the nonlinear transition type;
[0013] In response to the moving speed of the panoramic camera being less than a preset speed threshold, the transition type is determined to be a linear transition type, and based on the transition mode, transition distance and the moving speed, and according to the linear transition type, a second transition mode is determined.
[0014] In one embodiment, determining the second transition mode based on the transition mode, transition distance and movement speed and according to the linear transition type includes:
[0015] In response to the transition distance being less than a preset transition distance threshold, determining a first transition mode according to the transition direction, the transition distance and the uniform linear transition type;
[0016] In response to the transition distance being greater than a preset transition distance threshold, selecting at least one transition point in the transition direction, and determining a first transition mode according to the at least one transition point, the transition distance, and the variable speed linear transition type, and according to the transition direction;
[0017] In response to the transition distance being greater than a preset transition distance threshold, determining a transition speed change coefficient based on the transition distance and a preset time;
[0018] Determining a first transition mode based on the transition speed change coefficient and the speed-varying linear transition type and according to the transition direction;
[0019] The transition distance threshold is determined according to the moving speed and a preset time.
[0020] In one embodiment, the position relationship includes: a distance relationship and an angle relationship; the nonlinear transition type includes: a Bezier curve; and the transition from the first picture to the second picture based on the transition method includes:
[0021] In response to the distance relationship being greater than a preset distance threshold, and / or the angle relationship being greater than a preset angle threshold, determining at least one intermediate control point based on a line between the first focus and the second focus and a preset length threshold;
[0022] Based on the at least one intermediate control point, the first focus, and the second focus, the Bezier curve is selected to transition the first picture to a second picture, wherein the second focus is located at the center of the second picture.
[0023] In one embodiment, the position relationship includes: a distance relationship; the linear transition type includes: a linear difference; and the transition from the first picture to the second picture based on the transition mode includes:
[0024] In response to the distance relationship being less than a preset distance threshold, a transition ratio is determined according to the distance between the first focus and the second focus, and the first picture is transitioned to the second picture according to the transition ratio and using the linear difference, wherein the second focus is located at the center of the second picture.
[0025] In one embodiment, in response to the panoramic camera entering the planar shooting mode, the method further includes:
[0026] The shooting field of view of the panoramic camera is fixed at the shooting direction of the panoramic camera.
[0027] In a second aspect, the present disclosure further provides a panoramic shooting viewing angle control device. The device is applied to a panoramic camera, and the device includes:
[0028] a picture adjustment module, configured to obtain a first panoramic image of the panoramic camera at a current moment in response to the panoramic camera entering a planar shooting mode, determine a first focus based on the first panoramic image, and use the first focus to adjust the panoramic picture in the panoramic camera at the current moment to obtain a first picture;
[0029] a focus determination module, configured to, in response to detecting movement of the panoramic camera, obtain a moving speed, a moving trajectory, and a second panoramic image after the movement of the panoramic camera, and determine a second focus based on the second panoramic image;
[0030] A transition mode determination module, used to determine a transition mode according to a moving speed and a moving trajectory of the panoramic camera and a positional relationship between the first focus and the second focus;
[0031] A transition module is used to transition the first picture to a second picture based on the transition method, where the second picture is determined according to the second focus.
[0032] In a third aspect, the present disclosure further provides a computer device, wherein the computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps in any of the above method embodiments are implemented.
[0033] In a fourth aspect, the present disclosure further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.
[0034] In a fifth aspect, the present disclosure further provides a computer program product, wherein the computer program product comprises a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.
[0035] In the above embodiments, after the panoramic camera enters the plane shooting mode, it can automatically obtain the first panoramic image and determine the first focus, without the user having to manually search and lock the focus, which greatly simplifies the operation process. By comprehensively analyzing the camera movement speed, movement trajectory and the relationship between the focus points to determine the transition method, the focus change can be intelligently tracked during the camera movement. Whether shooting slow-moving objects such as the blooming process of flowers, or fast-moving scenes such as sports games, it can ensure that the focus switches naturally and smoothly between different objects, and can adapt to a variety of scenes. The picture is adjusted using the determined focus, so that the picture is always displayed with the important focus as the center, highlighting the subject and avoiding the clutter of the picture. The transition from the first picture to the second picture is based on a scientific and reasonable transition method, which maintains the stability of the picture and the visual comfort, reduces undesirable phenomena such as picture jitter, blur or sudden focus change, improves the overall shooting quality, and facilitates post-editing. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the specific embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the specific embodiments or the description of the prior art will be briefly introduced below. 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.
[0037] Figure 1 1 is a flow chart of a panoramic shooting viewing angle control method according to an embodiment;
[0038] Figure 2 This is a schematic diagram of the process of step S106 in one embodiment;
[0039] Figure 3 A schematic diagram of a flow chart of step S108 in an embodiment;
[0040] Figure 4 Another schematic diagram of the process of step S108 in one embodiment;
[0041] Figure 5 is a schematic diagram of a first focus, a second focus and an intermediate control point in one embodiment;
[0042] Figure 6 It is a schematic block diagram of the structure of a panoramic shooting viewing angle control device in one embodiment;
[0043] Figure 7 Schematic diagram of the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solution and advantages of the present disclosure more clear, the present disclosure is further described in detail below in conjunction with 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 used to limit the present disclosure.
[0045] It should be noted that the terms "first", "second", etc. in the specification and claims of this article and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of this article described here can be implemented in an order other than those illustrated or described here. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, device, product or equipment that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0046] In this article, the term "and / or" is only a description of the association relationship between related 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, the character " / " in this article generally indicates that the related objects before and after are in an "or" relationship.
[0047] In one embodiment, Figure 1 As shown, a panoramic shooting time control method is provided. This embodiment uses the method applied to a panoramic camera as an example for illustration, and includes the following steps:
[0048] S102, in response to the panoramic camera entering a planar shooting mode, obtaining a first panoramic image of the panoramic camera at a current moment, determining a first focus based on the first panoramic image, and using the first focus to adjust the panoramic picture in the panoramic camera at the current moment to obtain a first picture.
[0049] Among them, the plane shooting mode generally refers to a shooting setting in which the main purpose is to obtain a two-dimensional plane image or video during the process of photography or video recording. In some embodiments of the present disclosure, under normal circumstances, a panoramic camera captures a panoramic video. In some scenes, the user needs to convert the panoramic video into a plane video. In this case, the camera mode may be a plane shooting mode. The first focus may be the area of interest that currently needs to be focused. The first picture is generally a panoramic picture with the focus placed in the center of the picture.
[0050] Specifically, when the panoramic camera enters the plane shooting mode, the system will immediately obtain the first panoramic image at the current moment. This panoramic image contains 360-degree scene information around the camera. Through specific image processing algorithms and focus recognition technology, the first focus is determined in this rich image data. This first focus may be a person, object or a specific point of interest in the picture. For example, when shooting scenery, it may be a distant mountain or a boat in the lake; when shooting an activity scene, it may be an actor on the stage or a key figure in the crowd. Then, the determined first focus is used to adjust the panoramic picture in the panoramic camera at the current moment. Specifically, through the image adjustment mechanism inside the camera, the first focus is moved to the center of the picture, and the other parts of the picture are scaled, cropped or deformed accordingly to ensure that the entire picture is visually balanced and coordinated. The final first picture, with the first focus as the center, clearly displays the relevant scene information around the focus, allowing the experiencer or user to focus on this important focus, highlighting the subject of the shooting, laying the foundation for subsequent editing, and making the picture more visually attractive and expressive.
[0051] S104, in response to detecting the movement of the panoramic camera, obtaining a moving speed, a moving trajectory and a second panoramic image after the movement of the panoramic camera, and determining a second focus based on the second panoramic image.
[0052] Among them, the movement of the panoramic camera refers to the change in the position of the panoramic camera in space. This change may be caused by the user moving the camera handheld, the camera being installed on a mobile device (such as a drone, gimbal) and moving with it, or the displacement caused by external forces. The moving speed refers to the distance the panoramic camera moves in a unit time, usually expressed in meters per second or other suitable length units and time units. It reflects the speed of the camera position change. The moving trajectory is the path that the panoramic camera passes during the movement. It can be described by a series of continuous coordinate points in three-dimensional space. Its shape may be a straight line, a curve or a complex irregular path, depending on the movement of the camera. The second panoramic image usually refers to the image containing the surrounding 360-degree scene information taken after the panoramic camera moves. Compared with the first panoramic image before the movement, due to the change in the camera position, the scene content, relative position of objects and perspective in the image may be different. Second focus: a point of importance or possible concern of the user identified by specific algorithms and technologies in the second panoramic image. Similar to the first focus, it can be a person, an object or a specific landscape element, etc., which is the key object for subsequent picture processing and focus switching.
[0053] Specifically, when the panoramic camera moves, the camera's internal sensor can be used to record the camera's moving speed and moving trajectory. For example, the accelerometer and gyroscope can be used to measure the camera's acceleration in all directions, and the speed information can be obtained by integrating the acceleration; the gyroscope can measure the camera's rotation angle and angular velocity, and combined with the time information, the camera's moving direction and trajectory can be determined. After the panoramic camera moves to a new position, its fisheye lens will continue to capture the light information of the surrounding environment, and the panoramic camera's imaging system will convert the light into a digital image signal, and a second panoramic image will be generated after a series of image processing steps (such as noise reduction, color correction, etc.). The second panoramic image is input into the trained focus recognition model, and the model will output the possible focus objects and their position information in the image, and determine the second focus according to preset rules (such as giving priority to people, specific landmark objects, etc.). The focus recognition model can be implemented using an image recognition algorithm. For example: using a target detection algorithm based on deep learning, such as YOLO (You Only Look Once) or Faster R-CNN, etc. Training on a large amount of image data can identify objects of different categories. Therefore, the selection is made according to a predetermined rule. In some embodiments of the present disclosure, there is no restriction on how to determine the focus. Those skilled in the art can flexibly select different ways to determine the focus according to actual conditions.
[0054] In addition, it should be noted that after determining the second panoramic image, if the second panoramic image does not exist in the second panoramic image, the current viewing angle of the camera can be fixed at the first focus, or the actual picture of the current camera can be maintained. After determining the second panoramic image, the second panoramic image is directly displayed without subsequent adjustments.
[0055] S106: Determine a transition method according to a moving speed and a moving trajectory of the panoramic camera and a positional relationship between the first focus and the second focus.
[0056] The transition mode may include: a linear transition type transition mode and a nonlinear transition type transition mode. The position relationship between the first focus and the second focus may include: an angle relationship and a distance relationship.
[0057] Specifically, different processing methods can be selected according to the moving speed of the panoramic camera. For example, if the moving speed of the panoramic camera is fast, a nonlinear transition type can be selected, and the transition method can be determined by using the moving trajectory and position relationship. For another example, if the moving speed of the panoramic camera is slow, a linear transition type can be selected, and the transition method can be determined by using the moving trajectory and position relationship. Furthermore, if the moving speed changes unevenly and conforms to the law of exponential function, the transition method can be determined by using the moving trajectory and position relationship, and the transition method can be determined in the form of an exponential function.
[0058] S108: Based on the transition method, transition the first picture to a second picture, where the second picture is determined according to the second focus.
[0059] Specifically, the first picture may be transitioned to the second picture according to different transition modes, and during the transition process, the second focus needs to be placed in the center of the second picture.
[0060] In some exemplary embodiments, if a linear transition type transition method is used, and the camera movement speed is moderate and the focus position relationship is relatively simple, for example, transitioning from a part of a still object (the first focus) to another adjacent part (the second focus). First, the coordinate difference between the first focus and the second focus in the picture is calculated, and the displacement of the focus in each time step is determined according to the transition time and the frame rate of the camera. In each time step, the picture is resampled and interpolated, and the pixel weight of the focus area in the picture is gradually adjusted, so that the focus moves smoothly from the position of the first focus to the position of the second focus, while maintaining the relative stability and natural transition of other parts of the picture, and finally forming a second picture. When a nonlinear transition type transition method is used, such as a Bezier curve transition method, when shooting a dynamic scene and the focus switching is relatively complex, the control point of the Bezier curve is determined according to the camera's movement speed, acceleration, and the position relationship between the first focus and the second focus. As time goes by, the position coordinates of the focus at each time point are calculated according to the formula of the Bezier curve. For the picture, according to the change of the focus position, the image deformation algorithm is used in each time step to perform local stretching, compression and distortion operations on the picture, so that the picture can smoothly transition around the Bezier curve trajectory of the focus, ensuring that the second picture maintains visual continuity and naturalness during the focus switching process.
[0061] In the above-mentioned panoramic shooting angle control method, after the panoramic camera enters the plane shooting mode, it can automatically obtain the first panoramic image and determine the first focus, without the user manually finding and locking the focus tediously, which greatly simplifies the operation process. By comprehensively analyzing the camera movement speed, movement trajectory and the relationship between the focus points to determine the transition method, the focus change can be intelligently tracked during the camera movement. Whether shooting slow-moving objects such as the blooming process of flowers, or fast-moving scenes such as sports games, it can ensure that the focus switches naturally and smoothly between different objects. The picture is adjusted using the determined focus so that the picture is always displayed with the important focus as the center, highlighting the subject and avoiding the clutter of the picture. The transition from the first picture to the second picture is based on a scientific and reasonable transition method, which maintains the stability of the picture and the visual comfort, reduces undesirable phenomena such as picture jitter, blur or sudden focus changes, improves the overall shooting quality, and facilitates post-editing.
[0062] In one embodiment, Figure 2 As shown, the transition mode is determined according to the moving speed and moving trajectory of the panoramic camera and the positional relationship between the first focus and the second focus, including:
[0063] S202: Determine a transition direction and a transition distance based on the position relationship and the movement trajectory.
[0064] The transition direction may generally be a transition method required when transitioning from the first picture to the second picture.
[0065] Specifically, the transition distance can be calculated based on the coordinates of the first focus and the second focus. Usually, the movement trajectory and the transition direction are the same. The transition direction can be determined based on the positional relationship and / or the movement trajectory. Considering the movement trajectory of the camera, if the camera moves in a straight line and the movement direction is close to the focus line direction, the focus line direction can be directly used as the transition direction. However, if the camera movement trajectory is a curve, the focus line direction needs to be corrected. For example, when the camera moves along a curve that bends to the right, and the focus switches from the object on the left side of the picture to the object on the right side, the transition direction should be appropriately offset to the right by a certain angle based on the focus line direction to better conform to the actual movement trend of the camera and ensure the naturalness of the picture transition. Depending on different situations, technicians in this field can make a choice based on the positional relationship and the movement trajectory.
[0066] S204, in response to the moving speed of the panoramic camera being greater than a preset speed threshold, determining that the transition type is a nonlinear transition type, and determining a first transition mode based on the transition direction, transition distance and moving speed and in accordance with the nonlinear transition type.
[0067] Among them, the nonlinear transition type can be a focus or picture transition method. The transition process is not a uniform change according to a fixed ratio, but is achieved through more complex curves or algorithms to adapt to complex and changeable movement conditions, making the transition effect more natural and smooth, and avoiding the stiffness of linear transition in certain scenes.
[0068] Specifically, the system continuously monitors the movement speed of the panoramic camera. When it is detected that the camera movement speed is greater than the preset speed threshold, it is determined to use a nonlinear transition type. This is because in high-speed moving scenes, linear transition may not meet the natural and smooth transition requirements, and nonlinear transition can better adapt to complex motion states. Select a suitable nonlinear function according to specific needs, such as Bezier curve function, sine curve function, etc. Then determine the transition speed according to the movement speed of the camera to ensure that the transition speed of the focus is always less than or equal to the camera movement speed. In each frame of the image, the position of the focus on the nonlinear curve is calculated according to the selected nonlinear transition type and the current time. As time goes on, the focus smoothly transitions from the first focus to the second focus along the nonlinear curve, achieving a natural and smooth transition effect, thereby determining the first transition mode.
[0069] S206, in response to the moving speed of the panoramic camera being less than a preset speed threshold, determining that the transition type is a linear transition type, and determining a second transition mode based on the transition mode, transition distance and the moving speed and according to the linear transition type.
[0070] Among them, the linear transition type usually refers to a transition method in which the focus position changes evenly over time according to a fixed proportional relationship during the focus switching process. Its characteristics are that the change process is simple and direct, showing a linear change trend, and it is suitable for situations where the camera movement speed is relatively stable and the scene changes are relatively simple.
[0071] Specifically, when the panoramic camera moves slowly, a linear transition type can be selected. Because in the case of slow movement, linear transition is sufficient to ensure the smoothness of focus switching, and the calculation is relatively simple, which can meet the needs of picture transition. Since it is a linear transition, the transition time can be calculated according to the moving speed and transition distance, and the transition time and transition distance are used to determine the transition displacement per unit time (the transition displacement can be the same or different). Then the new position is calculated according to the transition displacement per unit time, thereby determining the second transition mode.
[0072] In this embodiment, the transition type is dynamically selected according to the camera movement speed so that the focus transition matches the actual movement state of the camera. Non-linear transition provides a more complex and natural transition path when moving at high speed, and linear transition ensures a smooth and uniform transition when moving at low speed. The combination of the two ensures that no matter what movement speed the camera is at, the focus switch can conform to the visual habits of the human eye to the greatest extent, enhancing the realism and viewing quality of the picture. The rational use of the two transition types effectively avoids jumping and freezing during the focus transition process. The curve characteristics of the non-linear transition at high speed and the uniform changes of the linear transition at low speed can make the focus transition smoothly between different positions, keep the picture stable and smooth, and present high-quality visual content to users.
[0073] In one embodiment, Figure 3 As shown, the linear transition type includes: a uniform linear transition type and a variable linear transition type, and the second transition mode is determined based on the transition mode, transition distance and moving speed and according to the linear transition type, including:
[0074] S302: In response to the transition distance being less than a preset transition distance threshold, a first transition mode is determined according to the transition direction, the transition distance and the uniform linear transition type.
[0075] The transition distance threshold is determined according to the moving speed and a preset time. Generally, the preset time may be the time for transition. The uniform linear transition type is a transition mode for achieving a smooth change from one state to another, and its core feature is that the rate of change remains constant during the entire transition process.
[0076] Specifically, when the transition distance is less than the preset transition distance, it can be determined that the transition to the second focus can be achieved within the preset time according to the moving speed. At this time, the first transition mode can be determined according to the transition direction, transition distance and uniform linear transition type.
[0077] In some exemplary embodiments, the transition time is known (which can be set according to actual needs, such as the total duration of the animation and the desired fluency), and according to the principle of uniform linear transition, the speed is equal to the distance divided by the time. For the two-dimensional case, the speed is decomposed into the x and y directions, the component of the speed in the x direction and the component in the y direction. If it is three-dimensional or higher, it is decomposed according to the dimension of the transition direction in a similar way. In each time interval, the state is updated according to the formula of uniform linear transition to obtain the first transition mode.
[0078] S304, in response to the transition distance being greater than a preset transition distance threshold, selecting at least one transition point in the transition direction, and determining a first transition mode based on the at least one transition point, the transition distance and the speed-changing linear transition type, and according to the transition direction.
[0079] In some embodiments of the present disclosure, the transition point may refer to a point where a speed change is required. The variable speed linear transition type is a method of transitioning between two states. Unlike the uniform speed linear transition type, the rate of change during the transition is not constant, but changes linearly with time or other factors.
[0080] Specifically, when the transition distance is greater than the preset transition distance threshold, if a uniform linear transition type is used at this time, the transition speed will be faster. Therefore, a variable speed linear transition type can be used for gradual transition. One or more transfer points can be selected in the transition direction according to the transition distance. For example, if the transition distance is d, it is preset to be divided into n sections (n can be determined according to the specific situation, such as the complexity of the transition, the expected number of speed change stages, etc.), then each distance is d / n. Starting from the starting point, the positions of the transfer points are determined in sequence along the transition direction. In addition, the transfer points can also be selected in combination with the actual characteristics of the scene. The specific selection of the transfer points is not restricted here. The entire transition process is divided into multiple stages according to the transfer points. Then determine the transition time and speed of each stage, and determine the first transition method according to the transition time and transition speed of each stage and the transition direction. The transition time of each stage can usually be determined according to a preset time. For example, the preset time is 5s with three stages, then the first stage can be 1s, the second stage can be 1s, and the third stage can be 3s, or the first stage can be 1s, the second stage can be 2s, and the third stage can be 2s. According to different application scenarios, the transition time of each stage can be flexibly changed, and in some embodiments of the present disclosure, the transition time is not limited.
[0081] S306 : In response to the transition distance being greater than a preset transition distance threshold, determining a transition speed change coefficient based on the transition distance and a preset time.
[0082] The transition speed variation coefficient is usually a coefficient used to describe how the transition speed changes. In a variable speed linear transition, the transition speed is not constant, and this coefficient determines the linear law of the speed change, such as the degree of acceleration or deceleration.
[0083] Specifically, when the transition distance is greater than the preset transition distance threshold, the system will calculate the transition speed change coefficient based on the transition distance and the preset time. This coefficient will be used for the subsequent variable speed linear transition. In this way, it can be ensured that at a longer transition distance, the transition process can be completed within the preset time and has a reasonable speed change law. Taking position transition as an example, suppose an object is to move from point A to point B, and the transition direction is from A to B. Assume that the transition distance is d and the preset time is t. In the variable speed linear transition, the relationship between speed and time can be expressed as v=kt+v0 (k is the transition speed change coefficient, v0 is the initial speed, and here the initial speed is assumed to be 0 for ease of calculation). According to the kinematic formula in physics It can be deduced that k = 2d / t 2 It will be understood that the above is for illustration only.
[0084] S308: Determine a first transition mode based on the transition speed change coefficient and the speed-varying linear transition type and in accordance with the transition direction.
[0085] Specifically, after determining the transition speed change coefficient, a variable speed linear transition type may be adopted according to the transition speed change coefficient, and the first transition mode may be determined according to the transition direction.
[0086] In this embodiment, a variable speed linear transition type and a calculated transition speed variation coefficient are used. The object may start at a slower speed at the beginning and then gradually speed up, or start quickly and then gradually slow down. This linear change in speed makes the movement of the object look more natural and avoids the unreality caused by sudden acceleration or deceleration. By determining the transition speed variation coefficient by a preset time, the rhythm of the transition can be accurately controlled. Whether it is a fast scene switch or a slow state evolution, the preset time can be adjusted according to specific needs, thereby achieving effective control of the transition speed and rhythm, so that the entire transition process is more in line with the requirements of the application scenario.
[0087] In one embodiment, the position relationship includes: a distance relationship and an angle relationship; the angle relationship generally refers to the angle formed by the line between the first focus and the second focus and a reference direction (such as the horizontal axis or vertical axis of the image). It describes the relative direction change of the two foci in space. The nonlinear transition type includes: Bezier curves, such as Figure 4 As shown, the transitioning of the first picture to the second picture based on the transition mode includes:
[0088] S402: In response to the distance relationship being greater than a preset distance threshold, and / or the angle relationship being greater than a preset angle threshold, determining at least one intermediate control point based on a line between the first focus and the second focus and a preset length threshold.
[0089] S404: Based on the at least one intermediate control point, the first focus, and the second focus, select the Bezier curve to transition the first picture to a second picture, wherein the second focus is located at the center of the second picture.
[0090] The intermediate control point may be a point located on or near the line between the first focus and the second focus, and is used to control the shape of the Bezier curve. By properly setting the intermediate control point, the Bezier curve can better adapt to the distance and angle changes between the focuses and achieve a smooth transition.
[0091] Specifically, the distance between the first focus and the second focus, and the angle between the line between them and the reference direction are calculated, and compared with the preset distance threshold and angle threshold respectively. As long as the distance relationship is greater than the preset distance threshold, or the angle relationship is greater than the preset angle threshold, the process of determining the intermediate control point is triggered. Based on the line between the first focus and the second focus, the first focus is used as the starting point, and the first intermediate control point is determined according to the preset length threshold along the direction of the line. If multiple intermediate control points are required (for example, when the distance or angle between the focuses changes too much), other intermediate control points are continued to be determined on the line according to a certain rule (such as equal spacing). After determining at least one intermediate control point, a Bezier curve can be defined in combination with the first focus and the second focus. If there is one intermediate control point, a quadratic Bezier curve can be used; if there are multiple intermediate control points, a higher-order Bezier curve is used. When implementing the picture transition, t gradually changes from 0 to 1 as time goes by. In each frame, the corresponding point on the Bezier curve is calculated according to the current value. This point indicates the position where the focus should be at the current moment. Then, according to the change of the focus position, the picture is adjusted accordingly, such as recomposing, adjusting the display of picture elements, etc., so as to achieve a smooth transition from the first picture to the second picture, and finally make the second focus located in the center of the second picture.
[0092] In some exemplary embodiments, Figure 5 As shown, A is the first focus, B is the second focus, AB is the line between the first focus and the second focus. If the preset length is 3 cm, the intermediate control point can be determined at any position on the edge of the circle C1 at point C with a radius of 3 cm. For example, the intermediate control points can be D1, D2 and D3.
[0093] In this embodiment, by introducing the intermediate control point and using the Bezier curve, a smooth transition of the focus from the first focus to the second focus located in the center of the second screen can be achieved when the distance between the focuses is far or the angle changes greatly. This transition method avoids the stiffness caused by direct switching, making the screen transition more natural and smooth, and conforming to the visual habits of the human eye. The number and position of the intermediate control points are dynamically determined according to the distance relationship and the angle relationship, so that the system can flexibly adapt to different focus changes. Whether it is a small range of focus movement or a large focus jump, it can be optimized through a reasonable Bezier curve to ensure the quality of the transition effect.
[0094] In one embodiment, the position relationship includes: a distance relationship; the linear transition type includes: a linear difference; and linear interpolation is a method of performing numerical estimation between two known data points. The transition from the first picture to the second picture based on the transition method includes:
[0095] In response to the distance relationship being less than a preset distance threshold, a transition ratio is determined according to the distance between the first focus and the second focus, and the first picture is transitioned to the second picture according to the transition ratio and using the linear difference, wherein the second focus is located at the center of the second picture.
[0096] Among them, the transition ratio generally refers to the ratio of change in a unit time, which can be a ratio value determined according to the distance between the first focus and the second focus. The ratio value is used to control the degree of transition of the picture from the first focus state to the second picture state with the second focus in the center during the transition process. For example, if the distance is close, the transition ratio may be relatively large, which means that the picture transitions to the second picture faster; conversely, when the distance is slightly farther, the transition ratio may be smaller, and the transition process is relatively smooth. According to the distance between the first focus and the second focus, the farther the distance, the larger the transition ratio is usually, and the closer the distance, the smaller the transition ratio is usually. For example, the distance d can be mapped to the transition ratio according to a preset rule or function. For example, a simple inverse proportional relationship p=k / d can be set (k is a constant, which can be adjusted according to actual needs to ensure that the transition ratio is within a reasonable range), or a more complex function can be used to make the relationship between the transition ratio and the distance more in line with the actual scene requirements.
[0097] Specifically, the distance between the first focus and the second focus can be calculated. Assume that the position coordinates of a key element (related to the focus) in the first picture are (x1, y1), and the ideal position coordinates of the corresponding element in the second picture centered on the second focus are (x2, y2). In each frame during the transition process, the current position coordinates (x, y) of the element are calculated according to the transition ratio p, and the formula is x=x1+p(x2-x1), y=y1+p(y2-y1). By continuously updating the position of the element, a smooth transition of the element position in the picture from the position related to the first focus to the position centered on the second focus is achieved.
[0098] In this embodiment, when the distance relationship is less than the preset distance threshold, the transition ratio is determined according to the distance between the focal points, and the screen transition is achieved by using a linear difference method. This means that the transition from the first screen to the second screen is smooth and continuous. For example, the position, color and other attributes of the object in the screen will gradually change according to the linear law as the transition ratio changes, without sudden changes or jumps, so that the user can naturally feel that the screen focus moves smoothly from the first focus to the second focus located in the center of the second screen.
[0099] In one embodiment, in response to the panoramic camera entering the planar shooting mode, the method further includes:
[0100] The shooting field of view of the panoramic camera is fixed at the shooting direction of the panoramic camera.
[0101] The shooting direction of the panoramic camera can usually be the direction of the lens, that is, the direction of the northern hemisphere. The system locks the field of view to the top area of the camera (defined as the northern hemisphere) by default, so that the user can use the panoramic camera to point to the target, so that the focus can be accurately and quickly locked in the subsequent use of the panoramic camera.
[0102] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed 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 part of the steps or stages in other steps.
[0103] Based on the same inventive concept, the embodiment of the present disclosure also provides a panoramic shooting angle control device for implementing the panoramic shooting angle control method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more panoramic shooting angle control device embodiments provided below can refer to the limitations of the panoramic shooting angle control method above, and will not be repeated here.
[0104] In one embodiment, Figure 6 As shown, a panoramic shooting angle control device 600 is provided, comprising: an image adjustment module 602, a focus determination module 604, a transition mode determination module 606 and a transition module 608, wherein:
[0105] The picture adjustment module 602 is used to obtain a first panoramic image of the panoramic camera at a current moment in response to the panoramic camera entering a planar shooting mode, determine a first focus based on the first panoramic image, and use the first focus to adjust the panoramic picture in the panoramic camera at the current moment to obtain a first picture.
[0106] The focus determination module 604 is used to obtain the movement speed, movement trajectory and a second panoramic image after the movement of the panoramic camera in response to detecting the movement of the panoramic camera, and determine a second focus based on the second panoramic image.
[0107] The transition mode determination module 606 is used to determine the transition mode according to the moving speed and moving trajectory of the panoramic camera and the positional relationship between the first focus and the second focus.
[0108] The transition module 608 is used to transition the first picture to a second picture based on the transition method, where the second picture is determined according to the second focus.
[0109] In one embodiment of the device, the transition mode determination module 606 includes:
[0110] A transition data determination module, used to determine a transition direction and a transition distance based on the position relationship and the movement trajectory;
[0111] a first transition mode determination module, configured to determine, in response to a moving speed of the panoramic camera being greater than a preset speed threshold, that a transition type is a nonlinear transition type, and determine a first transition mode based on the transition direction, transition distance, and moving speed and according to the nonlinear transition type;
[0112] The second transition mode determination module is used to determine that the transition type is a linear transition type in response to the moving speed of the panoramic camera being less than a preset speed threshold, and to determine the second transition mode based on the transition mode, transition distance and moving speed and according to the linear transition type.
[0113] In one embodiment of the device, the first transition mode determination module includes:
[0114] The first submodule is used to determine a first transition mode according to the transition direction, the transition distance and the uniform linear transition type in response to the transition distance being less than a preset transition distance threshold.
[0115] The second submodule is used to select at least one transition point in the transition direction in response to the transition distance being greater than a preset transition distance threshold, and determine a first transition mode according to the at least one transition point, the transition distance and the speed-changing linear transition type, and according to the transition direction.
[0116] The third submodule is used to determine a transition speed change coefficient based on the transition distance and a preset time in response to the transition distance being greater than a preset transition distance threshold; and to determine a first transition mode based on the transition speed change coefficient and the variable speed linear transition type and according to the transition direction.
[0117] In one embodiment of the device, the positional relationship includes: a distance relationship and an angle relationship; the nonlinear transition type includes: a Bezier curve, and the transition module 608 is further used to determine at least one intermediate control point based on a line between the first focus and the second focus and a preset length threshold in response to the distance relationship being greater than a preset distance threshold, and / or the angle relationship being greater than a preset angle threshold; based on the at least one intermediate control point, the first focus and the second focus, select the Bezier curve to transition the first screen to the second screen, wherein the second focus is located at the center of the second screen.
[0118] In one embodiment of the device, the position relationship includes: a distance relationship; the linear transition type includes: a linear difference. The transition module 608 is further configured to, in response to the distance relationship being less than a preset distance threshold, determine a transition ratio according to the distance between the first focus and the second focus, and transition the first picture to the second picture according to the transition ratio and using the linear difference, wherein the second focus is located at the center of the second picture.
[0119] In one embodiment of the device, the device further comprises: a field of view fixing module, configured to fix the shooting field of view of the panoramic camera at the shooting direction of the panoramic camera.
[0120] Each module in the above-mentioned panoramic shooting angle control device can be implemented in whole or in part by software, hardware or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each of the above modules.
[0121] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 7 As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, 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, a method for controlling the viewing angle of a panoramic shooting 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 covered on the display screen, or a key, trackball or touchpad set on the housing of the computer device, or an external keyboard, touchpad or mouse, etc.
[0122] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the scheme of the present disclosure, and does not constitute a limitation on the computer device to which the scheme of the present disclosure is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0123] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in any of the above method embodiments when executing the computer program.
[0124] 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 any of the above method embodiments are implemented.
[0125] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in any of the above method embodiments when executed by a processor.
[0126] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed 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 the memory, database or other medium used in the embodiments provided by the present disclosure can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an 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 by the present disclosure may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited thereto. The processor involved in each embodiment provided by the present disclosure may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited thereto.
[0127] The technical features of the above embodiments may 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.
[0128] The above-described embodiments only express several implementation methods of the present disclosure, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present invention. It should be pointed out that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present disclosure, and these all belong to the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure shall be subject to the attached claims.
Claims
1. A panoramic shooting viewing angle control method, characterized in that: The method is applied to a panoramic camera, and the method comprises: In response to the panoramic camera entering a planar shooting mode, acquiring a first panoramic image of the panoramic camera at a current moment, determining a first focus based on the first panoramic image, and adjusting a panoramic picture in the panoramic camera at a current moment by using the first focus to obtain a first picture; In response to detecting the movement of the panoramic camera, acquiring a moving speed, a moving trajectory, and a second panoramic image after the movement of the panoramic camera, and determining a second focus based on the second panoramic image; Determining a transition mode according to a moving speed and a moving trajectory of the panoramic camera and a positional relationship between the first focus and the second focus; Based on the transition mode, the first picture is transitioned to a second picture, where the second picture is determined according to the second focus.
2. The method according to claim 1, characterized in that The determining of the transition mode according to the moving speed and moving trajectory of the panoramic camera and the positional relationship between the first focus and the second focus includes: Based on the position relationship and the movement trajectory, determining a transition direction and a transition distance; In response to the moving speed of the panoramic camera being greater than a preset speed threshold, determining that the transition type is a nonlinear transition type, and determining a first transition mode based on the transition direction, the transition distance and the moving speed and according to the nonlinear transition type; In response to the moving speed of the panoramic camera being less than a preset speed threshold, the transition type is determined to be a linear transition type, and based on the transition mode, transition distance and the moving speed, and according to the linear transition type, a second transition mode is determined.
3. The method according to claim 2, characterized in that The linear transition type includes: a uniform linear transition type and a variable linear transition type. The second transition mode is determined based on the transition mode, the transition distance and the moving speed and according to the linear transition type, including: In response to the transition distance being less than a preset transition distance threshold, determining a first transition mode according to the transition direction, the transition distance and the uniform linear transition type; In response to the transition distance being greater than a preset transition distance threshold, selecting at least one transition point in the transition direction, and determining a first transition mode according to the at least one transition point, the transition distance, and the variable speed linear transition type, and according to the transition direction; In response to the transition distance being greater than a preset transition distance threshold, determining a transition speed change coefficient based on the transition distance and a preset time; Determining a first transition mode based on the transition speed change coefficient and the speed-varying linear transition type and according to the transition direction; The transition distance threshold is determined according to the moving speed and a preset time.
4. The method according to claim 2, characterized in that: The position relationship includes: a distance relationship and an angle relationship; the nonlinear transition type includes: a Bezier curve; based on the transition method, transitioning the first picture to the second picture includes: In response to the distance relationship being greater than a preset distance threshold, and / or the angle relationship being greater than a preset angle threshold, determining at least one intermediate control point based on a line between the first focus and the second focus and a preset length threshold; Based on the at least one intermediate control point, the first focus, and the second focus, the Bezier curve is selected to transition the first picture to a second picture, wherein the second focus is located at the center of the second picture.
5. The method according to claim 2, characterized in that: The positional relationship includes: a distance relationship; The linear transition type includes: linear difference; the transition from the first picture to the second picture based on the transition mode includes: In response to the distance relationship being less than a preset distance threshold, a transition ratio is determined according to the distance between the first focus and the second focus, and the first picture is transitioned to the second picture according to the transition ratio and using the linear difference, wherein the second focus is located at the center of the second picture.
6. The method according to claim 1, characterized in that After the panoramic camera enters the planar shooting mode, the method further includes: The shooting field of view of the panoramic camera is fixed at the shooting direction of the panoramic camera.
7. A panoramic shooting viewing angle control device, characterized in that: The device is applied to a panoramic camera, and comprises: a picture adjustment module, configured to obtain a first panoramic image of the panoramic camera at a current moment in response to the panoramic camera entering a planar shooting mode, determine a first focus based on the first panoramic image, and use the first focus to adjust the panoramic picture in the panoramic camera at the current moment to obtain a first picture; a focus determination module, configured to, in response to detecting movement of the panoramic camera, obtain a moving speed, a moving trajectory, and a second panoramic image after the movement of the panoramic camera, and determine a second focus based on the second panoramic image; A transition mode determination module, used to determine a transition mode according to a moving speed and a moving trajectory of the panoramic camera and a positional relationship between the first focus and the second focus; A transition module is used to transition the first picture to a second picture based on the transition method, where the second picture is determined according to the second focus.
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.
Citation Information
Patent Citations
Image device and display mehtod
CN101312501A
Transition processing method and device for panoramic switching, equipment and medium
CN115131472A
Video processing method and device, computer equipment, storage medium and program product
CN118869905A