Display method, device and equipment of mark point and storage medium
By acquiring the geometric shape and color information of the marker points and processing primitives using vertex, geometry, and fragment shaders, the problems of unsmooth marker point display and excessive data volume are solved, achieving smooth display and optimized storage space.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHINING 3D TECH CO LTD
- Filing Date
- 2022-12-16
- Publication Date
- 2026-07-10
Smart Images

Figure CN115774536B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of graphic display technology, and in particular to a method, apparatus, electronic device, and computer-readable storage medium for displaying markers. Background Technology
[0002] Marker points are widely used in many fields; for example, marker points can carry encoded information, and marker points carrying encoded information can be called coded marker points. Coded marker points are an indispensable part of fields such as photogrammetry and industrial scanning, and have important application value in image recognition; another example is that marker points can be used as visual positioning markers in the field of positioning.
[0003] In related technologies, there are generally two ways to display marker points:
[0004] The first method is to draw it in the form of triangles: For the circular or arc-shaped part of the marker, in order to achieve the effect of a circle or arc, the circle or arc needs to be subdivided into many triangles. The edge of the circle is composed of a side of many triangles, thus presenting a circular or arc-shaped display effect.
[0005] The second method involves drawing with a bounding box and a texture map of the corresponding shape: A bounding box is used to enclose the marker, and then a texture map of the marker's shape is attached. The texture map contains the marker's shape and corresponding color; the parts to be drawn have normal color values, while the parts not to be drawn have 0% opacity. When the device renders the bounding box, the texture map is sampled and drawn.
[0006] Both of the above display methods suffer from uneven edges of the markers after magnification, or excessive data size of the markers that consumes too much storage space in order to improve the smoothing effect. Summary of the Invention
[0007] In view of this, this application provides a method, apparatus, electronic device, and computer-readable storage medium for displaying marker points.
[0008] Specifically, this application is implemented through the following technical solution:
[0009] According to a first aspect of the embodiments of this application, a method for displaying marker points is provided, comprising:
[0010] Obtain the geometric shape and color information of the marker point; the color information indicates the color of different display portions within the marker point.
[0011] The geometric shape information of the marker point is processed using a vertex shader to obtain a first primitive; and the first primitive is processed using a geometry shader to obtain a second primitive.
[0012] For a number of fragments obtained by rasterizing the second primitive, the fragment shader determines the display portion to which each fragment belongs based on the geometric shape information, and determines the color of each fragment based on the display portion to which each fragment belongs and the color information.
[0013] The marker point is displayed according to the color of each fragment among the plurality of fragments.
[0014] Optionally, the different display portions of the marker point include at least two circles with different radii, the centers of the at least two circles overlap, and the display layer of the circle with the smaller radius is higher than that of the circle with the larger radius; the geometric shape information includes the radii of the at least two circles;
[0015] The step of determining the display portion to which each fragment belongs based on the geometric shape information includes:
[0016] For each of the aforementioned fragments, determine the target distance from the fragment to the center of the marker point;
[0017] The display portion to which the fragment belongs is determined based on the difference between the target distance and the radii of at least two of the circles.
[0018] Optionally, the different display portions of the marker point include a central circle and at least one annular band; the geometric information includes the radius of the central circle and the radius of each annular band;
[0019] The step of determining the display portion to which each fragment belongs based on the geometric shape information includes:
[0020] For each of the aforementioned fragments, determine the target distance from the fragment to the center of the marker point;
[0021] The display portion to which the fragment belongs is determined based on the difference between the target distance and the radius of the central circle, and the difference between the target distance and the radii of each annular band.
[0022] Optionally, if the target distance is less than or equal to the radius of the central circle, the display portion to which the fragment belongs is the central circle;
[0023] If the marker point includes a ring, and the target distance is greater than the radius of the central circle and less than or equal to the radius of the ring, the display portion to which the fragment belongs is the ring.
[0024] When the marker point includes at least two annular bands, if the target distance is between the radius of the central circle and the radius of the annular band closest to the central circle, the display portion to which the fragment belongs is the annular band closest to the central circle; if the target distance is between the radii of the two annular bands, the display portion to which the fragment belongs is determined to be the one with the larger radius of the two annular bands.
[0025] Optionally, the annular zone can be divided into at least two arc-shaped regions; the geometric information also includes the angle range of each arc-shaped region;
[0026] The step of determining the display portion to which each fragment belongs based on the geometric shape information includes:
[0027] For a fragment belonging to an annular zone, the arc region to which the fragment belongs is determined based on the angle information of the fragment and the difference between the angle ranges of different arc regions in the annular zone to which the fragment belongs.
[0028] The method further includes:
[0029] In the fragment shader, the display shape of each arc region is determined by the angle range of each arc region;
[0030] The step of displaying the marker point according to the color of each fragment among the plurality of fragments includes:
[0031] The marker point is displayed based on the color of each fragment and the display shape of each arc-shaped area.
[0032] Optionally, it also includes:
[0033] If, based on the geometric information, it is determined that a fragment does not belong to any of the display portions of the marker points, the fragment is discarded or its color is set to transparent.
[0034] Optionally, the first primitive is drawn as a point by the vertex shader.
[0035] Optionally, the geometric information includes normal information and the radius of the marker point;
[0036] The process of processing the first primitive using a geometry shader to obtain the second primitive includes:
[0037] Based on the normal information and the radius of the marker point, draw the bounding box of the first primitive;
[0038] Based on the given bounding box shape, the second primitive is output; wherein, the second primitive includes two triangular primitives.
[0039] According to a second aspect of the embodiments of this application, a display device for marker dots is provided, comprising:
[0040] The information acquisition module is used to acquire the geometric shape information and color information of the marker point; the color information indicates the color of different display parts of the marker point;
[0041] The primitive acquisition module is used to draw the geometric shape information of the marker point using a vertex shader to obtain a first primitive; and to process the first primitive using a geometry shader to obtain a second primitive.
[0042] The color determination module is used to determine the display portion to which each fragment belongs based on the geometric shape information for a number of fragments obtained by rasterizing the second primitive, and to determine the color of each fragment based on the display portion to which each fragment belongs and the color information.
[0043] The display module is used to display the marker point according to the color of each fragment among the plurality of fragments.
[0044] According to a third aspect of the embodiments of this application, an electronic device is provided, including a memory, a processor, and executable instructions stored in the memory and executable on the processor;
[0045] Wherein, when the processor executes the executable instructions, it implements the steps in the method as described in any one of the first aspects.
[0046] According to a fourth aspect of the embodiments of this application, a computer-readable storage medium is provided, on which computer instructions are stored, wherein when executed by a processor, the computer instructions implement the steps of the method described in any one of the first aspects.
[0047] The technical solutions provided by the embodiments of this disclosure may include the following beneficial effects:
[0048] In this embodiment of the disclosure, the display portion to which each fragment belongs is determined in the fragment shader based on the geometric shape information, and the color of each fragment is accurately determined based on the display portion to which each fragment belongs and the color information. This achieves the effect that the circular or arc-shaped edge of the marker point can be displayed smoothly and clearly no matter how magnified the view is; and the data volume of the marker point only involves primitive information and related parameter information (such as geometric shape information and color information), the data volume of the marker point is small, thereby reducing the required storage space.
[0049] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0050] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0051] Figure 1A and 1B It is a schematic diagram of the marker points drawn in the form of triangles in related technologies.
[0052] Figure 1C yes Figure 1B A magnified view of a portion of the image.
[0053] Figure 2 It is a magnified view of a marker point obtained by drawing a frame shape and a texture map of the corresponding shape in related technologies.
[0054] Figure 3 This is a flowchart illustrating a method for displaying markers according to an exemplary embodiment of this application.
[0055] Figure 4A This is a schematic diagram illustrating a marker point obtained using the marker point display method of this application, as shown in an exemplary embodiment of this application.
[0056] Figure 4B and Figure 4C for Figure 4A A magnified view of a portion of the image.
[0057] Figure 5 This is an exemplary schematic diagram of an electronic device illustrated in an exemplary embodiment of this application.
[0058] Figure 6 This is a schematic diagram illustrating another marker point in an exemplary embodiment of this application.
[0059] Figure 7 This is another exemplary schematic diagram of an electronic device illustrated in an exemplary embodiment of this application.
[0060] Figure 8 This is a schematic diagram of the structure of a marker display device according to an exemplary embodiment of this application. Detailed Implementation
[0061] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0062] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the associated listed items.
[0063] It should be understood that although the terms first, second, third, etc., may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."
[0064] The first method of displaying markers in related technologies involves drawing them in the form of triangles. For details on drawing them in the form of triangles, please refer to [link / reference needed]. Figure 1A (Where the gray background is used, and the markers are composed of black circles with white inner circles.) If the triangles are subdivided too fewly, when viewed under slight magnification, the edge of the circle will appear to be composed of line segments, each corresponding to a side of a subdivided triangle. Therefore, the edge of the circle is not a true circle; the edge is not smooth enough, resulting in a poor display. If there are too many subdivided triangles, please refer to [the relevant documentation]. Figure 1B Although it can make it appear rounder when magnified slightly, it doesn't... Figure 1B Please zoom in further. Figure 1C You will still see line segments, and too many triangles will increase the amount of data for the marker points, taking up a lot of storage space.
[0065] The second method of displaying markers in related technologies involves drawing a frame with a texture map of the corresponding shape. Please refer to [link / reference]. Figure 2 If the markers displayed using this drawing method are magnified, it can be observed that the edges of the circular parts are not clear enough due to insufficient resolution of the texture map, resulting in a blurry and uneven display. If a higher resolution texture map is used to make the markers appear clearer, the amount of data for the markers will increase, occupying a lot of storage space.
[0066] To address the problems in related technologies, this application provides a method for displaying marker points. Using OpenGL for rendering, after obtaining the geometric shape and color information of the marker point, a vertex shader can process the geometric shape information to obtain a first primitive; and a geometry shader can process the first primitive to obtain a second primitive. Then, for several fragments obtained by rasterizing the second primitive, a fragment shader can determine the display portion to which each fragment belongs based on the geometric shape information, and determine the color of each fragment based on the display portion to which each fragment belongs and the color information; finally, the marker point is displayed according to the color of each fragment. This embodiment determines the display portion to which each fragment belongs in the fragment shader, allowing each fragment to display the corresponding color, achieving a smooth and clear display of the circular or arc-shaped edge of the marker point regardless of magnification. Furthermore, the data volume of the marker point only involves primitive information and related parameter information (such as geometric shape and color information), resulting in a smaller data volume and reduced storage space requirements.
[0067] The marker display method provided in this application embodiment can be executed by an electronic device with graphics processing capabilities. The electronic device includes, but is not limited to, smartphones / mobile phones, tablet computers, personal digital assistants (PDAs), laptop computers, desktop computers, media content players, video game consoles / systems, virtual reality systems, augmented reality systems, wearable devices (e.g., watches, glasses, gloves, headwear (e.g., hats, helmets, virtual reality headsets, augmented reality headsets, head-mounted devices (HMDs), headbands), pendants, armbands, leg rings, shoes, vests), remote controls, or any other device with graphics processing capabilities.
[0068] For example, the electronic device includes a processor and a memory, the memory storing executable instructions that can run on the processor, and the processor executing the executable instructions to implement the marker display method provided in the embodiments of this application. For example, the processor may be a graphics processing unit (GPU).
[0069] For example, the electronic device integrates a computer program product, and when the electronic device executes the computer program product, it implements the marker display method provided in the embodiments of this application.
[0070] Please see Figure 3 , Figure 3 This is a schematic diagram of a method for displaying marker points provided in an embodiment of this application. The method can be executed by an electronic device, and the method includes:
[0071] In S101, the geometric shape information and color information of the marker point are obtained; the color information indicates the color of different display parts in the marker point.
[0072] In S102, the geometric shape information of the marker point is processed using a vertex shader to obtain a first primitive; and the first primitive is processed using a geometry shader to obtain a second primitive.
[0073] In S103, for a number of fragments obtained by rasterizing the second primitive, the fragment shader determines the display portion to which each fragment belongs based on the geometric shape information, and determines the color of each fragment based on the display portion to which each fragment belongs and the color information.
[0074] In S104, the marker point is displayed according to the color of each fragment among the plurality of fragments.
[0075] In this embodiment, the display portion to which each fragment belongs is determined in the fragment shader, so that each fragment can display the corresponding color. This achieves the effect that the circular or arc-shaped edge of the marker point can be displayed smoothly and clearly no matter how magnified the view is. Furthermore, the data volume of the marker point only involves primitive information and related parameter information (such as geometric shape information and color information). The data volume of the marker point is small, thereby reducing the required storage space.
[0076] In one example, please refer to Figure 4A , Figure 4A The markers obtained using the marker display method of this application (the markers are...) Figure 4A (The black and white parts in the image). Please refer to... Figure 4B as well as Figure 4C , Figure 4B and Figure 4C for Figure 4A The magnified result shows that the circular edges of the markers obtained using the marker display method of this application can still be displayed smoothly and clearly when magnified.
[0077] In one exemplary embodiment, the electronic device includes a central processing unit (CPU) and a graphics processing unit (GPU). See also... Figure 5The central processing unit (CPU) can transmit the geometric shape and color information of the marker to be displayed to the graphics processing unit (GPU). After acquiring the geometric shape and color information of the marker, the GPU's vertex shader processes the geometric shape information to obtain a first primitive; then, the geometry shader processes the first primitive to obtain a second primitive; after rasterizing the second primitive to obtain several fragments, the fragment shader determines the display portion to which each fragment belongs based on the geometric shape information, and determines the color of each fragment based on the display portion to which each fragment belongs and the color information; it should be noted that if it is determined based on the geometric shape information that a fragment does not belong to any display portion of the marker, the fragment can be discarded or its color can be set to transparent, so that other fragments belonging to the marker can form the shape of the marker; finally, the marker is displayed based on the colors of the fragments belonging to different display portions among the several fragments.
[0078] A vertex shader is a set of instructions that executes when a vertex is rendered. It's a shader that performs a series of operations on a vertex. Besides the basic position attribute, a vertex may also contain many other attributes, such as texture and normals. Through the vertex shader, the graphics processor knows exactly where the vertex should be drawn.
[0079] In some embodiments, the vertex shader can draw the first primitive in a point manner based on the geometric shape information of the marker point, and then output the first primitive to the geometry shader.
[0080] A geometry shader is a type of shader that falls between a vertex shader and a fragment shader. Its input is a set of vertices of a primitive, and its output is a set of vertices of another primitive. It transforms a primitive into a completely different primitive and can generate more vertices than the original.
[0081] In some embodiments, the geometric shape information includes normal information and the radius of the marker point. The geometry shader can draw the bounding box of the first primitive based on the normal information and the radius of the marker point, and then output the second primitive based on the bounding box so that the shape of the marker point can be determined from the second primitive. In one example, the bounding box is a rectangle composed of two triangles, and the second primitive includes two triangular primitives.
[0082] In some embodiments, the different display portions of the marker point include at least two circles with different radii, the centers of the at least two circles overlapping, and the display layer of the circle with the smaller radius is higher than that of the circle with the larger radius. (See also...) Figure 4AThe marker point can be displayed by overlapping the centers of a white circle and a black circle, with the white circle having a higher display level than the black circle. The geometric shape information includes the radii of at least two circles. The geometry shader is specifically used to draw the bounding box of the first primitive based on the normal information and the largest radius of the at least two circles, and then output the second primitive based on the bounding box.
[0083] After obtaining the second primitive, it can be rasterized to obtain several fragments. After obtaining the rasterized fragments of the second primitive, a fragment shader can be called to perform a fragment-by-fragment operation to determine the color of each fragment. For example, for each fragment among the several fragments, the fragment shader can be called to determine the target distance from the fragment to the center of the marker point; then, based on the difference between the target distance and the radii of at least two of the circles, the display portion to which the fragment belongs is determined, and then the color of the fragment is determined based on the display portion to which the fragment belongs and the color of the display portion indicated by the color information; wherein, the fragment shader can discard or set to transparent any fragments that do not belong to the central circle or any of the annular bands. In this embodiment, the fragment shader accurately determines the display portion to which each fragment belongs based on the target distance and geometric shape information from each fragment to the center of the marker point, so that each fragment can display an accurate color, achieving the effect that the circular edge of the marker point can be displayed smoothly and clearly no matter how magnified the observation.
[0084] In one example, taking the different display portions of the marker point as circles with different radii as an example, if the target distance is less than or equal to the smaller of the two circles, the display portion to which the fragment belongs is the smaller of the two circles; if the target distance is greater than the smaller of the two circles and less than or equal to the larger of the two circles, the display portion to which the fragment belongs is the larger of the two circles.
[0085] Furthermore, the circle can be divided into at least two arc-shaped regions; for example, please refer to [link to relevant documentation]. Figure 6The outermost circle of the marker is divided into eight arc-shaped regions, four of which are white, while the other four have zero transparency (i.e., no color). Therefore, the geometric shape information of the marker includes not only the radii of at least two circles but also the angular ranges of the arc-shaped regions divided by any one of the circles. After determining the circle to which each fragment belongs, the fragment shader, for the circle divided into arc-shaped regions, determines the arc-shaped region to which the fragment belongs based on the difference between the angle information of the fragment and the angle ranges of the different arc-shaped regions within the circle to which the fragment belongs; then, based on the arc-shaped region to which the fragment belongs and the color of the arc-shaped region indicated by the color information, the color of the fragment is determined. In the fragment shader, the display shape of each arc-shaped region is also determined using the angular ranges of the arc-shaped regions; thus, the marker can be displayed based on the color of each fragment and the display shape of each arc-shaped region. In this embodiment, the fragment shader determines which circle each fragment belongs to, and further determines which arc region within the circle a fragment belonging to is divided into. This achieves accurate determination of the display portion to which each fragment belongs, enabling each fragment to display an accurate color. The circular edge of the marker point can be displayed smoothly and clearly no matter how magnified the view is.
[0086] In other embodiments, the different display portions of the marker point include a central circle and at least one annular band; see, for example, [reference needed]. Figure 4A The marker point can consist of a white central circle and a black annular band. The geometric information includes the radius of the central circle and the radii of each annular band; where the radius of the annular band refers to the radius of the circle containing the annular band, for example... Figure 4A The radius of the annular band in the diagram is the sum of the radius of the white central circle and the width of the black annular band. The geometry shader is specifically used to draw the bounding box of the first primitive based on the normal information and the radius of the outermost annular band of the marker point, and then output the second primitive based on the bounding box.
[0087] After obtaining the second primitive, it can be rasterized to obtain several fragments. The core of the rasterization algorithm is to obtain the pixels covered by the second primitive projected onto the screen; these pixels are called fragments. Each fragment, in addition to the attributes contained in its vertices, also carries a pixel coordinate to indicate which pixel in the image space it corresponds to. These attributes are obtained through vertex attribute interpolation in the rasterization algorithm. In other words, a fragment is a discrete set of points within the original primitive (i.e., the second primitive). After obtaining several fragments after rasterization of the second primitive, a fragment shader can be called to perform per-fragment operations to determine the color of each fragment.
[0088] For example, for each of the plurality of fragments, a fragment shader can be invoked to determine the target distance from the fragment to the center of the marker point. Then, based on the difference between the target distance and the radius of the central circle, and the difference between the target distance and the radii of each annular band, the display portion to which the fragment belongs is determined. Furthermore, the color of the fragment is determined based on the display portion to which the fragment belongs and the color of that display portion indicated by the color information. The fragment shader can discard or set to transparent any fragments that do not belong to the central circle or any of the annular bands. In this embodiment, the fragment shader accurately determines the display portion to which each fragment belongs based on the target distance from each fragment to the center of the marker point and the geometric shape information, thereby enabling each fragment to display an accurate color. This achieves the effect that the circular edge of the marker point can be displayed smoothly and clearly regardless of magnification.
[0089] In one example, if the target distance is less than or equal to the radius of the central circle, the display portion to which the fragment belongs can be determined to be the central circle. If the marker point includes a ring band, and the target distance is greater than the radius of the central circle but less than or equal to the radius of the ring band, the display portion to which the fragment belongs can be determined to be the ring band; thus, fragments that do not belong to the central circle or the ring band can be discarded to reduce the amount of data at the marker point and decrease storage space.
[0090] When the marker point includes at least two annular bands, if the target distance is greater than the radius of the central circle, there are two possibilities: (1) If the target distance is between the radius of the central circle and the radius of the annular band closest to the central circle, then the display portion to which the fragment belongs is the annular band closest to the central circle. (2) If the target distance is between the radii of the two annular bands, then the display portion to which the fragment belongs is the one with the larger radius of the two annular bands. Therefore, fragments that do not belong to the central circle or any of the annular bands can be discarded or set to transparent to ensure accurate display of the coded point shape.
[0091] Furthermore, the ring-shaped zone within the marker can be divided into at least two arc-shaped regions; for example, please refer to... Figure 6The outermost ring of the marker is divided into eight arc-shaped regions, four of which are white, while the other four have zero transparency (i.e., no color). Therefore, the geometric information of the marker includes not only the radius of the central circle and the radii of each ring, but also the angular range of each arc-shaped region within the ring. After determining whether each fragment belongs to the central circle or the ring, the fragment shader, for fragments belonging to the ring, determines the arc-shaped region to which the fragment belongs based on the difference between the fragment's angular information and the angular range of different arc-shaped regions within the ring to which the fragment belongs; further, it determines the color of the fragment based on the arc-shaped region to which the fragment belongs and the color of that arc-shaped region indicated by the color information. In this embodiment, the fragment shader determines whether each fragment belongs to the central circle or the ring, and further determines which arc-shaped region a fragment belonging to the ring belongs to, achieving accurate determination of the display portion to which each fragment belongs, thus enabling each fragment to display an accurate color. This ensures that the circular edge of the marker remains smoothly and clearly displayed regardless of magnification.
[0092] In the fragment shader, the display shape of each arc-shaped region is determined using the angle range of each arc-shaped region. After determining the color corresponding to each fragment and the display shape of each arc-shaped region, the electronic device can display the marker point based on the color of each fragment and the display shape of each arc-shaped region. For example, the electronic device can write information such as the color of each fragment and the display shape of each arc-shaped region into the graphics processor cache, thereby performing visualization based on the information in the graphics processor cache. Furthermore, when storing the marker point subsequently, only primitive information and related parameter information (such as geometric shape information and color information) need to be stored; the amount of data for the marker point is small, thus reducing the required storage space.
[0093] It is easy to understand that the solutions described in the above embodiments can be combined when there is no conflict, and not all of them will be listed in this disclosure.
[0094] Figure 7 This is a schematic structural diagram of a device provided in an exemplary embodiment. Please refer to... Figure 7At the hardware level, the device includes a processor 702, an internal bus 704, a network interface 706, memory 708, and non-volatile memory 710, and may also include other hardware required for business operations. One or more embodiments of this specification can be implemented in software, such as the processor 702 reading the corresponding computer program from the non-volatile memory 710 into memory 708 and then running it. Of course, in addition to software implementation, one or more embodiments of this specification do not exclude other implementation methods, such as logic devices or a combination of hardware and software, etc. That is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0095] Please refer to Figure 8 The marker display device can be applied to, for example Figure 7 The device shown implements the technical solution of this specification. The display device for the marker point may include:
[0096] The information acquisition module 201 is used to acquire the geometric shape information and color information of the marker point; the color information indicates the color of different display parts in the marker point.
[0097] Primitive acquisition module 202 is used to draw the geometric shape information of the marker point using a vertex shader to obtain a first primitive; and to process the first primitive using a geometry shader to obtain a second primitive.
[0098] The color determination module 203 is used to determine the display portion to which each fragment belongs based on the geometric shape information for a plurality of fragments obtained by rasterization of the second primitive, and to determine the color of each fragment based on the display portion to which each fragment belongs and the color information.
[0099] Display module 204 is used to display the marker point according to the color of each fragment among the plurality of fragments.
[0100] In some embodiments, the different display portions of the marker point include at least two circles with different radii, the centers of the at least two circles overlap, and the display layer of the circle with the smaller radius is higher than that of the circle with the larger radius; the geometric information includes the radii of the at least two circles. The color determination module 203 is specifically used to: for each of the plurality of fragments, determine the target distance from the fragment to the center of the marker point; and determine the display portion to which the fragment belongs based on the difference between the target distance and the radii of the at least two circles.
[0101] In some embodiments, different display portions of the marker point include a central circle and at least one annular band; the geometric information includes the radius of the central circle and the radii of each annular band. The color determination module 203 is specifically configured to: for each of the plurality of fragments, determine the target distance from the fragment to the center of the marker point; and determine the display portion to which the fragment belongs based on the difference between the target distance and the radius of the central circle, and the difference between the target distance and the radii of each annular band.
[0102] In some embodiments, if the target distance is less than or equal to the radius of the central circle, the display portion to which the fragment belongs is the central circle; if the marker point includes a ring band, and the target distance is greater than the radius of the central circle and less than or equal to the radius of the ring band, the display portion to which the fragment belongs is the ring band; if the marker point includes at least two ring bands, and the target distance is between the radius of the central circle and the radius of the ring band closest to the central circle, the display portion to which the fragment belongs is the ring band closest to the central circle; if the target distance is between the radii of two ring bands, the display portion to which the fragment belongs is determined to be the ring band with the larger radius of the two ring bands.
[0103] In some embodiments, the annular band can be divided into at least two arc-shaped regions; the geometric shape information also includes the angle range of each arc-shaped region; the color determination module 203 is specifically used to: for a fragment belonging to the annular band, determine the arc-shaped region to which the fragment belongs based on the angle information of the fragment and the difference between the angle ranges of different arc-shaped regions in the annular band to which the fragment belongs. The device also includes a shape determination module, used in the fragment shader to determine the display shape of each arc-shaped region using the angle range of each arc-shaped region. The display module 204 is specifically used to display the marker point based on the color of each fragment among the plurality of fragments and the display shape of each arc-shaped region.
[0104] In some embodiments, a discarding module is further included, which is used to discard a fragment or set the color of the fragment to transparent if it is determined from the geometric information that a fragment does not belong to any of the display portions of the marker points.
[0105] In some embodiments, the first primitive is drawn as points by the vertex shader.
[0106] In some embodiments, the geometric shape information includes normal information and the radius of the marker point; the primitive acquisition module 202 is specifically used to draw the bounding box of the first primitive according to the normal information and the radius of the marker point; and output the second primitive according to the bounding box; wherein the second primitive includes two triangular primitives.
[0107] The specific implementation process of the functions and roles of each module in the above device can be found in the implementation process of the corresponding steps in the above method, and will not be repeated here.
[0108] Accordingly, embodiments of this application also provide an electronic device, including a memory, a processor, and executable instructions stored in the memory and executable on the processor;
[0109] The processor executes the executable instructions to implement the steps in the above method.
[0110] For example, the processor includes, but is not limited to, a central processing unit (CPU), a graphics processing unit (GPU), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), or a field-programmable gate array (FPGA).
[0111] For example, the memory may include at least one type of storage medium, including flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc.
[0112] Accordingly, this application also provides a computer program product, including a computer program that, when executed by a processor, is used to implement the above-described method.
[0113] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory including instructions that can be executed by a processor of the device to perform the described method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0114] A non-transitory computer-readable storage medium that, when instructions in the storage medium are executed by a terminal's processor, enables the terminal to perform the methods described above.
[0115] The embodiments of the subject matter and functional operation described in this specification can be implemented in the following ways: digital electronic circuits, tangibly embodied computer software or firmware, computer hardware including the structures disclosed in this specification and their structural equivalents, or combinations thereof. Embodiments of the subject matter described in this specification can be implemented as one or more computer programs, i.e., one or more modules of computer program instructions encoded on a tangible, non-transitory program carrier for execution by a data processing apparatus or for controlling the operation of a data processing apparatus. Alternatively or additionally, the program instructions may be encoded on artificially generated propagation signals, such as machine-generated electrical, optical, or electromagnetic signals, which are generated to encode information and transmit it to a suitable receiving device for execution by the data processing apparatus. The computer storage medium may be a machine-readable storage device, a machine-readable storage substrate, a random or serial access memory device, or combinations thereof.
[0116] The processing and logic flow described in this specification can be executed by one or more programmable computers that execute one or more computer programs to perform corresponding functions by operating on input data and generating output. The processing and logic flow can also be executed by dedicated logic circuitry—such as FPGAs (Field-Programmable Gate Arrays) or ASICs (Application-Specific Integrated Circuits), and the device can also be implemented as dedicated logic circuitry.
[0117] Suitable computers for executing computer programs include, for example, general-purpose and / or special-purpose microprocessors, or any other type of central processing unit. Typically, the central processing unit receives instructions and data from read-only memory and / or random access memory. The basic components of a computer include a central processing unit for implementing or executing instructions and one or more memory devices for storing instructions and data. Typically, a computer will also include one or more mass storage devices for storing data, such as disks, magneto-optical disks, or optical disks, or the computer will be operatively coupled to such mass storage devices to receive data from or transfer data to them, or both. However, a computer is not required to have such devices. Furthermore, a computer can be embedded in another device, such as a mobile phone, a personal digital assistant (PDA), a mobile audio or video player, a game console, a global positioning system (GPS) receiver, or a portable storage device such as a universal serial bus (USB) flash drive, to name a few.
[0118] Computer-readable media suitable for storing computer program instructions and data include all forms of non-volatile memory, media, and memory devices, such as semiconductor memory devices (e.g., EPROM, EEPROM, and flash memory devices), magnetic disks (e.g., internal hard disks or removable disks), magneto-optical disks, and CD-ROM and DVD-ROM disks. Processors and memory may be supplemented by or incorporated into dedicated logic circuitry.
[0119] While this specification contains numerous specific implementation details, these should not be construed as limiting the scope of any invention or the scope of the claims, but rather are primarily intended to describe features of specific embodiments of a particular invention. Certain features described in the various embodiments herein may also be implemented in combination in a single embodiment. Conversely, various features described in a single embodiment may also be implemented separately in various embodiments or in any suitable sub-combination. Furthermore, while features may function in certain combinations as described above and even initially claimed in this way, one or more features from a claimed combination may be removed from that combination in some cases, and a claimed combination may refer to a sub-combination or a variation thereof.
[0120] Similarly, although the operations are depicted in a specific order in the accompanying drawings, this should not be construed as requiring these operations to be performed in the specific order shown or sequentially, or requiring all illustrated operations to be performed to achieve the desired result. In some cases, multitasking and parallel processing may be advantageous. Furthermore, the separation of various system modules and components in the above embodiments should not be construed as requiring such separation in all embodiments, and it should be understood that the described program components and systems can generally be integrated together in a single software product or packaged into multiple software products.
[0121] Thus, specific embodiments of the subject matter have been described. Other embodiments are within the scope of the appended claims. In some cases, the actions recited in the claims may be performed in a different order and still achieve the desired result. Furthermore, the processes depicted in the drawings are not necessarily shown in a specific order or sequence to achieve the desired result. In some implementations, multitasking and parallel processing may be advantageous.
[0122] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A method for displaying marker points, characterized in that, include: Obtain the geometric shape and color information of the marker points; The color information indicates the color of different display portions within the marker point; The geometric shape information of the marker points is processed using a vertex shader to obtain the first primitive; Furthermore, the first primitive is processed using a geometry shader to obtain the second primitive; For a number of fragments obtained by rasterizing the second primitive, the fragment shader determines the display portion to which each fragment belongs based on the geometric shape information, and determines the color of each fragment based on the display portion to which each fragment belongs and the color information. The marker point is displayed according to the color of each fragment among the plurality of fragments; The different display portions of the marker point include at least two circles with different radii, the centers of the at least two circles overlap, and the display layer of the circle with the smaller radius is higher than that of the circle with the larger radius; the geometric shape information includes the radii of the at least two circles. The step of determining the display portion to which each fragment belongs based on the geometric shape information includes: For each of the aforementioned fragments, determine the target distance from the fragment to the center of the marker point; The display portion to which the fragment belongs is determined based on the difference between the target distance and the radii of at least two of the circles.
2. The method according to claim 1, characterized in that, The different display portions of the marker point include a central circle and at least one annular band; the geometric information includes the radius of the central circle and the radius of each annular band; The step of determining the display portion to which each fragment belongs based on the geometric shape information includes: For each of the aforementioned fragments, determine the target distance from the fragment to the center of the marker point; The display portion to which the fragment belongs is determined based on the difference between the target distance and the radius of the central circle, and the difference between the target distance and the radii of each annular band.
3. The method according to claim 2, characterized in that, If the target distance is less than or equal to the radius of the center circle, the display portion to which the fragment belongs is the center circle; If the marker point includes a ring, and the target distance is greater than the radius of the central circle but less than or equal to the radius of the ring, the display portion to which the fragment belongs is the ring. When the marker point includes at least two annular bands, if the target distance is between the radius of the central circle and the radius of the annular band closest to the central circle, the display portion to which the fragment belongs is the annular band closest to the central circle; if the target distance is between the radii of the two annular bands, the display portion to which the fragment belongs is determined to be the one with the larger radius of the two annular bands.
4. The method according to claim 2 or 3, characterized in that, The annular zone can be divided into at least two arc-shaped regions; The geometric shape information also includes the angle range of each arc region; The step of determining the display portion to which each fragment belongs based on the geometric shape information includes: For a fragment belonging to an annular zone, the arc region to which the fragment belongs is determined based on the difference between the angle information of the fragment and the angle range of different arc regions in the annular zone to which the fragment belongs. The method further includes: In the fragment shader, the display shape of each arc region is determined by the angle range of each arc region; The step of displaying the marker point based on the color of each fragment among the plurality of fragments includes: The marker point is displayed based on the color of each fragment and the display shape of each arc-shaped area.
5. The method according to claim 1, characterized in that, Also includes: If, based on the geometric information, it is determined that a fragment does not belong to any of the display portions of the marker points, the fragment is discarded or its color is set to transparent; and / or the first primitive is drawn as a point by the vertex shader.
6. The method according to claim 1, characterized in that, The geometric information includes normal information and the radius of the marker point; The process of processing the first primitive using a geometry shader to obtain the second primitive includes: Based on the normal information and the radius of the marker point, draw the bounding box of the first primitive; Based on the given bounding box shape, the second primitive is output; wherein, the second primitive includes two triangular primitives.
7. A display device for marker dots, characterized in that, include: The information acquisition module is used to acquire the geometric shape and color information of the marker points; The color information indicates the color of different display portions within the marker point; The primitive acquisition module is used to draw the geometric shape information of the marker points using a vertex shader to obtain the first primitive; Furthermore, the first primitive is processed using a geometry shader to obtain the second primitive; The color determination module is used to determine the display portion to which each fragment belongs based on the geometric shape information for a number of fragments obtained by rasterizing the second primitive, and to determine the color of each fragment based on the display portion to which each fragment belongs and the color information. The display module is used to display the marker point according to the color of each fragment among the plurality of fragments; The different display portions of the marker point include at least two circles with different radii, the centers of the at least two circles overlap, and the display layer of the circle with the smaller radius is higher than that of the circle with the larger radius; the geometric shape information includes the radii of the at least two circles. The color determination module is specifically used to determine the target distance from each of the plurality of fragments to the center of the marker point; and to determine the display portion to which the fragment belongs based on the difference between the target distance and the radii of at least two of the circles.
8. An electronic device, characterized in that, This includes memory, processor, and executable instructions stored in memory and capable of running on the processor; Wherein, when the processor executes the executable instructions, it implements the steps in the method as described in any one of claims 1 to 6.
9. A computer-readable storage medium storing computer instructions thereon, characterized in that, When the computer instructions are executed by the processor, they implement the steps of the method according to any one of claims 1 to 6.