Background area determination method and apparatus, and electronic device
By acquiring the camera data and motion trajectory of the virtual lens, the background area image of the virtual scene is generated, which solves the problem of poor accuracy in virtual background drawing and improves efficiency and accuracy.
Patent Information
- Application Number
- CN202211145809.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-20
- Publication Date
- 2025-08-05
- Estimated Expiration
- 2042-09-20
AI Technical Summary
When making virtual backgrounds, the accuracy of the user manually drawing background areas in the prior art results in slow production and low accuracy, especially when making sky scenes, there are a large number of blind spots and perspective errors.
By acquiring camera data of the virtual lens, the virtual lens controls the virtual scene to capture, generates a first image, and determines the background area based on the image, and uses the scene information displayed in the target video and the lens motion trajectory to reduce the manual drawing range and improve accuracy.
It improves the work efficiency and accuracy of users in drawing virtual backgrounds, reduces the problem of image accuracy due to perspective errors, and simplifies the drawing process.
Smart Images

Figure CN115580778B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computers, and in particular, to a method and apparatus for determining a background area, and an electronic device. Background Art
[0002] Currently, when making specific virtual backgrounds, such as sky scenes, underwater scenes, and grassland scenes, the morphology of the outdoor sky has a significant impact on the animation screen. However, there are a large number of production blind spots when making most sky textures, such as unclear camera perspective, position, and the layout composition of the preview animation screen within a certain period of time. This leads to the need to spend a large amount of human resources to determine the production level and details, resulting in slow production of the entire animation scene. Too many production blind spots also lead to poor accuracy of the final production result.
[0003] In view of the above problems, no effective solution has been proposed yet. Summary of the Invention
[0004] At least some embodiments of the present invention provide a method and apparatus for determining a background area, and an electronic device, so as to at least solve the technical problem of poor accuracy in determining the background area to be manually drawn by a user in a virtual scene in the related art.
[0005] According to one embodiment of the present invention, a method for determining a background area is provided, including: obtaining camera data of a virtual camera, where the camera data at least includes: the movement trajectory of the virtual camera; controlling the virtual camera to shoot a first virtual scene based on the camera data to generate a first image, where the first image is used to represent the movement range of the virtual camera during the movement process; determining the background area of the first virtual scene based on the first image.
[0006] According to one embodiment of the present invention, an apparatus for determining a background area is further provided, including: an obtaining module, configured to obtain camera data of a virtual camera, where the camera data at least includes: the movement trajectory of the virtual camera; a generating module, configured to control the virtual camera to shoot a first virtual scene based on the camera data to generate a first image, where the first image is used to represent the movement range of the virtual camera during the movement process; a determining module, configured to determine the background area of the first virtual scene based on the first image.
[0007] According to one embodiment of the present invention, a computer-readable storage medium is further provided, where a computer program is stored in the computer-readable storage medium, and the computer program is configured to execute the method for determining a background area in any one of the above when running.
[0008] According to one embodiment of the present invention, an electronic device is further provided, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to execute the background area determination method in any one of the above.
[0009] In at least some embodiments of the present invention, camera data of a virtual lens is acquired; the virtual lens is controlled based on the camera data to capture a first virtual scene, generating a first image; the background area of the first virtual scene is determined based on the first image. By using the scene information of the initial virtual scene shown in the target video and the movement trajectory of the virtual lens, the range of the background area that needs to be drawn by the user is determined, and the overall virtual background does not need to be drawn, which can improve the work efficiency when the user is drawing. At the same time, the background area is determined according to the actually acquired target video of the initial virtual scene, without having to consider too much the problem of poor image accuracy caused by the perspective error of the virtual lens, further improving the accuracy of the determined background area, and thus solving the technical problem of poor accuracy in determining the background area to be manually drawn by the user in the virtual scene in the related art. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The illustrative embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0011] Figure 1 is a hardware structure block diagram of a computer terminal for a background area determination method according to an embodiment of the present invention;
[0012] Figure 2 is a flowchart of a background area determination method according to one embodiment of the present invention;
[0013] Figure 3 is a schematic diagram of a first image according to one embodiment of the present invention;
[0014] Figure 4 is a schematic diagram of a second image according to one embodiment of the present invention;
[0015] Figure 5 is a schematic diagram of key image frame selection according to one embodiment of the present invention;
[0016] Figure 6 is a schematic diagram of a virtual scene image according to one embodiment of the present invention;
[0017] Figure 7 is a schematic diagram of a target virtual background image according to one embodiment of the present invention
[0018] Figure 8It is a structural block diagram of a background area determination device according to an embodiment of the present invention;
[0019] Figure 9 It is a schematic diagram of an electronic device according to an embodiment of the present invention. Specific embodiments
[0020] In order to enable those skilled in the art to better understand the solution of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0021] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned accompanying drawings are used to distinguish similar objects, and do not necessarily need to be used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present invention described herein can be implemented in an order different from those illustrated or described herein. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units does not necessarily need to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0022] Currently, there are two common methods for generating a virtual sky background. One is to use sky HDR (High Dynamic Range Imaging) technology to splice and draw sky images in different regions, and then paste the spliced image into a three-dimensional mesh for rendering. However, when making the sky background image, there is a situation where it is impossible to directly obtain the position and perspective of the virtual camera, as well as the pre-composition of the current frame of the screen. This will cause a large production blind spot for users when drawing and splicing the sky image according to the virtual camera, making it difficult to meet user requirements. At the same time, if the sky background image to be drawn and spliced is large, it may also lead to a high time cost. And if there are image details that need to be modified, a large amount of human resources will be consumed to repeatedly draw and judge the modification range, resulting in a large consumption cost of human resources.
[0023] Another method is to use graphic design software to draw the sky background image and then perform tracking processing on the image in the form of patching with Nuke (a digital compositing software). However, this method is usually used to draw the sky background image according to the position, angle and other information of a single virtual shot, and it cannot be used in virtual shots of other scenes. Moreover, there will be perspective errors during sky perspective, and the accuracy is relatively low.
[0024] According to one embodiment of the present invention, an embodiment of a method for determining a background area is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. And although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than here.
[0025] This method embodiment can be executed in a computer terminal or a similar computing device. Taking the operation on a computer terminal as an example, the computer terminal can be a laptop computer, a desktop computer, a workbench, a personal digital assistant, a server, a blade server, a mainframe computer and other suitable computer terminal devices. Figure 1 It is a hardware structure block diagram of a computer terminal for a method of determining a background area according to an embodiment of the present invention. As Figure 1 shown, the computer terminal may include one or more ( Figure 1 only one is shown in the figure) processors 102 (the processor 102 may include, but is not limited to, a central processing unit (CPU), a graphics processing unit (GPU), a digital signal processing (DSP) chip, a microprocessor (MCU), a programmable logic device (FPGA), a neural network processor (NPU), a tensor processor (TPU), an artificial intelligence (AI) type processor, etc.) and a memory 104 for storing data. Optionally, the above computer terminal may further include a transmission device 106 for communication functions, an input / output device 108, and a display device 110. Those of ordinary skill in the art can understand that Figure 1 the structure shown in the figure is only schematic and does not limit the structure of the above computer terminal. For example, the computer terminal may further include more or fewer components than those Figure 1 shown in the figure, or have a different configuration from that Figure 1 shown in the figure.
[0026] The memory 104 can be used to store computer programs, such as software programs and modules of application software, such as the computer program corresponding to the background area determination method in the embodiments of the present invention. The processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, that is, the above-mentioned background area determination method is implemented. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some instances, the memory 104 may further include a memory remotely disposed relative to the processor 102, and these remote memories can be connected to the computer terminal through a network. Examples of the above-mentioned network include but are not limited to the Internet, intranet, local area network, mobile communication network, and combinations thereof.
[0027] The transmission device 106 is used to receive or send data via a network. Specific examples of the above-mentioned network may include a wireless network provided by a communication provider of a computer terminal. In one instance, the transmission device 106 includes a network adapter (Network Interface Controller, abbreviated as NIC), which can be connected to other network devices through a base station and thus communicate with the Internet. In one instance, the transmission device 106 may be a radio frequency (Radio Frequency, abbreviated as RF) module, which is used to communicate with the Internet wirelessly.
[0028] The input in the input / output device 108 can come from multiple human interface devices (Human Interface Device, abbreviated as HID). For example: keyboards and mice, gamepads, other dedicated game controllers (such as: steering wheels, fishing rods, dance pads, remote controls, etc.). Some human interface devices can provide output functions in addition to input functions. For example: force feedback and vibration of gamepads, audio output of controllers, etc.
[0029] The display device 110 can be, for example, a head-up display (HUD), a touch-screen liquid crystal display (LCD), and a touch display (also referred to as a "touch screen" or "touch display screen"). The liquid crystal display enables a user to interact with the user interface of a computer terminal. In some embodiments, the computer terminal has a graphical user interface (GUI), and the user can perform human-computer interaction with the GUI through finger contacts and / or gestures on the touch-sensitive surface. The human-computer interaction function may optionally include the following interactions: creating web pages, drawing, word processing, creating electronic documents, gaming, video conferencing, instant messaging, sending and receiving emails, call interfaces, playing digital videos, playing digital music, and / or web browsing, etc. The executable instructions for performing the above human-computer interaction functions are configured / stored in a computer program product or a readable storage medium executable by one or more processors.
[0030] In one embodiment of the present disclosure, the background area determination method can run on a local terminal device or a server. When the background area determination method runs on the server, the method can be implemented and executed based on a cloud interaction system, where the cloud interaction system includes a server and client devices.
[0031] In a possible implementation manner, an embodiment of the present invention provides a background area determination method, which provides a graphical user interface through a terminal device. The terminal device can be the aforementioned local terminal device or the client device in the aforementioned cloud interaction system. Figure 2 is a flowchart of the background area determination method according to one embodiment of the present invention, as Figure 2 shown, the method includes the following steps:
[0032] Step S202, obtain the camera data of the virtual lens.
[0033] Among them, the camera data at least includes: the movement trajectory of the virtual lens.
[0034] The above virtual lens can refer to a virtual device for obtaining images within a virtual scene; the above camera data can refer to the shooting parameters of the virtual lens, such as the parameters required for shooting with a camera in real life. The above camera data may include, but is not limited to: the movement trajectory of the virtual lens in the virtual scene, the shooting position of the virtual lens, the shooting angle, etc.
[0035] Generally, in order to reflect some scene features in the virtual scene or some virtual objects in the scene, such as buildings in a grassland scene, flying objects in a sky scene, etc., the virtual lens can be controlled to move according to a preset movement trajectory to shoot the buildings or flying objects.
[0036] Step S204: Control the virtual camera to capture the first virtual scene based on the camera data, and generate a first image.
[0037] The first image is used to represent the movement range of the virtual camera during movement.
[0038] The above-mentioned first virtual scene may refer to an initial virtual scene. In this scene, there may be a virtual scene with only one virtual camera, or a virtual scene with only background models, such as sky and grass models. The above-mentioned first image may refer to the image range of the first virtual scene that the user can obtain through the virtual camera when the virtual camera moves along the aforementioned movement trajectory, that is, the above-mentioned movement range.
[0039] In an optional solution of this embodiment, after determining the movement trajectory of the preset virtual camera, the virtual camera can be first controlled to move and capture according to the aforementioned movement trajectory to obtain a preview animation video of the first virtual scene, that is, a video that can display the shooting and movement range of the virtual camera. Then, multiple video images are obtained from the preview animation video according to actual needs, and the area ranges corresponding to each video image in the first virtual scene are combined to obtain the above-mentioned first image.
[0040] For example, if the above-mentioned first virtual scene is a sky background and the above-mentioned movement trajectory is to move horizontally for a certain distance to obtain the cloud changes in the sky background, the above-mentioned preview animation video can be an animation video captured by the virtual camera according to the preset horizontal movement trajectory, and this video can show a certain range of sky scenes. At this time, the above-mentioned first image can refer to the image range of the sky background presented in this animation video.
[0041] Optionally, the camera data further includes: the viewing angle corresponding to the movement trajectory. Controlling the virtual camera to capture the first virtual scene based on the camera data includes: controlling the virtual camera to move according to the movement trajectory; controlling the virtual camera to capture the first virtual scene according to the viewing angle to obtain a first image sequence; and merging the first image sequence to generate the first image.
[0042] The above-mentioned first image sequence may refer to the video images corresponding to different moments in the aforementioned preview animation video.
[0043] Considering that there may be errors when directly shooting the first virtual scene with a virtual camera according to the aforementioned motion trajectory, or the cloud changes in the sky background captured are not obvious, which cannot meet the expected requirements of users. Therefore, other camera data can be set for the virtual camera at this time, such as the focal length of the virtual camera at different motion moments, the viewing angle that the virtual camera can obtain, etc. By using the preset viewing angle to control the virtual camera to shoot the first virtual scene, it can largely make the obtained first image more in line with the expected requirements of users.
[0044] Continuing with the aforementioned shooting of the sky background, when controlling the virtual camera to perform horizontal motion shooting of the sky background, the viewing angle of the virtual camera can also be changed in real time. For example, if the first image is obtained to shoot a cloud in the sky background, and the cloud image in the current sky background is small, then at this time, the virtual camera can be controlled to adjust the focal length to change the viewing angle of the virtual camera, zoom in on the captured sky background to obtain a clear and obvious cloud picture, so that the captured image is more in line with the expected requirements of users.
[0045] In an alternative solution of this embodiment, in addition to using the virtual camera to shoot a preview animation video of the first virtual scene as described above, and then determining multiple video images from the animation video for merging to generate the first image, after obtaining the motion trajectory of the virtual camera, multiple trajectory points can be determined from the motion trajectory. When the virtual camera moves along the motion trajectory to the above-mentioned multiple trajectory points, the virtual image of the first virtual scene that the virtual camera can obtain at this trajectory point is automatically obtained, and the multiple virtual images are determined as a plurality of first image sequences, and merged to generate the above-mentioned first image. Compared with the accuracy of using the virtual camera to obtain an animation video to determine the first image, directly using the virtual camera to obtain the first image sequence at the preset trajectory points can largely ensure the efficiency of generating the first image and improve the user's drawing progress.
[0046] After using the virtual camera to shoot multiple images of the first virtual scene, as shown above, these images can be merged to obtain the aforementioned first image.
[0047] Figure 3 It is a schematic diagram of the first image according to one embodiment of the present invention, as Figure 3 shown, where multiple rectangles represent the image ranges of the first virtual scene that can be obtained by the virtual camera at different motion moments, that is, the aforementioned first image sequences. The images corresponding to the first image sequences correspond one-to-one with their corresponding camera data, including data order, data size, etc., that is, after merging multiple first image sequences, the above-mentioned first image is generated.
[0048] In an alternative solution of this embodiment, in order to reflect the movement trajectory of the virtual camera, as Figure 3 shown, the rectangle number corresponding to the virtual image obtained by the virtual camera at the first frame can be set as ①, the rectangle number corresponding to the virtual image obtained by the virtual camera at the second frame can be set as ②, and so on. The rectangle number corresponding to the virtual image obtained by the virtual camera at the nth frame is set as the number n.
[0049] In Figure 3 , in addition to reflecting the movement trajectory of the virtual camera, it can also intuitively reflect the distance between the virtual camera and the virtual object at different movement moments, so that the user can determine whether the obtained virtual image meets their expected requirements, thereby improving the efficiency when determining the background area subsequently. Specifically, the closer the virtual camera is to the first virtual scene, the smaller the image range it can obtain; the farther the virtual camera is from the first virtual scene, the larger the image range it can obtain. For example, Figure 3 as shown in, the distance 1 between the position of the virtual camera corresponding to obtaining the rectangle numbered ① and the first virtual scene is farther than the distance 2 between the position of the virtual camera corresponding to obtaining the rectangle numbered n and the first virtual scene.
[0050] Step S206, determine the background area of the first virtual scene based on the first image.
[0051] The above background area may refer to the area that the user needs to manually draw, such as virtual backgrounds like the sky and grassland. Since the entire first virtual scene is relatively large, if the user draws point by point for the entire scene, it will not only consume a large amount of human resources, but may also lead to drawing errors due to the excessive drawing workload.
[0052] Therefore, in an alternative solution of this embodiment, since the above first image is presented by the virtual camera and the user cannot obtain other images except the first image through the virtual camera, the user only needs to draw the first virtual scene presented in the first image. That is, the first virtual scenes corresponding to each image in the first image can be combined to generate the above background area, and the user only needs to draw the image content in this background area, thereby improving the drawing efficiency. And because the drawing workload is small, the user can spend more energy to improve the accuracy of the drawn background.
[0053] In at least some embodiments of the present invention, camera data of a virtual lens is acquired; the virtual lens is controlled based on the camera data to capture a first virtual scene, generating a first image; and a background area of the first virtual scene is determined based on the first image. By using the scene information of the initial virtual scene shown in the target video and the movement trajectory of the virtual lens, the range of the background area that needs to be drawn by the user is determined, and the overall virtual background is no longer drawn, which can improve the work efficiency when the user is drawing. At the same time, the background area is determined according to the actually acquired target video of the initial virtual scene, without having to consider too much the problem of poor image accuracy caused by the perspective error of the virtual lens, further improving the accuracy of the determined background area, and thus solving the technical problem of poor accuracy in determining the background area to be manually drawn by the user in the related art.
[0054] Optionally, merging the first image sequence to generate the first image includes: performing a frame freezing operation on the first image sequence to obtain multiple captured images; determining the target positions of the multiple captured images in the first image sequence; marking the multiple captured images based on the target positions to obtain multiple marked images; and merging the multiple marked images to generate the first image.
[0055] In an optional solution of this embodiment, when using a virtual lens to capture a virtual scene, abnormal situations such as image blurring and obstacle occlusion may occur. Therefore, before generating the first image, a frame freezing operation can be first performed on the first image sequence to freeze the corresponding background image obtained through the virtual lens, that is, the above-mentioned first image, to obtain multiple consecutive background images. Then, in order, for example, in chronological order, the target positions of each background image in the first image sequence can be determined to avoid rendering errors during subsequent image rendering. After determining the target position of each background image, in order to facilitate the distinction of each background image, the background image can also be marked based on the target position of each background image, such as marking with a digital number, or assigning different colors to background images in different positions, etc., to obtain multiple marked images that are convenient for the user to observe. Finally, all the marked images can be combined according to their respective target positions to generate the above-mentioned first image for the user to view. The finally generated first image can be as Figure 3 shown. It should be noted that Figure 3 the use of numbers such as ① and ② in [figure] is only to facilitate the distinction of the background images obtained in chronological order, that is, the above-mentioned marking of background images in different positions with digital numbers. The user can make a marking selection according to the actual situation, and no specific limitation is made here.
[0056] In an optional solution of this embodiment, considering the speed and convenience during operation, the Framehold (a software tool node) node in the Nuke software can be directly used to freeze the frame of the image. After frame freezing, the background images at different positions are numbered and merged, which can well show the motion state of the camera, enabling the user to more quickly and conveniently determine the position of the background image they need.
[0057] Optionally, marking multiple captured images based on the target position to obtain multiple marked images includes: determining the target color corresponding to the target position; using the color information of the target color to mark the multiple captured images to obtain multiple marked images.
[0058] Considering the intuitiveness during image display, when marking the background image, different colors can be selected as the marking method, that is, different target colors can be set for the background images corresponding to different target positions. Considering that the target color may conflict with the background color, the background color can be determined first, and then the target color can be determined.
[0059] For example, if the background is a blue sky, the above-mentioned target color can be other colors except blue and colors close to blue. The specific color determination criteria can refer to relevant materials and will not be elaborated here.
[0060] Optionally, determining the target color corresponding to the target position includes: obtaining a preset color wheel, where the colors included in the preset color wheel change gradually; sampling the preset color wheel at a preset interval to obtain the target color.
[0061] The above-mentioned preset interval can refer to a time interval or a position interval between images. It should be noted that the above-mentioned preset interval is only an exemplary illustration, and the user can select the required preset interval or interval size according to the actual situation, and no specific limitation is made here. When determining the target colors of different first images, they can be determined one by one according to the above-mentioned preset interval.
[0062] For example, the user can first determine the preset color wheel range of the target color to be selected, such as from red to green, and yellow will be included in the preset color wheel. If the above-mentioned preset interval is a time interval, then at this time, the preset color wheel can be evenly divided according to the number of first images obtained, so that different first images can correspond to different target colors. That is, the color of the first image corresponding to the first frame can be set to red, and the color of the first image corresponding to the last frame can be set to green, and the colors of the remaining first images are correspondingly set between red and green; if the above-mentioned preset interval is a position interval, then at this time, the first image of the first frame can be set to red, and the first image of the last frame can be set to green, and then the other colors in the preset color wheel are evenly distributed between the first images of the first frame and the last frame, and the first images of the remaining frames can determine their corresponding target colors according to their specific positions.
[0063] It should be noted that the above-mentioned preset color wheel changes gradually, and each color in the preset color wheel corresponds to only one first image.
[0064] By using different colors to determine the positions of different first images to obtain an obvious first image sequence, the movement range of the virtual camera can be clearly determined, that is, the range of the background image that can be obtained through the virtual camera. Further, the image area that needs to be background-rendered can be accurately determined, that is, the background area of the above-mentioned first virtual scene. For example, if the background image is a sky background, the range of the sky background to be rendered can be determined specifically, so as to ensure the accuracy of the rendering result.
[0065] Optionally, after determining the background area of the first virtual scene based on the first image, the method includes: controlling the virtual camera to shoot the second virtual scene based on the camera data to obtain a second image sequence, where both the second virtual scene and the first virtual scene include a background model; merging the second image sequence with the first image to obtain a second image; determining the background area of the second virtual scene based on the second image.
[0066] The above-mentioned second virtual scene can refer to a virtual scene containing virtual objects; the above-mentioned background model can refer to a model used to render the background of the virtual scene, such as a sky sphere background, a grassland background, etc. It should be noted that both the second virtual scene and the first virtual scene include the above-mentioned background model. The difference between the two is that the second virtual scene contains virtual objects, such as models of buildings and virtual creatures, while the first virtual scene is just a blank scene, or only has the above-mentioned background model, such as a sky or grassland model.
[0067] In an alternative solution of this embodiment, since there are not only background images in some virtual scenes, but also virtual objects, such as buildings in an urban scene and marine organisms in a marine scene. When using a virtual camera to capture a virtual scene, some background areas may not be captured due to virtual models such as buildings and marine organisms. That is to say, these un-capturable background areas do not need to be drawn and rendered. Therefore, when the user draws the background area, only the background area that can be captured by the virtual camera needs to be drawn, that is, the background area corresponding to the second image in the second virtual scene.
[0068] In an alternative solution of this embodiment, after obtaining the first image of the first virtual scene using a virtual camera, multiple virtual objects, such as virtual models corresponding to buildings and virtual organisms, can be selected to be displayed, and the virtual scene at this time is used as the second virtual scene. Then, the virtual camera is used to capture the second virtual scene according to the preset conditions when capturing the first virtual scene to obtain the above-mentioned second image sequence.
[0069] In an alternative solution of this embodiment, after obtaining the second image sequence, the second image sequence can be merged with the first image using an image extraction method to obtain the second image. Specifically, the image information corresponding to each image in the first image, such as the trajectory position and field of view angle of the virtual camera, can be obtained first. Then, from the second image sequence, the image with the same trajectory position and field of view angle is selected to determine the image in the second image sequence corresponding to each image in the first image, so as to combine and generate the above-mentioned second image. Finally, the above-mentioned background area is determined from the second virtual scene according to the second image.
[0070] Figure 4 It is a schematic diagram of the second image sequence according to one embodiment of the present invention. As Figure 4 shown, the second image is a continuous virtual image with a direction corresponding to the first image, and it mainly shows the virtual objects in the virtual scene.
[0071] In an alternative solution of this embodiment, when determining the background area in the second virtual scene, if the first virtual scene is a blank scene, that is, there are no background elements in the first image, after determining the second image according to the first image, the background area can be obtained by using scan-line rendering, such as Figure 4 the shaded part of each rectangular frame in; if the first virtual scene is a virtual scene with a background model, the first image and the second image can be subjected to image extraction, and the same parts in the corresponding images are retained, and the different parts are removed, so as to obtain the background area of the above-mentioned second virtual scene, such as Figure 4The shaded part of each rectangular box in. For the specific method of obtaining the same part in two images, relevant literature can be referred to.
[0072] In an optional solution of this embodiment, since there are multiple images with the same background elements in the second image, the user only needs to draw the same background elements once, instead of drawing for each second image. Therefore, after obtaining the second image, the background elements corresponding to each image in the second image can be determined first, and then these background elements can be determined in the background model of the second virtual scene, that is, the above-mentioned background area is determined.
[0073] For example, taking the above background model as a sky model containing the sun, if there are multiple images in the second image that all contain the sun part, the user only needs to draw the sun part once, and does not need to redraw the sun part every time the virtual camera is switched. If the background elements corresponding to the images in the second image are only the sun and the surrounding clouds and the sky part, the sun and the surrounding clouds and the sky part can be directly determined in the background model of the second virtual scene, so as to determine the above-mentioned background area of the second virtual scene.
[0074] Optionally, merging the second image sequence with the first image to obtain the second image includes: sampling the second image sequence to obtain key frame images; merging the key frame images with the first image to obtain the second image.
[0075] The above key frame images can refer to the images in the second image sequence with obvious background elements, the image frames where the background area needs to be drawn, or the image frames used to transition and prompt the user about the current work progress.
[0076] In an optional solution of this embodiment, the user can select key frames according to the actual situation and remove the image frames that are useless for drawing the background area. For example, the image frames that can show the structural layout of the virtual background can be retained, the image frames without background images in the target video can be discarded, and the image frames captured when the position of the virtual camera does not change, etc. The situation of determining the key frames can be determined by the user and will not be specifically limited here.
[0077] Figure 5 is a schematic diagram of the selection of key image frames according to one embodiment of the present invention. As Figure 5 shown, among multiple image frames, key image frames with strong correlation to the structural layout of the virtual background and that can help the user determine the background area to be drawn can be selected. For example Figure 5In (1) and (6), only the virtual background part and the building part are shown respectively. It is difficult for users to determine the background area to be drawn based on these two parts. Therefore, (1) and (6) can be discarded, and (2), (3), (4), and (5) are determined as the key image frames.
[0078] In an alternative solution of this embodiment, after the user selects the key image frames, for the convenience of the user to view, as Figure 5 shown, a rectangular frame can also be used to enclose the key image frames selected by the user, so that the user can judge whether the selection is correct. It should be noted that Figure 5 the rectangular frame in [] is only for exemplary display. In addition, the key image frames selected by the user can be given colors, or marked with book symbols below the key image frames, etc. The specific ways to remind the user are not limited.
[0079] In an alternative solution of this embodiment, after the user selects the key image frames, these key frames can be directly rendered and output. Considering the continuity and convenience of the output key frame images, the picture format of exr can be selected to output multiple key image frames selected by the user through multi-channel merging.
[0080] Optionally, after determining the background area of the second virtual scene based on the second image, the method further includes: obtaining a background image corresponding to the background area of the second virtual scene; rendering the background model in the second virtual scene based on the background image to obtain a target virtual scene; and displaying the target virtual scene in the interaction interface.
[0081] In an alternative solution of this embodiment, after determining the above-mentioned background image, that is, the background area of the second virtual scene, the initial background model can be rendered using this image to generate the virtual background required by the user, so as to simplify the entire rendering process and avoid the problem of excessive occupation of system memory resources when rendering the background model using the overall background image.
[0082] For example, if the second virtual scene is a sky scene and the virtual object in the scene is a building, the above-mentioned background image corresponding to the second virtual scene refers to the sky background excluding the shadow part of the target building photographed at different positions and angles. The user needs to draw the sky background corresponding to the shadow part. Figure 6 is a schematic diagram of a virtual scene image according to an embodiment of the present invention. As Figure 6 shown, where the entire picture represents a virtual scene image with a target object. The 1042 in the lower right corner of the image represents that this is the second image corresponding to the 1042nd frame. The target building part in the figure represents the above-mentioned target object. At this time Figure 6 the shaded area in [] can be the above-mentioned background area. That is to say, the shaded area can be drawn to obtain the background area.
[0083] To facilitate comparison between the determined background area and the original virtual scene image, Figure 7 is a schematic diagram of the target virtual background image according to one embodiment of the present invention. As Figure 7 shown, the range of the background area determined by the above method is small. The user only needs to draw the background area, without having to draw the entire virtual background, which can greatly improve the speed of rendering the background, and does not involve the background area covered by the target building, without perspective errors, and the accuracy of the determined background area is also relatively high.
[0084] After generating the final virtual background, the virtual background can be combined with the initial second virtual scene. For example, the Figure 7 shadow area in it is combined with its original second virtual scene including buildings to obtain the above-mentioned target virtual scene, and the target virtual scene is displayed to the user in the interaction interface.
[0085] By only generating the virtual background of a specific area, the memory resources occupied by the system for rendering the background model are greatly reduced. While improving the rendering speed, the rendering accuracy is also improved, enhancing the user experience.
[0086] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disc), including several instructions for causing a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of various embodiments of the present invention.
[0087] In this embodiment, a background area determination device is also provided. This device is used to implement the above embodiments and preferred implementation manners, and those that have been described will not be repeated. As used hereinafter, the terms "unit" and "module" can be a combination of software and / or hardware that can achieve a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.
[0088] Figure 8 is a structural block diagram of the background area determination device according to one embodiment of the present invention. A graphical user interface is provided through a terminal device, and the content displayed on the graphical user interface includes a touch area, as Figure 8As shown in the figure, the device includes: an acquisition module 802, configured to acquire camera data of a virtual lens, where the camera data at least includes: the movement trajectory of the virtual lens; a generation module 804, configured to control the virtual lens to shoot a first virtual scene based on the camera data, and generate a first image, where the first image is used to represent the movement range of the virtual lens during movement; a determination module 806, configured to determine the background area of the first virtual scene based on the first image.
[0089] Optionally, the camera data further includes: the viewing angle corresponding to the movement trajectory, and the generation module 804 includes: a movement unit, configured to control the virtual lens to move according to the movement trajectory; a first shooting unit, configured to control the virtual lens to shoot the first virtual scene according to the viewing angle, and obtain a first image sequence; a first merging unit, configured to merge the first image sequence to generate a first image.
[0090] Optionally, the generation unit is further configured to: perform a frame freezing operation on the first image sequence to obtain multiple captured images; determine the target positions of the multiple captured images in the first image sequence; mark the multiple captured images based on the target positions to obtain multiple marked images; and merge the multiple marked images to generate a first image.
[0091] Optionally, the generation unit is further configured to: determine the target color corresponding to the target position; and mark the multiple captured images with the color information of the target color to obtain multiple marked images.
[0092] Optionally, the generation unit is further configured to: obtain a preset color wheel, where the colors included in the preset color wheel change gradually; and sample the preset color wheel at a preset interval to obtain the target color.
[0093] Optionally, the device further includes: a second shooting unit, configured to control the virtual lens to shoot a second virtual scene based on the camera data, and obtain a second image sequence, where both the second virtual scene and the first virtual scene include a background model; a second merging unit, configured to merge the second image sequence with the first image to obtain a second image; and a determination unit, configured to determine the background area of the second virtual scene based on the second image.
[0094] Optionally, the second merging unit is further configured to: sample the second image sequence to obtain key frame images; and merge the key frame images with the first image to obtain a second image.
[0095] Optionally, the device further includes: a background image acquisition module, configured to acquire a background image corresponding to the background area of the second virtual scene; a rendering module, configured to render the background model in the second virtual scene based on the background image to obtain a target virtual scene; and a display module, configured to display the target virtual scene in an interaction interface.
[0096] It should be noted that the above-mentioned units and modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above-mentioned units and modules are all located in the same processor; or, the above-mentioned units and modules are respectively located in different processors in any combination form.
[0097] An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored. Among them, the computer program is set to execute the steps in any one of the above method embodiments when running.
[0098] Optionally, in this embodiment, the above-mentioned computer-readable storage medium may include, but is not limited to: USB flash drive, read-only memory (abbreviated as ROM), random access memory (abbreviated as RAM), mobile hard disk, magnetic disk or optical disc and other various media that can store computer programs.
[0099] Optionally, in this embodiment, the above-mentioned computer-readable storage medium may be located in any one of the computer terminals in the computer terminal group in the computer network.
[0100] Optionally, in this embodiment, the above-mentioned computer-readable storage medium may be set to store a computer program for executing the following steps:
[0101] S1: Used to obtain the camera data of the virtual lens. Among them, the camera data at least includes: the movement trajectory of the virtual lens;
[0102] S2: Used to control the virtual lens to shoot the first virtual scene based on the camera data, and generate a first image, where the first image is used to represent the movement range of the virtual lens during the movement process;
[0103] S3: Used to determine the background area of the first virtual scene based on the first image
[0104] Optionally, the above-mentioned computer-readable storage medium is also set to store program code for executing the following steps: The camera data further includes: the viewing angle corresponding to the movement trajectory. Controlling the virtual lens to shoot the first virtual scene based on the camera data and generating a first image includes: controlling the virtual lens to move according to the movement trajectory; controlling the virtual lens to shoot the first virtual scene according to the viewing angle to obtain a first image sequence; merging the first image sequence to generate a first image.
[0105] Optionally, the above computer-readable storage medium is further configured to store program code for performing the following steps: merging the first image sequence to generate a first image, including: performing a frame freezing operation on the first image sequence to obtain multiple captured images; determining target positions of the multiple captured images in the first image sequence; marking the multiple captured images based on the target positions to obtain multiple marked images; and merging the multiple marked images to generate the first image.
[0106] Optionally, the above computer-readable storage medium is further configured to store program code for performing the following steps:
[0107] Marking the multiple captured images based on the target positions to obtain multiple marked images includes: determining a target color corresponding to the target positions; and marking the multiple captured images with color information of the target color to obtain multiple marked images.
[0108] Optionally, the above computer-readable storage medium is further configured to store program code for performing the following steps: Determining a target color corresponding to the target positions includes: obtaining a preset color wheel, where the colors included in the preset color wheel change gradually; and sampling the preset color wheel at a preset interval to obtain the target color.
[0109] Optionally, the above computer-readable storage medium is further configured to store program code for performing the following steps: After determining a background area of the first virtual scene based on the first image, the method includes: controlling a virtual lens based on camera data to capture a second virtual scene to obtain a second image sequence, where both the second virtual scene and the first virtual scene include a background model; merging the second image sequence with the first image to obtain a second image; and determining a background area of the second virtual scene based on the second image.
[0110] Optionally, the above computer-readable storage medium is further configured to store program code for performing the following steps: Merging the second image sequence with the first image to obtain a second image includes: sampling the second image sequence to obtain key frame images; and merging the key frame images with the first image to obtain the second image.
[0111] Optionally, the above computer-readable storage medium is further configured to store program code for performing the following steps: After determining a background area of the second virtual scene based on the second image, the method further includes: obtaining a background image corresponding to the background area of the second virtual scene; rendering the background model in the second virtual scene based on the background image to obtain a target virtual scene; and displaying the target virtual scene in an interaction interface.
[0112] In at least some embodiments of the present invention, camera data of a virtual lens is acquired; the virtual lens is controlled based on the camera data to capture a first virtual scene, generating a first image; and the background area of the first virtual scene is determined based on the first image. By using the scene information of the initial virtual scene shown in the target video and the movement trajectory of the virtual lens, the range of the background area that needs to be drawn by the user is determined, and the overall virtual background is no longer drawn, which can improve the work efficiency when the user is drawing. At the same time, the background area is determined according to the actually acquired target video of the initial virtual scene, without having to consider too much the problem of poor image accuracy caused by the perspective error of the virtual lens, further improving the accuracy of the determined background area, and thus solving the technical problem of poor accuracy in determining the background area to be manually drawn by the user in the virtual scene in the related art.
[0113] From the description of the above embodiments, those skilled in the art can easily understand that the exemplary embodiments described herein can be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present invention can be embodied in the form of a software product, which can be stored in a computer-readable storage medium (such as a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (such as a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present invention.
[0114] In an exemplary embodiment of the present application, a program product capable of implementing the above method of this embodiment is stored on a computer-readable storage medium. In some possible implementation manners, various aspects of the embodiments of the present invention can also be implemented in the form of a program product, which includes program code. When the program product runs on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary embodiments of the present invention described in the "exemplary method" part above.
[0115] The program product for implementing the above method according to the embodiments of the present invention can use a portable compact disc read-only memory (CD-ROM) and include program code, and can run on a terminal device, such as a personal computer. However, the program product of the embodiments of the present invention is not limited to this. In the embodiments of the present invention, the computer-readable storage medium can be any tangible medium that contains or stores a program, and the program can be used by or in combination with an instruction execution system, apparatus, or device.
[0116] The above program product may adopt any combination of one or more computer-readable media. Such computer-readable storage media may, for example, but are not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or components, or any combination of the above. More specific examples (non-exhaustive listing) of computer-readable storage media include: electrical connections with one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disc read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above.
[0117] It should be noted that the program code contained on the computer-readable storage media can be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the above.
[0118] An embodiment of the present invention further provides an electronic device, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0119] Optionally, the above electronic device may further include a transmission device and an input / output device. Among them, the transmission device is connected to the above processor, and the input / output device is connected to the above processor.
[0120] Optionally, in this embodiment, the above processor may be configured to execute the following steps through a computer program:
[0121] S1: Used to obtain camera data of a virtual lens. Among them, the camera data at least includes: the movement trajectory of the virtual lens;
[0122] S2: Used to control the virtual lens to shoot a first virtual scene based on the camera data, and generate a first image. The first image is used to represent the movement range of the virtual lens during the movement process;
[0123] S3: Used to determine the background area of the first virtual scene based on the first image
[0124] Optionally, the above computer-readable storage media is further configured to store program code for executing the following steps: The camera data further includes: the viewing angle corresponding to the movement trajectory. Controlling the virtual lens to shoot the first virtual scene based on the camera data and generating a first image includes: controlling the virtual lens to move according to the movement trajectory; controlling the virtual lens to shoot the first virtual scene according to the viewing angle to obtain a first image sequence; merging the first image sequence to generate a first image.
[0125] Optionally, the above computer-readable storage medium is further configured to store program code for performing the following steps: merging the first image sequence to generate a first image, including: performing a frame freezing operation on the first image sequence to obtain multiple captured images; determining target positions of the multiple captured images in the first image sequence; marking the multiple captured images based on the target positions to obtain multiple marked images; and merging the multiple marked images to generate the first image.
[0126] Optionally, the above computer-readable storage medium is further configured to store program code for performing the following steps:
[0127] Marking the multiple captured images based on the target positions to obtain multiple marked images includes: determining a target color corresponding to the target positions; and marking the multiple captured images with color information of the target color to obtain multiple marked images.
[0128] Optionally, the above computer-readable storage medium is further configured to store program code for performing the following steps: Determining the target color corresponding to the target positions includes: obtaining a preset color wheel, where the colors included in the preset color wheel change gradually; and sampling the preset color wheel at a preset interval to obtain the target color.
[0129] Optionally, the above computer-readable storage medium is further configured to store program code for performing the following steps: After determining the background area of the first virtual scene based on the first image, the method includes: controlling a virtual lens based on camera data to capture a second image sequence of a second virtual scene, where both the second virtual scene and the first virtual scene include a background model; merging the second image sequence with the first image to obtain a second image; and determining the background area of the second virtual scene based on the second image.
[0130] Optionally, the above computer-readable storage medium is further configured to store program code for performing the following steps: Merging the second image sequence with the first image to obtain a second image includes: sampling the second image sequence to obtain key frame images; and merging the key frame images with the first image to obtain the second image.
[0131] Optionally, the above computer-readable storage medium is further configured to store program code for performing the following steps: After determining the background area of the second virtual scene based on the second image, the method further includes: obtaining a background image corresponding to the background area of the second virtual scene; rendering the background model in the second virtual scene based on the background image to obtain a target virtual scene; and displaying the target virtual scene in an interaction interface.
[0132] In at least some embodiments of the present invention, camera data of a virtual lens is acquired; the virtual lens is controlled based on the camera data to capture a first virtual scene, generating a first image; and the background area of the first virtual scene is determined based on the first image. By utilizing the scene information of the initial virtual scene shown in the target video and the movement trajectory of the virtual lens, the range of the background area that needs to be drawn by the user is determined, and the overall virtual background is no longer drawn, which can improve the work efficiency when the user is drawing. At the same time, the background area is determined according to the actually acquired target video of the initial virtual scene, without having to consider too much the problem of poor image accuracy caused by the perspective error of the virtual lens, further improving the accuracy of the determined background area, and thus solving the technical problem of poor accuracy in determining the background area to be manually drawn by the user in the virtual scene in the related art.
[0133] Figure 9 is a schematic diagram of an electronic device according to an embodiment of the present invention. As Figure 9 shown, the electronic device 900 is merely an example and should not impose any limitations on the functions and usage scope of the embodiments of the present invention.
[0134] As Figure 9 shown, the electronic device 900 is presented in the form of a general-purpose computing device. The components of the electronic device 900 may include, but are not limited to: the at least one processor 910 described above, the at least one memory 920 described above, a bus 930 connecting different system components (including the memory 920 and the processor 910), and a display 940.
[0135] Among them, the above-mentioned memory 920 stores program code, and the program code can be executed by the processor 910, enabling the processor 910 to execute the steps according to various exemplary embodiments of the present invention described in the above method part of the present application.
[0136] The memory 920 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 9201 and / or a cache storage unit 9202, and may further include a read-only storage unit (ROM) 9203, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memories.
[0137] In some instances, the memory 920 may further include a program / utilities 9204 having a set (at least one) of program modules 9205. Such program modules 9205 include but are not limited to: an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. The memory 920 may further include a memory remotely located with respect to the processor 910. These remote memories may be connected to the electronic device 900 through a network. Examples of such networks include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0138] The bus 930 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, a graphics acceleration port, the processor 910, or a local bus using any of a variety of bus structures.
[0139] The display 940 may be, for example, a touchscreen liquid crystal display (LCD), which enables a user to interact with the user interface of the electronic device 900.
[0140] Optionally, the electronic device 900 may also communicate with one or more external devices 1000 (such as a keyboard, a pointing device, a Bluetooth device, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 900, and / or may communicate with any device that enables the electronic device 900 to communicate with one or more other computing devices (such as a router, a modem, etc.). Such communication may be through the input / output (I / O) interface 950. And, the electronic device 900 may also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through the network adapter 960. As Figure 9 shown, the network adapter 960 communicates with other modules of the electronic device 900 through the bus 930. It should be understood that although Figure 9 not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 900, which may include but are not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0141] The above-mentioned electronic device 900 may further include: a keyboard, a cursor control device (such as a mouse), an input / output interface (I / O interface), a network interface, a power supply, and / or a camera.
[0142] Those of ordinary skill in the art can understand that Figure 9 the structure shown is only schematic and does not limit the structure of the above-mentioned electronic device. For example, the electronic device 900 may further include more thanFigure 9 more or fewer components shown, or having a configuration different from that Figure 1 shown. The memory 920 can be used to store computer programs and corresponding data, such as the computer program and corresponding data corresponding to the background area determination method in the embodiments of the present invention. The processor 910 executes various functional applications and data processing by running the computer program stored in the memory 920, that is, implements the above-mentioned background area determination method.
[0143] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0144] In the above embodiments of the present invention, the descriptions of each embodiment have their own emphases. For the parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0145] In the several embodiments provided by the present application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only illustrative. For example, the division of units can be a logical function division. In actual implementation, there can be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point, the displayed or discussed coupling or direct coupling or communication connection between each other can be through some interfaces. The indirect coupling or communication connection of units or modules can be in an electrical or other form.
[0146] The units described as separate components may or may not be physically separated. The components shown as units may or may not be physical units, that is, they can be located in one place or distributed to multiple units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0147] In addition, the functional units in each embodiment of the present invention can be integrated in a processing unit, or each unit exists physically alone, or two or more units are integrated in one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
[0148] When the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present invention. The foregoing storage medium includes: various media that can store program codes, such as USB flash drives, read-only memories (ROMs), random access memories (RAMs), mobile hard disks, magnetic disks, or optical discs.
[0149] The above are only the preferred embodiments of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and modifications can be made, and these improvements and modifications should also be regarded as the protection scope of the present invention.
Claims
1. A background area determination method, characterized in that: include: Acquiring camera data of a virtual lens, wherein the camera data at least includes: a motion trajectory of the virtual lens; Controlling the virtual lens to shoot a first virtual scene based on the camera data to generate a first image, wherein the first image is used to represent a motion range of the virtual lens during the motion process; determining a background area of the first virtual scene based on the first image; controlling the virtual lens to shoot a second virtual scene based on the camera data to obtain a second image sequence, wherein both the second virtual scene and the first virtual scene include a background model; merging the second image sequence with the first image to obtain a second image; A background area of the second virtual scene is determined based on the second image.
2. The method according to claim 1, characterized in that The camera data further includes: a field of view angle corresponding to the motion trajectory; and controlling the virtual lens to shoot the first virtual scene based on the camera data to generate a first image includes: Controlling the virtual lens to move along the motion trajectory; controlling the virtual lens to shoot the first virtual scene according to the field of view angle to obtain a first image sequence; The first image sequence is merged to generate the first image.
3. The method according to claim 2, characterized in that Merging the first image sequence to generate the first image includes: performing a frame freezing operation on the first image sequence to obtain a plurality of captured images; determining target positions of the plurality of captured images in the first image sequence; marking the plurality of captured images based on the target position to obtain a plurality of marked images; The multiple marked images are merged to generate the first image.
4. The method according to claim 3, characterized in that Marking the plurality of captured images based on the target position to obtain the plurality of marked images includes: Determining a target color corresponding to the target position; The plurality of captured images are marked using the color information of the target color to obtain the plurality of marked images.
5. The method according to claim 4, characterized in that Determining the target color corresponding to the target position includes: Obtaining a preset color wheel, wherein the colors included in the preset color wheel change gradually; The preset color wheel is sampled at preset intervals to obtain the target color.
6. The method according to claim 1, characterized in that Merging the second image sequence with the first image to obtain a second image includes: Sampling the second image sequence to obtain a key frame image; The key frame image is merged with the first image to obtain the second image.
7. The method according to claim 5, characterized in that After determining the background area of the second virtual scene based on the second image, the method further includes: Acquire a background image corresponding to the background area of the second virtual scene; Rendering the background model in the second virtual scene based on the background image to obtain a target virtual scene; The target virtual scene is displayed in an interactive interface.
8. A background area determination device, characterized in that: include: An acquisition module, configured to acquire camera data of a virtual lens, wherein the camera data at least includes: a motion trajectory of the virtual lens; a generating module, configured to control the virtual lens to shoot a first virtual scene based on the camera data, and generate a first image, wherein the first image is used to represent a motion range of the virtual lens during the motion process; a determining module, configured to determine a background area of the first virtual scene based on the first image; a second shooting unit, configured to control the virtual lens to shoot a second virtual scene based on the camera data to obtain a second image sequence, wherein both the second virtual scene and the first virtual scene include a background model; a second merging unit, configured to merge the second image sequence with the first image to obtain a second image; A determining unit is configured to determine a background area of the second virtual scene based on the second image.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the background area determination method according to any one of claims 1 to 7 when executed by a processor.
10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the background area determination method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Drawing system and method of 3D scene, and terminal
CN105389848A
Video generation method and device of virtual scene, storage medium and electronic equipment
CN113747138A