Scene object highlighting methods, devices, electronic devices and storage media

By using a templated depth texture map processing technique in 3D scenes, the problem of inaccurate highlighting in existing technologies is solved, achieving more efficient and accurate highlighting of target objects while reducing hardware requirements.

CN115619919BActive Publication Date: 2026-11-10NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211073797.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-02
Publication Date
2026-11-10
Estimated Expiration
2042-09-02

AI Technical Summary

Technical Problem

Existing technologies struggle to accurately highlight specific characters, objects, or areas in 3D scenes, leading to a decline in user experience.

Method used

By processing target objects in a 3D scene using a templated depth texture map, a templated object depth texture map is generated, and the target scene is rendered based on the template value, enhancing the accuracy of highlighting.

Benefits of technology

It improves the accuracy of highlighting target objects in 3D scenes, reduces hardware requirements, reduces memory and video memory usage, and improves highlighting efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115619919B_ABST
    Figure CN115619919B_ABST
Patent Text Reader

Abstract

This invention relates to the field of game image processing technology, and discloses a method, apparatus, electronic device, and storage medium for highlighting scene objects. It is used to accurately highlight target objects in a 3D scene using a templated depth texture map, thereby enhancing highlighting accuracy. The method includes: in response to a scene object highlighting instruction, acquiring a templated scene depth texture map corresponding to the target scene, wherein the scene object highlighting instruction indicates the target object in the target scene that needs to be highlighted, and the templated scene depth texture map corresponds to a first template value; generating a templated object depth texture map based on the target object and the templated scene depth texture map, wherein the templated object depth texture map corresponds to a second template value; and processing the target scene based on the templated object depth texture map to obtain a rendered image of the target scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of game image processing technology, and in particular to a method, apparatus, electronic device, and storage medium for highlighting scene objects. Background Technology

[0002] Typically, to help users focus their attention on a specific character, object, or area while playing a game, prompts and instructions are provided to guide them in performing related actions, thereby enhancing their gaming experience.

[0003] Existing solutions typically wrap specific objects or areas using the on-screen UI. However, in 3D game scenes, existing solutions struggle to accurately highlight specific characters, objects, or areas from the 3D environment. Summary of the Invention

[0004] This invention provides a method, apparatus, electronic device, and storage medium for highlighting scene objects, which accurately highlights target objects in a 3D scene using a templated depth texture map, thereby enhancing the highlighting accuracy.

[0005] A first aspect of this invention provides a scene object highlighting method, comprising: responding to a scene object highlighting instruction, acquiring a scene depth texture map with a template corresponding to a target scene, wherein the scene object highlighting instruction is used to indicate a target object in the target scene that needs to be highlighted, and the scene depth texture map with the template corresponds to a first template value; generating a templated object depth texture map based on the target object and the scene depth texture map with the template, wherein the templated object depth texture map corresponds to a second template value; and processing the target scene based on the templated object depth texture map to obtain a target scene rendering image.

[0006] A second aspect of the present invention provides a scene object highlighting device, comprising: an acquisition module, configured to acquire a templated scene depth texture map corresponding to a target scene in response to a scene object highlighting instruction, wherein the scene object highlighting instruction is used to indicate a target object in the target scene that needs to be highlighted, and the templated scene depth texture map corresponds to a first template value; a generation setting module, configured to generate a templated object depth texture map based on the target object and the templated scene depth texture map, wherein the templated object depth texture map corresponds to a second template value; and a processing module, configured to process the target scene based on the templated object depth texture map to obtain a target scene rendering image.

[0007] A third aspect of the present invention provides an electronic device, including: a memory and at least one processor, wherein the memory stores instructions; the at least one processor invokes the instructions in the memory to cause the electronic device to execute the scene object highlighting method described above.

[0008] A fourth aspect of the present invention provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the above-described scene object highlighting method.

[0009] In the technical solution provided by this invention, in response to a scene object highlighting instruction, a scene depth texture map with a template corresponding to the target scene is obtained. The scene object highlighting instruction is used to indicate the target object in the target scene that needs to be highlighted, and the scene depth texture map with a template corresponds to a first template value. A templated object depth texture map is generated based on the target object and the scene depth texture map with a template, and the templated object depth texture map corresponds to a second template value. The target scene is processed based on the templated object depth texture map to obtain a rendered image of the target scene. This invention accurately highlights target objects in a 3D scene using a templated depth texture map, enhancing highlighting accuracy, avoiding the use of models, and reducing hardware requirements. Attached Figure Description

[0010] Figure 1 This is a schematic diagram of an embodiment of the scene object highlighting method in this invention; Figure 2 This is a schematic diagram of another embodiment of the scene object highlighting method in this invention; Figure 3 This is a schematic diagram of another embodiment of the scene object highlighting method in this invention; Figure 4 This is a schematic diagram of another embodiment of the scene object highlighting method in this invention; Figure 5 This is a schematic diagram of one embodiment of the scene object highlighting device in this invention; Figure 6 This is a schematic diagram of one embodiment of the electronic device in this invention. Detailed Implementation

[0011] This invention provides a method, apparatus, electronic device, and storage medium for highlighting scene objects, which uses template masking to highlight target objects or target areas in an image, enhancing the accuracy and timeliness of highlighting, reducing the occupation of memory and video memory, and improving highlighting efficiency.

[0012] It is understood that this invention can be applied to electronic devices, which may be servers or terminals, and this invention does not limit them.

[0013] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented, for example, in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0014] In existing solutions, the method of wrapping the highlighted object in the screen UI cannot accurately match the characters, objects and areas in the 3D scene. However, the scene object highlighting method provided by this invention can accurately identify the target object or target area in the image by using template masking. By increasing the brightness of the identified area or decreasing the brightness of the unidentified area, the accuracy of object highlighting is enhanced.

[0015] In one embodiment of the present invention, the scene object highlighting method can run on a local terminal device or a server. When the scene object highlighting method runs on a server, the method can be implemented and executed based on a cloud interaction system, wherein the cloud interaction system includes a server and a client device.

[0016] In an optional implementation, various cloud applications, such as cloud gaming, can run under the cloud interaction system. Taking cloud gaming as an example, cloud gaming refers to a gaming method based on cloud computing. In the cloud gaming operating mode, the game program's execution and the game screen presentation are separated. The storage and execution of scene object highlighting methods are completed on the cloud gaming server. The client device is used for data reception, transmission, and game screen presentation. For example, the client device can be a display device with data transmission capabilities located close to the user, such as a mobile terminal, television, computer, or PDA; however, information processing is performed by the cloud gaming server in the cloud. When playing the game, the player operates the client device to send operation commands to the cloud gaming server. The cloud gaming server runs the game according to the operation commands, encodes and compresses game screen data, returns it to the client device via the network, and finally, the client device decodes and outputs the game screen.

[0017] In an optional implementation, taking a game as an example, the local terminal device stores the game program and is used to display the game screen. The local terminal device is used to interact with the player through a graphical user interface (GUI), i.e., conventionally by downloading, installing, and running the game program via an electronic device. The local terminal device can provide the GUI to the player in various ways, such as rendering it on the terminal's display screen or providing it to the player via holographic projection. For example, the local terminal device can include a display screen for displaying the GUI, which includes game screens, and a processor for running the game, generating the GUI, and controlling the display of the GUI on the display screen.

[0018] In one possible implementation, embodiments of the present invention provide a method for highlighting scene objects, which provides a graphical user interface through a terminal device. The terminal device may be the aforementioned local terminal device or a client device in the aforementioned cloud interaction system.

[0019] Please see Figure 1 A flowchart of a scene object highlighting method provided in this embodiment of the invention specifically includes: 101. In response to the scene object highlighting command, obtain the scene depth texture map with template corresponding to the target scene. The scene object highlighting command is used to indicate the target object in the target scene that needs to be highlighted. The scene depth texture map with template corresponds to the first template value.

[0020] When a scene object highlighting instruction is received from the user terminal, the instruction is parsed to determine that the target object in the target scene needs to be highlighted. The target object can be a specific character, object, or area in the game scene. First, a scene depth texture map with a template is obtained for the target scene. The scene depth texture map with a template contains the target object to be highlighted, and the template value corresponding to each pixel in the scene depth texture map with a template is the first template value.

[0021] 102. Generate a templated object depth texture map based on the target object and the templated scene depth texture map. The templated object depth texture map corresponds to the second template value.

[0022] Generate a templated object depth texture map based on the target object and the templated scene depth texture map, wherein the templated object depth texture map corresponds to the second template value.

[0023] It should be noted that when drawing scenes and characters, special template values ​​are set for characters that need to be highlighted, based on the scene depth texture map of the template. This is used to distinguish between characters that need prompts and those that do not. For example, the template value for characters that need to be highlighted can be set to 0B00000010, and the template value for characters that do not need to be highlighted can be set to 0B00000001. These template values ​​can also be set to other values, but there are no specific restrictions here.

[0024] 103. Process the target scene based on the object depth texture map with template to obtain the target scene rendering image.

[0025] The target scene is highlighted based on the templated object depth texture map to obtain the target scene rendered image. A full-screen effect is then achieved using both the templated object depth texture map and the templated scene depth texture map to obtain the target scene rendered image.

[0026] It should be noted that highlighting refers to specially marking objects or areas that need to be highlighted, so as to distinguish them from other non-highlighted objects or areas. After highlighting, the objects or areas can be clearly seen in the scene.

[0027] In this embodiment of the invention, target objects in a 3D scene are accurately highlighted by using a depth texture map with a template, which enhances the highlighting accuracy, avoids the use of models, and reduces hardware requirements.

[0028] Please see Figure 2 Another flowchart of the scene object highlighting method provided in this embodiment of the invention specifically includes: 201. In response to the scene object highlighting command, obtain the scene depth texture map with template corresponding to the target scene. The scene object highlighting command is used to indicate the target object in the target scene that needs to be highlighted. The scene depth texture map with template corresponds to the first template value.

[0029] When a scene object highlighting instruction is received from the user terminal, the instruction is parsed to determine that the target object in the target scene needs to be highlighted. The target object can be a specific character, object, or area in the game scene. First, a scene depth texture map with a template is obtained for the target scene. The scene depth texture map with a template contains the target object to be highlighted, and the template value corresponding to each pixel in the scene depth texture map with a template is the first template value.

[0030] 202. Generate a templated object depth texture map based on the target object and the templated scene depth texture map. The templated object depth texture map corresponds to the second template value.

[0031] Generate a templated object depth texture map based on the target object and the templated scene depth texture map, wherein the templated object depth texture map corresponds to the second template value.

[0032] It should be noted that when drawing scenes and characters, special template values ​​are set for characters that need to be highlighted, based on the scene depth texture map of the template. This is used to distinguish between characters that need prompts and those that do not. For example, the template value for characters that need to be highlighted can be set to 0B00000010, and the template value for characters that do not need to be highlighted can be set to 0B00000001. These template values ​​can also be set to other values, but there are no specific restrictions here.

[0033] 203. Perform template testing on each pixel in the templated scene depth texture map based on the templated object depth texture map, and obtain the template test results.

[0034] Specifically, when the target object is a person or an object, the first template value corresponding to each pixel is read from the scene depth texture map with the template according to the preset reading template mask; the first template value corresponding to each pixel is compared with the second template value corresponding to the object depth texture map with the template, and the comparison result of each pixel is determined as the template test result. This embodiment limits the template testing process, clarifies the comparison of the first template value and the second template value, provides a specific implementation scheme, and improves testing efficiency.

[0035] 204. Determine the highlight color corresponding to each pixel in the scene depth texture map with template based on the template test results.

[0036] Specifically, when the template test result of the target pixel in the scene depth texture map with template is that the first template value is less than the second template value, a blend color is generated based on the initial color of the target pixel and a preset reference color, and the blend color is determined as the highlight color corresponding to the target pixel; when the template test result of the target pixel in the scene depth texture map with template is that the first template value is equal to the second template value, the initial color of the target pixel is determined as the highlight color corresponding to the target pixel, or the initial color of the target pixel is highlighted to obtain a highlight color, and the highlight color is determined as the highlight color corresponding to the target pixel; when the template test result of the target pixel in the scene depth texture map with template is that the first template value is greater than the second template value, the initial color of the target pixel is replaced with the target color, and the target color is determined as the highlight color corresponding to the target pixel.

[0037] For example, if the cached template value (i.e., the first template value) of a pixel is less than the preset template value (i.e., the second template value) for highlighting the character, it means that this pixel is a non-highlighting pixel. In this case, the color of the pixel is changed according to the preset first color and color mixing formula in the pixel.

[0038] It should be noted that when the preset first color is black and the blending method is multiplicative, the initial color of the pixel is multiplied by black, resulting in a darker highlighted color compared to the initial color, thus reducing the brightness of non-highlighted objects. If the template value of the pixel is equal to the preset template value for highlighting the subject, the initial color remains unchanged, or the pixel's initial color is blended with another preset second color, making the initial color brighter. Specifically, if the second color is (R:1.3, G:1.3, B:1.3) and the blending method is multiplicative, the pixel's initial color is multiplied by the second color, making it brighter, thus increasing the brightness of highlighted objects. If the template value of the pixel is greater than the preset template value for highlighting the subject, it indicates occlusion, and the pixel's initial color is directly replaced with another preset third color, such as red; the specific third color is not limited here.

[0039] In this embodiment, the process of determining the color of each pixel is refined, and different highlighting methods are used for different test results, thereby enhancing the distinction between the highlighted person or object and the surrounding scene.

[0040] 205. Render the target scene based on the highlighted color of each pixel in the scene depth texture map with template, the scene depth texture map with template, and the object depth texture map with template, to obtain the target scene rendered image.

[0041] When the target object is not occluded, the target scene is drawn based on the highlight color corresponding to each pixel in the scene depth texture map with template and the scene depth texture map with template; the target object is drawn on the target scene based on the highlight color corresponding to each pixel in the scene depth texture map with template and the object depth texture map with template, thus obtaining the target scene rendered image; or, when the target object is occluded, the target object is drawn based on the highlight color corresponding to each pixel in the scene depth texture map with template and the object depth texture map with template; the target scene is drawn on the target object based on the mask written with a preset template, the highlight color corresponding to each pixel in the scene depth texture map with template and the scene depth texture map with template, thus obtaining the target scene rendered image.

[0042] For example, the template value for a character to be highlighted can be set to 0B00000010, and the template value for a character not to be highlighted can be set to 0B00000001. When the character to be highlighted is in front of other objects or characters, i.e., not occluded, the default template value is 0B00000000. First, the scene is drawn (i.e., all objects except the character are drawn), with the template value set to 0B00000001. Then, the character to be highlighted is drawn. Because the depth test passes, the template value is replaced with 0B00000010. When other objects are in front of the character, i.e., the character is occluded, the default template value is 0B00000000. First, the character to be highlighted is drawn, with the template value set to 0B00000010. Then, other objects are drawn. Because the depth test passes and the template is written to the mask as 0B00000001, the template value is written to 0B00000011.

[0043] Understandably, when a pixel contains only other objects, the default stencil value is 0B00000000. When other objects are drawn and the depth test passes, the stencil value of the other objects (i.e., the characters that should not be highlighted) is written according to the Stencil Write Mask, and the final stencil value of the pixel is 0B00000001. When the pixel is not rendered, the default stencil value is 0B00000000.

[0044] This embodiment provides different drawing orders depending on whether the target person or object is occluded, allowing the person to be highlighted quickly and accurately even in occluded scenes, thus improving the success rate of highlighting.

[0045] In this embodiment of the invention, a depth texture map with a template is used to accurately highlight people or objects in a 3D scene, which enhances the highlighting accuracy, avoids the use of models, reduces hardware requirements, and can also quickly identify people or objects that are occluded and highlight them with other colors, thus improving the highlighting efficiency.

[0046] Please see Figure 3 Another flowchart of the scene object highlighting method provided in this embodiment of the invention specifically includes: 301. In response to the scene object highlighting command, obtain the scene depth texture map with template corresponding to the target scene. The scene object highlighting command is used to indicate the target object in the target scene that needs to be highlighted. The scene depth texture map with template corresponds to the first template value.

[0047] 302. Generate a templated object depth texture map based on the target object and the templated scene depth texture map. The templated object depth texture map corresponds to the second template value.

[0048] Steps 301-302 are similar to steps 201-202, and will not be repeated here.

[0049] 303. Generate a templated outer contour depth texture map based on the templated object depth texture map. The templated outer contour depth texture map includes contour marker values, which are used to indicate the outer contour of the target object.

[0050] Specifically, a templated outer contour depth texture map is generated based on the templated object depth texture map. This templated outer contour depth texture map includes contour marker values, which indicate the outer contour of the target object. These contour marker values ​​need to be distinct from both the first and second template values ​​so that the outer contour can clearly distinguish itself from the surrounding scene, enabling rapid user identification.

[0051] This embodiment adds a process for generating the outline of a person or object, further distinguishing the person or object from the scene. Even in scenes with overly chaotic colors, it can achieve a good highlighting effect, improving highlighting efficiency and success rate.

[0052] 304. Perform template testing on each pixel in the templated scene depth texture map based on the templated object depth texture map to obtain the template test results.

[0053] 305. Determine the highlight color corresponding to each pixel in the scene depth texture map with template based on the template test results.

[0054] Steps 304-305 are similar to steps 203-204, and will not be repeated here.

[0055] 306. Perform template testing on the outer contour depth texture map with template by reading the mask using the preset template. The template value corresponding to the template reading mask is the third template value.

[0056] A template test is performed on the outer contour depth texture map using a preset template read mask. The template value corresponding to the template read mask is the third template value. For example, if the template value of the outer contour depth texture map is 0B00000100 and the template write mask is 0B000001000, a template test needs to be performed when drawing the outer contour. The template read mask is 0B00000010. If the template value of the outer contour depth texture map is less than the template read mask, the template value is rewritten according to the template write mask.

[0057] 307. When the template value corresponding to the target pixel in the templated outer contour depth texture map is greater than or equal to the third template value, the color corresponding to the target pixel in the templated outer contour depth texture map is replaced with the preset outer contour color to obtain the outer contour depth texture map after color replacement.

[0058] When the template value corresponding to the target pixel in the templated outer contour depth texture map is greater than or equal to the third template value, the color corresponding to the target pixel in the templated outer contour depth texture map is replaced with the preset outer contour color to obtain the outer contour depth texture map after color replacement.

[0059] This embodiment provides a specific implementation method for highlighting people or objects and their outlines in scenarios where the outer contour of a person is increased, thereby improving the highlighting effect.

[0060] 308. Render the target scene based on the highlighted color of each pixel in the scene depth texture map with template, the scene depth texture map with template, and the object depth texture map with template, to obtain the target scene rendered image.

[0061] Step 308 is similar to step 205, and will not be repeated here.

[0062] In this embodiment of the invention, target objects in a 3D scene are accurately highlighted using a depth texture map with a template, which enhances the highlighting accuracy, avoids the use of models, reduces hardware requirements, and can also quickly identify occluded objects and highlight them with other colors, thus improving highlighting efficiency. It can accurately identify the outer contour of objects, thereby accurately highlighting target objects in scenes with overly chaotic colors.

[0063] Please see Figure 4 Another flowchart of the scene object highlighting method provided in this embodiment of the invention specifically includes: 401. In response to the scene object highlighting instruction, obtain the scene depth texture map with template corresponding to the target scene. The scene object highlighting instruction is used to indicate the target object in the target scene that needs to be highlighted. The scene depth texture map with template corresponds to the first template value.

[0064] 402. Generate a templated object depth texture map based on the target object and the templated scene depth texture map. The templated object depth texture map corresponds to the second template value.

[0065] Steps 401-402 are similar to steps 101-102, and will not be repeated here.

[0066] 403. Determine the world coordinates of multiple target pixels based on the object depth texture map with template.

[0067] It should be noted that when the object is a scene area, the object depth texture map with template includes multiple target pixels, and the world coordinates of each target pixel are determined. Here, the target pixel represents any one of all pixels in the target area.

[0068] 404. Perform ray collision detection based on the world coordinates of multiple target pixels and a preset local coordinate transformation matrix to determine the blend color corresponding to each target pixel.

[0069] Specifically, the server subtracts the camera's world coordinates from the world coordinates of each target pixel to obtain the world viewing direction corresponding to each target pixel. The server converts the world coordinates of each target pixel, the camera's world coordinates, and multiple world viewing directions into local coordinates using a preset local coordinate matrix, obtaining the local coordinates of each target pixel, the camera's local coordinates, and the world viewing direction corresponding to each target pixel. The local coordinate matrix includes the attribute parameters of the target object. The server detects the local coordinates of each target pixel according to a preset detection algorithm, the camera's local coordinates, and the local viewing direction corresponding to each target pixel. When detection fails, the server mixes the initial color corresponding to the failed target pixel with a preset reference color to generate a first mixed color. When detection succeeds, the server mixes the initial color corresponding to the successfully detected target pixel with the algorithm color generated by the preset detection algorithm to generate a second mixed color.

[0070] It should be noted that the attribute parameters of the target object in the local coordinate transformation matrix need to be different depending on the scene region. For example, when the scene region is a square region, the attribute parameters include the size of the square region and the world coordinates of the square region; when the scene region is a spherical region, the attribute parameters include the radius of the spherical region and the world coordinates of the spherical region; when the scene region is a capsule-shaped region, the attribute parameters include the height and radius of the capsule-shaped region and the world coordinates of the capsule-shaped region; when the scene region is a cylindrical region, the attribute parameters include the height and radius of the cylindrical region and the world coordinates of the cylindrical region; when the scene region is a conical region, the attribute parameters include the position and radius of the bottom center point of the conical region and the position of the top center point.

[0071] Understandably, the detection algorithm used changes as the shape of the scene area changes. For example, when the scene area is square, the square ray collision algorithm is used; when the area is spherical, the spherical ray collision algorithm is used; when the scene area is capsule-shaped, the capsule ray collision algorithm is used; when the scene area is cylindrical, the capsule ray collision algorithm is used; and when the scene area is conical, the conical ray collision algorithm is used. The algorithm is selected based on the actual shape of the scene area, and no specific limitation is made here.

[0072] 405. Draw the target scene based on the blend color and the object depth texture map with template corresponding to each target pixel to obtain the target rendered image.

[0073] The target scene is drawn based on the blended color corresponding to each target pixel and the object depth texture map with a template, resulting in a target rendered image. It's understandable that after obtaining the target rendered image, the scene area within it can display a dynamic effect initially, followed by a breathing light effect with preset size and color. This dynamic effect could be a complete flashing of the scene area or a periodic zooming in and out within the scene area's bounding box, serving to guide the user's attention.

[0074] In this embodiment of the invention, regions in a 3D scene are accurately highlighted using a templated depth texture map, which enhances the highlighting accuracy, avoids the use of models, and reduces hardware requirements. At the same time, different algorithms and region attribute parameters are used for regions of different shapes, and corresponding collision algorithms are used for rapid identification and corresponding special effects algorithms for highlighting and display, thereby improving highlighting efficiency.

[0075] The above describes the scene object highlighting method in the embodiments of the present invention. The following describes the scene object highlighting device in the embodiments of the present invention. Please refer to [link / reference]. Figure 5 One embodiment of the scene object highlighting device in this invention includes: The acquisition module 501 is used to acquire a scene depth texture map with a template corresponding to the target scene in response to the scene object highlighting instruction. The scene object highlighting instruction is used to indicate the target object in the target scene that needs to be highlighted. The scene depth texture map with a template corresponds to a first template value. The generation setting module 502 is used to generate a templated object depth texture map based on the target object and the templated scene depth texture map, wherein the templated object depth texture map corresponds to a second template value; The processing module 503 is used to process the target scene according to the object depth texture map with template to obtain the target scene rendering image.

[0076] In one feasible implementation, when the target object is a person or an object, the processing module 503 includes: The first test unit 50301 is used to perform template testing on each pixel in the templated scene depth texture map based on the templated object depth texture map, and obtain template test results; The first determining unit 50302 is used to determine the highlighted color corresponding to each pixel in the scene depth texture map with template based on the template test results; The first rendering unit 50303 is used to render the target scene based on the highlight color corresponding to each pixel in the scene depth texture map with template, the scene depth texture map with template, and the object depth texture map with template, to obtain a target scene rendering image.

[0077] In one feasible implementation, the first test unit 50301 is specifically used for: The first template value corresponding to each pixel is read from the scene depth texture map with template according to the preset reading template mask; The first template value corresponding to each pixel is compared with the second template value corresponding to the object depth texture map with template, and the comparison result of each pixel is determined as the template test result.

[0078] In one feasible implementation, the first determining unit 50302 is specifically used for: When the template test result of the target pixel in the scene depth texture map with template is that the first template value is less than the second template value, a mixed color is generated according to the initial color of the target pixel and the preset reference color, and the mixed color is determined as the highlight color corresponding to the target pixel; When the template test result of the target pixel in the scene depth texture map with template is that the first template value is equal to the second template value, the initial color of the target pixel is determined as the highlight color corresponding to the target pixel, or the initial color of the target pixel is highlighted to obtain a highlight color, and the highlight color is determined as the highlight color corresponding to the target pixel. When the template test result of the target pixel in the scene depth texture map with template is that the first template value is greater than the second template value, the initial color of the target pixel is replaced with the target color, and the target color is determined as the highlight color corresponding to the target pixel.

[0079] In one feasible implementation, the first rendering unit 50303 is specifically used for: When the target object is not occluded, the target scene is drawn according to the highlight color corresponding to each pixel in the scene depth texture map with template and the scene depth texture map with template; Based on the highlighted color corresponding to each pixel in the scene depth texture map with template and the object depth texture map with template, the target object is drawn on the target scene to obtain the target scene rendering image; or, When the target object is occluded, the target object is drawn according to the highlight color corresponding to each pixel in the scene depth texture map with template and the object depth texture map with template; The target scene is rendered based on the target object by writing a mask according to the preset template, the highlight color corresponding to each pixel in the scene depth texture map with the template, and the scene depth texture map with the template.

[0080] In one feasible implementation, the scene object highlighting device further includes: The contour generation module 504 is used to generate a templated outer contour depth texture map based on the templated object depth texture map. The templated outer contour depth texture map includes contour marker values, which are used to indicate the outer contour of the target object.

[0081] In one feasible implementation, the processing module 503 further includes: The second test unit 50304 is used to perform template testing on each pixel in the scene depth texture map with template according to the preset reading template mask and the object depth texture map with template, and obtain template test results; The second determining unit 50305 is used to determine the highlight color corresponding to each pixel in the scene depth texture map with template based on the template test results; The third test unit 50306 is used to perform template testing on the templated outer contour depth texture map through a preset template reading mask, wherein the template value corresponding to the template reading mask is the third template value. The replacement unit 50307 is used to replace the color corresponding to the target pixel in the templated outer contour depth texture map with a preset outer contour color when the template value corresponding to the target pixel in the templated outer contour depth texture map is greater than or equal to the third template value, so as to obtain an outer contour depth texture map after color replacement. The second rendering unit 50308 is used to render the target scene based on the highlight color corresponding to each pixel in the scene depth texture map with template, the scene depth texture map with template, the object depth texture map with template, and the outer contour depth texture map after color replacement, to obtain the target rendered image.

[0082] In one feasible implementation, when the target object is a scene area, the processing module 503 may further include: The third determining unit 50309 is used to determine the world coordinates of multiple target pixels based on the object depth texture map with template. The fourth determining unit 50310 is used to perform ray collision detection based on the world coordinates of the plurality of target pixels and a preset local coordinate transformation matrix to determine the mixed color corresponding to each target pixel; The drawing unit 50311 is used to draw the target scene according to the blend color corresponding to each target pixel and the object depth texture map with template, so as to obtain the target rendering image.

[0083] In one feasible implementation, the fourth determining unit 50310 is specifically used for: Subtracting the camera's world coordinates from the world coordinates of each target pixel yields the world viewing direction for each target pixel. A preset local coordinate matrix is ​​used to convert the world coordinates of each target pixel, the camera's world coordinates, and the multiple world viewing directions into local coordinates, resulting in the local coordinates of each target pixel, the camera's local coordinates, and the world viewing direction for each target pixel. The local coordinate matrix includes the target object's attribute parameters. The local coordinates of each target pixel are detected according to a preset detection algorithm, the camera's local coordinates, and the local viewing direction for each target pixel. When detection fails, the initial color of the failed target pixel is mixed with a preset reference color to generate a first mixed color. When detection succeeds, the initial color of the successfully detected target pixel is mixed with the algorithm color generated by the preset detection algorithm to generate a second mixed color.

[0084] This invention utilizes a templated depth texture map to accurately highlight target objects in a 3D scene, enhancing highlighting accuracy, avoiding the use of models, and reducing hardware requirements. Simultaneously, it can quickly identify occluded objects and highlight them using other colors, improving highlighting efficiency. It accurately identifies the outer contour of objects, thus accurately highlighting target objects in scenes with overly chaotic colors. Different algorithms and region attribute parameters are used for regions of different shapes, with corresponding collision algorithms for rapid identification and corresponding special effects algorithms for highlighting, further improving highlighting efficiency.

[0085] Figure 6This is a schematic diagram of the structure of an electronic device 600 provided in an embodiment of the present invention. The electronic device 600 can vary significantly due to different configurations or performance characteristics. It may include one or more central processing units (CPUs) 610 (e.g., one or more processors) and a memory 620, and one or more storage media 630 (e.g., one or more mass storage devices) for storing application programs 633 or data 632. The memory 620 and storage media 630 can be temporary or persistent storage. The program stored in the storage media 630 may include one or more modules (not shown in the diagram), each module including a series of instruction operations on the electronic device 600. Furthermore, the processor 610 may be configured to communicate with the storage media 630 and execute the series of instruction operations in the storage media 630 on the electronic device 600.

[0086] Electronic device 600 may also include one or more power supplies 640, one or more wired or wireless network interfaces 650, one or more input / output interfaces 660, and / or one or more operating devices 631, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc. Those skilled in the art will understand that... Figure 6 The illustrated electronic device structure does not constitute a limitation on the electronic device and may include more or fewer components than illustrated, or combine certain components, or have different component arrangements.

[0087] As an example, and not a limitation, electronic device 600 may be a server or a terminal.

[0088] This invention provides an electronic device, including: a memory and at least one processor, wherein the memory stores instructions; the at least one processor invokes the instructions in the memory to cause the electronic device to execute the above-described scene object highlighting method, the specific method steps of which include: In response to a scene object highlighting command, a templated scene depth texture map corresponding to the target scene is obtained. The scene object highlighting command indicates the target object in the target scene that needs to be highlighted, and the templated scene depth texture map corresponds to a first template value. A templated object depth texture map is generated based on the target object and the templated scene depth texture map, and the templated object depth texture map corresponds to a second template value. The target scene is then processed based on the templated object depth texture map to obtain a rendered image of the target scene. This embodiment of the invention accurately highlights target objects in a 3D scene using a templated depth texture map, enhancing highlighting accuracy, avoiding the use of models, and reducing hardware requirements.

[0089] The above method, when the target object is a person or an object, involves highlighting the target scene based on a templated object depth texture map to obtain a rendered image of the target scene. This includes: performing a template test on each pixel in the templated scene depth texture map based on the templated object depth texture map, obtaining the template test result; determining the highlight color corresponding to each pixel in the templated scene depth texture map based on the template test result; and rendering the target scene based on the highlight color corresponding to each pixel in the templated scene depth texture map, the templated scene depth texture map, and the templated object depth texture map to obtain the rendered image of the target scene. In this method, when the target object is a person or an object, template testing is performed using the template depth map to determine the color of each pixel, thus completing the highlighting process for the person.

[0090] The above method performs template testing on each pixel in the templated scene depth texture map based on the templated object depth texture map to obtain the template test result. This includes: reading the first template value corresponding to each pixel from the templated scene depth texture map according to a preset template reading mask; comparing the first template value corresponding to each pixel with the second template value corresponding to the templated object depth texture map; and determining the comparison result for each pixel as the template test result. This method limits the template testing process, explicitly comparing the first and second template values, providing a concrete implementation scheme, and improving testing efficiency.

[0091] The method described above, which determines the highlight color corresponding to each pixel in the templated scene depth texture map based on template test results, includes: when the template test result of the target pixel in the templated scene depth texture map is that the first template value is less than the second template value, a blend color is generated based on the initial color of the target pixel and a preset reference color, and the blend color is determined as the highlight color corresponding to the target pixel; when the template test result of the target pixel in the templated scene depth texture map is that the first template value is equal to the second template value, the initial color of the target pixel is determined as the highlight color corresponding to the target pixel, or the initial color of the target pixel is highlighted to obtain a highlight color, and the highlight color is determined as the highlight color corresponding to the target pixel; when the template test result of the target pixel in the templated scene depth texture map is that the first template value is greater than the second template value, the initial color of the target pixel is replaced with the target color, and the target color is determined as the highlight color corresponding to the target pixel. This method refines the process of determining the color of each pixel and uses different highlighting methods for different test results, enhancing the distinction between the highlighted person or object and the surrounding scene.

[0092] The above-mentioned method of rendering the target scene based on the highlight color corresponding to each pixel in the templated scene depth texture map, the templated scene depth texture map, and the templated object depth texture map to obtain the target scene rendered image includes: when the target object is not occluded, drawing the target scene based on the highlight color corresponding to each pixel in the templated scene depth texture map and the templated scene depth texture map; drawing the target object based on the target scene based on the highlight color corresponding to each pixel in the templated scene depth texture map and the templated object depth texture map to obtain the target scene rendered image; or, when the target object is occluded, drawing the target object based on the highlight color corresponding to each pixel in the templated scene depth texture map and the templated object depth texture map; and drawing the target scene based on the target object based on the preset template written to the mask, the highlight color corresponding to each pixel in the templated scene depth texture map, and the templated scene depth texture map to obtain the target scene rendered image. In this method, the process of determining the color of each pixel is refined, and different highlighting processing methods are used for different test results, which enhances the distinction between the highlighted person or object and the surrounding scene.

[0093] Before highlighting the target scene based on the templated object depth texture map to obtain the rendered image of the target scene, the above method also includes: generating a templated outer contour depth texture map based on the templated object depth texture map. The templated outer contour depth texture map includes contour marker values, which are used to indicate the outer contour of the target object. This method adds a process for generating the contour of people or objects, further distinguishing people or objects from the scene. It can achieve a good highlighting effect even in scenes with overly chaotic colors, improving highlighting efficiency and success rate.

[0094] The above-described method of processing the target scene based on the templated object depth texture map to obtain the target rendered image includes: performing a template test on each pixel in the templated scene depth texture map based on a preset template reading mask and the templated object depth texture map, and obtaining the template test result; determining the highlight color corresponding to each pixel in the templated scene depth texture map based on the template test result; performing a template test on the templated outer contour depth texture map through a preset template reading mask, where the template value corresponding to the template reading mask is a third template value; when the template value corresponding to the target pixel in the templated outer contour depth texture map is greater than or equal to the third template value, replacing the color corresponding to the target pixel in the templated outer contour depth texture map with a preset outer contour color, and obtaining a color-replaced outer contour depth texture map; and rendering the target scene based on the highlight color corresponding to each pixel in the templated scene depth texture map, the templated scene depth texture map, the templated object depth texture map, and the color-replaced outer contour depth texture map, to obtain the target rendered image. This method provides a specific implementation for highlighting characters or objects and their outer contours in scenes where the outer contour of a person or object is added, thus improving the highlighting effect.

[0095] The above method, when the target object is a scene region, highlights the target scene based on a templated object depth texture map to obtain a target rendered image. This includes: determining the world coordinates of multiple target pixels based on the templated object depth texture map; performing ray collision detection based on the world coordinates of the multiple target pixels and a preset local coordinate transformation matrix to determine the blend color corresponding to each target pixel; and drawing the target scene based on the blend color corresponding to each target pixel and the templated object depth texture map to obtain the target rendered image. In this method, when the target object is a region, the world coordinates of pixels are transformed into local coordinates using a local coordinate matrix. Color blending is then performed based on the test results of the local coordinates of the pixels, achieving region highlighting and improving highlighting efficiency and applicability to region highlighting.

[0096] The above-described method performs ray collision detection based on the world coordinates of multiple target pixels and a preset local coordinate transformation matrix to determine the blend color corresponding to each target pixel. This includes: subtracting the camera's world coordinates from the world coordinates of each target pixel to obtain the world viewing direction for each target pixel; converting the world coordinates of each target pixel, the camera's world coordinates, and multiple world viewing directions into local coordinates using a preset local coordinate matrix to obtain the local coordinates of each target pixel, the camera's local coordinates, and the world viewing direction for each target pixel, where the local coordinate matrix includes the target object's attribute parameters; detecting the local coordinates of each target pixel based on a preset detection algorithm, the camera's local coordinates, and the local viewing direction for each target pixel; when detection fails, mixing the initial color of the failed target pixel with a preset reference color to generate a first blend color; when detection succeeds, mixing the initial color of the successfully detected target pixel with the algorithm color generated by the preset detection algorithm to generate a second blend color. This method performs ray collision detection on the color of each pixel in the region to determine the blend color of each pixel, providing a concrete implementation method and improving the efficiency of highlighting processing.

[0097] The present invention also provides a computer-readable storage medium, which can be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. The computer-readable storage medium stores instructions that, when executed on a computer, cause the computer to perform the steps of the scene object highlighting method. The steps specifically include: In response to a scene object highlighting command, a templated scene depth texture map corresponding to the target scene is obtained. The scene object highlighting command indicates the target object in the target scene that needs to be highlighted, and the templated scene depth texture map corresponds to a first template value. A templated object depth texture map is generated based on the target object and the templated scene depth texture map, and the templated object depth texture map corresponds to a second template value. The target scene is then processed based on the templated object depth texture map to obtain a rendered image of the target scene. This embodiment of the invention accurately highlights target objects in a 3D scene using a templated depth texture map, enhancing highlighting accuracy, avoiding the use of models, and reducing hardware requirements.

[0098] The above method, when the target object is a person or an object, processes the target scene based on a templated object depth texture map to obtain a rendered image of the target scene. This includes: performing a template test on each pixel in the templated scene depth texture map based on the templated object depth texture map, obtaining the template test result; determining the highlight color corresponding to each pixel in the templated scene depth texture map based on the template test result; and rendering the target scene based on the highlight color corresponding to each pixel in the templated scene depth texture map, the templated scene depth texture map, and the templated object depth texture map to obtain the rendered image of the target scene. In this method, when the target object is a person or an object, template testing is performed using the template depth map to determine the color of each pixel, thus completing the highlighting process for the person.

[0099] The above method performs template testing on each pixel in the templated scene depth texture map based on the templated object depth texture map to obtain the template test result. This includes: reading the first template value corresponding to each pixel from the templated scene depth texture map according to a preset template reading mask; comparing the first template value corresponding to each pixel with the second template value corresponding to the templated object depth texture map; and determining the comparison result for each pixel as the template test result. This method limits the template testing process, explicitly comparing the first and second template values, providing a concrete implementation scheme, and improving testing efficiency.

[0100] The method described above, which determines the highlight color corresponding to each pixel in the templated scene depth texture map based on template test results, includes: when the template test result of the target pixel in the templated scene depth texture map is that the first template value is less than the second template value, a blend color is generated based on the initial color of the target pixel and a preset reference color, and the blend color is determined as the highlight color corresponding to the target pixel; when the template test result of the target pixel in the templated scene depth texture map is that the first template value is equal to the second template value, the initial color of the target pixel is determined as the highlight color corresponding to the target pixel, or the initial color of the target pixel is highlighted to obtain a highlight color, and the highlight color is determined as the highlight color corresponding to the target pixel; when the template test result of the target pixel in the templated scene depth texture map is that the first template value is greater than the second template value, the initial color of the target pixel is replaced with the target color, and the target color is determined as the highlight color corresponding to the target pixel. This method refines the process of determining the color of each pixel and uses different highlighting methods for different test results, enhancing the distinction between the highlighted person or object and the surrounding scene.

[0101] The above-mentioned method of rendering the target scene based on the highlight color corresponding to each pixel in the templated scene depth texture map, the templated scene depth texture map, and the templated object depth texture map to obtain the target scene rendered image includes: when the target object is not occluded, drawing the target scene based on the highlight color corresponding to each pixel in the templated scene depth texture map and the templated scene depth texture map; drawing the target object based on the target scene based on the highlight color corresponding to each pixel in the templated scene depth texture map and the templated object depth texture map to obtain the target scene rendered image; or, when the target object is occluded, drawing the target object based on the highlight color corresponding to each pixel in the templated scene depth texture map and the templated object depth texture map; and drawing the target scene based on the target object based on the preset template written to the mask, the highlight color corresponding to each pixel in the templated scene depth texture map, and the templated scene depth texture map to obtain the target scene rendered image. In this method, the process of determining the color of each pixel is refined, and different highlighting processing methods are used for different test results, which enhances the distinction between the highlighted person or object and the surrounding scene.

[0102] Before processing the target scene based on the templated object depth texture map to obtain the rendered image of the target scene, the above method also includes: generating a templated outer contour depth texture map based on the templated object depth texture map. The templated outer contour depth texture map includes contour marker values, which are used to indicate the outer contour of the target object. This method adds a process for generating the contour of people or objects, further distinguishing people or objects from the scene. It can also achieve a good highlighting effect in scenes with overly chaotic colors, improving highlighting efficiency and success rate.

[0103] The above-described method of processing the target scene based on the templated object depth texture map to obtain the target rendered image includes: performing a template test on each pixel in the templated scene depth texture map based on a preset template reading mask and the templated object depth texture map, and obtaining the template test result; determining the highlight color corresponding to each pixel in the templated scene depth texture map based on the template test result; performing a template test on the templated outer contour depth texture map through a preset template reading mask, where the template value corresponding to the template reading mask is a third template value; when the template value corresponding to the target pixel in the templated outer contour depth texture map is greater than or equal to the third template value, replacing the color corresponding to the target pixel in the templated outer contour depth texture map with a preset outer contour color, and obtaining a color-replaced outer contour depth texture map; and rendering the target scene based on the highlight color corresponding to each pixel in the templated scene depth texture map, the templated scene depth texture map, the templated object depth texture map, and the color-replaced outer contour depth texture map, to obtain the target rendered image. This method provides a specific implementation for highlighting characters or objects and their outer contours in scenes where the outer contour of a person or object is added, thus improving the highlighting effect.

[0104] The above method, when the target object is a scene region, highlights the target scene based on a templated object depth texture map to obtain a target rendered image. This includes: determining the world coordinates of multiple target pixels based on the templated object depth texture map; performing ray collision detection based on the world coordinates of the multiple target pixels and a preset local coordinate transformation matrix to determine the blend color corresponding to each target pixel; and drawing the target scene based on the blend color corresponding to each target pixel and the templated object depth texture map to obtain the target rendered image. In this method, when the target object is a region, the world coordinates of pixels are transformed into local coordinates using a local coordinate matrix. Color blending is then performed based on the test results of the local coordinates of the pixels, achieving region highlighting and improving highlighting efficiency and applicability to region highlighting.

[0105] The above-described method performs ray collision detection based on the world coordinates of multiple target pixels and a preset local coordinate transformation matrix to determine the blend color corresponding to each target pixel. This includes: subtracting the camera's world coordinates from the world coordinates of each target pixel to obtain the world viewing direction for each target pixel; converting the world coordinates of each target pixel, the camera's world coordinates, and multiple world viewing directions into local coordinates using a preset local coordinate matrix to obtain the local coordinates of each target pixel, the camera's local coordinates, and the world viewing direction for each target pixel, where the local coordinate matrix includes the target object's attribute parameters; detecting the local coordinates of each target pixel based on a preset detection algorithm, the camera's local coordinates, and the local viewing direction for each target pixel; when detection fails, mixing the initial color of the failed target pixel with a preset reference color to generate a first blend color; when detection succeeds, mixing the initial color of the successfully detected target pixel with the algorithm color generated by the preset detection algorithm to generate a second blend color. This method performs ray collision detection on the color of each pixel in the region to determine the blend color of each pixel, providing a concrete implementation method and improving the efficiency of highlighting processing.

[0106] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0107] Furthermore, in the description of the embodiments of the present invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in the present invention based on the specific circumstances.

[0108] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0109] In the description of this invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0110] Finally, it should be noted that the above embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method for highlighting scene objects, characterized in that, include: In response to a scene object highlighting instruction, a scene depth texture map with a template corresponding to the target scene is obtained. The scene object highlighting instruction is used to indicate the target object in the target scene that needs to be highlighted. The scene depth texture map with a template corresponds to a first template value. Generate a templated object depth texture map based on the target object and the templated scene depth texture map, wherein the templated object depth texture map corresponds to a second template value; The target scene is processed according to the object depth texture map with template to obtain a target scene rendering image; including, when the target object is a person or an object, performing template testing on each pixel in the scene depth texture map with template according to the object depth texture map with template to obtain template test results; Based on the template test results, the highlight color corresponding to each pixel in the scene depth texture map with template is determined; when the template test result of the target pixel in the scene depth texture map with template is that the first template value is greater than the second template value, the initial color of the target pixel is replaced with the target color, and the target color is determined as the highlight color corresponding to the target pixel; The target scene is rendered based on the highlighted color corresponding to each pixel in the templated scene depth texture map, the templated scene depth texture map, and the templated object depth texture map to obtain the target scene rendered image.

2. The scene object highlighting method according to claim 1, characterized in that, The step of performing template testing on each pixel in the templated scene depth texture map based on the templated object depth texture map to obtain template test results includes: The first template value corresponding to each pixel is read from the scene depth texture map with template according to the preset reading template mask; The first template value corresponding to each pixel is compared with the second template value corresponding to the object depth texture map with template, and the comparison result of each pixel is determined as the template test result.

3. The scene object highlighting method according to claim 1, characterized in that, The step of determining the highlighted color corresponding to each pixel in the scene depth texture map with template based on the template test results includes: When the template test result of the target pixel in the scene depth texture map with template is that the first template value is less than the second template value, a mixed color is generated according to the initial color of the target pixel and the preset reference color, and the mixed color is determined as the highlight color corresponding to the target pixel; When the template test result of the target pixel in the scene depth texture map with template is that the first template value is equal to the second template value, the initial color of the target pixel is determined as the highlight color corresponding to the target pixel, or the initial color of the target pixel is highlighted to obtain a highlight color, and the highlight color is determined as the highlight color corresponding to the target pixel.

4. The scene object highlighting method according to claim 1, characterized in that, The step of rendering the target scene based on the highlighted color corresponding to each pixel in the templated scene depth texture map, the templated scene depth texture map, and the templated object depth texture map to obtain a target scene rendered image includes: When the target object is not occluded, the target scene is drawn according to the highlight color corresponding to each pixel in the scene depth texture map with template and the scene depth texture map with template; Based on the highlighted color corresponding to each pixel in the scene depth texture map with template and the object depth texture map with template, the target object is drawn on the target scene to obtain the target scene rendering image; or, When the target object is occluded, the target object is drawn according to the highlight color corresponding to each pixel in the scene depth texture map with template and the object depth texture map with template; The target scene is rendered based on the target object by writing a mask according to the preset template, the highlight color corresponding to each pixel in the scene depth texture map with the template, and the scene depth texture map with the template.

5. The scene object highlighting method according to claim 1, characterized in that, Before processing the target scene based on the templated object depth texture map to obtain the target scene rendered image, the method further includes: A templated outer contour depth texture map is generated based on the templated object depth texture map. The templated outer contour depth texture map includes contour marker values, which are used to indicate the outer contour of the target object.

6. The scene object highlighting method according to claim 5, characterized in that, The step of processing the target scene based on the templated object depth texture map to obtain the target rendered image includes: Based on the preset reading template mask and the templated object depth texture map, template testing is performed on each pixel in the templated scene depth texture map to obtain the template test result; The highlighted color corresponding to each pixel in the scene depth texture map with the template is determined based on the template test results; The template depth texture map with template is subjected to template testing by a preset template reading mask, and the template value corresponding to the template reading mask is the third template value; When the template value corresponding to the target pixel in the templated outer contour depth texture map is greater than or equal to the third template value, the color corresponding to the target pixel in the templated outer contour depth texture map is replaced with a preset outer contour color to obtain an outer contour depth texture map after color replacement. The target scene is rendered based on the highlighted color corresponding to each pixel in the scene depth texture map with template, the scene depth texture map with template, the object depth texture map with template, and the outer contour depth texture map after color replacement, to obtain the target rendered image.

7. The scene object highlighting method according to claim 1, characterized in that, When the target object is a scene region, the process of processing the target scene based on the templated object depth texture map to obtain the target rendered image includes: The world coordinates of multiple target pixels are determined based on the object depth texture map with template. Ray collision detection is performed based on the world coordinates of the multiple target pixels and a preset local coordinate transformation matrix to determine the blend color corresponding to each target pixel; The target scene is drawn based on the blended color corresponding to each target pixel and the object depth texture map with template, and the target rendered image is obtained.

8. The scene object highlighting method according to claim 7, characterized in that, The step of performing ray collision detection based on the world coordinates of the multiple target pixels and a preset local coordinate transformation matrix to determine the blend color corresponding to each target pixel includes: Subtract the camera's world coordinates from the world coordinates of each target pixel to obtain the world viewing direction corresponding to each target pixel; The world coordinates of each target pixel, the world coordinates of the camera, and the multiple world viewing directions are converted into local coordinates by a preset local coordinate matrix, so as to obtain the local coordinates of each target pixel, the local coordinates of the camera, and the world viewing direction corresponding to each target pixel. The local coordinate matrix includes the attribute parameters of the target object. The local coordinates of each target pixel are detected based on a preset detection algorithm, the local coordinates of the camera, and the local observation direction corresponding to each target pixel. When detection fails, the initial color corresponding to the target pixel that failed detection is mixed with the preset reference color to generate the first mixed color; When detection is successful, the initial color corresponding to the successfully detected target pixel is mixed with the algorithm color generated by the preset detection algorithm to generate a second mixed color.

9. A scene object highlighting device, characterized in that, include: The acquisition module is used to acquire a scene depth texture map with a template corresponding to the target scene in response to the scene object highlighting instruction. The scene object highlighting instruction is used to indicate the target object in the target scene that needs to be highlighted. The scene depth texture map with a template corresponds to a first template value. The generation module is used to generate a templated object depth texture map based on the target object and the templated scene depth texture map, wherein the templated object depth texture map corresponds to a second template value; The processing module is used to process the target scene according to the object depth texture map with template to obtain a target scene rendering image, including, when the target object is a person or an object, performing template testing on each pixel in the scene depth texture map with template according to the object depth texture map with template to obtain template test results; The highlighted color corresponding to each pixel in the scene depth texture map with the template is determined based on the template test results; When the template test result of the target pixel in the scene depth texture map with template is that the first template value is greater than the second template value, the initial color of the target pixel is replaced with the target color, and the target color is determined as the highlight color corresponding to the target pixel; the target scene is rendered according to the highlight color corresponding to each pixel in the scene depth texture map with template, the scene depth texture map with template, and the object depth texture map with template to obtain the target scene rendering image.

10. An electronic device, characterized in that, The electronic device includes: a memory and at least one processor, wherein the memory stores instructions, and the memory and the at least one processor are interconnected via a line; The at least one processor invokes the instructions in the memory to cause the electronic device to execute the scene object highlighting method as described in any one of claims 1-8.

11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed by a processor, implement the scene object highlighting method as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Contour rendering method and device, electronic equipment and computer readable storage medium

    CN112669433A

  • Selection and thematic highlighting using terrain textures

    US9007374B1