Image rendering method and related equipment

By responding to the rendering instructions and using pre-stored color textures to determine the analysis area of ​​the image segment, the analysis failure problem caused by overall rendering of images in the prior art is solved, and area partition display and efficient analysis are realized.

CN119206017BActive Publication Date: 2025-04-08HANGZHOU HIKVISION SYST TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411731353.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2025-04-08
Estimated Expiration
2044-11-29

AI Technical Summary

Technical Problem

In the prior art, images can only be rendered as a whole, resulting in the failure of specific area analysis and affecting the progress of image analysis.

Method used

By responding to the rendering instruction, the pending slice metadata is obtained and the analysis area to which the slice metadata belongs is determined based on the pre-stored first color texture. If it belongs to the analysis area, render it with the corresponding preset color and distinguish it from the non-analytical area.

Benefits of technology

The area partition display of the image is realized, which avoids analysis failure caused by overall rendering and improves the efficiency of image analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119206017B_ABST
    Figure CN119206017B_ABST
Patent Text Reader

Abstract

The present application discloses an image rendering method and related equipment, and relates to the field of image processing technology. The image rendering method includes: in response to a rendering instruction, obtaining the current to-be-processed fragment data; determining whether the vertex data corresponding to the current to-be-processed fragment data belongs to the analysis area according to a pre-stored first color texture, the first color texture including a region belonging index for characterizing each fragment in the analysis area; if the vertex data corresponding to the current to-be-processed fragment data belongs to the analysis area, then rendering the current to-be-processed fragment data according to a first preset color setting of the analysis area, the first preset color setting being distinguished from a second preset color setting of a non-analysis area. The present application implements color display and analysis by region to avoid affecting the progress of the actual image analysis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to an image rendering method and related equipment. Background Art

[0002] In practical applications, different areas of an image usually need to be analyzed differently. For example, after collecting relevant images of a certain area, it is necessary to analyze the building conditions below 50 meters in a village within the area. At this time, in order to avoid the influence of other areas on the image analysis, other areas in the relevant images need to be masked with colors. In related technologies, the relevant images can only be rendered as a whole (rendering is for the entire screen, that is, after the image is highly analyzed, within the height range, all image data can only be superimposed with the same color as a whole), which makes the specific regional analysis invalid and affects the progress of the actual image analysis.

[0003] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are related technologies. Summary of the invention

[0004] The main purpose of the present application is to provide an image rendering method and related equipment, aiming to solve the technical problem in the related technology that only related images can be rendered as a whole, resulting in failure of specific area analysis.

[0005] To achieve the above object, the present application proposes an image rendering method, the method comprising:

[0006] In response to the rendering instruction, obtain metadata of the current fragment to be processed;

[0007] Determining whether the vertex data corresponding to the currently processed fragment data belongs to the analysis area according to a pre-stored first color texture, wherein the first color texture includes a region belonging index for characterizing each fragment in the analysis area;

[0008] If the vertex data corresponding to the current fragment to be processed belongs to the analysis area, the vertex data of the current fragment to be processed is rendered according to a first preset color setting of the analysis area, where the first preset color setting is different from a second preset color setting of the non-analysis area.

[0009] In one embodiment, before the step of determining whether the vertex data corresponding to the currently processed fragment data belongs to the analysis area according to the pre-stored first color texture, the method further includes:

[0010] Determine the region attribution index of the rasterized fragment corresponding to the vertices constituting the analysis region, wherein the region attribution index is determined according to the first index value of the vertices constituting the analysis region and the preset vertex array of each analysis region;

[0011] The region attribution index of the rasterized fragment is represented by a color variable to obtain the pre-stored first color texture.

[0012] In one embodiment, the color variable is a multidimensional vector, at least one vector in the multidimensional vector is used to represent the identifier of the analysis area to which the rasterized fragment belongs, and / or other vectors in the multidimensional vector are used to represent the second index value of the analysis area to which the rasterized fragment belongs.

[0013] In one embodiment, the step of determining whether the vertex data corresponding to the current to-be-processed fragment data belongs to the analysis area according to the pre-stored first color texture includes:

[0014] Obtaining depth information of the current to-be-processed fragment metadata from a preset depth texture;

[0015] Performing coordinate inverse calculation according to the depth information to obtain the target coordinates of the current to-be-processed piece of metadata in a preset coordinate system;

[0016] Based on the target coordinates, projecting the current to-be-processed fragment data according to a projection scheme corresponding to the texture of the corresponding analysis area to obtain corresponding target texture coordinates;

[0017] Based on the target texture coordinates and the first color texture, it is determined whether the vertex data corresponding to the current fragment data to be processed belongs to an analysis area.

[0018] In one embodiment, after the step of determining whether the vertex data corresponding to the current to-be-processed fragment data belongs to the analysis area based on the target texture coordinates and the first color texture, the method further includes:

[0019] If the vertex data corresponding to the currently processed fragment data belongs to the analysis area, determining the height value of the analysis area;

[0020] The step of rendering the current to-be-processed piece of metadata according to the first preset color setting of the analysis area includes:

[0021] Determine a comparison result between the height value and a height coordinate obtained by backcalculation based on the depth information;

[0022] If the comparison result satisfies the analysis condition, the currently processed fragment metadata is rendered according to the first preset color setting of the corresponding analysis area.

[0023] In one embodiment, after the step of determining the comparison result between the height value and the height coordinate obtained by backcalculation based on the depth information, the following steps are included:

[0024] If the comparison result does not meet the analysis condition, the current to-be-processed fragment data is rendered according to a second preset color setting or a third preset color setting, where the third preset color setting is different from the first color setting and the second color setting.

[0025] In one embodiment, the step of rendering the current to-be-processed fragment metadata according to the first preset color setting of the analysis area further includes:

[0026] According to the target color obtained by fusing the first preset color setting and the second color setting of the analysis area, the currently processed fragment data is rendered accordingly.

[0027] In one embodiment, after the step of determining whether the vertex data corresponding to the currently processed fragment data belongs to the analysis area, the method further includes:

[0028] If it is determined that the current fragment data to be processed does not belong to the analysis area, the current fragment data to be processed is rendered according to the second preset color setting, wherein the second preset color setting is determined according to a preset second color texture of the current fragment data to be processed.

[0029] In addition, to achieve the above purpose, the present application also proposes an image rendering device, such as Figure 6 As shown, the image rendering device includes:

[0030] A response module 10 is used to obtain metadata of a current slice to be processed in response to a rendering instruction;

[0031] A determination module 20, configured to determine whether the vertex data corresponding to the currently processed fragment data belongs to an analysis area according to a pre-stored first color texture, wherein the first color texture includes an area belonging index for characterizing each fragment in the analysis area;

[0032] The rendering module 30 is used to render the vertex data of the current fragment to be processed according to the first preset color setting of the analysis area if the vertex data corresponding to the current fragment to be processed belongs to the analysis area, and the first preset color setting is different from the second preset color setting of the non-analysis area.

[0033] In one embodiment, the image rendering device is used to implement:

[0034] Determine the region attribution index of the rasterized fragment corresponding to the vertices constituting the analysis region, wherein the region attribution index is determined according to the first index value of the vertices constituting the analysis region and the preset vertex array of each analysis region;

[0035] The region attribution index of the rasterized fragment is represented by a color variable to obtain the pre-stored first color texture.

[0036] In one embodiment, the color variable is a multidimensional vector, at least one vector in the multidimensional vector is used to represent the identifier of the analysis area to which the rasterized fragment belongs, and / or other vectors in the multidimensional vector are used to represent the second index value of the analysis area to which the rasterized fragment belongs.

[0037] In one embodiment, the image rendering device is further used to implement:

[0038] Obtaining depth information of the current to-be-processed fragment metadata from a preset depth texture;

[0039] Performing coordinate inverse calculation according to the depth information to obtain the target coordinates of the current to-be-processed piece of metadata in a preset coordinate system;

[0040] Based on the target coordinates, projecting the current to-be-processed fragment data according to a projection scheme corresponding to the texture of the corresponding analysis area to obtain corresponding target texture coordinates;

[0041] Based on the target texture coordinates and the first color texture, it is determined whether the vertex data corresponding to the current fragment data to be processed belongs to an analysis area.

[0042] In one embodiment, the image rendering device is further used to implement:

[0043] If the vertex data corresponding to the currently processed fragment data belongs to the analysis area, determining the height value of the analysis area;

[0044] The image rendering device is also used to implement:

[0045] Determine a comparison result between the height value and a height coordinate obtained by backcalculation based on the depth information;

[0046] If the comparison result satisfies the analysis condition, the currently processed fragment metadata is rendered according to the first preset color setting of the corresponding analysis area.

[0047] In one embodiment, the image rendering device is further used to implement:

[0048] If the comparison result does not meet the analysis condition, the current to-be-processed fragment data is rendered according to a second preset color setting or a third preset color setting, where the third preset color setting is different from the first color setting and the second color setting.

[0049] In one embodiment, the image rendering device is further used to implement:

[0050] According to the target color obtained by fusing the first preset color setting and the second color setting of the analysis area, the currently processed fragment data is rendered accordingly.

[0051] In one embodiment, the image rendering device is further used to implement:

[0052] If it is determined that the current fragment data to be processed does not belong to the analysis area, the current fragment data to be processed is rendered according to the second preset color setting, wherein the second preset color setting is determined according to a preset second color texture of the current fragment data to be processed.

[0053] In addition, to achieve the above-mentioned purpose, the present application also proposes an image rendering device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the image rendering method described above.

[0054] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the image rendering method described above are implemented.

[0055] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, wherein the computer program product includes a computer program, and when the computer program is executed by a processor, the steps of the image rendering method described above are implemented.

[0056] One or more technical solutions proposed in this application have at least the following technical effects:

[0057] The present application proposes an image rendering method and related equipment. Compared with the related technology in which only the related image can be rendered as a whole, resulting in the failure of specific area analysis, in the present application, by responding to a rendering instruction, the current fragment data to be processed is obtained; according to a pre-stored first color texture, it is determined whether the vertex data corresponding to the current fragment data to be processed belongs to the analysis area, and the first color texture includes a region attribution index for characterizing each fragment in the analysis area; if the vertex data corresponding to the current fragment data to be processed belongs to the analysis area, the current fragment data to be processed is rendered according to a first preset color setting of the analysis area, and the first preset color setting is distinguished from the second preset color setting of the non-analysis area.

[0058] It can be understood that since the first color texture is pre-stored and the first color texture is used to characterize the regional attribution index of each fragment in the analysis area, therefore, in response to the rendering instruction, after obtaining the current fragment metadata to be processed, it is possible to accurately determine whether the vertex data corresponding to the current fragment metadata to be processed belongs to the analysis area. Under this premise, if the vertex data corresponding to the current fragment to be processed belongs to the analysis area, and since the first preset color setting is distinguished from the second preset color setting of the non-analysis area in the image to be rendered, that is, the display colors of the analysis area and the non-analysis area are different, therefore, the current fragment metadata to be processed can be subsequently rendered in accordance with the first preset color setting, that is, the current fragment metadata to be processed in this application can not be superimposed with only the same color as a whole, but can be displayed by regional partitions, thereby avoiding affecting the progress of the actual image analysis. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0060] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0061] Figure 1 A schematic diagram of the image rendering method flow provided in Example 1 of the present application;

[0062] Figure 2 A schematic diagram of the image rendering method flow provided in the second embodiment of the present application;

[0063] Figure 3A schematic diagram of a process for obtaining second color texture and depth texture information provided in Embodiment 1 of the present application;

[0064] Figure 4 A schematic diagram of a process for obtaining a first color texture provided in Embodiment 1 of the present application;

[0065] Figure 5 A schematic diagram of a scenario provided for Embodiment 1 of the present application;

[0066] Figure 6 This is a schematic diagram of the module structure of the image rendering device in an embodiment of the present application;

[0067] Figure 7 Schematic diagram of the device structure of the hardware operating environment involved in the image rendering method in the embodiment of the present application.

[0068] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0069] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0070] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0071] In this embodiment, for the convenience of description, the following description is made by taking the identification image rendering device as the execution subject.

[0072] It should be noted that the execution subject of this embodiment may be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, an image rendering device, etc. The following takes an image rendering device as an example to illustrate this embodiment and the following embodiments.

[0073] Based on this, the present application embodiment provides an image rendering method, referring to Figure 1 , Figure 1 This is a flowchart diagram of the first embodiment of the image rendering method of the present application.

[0074] In this embodiment, the image rendering method includes steps S100 to S300:

[0075] Step S100, in response to a rendering instruction, obtaining metadata of a current slice to be processed;

[0076] In this embodiment, the application scenarios may be:

[0077] If the project requires that the buildings below 50 meters and / or below 30 meters in a certain M village and a certain N village within the region be analyzed (it should be noted that this is just an example, and the actual analysis can support multiple areas rather than just a single area), then after acquiring the image within the region, in order to avoid the influence of other areas on the analysis, it is necessary to distinguish and display the analysis area in the image, or use other colors to cover other areas in the image (such as area P);

[0078] Or when there is a natural disaster such as a flood, if it is necessary to analyze the most severely flooded villages K and L (water level rises above 5 meters) below 5 meters and below 3 meters (it should be noted that this is just an example, and the actual analysis can support multiple areas rather than just a single area), then after acquiring images of the flood site, in order to avoid the influence of other areas on the analysis, it is necessary to distinguish and display the analysis areas in the image, or cover other areas in the image (such as area G) with other colors.

[0079] Specifically, in this embodiment, the image rendering device may be a GPU (graphics processing unit, a graphics processor, whose core part is a graphics card, used to construct and render three-dimensional data, etc.), wherein the GPU may receive a rendering instruction issued by a CPU (Central Processing Unit, central processing unit), and obtain metadata of the current slice to be processed based on the rendering instruction.

[0080] It should be noted that first, in response to the rendering instruction, the post-frame data is obtained, wherein the post-frame data refers to data based on the pipeline rendering result of the image for a series of subsequent processing, and then based on the post-frame data, the current fragment metadata to be processed (part of the post-frame data) is obtained.

[0081] It should be understood that the current fragment metadata to be processed corresponds to the corresponding vertex data (vertex is the vertex in the mathematical concept, mainly referring to the coordinates of the point, the coordinates of the constituent points of the line, and the coordinates of the three vertices of the triangle).

[0082] Step S200, determining whether the vertex data corresponding to the currently processed fragment data belongs to an analysis area according to a pre-stored first color texture, wherein the first color texture includes an area belonging index for characterizing each fragment in the analysis area;

[0083] In this embodiment, the region attribution index of each fragment (future pixel, but containing more information than pixel, such as coordinates, depth, etc.; after the fragment is processed by the pipeline, such as depth test, it finally becomes a pixel) in the analysis area is saved in the first color texture in advance. Therefore, after determining the vertex data corresponding to the current fragment data to be processed, the pre-stored first color texture is called to determine whether the vertex data corresponding to the current fragment data to be processed belongs to the analysis area.

[0084] It is understandable that Figure 4 As shown, the first color texture ( Figure 4 The color texture C) is an image with the same resolution and size as the rendered frame (image) corresponding to the post-frame data. Each color variable value (each texture position) in the first color texture corresponds to a fragment, and the color variable value specifically reflects the region attribution index of the corresponding fragment. For example, if the value of a color variable in the first color texture is a1, the region attribution index of the corresponding fragment may be 1, indicating that the fragment belongs to the analysis region with an index value of 1. If the value of a color variable in the first color texture is b1, the region attribution index of the corresponding fragment may be 3, indicating that the fragment belongs to the analysis region with an index value of 3.

[0085] In this embodiment, it should be noted that the first color texture is already generated or temporarily generated. Further, since the screen of the device is a standard rectangle, and the analysis area is not necessarily a standard rectangle, the first color texture includes the region attribution index used to characterize each fragment in the analysis area, that is, the pixels of the first color texture have a part that does not store this part of information in addition to the part that stores the region attribution index.

[0086] Before the step of determining whether the vertex data corresponding to the currently processed fragment data belongs to the analysis area according to the pre-stored first color texture, the method further includes:

[0087] Step S001, determining the region attribution index of the rasterized fragment corresponding to the vertices constituting the analysis region, wherein the region attribution index is determined according to the first index value of the vertices constituting the analysis region and the preset vertex array of each analysis region;

[0088] In this embodiment, how to generate a first color texture is described. Specifically, vertex data of each vertex in the analysis area is first obtained, and then rasterization is performed based on the vertex data to obtain rasterized fragments corresponding to the vertices of the analysis area (the role of the vertex shader to the fragment shader is to interpolate and provide screen coordinates. For example, the current device screen resolution is 200x300, and the fragment shader cannot obtain these coordinates, and can only obtain them through interpolation from the vertex shader to the fragment shader). Then, based on the first index value of the vertices that constitute the analysis area and the preset vertex arrays of each analysis area (the definition of the array is an ordered sequence of elements, that is, the array has its own index), the area attribution index of the rasterized fragments corresponding to the vertices that constitute the analysis area is determined.

[0089] Specifically, for example, there are 2 analysis areas, the number of vertices to be analyzed in the first one is 12, and the number of vertices to be analyzed in the second one is 30. At this time, the array length is 2, and the first vertex array is set to 12, and the second vertex array is set to 42 (12+30=42). The vertex shader obtains the first index value of the current vertex to be analyzed, such as 10. Therefore, the vertex shader can directly compare the first index value of 10 with the vertex array (maximum value). The first index value of 10 is less than the maximum value (12) of the first vertex array (countArray), then the vertex shader determines that the current vertex to be analyzed belongs to the first analysis area, where, if the regional index value (second index value) corresponding to the first analysis area has been set to 0 (the regional index value corresponding to the second analysis area is set to 1, and the regional index value corresponding to the third analysis area is set to 2), at this time, the regional attribution index of the current vertex to be analyzed is 0.

[0090] More specifically, in this embodiment, assume that there are two areas, the vertices of the first area are a, b, c, and the vertices of the second area are d, e, f. If the vertices of the two areas are grouped into a vertex array, it is [a, b, c, d, e, f]. The vertex index array corresponding to the vertex array is [0, 1, 2, 3, 4, 5].

[0091] When executing GPU operations, it is clear that the first area has 3 vertices and the second area has 3 vertices. Based on this known information, it can be determined that the vertices (a, b, c) corresponding to the values ​​of the index array less than 3 are the first area, and the vertices (d, e, f) corresponding to the values ​​of the index greater than or equal to 3 and less than 6 (3+3=6, a total of 6 vertices in the two areas) are the second area.

[0092] That is, the index value of the analysis area in the vertex array corresponds to the value in the index array. That is to say, if the vertex array is [a, b, c], then the index corresponding to a is 0, the index corresponding to B is 1, and the index corresponding to c is 2. If the index array is [2,0], then vertex c and vertex a will be taken at once according to the index array. Furthermore, if the current vertex being processed is c, then the vertex index obtained at this moment is 2. If the vertex array is [c,a,b], then the index value corresponding to vertex c is 0.

[0093] Step S002: using a color variable to characterize the region attribution index of the rasterized fragment to obtain the pre-stored first color texture.

[0094] In this embodiment, if Figure 4 As shown, the region attribution index of the rasterized fragment is represented by a color variable to obtain the pre-stored first color texture.

[0095] Specifically, the color variable may be a multidimensional vector (optional), at least one vector in the multidimensional vector is used to represent the identifier of the analysis area to which the rasterized fragment belongs, and / or other vectors in the multidimensional vector are used to represent the second index value of the analysis area to which the rasterized fragment belongs. For example, if the color variable (color) is a multidimensional vector and is a four-dimensional vector, the four dimensions are represented by R, G, B, and A respectively, then at least one vector in the multidimensional vector is used to represent the identifier of the analysis area to which the rasterized fragment belongs (for example, A is used to store the identifier of whether it is located in the analysis area, A is 0, indicating that it does not belong to the corresponding analysis area, and A is 1, indicating that it belongs to the corresponding analysis area), and other vectors (R, G, B) in the multidimensional vector are used to represent the second index value of the area to which the second related fragment corresponding to the current vertex to be analyzed belongs, wherein the second index value may be represented in segments, and 256 second index values ​​in the first segment are stored in the R component, 256 second index values ​​in the second segment are stored in the G component, and 256 second index values ​​in the third segment are stored in the G component. For example, if the second index value of the region to which the fragment belongs is 250, its second index value is stored in the R component; if the second index value of the region to which the fragment belongs is 300, its second index value is stored in the G component.

[0096] In this embodiment, due to the limitation of GPU processing performance, the specific values ​​corresponding to R, G, and B in the color variable may be normalized to reduce the consumption of computing resources.

[0097] In this embodiment, it is also specifically described how to determine whether the vertex data corresponding to the currently processed fragment data belongs to the analysis area:

[0098] That is, the step of determining whether the vertex data corresponding to the currently processed fragment data belongs to the analysis area according to the pre-stored first color texture includes:

[0099] Obtaining depth information of the current to-be-processed fragment metadata from a preset depth texture;

[0100] Performing coordinate inverse calculation according to the depth information to obtain the target coordinates of the current to-be-processed piece of metadata in a preset coordinate system;

[0101] Based on the target coordinates, projecting the current to-be-processed fragment data according to a projection scheme corresponding to the texture of the corresponding analysis area to obtain corresponding target texture coordinates;

[0102] Based on the target texture coordinates and the first color texture, it is determined whether the vertex data corresponding to the current fragment data to be processed belongs to an analysis area.

[0103] In this embodiment, the overall scheme is: back-projection is performed on the current fragment (data) to be processed to obtain the vertex data corresponding to the fragment, and then the vertex data is projected according to the projection scheme of the first color texture to obtain its fragment coordinates, and the fragment at the corresponding position in the first color texture is found according to the fragment coordinates, and then the index value stored in the color of the fragment is determined to determine the ownership, so as to perform a series of subsequent operations based on the ownership.

[0104] Specifically, in this embodiment, the late frame data is first obtained, such as Figure 3 As shown, the frame post data includes a preset depth texture ( Figure 3 The depth texture B in the image) and the second color texture (two images with the same resolution as the screen, Figure 3The color texture A in the image is obtained. Therefore, in this embodiment, the depth information corresponding to the current piece data can be obtained from the depth texture according to the texture coordinates (the depth is the value finally obtained by three-dimensionally transforming and projecting the distance between the object and the observation point in the three-dimensional scene, and the depth determines the front and back occlusion relationship of each pixel when the object is rendered on the screen), and then the coordinates are inversely calculated (reversely projected) according to the depth information to obtain the target coordinates of the current piece data to be processed in a preset coordinate system (the preset coordinate system is a specific coordinate system, which corresponds to the corresponding projection scheme during the previous rendering), and then based on the target coordinates, the current piece data to be processed is projected according to the projection scheme corresponding to the texture of the corresponding analysis area (it should be noted that the corresponding projection schemes for different analysis areas may be the same or different), to obtain the corresponding target texture coordinates, and then the variable value of the target texture coordinate is obtained from the first color texture, and subsequent processing is performed according to the variable value (including the judgment of whether it belongs to the analysis area, the judgment of which analysis area it belongs to, the judgment of the height value corresponding to the analysis area, the final color processing, etc.).

[0105] Specifically, if the value stored in the texel (pixel) of the target texture coordinate matches the first color texture, it is determined that the vertex data corresponding to the current piece data to be processed belongs to the analysis area; if the texel of the target texture coordinate does not match the first color texture, it is determined that the vertex data corresponding to the current piece data to be processed does not belong to the analysis area.

[0106] Step S300, if the vertex data corresponding to the current fragment to be processed belongs to the analysis area, then the vertex data of the current fragment to be processed is rendered according to the first preset color setting of the analysis area, and the first preset color setting is different from the second preset color setting of the non-analysis area.

[0107] In this embodiment, for example, if the first preset color setting is a red setting, the second preset color setting is a non-red setting such as a green setting, etc., and the two are completely different, so that the display of the analysis area can be distinguished from the non-analysis area. It should be emphasized that the first color texture is used to represent the area index, and the color setting is used to color the fragment, and the two are different concepts.

[0108] The step of rendering the current to-be-processed piece of metadata according to the first preset color setting of the analysis area also includes:

[0109] According to the target color obtained by fusing the first preset color setting and the second color setting of the analysis area, the currently processed fragment data is rendered accordingly.

[0110] In this embodiment, if Figure 5As shown, the target color obtained by merging the first preset color setting (such as red) and the second color setting (green) can be used as the color for rendering the first related fragment of the current vertex to be processed to increase the difference between the two.

[0111] After the step of determining whether the vertex data corresponding to the currently processed fragment data belongs to the analysis area, the method further includes:

[0112] If it is determined that the current fragment data to be processed does not belong to the analysis area, the current fragment data to be processed is rendered according to the second preset color setting, wherein the second preset color setting is determined according to a preset second color texture of the current fragment data to be processed.

[0113] In this embodiment, the process of acquiring the second color texture may be:

[0114] Get the later frame of the image to be rendered, parse and organize the later frame into a vertex form that can be used by the GPU, and then execute the rendering process, saving the color corresponding to each fragment metadata in the rendering pipeline as a second color texture (such as Figure 3 As shown), that is, in this embodiment, the second color texture stores color setting information, and then, the current to-be-processed fragment data is rendered based on the second preset color setting in the second color texture.

[0115] It can be understood that since the first color texture is pre-stored and the first color texture is used to characterize the regional attribution index of each fragment in the analysis area, therefore, in response to the rendering instruction, after obtaining the current fragment metadata to be processed, it is possible to accurately determine whether the vertex data corresponding to the current fragment metadata to be processed belongs to the analysis area. Under this premise, if the vertex data corresponding to the current fragment to be processed belongs to the analysis area, and since the first preset color setting is distinguished from the second preset color setting of the non-analysis area in the image to be rendered, that is, the display colors of the analysis area and the non-analysis area are different, therefore, the current fragment metadata to be processed can be subsequently rendered in accordance with the first preset color setting, that is, the current fragment metadata to be processed in this application can not be superimposed with only the same color as a whole, but can be displayed by regional partitions, thereby avoiding affecting the progress of the actual image analysis.

[0116] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can refer to the above introduction, and will not be repeated later. Figure 2 After the step of determining whether the vertex data corresponding to the current to-be-processed fragment data belongs to the analysis area based on the target texture coordinates and the first color texture, the method further includes:

[0117] Step A100, if the vertex data corresponding to the currently processed fragment data belongs to the analysis area, determine the height value of the analysis area;

[0118] The step of rendering the current to-be-processed piece of metadata according to the first preset color setting of the analysis area includes:

[0119] Step A200, determining a comparison result between the height value and a height coordinate obtained by inverse calculation based on the depth information;

[0120] Step A300: If the comparison result satisfies the analysis condition, then the current to-be-processed piece of metadata is rendered according to the first preset color setting of the analysis area.

[0121] In this embodiment, a comparison result between the height value and the height coordinate obtained by inverse calculation based on the depth information is determined. If the comparison result between the height value and the height coordinate obtained by inverse calculation based on the depth information meets the analysis condition (such as the height value is greater than or equal to the height coordinate obtained by inverse calculation based on the depth information), the current piece of metadata to be processed is rendered according to the first preset color setting of the analysis area to which it belongs.

[0122] In this embodiment, if the comparison result does not meet the analysis condition, the current to-be-processed piece data is rendered according to the second preset color setting or the third preset color setting, and the third preset color setting is distinguished from the first color setting and the second color setting. If the height value is less than the height coordinate obtained by inverse calculation based on the depth information, the current to-be-processed piece data is rendered according to the second preset color setting (red) or the third color setting (black). Figure 5 shown.

[0123] In this embodiment, if the vertex data corresponding to the currently processed fragment data belongs to the analysis area, the height value of the analysis area is determined. The comparison result of the height value and the height coordinate obtained by inverse calculation based on the depth information is determined; if the comparison result meets the analysis condition, the currently processed fragment data is rendered according to the first preset color setting of the analysis area, and the rendering is performed according to the comparison result of the height value of the analysis area and the height coordinate obtained by inverse calculation based on the depth information, so as to meet the needs of actual applications.

[0124] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the image rendering method of the present application. More simple transformations based on this technical concept are all within the protection scope of the present application.

[0125] This application also provides an image rendering device, please refer to Figure 6 , the image rendering device comprises:

[0126] A response module 10 is used to obtain metadata of a current slice to be processed in response to a rendering instruction;

[0127] A determination module 20, configured to determine whether the vertex data corresponding to the currently processed fragment data belongs to an analysis area according to a pre-stored first color texture, wherein the first color texture includes an area belonging index for characterizing each fragment in the analysis area;

[0128] The rendering module 30 is used to render the vertex data of the current fragment to be processed according to the first preset color setting of the analysis area if the vertex data corresponding to the current fragment to be processed belongs to the analysis area, and the first preset color setting is different from the second preset color setting of the non-analysis area.

[0129] In one embodiment, the image rendering device is used to implement:

[0130] Determine the region attribution index of the rasterized fragment corresponding to the vertices constituting the analysis region, wherein the region attribution index is determined according to the first index value of the vertices constituting the analysis region and the preset vertex array of each analysis region;

[0131] The region attribution index of the rasterized fragment is represented by a color variable to obtain the pre-stored first color texture.

[0132] In one embodiment, the color variable is a multidimensional vector, at least one vector in the multidimensional vector is used to represent the identifier of the analysis area to which the rasterized fragment belongs, and / or other vectors in the multidimensional vector are used to represent the second index value of the analysis area to which the rasterized fragment belongs.

[0133] In one embodiment, the image rendering device is further used to implement:

[0134] Obtaining depth information of the current to-be-processed fragment metadata from a preset depth texture;

[0135] Performing coordinate inverse calculation according to the depth information to obtain the target coordinates of the current to-be-processed piece of metadata in a preset coordinate system;

[0136] Based on the target coordinates, projecting the current to-be-processed fragment data according to a projection scheme corresponding to the texture of the corresponding analysis area to obtain corresponding target texture coordinates;

[0137] Based on the target texture coordinates and the first color texture, it is determined whether the vertex data corresponding to the current fragment data to be processed belongs to an analysis area.

[0138] In one embodiment, the image rendering device is further used to implement:

[0139] If the vertex data corresponding to the currently processed fragment data belongs to the analysis area, determining the height value of the analysis area;

[0140] The image rendering device is also used to implement:

[0141] Determine a comparison result between the height value and a height coordinate obtained by backcalculation based on the depth information;

[0142] If the comparison result satisfies the analysis condition, the currently processed fragment metadata is rendered according to the first preset color setting of the corresponding analysis area.

[0143] In one embodiment, the image rendering device is further used to implement:

[0144] If the comparison result does not meet the analysis condition, the current to-be-processed fragment data is rendered according to a second preset color setting or a third preset color setting, where the third preset color setting is different from the first color setting and the second color setting.

[0145] In one embodiment, the image rendering device is further used to implement:

[0146] According to the target color obtained by fusing the first preset color setting and the second color setting of the analysis area, the currently processed fragment data is rendered accordingly.

[0147] In one embodiment, the image rendering device is further used to implement:

[0148] If it is determined that the current fragment data to be processed does not belong to the analysis area, the current fragment data to be processed is rendered according to the second preset color setting, wherein the second preset color setting is determined according to a preset second color texture of the current fragment data to be processed.

[0149] Compared with the related art, the beneficial effects of the image rendering device provided in the present application are the same as the beneficial effects of the image rendering method provided in the above embodiment, which will not be elaborated here.

[0150] The present application provides an image rendering device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the image rendering method in the above-mentioned embodiment 1.

[0151] Reference below Figure 7, which shows a schematic diagram of the structure of an image rendering device suitable for implementing an embodiment of the present application. The image rendering device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The image rendering device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0152] like Figure 7 As shown, the image rendering device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the image rendering device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the image rendering device to communicate with other devices wirelessly or by wire to exchange data. Although the image rendering device with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.

[0153] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0154] The image rendering device provided by the present application adopts the image rendering method in the above embodiment to solve the technical problem of image rendering. Compared with the related art, the beneficial effects of the image rendering device provided by the present application are the same as the beneficial effects of the image rendering method provided by the above embodiment, and the other technical features in the image rendering device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0155] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0156] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0157] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, wherein the computer-readable program instructions are used to execute the image rendering method in the above-mentioned embodiment.

[0158] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.

[0159] The computer-readable storage medium may be included in the image rendering device; or may exist independently without being assembled into the image rendering device.

[0160] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the image rendering device, the image rendering device executes:

[0161] In response to the rendering instruction, obtain metadata of the current fragment to be processed;

[0162] Determining whether the vertex data corresponding to the currently processed fragment data belongs to the analysis area according to a pre-stored first color texture, wherein the first color texture includes a region belonging index for characterizing each fragment in the analysis area;

[0163] If the vertex data corresponding to the current fragment to be processed belongs to the analysis area, the vertex data of the current fragment to be processed is rendered according to a first preset color setting of the analysis area, where the first preset color setting is different from a second preset color setting of the non-analysis area.

[0164] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0165] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0166] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0167] The readable storage medium provided in the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned image rendering method, and can solve the technical problems of image rendering. Compared with the related art, the beneficial effects of the computer-readable storage medium provided in the present application are the same as the beneficial effects of the image rendering method provided in the above-mentioned embodiment, and will not be elaborated here.

[0168] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned image rendering method when executed by a processor.

[0169] The computer program product provided by this application can solve the technical problem of image rendering. Compared with the related art, the beneficial effects of the computer program product provided by this application are the same as the beneficial effects of the image rendering method provided by the above embodiment, which will not be repeated here.

[0170] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. An image rendering method, characterized in that: The method comprises: In response to the rendering instruction, obtain metadata of the current fragment to be processed; Determining whether the vertex data corresponding to the currently processed fragment data belongs to the analysis area according to a pre-stored first color texture, wherein the first color texture includes a region belonging index for characterizing each fragment in the analysis area; If the vertex data corresponding to the current fragment to be processed belongs to the analysis area, the current fragment data to be processed is rendered according to the first preset color setting of the analysis area to which it belongs, so as to obtain fragment data displayed in different color partitions, so as to perform image analysis on the fragment data displayed in different color partitions, and the first preset color setting is distinguished from the second preset color setting of the non-analysis area.

2. The image rendering method according to claim 1, characterized in that: Before the step of determining whether the vertex data corresponding to the currently processed fragment data belongs to the analysis area according to the pre-stored first color texture, the method further includes: Determine the region attribution index of the rasterized fragment corresponding to the vertices constituting the analysis region, wherein the region attribution index is determined according to the first index value of the vertices constituting the analysis region and the preset vertex array of each analysis region; The region attribution index of the rasterized fragment is represented by a color variable to obtain the pre-stored first color texture.

3. The image rendering method according to claim 2, characterized in that: The color variable is a multidimensional vector, at least one vector in the multidimensional vector is used to represent the identifier of the analysis area to which the rasterized fragment belongs, and / or other vectors in the multidimensional vector are used to represent the second index value of the analysis area to which the rasterized fragment belongs.

4. The image rendering method according to claim 1, characterized in that: The step of determining whether the vertex data corresponding to the currently processed fragment data belongs to the analysis area according to the pre-stored first color texture includes: Obtaining depth information corresponding to the current to-be-processed fragment metadata from a preset depth texture; Inversely project the depth information according to the projection mode of the depth texture to obtain the target coordinates of the current to-be-processed fragment data in a preset coordinate system; Based on the target coordinates, projecting the current to-be-processed fragment data according to a projection scheme corresponding to the texture of the corresponding analysis area to obtain corresponding target texture coordinates; Based on the target texture coordinates and the first color texture, it is determined whether the vertex data corresponding to the current fragment data to be processed belongs to an analysis area.

5. The image rendering method according to claim 4, characterized in that: After the step of determining whether the vertex data corresponding to the current to-be-processed fragment data belongs to the analysis area based on the target texture coordinates and the first color texture, the method further includes: If the vertex data corresponding to the currently processed fragment data belongs to the analysis area, determining the height value of the analysis area; The step of rendering the current to-be-processed piece of metadata according to the first preset color setting of the analysis area includes: Determine a comparison result between the height value and a height coordinate obtained by backcalculation based on the depth information; If the comparison result satisfies the analysis condition, the currently processed fragment metadata is rendered according to the first preset color setting of the corresponding analysis area.

6. The image rendering method according to claim 5, characterized in that: After the step of determining the comparison result between the height value and the height coordinate obtained by backcalculation based on the depth information, the method further comprises: If the comparison result does not meet the analysis condition, the current to-be-processed fragment data is rendered according to a second preset color setting or a third preset color setting, where the third preset color setting is different from the first color setting and the second color setting.

7. The image rendering method according to claim 1, characterized in that: The step of rendering the current to-be-processed piece of metadata according to the first preset color setting of the analysis area also includes: According to the target color obtained by fusing the first preset color setting and the second color setting of the analysis area, the currently processed fragment data is rendered accordingly.

8. The image rendering method according to claim 1, characterized in that: After the step of determining whether the vertex data corresponding to the currently processed fragment data belongs to the analysis area, the method further includes: If it is determined that the current fragment data to be processed does not belong to the analysis area, the current fragment data to be processed is rendered according to the second preset color setting, wherein the second preset color setting is determined according to a preset second color texture of the current fragment data to be processed.

9. An image rendering device, characterized in that: The device comprises: A response module, used to respond to a rendering instruction and obtain metadata of the current slice to be processed; A determination module, used to determine whether the vertex data corresponding to the currently processed fragment data belongs to the analysis area according to a pre-stored first color texture, wherein the first color texture includes a region belonging index for characterizing each fragment in the analysis area; A rendering module is used to render the current fragment data to be processed according to a first preset color setting of the analysis area to which it belongs, if the vertex data corresponding to the current fragment data to be processed belongs to the analysis area, to obtain fragment data displayed in different color partitions, so as to perform image analysis on the fragment data displayed in different color partitions, wherein the first preset color setting is distinguished from the second preset color setting of the non-analysis area.

10. An image rendering device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the image rendering method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Method for delivering resources in panoramic video and display equipment

    CN114051089A

  • Display method and device of application program interface, electronic equipment and storage medium

    CN115761012A