CN112330769B - Method and device for generating dotted line texture and electronic equipment - Google Patents

Method and device for generating dotted line texture and electronic equipment Download PDF

Info

Publication number
CN112330769B
CN112330769B CN202011461946.XA CN202011461946A CN112330769B CN 112330769 B CN112330769 B CN 112330769B CN 202011461946 A CN202011461946 A CN 202011461946A CN 112330769 B CN112330769 B CN 112330769B
Authority
CN
China
Prior art keywords
target pixel
dotted
line
dotted line
marked
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011461946.XA
Other languages
Chinese (zh)
Other versions
CN112330769A (en
Inventor
张现法
贾双成
贾郭峰
朱磊
王斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhidao Network Technology Beijing Co Ltd
Original Assignee
Zhidao Network Technology Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhidao Network Technology Beijing Co Ltd filed Critical Zhidao Network Technology Beijing Co Ltd
Priority to CN202011461946.XA priority Critical patent/CN112330769B/en
Publication of CN112330769A publication Critical patent/CN112330769A/en
Application granted granted Critical
Publication of CN112330769B publication Critical patent/CN112330769B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/001Texturing; Colouring; Generation of texture or colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/29Geographical information databases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/40Filling a planar surface by adding surface attributes, e.g. colour or texture

Abstract

The application relates to a method and a device for generating a dotted line texture and electronic equipment. The method comprises the following steps: coloring a target pixel point in a picture to be processed according to a preset color to form a dotted line symbol; acquiring screen position information of a boundary line to be marked on an electronic map, and calculating the display quantity of the obtained dotted line symbols; and according to the display quantity of the dotted symbols and the screen position information of the boundary line to be marked, sequentially splicing each dotted symbol, and displaying dotted textures at the corresponding position of the electronic map. Such a design, on the one hand, makes it easier to configure the colors in the form of pictures; according to the screen position information of the boundary line to be marked in the electronic map displayed on the current screen, the display position of the dotted line texture on the screen is determined, the operation amount is small, the display is fast, and the display efficiency is improved. On the other hand, the dotted line textures are directly displayed on the upper layer of the electronic map in the form of pictures, so that the requirements on hardware are low, and the use requirements of hardware such as vehicle-mounted intelligent equipment or mobile phones are met.

Description

Method and device for generating dotted line texture and electronic equipment
Technical Field
The present application relates to the field of image processing technologies, and in particular, to a method and an apparatus for generating a dashed texture, and an electronic device.
Background
In the related art, an electronic map may express geospatial data through a vector data model. Vector data models typically express geospatial entity location and extent in the real world by elements such as points, lines, and facets. Wherein the line may include a solid line or a dotted line according to the type of the line. Different geographical information may be expressed according to different lineages, e.g. a line may be used to represent a road or a boundary.
In an electronic map, a boundary line such as a province boundary line or a national boundary line is often indicated by a dotted line. Generally, at the PC side of a computer, a system of the computer itself may support OpenGL (Open Graphics Library, "open graphics library" or "open graphics library") to draw a dotted line in an electronic map. Wherein OpenGL is a cross-language, cross-platform application programming interface for rendering 2D, 3D vector graphics. Efficient implementations of OpenGL (using graphics acceleration hardware) exist in Windows, part of the UNIX platform, and Mac OS. These implementations are typically provided by the display device vendor and are highly dependent on the hardware provided by the vendor. For the vehicle-mounted intelligent device, the system is generally an embedded system, which cannot support OpenGL to draw a dotted line and needs manual drawing, so that the workload is increased.
Disclosure of Invention
In order to overcome the problems in the related art, the application provides a method and a device for generating a dotted line texture and electronic equipment.
The first aspect of the present application provides a method for generating a dashed texture, including:
coloring a target pixel point in a picture to be processed according to a preset color to form a dotted line symbol;
acquiring screen position information of a boundary line to be marked on an electronic map, and calculating to acquire the display quantity of the dotted line symbols;
and according to the display quantity of the dotted symbols and the screen position information of the boundary line to be marked, sequentially splicing each dotted symbol, and displaying dotted textures at the corresponding positions of the electronic map.
In one embodiment, the coloring the target pixel point in the image to be processed according to the preset color to form a dotted line symbol includes:
according to the preset color, carrying out colored coloring on part of the target pixel points in the picture to be processed to form colored target pixel points; transparent coloring is carried out on the other part of the target pixel points to form transparent target pixel points;
the colored target pixel points and the transparent target pixel points form a dotted line symbol.
In one embodiment, the forming of the dotted line symbol by the colored target pixel point and the transparent target pixel point includes:
and at least one colored target pixel point and at least one transparent target pixel point sequentially form a dotted line symbol according to preset positions.
In one embodiment, the colored target pixel points form any one of a line structure, a dot structure or a line and dot alternating structure.
In one embodiment, the obtaining the screen position information of the boundary line to be marked on the electronic map includes:
obtaining vertex geographic coordinates of each vertex of a boundary to be marked in the electronic map;
and converting the geographic coordinates of the vertexes, and calculating to obtain the screen pixel coordinates corresponding to each vertex.
In one embodiment, the calculating obtains the number of dashed symbols, including:
calculating and obtaining the interval length between two adjacent vertexes according to the screen pixel coordinates of each vertex;
accumulating the interval lengths between every two adjacent vertexes, and calculating to obtain the total length of the boundary line to be marked;
and according to the total length divided by the number of the target pixel points of the single dotted line symbol, calculating to obtain the number of the dotted line symbols to be displayed.
In one embodiment, the predetermined color includes at least one color set according to a color value.
A second aspect of the present application provides a device for generating a texture of a broken line, including:
the coloring module is used for coloring the target pixel point in the picture to be processed according to a preset color to form a dotted line symbol;
the virtual line information acquisition module is used for acquiring screen position information of a boundary line to be marked on the electronic map and calculating the display quantity of the virtual line symbols acquired by the coloring module;
and the texture display module is used for displaying the dotted textures at the corresponding positions of the electronic map after the dotted symbols are spliced in sequence according to the display quantity of the dotted symbols and the screen position information of the boundary line to be marked, which are obtained by the dotted information acquisition module.
A third aspect of the present application provides an electronic apparatus, comprising:
a processor; and
a memory having executable code stored thereon which, when executed by the processor, causes the processor to perform the method as described above.
A fourth aspect of the application provides a non-transitory machine-readable storage medium having stored thereon executable code which, when executed by a processor of an electronic device, causes the processor to perform a method as described above.
The technical scheme provided by the application can comprise the following beneficial effects:
according to the technical scheme, the dotted line symbols are formed by coloring target pixel points in the picture to be processed, and a certain number of the dotted line symbols are displayed on the electronic map according to the screen position information of the boundary line to be marked, so that the dotted line textures are formed. On one hand, the picture is easier to configure the colors and is more flexible to operate; meanwhile, the display position of the dotted line texture on the screen is determined directly according to the screen position information of the boundary line to be marked in the electronic map displayed on the current screen, so that the operation amount is small, the display is fast, and the display efficiency is improved. On the other hand, the method has the advantages that drawing is not needed, the data point sequence of the electronic map is not needed to be changed, the dotted line textures are directly displayed on the upper layer of the electronic map in the form of pictures, the requirement on hardware is low, and the use requirement of hardware such as vehicle-mounted intelligent equipment or mobile phones is met.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application as claimed.
Drawings
The foregoing and other objects, features and advantages of the application will be apparent from the following more particular descriptions of exemplary embodiments of the application as illustrated in the accompanying drawings wherein like reference numbers generally represent like parts throughout the exemplary embodiments of the application.
FIG. 1 is a flow chart of a method for generating a dashed texture according to an embodiment of the present application;
FIG. 2 is another flow chart of a method for generating a dashed texture according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a single dashed symbol shown in an embodiment of the present application;
FIG. 4 is a schematic representation of a dashed texture formed by a plurality of dashed symbols in accordance with an embodiment of the present application;
FIG. 5 is a schematic diagram of a device for generating a texture of a broken line according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Preferred embodiments of the present application will be described in more detail below with reference to the accompanying drawings. While the preferred embodiments of the present application are shown in the drawings, it should be understood that the present application may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the application to those skilled in the art.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any or all possible combinations of one or more of the associated listed items.
It should be understood that although the terms "first," "second," "third," etc. may be used herein to describe various information, these information should not be limited by these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the application. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more such feature. In the description of the present application, the meaning of "a plurality" is two or more, unless explicitly defined otherwise.
In the related art, a terminal with low hardware configuration, such as a vehicle-mounted intelligent device, a mobile phone, and the like, cannot automatically draw a dotted line in an electronic map by using OpenGL, and needs to be manually drawn, so that the workload is increased. Aiming at the problems, the embodiment of the application provides a method for generating the dotted line texture, which can quickly generate the dotted line texture on the electronic map and improve the working efficiency. The following describes the technical scheme of the embodiment of the present application in detail with reference to the accompanying drawings.
Example 1
Fig. 1 is a flowchart of a method for generating a dashed texture according to an embodiment of the present application.
Referring to fig. 1, the method for generating the dotted texture includes:
step S110, coloring the target pixel point in the picture to be processed according to the preset color to form a dotted line symbol.
It will be appreciated that a picture is made up of at least one target pixel having a location and a color. The picture to be processed comprises at least one target pixel point. In this embodiment, the image to be processed includes a plurality of target pixel points. In an electronic map, different geographic elements can be generally distinguished by different colors. For example, water areas in geographic elements are shown in blue and mountain forests are shown in green. In one embodiment, at least one preset color may be used to color the target pixel point in the image to be processed, so as to form a dotted line symbol. The target pixel point is a pixel point to be colored. That is, the colored picture to be processed includes at least one color, i.e., the single dashed symbol includes at least one color. In one embodiment, the dashed symbols are any one of a line structure, a dot structure, or an alternating structure of lines and dots. Further, the size of a single dotted symbol may be achieved by coloring the target pixel dots by a preset number. For example, for a dashed symbol of a short-line structure, the line and line width of a single short line can be adjusted by controlling the number of colored target pixel points.
In other embodiments, the method of the present application is not limited to forming a pattern with a dotted line symbol by coloring a target pixel point of a picture to be processed, but also forming a pattern with any other shape by coloring, and has a high flexible operability.
Step S120, screen position information of the boundary line to be marked on the electronic map is obtained, and the display quantity of the dotted line symbols is calculated.
The electronic map is displayed on a display screen of the terminal, and when a certain position of the current map interface needs to be displayed with a broken line, for example, a provincial line of the current map interface needs to be displayed with the broken line, and the provincial line is the boundary to be marked. By acquiring the screen position information of the boundary line to be marked, the number of the dotted symbols to be displayed can be calculated so that a sufficient and proper number of the dotted symbols are continuously displayed at the position of the screen of the boundary line to be marked.
Step S130, according to the display number of the dotted symbols and the screen position information of the boundary line to be marked, the dotted textures are displayed at the corresponding positions of the electronic map after each dotted symbol is spliced in sequence.
It can be understood that, on the display screen, the position to be displayed of the texture of the dotted line can be defined by the screen position information of the boundary line to be marked; and the corresponding number of the colored dotted symbols can be spliced one by one in sequence at the position to be displayed through calculating the display number of the colored dotted symbols, so that the dotted textures are formed. The method for generating the dotted line texture forms the dotted line texture by coloring the target pixel point in the picture to be processed to form the dotted line symbol and displaying a certain number of the dotted line symbols on the electronic map according to the screen position information of the boundary line to be marked. On one hand, the picture is easier to configure the colors and is more flexible to operate; meanwhile, the display position of the dotted line texture on the screen is determined directly according to the screen position information of the boundary line to be marked in the electronic map displayed on the current screen, so that the operation amount is small, the display is fast, and the display efficiency is improved. On the other hand, the method has the advantages that drawing is not needed, the data point sequence of the electronic map is not needed to be changed, the dotted line textures are directly displayed on the upper layer of the electronic map in the form of pictures, the requirement on hardware is low, and the use requirement of hardware such as vehicle-mounted intelligent equipment or mobile phones is met.
In one embodiment, the steps S110 and S120 of the present application may be performed in no sequential order, i.e., the steps S110 and S120 may be performed simultaneously or in steps in any order.
Example two
Fig. 2 is another flow chart of a method for generating a texture with a broken line according to an embodiment of the present application.
Referring to fig. 2, the method for generating the dotted texture includes:
step S210, according to the preset color, performing colored coloring on part of the target pixel points in the picture to be processed, and performing transparent coloring on the other part of the target pixel points to form a dotted line symbol.
In one embodiment, according to a preset color, a part of target pixel points in a picture to be processed are colored to form colored target pixel points; transparent coloring is carried out on the other part of the target pixel points to form transparent target pixel points; the colored target pixel points and the transparent target pixel points form a dotted line symbol. That is, the dotted line symbol is formed by colored target pixel points and transparent target pixel points in a preset order. Further, the dotted line symbol may be any one of a line structure, a dot structure, or an alternating structure of lines and dots. And at least one colored target pixel point and at least one transparent target pixel point sequentially form a dotted line symbol according to preset positions. When the dotted line symbol is a line structure, the colored target pixel points are sequentially spliced to form lines, and the transparent target pixel points are sequentially spliced to form intervals between adjacent lines, namely the dotted line symbol of the single line structure consists of colored lines and transparent intervals. Similarly, for the broken line symbols of other structures, colored target pixel points and transparent target pixel points are spliced in sequence to form the display device. Further, the size of each of the dotted symbols may be set according to the colored target pixel point. For example, for a dashed line symbol of a line structure, the width and length of the line may be controlled by the number of colored target pixel points, and the length of the interval between adjacent lines may be controlled by the number of transparent target pixel points. For example, as shown in fig. 3, for the dotted line symbol of the required black line structure, a single dotted line symbol is set, the line length of the line is 2 target pixel points, and the interval distance between two adjacent lines is 6 target pixel points. In the coloring process, 2 adjacent target pixel points in the picture to be processed are colored to be black through a coloring device, and the other 6 target pixel points are colored to be transparent, so that a needed broken line symbol of a black line structure is formed. It should be noted that, in fig. 3, the edges of the 6 hollow black circles are actually transparent and colored, and the black edges are only used as a number indication of the target pixel points.
In order to provide rich colors, in one embodiment, the preset colors are set according to color values. For example, according to the RGB color mode, the color values of red (R), green (G) and blue (B) can be set respectively, so that a plurality of different colors can be designed, thereby meeting the color identification requirement and being convenient for distinguishing the colors of other geographic elements in the electronic map.
Step S220, screen pixel coordinates and display quantity of the dotted line symbols are obtained according to the screen position information of the boundary line to be marked on the electronic map.
In the related art, for convenience of managing and tracking data, map data is generally hierarchically processed. Specifically, the map data may be divided into a plurality of data levels from top to bottom, and one upper layer data may correspond to a plurality of lower layer data, each layer expressing the communication characteristics of different roads. Different scales may correspond to different data levels. In this embodiment, the dotted line symbol is formed at the uppermost layer of the electronic map, that is, the dotted line symbol is displayed on the data level in the electronic map currently displayed on the screen. Further, a plurality of dotted symbols are displayed at the positions of the corresponding screens of the lines to be marked of the current data hierarchy. In one embodiment, the screen position information of the boundary line to be marked is the screen pixel coordinate of the boundary line to be marked, and the dotted line symbol may be displayed at the position of the screen pixel coordinate according to the screen pixel coordinate of the boundary line to be marked in the current data hierarchy.
In order to determine the display position of each dotted line symbol, in one specific embodiment, vertex geographic coordinates of each vertex of the boundary to be marked in the electronic map are obtained; and converting the geographic coordinates of the vertexes, and calculating to obtain the screen pixel coordinates corresponding to each vertex. In particular, a line is typically represented by an ordered set of points (coordinate pairs). And a line for bending or kinking that includes multiple vertices (also referred to as inflection points). Specifically, the boundary line to be marked is the position where the dotted line symbol needs to be displayed. The boundary line is not limited to the national boundary line or boundary line, but may be other ground objects or landforms that need to be represented by a broken line. In one embodiment, the line connecting every two adjacent vertexes is a straight line, and the vertexes are sequentially connected to form a bending boundary. When the electronic map is displayed on the screen, the vertex geographic coordinates of each vertex of the boundary to be marked in the current data level are obtained. The vertex geographic coordinates are longitude and latitude coordinates of the vertex. According to the data hierarchy of the current electronic map display, the screen pixel coordinates of each vertex can be obtained according to the related technology calculation. The position of the connecting line of every two adjacent vertexes can be determined through the screen pixel coordinates of each vertex. The position of the connecting line of every two adjacent vertexes is the display position of the dotted line symbol.
In order to determine the display quantity of each dotted line symbol, in one specific embodiment, the interval length between two adjacent vertexes is calculated and obtained according to the screen pixel coordinate of each vertex; accumulating the interval length between every two adjacent vertexes, and calculating to obtain the total length of the boundary line to be marked; and calculating to obtain the number of the dotted line symbols to be displayed according to the total length divided by the number of the target pixel points of the single dotted line symbol. For example, the dashed-line symbol of the black line structure in the above embodiment includes 2 colored target pixel points and 6 transparent target pixel points, i.e., a single dashed-line symbol includes 8 target pixel points. The total length of the boundary line to be marked is calculated, and then divided by 8, namely the number of the dotted line symbols to be displayed on the boundary line to be displayed. As shown in fig. 4, when the calculation results in that 3 dotted symbols need to be displayed, the three dotted symbols are connected end to end in order to form a dotted texture of the line structure.
In this step, the positions and the number of the display of the dotted line symbols can be determined by obtaining the screen pixel coordinates and the display number of the dotted line symbols.
In step S230, each of the dotted symbols is sequentially spliced according to the screen pixel coordinates and the display number of the dotted symbols to form a dotted texture picture and displayed on the screen.
It is understood that a picture is made up of target pixels having locations and colors. In one specific embodiment, a target pixel point in the dashed texture picture is identified, each target pixel point is colored according to a preset color, and a plurality of colored target pixel points form a dashed symbol. And according to the display quantity, splicing a plurality of dotted line symbols according to the pixel coordinate sequence of the screen to form a complete dotted line texture picture.
In the above embodiment, the target pixel point is colored and transparent according to the preset color to form a single dotted line symbol, and the plurality of dotted line symbols form a continuous and complete dotted line texture picture according to the corresponding screen pixel coordinates and the display number. Such a design is, on the one hand. The dotted line texture is displayed in the form of a picture, so that the needed dotted line texture is more easily configured and obtained; on the other hand, the needed dotted line effect can be realized on the electronic map by changing the picture without changing the map data in the electronic map, and the operation is simple and convenient.
Corresponding to the embodiment of the implementation method of the application function, the application also provides a device for generating the broken line texture, electronic equipment and corresponding embodiments. Specifically, the apparatus described in the embodiment of the present application may implement part or all of the flow in the embodiment of the method for generating a dashed texture described in connection with fig. 1 to 4.
Example III
Fig. 5 is a schematic structural diagram of a device for generating a texture of a broken line according to an embodiment of the present application.
Referring to fig. 5, the embodiment provides a device for generating a texture of a dotted line, which includes a coloring module 410, a dotted line information obtaining module 420, and a texture display module 430. Wherein:
the coloring module 410 is configured to color the target pixel point in the image to be processed according to a preset color, so as to form a dotted line symbol.
The dotted line information obtaining module 420 is configured to obtain screen position information of a boundary line to be marked on the electronic map, and calculate the display number of the dotted line symbols obtained by the coloring module 410.
The texture display module 430 is configured to display the dotted textures at the corresponding positions of the electronic map after sequentially splicing the dotted symbols according to the display number of the dotted symbols and the screen position information of the boundary line to be marked obtained by the dotted information obtaining module 420.
Further, the coloring module 410 may color the target pixel according to a preset color. The coloring module 410 performs colored coloring on a part of target pixel points in the image to be processed according to a preset color to form colored target pixel points; transparent coloring is carried out on the other part of the target pixel points to form transparent target pixel points; the colored target pixel points and the transparent target pixel points form a single complete dotted line symbol. The preset color comprises at least one color set according to color values. Specifically, at least one colored target pixel point and at least one transparent target pixel point sequentially form a dotted line symbol according to preset positions. The colored target pixel points form any one of a line structure, a dot structure or a line and dot alternate structure, so that a line, a dot or a line and dot alternate dotted line texture can be formed.
The broken line information acquisition module 420 acquires the display position and the display number of the broken line symbols according to the screen position information of the boundary line to be marked. Specifically, obtaining the vertex geographic coordinates of each vertex of the boundary to be marked in the electronic map; and converting the geographic coordinates of the vertexes, and calculating to obtain the screen pixel coordinates corresponding to each vertex, so that the display position of the dotted line symbol can be obtained. The display position of the dotted line symbol is the position where every two adjacent vertex lines are located. Further, according to the screen pixel coordinates of each vertex, calculating and obtaining the interval length between two adjacent vertexes; accumulating the interval length between every two adjacent vertexes, and calculating to obtain the total length of the boundary line to be marked; the number of the dotted line symbols to be displayed can be calculated and obtained according to the total length divided by the number of the target pixel points of the single dotted line symbol.
The texture display module 430 displays the colored plurality of dotted symbols at the positions of the screen of the boundary line to be marked. Specifically, according to the screen pixel coordinates and the display quantity of the dotted line symbols, each dotted line symbol is spliced in sequence to form a dotted line texture picture and displayed on the screen.
According to the generating device of the dotted line texture, the dotted line texture is displayed in the form of a picture, the color of pixels in the picture can be flexibly configured through the coloring module, and the dotted line symbols are spliced according to the display quantity and the display positions according to the screen position information of the boundary line to be marked finally through the dotted line information acquisition module, so that complete continuous dotted line texture is formed and displayed on the screen. The device provided by the application is flexible and simple in configuration, and can meet the equipment requirement of insufficient hardware conditions. That is, the device of the application can be applied to equipment with better hardware conditions, equipment with poorer hardware conditions and wide application.
The specific manner in which the respective modules perform the operations in the apparatus of the above embodiments has been described in detail in the embodiments related to the method, and will not be described in detail herein.
For a specific description of the apparatus for generating the dotted line texture, reference may be made to the description of the method for generating the dotted line texture hereinabove, and the description thereof will not be repeated here. The respective modules in the above-described generation apparatus of the broken line texture may be implemented in whole or in part by software, hardware, or a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application. The electronic device may be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, navigation devices, portable wearable devices, and the like.
Referring to fig. 6, an electronic device 500 includes a memory 510 and a processor 520.
The processor 520 may be a central processing unit (Central Processing Unit, CPU), but may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Memory 510 may include various types of storage units, such as system memory, read Only Memory (ROM), and persistent storage systems. Where the ROM may store static data or instructions that are required by the processor 520 or other modules of the computer. The persistent storage system may be a read-write capable storage system. The persistent storage system may be a non-volatile storage device that does not lose stored instructions and data even after the computer is powered down. In some embodiments, the persistent storage system employs a mass storage system (e.g., magnetic or optical disk, flash memory) as the persistent storage system. In other embodiments, the persistent storage system may be a removable storage device (e.g., diskette, optical drive). The system memory may be a read-write memory device or a volatile read-write memory device, such as dynamic random access memory. The system memory may store instructions and data that are required by some or all of the processors at runtime. Furthermore, memory 510 may include any combination of computer-readable storage media, including various types of semiconductor memory chips (DRAM, SRAM, SDRAM, flash memory, programmable read-only memory), magnetic disks, and/or optical disks may also be employed. In some embodiments, memory 510 may include a readable and/or writable removable storage device such as a Compact Disc (CD), a read-only digital versatile disc (e.g., DVD-ROM, dual layer DVD-ROM), a read-only blu-ray disc, an ultra-dense disc, a flash memory card (e.g., SD card, min SD card, micro-SD card, etc.), a magnetic floppy disk, and the like. The computer readable storage medium does not contain a carrier wave or an instantaneous electronic signal transmitted by wireless or wired transmission.
The memory 510 has stored thereon executable code that, when processed by the processor 520, causes the processor 520 to perform some or all of the methods described above.
The aspects of the present application have been described in detail hereinabove with reference to the accompanying drawings. In the foregoing embodiments, the descriptions of the embodiments are focused on, and for those portions of one embodiment that are not described in detail, reference may be made to the related descriptions of other embodiments. Those skilled in the art will also appreciate that the acts and modules referred to in the specification are not necessarily required for the present application. In addition, it can be understood that the steps in the method of the embodiment of the present application may be sequentially adjusted, combined and pruned according to actual needs, and the modules in the system of the embodiment of the present application may be combined, divided and pruned according to actual needs.
Furthermore, the method according to the application may also be implemented as a computer program or computer program product comprising computer program code instructions for performing part or all of the steps of the above-described method of the application.
Alternatively, the application may also be embodied as a non-transitory machine-readable storage medium (or computer-readable storage medium, or machine-readable storage medium) having stored thereon executable code (or a computer program, or computer instruction code) which, when executed by a processor of an electronic device (or electronic device, server, etc.), causes the processor to perform part or all of the steps of the above-described method according to the application.
Those of skill would further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the application herein may be implemented as electronic hardware, computer software, or combinations of both.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems and methods according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The foregoing description of embodiments of the application has been presented for purposes of illustration and description, and is not intended to be exhaustive or limited to the embodiments disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the various embodiments described. The terminology used herein was chosen in order to best explain the principles of the embodiments, the practical application, or the improvement of technology in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.

Claims (10)

1. A method for generating a broken line texture is characterized by comprising the following steps:
coloring a target pixel point in a picture to be processed according to a preset color to form a dotted line symbol;
acquiring screen position information of a boundary line to be marked on an electronic map, and calculating to acquire the display quantity of the dotted line symbols;
and according to the display quantity of the dotted symbols and the screen position information of the boundary line to be marked, sequentially splicing each dotted symbol, and displaying dotted textures at the corresponding positions of the electronic map.
2. The method according to claim 1, wherein coloring the target pixel point in the picture to be processed according to the preset color to form a dotted line symbol includes:
according to the preset color, carrying out colored coloring on part of the target pixel points in the picture to be processed to form colored target pixel points; transparent coloring is carried out on the other part of the target pixel points to form transparent target pixel points;
the colored target pixel points and the transparent target pixel points form a dotted line symbol.
3. The method of claim 2, wherein the colored target pixel points and the transparent target pixel points form a dashed symbol, comprising:
and at least one colored target pixel point and at least one transparent target pixel point sequentially form a dotted line symbol according to preset positions.
4. The method of claim 2, wherein the colored target pixel points form any one of a line structure, a dot structure, or a line and dot alternating structure.
5. The method according to claim 1, wherein the acquiring the screen position information of the boundary line to be marked on the electronic map includes:
obtaining vertex geographic coordinates of each vertex of a boundary to be marked in the electronic map;
and converting the geographic coordinates of the vertexes, and calculating to obtain the screen pixel coordinates corresponding to each vertex.
6. The method of claim 5, wherein the calculating the number of dashed symbols comprises:
calculating and obtaining the interval length between two adjacent vertexes according to the screen pixel coordinates of each vertex;
accumulating the interval lengths between every two adjacent vertexes, and calculating to obtain the total length of the boundary line to be marked;
and according to the total length divided by the number of the target pixel points of the single dotted line symbol, calculating to obtain the number of the dotted line symbols to be displayed.
7. The method according to any one of claims 1 to 6, wherein the preset color comprises at least one color set according to a color value.
8. A broken line texture generating apparatus, comprising:
the coloring module is used for coloring the target pixel point in the picture to be processed according to a preset color to form a dotted line symbol;
the virtual line information acquisition module is used for acquiring screen position information of a boundary line to be marked on the electronic map and calculating the display quantity of the virtual line symbols acquired by the coloring module;
and the texture display module is used for displaying the dotted textures at the corresponding positions of the electronic map after the dotted symbols are spliced in sequence according to the display quantity of the dotted symbols and the screen position information of the boundary line to be marked, which are obtained by the dotted information acquisition module.
9. An electronic device, comprising:
a processor; and
a memory having executable code stored thereon, which when executed by the processor, causes the processor to perform the method of any of claims 1-7.
10. A non-transitory machine-readable storage medium having stored thereon executable code, which when executed by a processor of an electronic device, causes the processor to perform the method of any of claims 1-7.
CN202011461946.XA 2020-12-14 2020-12-14 Method and device for generating dotted line texture and electronic equipment Active CN112330769B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011461946.XA CN112330769B (en) 2020-12-14 2020-12-14 Method and device for generating dotted line texture and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011461946.XA CN112330769B (en) 2020-12-14 2020-12-14 Method and device for generating dotted line texture and electronic equipment

Publications (2)

Publication Number Publication Date
CN112330769A CN112330769A (en) 2021-02-05
CN112330769B true CN112330769B (en) 2023-08-22

Family

ID=74301720

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011461946.XA Active CN112330769B (en) 2020-12-14 2020-12-14 Method and device for generating dotted line texture and electronic equipment

Country Status (1)

Country Link
CN (1) CN112330769B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113284215B (en) * 2021-06-09 2023-08-29 智道网联科技(北京)有限公司 High-precision map dotted line processing method and device and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101388157A (en) * 2008-09-25 2009-03-18 炬力集成电路设计有限公司 Electronic map display packing, apparatus and equipment
US8274524B1 (en) * 2011-09-28 2012-09-25 Google Inc. Map rendering using interpolation of style parameters across zoom levels
CN103782323A (en) * 2011-08-23 2014-05-07 通腾科技股份有限公司 Methods of and apparatus for displaying map information
CN103971586A (en) * 2013-01-31 2014-08-06 北京四维图新科技股份有限公司 E-map generation method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2996037B1 (en) * 2014-03-28 2017-10-04 Huawei Device Co., Ltd. Method and apparatus for determining color of interface control, and terminal device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101388157A (en) * 2008-09-25 2009-03-18 炬力集成电路设计有限公司 Electronic map display packing, apparatus and equipment
CN103782323A (en) * 2011-08-23 2014-05-07 通腾科技股份有限公司 Methods of and apparatus for displaying map information
US8274524B1 (en) * 2011-09-28 2012-09-25 Google Inc. Map rendering using interpolation of style parameters across zoom levels
CN103971586A (en) * 2013-01-31 2014-08-06 北京四维图新科技股份有限公司 E-map generation method and device

Also Published As

Publication number Publication date
CN112330769A (en) 2021-02-05

Similar Documents

Publication Publication Date Title
EP1754195B1 (en) Tile based graphics rendering
EP3170151B1 (en) Blending between street view and earth view
US8237745B1 (en) Label positioning technique to reduce crawling during zoom activities
US20120050285A1 (en) 3d building generalization for digital map applications
US9275493B2 (en) Rendering vector maps in a geographic information system
US9495767B2 (en) Indexed uniform styles for stroke rendering
JP5959637B2 (en) Rendering a text image that follows a line
US20150332487A1 (en) Encoding polygon data for fast retrieval and rendering
US10319062B2 (en) Rendering map data using descriptions of raster differences
US9684977B2 (en) Method and apparatus for road map rendering
US20130127852A1 (en) Methods for providing 3d building information
JPWO2013114558A1 (en) Map drawing device, navigation device, and map drawing method
CN112330769B (en) Method and device for generating dotted line texture and electronic equipment
KR102527827B1 (en) Dynamic restyling of digital maps
JP5738442B2 (en) Map drawing device, navigation device, and map drawing method
CN115880127A (en) Rendering format selection method and related equipment thereof
US11580649B1 (en) Graphical element rooftop reconstruction in digital map
WO2023185476A1 (en) Object rendering method and apparatus, electronic device, storage medium, and program product
JP5777736B2 (en) MAP DATA CREATION DEVICE, MAP DATA CREATION METHOD, AND STORAGE MEDIUM
CN116193050A (en) Image processing method, device, equipment and storage medium
CN112527926A (en) Electronic map rendering method, terminal and medium
CN116010541A (en) Map element thinning method and device
CN115591238A (en) Game map generation method and device, electronic device and storage medium
CN114470756A (en) Starry sky simulation method, starry sky simulation device, computer equipment and medium
CN114359456A (en) Picture pasting method and device, electronic equipment and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant