Map generation method and device

By obtaining and synthesizing edge lines in the map interface and overlaying them with the map image, the problem of low sharpness of boundary lines when enlarging the map in the game is solved, and the adaptive scaling and clarity improvement of boundary lines is achieved.

CN115501597BActive Publication Date: 2024-12-27SHANGHAI NETEASE CUICAN NETWORK TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211152518.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-21
Publication Date
2024-12-27
Estimated Expiration
2042-09-21

AI Technical Summary

Technical Problem

In games containing map interfaces, the boundary line has low clarity when enlarged, and the boundary line after enlargement becomes thicker and jagged edges appear. The existing technology has not effectively solved this problem.

Method used

By obtaining the map image and the corresponding scaling scale, the edge lines of the region are generated, and the edge lines are synthesized based on the adjacent relationship to generate a transparent boundary line image, superimpose it with the map image, and generate a target map corresponding to the scaling scale.

Benefits of technology

The boundary line adapts to the map size according to the scaling scale, improves the clarity of the map boundary line, and solves the problem of low boundary line clarity caused by map enlargement.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115501597B_ABST
    Figure CN115501597B_ABST
Patent Text Reader

Abstract

The present application discloses a map generation method and device. The method comprises: obtaining a map image and a zoom ratio corresponding to the map image, wherein the map image includes at least one region; generating edge lines of the at least one region based on the zoom ratio; synthesizing the edge lines of the at least one region based on the adjacent relationship of the at least one region to generate a boundary line image corresponding to the map image, wherein pixels other than pixels corresponding to the boundary line in the boundary line image are transparent; superimposing the boundary line image with the map image to generate a target map corresponding to the zoom ratio. The present application solves the technical problem in the related art that the clarity of the map boundary line is low due to the enlargement of the map.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of image processing, and in particular to a map generation method and device. Background Art

[0002] At present, in games that include a map interface, the game will set corresponding tasks in different areas of the map for players to complete, and the boundary lines on the map can allow players to clearly know the area they are in and where the boundary lines of the areas are, so that players can know the specific locations of each area. When players want to know the specific location of each area in the map, they will zoom in on the map. However, in the prior art, when the map is zoomed in, the boundary lines will also be magnified, and the magnified boundary lines will become thicker and jagged at the edges, resulting in low clarity of the map boundary lines.

[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0004] At least some embodiments of the present disclosure provide a map generation method and device to at least solve the technical problem in the related art that zooming in on a map results in low clarity of map boundary lines.

[0005] According to one embodiment of the present disclosure, a map generation method is provided, including: obtaining a map image and a zoom ratio corresponding to the map image, wherein the map image includes at least one area; generating edge lines of the at least one area based on the zoom ratio; synthesizing the edge lines of the at least one area based on the adjacent relationship of the at least one area to generate a boundary line image corresponding to the map image, wherein pixels in the boundary line image except for pixels corresponding to the boundary lines are transparent; and superimposing the boundary line image with the map image to generate a target map corresponding to the zoom ratio.

[0006] According to one embodiment of the present disclosure, a map generating device is also provided, including: an acquisition module, used to acquire a map image and a zoom ratio corresponding to the map image, wherein the map image includes at least one area; a generation module, used to generate edge lines of at least one area based on the zoom ratio; a synthesis module, used to synthesize the edge lines of at least one area based on the adjacent relationship of at least one area, and generate a boundary line image corresponding to the map image, wherein pixels in the boundary line image except pixels corresponding to the boundary line are transparent; and an overlay module, used to overlay the boundary line image with the map image, and generate a target map corresponding to the zoom ratio.

[0007] According to one embodiment of the present disclosure, a computer-readable storage medium is further provided, in which a computer program is stored, wherein the computer program is configured to execute any of the above-mentioned map generation methods when run.

[0008] According to one embodiment of the present disclosure, there is also provided an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute any of the above map generation methods.

[0009] In at least some embodiments of the present disclosure, a method is adopted in which a map image and a zoom ratio corresponding to the map image are obtained, wherein the map image includes at least one area; edge lines of the at least one area are generated based on the zoom ratio; the edge lines of the at least one area are synthesized based on the adjacent relationship of the at least one area to generate a boundary line image corresponding to the map image, wherein pixels in the boundary line image except for pixels corresponding to the boundary line are transparent; the boundary line image is superimposed on the map image to generate a target map corresponding to the zoom ratio, wherein the map image and the boundary line image are generated separately to generate a boundary line image corresponding to the map image, and the target map is generated by superimposing, wherein the boundary line image is determined according to the zoom ratio, and while the map image is zoomed, the boundary line image can also be zoomed according to the corresponding zoom ratio, thereby achieving the purpose of making the boundary line adapt to the map size according to the zoom ratio, thereby achieving the technical effect of improving the clarity of the map boundary line, and further solving the technical problem in the related art that the clarity of the map boundary line is low due to enlarging the map. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] The drawings described herein are used to provide a further understanding of the present disclosure and constitute a part of the present application. The illustrative embodiments of the present disclosure and their descriptions are used to explain the present disclosure and do not constitute an improper limitation on the present disclosure. In the drawings:

[0011] Figure 1 is a hardware structure block diagram of a mobile terminal of a map processing method according to an embodiment of the present disclosure;

[0012] Figure 2 is a flow chart of a map processing method according to an embodiment of the present disclosure;

[0013] Figure 3 is a schematic diagram of an optional map image according to an embodiment of the present disclosure;

[0014] Figure 4 is a schematic diagram of an edge line optionally generated according to a scaling ratio according to an embodiment of the present disclosure;

[0015] Figure 5is a schematic diagram of an optional boundary line image according to an embodiment of the present disclosure;

[0016] Figure 6 is a schematic diagram of an optional initial shape pattern according to an embodiment of the present disclosure;

[0017] Figure 7 is a schematic diagram of an optional initial shape pattern with a large smooth transition range according to an embodiment of the present disclosure;

[0018] Figure 8 is a schematic diagram of an optional initial shape pattern with a small smooth transition range according to an embodiment of the present disclosure;

[0019] Fig. 9 is a schematic diagram of an optional edge line of a region according to an embodiment of the present disclosure;

[0020] Fig.10 is an optional schematic diagram of edge lines before being intercepted according to an embodiment of the present disclosure;

[0021] Fig.11 is an optional boundary line image according to an embodiment of the present disclosure;

[0022] Fig.12 is a schematic diagram of an optional inverted color pattern according to an embodiment of the present disclosure;

[0023] Fig.13 is a schematic diagram of an optional edge line of a second area according to an embodiment of the present disclosure;

[0024] Fig.14 is a schematic diagram of an optional multiplication result according to an embodiment of the present disclosure;

[0025] Fig.15 is a line diagram of an optional RGB three channels according to an embodiment of the present disclosure;

[0026] Fig.16 is a schematic diagram of an optional transition region according to an embodiment of the present disclosure;

[0027] Fig.17 is a structural block diagram of a map processing device according to an embodiment of the present disclosure;

[0028] Fig.18 is a schematic diagram of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0029] In order to enable those skilled in the art to better understand the scheme of the present disclosure, the technical scheme in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without creative work should fall within the scope of protection of the present disclosure.

[0030] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.

[0031] In a possible implementation, the inventor has found that the technical problem of unclear map boundary lines still exists in the solution of drawing boundary lines directly on the map in the map background of the game display screen in the field of image processing after practice and careful research. Based on this, the game scene applied by the embodiment of the present disclosure can be a scene where the map interface needs to be operated. The game type targeted is generally a game with a map interface. A map processing method and device are proposed, which adopts the method of obtaining a map image and a zoom ratio corresponding to the map image, wherein the map image includes at least one area; the edge lines of at least one area are generated based on the zoom ratio; the edge lines of at least one area are synthesized based on the adjacent relationship of at least one area to generate a boundary line image corresponding to the map image, wherein the pixels in the boundary line image except the pixels corresponding to the boundary line are transparent; the boundary line image is superimposed on the map image to generate a target map corresponding to the zoom ratio. The technical concept achieves the purpose of making the map boundary line adapt to the map size according to the zoom ratio, thereby solving the technical problem of low clarity of the map boundary line caused by zooming in the map in the related art, and thus achieving the technical effect of improving the clarity of the map boundary line.

[0032] The above method embodiments involved in the present disclosure can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, the mobile terminal can be a smart phone, a tablet computer, a handheld computer, a mobile Internet device, a PAD, a game console and other terminal devices. Figure 1 FIG. 1 is a hardware structure block diagram of a mobile terminal of a map processing method according to an embodiment of the present disclosure. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 The processor 102 (only one is shown) may include, but is not limited to, a central processing unit (CPU), a graphics processing unit (GPU), a digital signal processing (DSP) chip, a microprocessor (MCU), a field-programmable logic device (FPGA), a neural network processor (NPU), a tensor processing unit (TPU), an artificial intelligence (AI) type processor, etc.) and a memory 104 for storing data. In one embodiment of the present disclosure, it may also include: an input / output device 108 and a display device 110.

[0033] In some optional embodiments mainly based on game scenarios, the above-mentioned device can also provide a human-computer interaction interface with a touch-sensitive surface, which can sense finger contact and / or gestures to perform human-computer interaction with a graphical user interface (GUI). The human-computer interaction function may include the following interactions: creating web pages, drawing, word processing, making electronic documents, games, video conferencing, instant messaging, sending and receiving emails, call interface, playing digital videos, playing digital music and / or web browsing, etc. The executable instructions for executing the above-mentioned human-computer interaction functions are configured / stored in a computer program product or readable storage medium executable by one or more processors.

[0034] Those skilled in the art will understand that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.

[0035] According to one embodiment of the present disclosure, an embodiment of a map processing method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0036] In a possible implementation, the present disclosure provides a map processing method. Figure 2 is a flowchart of a map processing method according to an embodiment of the present disclosure, such as Figure 2 As shown, the method comprises the following steps:

[0037] Step S202, obtaining a map image and a zoom ratio corresponding to the map image, wherein the map image includes at least one area.

[0038] The above-mentioned map image may be an image of a virtual world map provided to players in an electronic game, or an image of a real world map provided to users in a navigation device, but is not limited thereto. The navigation device may be a mobile terminal or a vehicle-mounted terminal installed with only navigation software, and the mobile terminal here may include but is not limited to a mobile phone, a laptop computer, a tablet computer, a PDA, etc. It should be noted that in the embodiments of the present disclosure, the map image may refer to a map layer, which only contains a picture of the map but does not contain the boundary lines of different areas, such as Figure 3 As shown, Figure 3 is a schematic diagram of an optional map image according to an embodiment of the present disclosure.

[0039] The above-mentioned zoom ratio can be determined based on the user; further, the zoom ratio can be determined based on the user's operation on the map interface; further, the zoom ratio can be determined in real time based on the user's zoom operation on the map interface. In this embodiment, the zoom ratio is not specifically limited.

[0040] Optionally, the zoom ratio may also be determined in advance based on different preset ratios. The preset ratio may be a plurality of zoom ratios fixed in the map image. For example, the preset ratio may include but is not limited to: a zoom ratio of 1, 2, or 3 times; a zoom ratio of 1, 2, or 3 times.

[0041] In an optional embodiment, when the user is operating in the game screen, the map image in the game screen on which the user is operating can be determined first, wherein the map image can include one or more areas, and secondly, in response to the user's zoom operation on the map image, the zoom ratio of the map image in the game screen can be determined in real time to be 2 times, but it is not limited to this, and the specific magnification factor is determined by the actual operation.

[0042] It should be noted that the game screen can be operated by selecting with a mouse, by a capacitive pen, or by directly using a finger, but is not limited thereto.

[0043] In another optional embodiment, when the user is operating in the navigation interface, the map image in the navigation interface on which the user is operating can be first determined, wherein the map image can include one or more areas, and secondly, in response to the user's zoom operation on the map image, the zoom ratio of the map image in the navigation interface can be determined in real time to be 5 times, but is not limited to this, and the specific magnification factor is determined by the actual operation.

[0044] In another optional embodiment, map images corresponding to different magnification ratios may be generated based on different preset scale sizes, and in response to the user's zoom operation on the map image, the map image corresponding to the magnification ratio may be retrieved and displayed to the user.

[0045] In another optional embodiment, when the user is operating in the game screen, the map image in the game screen on which the user is operating can be determined first, wherein the map image can include one or more areas, and secondly, in response to the user's zoom-out operation on the map image, the zoom-out ratio of the map image in the game screen can be determined in real time to be 2 times, but not limited to this, and the specific zoom-out multiple is determined by the actual operation.

[0046] In another optional embodiment, when the user is operating in the navigation interface, the map image in the navigation interface on which the user is operating can be first determined, wherein the map image can include one or more areas, and secondly, in response to the user's zoom-out operation on the map image, the zoom-out ratio of the map image in the navigation interface can be determined in real time to be 5 times, but is not limited to this, and the specific zoom-out ratio is determined by the actual operation.

[0047] In another optional embodiment, map images corresponding to different reduction ratios may be generated based on different preset scale sizes, and in response to a user's zooming operation on the map image, a map image corresponding to the reduction ratio may be retrieved and displayed to the user.

[0048] Step S204: generating edge lines of at least one region based on the scaling ratio.

[0049] The edge line mentioned above can be a closed curve at the edge of each area in the map, and can be a binary image, where 0 represents black and 1 represents white, but it is not limited thereto. The edge line can also be other types of images. In this embodiment, a binary image is used as an example for description. Figure 4 As shown, Figure 4 It is a schematic diagram of an edge line optionally generated according to a scaling ratio according to an embodiment of the present disclosure, wherein a curve on the right is an edge line generated according to the scaling ratio.

[0050] In an optional embodiment, a parameter for controlling the size of edge lines can be generated based on the scaling ratio by using a DDX function, and based on the parameter, edge lines of at least one region can be generated, and the pixels of the edge lines can be kept consistent with the pixels of the map image when scaling, thereby improving the clarity of the edge lines after scaling. The DDX function is a function that outputs a partial derivative of a specified input value relative to the screen space X coordinate.

[0051] In another optional embodiment, when it is determined that the magnification ratio of the map in the game screen is 2 times, the parameters for controlling the edge lines can be generated based on the 2 times magnification ratio through the DDX function, and based on the parameters, the edge lines of at least one area in the map image can be generated, wherein the edge lines can be a closed curve image on the edge of each area.

[0052] In another optional embodiment, when it is determined that the magnification ratio of the map in the navigation interface is 2 times, the parameters for controlling the edge lines can be generated based on the magnification ratio of 2 through the DDX function, and based on the parameters, the edge lines of at least one area in the map image can be generated, wherein the edge lines can be a closed curve image on the edge of each area.

[0053] In another optional embodiment, after determining that the map in the game screen is reduced in scale by 5 times, the DDX function can be used to generate parameters for controlling edge lines based on the 5-fold reduction ratio. Based on the parameters, edge lines of at least one area in the map image can be generated, wherein the edge lines can be a closed curve image on the edge of each area.

[0054] In another optional embodiment, when it is determined that the map in the navigation interface is reduced in scale by 5 times, parameters for controlling edge lines can be generated based on the 5-fold reduction ratio through a DDX function, and based on the parameters, edge lines of at least one area in the map image can be generated, wherein the edge lines can be a closed curve image on the edge of each area.

[0055] Step S206, synthesizing the edge lines of at least one area based on the neighboring relationship of at least one area to generate a boundary line image corresponding to the map image, wherein pixels in the boundary line image except for pixels corresponding to the boundary line are transparent.

[0056] The above-mentioned neighbor relationship may be a neighbor relationship between any two areas among the multiple areas, that is, the two areas are connected.

[0057] The above-mentioned boundary line image includes images of boundary lines of different regions, that is, the boundary line image may refer to a line layer, where the boundary lines may be lines obtained by intercepting all edge lines, and the boundary lines of different regions may intersect, but may not cross. Figure 5 As shown, Figure 5 is a schematic diagram of an optional boundary line image according to an embodiment of the present disclosure, wherein the boundary line of the most central area is a closed line, and the boundary lines of other areas adjacent to the most central area intersect with the boundary line of the most central area but do not cross, that is, the boundary lines of other areas are non-closed lines, and Figure 5In an optional embodiment, when the map image contains only one region, the edge line of the region can be obtained first, and then the edge line can be redrawn according to the edge line, and the pixels other than the pixels corresponding to the redrawn edge line can be made transparent, so that the boundary line image corresponding to the map image can be obtained.

[0058] In another optional embodiment, when the map image contains multiple areas, the edge lines of each area can be obtained first, and then the intersecting edge lines can be cropped based on the adjacent relationship of each area, that is, the cropped edge lines can be obtained, and then the edge lines can be redrawn according to the cropped edge lines, and the pixels outside the pixels corresponding to the redrawn edge lines are made transparent, that is, the boundary line image corresponding to the map image can be obtained.

[0059] Step S208: superimpose the boundary line image and the map image to generate a target map corresponding to the zoom ratio.

[0060] In an optional embodiment, after a separate boundary line image is generated based on the zoom ratio, since the pixels in the boundary line image other than the pixels corresponding to the boundary line are transparent, the map image and the boundary line image can be superimposed through the lerp function, that is, the target map corresponding to the zoom ratio can be obtained. The lerp function can calculate the linear interpolation between two values ​​A and B through Alpha

[0061] It should be noted that the function for superimposing images is not limited to the lerp function, but may be any one or more functions that can superimpose images. In this embodiment, the lerp function is taken as an example for description.

[0062] In at least some embodiments of the present disclosure, a method is adopted in which a map image and a zoom ratio corresponding to the map image are obtained, wherein the map image includes at least one area; edge lines of the at least one area are generated based on the zoom ratio; the edge lines of the at least one area are synthesized based on the adjacent relationship of the at least one area to generate a boundary line image corresponding to the map image, wherein pixels in the boundary line image except for pixels corresponding to the boundary line are transparent; the boundary line image is superimposed on the map image to generate a target map corresponding to the zoom ratio, wherein the map image and the boundary line image are generated separately to generate a boundary line image corresponding to the map image, and the target map is generated by superimposing, wherein the boundary line image is determined according to the zoom ratio, and while the map image is zoomed, the boundary line image can also be zoomed according to the corresponding zoom ratio, thereby achieving the purpose of making the boundary line adapt to the map size according to the zoom ratio, thereby achieving the technical effect of improving the clarity of the map boundary line, and further solving the technical problem in the related art that the clarity of the map boundary line is low due to enlarging the map.

[0063] Optionally, edge lines of at least one area are generated based on a scaling ratio, including: generating an initial shape pattern corresponding to the at least one area; determining a first smooth transition range and a second smooth transition range corresponding to the initial shape pattern based on the scaling ratio, wherein the first smooth transition range is smaller than the second smooth transition range; performing a smooth transition on the edge of the graphic using the first smooth transition range and the second smooth transition range, respectively, to obtain a first target shape pattern and a second target shape pattern; and obtaining a difference between the first target shape pattern and the second target shape pattern to obtain edge lines of at least one area.

[0064] The initial shape pattern may be a pattern corresponding to the shape range of each area generated by Photoshop software, but is not limited thereto, and may also be other software. In this embodiment, Photoshop software is used as an example for explanation. The initial shape pattern may be a binary image, and the pixels corresponding to the initial shape pattern are white, and the other pixels are black, but is not limited thereto. Figure 6 As shown, Figure 6 is a schematic diagram of an optional initial shape pattern according to an embodiment of the present disclosure.

[0065] In an optional embodiment, an initial shape pattern of at least one region may be generated first, wherein pixels representing the range of the corresponding region in the initial shape pattern are white, and other pixels are black.

[0066] The above-mentioned first smooth transition range and second smooth transition range may be a range that enables the edge of the pattern shape in the initial shape pattern to transition from white to black. For example, when 1 represents white and 0 represents black, the smooth transition ranges of 0 and 1 may be modified by the smoothstep function to allow white to approach black, wherein the larger the smooth transition range, the smaller the range of transition from white to black. For example, the first smooth transition range may be 0.2-0.25, which indicates that the range of transition from white to black is smaller, that is, the narrower the gray part, the larger the white part of the first target shape pattern. It should be noted that the first smooth transition range is determined by the first range value and the first smoothing value. For example, the second smooth transition range may be 0-0.05, which indicates that the range of transition from white to black is larger, that is, the wider the gray part, the smaller the white part of the second target shape pattern. It should be noted that the second smooth transition range is determined by the second range value and the second smoothing value.

[0067] The first target shape pattern mentioned above can be an initial shape pattern with a smaller transition range when the edge of the pattern shape transitions from white to black, such as Figure 7 As shown, Figure 7 is a schematic diagram of an optional initial shape pattern with a large smooth transition range according to an embodiment of the present disclosure; the second target shape pattern may be an initial shape pattern with a large transition range when the edge of the pattern shape transitions from white to black, such as Figure 8 As shown, Figure 8 It is a schematic diagram of an optional initial shape pattern with a small smooth transition range according to an embodiment of the present disclosure.

[0068] In another optional embodiment, the first smooth transition range and the second smooth transition range can be determined by the following method: obtaining the first preset transition range and the second preset transition range; determining the target partial derivative based on the scaling ratio; respectively obtaining the product of the target partial derivative and the first preset transition range and the second preset transition range to obtain the first smooth transition range and the second smooth transition range.

[0069] The above-mentioned target partial derivative may be a partial derivative that can obtain the first smoothing range and the second smoothing range, and may be obtained by a DDX function based on a scaling ratio. In this embodiment, θ is taken as an example for explanation.

[0070] Among them, the first preset transition range is the range from the first range value to the first preset value, and the first preset value is the sum of the first range value and the first smoothing value; the second preset transition range is the range from the second range value to the second preset value, and the second preset value is the sum of the second range value and the second smoothing value.

[0071] The first range value mentioned above may be F1, the first smoothing value may be P1, and the first preset value may be F1+P1, so the first preset transition range may be F1-F1+P1.

[0072] In another optional embodiment, when the first range value is 0.2 and the first smoothing value is 0.05, the first preset value may be 0.25, so the first preset transition range may be 0.2-0.25, but is not limited thereto.

[0073] The second range value mentioned above may be F2, the second smoothing value may be P2, and the second preset value may be F2+P2, so the second preset transition range may be F2-F2+P2.

[0074] In another optional embodiment, when the second range value is 0 and the second smoothing value is 0.05, the second preset value may be 0-0.05, so the second preset transition range may be 0-0.05, but is not limited thereto.

[0075] In another optional embodiment, after obtaining the first preset transition range and the second preset transition range, the target partial derivative can be obtained based on the scaling ratio through the DDX function; secondly, the product of the first preset transition range and the target partial derivative, and the product of the second preset transition range and the target partial derivative can be obtained, that is, the first smooth transition range and the second smooth transition range can be obtained.

[0076] In another optional embodiment, after obtaining the first preset transition range and the second preset transition range, the target partial derivative θ can be firstly obtained through the DDX function, and then θ can be multiplied by F1-F1+P1 and F2-F2+P2 respectively, that is, the first smooth transition range can be θ*(F1-F1+P1), and the second smooth transition range can be θ*(F2-F2+P2), but not limited to this.

[0077] In another optional embodiment, after obtaining the first smooth transition range and the second smooth transition range, the edge of the initial image can be smoothly transitioned based on the first smooth transition range and the second smooth transition range, that is, the first target shape pattern and the second target shape pattern can be obtained, wherein the transition range of the first target shape pattern is smaller than the transition range of the second target shape pattern.

[0078] In another optional embodiment, after obtaining the first target shape pattern and the second target shape pattern, the difference between the first target shape pattern and the second target shape pattern can be obtained, that is, the edge line of at least one area can be obtained, such as Fig. 9 As shown, Fig. 9 It is a schematic diagram of edge lines of an optional area according to an embodiment of the present disclosure.

[0079] Optionally, the edge lines of at least one area are synthesized based on the adjacent relationship of at least one area to generate a boundary line image corresponding to the map image, including: intercepting the edge lines of at least one area based on the adjacent relationship of at least one area to obtain the boundary lines corresponding to the at least one area; merging the boundary lines corresponding to the at least one area to generate the boundary line image.

[0080] In an optional embodiment, the boundary line corresponding to at least one area can be obtained by the following method: obtaining the boundary line corresponding to the first area in at least one area; determining the second area adjacent to the first area in the at least one area based on the adjacent relationship of the at least one area; and intercepting the edge lines of the second area based on the second target shape pattern corresponding to the first area to obtain the boundary line corresponding to the second area.

[0081] The first area mentioned above may be the most central area in the map image, or the area adjacent to the most central area and the surrounding area; the second area mentioned above may be an area adjacent to the first area, and may be one or more.

[0082] In an optional embodiment, when there is only one area in the map image, the edge lines of the area are the boundary line image.

[0083] In another optional embodiment, when there are multiple areas in the map image, the most central area in the map image (i.e., the first area) can be determined first, and the boundary line corresponding to the first area can be obtained. Secondly, based on the adjacent relationship, a second area adjacent to the first area can be determined, and the edge lines of the second area can be intercepted based on the second target shape pattern of the first area to obtain the boundary line corresponding to the second area. Finally, the boundary lines corresponding to multiple areas can be merged to generate a boundary line image.

[0084] Fig.10 is an optional schematic diagram of edge lines before being intercepted according to an embodiment of the present disclosure, Fig.11 is an optional boundary line image according to an embodiment of the present disclosure, such as Fig.10 , 11 As shown, the dotted line portion represents multiple areas, the solid line portion represents the boundary lines of multiple areas, before the edge lines are intercepted, the edge lines of the second area intersect with the second target shape of the first area, and after the edge lines are intercepted, the obtained boundary line image intersects with the boundary lines of the first area but does not cross.

[0085] In another optional embodiment, when there are multiple areas in the map image, first, the area adjacent to the most central area and the surrounding areas in the map image (i.e., the first area) can be determined, and the boundary line corresponding to the first area can be obtained. Secondly, based on the adjacent relationship, multiple second areas adjacent to the first area are determined, and the edge lines of the multiple second areas are intercepted based on the second target shape pattern of the first area, so that the boundary lines corresponding to the multiple second areas can be obtained. Finally, the boundary lines corresponding to the multiple areas are merged to generate a boundary line image.

[0086] Optionally, the edge lines of the second area are intercepted based on the second target shape pattern corresponding to the first area to obtain the boundary line corresponding to the second area, including: inverting the second target shape pattern to obtain an inverted pattern; determining the original pixel value of each first pixel on the edge line of the second area, and the pixel value of the second pixel corresponding to each first pixel in the inverted pattern; obtaining the product of the original pixel value of the first pixel and the pixel value of the second pixel to obtain the target pixel value of each first pixel; based on the target pixel value of each first pixel on the edge line of the second area, determine the boundary line corresponding to the second area.

[0087] The above-mentioned inverse color pattern can be a pattern with a color opposite to that of the second target shape pattern. For example, the white part in the second target shape pattern is black in the inverse color pattern, and the black part in the second target shape pattern is white in the inverse color pattern. Fig.12 As shown, Fig.12 is a schematic diagram of an optional inverted color pattern according to an embodiment of the present disclosure, wherein the white portion in the second target shape pattern is black in the inverted color pattern, and the black portion in the second target shape pattern is white in the inverted color pattern.

[0088] In an optional embodiment, the second target shape pattern may be firstly subjected to color inversion processing, that is, an inverted color pattern may be obtained.

[0089] The original pixel value of each first pixel mentioned above can be 1 for white and 0 for black, but is not limited to this. Fig.13 As shown, Fig.13 This is a schematic diagram of an optional edge line of a second area according to an embodiment of the present disclosure, wherein the first white pixel value on the edge line is 1, and the first black pixel value is 0.

[0090] The pixel value of the second pixel mentioned above may be 0 for white and 1 for black, but is not limited thereto. The pixel value of each second pixel corresponds to each first pixel value one by one.

[0091] In another optional embodiment, when the original pixel value of the first pixel on the edge line of the second area is 1 for white and 0 for black, the second pixel value in the inverted pattern corresponding to the original pixel value of the first pixel is 1 for white and 0 for black, but is not limited to this.

[0092] In another optional embodiment, the original pixel value of the first pixel value and the second pixel value may be multiplied one by one, so as to obtain the target pixel value of each first pixel on the edge line of the second region. For example, when 0*0, 0 (i.e., black) may be obtained, when 0*1, 0 (i.e., black) may be obtained, when 1*0, 0 (i.e., black) may be obtained, and when 1*1, 1 (i.e., white) may be obtained.

[0093] In another optional embodiment, after obtaining the target pixel value of each first pixel on the edge line of the second area, the color of each target pixel value can be determined, that is, the boundary line corresponding to the second area can be determined, such as Fig.14 As shown, Fig.14 It is a schematic diagram of an optional product result according to an embodiment of the present disclosure, and a boundary line corresponding to the second area can be obtained.

[0094] Optionally, obtaining a boundary line corresponding to a first area in at least one area includes: in response to the boundary line corresponding to the first area being a closed curve, determining an edge line of the first area as the boundary line corresponding to the first area; in response to the boundary line corresponding to the first area not being a closed curve, intercepting the edge line of at least one area based on an adjacent relationship of at least one area to obtain the boundary line corresponding to the first area.

[0095] In an optional embodiment, when there is only one area in the map image, the edge line of the first area can be obtained because there is no need to intercept the edge line, that is, the edge line of the first area can be determined as the boundary line corresponding to the first area.

[0096] In another optional embodiment, when there are multiple areas in the map image, because the second area is adjacent to the first area, it is necessary to intercept the edge lines of the first area based on the adjacent relationship, that is, to intercept the intersecting edge lines, so as to obtain the boundary line corresponding to the first area.

[0097] The technical solution provided by the present invention needs to separate the map and the lines into two layers, process the line layer separately, and then overlay the line layer on the map layer.

[0098] Therefore, it is necessary to separate the two layers to produce it. First, the regular map layer is the map image, in which there are no boundary lines on the map image. Then the lines are a separate layer. Looking at the line layer alone, except for the pixels of the lines, other places are transparent.

[0099] Use the lerp function in the shader to merge the map image and the line image together and finally combine them into a whole.

[0100] The line processing methods and principles are as follows:

[0101] Draw the shape of the area in Photoshop software, and process the edges into soft edges, that is, gradually reduce the white color outwards. The soft edges are to prepare for the subsequent lines to adapt to the map size.

[0102] Use the three RGB channels of the texture. The red channel is the closed loop line in the middle, the green channel is the line that intersects the red channel, and the blue channel is the line that intersects both red and green. Fig.15 As shown, Fig.15 It is a line diagram of an optional RGB three channels according to an embodiment of the present disclosure.

[0103] Shader core code: Use the smoothstep function to process the edge of the graphic, making the edge a hard edge. The so-called hard edge means that the transition between black and white is less or no transition. In graphics, black and white are represented by 0 for black, 1 for white, and gray between 0 and 1. Fig.16 is a schematic diagram of an optional transition region according to an embodiment of the present disclosure, such as Fig.16 As shown in the figure, the gray part between the two arrows gradually transitions from black to white, corresponding to the transition value between 0 and 1. The Smoothstep function can modify the range of 0 and 1, making white closer to black, so that the display range of white can be scaled between gray. The range value controls the scaling range. The larger the value, the smaller the range.

[0104] Use different range values ​​to process twice to get two results with different range sizes, then use the result of the large range to subtract the result of the small range to get the final line shape. The specific implementation method is as follows:

[0105] like Figure 7 As shown, the range value A is 0, such as Figure 8As shown, the range value B is 0.2, the white range of A is larger than that of B, and the white in the larger range is subtracted from the white in the smaller range; using the above steps to process the three channels of RGB respectively, you will get 3 different shape results A and B, 3 different line shapes; let the shape result B of the R channel be inverted (that is, black becomes white, and white becomes black), and multiply the shape result B of the R channel after inversion by the line result of the B channel, so that you can get a G channel line shape that eliminates the white part in the white range of the R channel; then add the line result of the R channel to the line shape of the G channel that eliminates the white part in the white range of the R channel, and get a line result that intersects but does not cross.

[0106] The processing method for other channels is the same as that for the R channel and will not be repeated here.

[0107] Use the DDX function to affect the parameters that control the size of the shape edge so that the line can always maintain the same pixel size as the screen when scaling. The specific implementation method is as follows:

[0108] The output of the DDX function is the partial derivative of the specified input value relative to the X coordinate of the screen space. The output value is related to the proportion of the input value in the screen, that is, when the image is enlarged, the value will become smaller, and when the image is reduced, the value will become larger. The output value of the DDZ function is multiplied by the range value and the smoothing value respectively, so that both values ​​are affected by the DDX function. Then, when the image is scaled, the range value and the smoothing value will automatically change, which will form the effect that the more the image is enlarged, the smaller the line becomes. The final visual effect is that no matter how the image is scaled, the relative size of the line relative to the screen remains unchanged. Finally, the lerp function is used to merge the final line color and map image, so that the line and the map become a whole, which is convenient for unified scaling of the line and the map.

[0109] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present disclosure, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present disclosure.

[0110] In this embodiment, a map processing device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the terms "unit" and "module" can be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0111] Fig.17 is a structural block diagram of a map processing device according to an embodiment of the present disclosure, such as Fig.17 As shown, the device includes: an acquisition module 1702, used to acquire a map image and a zoom ratio corresponding to the map image, wherein the map image includes at least one area; a generation module 1704, used to generate edge lines of at least one area based on the zoom ratio; a synthesis module 1706, used to synthesize the edge lines of at least one area based on the adjacent relationship of at least one area, and generate a boundary line image corresponding to the map image, wherein pixels in the boundary line image except for pixels corresponding to the boundary line are transparent; an overlay module 1708, used to overlay the boundary line image with the map image, and generate a target map corresponding to the zoom ratio.

[0112] Optionally, the generation module includes: a generation unit for generating an initial shape pattern corresponding to at least one area; a determination unit for determining a first smooth transition range and a second smooth transition range corresponding to the initial shape pattern based on a scaling ratio, wherein the first smooth transition range is smaller than the second smooth transition range; a processing unit for smoothing the edge of the graphic using the first smooth transition range and the second smooth transition range, respectively, to obtain a first target shape pattern and a second target shape pattern; an acquisition unit for acquiring the difference between the first target shape pattern and the second target shape pattern to obtain the edge line of at least one area.

[0113] Optionally, the determination unit includes: a first acquisition subunit, used to acquire a first preset transition range and a second preset transition range; a first determination subunit, used to determine a target partial derivative based on a scaling ratio; and a second acquisition subunit, used to respectively acquire the product of the target partial derivative and the first preset transition range and the second preset transition range to obtain a first smooth transition range and a second smooth transition range.

[0114] Optionally, the first preset transition range is a range from a first range value to a first preset value, and the first preset value is the sum of the first range value and the first smoothing value; the second preset transition range is a range from a second range value to a second preset value, and the second preset value is the sum of the second range value and the second smoothing value.

[0115] Optionally, the synthesis module includes: a capture unit for capturing edge lines of at least one area based on the adjacent relationship of at least one area to obtain a boundary line corresponding to at least one area; and a synthesis unit for merging boundary lines corresponding to at least one area to generate a boundary line image.

[0116] Optionally, the interception unit includes: a third acquisition subunit, used to acquire a boundary line corresponding to a first area in at least one area; a second determination subunit, used to determine a second area adjacent to the first area in at least one area based on the adjacent relationship of at least one area; and an interception subunit, used to intercept the edge lines of the second area based on a second target shape pattern corresponding to the first area to obtain a boundary line corresponding to the second area.

[0117] Optionally, the interception subunit is also used to: invert the second target shape pattern to obtain an inverted pattern; determine the original pixel value of each first pixel on the edge line of the second area, and the pixel value of the second pixel corresponding to each first pixel in the inverted pattern; obtain the product of the original pixel value of the first pixel and the pixel value of the second pixel to obtain the target pixel value of each first pixel; based on the target pixel value of each first pixel on the edge line of the second area, determine the boundary line corresponding to the second area.

[0118] Optionally, the third acquisition sub-unit is also used to: in response to the boundary line corresponding to the first area being a closed curve, determine the edge line of the first area as the boundary line corresponding to the first area; in response to the boundary line corresponding to the first area not being a closed curve, intercept the edge line of at least one area based on the adjacent relationship of at least one area to obtain the boundary line corresponding to the first area.

[0119] It should be noted that the above-mentioned units and modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to this: the above-mentioned units and modules are all located in the same processor; or, the above-mentioned units and modules are located in different processors in any combination.

[0120] An embodiment of the present disclosure further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.

[0121] Optionally, in this embodiment, the above-mentioned computer-readable storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.

[0122] Optionally, in this embodiment, the computer-readable storage medium may be located in any one of the computer terminals in a computer terminal group in a computer network, or in any one of the mobile terminals in a mobile terminal group.

[0123] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program for performing the following steps:

[0124] Step S1: obtaining a map image and a zoom ratio corresponding to the map image, wherein the map image includes at least one area;

[0125] Step S2: generating edge lines of at least one area based on the scaling ratio;

[0126] Step S3: synthesizing the edge lines of at least one area based on the neighboring relationship of at least one area to generate a boundary line image corresponding to the map image, wherein pixels in the boundary line image other than pixels corresponding to the boundary line are transparent;

[0127] Step S4: superimpose the boundary line image and the map image to generate a target map corresponding to the zoom ratio.

[0128] Optionally, the above-mentioned computer-readable storage medium is also configured to store program codes for performing the following steps: generating an initial shape pattern corresponding to at least one area; determining a first smooth transition range and a second smooth transition range corresponding to the initial shape pattern based on a scaling ratio, wherein the first smooth transition range is smaller than the second smooth transition range; performing a smooth transition on the edge of the graphic using the first smooth transition range and the second smooth transition range, respectively, to obtain a first target shape pattern and a second target shape pattern; obtaining the difference between the first target shape pattern and the second target shape pattern to obtain the edge lines of at least one area.

[0129] Optionally, the above-mentioned computer-readable storage medium is also configured to store program codes for executing the following steps: obtaining a first preset transition range and a second preset transition range; determining a target partial derivative based on a scaling ratio; respectively obtaining the product of the target partial derivative and the first preset transition range and the second preset transition range to obtain a first smooth transition range and a second smooth transition range.

[0130] Optionally, the computer-readable storage medium is also configured to store program codes for executing the following steps: the first preset transition range is a range from a first range value to a first preset value, the first preset value being the sum of the first range value and the first smoothing value; the second preset transition range is a range from a second range value to a second preset value, the second preset value being the sum of the second range value and the second smoothing value.

[0131] Optionally, the above-mentioned computer-readable storage medium is also configured to store program codes for executing the following steps: intercepting the edge lines of at least one area based on the adjacent relationship of at least one area to obtain the boundary lines corresponding to at least one area; merging the boundary lines corresponding to at least one area to generate a boundary line image.

[0132] Optionally, the above-mentioned computer-readable storage medium is also configured to store program codes for executing the following steps: obtaining a boundary line corresponding to a first area in at least one area; determining a second area adjacent to the first area in at least one area based on the adjacent relationship of at least one area; and intercepting the edge lines of the second area based on a second target shape pattern corresponding to the first area to obtain a boundary line corresponding to the second area.

[0133] Optionally, the computer-readable storage medium is also configured to store program codes for executing the following steps: inverting the second target shape pattern to obtain an inverted pattern; determining the original pixel value of each first pixel on the edge line of the second area, and the pixel value of the second pixel corresponding to each first pixel in the inverted pattern; obtaining the product of the original pixel value of the first pixel and the pixel value of the second pixel to obtain the target pixel value of each first pixel; and determining the boundary line corresponding to the second area based on the target pixel value of each first pixel on the edge line of the second area.

[0134] Optionally, the computer-readable storage medium is also configured to store program codes for executing the following steps: in response to the boundary line corresponding to the first area being a closed curve, determining the edge line of the first area as the boundary line corresponding to the first area; in response to the boundary line corresponding to the first area not being a closed curve, intercepting the edge line of at least one area based on the adjacent relationship of at least one area to obtain the boundary line corresponding to the first area.

[0135] In the computer-readable storage medium of this embodiment, a technical solution for map processing is provided. The method adopts the following steps: obtaining a map image and a zoom ratio corresponding to the map image, wherein the map image includes at least one region; generating edge lines of at least one region based on the zoom ratio; synthesizing the edge lines of at least one region based on the adjacent relationship of at least one region to generate a boundary line image corresponding to the map image, wherein pixels other than pixels corresponding to the boundary line in the boundary line image are transparent; superimposing the boundary line image with the map image to generate a target map corresponding to the zoom ratio, by generating the map image and the boundary line image separately, generating a boundary line image corresponding to the map image, and generating the target map by superimposing, wherein the boundary line image is determined according to the zoom ratio, and while scaling the map image, the boundary line image can also be scaled according to the corresponding zoom ratio, so as to achieve the purpose of making the boundary line adapt to the map size according to the zoom ratio, thereby achieving the technical effect of improving the clarity of the map boundary line, and thus solving the technical problem of low clarity of the map boundary line caused by enlarging the map in the related art.

[0136] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a computer-readable storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.

[0137] In an exemplary embodiment of the present application, a program product capable of implementing the above method of the present embodiment is stored on a computer-readable storage medium. In some possible implementations, various aspects of the embodiments of the present disclosure may also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps described in the above "Exemplary Method" section of the present embodiment according to various exemplary implementations of the present disclosure.

[0138] According to the program product for implementing the above method in the embodiment of the present disclosure, it can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the embodiment of the present disclosure is not limited to this. In the embodiment of the present disclosure, the computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.

[0139] The program product may be in any combination of one or more computer-readable media. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples (non-exhaustive) of computer-readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.

[0140] It should be noted that the program code contained in the computer-readable storage medium can be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the above.

[0141] An embodiment of the present disclosure further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0142] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0143] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:

[0144] Step S1: obtaining a map image and a zoom ratio corresponding to the map image, wherein the map image includes at least one area;

[0145] Step S2: generating edge lines of at least one area based on the scaling ratio;

[0146] Step S3: synthesizing the edge lines of at least one area based on the neighboring relationship of at least one area to generate a boundary line image corresponding to the map image, wherein pixels in the boundary line image other than pixels corresponding to the boundary line are transparent;

[0147] Step S4: superimpose the boundary line image and the map image to generate a target map corresponding to the zoom ratio.

[0148] Optionally, the processor can also be configured to perform the following steps through a computer program: generate an initial shape pattern corresponding to at least one area; determine a first smooth transition range and a second smooth transition range corresponding to the initial shape pattern based on a scaling ratio, wherein the first smooth transition range is smaller than the second smooth transition range; use the first smooth transition range and the second smooth transition range to perform a smooth transition on the edge of the graphic, respectively, to obtain a first target shape pattern and a second target shape pattern; obtain the difference between the first target shape pattern and the second target shape pattern, to obtain the edge line of at least one area.

[0149] Optionally, the above-mentioned processor can also be configured to perform the following steps through a computer program: obtaining a first preset transition range and a second preset transition range; determining a target partial derivative based on a scaling ratio; respectively obtaining the product of the target partial derivative and the first preset transition range and the second preset transition range to obtain a first smooth transition range and a second smooth transition range.

[0150] Optionally, the processor can also be configured to perform the following steps through a computer program: the first preset transition range is a range from a first range value to a first preset value, the first preset value being the sum of the first range value and the first smoothing value; the second preset transition range is a range from a second range value to a second preset value, the second preset value being the sum of the second range value and the second smoothing value.

[0151] Optionally, the processor may also be configured to perform the following steps through a computer program: intercepting edge lines of at least one region based on an adjacent relationship of at least one region to obtain a boundary line corresponding to at least one region; merging boundary lines corresponding to at least one region to generate a boundary line image.

[0152] Optionally, the processor can also be configured to perform the following steps through a computer program: obtaining a boundary line corresponding to a first area in at least one area; determining a second area adjacent to the first area in at least one area based on an adjacent relationship of at least one area; and intercepting edge lines of the second area based on a second target shape pattern corresponding to the first area to obtain a boundary line corresponding to the second area.

[0153] Optionally, the processor may also be configured to perform the following steps through a computer program: inverting the second target shape pattern to obtain an inverted pattern; determining the original pixel value of each first pixel on the edge line of the second area, and the pixel value of the second pixel corresponding to each first pixel in the inverted pattern; obtaining the product of the original pixel value of the first pixel and the pixel value of the second pixel to obtain the target pixel value of each first pixel; and determining the boundary line corresponding to the second area based on the target pixel value of each first pixel on the edge line of the second area.

[0154] Optionally, the processor can also be configured to perform the following steps through a computer program: in response to the boundary line corresponding to the first area being a closed curve, determining the edge line of the first area as the boundary line corresponding to the first area; in response to the boundary line corresponding to the first area not being a closed curve, intercepting the edge line of at least one area based on the adjacent relationship of at least one area to obtain the boundary line corresponding to the first area.

[0155] In the electronic device of this embodiment, a technical solution for map processing is provided. The method adopts the following steps: obtaining a map image and a zoom ratio corresponding to the map image, wherein the map image includes at least one area; generating edge lines of the at least one area based on the zoom ratio; synthesizing the edge lines of the at least one area based on the adjacent relationship of the at least one area to generate a boundary line image corresponding to the map image, wherein pixels other than pixels corresponding to the boundary line in the boundary line image are transparent; superimposing the boundary line image with the map image to generate a target map corresponding to the zoom ratio, wherein the map image and the boundary line image are generated separately to generate a boundary line image corresponding to the map image, and the target map is generated by superimposing, wherein the boundary line image is determined according to the zoom ratio, and while the map image is zoomed, the boundary line image can also be zoomed according to the corresponding zoom ratio, so as to achieve the purpose of making the boundary line adapt to the map size according to the zoom ratio, thereby achieving the technical effect of improving the clarity of the map boundary line, and thus solving the technical problem of low clarity of the map boundary line caused by zooming in the map in the related art.

[0156] Fig.18 is a schematic diagram of an electronic device according to an embodiment of the present disclosure. Fig.18 As shown, the electronic device 1800 is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0157] like Fig.18 As shown, the electronic device 1800 is in the form of a general computing device. The components of the electronic device 1800 may include but are not limited to: at least one processor 1810, at least one memory 1820, a bus 1830 connecting different system components (including the memory 1820 and the processor 1810), and a display 1840.

[0158] The memory 1820 stores program codes, which can be executed by the processor 1810, so that the processor 1810 executes the steps described in the method section of the embodiment of the present application according to various exemplary embodiments of the present disclosure.

[0159] The memory 1820 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 18201 and / or a cache memory unit 18202, and may further include a read-only memory unit (ROM) 18203, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory.

[0160] In some examples, the memory 1820 may also include a program / utility 18204 having a set (at least one) of program modules 18205, such program modules 18205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or a combination thereof may include the implementation of a network environment. The memory 1820 may further include a memory remotely disposed relative to the processor 1810, and these remote memories may be connected to the electronic device 1800 via a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0161] Bus 1830 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a local bus of processor 1810, or a bus using any of a variety of bus architectures.

[0162] The display 1840 may be, for example, a touch screen type liquid crystal display (LCD) that may enable a user to interact with a user interface of the electronic device 1800 .

[0163] Optionally, the electronic device 1800 may also communicate with one or more external devices 1900 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), one or more devices that enable a user to interact with the electronic device 1800, and / or any device that enables the electronic device 1800 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed through an input / output (I / O) interface 1850. Furthermore, the electronic device 1800 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 1860. Fig.18 As shown, the network adapter 1860 communicates with other modules of the electronic device 1800 via the bus 1830. It should be understood that although Fig.18 Not shown, other hardware and / or software modules may be used in conjunction with electronic device 1800, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0164] The electronic device 1800 may further include: a keyboard, a cursor control device (such as a mouse), an input / output interface (I / O interface), a network interface, a power supply and / or a camera.

[0165] It can be understood by those skilled in the art that Fig.18 The structure shown is only for illustration and does not limit the structure of the above electronic device. Fig.18 More or fewer components as shown, or with Figure 1 The memory 1820 may be used to store computer programs and corresponding data, such as the computer programs and corresponding data corresponding to the map generation method in the embodiment of the present disclosure. The processor 1810 executes various functional applications and data processing by running the computer programs stored in the memory 1820, that is, implementing the above-mentioned map generation method.

[0166] The serial numbers of the above-mentioned embodiments of the present disclosure are only for description and do not represent the advantages or disadvantages of the embodiments.

[0167] In the above embodiments of the present disclosure, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0168] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0169] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0170] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0171] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present disclosure is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.

[0172] The above is only a preferred embodiment of the present disclosure. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present disclosure. These improvements and modifications should also be regarded as the scope of protection of the present disclosure.

Claims

1. A map generation method, characterized in that: include: Acquire a map image and a zoom ratio corresponding to the map image, wherein the map image includes at least one area; Generate an edge line of the at least one area based on the scaling ratio, wherein the edge line is obtained based on a first smooth transition range and a second smooth transition range corresponding to the at least one area, and the first smooth transition range and the second smooth transition range are obtained based on the scaling ratio; synthesizing edge lines of the at least one area based on the neighboring relationship of the at least one area to generate a boundary line image corresponding to the map image, wherein pixels other than pixels corresponding to the boundary line in the boundary line image are transparent; superimposing the boundary line image and the map image to generate a target map corresponding to the zoom ratio; The step of synthesizing the edge lines of the at least one area based on the adjacent relationship of the at least one area to generate a boundary line image corresponding to the map image includes: Based on the adjacent relationship of the at least one area, the edge line of the at least one area is intercepted to obtain a boundary line corresponding to the at least one area; The boundary lines corresponding to the at least one region are merged to generate the boundary line image.

2. The method according to claim 1, characterized in that Generating an edge line of the at least one area based on the scaling ratio includes: generating an initial shape pattern corresponding to the at least one region; Determine the first smooth transition range and the second smooth transition range corresponding to the initial shape pattern based on the scaling ratio, wherein the first smooth transition range is smaller than the second smooth transition range; Using the first smooth transition range and the second smooth transition range to perform smooth transition on the edge of the graphic respectively, to obtain a first target shape pattern and a second target shape pattern; A difference between the first target shape pattern and the second target shape pattern is obtained to obtain an edge line of the at least one area.

3. The method according to claim 2, characterized in that Determining a first smooth transition range and a second smooth transition range corresponding to the initial shape pattern based on the scaling ratio includes: Acquire a first preset transition range and a second preset transition range; determining a target partial derivative based on the scaling; The products of the target partial derivative, the first preset transition range and the second preset transition range are respectively obtained to obtain the first smooth transition range and the second smooth transition range.

4. The method according to claim 3, characterized in that: The first preset transition range is a range from a first range value to a first preset value, and the first preset value is the sum of the first range value and a first smoothing value; the second preset transition range is a range from a second range value to a second preset value, and the second preset value is the sum of the second range value and a second smoothing value.

5. The method according to claim 1, characterized in that The method of intercepting edge lines of the at least one region based on the adjacent relationship of the at least one region to obtain a boundary line corresponding to the at least one region includes: Acquire a boundary line corresponding to a first area in the at least one area; Based on the neighboring relationship of the at least one area, determining a second area adjacent to the first area in the at least one area; The edge lines of the second area are intercepted based on the second target shape pattern corresponding to the first area to obtain the boundary lines corresponding to the second area.

6. The method according to claim 5, characterized in that The method of intercepting edge lines of the second area based on a second target shape pattern corresponding to the first area to obtain a boundary line corresponding to the second area includes: Performing color inversion processing on the second target shape pattern to obtain an inverted color pattern; Determine an original pixel value of each first pixel on an edge line of the second area, and a pixel value of a second pixel corresponding to each first pixel in the inverted pattern; Obtaining the product of the original pixel value of the first pixel and the pixel value of the second pixel to obtain the target pixel value of each first pixel; A boundary line corresponding to the second area is determined based on the target pixel value of each first pixel on the edge line of the second area.

7. The method according to claim 5, characterized in that Acquiring a boundary line corresponding to a first area in the at least one area includes: In response to the boundary line corresponding to the first area being a closed curve, determining an edge line of the first area as the boundary line corresponding to the first area; In response to the boundary line corresponding to the first region not being a closed curve, edge lines of the at least one region are intercepted based on the adjacent relationship of the at least one region to obtain the boundary line corresponding to the first region.

8. A map generating device, characterized in that: include: An acquisition module, used to acquire a map image and a zoom ratio corresponding to the map image, wherein the map image includes at least one area; a generating module, configured to generate an edge line of the at least one region based on the scaling ratio, wherein the edge line is obtained based on a first smooth transition range and a second smooth transition range corresponding to the at least one region, and the first smooth transition range and the second smooth transition range are obtained based on the scaling ratio; a synthesis module, configured to synthesize edge lines of the at least one area based on the adjacent relationship of the at least one area, and generate a boundary line image corresponding to the map image, wherein pixels in the boundary line image other than pixels corresponding to the boundary line are transparent; A superposition module, used for superimposing the boundary line image with the map image to generate a target map corresponding to the zoom ratio; Wherein, the synthesis module is also used for: Based on the adjacent relationship of the at least one area, the edge line of the at least one area is intercepted to obtain a boundary line corresponding to the at least one area; The boundary lines corresponding to the at least one region are merged to generate the boundary line image.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the map generating method according to any one of claims 1 to 7 when executed by a processor.

10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to execute the map generating method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Map display method, apparatus, equipment, and storage medium

    CN109144653A

  • Autonomous navigation topological map generation method

    CN109520505A