License plate rendering method and apparatus

By pre-generating the background and character textures of license plates, 3D objects are directly synthesized, solving the problem of low rendering efficiency when there is heavy traffic and achieving high frame rate and a good visual experience.

CN116994237BActive Publication Date: 2026-02-03ZHEJIANG SUPCON INFORMATION TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202311010476.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-11
Publication Date
2026-02-03
Estimated Expiration
2043-08-11

AI Technical Summary

Technical Problem

In scenarios with heavy traffic, existing technologies struggle to effectively improve the rendering efficiency of license plate images, leading to a decrease in frame rate and impacting the user's visual experience.

Method used

By pre-generating background and character textures, the 3D object of the license plate is directly captured and synthesized from the image, avoiding temporary rendering and improving rendering efficiency.

Benefits of technology

Maintaining a high frame rate in high traffic scenarios enhances the user's visual experience and significantly reduces device resource consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116994237B_ABST
    Figure CN116994237B_ABST
Patent Text Reader

Abstract

The application discloses a license plate rendering method and device, and the method comprises the following steps: obtaining a target license plate type and a target license plate number of a target license plate which needs to be rendered; collecting a background map corresponding to the target license plate type from a first image generated in advance, and collecting a character map corresponding to a target character from a second image generated in advance, the target character referring to a character constituting the target license plate number; synthesizing a three-dimensional object of the target license plate according to a license plate background map, the character map and a geometric body corresponding to the target license plate; and displaying the three-dimensional object of the target license plate on a screen.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of image rendering technology, and in particular relates to a license plate rendering method and apparatus. Background Technology

[0002] Digital traffic systems are an auxiliary technology in the field of traffic management. This technology aims to use cameras and sensors to collect real-time road data, process and analyze this data using algorithms, and then display the processing and analysis results on a screen in a visual interface, thereby facilitating traffic scheduling.

[0003] One challenge of this technology is that in scenarios with high traffic volume, such as rush hour or large intersections, the large number of vehicles and pedestrians gathered on the road increases the resource consumption of electronic devices used for visualization rendering, resulting in a decrease in the rendering frame rate and a poor visual experience for users viewing the visualization interface. Summary of the Invention

[0004] Therefore, this application discloses a license plate rendering method and apparatus to improve the rendering efficiency of license plate images in digital traffic road technology and enhance the user's visual experience.

[0005] The first aspect of this application provides a license plate rendering method, including:

[0006] Obtain the target license plate type and target license plate number of the target license plate to be rendered;

[0007] The background texture corresponding to the target license plate type is collected from a pre-generated first image, and the character texture corresponding to the target character is collected from a pre-generated second image, wherein the target character refers to the characters that make up the target license plate number;

[0008] The three-dimensional object of the target license plate is synthesized based on the license plate background texture, the character texture, and the geometry corresponding to the target license plate.

[0009] Display a three-dimensional object of the target license plate on the screen.

[0010] Optionally, before obtaining the target license plate type and target license plate number of the target license plate to be rendered, the process further includes:

[0011] Determine the color and aspect ratio corresponding to each type of license plate;

[0012] For each license plate type, a background texture corresponding to the license plate type is rendered according to the color and aspect ratio of the license plate type.

[0013] The background textures corresponding to each license plate type are arranged sequentially onto an image to obtain the first image.

[0014] Optionally, before obtaining the target license plate type and target license plate number of the target license plate to be rendered, the process further includes:

[0015] Identify each candidate character that can be used in the license plate number;

[0016] Render each candidate character to obtain a character texture corresponding to each candidate character;

[0017] The character textures corresponding to each candidate character are arranged sequentially onto an image to obtain the second image.

[0018] Optionally, before synthesizing the 3D object of the target license plate based on the license plate background texture, the character texture, and the geometry corresponding to the target license plate, the method further includes:

[0019] Based on the number of digits in the target license plate number, select the geometry corresponding to the target license plate from a plurality of pre-created candidate geometries.

[0020] Optionally, after displaying the three-dimensional object of the target license plate on the screen, the method further includes:

[0021] Receive adjustment instructions;

[0022] The pose of the three-dimensional object of the target license plate displayed on the screen is adjusted according to the adjustment instruction.

[0023] A second aspect of this application provides a license plate rendering device, comprising:

[0024] The acquisition unit is used to obtain the target license plate type and target license plate number of the target license plate to be rendered;

[0025] The acquisition unit is used to acquire a background texture corresponding to the target license plate type from a pre-generated first image, and to acquire a character texture corresponding to the target character from a pre-generated second image, wherein the target character refers to the characters that make up the target license plate number;

[0026] A compositing unit is used to compose a three-dimensional object of the target license plate based on the license plate background texture, the character texture, and the geometry corresponding to the target license plate.

[0027] The display unit is used to display a three-dimensional object of the target license plate on the screen.

[0028] Optionally, a generation unit may also be included, for:

[0029] Determine the color and aspect ratio corresponding to each type of license plate;

[0030] For each license plate type, a background texture corresponding to the license plate type is rendered according to the color and aspect ratio of the license plate type.

[0031] The background textures corresponding to each license plate type are arranged sequentially onto an image to obtain the first image.

[0032] Optionally, the generation unit is further configured to:

[0033] Identify each candidate character that can be used in the license plate number;

[0034] Render each candidate character to obtain a character texture corresponding to each candidate character;

[0035] The character textures corresponding to each candidate character are arranged sequentially onto an image to obtain the second image.

[0036] Optionally, a selection unit may also be included for:

[0037] Based on the number of digits in the target license plate number, select the geometry corresponding to the target license plate from a plurality of pre-created candidate geometries.

[0038] Optionally, the display unit is further configured to:

[0039] Receive adjustment instructions;

[0040] The pose of the three-dimensional object of the target license plate displayed on the screen is adjusted according to the adjustment instruction.

[0041] The beneficial effects of this plan are as follows:

[0042] When rendering the 3D object of the target license plate, the background texture and character texture of the 3D object constituting the target license plate can be obtained directly from the pre-generated first and second images, without having to generate the background texture and character texture temporarily through rendering. This can improve the rendering efficiency of the 3D object of the target license plate, save the device resources required for rendering, and thus maintain a sufficiently high frame rate in scenes with heavy traffic, thereby improving the visual experience of users viewing the visualization interface. Attached Figure Description

[0043] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0044] Figure 1 This is a flowchart of a license plate rendering method provided in an embodiment of this application;

[0045] Figure 2 This is a schematic diagram of a pre-created geometry provided in an embodiment of this application;

[0046] Figure 3 This is a schematic diagram of a first image composed of background textures corresponding to various license plate types, provided in an embodiment of this application.

[0047] Figure 4 This is a schematic diagram of a second image composed of character textures of multiple candidate characters provided in an embodiment of this application;

[0048] Figure 5 This is a schematic diagram of the structure of a license plate rendering device provided in an embodiment of this application. Detailed Implementation

[0049] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0050] To facilitate understanding of the technical solution of this application, some terms that may be involved in this application will be explained first.

[0051] A mesh represents a renderable 3D object, including its geometry, materials, and some of its transformation properties.

[0052] Geometry is a set of data that represents the structure of a three-dimensional model. It is usually represented by vertices or vertices plus indices. Each vertex represents a point on the three-dimensional object. It is usually in two-dimensional or three-dimensional form. Two-dimensional is expressed as [x,y] and three-dimensional is expressed as [x,y,z]. Three vertices can form a triangle. Every three-dimensional object is composed of several triangles.

[0053] Material refers to the texture of an object. Material can be seen as a combination of material and texture, and it is generally composed of a set of parameters, images, and shader language.

[0054] A 3D rendering engine is an image processing software used to generate 3D scene images based on input data.

[0055] Three-dimensional object data refers to the mesh data that constitutes a three-dimensional object. Furthermore, it may also include the following transformation data related to the mesh of the three-dimensional object.

[0056] Frame rate refers to the number of times a scene is rendered per second. Common browsers have a frame rate of 60 frames per second, but when a browser's performance is poor, the frame rate may be lower than 60 frames per second. A frame rate that is too low, such as below 30 frames per second, will result in a poor visual experience.

[0057] Over-drawcall, or excessive rendering, occurs when a graphics processing unit (GPU) is designed as a multi-threaded processor with a significantly larger number of processing chips than a central processing unit (CPU). Therefore, if the GPU renders only one 3D object at a time, it's essentially processing data serially. This prevents the GPU from utilizing its multi-core parallel processing capabilities, wasting its processing power and leading to a sharp decline in rendering performance.

[0058] HTML bubble mode refers to a 3D panel implemented using CSS3 (Cascading Style Sheets) 3D styles and HTML code. Various Document Object Models (DOMs) can be added to this 3D panel using HTML.

[0059] UV mapping is a set of data used to establish a one-to-one correspondence between surfaces and images when applying textures to the surface of a 3D model.

[0060] An Attribute is an instantiated object defined in the OpenGL Shading Language (GLSL). This instantiated object is a data structure used to accept the data that makes up a 3D object, which typically includes vertex data, normal data, UV data, etc.

[0061] Instantiated attributes can be understood as the attribute values ​​in the aforementioned instantiated object Attribute. Instantiation is a technique in 3D rendering. Its advantage is that the same 3D object can be drawn once, resulting in multiple identical objects. Here, the GPU stores the Attribute object corresponding to this object, as well as a set of instantiated Attribute objects. When the vertex shader calculates, it will take different values ​​for two different attributes. The first is to obtain the value one by one according to the order of the vertices, and the second is to obtain the value once for each 3D object drawn. This value will be shared by each vertex object.

[0062] Please see Figure 1 The following is a flowchart of a license plate rendering method provided in an embodiment of this application. The method may include the following steps.

[0063] The execution subject of this embodiment can be a computer program (hereinafter referred to as the program).

[0064] It should be noted that the target license plate in this embodiment may include the license plate of one or more specific cars traveling on the road, or it may include the license plate of every car traveling on the road.

[0065] When there are multiple target license plates, for each target license plate, the program generates and displays a 3D object of the license plate on the screen in the following manner.

[0066] S101, obtain the target license plate type and target license plate number of the target license plate to be rendered.

[0067] S102, collect the background texture corresponding to the target license plate type from the pre-generated first image, and collect the character texture corresponding to the target character from the pre-generated second image.

[0068] The target character refers to the characters that make up the target license plate number.

[0069] S103: Based on the license plate background texture, character texture, and the geometry corresponding to the target license plate, synthesize the 3D object of the target license plate.

[0070] S104, Display the three-dimensional object of the target license plate on the screen.

[0071] Before executing the license plate rendering method provided in this embodiment, the following preparation process can be performed first to obtain at least some of the data required for the execution of the license plate rendering method in this embodiment.

[0072] The preparation process may include steps such as constructing geometry, preparing the background texture of the license plate, preparing the character texture of the license plate, preparing the license plate number attribute, preparing the license plate number attribute queue, initializing the character color attribute, initializing the position transformation and rotation attribute matrix, generating the background UV data structure, and generating the character UV data structure.

[0073] The specific implementation methods for each step of the above preparation process are as follows.

[0074] Construct the geometry.

[0075] First, determine the width-to-height ratio of the license plate. Set the width of the license plate geometry to 1, and determine the height based on the width and width-to-height ratio. This gives you the width and height of the license plate geometry.

[0076] The number of digits in the license plate number is determined according to the relevant traffic regulations of the city. For example, according to the relevant traffic regulations, the allowed number of digits in a license plate can be 7 or 8. Therefore, a corresponding geometry can be generated for a 7-digit license plate number and a corresponding geometry can be generated for an 8-digit license plate number.

[0077] The city in question refers to the city where digital transportation road-assisted traffic management is needed.

[0078] In this embodiment, the number of digits in a license plate number can be understood as the total number of characters contained in a license plate number. These characters can be text, letters, or numbers.

[0079] For example, in the case of a license plate number with 7 digits, it can be constructed as follows: Figure 2 The geometry consists of 7 rectangular regions as shown in (1); in the case of an 8-digit license plate number, a geometry can be constructed as shown in (1). Figure 2 The license plate geometry is composed of eight rectangular regions as shown in (2).

[0080] exist Figure 2 In the aforementioned geometry, each small rectangular region corresponds to a character in the license plate number. The size and position of the rectangular region are determined based on the width and height of the license plate geometry, the left, top, right, and bottom margins of the rectangular region from the license plate geometry, and the number of rectangular regions.

[0081] Optionally, each rectangular region in the license plate geometry can be offset by a certain amount in the Z-coordinate to ensure that the Z-coordinate of the rectangular region deviates from the Z-coordinate of the license plate geometry during rendering, thus avoiding coplanarity and interference. The Z-coordinate axis can be considered as a coordinate axis perpendicular to the screen direction.

[0082] Thus, the geometry for displaying license plates with different numbers of digits is obtained. Combining the previous examples, when the license plate number can be 7 or 8 digits, the above method can be used to construct a geometry like... Figure 2 As shown in (1), the geometry corresponding to the 7-digit number, and as Figure 2 As shown in (2), the geometry corresponds to the number of 8 digits of the number.

[0083] Prepare the background image for the license plate.

[0084] The purpose of this step is to generate a background texture for each type of license plate based on its color and aspect ratio, and then arrange the background textures of different types of license plates one by one onto a first image of a preset size (e.g., 256*256).

[0085] This step may specifically include:

[0086] A1. Determine the color and aspect ratio corresponding to each type of license plate;

[0087] A2, for each license plate type, renders the background texture corresponding to the license plate type based on the color and aspect ratio of the license plate type;

[0088] A3 arranges the background textures corresponding to each license plate type onto a single image in sequence to obtain the first image.

[0089] In step A1, the color and aspect ratio corresponding to each license plate type can be obtained from the traffic regulations of the city.

[0090] The aspect ratio can be a fixed value.

[0091] For example, traffic regulations stipulate that license plates for large vehicles should have a yellow background and black lettering, so the color corresponding to this type of license plate is yellow. Similarly, regulations stipulate that license plates for small vehicles should have a blue background and white lettering, so the color corresponding to this type of license plate is blue.

[0092] In step A2, for each license plate type, the color and aspect ratio of that license plate type can be input into any existing texture generation tool to generate a background texture corresponding to that license plate type.

[0093] In step A3, you can first create an image with a preset size, such as a 256-pixel * 256-pixel image. Then, copy the background texture of each license plate type onto the image one by one in sequence. The final image containing the background textures corresponding to various license plate types is the first image.

[0094] For example, the generated first image can be as follows: Figure 3 As shown, Figure 3 (1) in the text is equivalent to a background texture of a certain license plate type.

[0095] In the first image, different background textures can maintain a certain interval in width and height, for example, a 30-pixel interval (or other values).

[0096] Generate background UV data structure.

[0097] This step can be performed after the step of preparing the license plate background image is completed.

[0098] After generating the first image, the UV data of the background texture for each license plate type on that first image can be recorded.

[0099] For any license plate type background texture, its UV data can be represented in vector form as [u, v, s, t]. Here, u and v represent the x-coordinate and y-coordinate of the starting position of the background texture on the first image. The starting position of the background texture can be specified as the position of the top-left corner, the top-right corner, or other points on the background texture, such as the center point or the bottom-right corner. s represents the width of the background texture, and t represents its height.

[0100] After obtaining the UV data for each license plate type, these UV data and the first index number corresponding to the license plate type can be recorded in a specific format to obtain a background UV data structure that records the UV data of the background texture for each license plate type in the first image. For example, the background UV data structure can be represented in the following form.

[0101]

[0102] Wherein, 01, 02, 52 represent the first index number of different license plate types. For example, 01 represents the license plate of a large vehicle, 02 represents the license plate of a small vehicle, and 52 represents the license plate of a small new energy vehicle. Correspondingly, [u1, v1, s1, t1] are the UV data of the background texture of the license plate of a large vehicle on the first image, [u2, v2, s2, t2] are the UV data of the background texture of the license plate of a small vehicle on the first image, and so on.

[0103] The first index number corresponding to different license plate types can be determined according to the traffic regulations of the city or according to other rules, as long as the first index number and the license plate type correspond one-to-one, there is no restriction.

[0104] Prepare the character textures for the license plate.

[0105] This step may include:

[0106] B1, determine each candidate character that can be used for the license plate number;

[0107] B2 renders each candidate character to obtain the character texture corresponding to each candidate character;

[0108] B3 arranges the character textures corresponding to each candidate character sequentially onto an image to obtain the second image.

[0109] In step B1, each candidate character that may be used on the license plate number can be obtained according to the relevant traffic regulations of the city.

[0110] Exemplarily, according to relevant traffic regulations, the characters that can be used on a license plate number can include 0 to 9, and 24 English letters except I and O. Then, in step B1, 0 to 9 and the 24 English letters except I and O can be determined as candidate characters.

[0111] In step B2, any existing rendering tool can be used to render each candidate character to obtain a character texture map corresponding to each candidate character. Exemplarily, a character texture map can be generated using Canvas.

[0112] Optionally, when generating the character texture map, each character texture map can be repeatedly drawn multiple times, and a transition of the transparency of the character edge can be set for each character texture map. The advantage of doing this is to avoid phenomena such as fringing at the edges of the character texture map when the character texture maps are synthesized into the second image.

[0113] For the generated character texture maps of the candidate characters, it should be ensured that when displayed, the characters are clearly visible at different scaling ratios.

[0114] After obtaining the character texture maps of each candidate character, referring to step A3, these character texture maps are arranged one by one in a certain order and interval on an image with a preset size, and the second image containing the character texture maps of each candidate character is obtained.

[0115] Optionally, the second image can have a transparent background.

[0116] Exemplarily, the second image generated by the above method can be as Figure 4 shown, where the patterns such as "Meng", "Liao", "A", etc. are the character texture maps of the candidate characters.

[0117] Generate the character UV data structure.

[0118] This step can be executed after the step of preparing the character texture maps of the license plate is completed.

[0119] After obtaining the second image, according to the preset character coding rule, each candidate character in it can be numbered to determine the corresponding second index number for each candidate character, and there is a one-to-one correspondence between the second index number and the candidate character.

[0120] Record the UV data of each candidate character in the second image. The UV data of the candidate characters is the same as the UV data of the background texture maps of different types of license plates mentioned above, and can be represented by a vector in the form of [u, v, s, t]. u and v represent the abscissa and ordinate of the starting position of the character texture map, and s and t represent the width and height of the character texture map. The starting position of the character texture map can be the position of any specific point such as the upper left vertex, the lower right vertex, and the center point of the character texture map.

[0121] After obtaining the UV data of each candidate character, these UV data and the second index number corresponding to the candidate character can be recorded in a certain data format, thereby obtaining a character UV data structure record containing the UV data and the second index number of each candidate character. Exemplarily, the character UV data structure can be represented in the following form.

[0122]

[0123] Among them, "Jing" and "Jin" represent the candidate characters on the second image. The second index number corresponding to "Jing" is 0, and the UV data is [0, 0, 26, 26]. The second index number corresponding to "Jin" is 1, and the UV data is [26, 0, 26, 26], and so on.

[0124] Prepare the license plate number attribute.

[0125] In this step, the maximum number of license plate instantiation objects input by the user can be obtained. According to this maximum number, numbers for multiple license plate instantiation objects are generated sequentially, and these numbers can be stored in the license plate number attribute queue.

[0126] Exemplarily, the first number is 0, the second is 1, the third is 2, and so on, used to obtain different license plate backs.

[0127] Prepare the license plate number attribute queue.

[0128] In this step, the license plate number attribute queue of each license plate instantiation object can be initialized. The license plate number attribute queue is used to store the second index number corresponding to each character in the license plate number. In the initialization stage, the license plate number attribute queue of each license plate instantiation object can be initialized to 0. So that after obtaining the license plate number corresponding to the license plate instantiation object, according to the characters included in this license plate number, the second index numbers corresponding to these characters are stored in the license plate number attribute queue.

[0129] Exemplarily, assume that the license plate number corresponding to a license plate instantiation object is "Jing A12345". The second index number of Jing is 0, the second index number of A is 45, the second index number of "1" is 35, the second index number of "2" is 36, the second index number of "3" is 37, the second index number of "4" is 38, and the second index number of "5" is 39. Then 0, 45, 35, 36, 37, 38, 39 are added to the license plate number attribute queue of this license plate instantiation object in sequence.

[0130] Initialize the character color attribute.

[0131] The text color of a license plate is usually white or black. The color is represented by three RGB channels. Each channel has a value range of 0 to 1. The text color code for white is [1, 1, 1], and the text color code for black is [0, 0, 0]. By default, the text color code of a license plate instance is set to [0, 0, 0].

[0132] Initialize the position transformation and rotation attribute matrices.

[0133] The position transformation and rotation attribute matrix, or simply the pose matrix, is typically provided for each instantiated object in instantiation rendering. This matrix can be a 4x4 matrix. By setting the values ​​of the elements in this matrix, the position, rotation, and scaling of each instantiated object can be set. By default, during the initialization phase, the values ​​of the scaling-related elements in this matrix are all set to 0, so that the license plate corresponding to the license plate instantiated object is not displayed on the screen.

[0134] After completing the above preparation process, you can execute the operation based on the data obtained through the preparation process. Figure 1 The method of the corresponding embodiment is described below, with the specific execution process of each step in the method explained.

[0135] In step S101, the target license plate type and target license plate number can be obtained in various ways.

[0136] One possible method is to capture images of vehicles on the road using a camera to obtain road images containing the target license plate, and then use a pre-built first recognition model to identify the type of vehicle on the road image to obtain the target license plate type.

[0137] For example, by using the first recognition model to process the road image, the vehicle to which the target license plate belongs is identified as a large vehicle, and thus the target license plate type is determined to be a large vehicle.

[0138] On the other hand, a pre-built second recognition model is used to process the road image, thereby identifying the target license plate number of the target license plate displayed in the road image.

[0139] The first and second recognition models can be neural network models pre-trained using relevant sample data to identify vehicle types and license plate numbers.

[0140] The target license plate type can also be determined based on the background color of the target license plate in the road image and relevant traffic regulations. For example, by identifying the background color of the target license plate, and according to relevant traffic regulations, the license plates of large vehicles are yellow with black characters, thus determining that the target license plate type corresponds to a large vehicle.

[0141] The specific implementation process of S102 is as follows.

[0142] First, create a blank license plate instance corresponding to the target license plate. Based on the total number of license plates, randomly obtain a number from the license plate number attribute queue. Use this number as the index number of the target license plate instance (also known as the target license plate index). Create a corresponding license plate instance. Set the values ​​of all scaling-related elements in the pose matrix of this license plate instance to 1, making the license plate instance visible on the screen. At this point, a blank license plate instance has been created.

[0143] Set the license plate background property of the license plate instantiated object. After obtaining the type of the target license plate, set the value of the license plate background property in the license plate instantiated object to the first index number corresponding to the target license plate type.

[0144] Set the license plate characters. Obtain the target license plate number, and according to the aforementioned character encoding rules, determine each character in the target license plate number, that is, determine the second index number corresponding to each target character. Add these second index numbers to the license plate number attribute queue of the license plate instantiated object.

[0145] Optionally, when adding, the corresponding second index number can be added to the license plate number attribute queue in the order of each target character in the target license plate number.

[0146] The background UV data structure and character UV data structure generated earlier can be pre-stored in a shader (e.g., a shader) that runs on a GPU. The shader can be divided into two parts: a vertex shader and a fragment shader.

[0147] After completing the above settings, the program passes the license plate instance corresponding to the target license plate to the vertex shader. The vertex shader determines the coordinate data of the vertices of the license plate instance based on the instance, as well as the first index number and the second index number contained therein.

[0148] The coordinate data of the vertices of the license plate instantiated object can be determined based on the geometry corresponding to the target license plate and the position of the target license plate on the road.

[0149] The geometry corresponding to the target license plate can be generated by the vertex shader, or it can be selected by the vertex shader from the pre-built geometry. The selection method can be:

[0150] Based on the number of digits in the target license plate number, select the geometry corresponding to the target license plate from a number of pre-created candidate geometries.

[0151] Combination Figure 2For example, if the target license plate number has 7 digits, then select... Figure 2 The geometry shown in (1) is used as the geometry corresponding to the target license plate. If the target license plate number has 8 digits, then select... Figure 2 The geometry shown in (2) is used as the geometry corresponding to the target license plate.

[0152] The vertex shader obtains a first index number and a second index number. Based on the first index number, the vertex shader calls its method to obtain the UV data of the target license plate type corresponding to that first index number from the aforementioned background UV structure data. Based on the second index number, the vertex shader calls its method to obtain the UV data of the target character corresponding to each second index number from the aforementioned character UV structure data. Then, the vertex shader passes the obtained UV data of the target license plate type and the UV data of each target character to the fragment shader.

[0153] The fragment shader samples the background texture data corresponding to the target license plate type from the first image based on the obtained UV data of the target license plate type; and samples the character texture corresponding to each target character from the second image based on the obtained UV data of each target character.

[0154] The specific implementation method of S103 is as follows.

[0155] The fragment shader performs a fusion calculation on the background texture corresponding to the target license plate type captured from the first image and the character texture corresponding to the target character captured from the second image to obtain the texture data of the 3D object of the target license plate. Then, it combines the texture data with the geometry of the target license plate provided by the vertex shader to obtain the 3D object of the target license plate.

[0156] The vertex shader also accepts instantiated color and position transformation properties, applies the position transformation properties to each license plate, and passes the color properties to the fragment shader.

[0157] In some alternative embodiments, the vertex shader may also accept color attributes from the license plate instantiated object and pass the color attributes to the fragment shader. In this case, the fragment shader can adjust the color of the character map of the target character based on the base color data carried in the color attributes.

[0158] For example, in some license plate numbers, the color of certain characters might be red or another color, inconsistent with the default character color. In this case, the program can set the color attribute of the corresponding character to the appropriate color before passing the license plate instantiator to the vertex shader, for example, setting the color attribute to red. The vertex shader then passes the set color attribute to the fragment shader, which, based on the color attribute, changes the color of the character texture of the specific character from the default color to the color indicated by the color attribute, for example, changing it to red.

[0159] After the adjustment is completed, the fragment shader merges the background texture corresponding to the target license plate type and the character texture corresponding to the target character after color attribute adjustment to obtain texture data for attaching to the 3D object of the target license plate.

[0160] For details on the specific process of merging multiple textures into texture data and combining texture data with geometry to form a 3D object, please refer to relevant existing technologies, which will not be elaborated here.

[0161] For a detailed implementation of S104, please refer to the relevant prior art, which will not be repeated here.

[0162] In some optional embodiments, after displaying the 3D object of the target license plate, the 3D object of the target license plate can be rotated or moved. The specific process is as follows:

[0163] Receive adjustment instructions;

[0164] The pose of the 3D object of the target license plate displayed on the screen is adjusted according to the adjustment instructions.

[0165] Moving and rotating a license plate involves finding the instantiated object of the license plate based on its index number, modifying the pose matrix of that instantiated object, and changing the values ​​of various parameters in that matrix. As a result, the license plate will move and rotate accordingly.

[0166] Adjustment commands can be entered by the user using input devices such as a keyboard and mouse.

[0167] The method for adjusting the pose of the 3D object of the target license plate displayed on the screen according to the adjustment command is as follows:

[0168] The index number of the license plate whose pose needs to be adjusted is obtained from the adjustment command. The movement and rotation interface is called. The license plate instance object whose pose needs to be adjusted is found according to the index number. According to the pose adjustment data input from the interface, the values ​​of the elements in the pose matrix of the license plate instance object are adjusted. Thus, the license plate displayed on the screen can move with the vehicle through data drive.

[0169] Position adjustment includes at least one of rotating license plate and moving license plate, and position adjustment data includes at least one of rotation angle data and movement distance data.

[0170] The pose adjustment data can be obtained from the adjustment instructions mentioned above.

[0171] Furthermore, the program can control the display or hiding of the 3D license plate object on the screen based on the user's input display control commands.

[0172] The display control command is used to control whether the specified license plate instantiated object is displayed on the screen or hidden on the screen.

[0173] The program obtains display control instructions for license plate instantiated objects through the show / hide interface. When the display control instruction instructs that the 3D object of the license plate be displayed on the screen, the value of the scaling-related element in the pose matrix of the specified license plate instantiated object can be set to 1, causing the specified license plate instantiated object to be displayed on the screen; when the display control instruction instructs that the 3D object of a license plate be hidden on the screen, the value of the scaling-related element in the pose matrix of the specified license plate instantiated object can be set to 0, causing the specified license plate instantiated object to be displayed on the screen.

[0174] Optionally, when the license plate instance is displayed on the screen, the program can record the values ​​of the scaling-related elements in the pose matrix at this time. When the license plate instance is restored from the hidden state to the displayed state, the scaling-related elements in the pose matrix can be set back to the previously recorded values, so that the license plate instance can be displayed on the screen in the original way.

[0175] Optionally, the above values ​​can be recorded in positions in the pose matrix that are unrelated to scaling, such as positions 04, 14, and 24 in the pose matrix.

[0176] Optionally, the program also has an instantiation object destruction function. When the user exits the program, the program calls the destruction interface to destroy the created license plate instantiation object and release memory and video memory.

[0177] Optionally, the program also has the function of deleting license plates. After receiving the deletion command input by the user, the program finds the license plate instance object to be deleted based on the index number carried by the deletion command, and sets the values ​​of the scaling-related elements in the pose matrix of the license plate instance object to 0. At this time, the license plate corresponding to the instance object will no longer be displayed on the screen.

[0178] The beneficial effects of this plan are as follows:

[0179] When rendering the 3D object of the target license plate, the background texture and character texture of the 3D object constituting the target license plate can be obtained directly from the pre-generated first and second images, without having to generate the background texture and character texture temporarily through rendering. This can improve the rendering efficiency of the 3D object of the target license plate, save the device resources required for rendering, and thus maintain a sufficiently high frame rate in scenes with heavy traffic, thereby improving the visual experience of users viewing the visualization interface.

[0180] For example, suppose there are 500 cars on the road during peak hours. When displaying the license plate of each car, the existing rendering solution needs to perform the following steps for each license plate: render the background texture of the license plate, render the character texture of the license plate number, merge the background texture and character texture, and combine the merged texture with the geometry. This is equivalent to rendering the background texture and the license plate number character texture 500 times, resulting in excessive resource consumption, reduced rendering efficiency, and reduced frame rate.

[0181] When rendering license plates of 500 cars using this solution, the pre-rendered background and character textures can be directly read from the first and second images, eliminating the need to repeatedly render the background and character textures. This results in a performance improvement of approximately (n-1) / n*100%, where n is the number of license plates to be rendered, for example, 500. This significantly reduces resource consumption, thereby improving rendering efficiency and increasing the display frame rate.

[0182] Furthermore, this solution can adjust the position and orientation of the license plate's 3D object according to adjustment commands, so that the license plate's 3D object follows the vehicle's movement, ensuring that the license plate is always facing the user viewing the screen.

[0183] Through actual experimental comparison, applying the rendering method provided in this embodiment on an NVIDIA Quadro P2200 graphics card can render and display up to 400,000 license plates simultaneously while maintaining a frame rate of 58-60 frames per second. If the license plates are animated (meaning the license plates can rotate, move, and scale independently), up to 220,000 can be rendered simultaneously.

[0184] In contrast, existing sprite-based rendering methods can only render a maximum of 5700 sprites at the same time, while existing HTML bubble rendering methods can render a maximum of 500 sprites at the same time.

[0185] As can be seen, applying this solution can improve rendering performance by 300-500 times.

[0186] The license plate rendering method provided in this embodiment can be applied to front-end devices or used on the user's local computer device.

[0187] The license plate rendering method in this embodiment can be implemented by the browser of a computer device through the HTML5 feature of the Web Graphics Library (WebGL). The algorithm calculation part can be calculated on the CPU using Javascript, and the rendering part can be calculated using GLSL language in the shader running on the GPU.

[0188] The advantage of doing this is that it offloads some of the main thread's computational processes to the GPU, greatly improving the rendering frame rate and avoiding poor visual effects caused by the computer's poor CPU performance.

[0189] According to the license plate rendering method provided in the embodiments of this application, the embodiments of this application also provide a license plate rendering device. Please refer to [link to relevant documentation]. Figure 5 This is a schematic diagram of the structure of the device, which may include the following units.

[0190] Unit 501 is used to obtain the target license plate type and target license plate number of the target license plate to be rendered;

[0191] The acquisition unit 502 is used to acquire a background texture corresponding to the target license plate type from a pre-generated first image, and to acquire a character texture corresponding to the target character from a pre-generated second image, wherein the target character refers to the character that makes up the target license plate number;

[0192] The compositing unit 503 is used to compose a three-dimensional object of the target license plate based on the license plate background texture, character texture, and the geometry corresponding to the target license plate.

[0193] Display unit 504 is used to display a three-dimensional object of the target license plate on the screen.

[0194] Optionally, the device further includes a generating unit 505, used for:

[0195] Determine the color and aspect ratio corresponding to each type of license plate;

[0196] For each license plate type, a background texture corresponding to the license plate type is rendered based on the color and aspect ratio of the license plate type.

[0197] Arrange the background textures corresponding to each license plate type sequentially onto a single image to obtain the first image.

[0198] Optionally, the generating unit 505 is also used for:

[0199] Identify each candidate character that can be used in the license plate number;

[0200] Render each candidate character to obtain the character texture corresponding to each candidate character;

[0201] Arrange the character textures corresponding to each candidate character in order onto an image to obtain the second image.

[0202] Optionally, the device further includes a selection unit 506 for:

[0203] Based on the number of digits in the target license plate number, select the geometry corresponding to the target license plate from a number of pre-created candidate geometries.

[0204] Optionally, the display unit 504 is also used for:

[0205] Receive adjustment instructions;

[0206] The pose of the 3D object of the target license plate displayed on the screen is adjusted according to the adjustment instructions.

[0207] The specific working principle and beneficial effects of the license plate rendering device provided in this application can be found in any of the license plate rendering methods provided in this application, and will not be repeated here.

[0208] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0209] For ease of description, the above systems or devices are described separately as various modules or units based on their functions. Of course, in implementing this application, the functions of each unit can be implemented in one or more software and / or hardware components.

[0210] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of this application.

[0211] Finally, it should be noted that in this document, relational terms such as first, second, third, and fourth are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0212] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A license plate rendering method, characterized in that, include: Determine the color and aspect ratio corresponding to each license plate type; for each license plate type, render a background texture corresponding to that license plate type based on its color and aspect ratio; arrange the background textures corresponding to each license plate type sequentially onto an image to obtain a first image, and record the UV data of the background texture of each license plate type on the first image; record the UV data of the generated first image and the first index number corresponding to the license plate type in a specific format to obtain a background UV data structure that records the UV data of the background texture of each license plate type in the first image. Identify each candidate character that can be used in the license plate number; Render each candidate character to obtain a character texture corresponding to each candidate character; The character textures corresponding to each candidate character are arranged sequentially onto an image to obtain a second image; each candidate character in the second image is numbered according to a preset character encoding rule to determine the second index number corresponding to each candidate character; there is a one-to-one correspondence between the second index number and the candidate character; the UV data of each candidate character in the second image is recorded, and the UV data of the second image and the second index number corresponding to the candidate character are recorded in a certain data format to obtain a character UV data structure that records the UV data of each candidate character in the second image; Obtain the target license plate type and target license plate number of the target license plate to be rendered; The background texture corresponding to the target license plate type is collected from the pre-generated background UV data structure, and the character texture corresponding to the target character is collected from the pre-generated character UV data structure, wherein the target character refers to the characters that make up the target license plate number; The three-dimensional object of the target license plate is synthesized based on the license plate background texture, the character texture, and the geometry corresponding to the target license plate. Display a three-dimensional object of the target license plate on the screen.

2. The method according to claim 1, characterized in that, Before synthesizing the 3D object of the target license plate based on the license plate background texture, the character texture, and the geometry corresponding to the target license plate, the method further includes: Based on the number of digits in the target license plate number, select the geometry corresponding to the target license plate from a plurality of pre-created candidate geometries.

3. The method according to claim 1, characterized in that, After displaying the three-dimensional object of the target license plate on the screen, the method further includes: Receive adjustment instructions; The pose of the three-dimensional object of the target license plate displayed on the screen is adjusted according to the adjustment instruction.

4. A license plate rendering device, characterized in that, include: A generation unit is used to determine the color and aspect ratio corresponding to each license plate type; for each license plate type, render a background texture corresponding to the license plate type according to the color and aspect ratio corresponding to the license plate type; arrange the background textures corresponding to each license plate type in sequence onto an image to obtain a first image, and record the UV data of the background texture of each license plate type on the first image; record the UV data on the generated first image and the first index number corresponding to the license plate type according to a specific format to obtain a background UV data structure that records the UV data of the background texture of each license plate type in the first image. Identify each candidate character that can be used in the license plate number; Render each candidate character to obtain a character texture corresponding to each candidate character; The character textures corresponding to each candidate character are arranged sequentially onto an image to obtain a second image; each candidate character in the second image is numbered according to a preset character encoding rule to determine the second index number corresponding to each candidate character; there is a one-to-one correspondence between the second index number and the candidate character; the UV data of each candidate character in the second image is recorded, and the UV data of the second image and the second index number corresponding to the candidate character are recorded in a certain data format to obtain a character UV data structure that records the UV data of each candidate character in the second image; The acquisition unit is used to obtain the target license plate type and target license plate number of the target license plate to be rendered; The acquisition unit is used to acquire the background texture corresponding to the target license plate type from the pre-generated background UV data structure, and to acquire the character texture corresponding to the target character from the pre-generated character UV data structure, wherein the target character refers to the characters that make up the target license plate number; A compositing unit is used to compose a three-dimensional object of the target license plate based on the license plate background texture, the character texture, and the geometry corresponding to the target license plate. The display unit is used to display a three-dimensional object of the target license plate on the screen.

5. The apparatus according to claim 4, characterized in that, It also includes a selection unit for: Based on the number of digits in the target license plate number, select the geometry corresponding to the target license plate from a plurality of pre-created candidate geometries.

6. The apparatus according to claim 4, characterized in that, The display unit is also used for: Receive adjustment instructions; The pose of the three-dimensional object of the target license plate displayed on the screen is adjusted according to the adjustment instruction.

Citation Information

Patent Citations

  • Three-dimensional vehicle model generation method and device and vehicle

    CN112330807A