Virtual camera adjustment method and device
By simulating a physical three-dimensional space and creating a virtual three-dimensional space on a computing device, the focus of the virtual camera is adjusted in real time, solving the problem of virtual focus matching in virtual shooting, achieving efficient and accurate automatic focus adjustment, and is suitable for a variety of screen shapes.
Patent Information
- Application Number
- CN202311447091.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-01
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2043-11-01
AI Technical Summary
In virtual shooting based on a physical screen, it is difficult to manually adjust the shooting parameters of the virtual camera accurately and timely, especially when the physical camera moves in a large range or in a non-flat screen scene, making it difficult to match the virtual focus effect.
By simulating the physical three-dimensional space on the computing device, a virtual three-dimensional space and a virtual screen model corresponding to the physical screen are created, the focus position of the physical camera is determined in real time, and the focus position of the virtual camera is adjusted according to preset conditions to make it consistent with the virtual screen model The distance between them is smaller than the distance between the focus of the physical camera and the screen to achieve automatic focus adjustment.
It improves the efficiency and accuracy of virtual camera focus adjustment, is suitable for screens of various shapes, reduces the frequency and calculation amount of focus adjustment, and ensures real-time performance and optimization of virtual focus effects.
Smart Images

Figure CN117528236B_ABST
Abstract
Description
Technical Field
[0001] One or more embodiments of the present disclosure relate to the field of virtual shooting technology, and in particular, to a method and device for adjusting a virtual camera. Background Art
[0002] Virtual shooting based on physical screens is an emerging film and television shooting technology that combines physical screens (such as LED screens or LCD screens), real-time computer graphics (Real-time Computer Graphics) and traditional photography techniques. In this technology, the physical screen is used as a background to display a pre-designed virtual scene, so that actors and cameras can interact directly with this virtual scene. The display image of this virtual scene on the physical screen is rendered in real time by a computer and can be adjusted in real time according to the needs of the shooting. This technology allows filmmakers to see the final visual effects on the set without having to wait until the post-production stage. In this way, directors and actors can better control the camera and performance during shooting to achieve the desired effect.
[0003] When performing virtual shooting based on a physical screen, it is usually necessary to create a virtual camera in a computer and render the display image of the virtual scene on the physical screen based on the shooting-related data of the virtual camera, which can be regarded as an image obtained by simulating the shooting of the virtual scene by the virtual camera through the physical screen. The physical camera is used to shoot the physical screen, specifically the real scene and the display image on the physical screen. In actual applications, the shooting parameters of the physical camera often change, such as the focus distance or aperture is adjusted according to the actual shooting needs, and the staff needs to manually adjust the shooting parameters of the virtual camera to achieve the harmony of the shooting picture. For example, the physical foreground in front of the physical screen shot by the physical camera must be coordinated with the perspective relationship of the virtual scene displayed on the physical screen, and the degree of defocus must be aligned. However, manual operation often cannot achieve the desired shooting effect accurately and timely. Moreover, in some scenarios, even if the shooting parameters of the physical camera and the virtual camera are completely aligned, other problems may occur. For example, the physical camera may set the focus on the foreground object in front of the physical screen instead of the physical screen due to shooting needs. If the shooting parameters of the virtual camera are set to the shooting parameters of the physical camera, the virtual scene presented on the physical screen will be out of focus. Summary of the invention
[0004] One or more embodiments of the present disclosure provide the following technical solutions:
[0005] The present disclosure provides a method for adjusting a virtual camera, which is applied to a data processing program running on a computing device; a virtual three-dimensional space corresponding to a physical three-dimensional space is simulated on the computing device; a virtual screen model corresponding to a physical screen is created in the virtual three-dimensional space; the method comprises:
[0006] Creating a virtual camera corresponding to the physical camera used to shoot the physical screen in the virtual three-dimensional space; wherein the physical screen is used to display an image obtained by the virtual camera simulating the shooting of a preset virtual scene; and the internal parameters of the virtual camera are consistent with the internal parameters of the physical camera;
[0007] Determining in real time the relative position relationship between the first focus of the physical camera and the physical screen;
[0008] If the first focus is located in front of the physical screen and the distance between the first focus and the physical screen meets a preset condition, the position of the second focus of the virtual camera is adjusted so that the distance between the second focus and the virtual screen model is smaller than the distance between the first focus and the physical screen.
[0009] The present disclosure also provides a virtual camera adjustment device, which is applied to a data processing program running on a computing device; the computing device simulates a virtual three-dimensional space corresponding to the physical three-dimensional space; a virtual screen model corresponding to the physical screen is created in the virtual three-dimensional space; the device comprises:
[0010] A creation module, used to create a virtual camera corresponding to the physical camera used to shoot the physical screen in the virtual three-dimensional space; wherein the physical screen is used to display an image obtained by the virtual camera simulating the shooting of a preset virtual scene; and the internal parameters of the virtual camera are consistent with the internal parameters of the physical camera;
[0011] A determination module, used to determine in real time the relative position relationship between the first focus of the physical camera and the physical screen;
[0012] An adjustment module is used to adjust the position of the second focus of the virtual camera when the first focus is located in front of the physical screen and the distance between the first focus and the physical screen meets a preset condition, so that the distance between the second focus and the virtual screen model is smaller than the distance between the first focus and the physical screen.
[0013] The present disclosure also provides an electronic device, comprising:
[0014] processor;
[0015] a memory for storing processor-executable instructions;
[0016] The processor implements the steps of any of the above methods by running the executable instructions.
[0017] The present disclosure also provides a computer-readable storage medium having computer instructions stored thereon, which implement the steps of any of the above methods when executed by a processor.
[0018] In the above technical solution, a virtual three-dimensional space corresponding to the physical three-dimensional space can be simulated on the computing device, and a virtual screen model corresponding to the physical screen in the physical three-dimensional space can be created in the virtual three-dimensional space; the data processing program on the computing device can further create a virtual camera corresponding to the physical camera in the physical three-dimensional space in the virtual three-dimensional space, wherein the virtual camera can be used to simulate shooting of a preset virtual scene, and display the simulated shot image through a physical screen, and the physical camera can be used to shoot the physical screen, and the internal parameters of the virtual camera are consistent with the internal parameters of the physical camera; after the virtual camera is created, the relative position relationship between the first focus of the physical camera and the physical screen can be determined in real time, and when it is determined that the first focus is located in front of the physical screen and the distance between the first focus and the physical screen meets certain conditions, the position of the second focus of the virtual camera is adjusted so that the distance between the second focus and the virtual screen model is less than the distance between the first focus and the physical screen, so as to complete the real-time adjustment of the position of the second focus of the virtual camera.
[0019] By adopting this method, when realizing virtual shooting, on the one hand, the focus position of the created virtual camera corresponding to the physical camera can be automatically adjusted according to the focus position of the current physical camera to reduce the out-of-focus effect of the image captured by the virtual camera, thus avoiding the need to manually set the offset distance for the focus of the virtual camera. Therefore, the adjustment efficiency and accuracy are relatively high, which is suitable for scenes where the physical camera moves over a large range and can be adapted to screens of various shapes. On the other hand, the focus position of the virtual camera can be adjusted in real time only when the focus of the physical camera is in front of the physical screen and the distance between the physical camera and the physical screen meets certain conditions, so as to reduce the frequency of adjusting the focus of the virtual camera and reduce the required amount of calculation, thereby ensuring the real-time nature of each adjustment. After each adjustment, the distance between the focus of the adjusted virtual camera and the virtual screen model is made smaller than the distance between the focus of the physical camera and the physical screen, so as to reduce the out-of-focus effect of the image captured by the virtual camera. In this way, both real-time nature and accuracy can be taken into account when adjusting the focus position of the virtual camera. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The following is a description of the accompanying drawings required for describing the exemplary embodiments, wherein:
[0021] Figure 1 A schematic diagram showing an application scenario according to an embodiment of the present disclosure.
[0022] Figure 2 A flowchart of a method for adjusting a virtual camera according to an embodiment of the present disclosure is shown.
[0023] Figure 3 A schematic diagram showing a physical camera and a physical screen according to an embodiment of the present disclosure is shown.
[0024] Figure 4 A schematic diagram showing another physical camera and a physical screen according to an embodiment of the present disclosure is shown.
[0025] Figure 5 A schematic structural diagram of a device according to an embodiment of the present disclosure is shown.
[0026] Figure 6 A block diagram of a virtual camera adjustment device according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0027] Here, exemplary embodiments will be described in detail, and examples thereof are shown in the accompanying drawings. When the following description relates to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with one or more embodiments of the present disclosure. On the contrary, they are only examples consistent with some aspects of one or more embodiments of the present disclosure.
[0028] It should be noted that in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in the present disclosure. In some other embodiments, the steps included in the method may be more or less than those described in the present disclosure. In addition, a single step described in the present disclosure may be decomposed into multiple steps for description in other embodiments; and multiple steps described in the present disclosure may also be combined into a single step for description in other embodiments.
[0029] When performing virtual shooting based on a physical screen, it is usually necessary to create a virtual camera in a computer and render the display image of the virtual scene on the physical screen according to the shooting-related data of the virtual camera, which can be regarded as an image obtained by simulating the shooting of the virtual scene by the virtual camera through the physical screen. The physical camera is used to shoot the physical screen, specifically the real scene (i.e. the scene in the real world) and the display image on the physical screen. In practical applications, it is usually hoped to increase the degree of reality of the virtual scene in the image captured by the physical camera as much as possible to achieve harmony in the captured picture. This degree of reality includes both the matching degree of the spatial position and perspective relationship of the virtual and real objects, and the matching degree of the defocus effect. Therefore, it is necessary to ensure that the defocus effect of the virtual camera and the defocus effect of the physical camera are matched in real time.
[0030] Defocus is a photography term, which means that during the shooting process, the main part of the captured image is not presented clearly, but becomes blurred or distorted because the focus of the camera lens deviates from the subject being photographed. Defocus is usually caused by the focus of the camera lens not matching the actual position of the subject being photographed. However, defocus is not always negative, and in some special cases, defocus effects are deliberately created to achieve a certain artistic effect, for example: to create an abstract and dreamy atmosphere.
[0031] In the related technology, it is usually required that the shooting-related data of the virtual camera and the physical camera are consistent. The shooting-related data may include internal parameters such as focal length, optical center offset, distortion parameters, pixel size, and external parameters such as position data and posture data (e.g., rotation angle), and may also include adjustable shooting parameters such as focus and aperture.
[0032] During the shooting process, since it is usually necessary to shoot from different positions and angles, the shooting parameters of the physical camera will often change, such as the focus distance or aperture will be adjusted according to the actual shooting needs. In order to make the shooting parameters of the virtual camera and the physical camera consistent, the staff needs to manually adjust the shooting parameters of the virtual camera.
[0033] However, manual operation often cannot achieve the desired shooting effect accurately and timely. Moreover, in some scenarios, even if the shooting parameters of the two are completely aligned, other problems may arise. For example, the physical camera may set the focus on the foreground object in front of the physical screen instead of the physical screen due to shooting needs. If the shooting parameters of the virtual camera are set to the shooting parameters of the physical camera, the image captured by the virtual camera will have a defocused effect, and the virtual scene presented on the physical screen will also appear defocused.
[0034] In addition, since the manual adjustment of the shooting parameters of the virtual camera requires manual estimation of the appropriate position of the focus of the virtual camera, which is quite difficult, the manual adjustment method is obviously difficult to apply to scenes where the physical camera moves over a large range, and is usually only suitable for flat screens. For screens of other shapes such as curved screens and tri-fold screens, since the shapes of these screens are not flat, it further increases the difficulty of manually estimating the appropriate position of the focus of the virtual camera, and therefore these screens are usually not suitable.
[0035] One or more embodiments of the present disclosure provide a technical solution for adjusting a virtual camera. In the technical solution, a virtual three-dimensional space corresponding to a physical three-dimensional space can be simulated on a computing device, and a virtual screen model corresponding to a physical screen in the physical three-dimensional space can be created in the virtual three-dimensional space; a data processing program on the computing device can further create a virtual camera corresponding to a physical camera in the physical three-dimensional space in the virtual three-dimensional space, wherein the virtual camera can be used to simulate shooting of a preset virtual scene, and the simulated shot image is displayed through a physical screen, and the physical camera can be used to shoot the physical screen, and the internal parameters of the virtual camera are consistent with the internal parameters of the physical camera; after the virtual camera is created, the relative position relationship between the first focus of the physical camera and the physical screen can be determined in real time, and when it is determined that the first focus is located in front of the physical screen and the distance between the first focus and the physical screen meets certain conditions, the position of the second focus of the virtual camera is adjusted so that the distance between the second focus and the virtual screen model is less than the distance between the first focus and the physical screen, so as to complete the real-time adjustment of the position of the second focus of the virtual camera.
[0036] By adopting this method, when realizing virtual shooting, on the one hand, the focus position of the created virtual camera corresponding to the physical camera can be automatically adjusted according to the focus position of the current physical camera to reduce the out-of-focus effect of the image captured by the virtual camera, thus avoiding the need to manually set the offset distance for the focus of the virtual camera. Therefore, the adjustment efficiency and accuracy are relatively high, which is suitable for scenes where the physical camera moves over a large range and can be adapted to screens of various shapes. On the other hand, the focus position of the virtual camera can be adjusted in real time only when the focus of the physical camera is in front of the physical screen and the distance between the physical camera and the physical screen meets certain conditions, so as to reduce the frequency of adjusting the focus of the virtual camera and reduce the required amount of calculation, thereby ensuring the real-time nature of each adjustment. After each adjustment, the distance between the focus of the adjusted virtual camera and the virtual screen model is made smaller than the distance between the focus of the physical camera and the physical screen, so as to reduce the out-of-focus effect of the image captured by the virtual camera. In this way, both real-time nature and accuracy can be taken into account when adjusting the focus position of the virtual camera.
[0037] The technical solutions provided by one or more embodiments of the present disclosure are described in detail below.
[0038] Please refer to Figure 1 , Figure 1 A schematic diagram showing an application scenario according to an embodiment of the present disclosure.
[0039] like Figure 1 As shown, the virtual shooting system includes three physical screens (021, 022, 023), and the mobile terminal 01 can establish communication connections with the three physical screens (021, 022, 023) respectively, and the mobile terminal 01 can also establish a communication connection with the computing device 03. The mobile terminal 01 can control each physical screen to display an identification graphic array and send multiple screen images obtained by image acquisition of each physical screen to the computing device 03, and the computing device 03 can generate and display virtual screen models corresponding to the three physical screens (021, 022, 023) according to the multiple screen images sent by the mobile terminal 01.
[0040] The physical screen used in the virtual shooting system may be an LED display screen, a liquid crystal (LCD) display screen, etc., and may be a curved screen or a flat screen. It should be understood that those skilled in the art can customize the type, quantity, size, resolution, etc. of the physical screen in the virtual shooting system according to actual needs, and the embodiments of the present disclosure are not limited to this. It should be understood that the embodiments of the present disclosure are not limited to the communication connection method between devices.
[0041] In addition, the virtual shooting system also includes a physical camera 04. Similarly, the computing device 03 can generate and display a virtual camera corresponding to the physical camera 04. The physical camera 04 can shoot the three physical screens (021, 022, 023) under the operation of the person responsible for shooting. The physical camera 04 can also establish a communication connection with the computing device 03.
[0042] It should be noted that a virtual three-dimensional space (e.g., a virtual three-dimensional space that restores the physical three-dimensional space in a 1:1 manner) corresponding to the physical three-dimensional space (i.e., the real three-dimensional space in the real world) can be simulated on the computing device 03. The three physical screens (021, 022, 023) and the physical camera 04 are real objects in the physical three-dimensional space, while the virtual screen model and the virtual camera are virtual objects created in the virtual three-dimensional space.
[0043] Please refer to Figure 2 , Figure 2 A flowchart of a method for adjusting a virtual camera according to an embodiment of the present disclosure is shown.
[0044] In this embodiment, the above-mentioned virtual camera adjustment method can be implemented in a virtual shooting system. The virtual shooting system may include a physical camera, a physical screen and a computing device in a physical three-dimensional space, and the computing device may simulate a virtual three-dimensional space corresponding to the physical three-dimensional space. The virtual shooting system may also include a virtual screen model corresponding to the physical screen and a virtual camera corresponding to the physical camera created in the virtual three-dimensional space.
[0045] It should be noted that the above-mentioned virtual screen model can be a three-dimensional model rendered in the above-mentioned virtual three-dimensional space that is consistent with the appearance, position, etc. of the above-mentioned physical screen in the above-mentioned physical three-dimensional space; the above-mentioned virtual camera can be a three-dimensional model rendered in the above-mentioned virtual three-dimensional space that is consistent with the appearance, position, etc. of the above-mentioned physical camera in the above-mentioned physical three-dimensional space.
[0046] The virtual camera can be used to simulate shooting of a pre-designed virtual scene, and map the simulated image to a virtual screen model, and then render it to a physical screen for display. Since the virtual screen model and the physical screen parameters are consistent, mapping to the virtual screen model first can make the rendered image compatible with the physical screen. Accordingly, the physical camera can be used to shoot the physical screen, and the image captured by the physical camera will contain the virtual scene part.
[0047] The above virtual camera adjustment method can be applied to a data processing program running on the above computing device, and can specifically include the following steps:
[0048] Step 201: Create a virtual camera in the virtual three-dimensional space corresponding to the physical camera used to shoot the physical screen; wherein the physical screen is used to display an image obtained by the virtual camera simulating shooting of a preset virtual scene; and the internal parameters of the virtual camera are consistent with the internal parameters of the physical camera.
[0049] In this embodiment, in order to finally realize virtual shooting, the data processing program running on the computing device may create the virtual camera corresponding to the physical camera in the virtual three-dimensional space.
[0050] It should be noted that the virtual camera and the physical camera have the same internal parameters such as focal length, optical center offset, distortion parameter, pixel size, etc. Since the internal parameters of the virtual camera and the physical camera are consistent, the image captured by the virtual camera can be consistent with the image captured by the physical camera in terms of resolution, viewing angle, perspective effect and compression effect, so that the physical foreground in the picture taken by the physical camera and the virtual scene displayed on the physical screen are visually harmonious.
[0051] In addition, the position data, posture data and other external parameters of the virtual camera in the virtual three-dimensional space are consistent with the position data, posture data and other external parameters of the physical camera in the physical three-dimensional space. Similarly, the shape, size, position data and other data of the virtual screen model in the virtual three-dimensional space are consistent with the shape, size, position data and other data of the physical screen in the physical three-dimensional space.
[0052] That is, in some embodiments, when creating the virtual camera corresponding to the physical camera in the virtual three-dimensional space, the virtual camera corresponding to the physical camera may be initialized and created in the virtual three-dimensional space. At this time, the internal parameters of the initialized virtual camera should be consistent with the internal parameters of the physical camera, but the external parameters of the virtual camera may be random data, and the external parameters of the virtual camera may be adjusted to be consistent with the external parameters of the physical camera later.
[0053] When adjusting the external parameters of the virtual camera, the relative position relationship between the physical camera in the above-mentioned physical three-dimensional space and the above-mentioned physical screen can be determined in real time first, that is, the relative position relationship between the physical camera and the physical screen at the current moment can be determined. Subsequently, the position of the virtual camera in the virtual three-dimensional space can be adjusted to a position corresponding to the virtual screen model (which can be called a target position), wherein the relative position relationship between the target position and the virtual screen model is consistent with the relative position relationship between the physical camera and the physical screen at the current moment. In practical applications, the relative position relationship between the physical camera and the physical screen can include not only the position of the center point of the physical camera relative to the physical screen, but also the rotation angle of the lens of the physical camera relative to the physical screen. In this way, the external parameters of the virtual camera can be kept consistent with the external parameters of the physical camera.
[0054] In some embodiments, the physical camera may be equipped with a tracking system.
[0055] Among them, the above-mentioned tracking system can be implemented based on a combination of software and hardware. For example, the tracking system may include a distance sensor, a steering angle sensor and a computing chip. The distance sensor and the steering angle sensor first collect the motion data of the above-mentioned physical camera in real time, and then the computing chip performs real-time calculations based on the collected motion data to obtain the external parameters of the physical camera, and sends the external parameters of the physical camera to the data processing program running on the above-mentioned computing device in real time. Of course, the collected motion data can also be summarized by the computing chip alone, and sent to the data processing program in real time, and the data processing program performs real-time calculations based on the motion data to obtain the external parameters of the physical camera.
[0056] The data processing program running on the computing device can obtain the external parameters of the physical camera sent by the tracking system in real time, and obtain the position data of the physical screen. Subsequently, the relative position relationship between the physical camera and the physical screen can be determined based on the external parameters of the physical camera at the current moment and the position data of the physical screen at the current moment.
[0057] It should be noted that, since the above-mentioned physical screen is usually a large screen and difficult to move, the position of the physical screen usually does not change. In this case, there is no need to obtain the position data of the physical screen in real time, but the position data of the physical screen can be obtained in advance and stored, and the stored position data of the physical screen can be used to determine the relative position relationship between the physical camera and the physical screen later.
[0058] Step 202: Determine in real time the relative position relationship between the first focus of the physical camera and the physical screen.
[0059] In this embodiment, after the above-mentioned virtual camera is created, the focus and aperture and other shooting-related data can be set for the virtual camera, so that the virtual camera can perform simulated shooting operations. In this case, the data processing program running on the above-mentioned computing device can determine the relative position relationship between the focus of the physical camera (which can be called the first focus) and the above-mentioned physical screen in real time, so as to adjust the position of the focus of the virtual camera according to the relative position relationship. Specifically, the position of the first focus in the above-mentioned physical three-dimensional space at the current moment can be determined, and after determining the position of the first focus in the physical three-dimensional space, the relative position relationship between the first focus in the physical three-dimensional space and the above-mentioned physical screen at the current moment can be further determined.
[0060] In some embodiments, when determining the relative positional relationship between the first focus of the physical camera and the physical screen in real time, since the physical camera is equipped with the tracking system, the external parameters of the physical camera can be first obtained in real time through the tracking system, and the distance (referred to as the first distance) between the first focus in the physical three-dimensional space and the physical camera (specifically, the lens of the physical camera) can be obtained in real time. The first distance can be determined in real time by the physical camera itself and sent to the data processing program; or the first distance can be calculated by the data processing program based on the displacement and angle of the lens of the physical camera at the current moment.
[0061] Subsequently, the position of the first focus of the physical camera in the physical three-dimensional space can be calculated based on the external parameters of the physical camera and the first distance obtained in real time. In addition, the position data of the physical screen in the physical three-dimensional space can also be obtained, for example, the position data sent by the positioning system carried by the physical screen can be obtained as the position data of the physical screen in the physical three-dimensional space.
[0062] When the position of the first focus in the physical three-dimensional space is calculated, the relative position relationship between the first focus and the physical screen can be determined based on the position of the first focus and the acquired position of the physical screen in the physical three-dimensional space.
[0063] Please refer to Figure 3 , Figure 3 A schematic diagram showing a physical camera and a physical screen according to an embodiment of the present disclosure is shown.
[0064] In practical applications, the display surface of the screen can be regarded as the front surface of the screen, and the non-display surface of the screen can be regarded as the back surface of the screen. Figure 3 As shown, if the focus of the physical camera is located in front of the front of the physical screen, it can be considered that the focus of the physical camera is located in front of the physical screen; if the focus of the physical camera is located on the front of the screen, it can be considered that the focus of the physical camera is located on the physical screen; if the focus of the physical camera is located behind the back of the physical screen, it can be considered that the focus of the physical camera is located behind the physical screen.
[0065] In some embodiments, if the first distance changes dramatically in a short period of time, it means that the staff may be adjusting the shooting parameters of the physical camera, for example, controlling the physical camera to focus in order to find suitable shooting parameters for shooting and achieve the desired shooting effect. In this case, the shooting parameters of the virtual camera may not be adjusted synchronously temporarily, but after determining that the adjustment of the shooting parameters of the physical camera is completed, the shooting parameters of the virtual camera are adjusted accordingly.
[0066] That is, when determining the position of the first focus of the above-mentioned physical camera based on the external parameters of the above-mentioned physical camera and the above-mentioned first distance, it can be determined first whether the continuous time for which the first distance obtained in real time remains unchanged reaches a preset threshold, where the threshold can be set according to actual needs. If the continuous time for which the first distance remains unchanged reaches the threshold, it can be considered that the adjustment of the shooting parameters of the physical camera is completed, and the position of the first focus of the physical camera can be determined based on the external parameters of the physical camera and the first distance.
[0067] In some embodiments, when determining the relative positional relationship between the first focus of the physical camera and the physical screen in real time, the distance (referred to as the first distance) between the first focus in the physical three-dimensional space and the physical camera (referred to as the lens of the physical camera) can be obtained in real time, and the distance (referred to as the second distance) between the virtual camera (referred to as the lens of the virtual camera) and the virtual screen model in the virtual three-dimensional space can be calculated in real time. The positions of the virtual camera and the virtual screen model in the virtual three-dimensional space correspond to the positions of the physical camera and the physical screen in the physical three-dimensional space, so the distance between the virtual camera and the virtual screen model can be regarded as the distance between the physical camera and the physical screen. In this way, the relative positional relationship between the first focus and the physical screen in the physical three-dimensional space can be determined by comparing the size relationship between the first distance and the second distance.
[0068] Subsequently, it can be compared whether the above-mentioned first distance is smaller than the above-mentioned second distance. If the first distance is smaller than the second distance, it can be determined that the above-mentioned first focus is located in front of the above-mentioned physical screen; if the first distance is equal to the second distance, it can be determined that the above-mentioned first focus is located on the above-mentioned physical screen; if the first distance is greater than the second distance, it can be determined that the above-mentioned first focus is located behind the above-mentioned physical screen.
[0069] Please continue to refer to Figure 3 If the first focus is located in front of the front side of the physical screen, it means that the first distance is smaller than the second distance, and the first focus can be considered to be located in front of the physical screen; if the first focus is located on the front side of the physical screen, it means that the first distance is equal to the second distance, and the first focus can be considered to be located on the physical screen; if the first focus is located behind the back side of the physical screen, it means that the first distance is greater than the second distance, and the first focus can be considered to be located behind the physical screen.
[0070] In some embodiments, when calculating the second distance between the virtual camera and the virtual screen model, a viewing cone model corresponding to the virtual camera may be established first.
[0071] The frustum model is a model used in computer graphics to represent three-dimensional scenes. It is implemented by dividing the scene space into two parts: the viewing volume and the clipping volume.
[0072] The viewing volume is the geometric shape that extends from the camera or observer's viewpoint to the visible part of the scene. It is usually a tetrahedron or hexahedron with a near clipping plane and a far clipping plane, as well as vertices determined by the viewpoint position and viewing direction. The viewing volume defines a virtual two-dimensional projection plane, and the final two-dimensional image is generated by mapping objects in space onto this plane.
[0073] The clipping volume is the area between the viewing volume and the screen or viewport. It is defined by applying clipping operations, clipping objects inside the viewing volume to the parts that are ultimately visible on the screen. Clipping operations can include culling objects that are outside the viewing volume, culling occluded objects, and performing perspective transformations.
[0074] Therefore, the viewing angle range of the virtual camera can be determined through the viewing cone model corresponding to the above virtual camera, that is, the part of the scene that the virtual camera can capture can be determined.
[0075] The virtual screen model may be a three-dimensional model rendered in the virtual three-dimensional space, and the three-dimensional model is usually composed of elements such as vertices, faces, edges, and includes attributes such as normal vectors and vertex colors.
[0076] Among them, vertices are the basic building blocks of 3D models, and they define the position information in 3D models. Usually, each vertex has 3D coordinates, that is, its position in 3D space. Faces are polygons composed of adjacent vertices, usually triangles or quadrilaterals. Faces define the surface geometry of the model. By connecting vertices, planar geometric bodies such as cubes, spheres, etc. can be formed. Each face consists of the indices of the specified vertices, which define the vertices contained in the face. Edges are the connecting lines between two adjacent vertices. Boundary lines are the boundary parts in the model, and they define the edge shape of the model.
[0077] In practical applications, if the physical screen is an LED screen, the vertices of the virtual screen model may be the four vertices of the LED box (usually a cube) constituting the LED screen on the front side of the screen.
[0078] In this case, it can be determined whether each vertex of the virtual screen model is located within the viewing angle corresponding to the frustum model. If there is at least one vertex located within the viewing angle corresponding to the frustum model, the distance between the at least one vertex and the virtual camera (specifically, the lens of the virtual camera) can be determined respectively, and the average distance can be calculated, so that the average distance can be used as the second distance between the virtual camera and the virtual screen model.
[0079] In some embodiments, the relative position relationship between the first focus of the physical camera and the physical screen may not be determined directly, but the relative position relationship between the foreground depth point of the physical camera and the physical screen may be determined. It should be noted that the distance between the position of the foreground depth point of the physical camera and the position of the focus of the physical camera in the present disclosure is the foreground depth of the physical camera.
[0080] Depth of field refers to the range that is considered clear in a photo, that is, the focus range of the object in the image in the front and back directions. In practical applications, the focus range in front of the object in the image is the front depth of field, that is, the front depth of field refers to the range in which the object can remain clear in an image captured by the camera, starting from the focus of the camera lens and extending forward. The focus range behind the object in the image is the back depth of field, that is, the back depth of field refers to the range in which the object can remain clear in an image captured by the camera, starting from the focus of the camera lens and extending backward.
[0081] Depth of field is often used to control the clarity and spatial sense of an image. Depth of field is affected by many factors, the most important of which are aperture, focal length and shooting distance. A larger aperture, a longer focal length and a closer shooting distance usually produce a shallow depth of field effect, that is, only a small part of the photographed object is in sharp range, and other areas are blurred. On the other hand, a smaller aperture, a shorter focal length and a longer shooting distance will produce a larger depth of field, so that the photographed object and the surrounding area can remain sharp.
[0082] That is, when determining the relative position relationship between the above-mentioned first focus of the above-mentioned physical camera and the above-mentioned physical screen, the foreground depth of the physical camera can be determined first (the foreground depth of the physical camera can be determined specifically based on the aperture of the physical camera), and the position of the above-mentioned foreground depth of field point can be determined based on the position of the first focus and the foreground depth of field.
[0083] Subsequently, the relative position relationship between the foreground depth point and the physical screen may be determined to serve as the relative position relationship between the first focus and the physical screen.
[0084] Please refer to Figure 4 , Figure 4 A schematic diagram showing another physical camera and a physical screen according to an embodiment of the present disclosure is shown.
[0085] like Figure 4 As shown, the foreground depth point of the physical camera is located before the focus of the physical camera, and the distance between the position of the foreground depth point and the position of the focus is the foreground depth of the physical camera; the back depth point of the physical camera is located after the focus of the physical camera, and the distance between the position of the back depth point and the position of the focus is the back depth of the physical camera.
[0086] In this case, if the foreground depth point of the physical camera is located in front of the front of the physical screen, the focus of the physical camera can be considered to be in front of the physical screen; if the foreground depth point of the physical camera is located on the front of the screen, the focus of the physical camera can be considered to be on the physical screen; if the foreground depth point of the physical camera is located behind the back of the physical screen, the focus of the physical camera can be considered to be behind the physical screen.
[0087] In this case, since the distance between the foreground depth point and the physical screen is greater than the distance between the actual first focus and the physical screen, it is equivalent to extending the adjustment range of the physical camera focal length. That is to say, when the foreground depth point is located in front of the physical screen, the focus may be located at a distance behind the screen. This distance is less than or equal to the length of the foreground depth of field, and such focusing effect is usually acceptable, which is equivalent to appropriately extending the adjustment range of the physical camera focal length behind the screen.
[0088] Step 203: If the first focus is located in front of the physical screen and the distance between the first focus and the physical screen meets a preset condition, adjust the position of the second focus of the virtual camera so that the distance between the second focus and the virtual screen model is smaller than the distance between the first focus and the physical screen.
[0089] In this embodiment, if it is determined that the above-mentioned first focus of the above-mentioned physical camera is located in front of the above-mentioned physical screen, and the distance between the first focus in the above-mentioned physical three-dimensional space and the physical screen meets the preset conditions, then the data processing program running on the above-mentioned computing device can adjust the position of the focus (which can be called the second focus) of the above-mentioned virtual camera in the above-mentioned virtual three-dimensional space, so that the distance between the second focus in the virtual three-dimensional space and the above-mentioned virtual screen model is smaller than the distance between the first focus in the physical three-dimensional space and the physical screen.
[0090] Among them, the preset condition can specifically be that the distance between the first focus in the physical three-dimensional space and the physical screen is greater than a certain threshold; or, it can be that the distance between the first focus in the physical three-dimensional space and the physical screen is greater than 0; or, it can be that the distance between the first focus in the physical three-dimensional space and the physical screen is greater than the depth of field of the physical camera; and so on. The preset condition can be set according to actual needs, and the present disclosure does not impose any special restrictions on this. In one example, if the distance between the first focus and the physical screen is less than a threshold, it can be considered that the second focus position of the virtual camera does not need to be adjusted, and the focus of the picture taken by the virtual camera can also meet the needs. At this time, no adjustment is required to reduce the amount of calculation and improve processing efficiency.
[0091] It should be noted that the distance between the adjusted second focus in the virtual three-dimensional space and the virtual screen model may be 0 or not, and the only requirement is that the distance is smaller than the distance between the first focus in the physical three-dimensional space and the physical screen. In this way, on the one hand, the requirement for the adjustment accuracy of the second focus position is reduced, and on the other hand, in certain specific scenes, the shooting picture of the virtual camera may need to retain a certain out-of-focus effect.
[0092] For example, if it is determined that the first focus of the physical camera is located in front of the physical screen, the data processing program running on the computing device can adjust the position of the focus of the virtual camera (which can be called the second focus) in the virtual three-dimensional space, so that the position of the second focus in the virtual three-dimensional space falls on the virtual screen model. Similar to the relative positional relationship between the first focus and the physical screen in the physical three-dimensional space, if the second focus is located on the front of the virtual screen model in the virtual three-dimensional space, it can be considered that the second focus is located on the virtual screen model.
[0093] In some embodiments, when adjusting the position of the second focus of the virtual camera to the virtual screen model, the position of the second focus in the virtual three-dimensional space can be adjusted to the virtual screen model based on the model data of the virtual screen model and the spatial data of the virtual three-dimensional space. For example, the spatial data of the virtual three-dimensional space can include a three-dimensional coordinate system corresponding to the virtual three-dimensional space, and the model data of the virtual screen model can include the three-dimensional coordinates of each vertex of the virtual screen model in the three-dimensional coordinate system. Based on this, the position of the second focus in the virtual three-dimensional space can be adjusted by adjusting the three-dimensional coordinates used to represent the position of the second focus, thereby achieving the adjustment of the position of the second focus in the virtual three-dimensional space to the virtual screen model.
[0094] According to the model setting method of the virtual camera, the position of the second focus can be directly changed as a variable parameter of the virtual camera, or can be changed by changing other parameters of the virtual camera (such as lens position), etc., and the present disclosure does not limit this.
[0095] In some embodiments, if it is determined that the first focus of the physical camera is not located in front of the physical screen, it means that the focus of the lens of the physical camera deviates from the physical screen and the actor performing in front of the physical screen. At this time, there is no clear part in the image captured by the physical camera, but all are blurred or distorted. During shooting, this situation is usually considered abnormal.
[0096] Based on this, if it is determined that the first focus of the physical camera is not located in front of the physical screen, the data processing program running on the computing device may output a prompt to the user that the focus of the physical camera is out of range.
[0097] In some embodiments, by adjusting the position of the second focus of the virtual camera, the out-of-focus effect of the image captured by the virtual camera can be alleviated to a certain extent, thereby reducing the negative impact caused by the secondary out-of-focus problem. Therefore, the aperture of the virtual camera can be directly adjusted to be consistent with the aperture of the physical camera. After setting the focus and aperture and other shooting-related data for the virtual camera, the virtual camera can perform a simulated shooting operation.
[0098] Usually, out-of-focus occurs not only when the camera lens is not focused accurately, but also when insufficient light enters the camera. Therefore, the aperture will also affect the out-of-focus effect of the camera's shooting.
[0099] The aperture is the part of the camera lens that controls the size of the hole that lets light in. It consists of a series of adjustable blades that open or close to control the amount of light that enters the camera. Adjusting the aperture size affects the depth and exposure of the image. A larger aperture creates a shallow depth of field, so that the subject is sharp and the background is blurred. A smaller aperture creates a larger depth of field, so that both the subject and the background remain sharp.
[0100] In order to avoid the problem of the physical camera being captured due to secondary defocus, the data processing program running on the computing device can calculate an available value of the aperture of the virtual camera. When the aperture of the virtual camera adopts this value, for the image displayed on the physical screen by the virtual camera simulating the virtual scene, the physical camera will shoot the real scene and the display image on the physical screen again, and the defocus effect of the real scene part and the virtual scene part in the obtained image will change continuously, so that the real scene part and the virtual scene part in the image captured by the physical camera have a correct hierarchical relationship. In practical applications, the continuous change of the defocus effect means that in an image captured by the camera, starting from the focus of the camera lens, the scene at a position farther from the focus is more blurred, and the scene at a position closer to the focus is clearer.
[0101] In the above technical solution, a virtual three-dimensional space corresponding to the physical three-dimensional space can be simulated on the computing device, and a virtual screen model corresponding to the physical screen in the physical three-dimensional space can be created in the virtual three-dimensional space; the data processing program on the computing device can further create a virtual camera corresponding to the physical camera in the physical three-dimensional space in the virtual three-dimensional space, wherein the virtual camera can be used to simulate shooting of a preset virtual scene, and display the simulated shot image through a physical screen, and the physical camera can be used to shoot the physical screen, and the internal parameters of the virtual camera are consistent with the internal parameters of the physical camera; after the virtual camera is created, the relative position relationship between the first focus of the physical camera and the physical screen can be determined in real time, and when it is determined that the first focus is located in front of the physical screen and the distance between the first focus and the physical screen meets certain conditions, the position of the second focus of the virtual camera is adjusted so that the distance between the second focus and the virtual screen model is less than the distance between the first focus and the physical screen, so as to complete the real-time adjustment of the position of the second focus of the virtual camera.
[0102] By adopting this method, when realizing virtual shooting, on the one hand, the focus position of the created virtual camera corresponding to the physical camera can be automatically adjusted according to the focus position of the current physical camera to reduce the out-of-focus effect of the image captured by the virtual camera, thus avoiding the need to manually set the offset distance for the focus of the virtual camera. Therefore, the adjustment efficiency and accuracy are relatively high, which is suitable for scenes where the physical camera moves over a large range and can be adapted to screens of various shapes. On the other hand, the focus position of the virtual camera can be adjusted in real time only when the focus of the physical camera is in front of the physical screen and the distance between the physical camera and the physical screen meets certain conditions, so as to reduce the frequency of adjusting the focus of the virtual camera and reduce the required amount of calculation, thereby ensuring the real-time nature of each adjustment. After each adjustment, the distance between the focus of the adjusted virtual camera and the virtual screen model is made smaller than the distance between the focus of the physical camera and the physical screen, so as to reduce the out-of-focus effect of the image captured by the virtual camera. In this way, both real-time nature and accuracy can be taken into account when adjusting the focus position of the virtual camera.
[0103] Corresponding to the aforementioned embodiment of the method for adjusting a virtual camera, the present disclosure also provides an embodiment of an apparatus for adjusting a virtual camera.
[0104] Please refer to Figure 5 , Figure 5It is a structural diagram of a device shown in an exemplary embodiment of the present disclosure. At the hardware level, the device includes a processor 501, an internal bus 502, a network interface 503, a memory 504 and a non-volatile memory 505, and of course may also include other required hardware. One or more embodiments of the present disclosure can be implemented based on software, such as the processor 501 reading the corresponding computer program from the non-volatile memory 505 into the memory 504 and then running it. Of course, in addition to the software implementation, one or more embodiments of the present disclosure do not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is to say, the execution subject of the following processing flow is not limited to each logic module, but can also be hardware or logic devices.
[0105] Please refer to Figure 6 , Figure 6 It is a block diagram of a virtual camera adjustment device shown in an exemplary embodiment of the present disclosure.
[0106] The above virtual camera adjustment device can be applied to Figure 5 The device shown in the figure is used to implement the technical solution of the present disclosure. Specifically, the device can be applied to a data processing program running on a computing device; a virtual three-dimensional space corresponding to a physical three-dimensional space is simulated on the computing device; a virtual screen model corresponding to a physical screen is created in the virtual three-dimensional space; the device includes:
[0107] A creation module 601 is used to create a virtual camera corresponding to the physical camera used to shoot the physical screen in the virtual three-dimensional space; wherein the physical screen is used to display an image obtained by the virtual camera simulating the shooting of a preset virtual scene; and the internal parameters of the virtual camera are consistent with the internal parameters of the physical camera;
[0108] A determination module 602, configured to determine in real time the relative position relationship between the first focus of the physical camera and the physical screen;
[0109] The adjustment module 603 is used to adjust the position of the second focus of the virtual camera when the first focus is located in front of the physical screen and the distance between the second focus and the physical screen meets a preset condition, so that the distance between the second focus and the virtual screen model is smaller than the distance between the first focus and the physical screen.
[0110] Optionally, the creating a virtual camera corresponding to a physical camera used to shoot the physical screen in the virtual three-dimensional space includes:
[0111] Initializing and creating a virtual camera corresponding to a physical camera used to shoot the physical screen in the virtual three-dimensional space;
[0112] Determining in real time the relative position relationship between the physical camera and the physical screen;
[0113] The position of the virtual camera is adjusted to a target position corresponding to the virtual screen model; wherein the relative position relationship between the target position and the virtual screen model is consistent with the relative position relationship between the physical camera and the physical screen.
[0114] Optionally, the physical camera is equipped with a tracking system;
[0115] The real-time determination of the relative position relationship between the physical camera and the physical screen includes:
[0116] Acquire the external parameters of the physical camera sent by the tracking system in real time, and acquire the position data of the physical screen;
[0117] Based on the external parameters of the physical camera and the position data of the physical screen, a relative position relationship between the physical camera and the physical screen is determined.
[0118] Optionally, the real-time determination of the relative position relationship between the first focus of the physical camera and the physical screen includes:
[0119] Acquire in real time a first distance between a first focus of the physical camera and the physical camera;
[0120] Determining a position of a first focus of the physical camera based on external parameters of the physical camera and the first distance;
[0121] Based on the position of the first focus and the position of the physical screen, a relative positional relationship between the first focus of the physical camera and the physical screen is determined.
[0122] Optionally, determining the position of the first focus of the physical camera based on the external parameters of the physical camera and the first distance includes:
[0123] Determine whether the duration for which the first distance obtained in real time remains unchanged reaches a preset threshold;
[0124] If the duration reaches the threshold, the position of a first focus of the physical camera is determined based on external parameters of the physical camera and the first distance.
[0125] Optionally, the real-time determination of the relative position relationship between the first focus of the physical camera and the physical screen includes:
[0126] Acquire a first distance between a first focus of the physical camera and the physical camera in real time, and calculate a second distance between the virtual camera and the virtual screen model in real time;
[0127] comparing whether the first distance is smaller than the second distance;
[0128] If the first distance is smaller than the second distance, it is determined that the first focus is located in front of the physical screen.
[0129] Optionally, the calculating the second distance between the virtual camera and the virtual screen model includes:
[0130] Establishing a viewing cone model corresponding to the virtual camera;
[0131] Determining whether the vertices of the virtual screen model are within a viewing angle range corresponding to the viewing cone model;
[0132] If there is at least one of the vertex located within the viewing angle corresponding to the viewing cone model, the average distance between the at least one of the vertex and the virtual camera is calculated, and the average distance is determined as the second distance.
[0133] Optionally, the adjustment module 603 is further used to:
[0134] The aperture of the virtual camera is adjusted to be consistent with the aperture of the physical camera.
[0135] Optionally, determining the relative position relationship between the first focus of the physical camera and the physical screen includes:
[0136] Determine the foreground depth of the physical camera, and determine the position of the foreground depth point based on the position of the first focus and the foreground depth; wherein the distance between the position of the foreground depth point and the position of the first focus is the foreground depth;
[0137] The relative position relationship between the foreground depth point and the physical screen is determined as the relative position relationship between the first focus and the physical screen.
[0138] Optionally, the device further comprises:
[0139] An output module is used to output a prompt to the user that the focus of the physical camera is out of range when the first focus is not located in front of the physical screen.
[0140] Optionally, the internal parameters include focal length, optical center offset, distortion parameters and pixel size.
[0141] Optionally, the external parameters include position data and posture data.
[0142] For the device embodiment, it basically corresponds to the method embodiment, so the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the technical solution of the present disclosure.
[0143] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, which may be in the form of a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email transceiver, a game console, a tablet computer, a wearable device or a combination of any of these devices.
[0144] In a typical configuration, a computer includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0145] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0146] Computer-readable media include permanent and non-permanent, removable and non-removable media that can store information by any method or technology. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, disk storage, quantum memory, graphene-based storage media or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0147] It should be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of further restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0148] The above describes a specific embodiment of the present disclosure. Other embodiments are within the scope of the present disclosure. In some cases, the actions or steps recorded in the present disclosure can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0149] The terms used in one or more embodiments of the present disclosure are for the purpose of describing specific embodiments only and are not intended to limit one or more embodiments of the present disclosure. The singular forms of "a", "said" and "the" are also intended to include plural forms unless the context clearly indicates other meanings. The term "and / or" refers to and includes any or all possible combinations of one or more associated listed items.
[0150] The description of the terms "one embodiment", "some embodiments", "example", "specific example" or "one implementation method" etc. used in one or more embodiments of the present disclosure means that the specific features or characteristics described in conjunction with the embodiment are included in at least one embodiment of the present disclosure. The schematic descriptions of these terms are not necessarily for the same embodiment. Moreover, the specific features or characteristics described can be combined in a suitable manner in one or more embodiments of the present disclosure. In addition, different embodiments and specific features or characteristics in different embodiments can be combined without contradiction.
[0151] It should be understood that although the terms first, second, third, etc. may be used to describe various information in one or more embodiments of the present disclosure, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of the present disclosure, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determination".
[0152] The above description is only a preferred embodiment of one or more embodiments of the present disclosure and is not intended to limit one or more embodiments of the present disclosure. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of one or more embodiments of the present disclosure shall be included in the scope of protection of one or more embodiments of the present disclosure.
[0153] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
Claims
1. A method for adjusting a virtual camera, applied to a data processing program running on a computing device; the computing device simulates a virtual three-dimensional space corresponding to a physical three-dimensional space ; A virtual screen model corresponding to the physical screen is created in the virtual three-dimensional space; the method comprises: Creating a virtual camera corresponding to the physical camera used to shoot the physical screen in the virtual three-dimensional space; wherein the physical screen is used to display an image obtained by the virtual camera simulating the shooting of a preset virtual scene; and the internal parameters of the virtual camera are consistent with the internal parameters of the physical camera; Determining in real time the relative position relationship between the first focus of the physical camera and the physical screen; If the first focus is located in front of the physical screen and the distance between the first focus and the physical screen meets a preset condition, the position of the second focus of the virtual camera is adjusted so that the distance between the second focus and the virtual screen model is smaller than the distance between the first focus and the physical screen.
2. The method according to claim 1, wherein a virtual camera corresponding to a physical camera used to shoot the physical screen is created in the virtual three-dimensional space. include: Initializing and creating a virtual camera corresponding to a physical camera used to shoot the physical screen in the virtual three-dimensional space; Determining in real time the relative position relationship between the physical camera and the physical screen; The position of the virtual camera is adjusted to a target position corresponding to the virtual screen model; wherein the relative position relationship between the target position and the virtual screen model is consistent with the relative position relationship between the physical camera and the physical screen.
3. The method according to claim 2, wherein the physical camera is equipped with a tracking system; The real-time determination of the relative position relationship between the physical camera and the physical screen includes: Acquire the external parameters of the physical camera sent by the tracking system in real time, and acquire the position data of the physical screen; Based on the external parameters of the physical camera and the position data of the physical screen, a relative position relationship between the physical camera and the physical screen is determined.
4. The method according to claim 3, wherein the real-time determination of the relative position relationship between the first focus of the physical camera and the physical screen is performed. include: Acquire in real time a first distance between a first focus of the physical camera and the physical camera; Determining a position of a first focus of the physical camera based on external parameters of the physical camera and the first distance; Based on the position of the first focus and the position of the physical screen, a relative positional relationship between the first focus of the physical camera and the physical screen is determined.
5. The method according to claim 4, wherein the position of the first focus of the physical camera is determined based on the external parameters of the physical camera and the first distance, include: Determine whether the duration for which the first distance obtained in real time remains unchanged reaches a preset threshold; If the duration reaches the threshold, the position of a first focus of the physical camera is determined based on external parameters of the physical camera and the first distance.
6. The method according to claim 1, wherein the step of determining in real time the relative position relationship between the first focus of the physical camera and the physical screen, include: Acquire a first distance between a first focus of the physical camera and the physical camera in real time, and calculate a second distance between the virtual camera and the virtual screen model in real time; comparing whether the first distance is smaller than the second distance; If the first distance is smaller than the second distance, it is determined that the first focus is located in front of the physical screen.
7. The method according to claim 6, wherein the calculating the second distance between the virtual camera and the virtual screen model comprises: include: Establishing a viewing cone model corresponding to the virtual camera; Determining whether the vertices of the virtual screen model are within a viewing angle range corresponding to the viewing cone model; If there is at least one of the vertex located within the viewing angle corresponding to the viewing cone model, the average distance between the at least one of the vertex and the virtual camera is calculated, and the average distance is determined as the second distance.
8. A virtual camera adjustment device, applied to a data processing program running on a computing device; the computing device simulates a virtual three-dimensional space corresponding to the physical three-dimensional space ; A virtual screen model corresponding to the physical screen is created in the virtual three-dimensional space; the device comprises: A creation module, used to create a virtual camera corresponding to the physical camera used to shoot the physical screen in the virtual three-dimensional space; wherein the physical screen is used to display an image obtained by the virtual camera simulating the shooting of a preset virtual scene; and the internal parameters of the virtual camera are consistent with the internal parameters of the physical camera; A determination module, used to determine in real time the relative position relationship between the first focus of the physical camera and the physical screen; An adjustment module is used to adjust the position of the second focus of the virtual camera when the first focus is located in front of the physical screen and the distance between the first focus and the physical screen meets a preset condition, so that the distance between the second focus and the virtual screen model is smaller than the distance between the first focus and the physical screen.
9. An electronic device, include: processor; a memory for storing processor-executable instructions; The processor implements the method according to any one of claims 1 to 7 by running the executable instructions.
10. A computer-readable storage medium having computer instructions stored thereon, wherein the instructions are executed by a processor to implement the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Control method for virtual camera, device and equipment
CN112121423A
Virtual shooting method, device and system and storage medium
CN112311965A
Scene picture shooting method and device, electronic equipment and storage medium
CN112330736A
Virtual-real camera picture shooting method
CN115942114A
Shielding image generation method and device, electronic equipment and storage medium
CN116681689A
