Character rendering method, device, equipment and storage medium
By pre-constructing a preset texture picture collection corresponding to the power geographic information system, the problem of low character rendering efficiency in the power geographic information system is solved, and a more efficient character rendering process is achieved.
Patent Information
- Application Number
- CN202111347768.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-15
- Publication Date
- 2025-08-12
- Estimated Expiration
- 2041-11-15
AI Technical Summary
In power geographic information systems, the problem of low character rendering efficiency.
By pre-constructing a collection of preset texture pictures corresponding to the power geographic information system, including multiple preset texture pictures, the reference texture pictures of characters to be marked are quickly obtained and rendered in the scene diagram.
It improves the efficiency of character rendering, reduces the number of switching times in the rendering process, and reduces the utilization rate of system memory and video memory resources.
Smart Images

Figure CN114241103B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a character rendering method, apparatus, device, and storage medium. Background Art
[0002] In the electric power geographic information system, Chinese and English characters or special characters are needed to mark the power grid transmission lines, and the character information needs to be rendered before it can be displayed in the electric power geographic information system.
[0003] Traditionally, when rendering characters, a universal signed distance field character set can be used. Signed distance field characters are generated by replacing the color value recorded at each pixel in a character texture image with the shortest distance from each pixel to the edge of the character. To obtain a universal signed distance field character set, the corresponding signed distance field characters are first generated based on commonly used characters. Then, the signed distance field character set is obtained based on all signed distance field characters.
[0004] However, when using a universal directed distance field character set to render characters in a power geographic information system, there is a problem of low rendering efficiency. Summary of the Invention
[0005] Based on this, embodiments of the present application provide a character rendering method, apparatus, device, and storage medium, which can improve the efficiency of character rendering in a scene graph.
[0006] In a first aspect, a character rendering method is provided, which is applied to a power geographic information system. The method comprises:
[0007] The character information to be marked is determined from the scene graph of the electric power geographic information system; the character information to be marked includes the character to be marked and the rendering information of the character to be marked; according to the rendering information of the character information to be marked, a reference texture image corresponding to the character to be marked is obtained from a preset texture image set; the preset texture image set corresponds to the electric power geographic information system, and the preset texture image set includes multiple preset texture images; according to the rendering information of the character information to be marked, the reference texture image is rendered in the scene graph to generate a scene graph including the character to be marked.
[0008] In one embodiment, the process of generating the preset texture image set includes:
[0009] Obtain historical record information and historical operation information of power equipment in the power geographic information system; the power equipment includes at least one of power generation equipment, transmission lines, substations, and distribution lines; obtain labeling character information corresponding to the power equipment from the historical record information and historical operation information of the power equipment; the labeling character information includes the identification and parameters of the power equipment; generate a preset texture image according to the labeling character information, and obtain a preset texture image set based on the preset texture image.
[0010] In one embodiment, generating a preset texture image according to the marked character information, and obtaining a preset texture image set based on the preset texture image includes:
[0011] According to the labeled character information, the characters in the labeled character information are converted into preset texture images; the pixels in the preset texture images are represented in the form of directed distances; and the preset texture images are merged to generate a preset texture image set.
[0012] In one embodiment, the preset texture images include texture images corresponding to different character formats, where the character format includes at least one of font, font size, and color; merging the preset texture images to generate a preset texture image set includes:
[0013] For each character format, a preset texture image corresponding to the character format is obtained; the preset texture images corresponding to the character formats are merged to generate a preset texture image set corresponding to each character format.
[0014] In one embodiment, the rendering information of the character to be annotated includes a character format; and obtaining a reference texture image corresponding to the character to be annotated from a preset texture image set according to the rendering information of the character to be annotated includes:
[0015] A preset texture image set corresponding to the character format is determined as a target preset texture image set; and a reference texture image corresponding to the character to be annotated is obtained from the target preset texture image set.
[0016] In one embodiment, the rendering information of the characters to be annotated includes size information and coordinate information of the characters to be annotated in a scene graph; rendering a reference texture image in the scene graph based on the rendering information of the characters to be annotated to generate a scene graph including the characters to be annotated includes:
[0017] According to the size information of the characters to be marked in the scene graph, a grid corresponding to the size information is created in the scene graph; a reference texture image is placed in the grid for rendering, and a scene graph including the characters to be marked is generated.
[0018] In one embodiment, creating a grid corresponding to the size information in the scene graph according to the size information of the character to be marked in the scene graph includes:
[0019] Obtain an initial grid; scale the initial grid according to the size information of the character to be annotated in the scene graph to generate a target grid corresponding to the character to be annotated; create a target grid in the scene graph according to the coordinate information of the character to be annotated in the scene graph.
[0020] In a second aspect, a character rendering device is provided, the device comprising:
[0021] A determination module is used to determine the character information to be marked from the scene graph of the electric power geographic information system; the character information to be marked includes the character to be marked and the rendering information of the character to be marked;
[0022] A first acquisition module is configured to acquire a reference texture image corresponding to the character to be annotated from a preset texture image set based on rendering information of the character information to be annotated; the preset texture image set corresponds to the electric power geographic information system, and the preset texture image set includes a plurality of texture images;
[0023] The first generating module is configured to render the reference texture image in a scene graph according to rendering information of the character information to be marked, so as to generate a scene graph including the character to be marked.
[0024] In a third aspect, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the method steps in any embodiment of the first aspect are implemented.
[0025] In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method steps in any embodiment of the first aspect are implemented.
[0026] The above-mentioned character rendering method, device, equipment and storage medium determine the character information to be annotated from the scene graph of the electric power geographic information system; obtain the reference texture image corresponding to the character to be annotated from the preset texture image set according to the rendering information of the character information to be annotated; render the reference texture image in the scene graph according to the rendering information of the character information to be annotated, and generate a scene graph including the character to be annotated. In the technical solution provided by the embodiment of the present application, since the preset texture image set corresponds to the electric power geographic information system, and the preset texture image set includes multiple preset texture images, the number of texture images contained in the texture image set pre-constructed according to the characteristics of the electric power geographic system is reduced, and the rendering process does not need to be switched when the texture images corresponding to the characters to be annotated are selected from the same preset texture image set for rendering, thereby improving the efficiency of character rendering. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 A block diagram of a computer device provided in an embodiment of the present application;
[0028] Figure 2 A flowchart of a character rendering method provided in an embodiment of the present application;
[0029] Figure 3 A schematic diagram of a preset texture image set provided in an embodiment of the present application;
[0030] Figure 4 A flowchart for generating a preset texture image set provided in an embodiment of the present application;
[0031] Figure 5 A flowchart of generating a preset texture picture set according to a preset texture picture provided in an embodiment of the present application;
[0032] Figure 6 A flowchart of merging preset texture images provided in an embodiment of the present application;
[0033] Figure 7 A flowchart for obtaining a reference texture image provided in an embodiment of the present application;
[0034] Figure 8 A flowchart of rendering a reference texture image in a scene graph provided in an embodiment of the present application;
[0035] Figure 9 A flowchart of creating a grid in a scene graph provided in an embodiment of the present application;
[0036] Figure 10 A flowchart of a character rendering method provided in an embodiment of the present application;
[0037] Figure 11 A block diagram of a character rendering device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0038] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.
[0039] The character rendering method provided in the present application can be applied to a computer device, which can be a server or a terminal. The server can be a single server or a server cluster composed of multiple servers. The embodiments of the present application do not specifically limit this. The terminal can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, and portable wearable devices.
[0040] Take the computer device as an example, Figure 1 A block diagram of a server is shown, such as Figure 1 As shown, a server may include a processor and memory connected via a system bus. The server's processor is configured to provide computing and control capabilities. The server's memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operating system and computer program in the non-volatile storage medium to run. When executed by the processor, the computer program implements a character rendering method.
[0041] Those skilled in the art will understand that Figure 1 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the server to which the solution of the present application is applied. Optionally, the server may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0042] It should be noted that the execution subject of the embodiments of the present application can be a computer device or a character rendering device. The following method embodiments will be described using a computer device as the execution subject.
[0043] In one embodiment, Figure 2 , which shows a flowchart of a character rendering method provided by an embodiment of the present application, the method may include the following steps:
[0044] Step 220 : Determine the character information to be marked from the scene graph of the electric power geographic information system; the character information to be marked includes the character to be marked and rendering information of the character to be marked.
[0045] The power geographic information system, also known as the power GIS, integrates power system technology, computer graphics processing technology, and spatial database technology. Based on geographic information, the power GIS can comprehensively manage power equipment and optimize the load distribution of the power grid. The power GIS can be used to design transmission and distribution networks, thereby displaying a scene diagram of the power grid, which can be a three-dimensional scene diagram or other multi-dimensional scene diagram.
[0046] In the scene graph, different labels can be used to mark the relevant information of different power equipment such as power generation equipment, transmission lines, substations, distribution lines, etc., so as to achieve the purpose of explanation. The label here can be at least one of Chinese characters, English characters, and special symbols, such as "#", ">", etc. In actual use, the character information to be marked can be determined from the scene graph of the power geographic information system through a customized scene annotation management object, and the character information to be marked in the currently displayed scene can be obtained in real time; all the character information to be marked in the scene graph can also be obtained. The character information to be marked can include the character to be marked and the rendering information of the character to be marked. The character to be marked is the character that needs to be displayed in the scene graph. The rendering information of the character to be marked can include character format information, size information of the character to be marked in the scene graph, coordinate position information, etc. Of course, it can also include other rendering information, which is not specifically limited in this embodiment.
[0047] Step 240: According to the rendering information of the character information to be marked, obtain a reference texture image corresponding to the character to be marked from a preset texture image set; the preset texture image set corresponds to the electric power geographic information system, and the preset texture image set includes multiple preset texture images.
[0048] The preset texture picture set is a set of preset texture pictures that are pre-generated and correspond to the electric power geographic information system, and the preset texture picture set may include multiple preset texture pictures. Figure 3 As shown, Figure 3 A schematic diagram of a preset texture image set provided in an embodiment of the present application, where only some commonly used characters in the electric power geographic information system are used as examples for illustration. For example, "electricity, pressure, line, V" and the like are all commonly used characters in the electric power geographic information system. The preset texture image set can be one set or multiple sets. A preset texture image set can include preset texture images corresponding to characters of the same character format, and can also include preset texture images corresponding to characters of different character formats; multiple preset texture image sets can be sets composed of preset texture images corresponding to all characters of the same character format, thereby obtaining multiple preset texture image sets under different character formats based on the set.
[0049] Based on the rendering information of the character to be annotated, combined with the texture coordinates of the texture image of the character to be annotated in a preset texture image set, a reference texture image corresponding to the character to be annotated is obtained from the preset texture image set. For example, based on the character format information in the rendering information, a reference texture image corresponding to the character to be annotated can be obtained from the preset texture image set corresponding to the character format.
[0050] Step 260: Render the reference texture image in the scene graph according to the rendering information of the character information to be marked, and generate a scene graph including the character to be marked.
[0051] After obtaining a reference texture image corresponding to the character to be annotated, the reference texture image can be rendered in a scene graph using a texture map to generate a scene graph including the character to be annotated. When rendering the reference texture image in the scene graph, the character to be annotated can be rendered at a desired size and position based on the size information, coordinate position information, etc. of the character to be annotated in the scene graph contained in the rendering information of the character to be annotated.
[0052] In this embodiment, the character information to be annotated is determined from a scene graph of the electric power geographic information system; based on the rendering information of the character information to be annotated, a reference texture image corresponding to the character to be annotated is obtained from a preset texture image set; and based on the rendering information of the character information to be annotated, the reference texture image is rendered in the scene graph to generate a scene graph including the character to be annotated. Because the preset texture image set corresponds to the electric power geographic information system and includes multiple preset texture images, the number of texture images included in the texture image set pre-built for the characteristics of the electric power geographic information system is reduced, and the rendering process does not need to be switched when selecting texture images corresponding to the characters to be annotated from the same preset texture image set for rendering, thereby improving the efficiency of character rendering.
[0053] In one embodiment, Figure 4 , which shows a flowchart of a character rendering method provided by an embodiment of the present application, specifically involving a possible process of generating a preset texture image set. The method may include the following steps:
[0054] Step 420: Acquire historical record information and historical operation information of power equipment in the power geographic information system; the power equipment includes at least one of power generation equipment, transmission lines, substations, and distribution lines.
[0055] Step 440: Obtain the labeling character information corresponding to the power equipment from the historical record information and historical operation information of the power equipment; the labeling character information includes the identification and parameters of the power equipment.
[0056] Step 460: Generate a preset texture image according to the marked character information, and obtain a preset texture image set based on the preset texture image.
[0057] Among them, the historical record information of the power equipment may include parameter information, wiring information, etc. of the power equipment. The parameter information may include parameter information such as the name, belonging information, location, rated voltage and current, capacity, and weight of the power equipment; the wiring information of the power equipment may represent information such as the connection relationship and position relationship of the power equipment, and the operation information of the power equipment may include information such as the status parameters of the power equipment. The power equipment may include at least one of power generation equipment, transmission lines, substations, and distribution lines. By obtaining the labeling character information corresponding to the power equipment from the historical record information and historical operation information of the power equipment, the labeling character information corresponding to the power equipment is the character information commonly used in the power grid. The labeling character information here may include the identification and parameters of the power equipment. The power equipment is labeled with characters through the labeling character information to provide an explanation. Then, a preset texture image is generated based on the obtained labeling character information, thereby obtaining a preset texture image set based on the preset texture image.
[0058] In this embodiment, historical record information and historical operation information of power equipment in the power geographic information system are obtained; from the historical record information and historical operation information of the power equipment, labeling character information corresponding to the power equipment is obtained; a preset texture image is generated based on the labeling character information, and a preset texture image set is obtained based on the preset texture image. The power geographic system has its own unique characteristics. By pre-building a corresponding texture image set based on these characteristics, the number of preset texture images in the pre-generated preset texture image set is limited, thereby reducing the memory and video memory usage of the preset texture image set.
[0059] In one embodiment, Figure 5 , which shows a flowchart of a character rendering method provided by an embodiment of the present application, specifically involving a possible process of generating a preset texture image set based on a preset texture image. The method may include the following steps:
[0060] Step 520: Convert the characters in the labeled character information into a preset texture image according to the labeled character information; and represent the pixels in the preset texture image in the form of directed distance.
[0061] Step 540: Merge the preset texture images to generate a preset texture image set.
[0062] Among them, according to the marked character information, the color value stored in each pixel in the font bitmap of the character in the marked character information can be replaced with the shortest distance from the edge of the character. When the pixel point is inside the character, a positive distance is used, and outside the character, a negative distance is used. It is zero at the edge of the character. In this way, the edge in the character is described in the form of directed distance, that is, vector distance. In the shader, the edge is smoothed by smooth difference to resolve the edge blur problem.
[0063] It is also possible to establish and maintain a mapping table from character Unicode encoding to glyph encapsulation objects, so that the corresponding texture file can be obtained according to the Unicode encoding corresponding to the character in the annotated character information, and the corresponding texture image can be generated according to the texture file. Then, the preset texture images are merged to generate a preset texture image set. When merging the preset texture images, a large texture can be created in advance, so that the pixel values in each preset texture image can be written into the large texture in sequence. For example, the large texture can be 1024*1024 pixels, 2048*2048 pixels, etc. The preset texture image set can be managed by a custom texture management object, and the texture images can be merged according to a custom texture widget.
[0064] In this embodiment, based on the annotated character information, the characters in the annotated character information are converted into preset texture images; the preset texture images are merged to generate a preset texture image set. The number of texture images included in the merged preset texture image set is reduced, and the rendering process does not need to be switched when selecting texture images corresponding to the characters to be annotated from the same preset texture image set for rendering, thereby improving the efficiency of character rendering. Furthermore, since the creation and uploading of new texture images to the GPU consumes graphics card performance, the preset texture images are merged to generate a preset texture image set, thereby reducing the number of texture image creation times and the number of times the texture images are uploaded to the GPU.
[0065] In one embodiment, the preset texture image includes texture images corresponding to different character formats, and the character format includes at least one of font, font size, and color; Figure 6 , which shows a flowchart of a character rendering method provided by an embodiment of the present application, specifically involving a possible process of merging preset texture images. The method may include the following steps:
[0066] Step 620: For each character format, obtain a preset texture image corresponding to the character format.
[0067] Step 640: Merge the preset texture images corresponding to the character formats to generate a set of preset texture images corresponding to each character format.
[0068] Among them, a corresponding texture image can be pre-generated for each character format, so that a preset texture image corresponding to the character format can be obtained for each character format, thereby obtaining the preset texture images of all characters in different character formats. The preset texture images corresponding to the character formats are then merged to generate a preset texture image set corresponding to each character format. For example, a preset texture image set corresponding to the character format of Songti, size 8 can be generated, and a preset texture image set corresponding to the character format of Songti, size 16 can also be generated. Of course, it can also be a preset texture image set corresponding to other character formats, which will not be explained one by one here.
[0069] In this embodiment, for each character format, a preset texture image corresponding to the character format is obtained; the preset texture images corresponding to the character format are merged to generate a preset texture image set corresponding to each character format. By pre-generating a set of preset texture images corresponding to multiple character formats for use, the flexibility and applicability of character annotation in practical applications can be improved.
[0070] In one embodiment, the rendering information of the character to be marked includes the character format, such as Figure 7 , which shows a flowchart of a character rendering method provided by an embodiment of the present application, specifically involving a possible process of obtaining a reference texture image. The method may include the following steps:
[0071] Step 720: Determine a preset texture picture set corresponding to the character format as a target preset texture picture set.
[0072] Step 740: Obtain a reference texture image corresponding to the character to be marked from the target preset texture image set.
[0073] Among them, when obtaining the reference texture image corresponding to the character to be marked, a preset texture image set corresponding to the character format can be determined according to the character format information in the rendering information of the character to be marked, as the target preset texture image set, and then from the target preset texture image set, combined with the texture coordinates of the texture image of the character to be marked in the preset texture image set, the reference texture image corresponding to the character to be marked is obtained from the preset texture image set.
[0074] In this embodiment, a preset texture image set corresponding to the character format is determined as a target preset texture image set; and a reference texture image corresponding to the character to be marked is obtained from the target preset texture image set, thereby improving the accuracy and efficiency of obtaining the texture image.
[0075] In one embodiment, the rendering information of the character to be marked includes the size information and coordinate information of the character to be marked in the scene graph, such as Figure 8 , which shows a flowchart of a character rendering method provided by an embodiment of the present application, specifically involving a possible process of rendering a reference texture image in a scene graph. The method may include the following steps:
[0076] Step 820: Create a grid corresponding to the size information in the scene graph according to the size information of the character to be marked in the scene graph.
[0077] Step 840: Place the reference texture image in the grid for rendering to generate a scene graph including the characters to be annotated.
[0078] Based on the size of the characters to be annotated in the scene graph, a mesh is created, i.e., a mesh object, that corresponds to the size information. This can be done directly based on the size of the characters to be annotated in the scene graph, or by scaling previously saved mesh data. The obtained reference texture image is placed on the created mesh and rendered, generating a scene graph that includes the characters to be annotated.
[0079] During the rendering process, you can construct a render object using the instantiation interface provided by the rendering engine. Both the underlying graphics card and the rendering engine provide corresponding instantiation implementation interfaces. Specifically, you construct an instantiated render object, associate it with a preset texture image set, and set the corresponding rendering state. The instantiation matrix is then passed to the GPU, and calculations for the position and orientation of the character coordinates in each frame are also ported to the GPU.
[0080] In this embodiment, a grid corresponding to the size information of the characters to be marked in the scene graph is created in the scene graph; a reference texture image is placed in the grid for rendering, and a scene graph including the characters to be marked is generated, so that the characters can be rendered in the scene graph accurately and quickly.
[0081] In one embodiment, Figure 9 , which shows a flowchart of a character rendering method provided by an embodiment of the present application, specifically involving a possible process of creating a grid in a scene graph. The method may include the following steps:
[0082] Step 920: Obtain the initial grid.
[0083] Step 940: scale the initial grid according to the size information of the character to be marked in the scene graph to generate a target grid corresponding to the character to be marked.
[0084] Step 960: Create a target grid in the scene graph according to the coordinate information of the character to be marked in the scene graph.
[0085] The vertex information or other information of the initial mesh can be obtained. The initial mesh can be a saved mesh created for the first time. When a new texture image needs to be rendered in the scene graph, the information of the initial mesh can be reused. Specifically, the initial mesh can be scaled according to the size information of the characters to be annotated in the scene graph to generate a target mesh corresponding to the characters to be annotated. Then, the target mesh can be created in the scene graph according to the coordinate information of the characters to be annotated in the scene graph.
[0086] In this embodiment, an initial grid is obtained; the initial grid is scaled based on the size of the character to be annotated in the scene graph to generate a target grid corresponding to the character to be annotated; and the target grid is created in the scene graph based on the coordinates of the character to be annotated in the scene graph. By reusing the information of the initial grid, the efficiency of character rendering in the scene graph is improved.
[0087] In one embodiment, Figure 10 , which shows a flowchart of a character rendering method provided by an embodiment of the present application, the method may include the following steps:
[0088] Step 1001: Obtain ledger information and operation information.
[0089] Obtain historical record information and historical operation information of power equipment in the power geographic information system; power equipment includes at least one of power generation equipment, transmission lines, substations, and distribution lines; obtain labeling character information corresponding to the power equipment from the historical record information and historical operation information of the power equipment.
[0090] Step 1002: Generate a merged preset texture image set.
[0091] A preset texture image is generated according to the marked character information, and a preset texture image set is obtained based on the preset texture image.
[0092] Step 1003: Obtain information of characters to be marked in the current scene graph.
[0093] The character information to be marked is determined from the scene graph of the electric power geographic information system; the character information to be marked includes the character to be marked and rendering information of the character to be marked.
[0094] Step 1004: Obtain a reference texture image corresponding to the character to be marked from a preset texture image set.
[0095] Step 1005: Get a reusable grid object and create a new grid.
[0096] Step 1006: Render the reference texture image in the scene graph.
[0097] The implementation principles and technical effects of each step in the character rendering method provided in this embodiment are similar to those in the previous character rendering method embodiments, and will not be repeated here. Figure 10 The implementation of each step in the embodiment is only an example and is not limited to each implementation. The order of each step can be adjusted in actual application as long as the purpose of each step can be achieved.
[0098] In the technical solution provided in the embodiment of the present application, since the preset texture picture set corresponds to the electric power geographic information system, and the preset texture picture set includes multiple preset texture pictures, the number of texture pictures contained in the corresponding texture picture set pre-constructed according to the characteristics of the electric power geographic system is reduced, and the rendering process does not need to be switched when the texture pictures corresponding to the characters to be marked are selected from the same preset texture picture set for rendering, thereby improving the efficiency of character rendering.
[0099] It should be understood that although Figure 2-10 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. In addition, Figure 2-10 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The order of execution of these steps or stages is not necessarily one by one, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.
[0100] Please refer to Figure 11 , which shows a block diagram of a character rendering device 1100 provided in an embodiment of the present application. Figure 11 As shown, the character rendering device 1100 may include: a determination module 1102, a first acquisition module 1104 and a first generation module 1106, wherein:
[0101] The determination module 1102 is used to determine the character information to be marked from the scene graph of the electric power geographic information system; the character information to be marked includes the character to be marked and the rendering information of the character to be marked;
[0102] A first acquisition module 1104 is configured to acquire a reference texture image corresponding to the character to be annotated from a preset texture image set based on the rendering information of the character information to be annotated; the preset texture image set corresponds to the electric power geographic information system and includes a plurality of texture images;
[0103] The first generating module 1106 is configured to render the reference texture image in the scene graph according to the rendering information of the character information to be marked, so as to generate a scene graph including the character to be marked.
[0104] In one embodiment, the character rendering apparatus 1100 further includes a second acquisition module 1108, a third acquisition module 1110, and a second generation module 1112, wherein:
[0105] The second acquisition module 1108 is used to obtain historical ledger information and historical operation information of power equipment in the power geographic information system; the power equipment includes at least one of power generation equipment, transmission lines, substations, and distribution lines;
[0106] The third acquisition module 1110 is used to obtain the labeling character information corresponding to the power equipment from the historical record information and historical operation information of the power equipment; the labeling character information includes the identification and parameters of the power equipment;
[0107] The second generating module 1112 is configured to generate a preset texture image according to the annotated character information, and obtain a preset texture image set based on the preset texture image.
[0108] In one embodiment, the second generation module 1112 is specifically configured to convert characters in the labeled character information into preset texture images based on the labeled character information; pixels in the preset texture images are represented in the form of directed distances; and each preset texture image is merged to generate a preset texture image set.
[0109] In one embodiment, the preset texture images include texture images corresponding to different character formats, and the character formats include at least one of font, font size, and color; the above-mentioned second generation module 1112 is also used to obtain the preset texture images corresponding to the character formats for each character format; merge the preset texture images corresponding to the character formats to generate a preset texture image set corresponding to each character format.
[0110] In one embodiment, the rendering information of the character to be marked includes the character format; the above-mentioned first acquisition module 1104 is specifically used to determine a preset texture image set corresponding to the character format as a target preset texture image set; and obtain a reference texture image corresponding to the character to be marked from the target preset texture image set.
[0111] In one embodiment, the rendering information of the characters to be annotated includes the size information and coordinate information of the characters to be annotated in the scene graph; the above-mentioned first generation module 1106 is specifically used to create a grid corresponding to the size information in the scene graph based on the size information of the characters to be annotated in the scene graph; place the reference texture image in the grid for rendering, and generate a scene graph including the characters to be annotated.
[0112] In one embodiment, the first generation module 1106 is further configured to obtain an initial grid; scale the initial grid according to the size information of the character to be annotated in the scene graph to generate a target grid corresponding to the character to be annotated; and create a target grid in the scene graph according to the coordinate information of the character to be annotated in the scene graph.
[0113] For the specific definition of the character rendering device, please refer to the definition of the character rendering method above, which will not be repeated here. The various modules in the above-mentioned character rendering device can be implemented in whole or in part by software, hardware, or a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations of the above-mentioned modules.
[0114] In one embodiment of the present application, a computer device is provided. The computer device includes a memory and a processor. The memory stores a computer program. When the processor executes the computer program, the following steps are implemented:
[0115] The character information to be marked is determined from the scene graph of the electric power geographic information system; the character information to be marked includes the character to be marked and the rendering information of the character to be marked; according to the rendering information of the character information to be marked, a reference texture image corresponding to the character to be marked is obtained from a preset texture image set; the preset texture image set corresponds to the electric power geographic information system, and the preset texture image set includes multiple preset texture images; according to the rendering information of the character information to be marked, the reference texture image is rendered in the scene graph to generate a scene graph including the character to be marked.
[0116] In one embodiment of the present application, when the processor executes the computer program, the processor further implements the following steps:
[0117] Obtain historical record information and historical operation information of power equipment in the power geographic information system; the power equipment includes at least one of power generation equipment, transmission lines, substations, and distribution lines; obtain labeling character information corresponding to the power equipment from the historical record information and historical operation information of the power equipment; the labeling character information includes the identification and parameters of the power equipment; generate a preset texture image according to the labeling character information, and obtain a preset texture image set based on the preset texture image.
[0118] In one embodiment of the present application, when the processor executes the computer program, the processor further implements the following steps:
[0119] According to the labeled character information, the characters in the labeled character information are converted into preset texture images; the pixels in the preset texture images are represented in the form of directed distances; and the preset texture images are merged to generate a preset texture image set.
[0120] In one embodiment of the present application, the preset texture image includes texture images corresponding to different character formats, and the character format includes at least one of font, font size, and color;
[0121] When the processor executes the computer program, it also performs the following steps:
[0122] For each character format, a preset texture image corresponding to the character format is obtained; the preset texture images corresponding to the character formats are merged to generate a preset texture image set corresponding to each character format.
[0123] In one embodiment of the present application, the rendering information of the character to be marked includes the character format;
[0124] When the processor executes the computer program, it also performs the following steps:
[0125] A preset texture image set corresponding to the character format is determined as a target preset texture image set; and a reference texture image corresponding to the character to be annotated is obtained from the target preset texture image set.
[0126] In one embodiment of the present application, the rendering information of the character to be marked includes size information and coordinate information of the character to be marked in the scene graph;
[0127] When the processor executes the computer program, it also performs the following steps:
[0128] According to the size information of the characters to be marked in the scene graph, a grid corresponding to the size information is created in the scene graph; a reference texture image is placed in the grid for rendering, and a scene graph including the characters to be marked is generated.
[0129] In one embodiment of the present application, when the processor executes the computer program, the processor further implements the following steps:
[0130] Obtain an initial grid; scale the initial grid according to the size information of the character to be annotated in the scene graph to generate a target grid corresponding to the character to be annotated; create a target grid in the scene graph according to the coordinate information of the character to be annotated in the scene graph.
[0131] The computer device provided in the embodiment of the present application has similar implementation principles and technical effects to those of the above-mentioned method embodiment, and will not be described in detail here.
[0132] In one embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0133] The character information to be marked is determined from the scene graph of the electric power geographic information system; the character information to be marked includes the character to be marked and the rendering information of the character to be marked; according to the rendering information of the character information to be marked, a reference texture image corresponding to the character to be marked is obtained from a preset texture image set; the preset texture image set corresponds to the electric power geographic information system, and the preset texture image set includes multiple preset texture images; according to the rendering information of the character information to be marked, the reference texture image is rendered in the scene graph to generate a scene graph including the character to be marked.
[0134] In one embodiment of the present application, when the computer program is executed by a processor, the following steps are further implemented:
[0135] Obtain historical record information and historical operation information of power equipment in the power geographic information system; the power equipment includes at least one of power generation equipment, transmission lines, substations, and distribution lines; obtain labeling character information corresponding to the power equipment from the historical record information and historical operation information of the power equipment; the labeling character information includes the identification and parameters of the power equipment; generate a preset texture image according to the labeling character information, and obtain a preset texture image set based on the preset texture image.
[0136] In one embodiment of the present application, when the computer program is executed by a processor, the following steps are further implemented:
[0137] According to the labeled character information, the characters in the labeled character information are converted into preset texture images; the pixels in the preset texture images are represented in the form of directed distances; and the preset texture images are merged to generate a preset texture image set.
[0138] In one embodiment of the present application, the preset texture image includes texture images corresponding to different character formats, and the character format includes at least one of font, font size, and color;
[0139] When the computer program is executed by the processor, the following steps are also performed:
[0140] For each character format, a preset texture image corresponding to the character format is obtained; the preset texture images corresponding to the character formats are merged to generate a preset texture image set corresponding to each character format.
[0141] In one embodiment of the present application, the rendering information of the character to be marked includes the character format;
[0142] When the computer program is executed by the processor, the following steps are also performed:
[0143] A preset texture image set corresponding to the character format is determined as a target preset texture image set; and a reference texture image corresponding to the character to be annotated is obtained from the target preset texture image set.
[0144] In one embodiment of the present application, the rendering information of the character to be marked includes size information and coordinate information of the character to be marked in the scene graph;
[0145] When the computer program is executed by the processor, the following steps are also performed:
[0146] According to the size information of the characters to be marked in the scene graph, a grid corresponding to the size information is created in the scene graph; a reference texture image is placed in the grid for rendering, and a scene graph including the characters to be marked is generated.
[0147] In one embodiment of the present application, when the computer program is executed by a processor, the following steps are further implemented:
[0148] Obtain an initial grid; scale the initial grid according to the size information of the character to be annotated in the scene graph to generate a target grid corresponding to the character to be annotated; create a target grid in the scene graph according to the coordinate information of the character to be annotated in the scene graph.
[0149] The computer-readable storage medium provided in this embodiment has similar implementation principles and technical effects to those of the above-mentioned method embodiment, and will not be described in detail here.
[0150] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0151] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0152] The above embodiments merely illustrate several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the patent application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be determined by the appended claims.
Claims
1. A character rendering method, characterized in that: Applied to a power geographic information system, the method includes: Determining character information to be marked from the scene graph of the electric power geographic information system; the character information to be marked includes the character to be marked and rendering information of the character to be marked; the rendering information of the character to be marked includes size information and coordinate information of the character to be marked in the scene graph; According to the rendering information of the character information to be annotated, a reference texture image corresponding to the character to be annotated is obtained from a preset texture image set; the preset texture image set corresponds to the electric power geographic information system, and the preset texture image set includes a plurality of preset texture images; Creating a grid corresponding to the size information in the scene graph according to the size information and coordinate information of the character to be marked in the scene graph; Placing the reference texture image in the grid for rendering to generate the scene graph including the characters to be marked; The process of generating the preset texture image set includes: Acquire historical ledger information and historical operation information of power equipment in the power geographic information system; the power equipment includes at least one of power generation equipment, transmission lines, substations, and distribution lines; Acquire, from the historical record information and the historical operation information of the power equipment, the labeling character information corresponding to the power equipment; the labeling character information includes the identification and parameters of the power equipment; generating the preset texture image according to the marked character information, and obtaining the preset texture image set based on the preset texture image; The acquiring, according to the rendering information of the character information to be marked, a reference texture picture corresponding to the character to be marked from a preset texture picture set includes: According to the rendering information of the character to be marked and the texture coordinates of the texture image of the character to be marked in the preset texture image set, a reference texture image corresponding to the character to be marked is obtained from the preset texture image set.
2. The method according to claim 1, characterized in that Generating the preset texture picture according to the marked character information, and obtaining the preset texture picture set based on the preset texture picture, includes: According to the labeled character information, the characters in the labeled character information are converted into a preset texture image; the pixels in the preset texture image are represented in the form of directed distance; The preset texture pictures are merged to generate the preset texture picture set.
3. The method according to claim 2, characterized in that The preset texture images include texture images corresponding to different character formats, where the character formats include at least one of font, font size, and color. The merging of the preset texture images to generate the preset texture image set includes: For each character format, obtaining a preset texture image corresponding to the character format; The preset texture images corresponding to the character formats are merged to generate a set of preset texture images corresponding to each of the character formats.
4. The method according to any one of claims 1 to 3, characterized in that The rendering information of the character to be annotated includes a character format; and obtaining a reference texture image corresponding to the character to be annotated from a preset texture image set according to the rendering information of the character to be annotated includes: Determining the preset texture picture set corresponding to the character format as a target preset texture picture set; A reference texture image corresponding to the character to be marked is obtained from the target preset texture image set.
5. The method according to claim 1, wherein The step of creating a grid corresponding to the size information in the scene graph according to the size information and coordinate information of the character to be marked in the scene graph includes: Get the initial grid; Scaling the initial grid according to size information of the character to be annotated in the scene graph to generate a target grid corresponding to the character to be annotated; The target grid is created in the scene graph according to the coordinate information of the character to be marked in the scene graph.
6. A character rendering device, characterized in that: The device comprises: A determination module is used to determine character information to be marked from a scene graph of the electric power geographic information system; the character information to be marked includes the character to be marked and rendering information of the character to be marked; the rendering information of the character to be marked includes size information and coordinate information of the character to be marked in the scene graph; A first acquisition module is configured to acquire, based on the rendering information of the character information to be annotated, a reference texture image corresponding to the character to be annotated from a preset texture image set; the preset texture image set corresponds to the electric power geographic information system, and the preset texture image set includes a plurality of texture images; A first generating module is configured to create a grid corresponding to the size information of the character to be annotated in the scene graph based on the size information and coordinate information of the character to be annotated in the scene graph; place the reference texture image in the grid for rendering, and generate the scene graph including the character to be annotated; The process of generating the preset texture image set includes: Acquire historical ledger information and historical operation information of power equipment in the power geographic information system; the power equipment includes at least one of power generation equipment, transmission lines, substations, and distribution lines; Acquire, from the historical record information and the historical operation information of the power equipment, the labeling character information corresponding to the power equipment; the labeling character information includes the identification and parameters of the power equipment; generating the preset texture image according to the marked character information, and obtaining the preset texture image set based on the preset texture image; The acquiring, according to the rendering information of the character information to be marked, a reference texture picture corresponding to the character to be marked from a preset texture picture set includes: According to the rendering information of the character to be marked and the texture coordinates of the texture image of the character to be marked in the preset texture image set, a reference texture image corresponding to the character to be marked is obtained from the preset texture image set.
7. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium, characterized in that A computer program is stored thereon, and when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Method of rendering text in three-dimensional scene
CN106683189A
Character string display processing method and apparatus, terminal, and storage medium
US20220021949A1