Method, device, equipment and storage medium for determining map area

By performing image recognition and coordinate conversion on regional images, the problem of low accuracy in obtaining longitude and latitude coordinates in irregular areas is solved, and efficient longitude and latitude coordinate extraction and map drawing are achieved.

CN111275730BActive Publication Date: 2024-10-01PINGAN INT SMART CITY TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010031594.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-01-13
Publication Date
2024-10-01
Estimated Expiration
2040-01-13

AI Technical Summary

Technical Problem

The existing technology has low accuracy and long time consumption when obtaining the latitude and longitude coordinates of irregular areas. Especially when there are no specific longitude and latitude coordinates, manual point tracing is not only time-consuming but also inaccurate.

Method used

By acquiring regional images, image recognition is performed to extract contour lines, preprocessing pixel coordinates, coordinate conversion based on map mapping relationships, obtaining longitude and latitude coordinates, and drawing the target area on the map.

Benefits of technology

It improves the extraction accuracy and drawing accuracy of latitude and longitude coordinates of irregular areas, and reduces the time and errors of manual point drawing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111275730B_ABST
    Figure CN111275730B_ABST
Patent Text Reader

Abstract

The present application relates to the field of image processing, and specifically discloses a method, device, equipment and storage medium for determining a map area, the method comprising: obtaining a regional image; performing image recognition on the regional image to obtain a contour line for representing the regional image, the contour line comprising a plurality of pixels; preprocessing a plurality of pixels according to the pixel coordinates of the pixels on the regional image to obtain a pixel coordinate set; based on the mapping relationship between the regional image and the map, performing coordinate conversion on the pixel coordinates in the pixel coordinate set to obtain a longitude and latitude coordinate set corresponding to the pixel coordinate set; and drawing a target area corresponding to the contour line on the map according to the longitude and latitude coordinate set. The accuracy of obtaining longitude and latitude coordinates of irregular areas is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing, and in particular to a method, device, equipment and storage medium for determining a map area. Background Art

[0002] At present, there are usually two methods to obtain the longitude and latitude coordinates of some irregular areas. When there are specific longitude and latitude coordinates, some software can be used to trace on the map, by obtaining the vertex coordinates or the circumference coordinates, and recording the order of tracing points when tracing points. Using the recorded order of tracing points, the vertices are connected in sequence, that is, these irregular areas can be redrawn using the vertex coordinates and the order of tracing points. However, this method must be drawn in real time, and the accuracy of the drawing cannot be guaranteed when drawing multiple times. When there are no specific longitude and latitude coordinates, it is necessary to manually trace points on the map according to the shape of these irregular areas, but this drawing method not only takes a lot of time, but also has low accuracy.

[0003] Therefore, how to improve the accuracy of obtaining the longitude and latitude coordinates of irregular areas has become an urgent problem to be solved. Summary of the invention

[0004] The present application provides a method, apparatus, device and storage medium for determining a map area to improve the accuracy of obtaining the longitude and latitude coordinates of an irregular area.

[0005] In a first aspect, the present application provides a method for determining a map area, the method comprising:

[0006] Get the area image;

[0007] Performing image recognition on the region image to obtain a contour line for representing the region image, wherein the contour line includes a plurality of pixel points;

[0008] Preprocessing the plurality of pixel points according to the pixel point coordinates of the pixel points on the regional image to obtain a pixel point coordinate set;

[0009] Based on the mapping relationship between the regional image and the map, coordinate conversion is performed on the pixel point coordinates in the pixel point coordinate set to obtain a longitude and latitude coordinate set corresponding to the pixel point coordinate set;

[0010] A target area corresponding to the contour line is drawn on the map according to the latitude and longitude coordinate set.

[0011] In a second aspect, the present application further provides a device for determining a map area, the device comprising:

[0012] An image acquisition module, used for acquiring regional images;

[0013] An image recognition module, used for performing image recognition on the regional image to obtain a contour line for representing the regional image, wherein the contour line includes a plurality of pixel points;

[0014] A preprocessing module, used for preprocessing the plurality of pixel points according to the pixel point coordinates of the pixel points on the regional image to obtain a pixel point coordinate set;

[0015] A coordinate conversion module, used for performing coordinate conversion on the pixel point coordinates in the pixel point coordinate set based on the mapping relationship between the regional image and the map, so as to obtain a longitude and latitude coordinate set corresponding to the pixel point coordinate set;

[0016] The area drawing module is used to draw a target area corresponding to the contour line on the map according to the latitude and longitude coordinate set.

[0017] In a third aspect, the present application also provides a computer device, comprising a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program and implement the method for determining the map area as described above when executing the computer program.

[0018] In a fourth aspect, the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the method for determining a map area as described above.

[0019] The present application discloses a method, device, equipment and storage medium for determining a map area, which obtains an area image, performs image recognition on the area image to obtain a contour line for identifying the area image, pre-processes a plurality of pixels according to the pixel coordinates of the pixels included in the contour line on the area image, obtains a pixel coordinate set, and then performs coordinate conversion on the pixel coordinates in the pixel coordinate set based on the mapping relationship between the area image and the map to obtain a longitude and latitude coordinate set corresponding to the pixel coordinate set, and finally draws a target area corresponding to the contour line on the map according to the longitude and latitude coordinate set. By converting the pixel coordinates based on the mapping relationship between the area image and the map to obtain the corresponding longitude and latitude coordinates, the longitude and latitude coordinates in the area image are extracted, the accuracy of the longitude and latitude coordinate extraction is improved, and the target area is drawn on the map according to the extracted longitude and latitude coordinates, and the drawing accuracy is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0021] Figure 1 is a schematic flow chart of the steps of a method for determining a map area provided in an embodiment of the present application;

[0022] Figure 2 is an example diagram of a regional image provided by an embodiment of the present application;

[0023] Figure 3 yes Figure 1 A schematic flowchart of the sub-steps of performing image recognition on a regional image;

[0024] Figure 4 yes Figure 1 A schematic flow chart of sub-steps of an embodiment of pre-processing a plurality of pixels;

[0025] Figure 5 yes Figure 1 A schematic flowchart of sub-steps of another embodiment of pre-processing a plurality of pixels;

[0026] Figure 6 yes Figure 1 A schematic flowchart of the sub-steps of coordinate transformation of pixel point coordinates;

[0027] Figure 7 A schematic block diagram of a device for determining a map area provided in an embodiment of the present application;

[0028] Figure 8 A schematic block diagram of the structure of a computer device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0029] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0030] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.

[0031] It should be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0032] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0033] The embodiments of the present application provide a method, device, computer equipment and storage medium for determining a map area. The method for determining a map area utilizes a plan view of an area for which longitude and latitude coordinates need to be obtained, and extracts the contour lines of the area from the plan view, thereby extracting the longitude and latitude coordinates in the area, thereby improving the accuracy of extracting the longitude and latitude coordinates.

[0034] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.

[0035] See also Figure 1 , Figure 1 The present invention provides a flowchart of the steps of a method for determining a map area provided in an embodiment of the present invention. The method for determining a map area processes a region image to extract corresponding longitude and latitude coordinates from the map using the region image, thereby improving the accuracy of longitude and latitude coordinate extraction.

[0036] like Figure 1 As shown, the method for determining the map area specifically includes: steps S101 to S105.

[0037] S101, obtaining a regional image.

[0038] Specifically, the regional image is an image of a graphic region that needs to have its regional longitude and latitude coordinates extracted, wherein the image may be a design drawing made by a designer, and the graphic region may be regular or irregular.

[0039] However, it should be noted that, except for the outline of the graphic area, the rest of the area image must be background-free, and the color of the outline part must be consistent. Figure 2 as shown in .

[0040] S102: Perform image recognition on the region image to obtain a contour line for representing the region image.

[0041] Specifically, the contour line includes a plurality of pixel points. The opencv, numpy, and aircv libraries of Python can be used to perform image recognition on the regional image, and the pixel points with the same color as the contour map are used to find the position with a high matching degree in the contour map, so as to obtain the contour line of the regional image. By obtaining the plurality of pixel points used for contour line positioning, the pixel coordinates of the contour line and the plurality of pixel points used to identify the regional image can be obtained.

[0042] In some embodiments, to improve the accuracy of contour line acquisition, please refer to Figure 3 , performing image recognition on the regional image, including step S1021 and step S1022.

[0043] S1021. Perform graphic segmentation on the region image to obtain a plurality of graphic regions.

[0044] In the specific implementation process, after the regional image is obtained, OpenCV can be used to perform graphic segmentation on the regional image to obtain multiple graphic regions. When performing image segmentation, the watershed algorithm or the GrubCut algorithm can be specifically used.

[0045] In some embodiments, performing graphic segmentation on a region image includes: performing distance transformation on the region image and normalizing the region image after the distance transformation; marking the region image after the normalization and performing watershed transformation on the marked region image according to the marking.

[0046] In the specific implementation process, the white background of the obtained regional image can be first changed to black, the contrast of the regional image can be improved by using the Laplace operator, and it can be converted into a binary image. Then, the binary image is distance transformed, the regional image after the distance transformation is normalized, and the normalized regional image is binarized again to obtain a mark. Finally, the watershed transform is used to segment the original regional image according to the mark of the distance transformation, and the regional image is segmented into multiple graphic areas.

[0047] S1022: Position the contour lines of the plurality of graphic regions respectively to complete the recognition of the contour lines.

[0048] Specifically, aircv can be used to locate the contour line with pixel points. In the specific implementation process, when aircv is used to locate the contour line with pixel points, the pixel points with the same color as the regional image are used to find the position with high color matching in the segmented graphic area, so as to complete the recognition of the contour line. Among them, when matching, it is possible to scan from the upper left corner to the lower right corner of the graphic area, so that the coordinates obtained are the pixel coordinates with the upper left corner of the graphic area as the coordinate origin.

[0049] S103 , pre-processing the plurality of pixel points according to the pixel point coordinates of the pixel points on the regional image to obtain a pixel point coordinate set.

[0050] Specifically, preprocessing refers to sorting pixels according to their pixel coordinates. Since the pixels scanned are arranged from the upper left corner to the lower right corner of the regional image when performing image recognition on the regional image, and since the contours in the regional image are irregular, the pixel coordinates extracted by the contours are numerous and complex, and the acquired pixel coordinates need to be sorted to obtain a pixel coordinate set, and finally the latitude and longitude coordinates are extracted according to the pixel coordinates in the pixel coordinate set to draw the target area on the map.

[0051] In some embodiments, in order to improve the efficiency and regularity of pixel sorting, please refer to Figure 4 , pre-processing the multiple pixels according to the pixel coordinates includes step S1031 and step S1032:

[0052] S1031. Calculate the square sum of the pixel coordinates of each pixel respectively, and determine the pixel with the smallest square sum as the starting pixel.

[0053] Specifically, calculating the square sum of the pixel coordinates of a pixel point refers to calculating the square sum of the horizontal coordinate and the vertical coordinate of the pixel coordinates. The smaller the calculated square sum is, the closer the pixel point is to the origin of the coordinate axis. The square sum of the pixel coordinates of each pixel point is calculated respectively, and the pixel point with the smallest square sum is determined as the starting pixel point.

[0054] S1032. Calculate the distances between the remaining pixel points and the starting pixel point according to the corresponding pixel point coordinates, and sort the remaining pixel points according to the distances.

[0055] Specifically, after the starting pixel point is determined, the distances between the starting pixel point and the remaining pixel points except the starting pixel point are calculated, and the pixel points are sorted according to the distances, so that the pixel points in the pixel point coordinate set are arranged in order.

[0056] In a specific implementation process, the order of pixel sorting can be to start from the starting pixel point, first sort the pixels to the right of the starting pixel point according to the distance, until there are no desirable pixels on the right, and then start from the starting pixel point, and sort the pixels to the left of the starting pixel point according to the distance.

[0057] In other embodiments, in order to adjust the number of pixels in the pixel coordinate set according to the map drawing accuracy, please refer to Figure 5, pre-processing the multiple pixel points according to the pixel point coordinates includes step S1031' and step S1033':

[0058] S1031′, respectively calculating the sum of squares of pixel coordinates of each pixel, and determining the pixel with the smallest square sum as the starting pixel.

[0059] Specifically, calculating the sum of squares of pixel coordinates of a pixel point refers to calculating the sum of squares of the horizontal coordinate and the vertical coordinate of the pixel point coordinates, and the pixel point with the smallest calculated square sum is the pixel point closest to the origin of the coordinate axis.

[0060] S1032', based on a preset pixel point screening rule, screening pixels are obtained from the remaining pixels.

[0061] Specifically, the preset pixel point screening rule may be: if the distance between a pixel point and an adjacent starting pixel point or the distance between a pixel point and an adjacent screening pixel point is less than a preset spacing, then the pixel point is determined to be a screening pixel point.

[0062] In the specific implementation process, the preset spacing refers to the straight-line distance between adjacent pixels. The size of the preset spacing can be determined according to the actual required map accuracy. The smaller the value of the preset spacing, the more pixels there are in the pixel coordinate set and the higher the accuracy. Conversely, the larger the value of the preset spacing, the fewer pixels there are in the pixel coordinate set and the lower the accuracy. Among them, the minimum value of the preset spacing is 1. When the required map accuracy does not need to be very high, the value of the preset spacing can be adjusted to reduce the number of pixels in the pixel coordinate set, reduce the workload of coordinate conversion, and improve the efficiency of longitude and latitude extraction.

[0063] S1033′, calculating the distance between the screening pixel point and the starting pixel point according to the pixel point coordinates corresponding to the screening pixel point, and sorting the screening pixel points according to the distance.

[0064] Specifically, the distances between the remaining screening pixel points except the starting pixel point and the starting pixel point are calculated, and the screening pixel points are sorted according to the distances, so that the screening pixel points in the pixel point coordinate set are arranged in order.

[0065] S104: Based on the mapping relationship between the regional image and the map, coordinate conversion is performed on the pixel point coordinates in the pixel point coordinate set to obtain a longitude and latitude coordinate set corresponding to the pixel point coordinate set.

[0066] Specifically, based on the mapping relationship between the regional image and the map, the map API interface can be used to convert the pixel coordinates in the pixel coordinate set, thereby converting the pixel coordinates into longitude and latitude coordinates to obtain a longitude and latitude coordinate set corresponding to the pixel coordinate set.

[0067] In some embodiments, before step S104, the method further includes:

[0068] Acquire image information of the regional image, wherein the image information includes the map level, longitude and latitude of the center point, and pixel width and height of the regional image; determine the area to be drawn of the map according to the map level, longitude and latitude of the center point, and pixel width and height of the regional image, and establish a mapping relationship between the regional image and the area to be drawn in the map.

[0069] Among them, the map level refers to the map level at which the current area image is displayed, for example, it can be displayed at the city level, the provincial level, etc., and the longitude and latitude of the center point refer to the longitude and latitude coordinates of the center point of the area image.

[0070] The display level and positioning center of the map are adjusted according to the map level and the longitude and latitude of the center point of the regional image, so that the center point of the regional image coincides with the positioning center of the map. Then, the display area of ​​the map is adjusted according to the pixel width and height of the regional image, so that the display area of ​​the map is consistent with the pixel width and height of the regional image.

[0071] By adjusting the display area of ​​the map so that the center of the map coincides with the center point of the regional image and the pixel width and height of the display area of ​​the map are consistent with those of the regional image, a mapping relationship between the regional image and the area to be drawn in the map is established to avoid the accuracy of the longitude and latitude coordinates obtained due to different map levels or scaling of the regional image when converting pixel point coordinates into longitude and latitude coordinates.

[0072] In some embodiments, please refer to Figure 6 , coordinate conversion is performed on the pixel point coordinates in the pixel point coordinate set, including step S1041 and step S1042:

[0073] S1041. Based on the mapping relationship between the regional image and the map, obtain a coordinate mapping relationship between the pixel point coordinates in the pixel point coordinate set and the longitude and latitude coordinates.

[0074] Specifically, after adjusting the map according to the mapping relationship between the regional image and the map, the coordinate mapping relationship between the pixel coordinates in the pixel coordinate set and the longitude and latitude coordinates is obtained. For example, the position indicated by the pixel A in the regional image and the location A in the map is the same, and thus the coordinate mapping relationship between the pixel coordinates and the longitude and latitude coordinates can be established according to the corresponding relationship between the coordinate values ​​of the pixel A and the location A in different coordinate systems.

[0075] S1042: Convert the coordinates of each pixel point into corresponding longitude and latitude coordinates based on the coordinate mapping relationship.

[0076] Specifically, after the coordinate mapping relationship between the pixel point coordinates and the longitude and latitude coordinates is acquired, the coordinates of each pixel point are converted into corresponding longitude and latitude coordinates based on the coordinate mapping relationship.

[0077] S105: Draw a target area corresponding to the contour line on the map according to the latitude and longitude coordinate set.

[0078] Specifically, after drawing the target area corresponding to the contour line, image rendering may be performed on the target area to finally obtain a rendered target area.

[0079] It should be noted that different maps may use different coordinate systems, for example, different maps may use BD-09 coordinate system, Mars coordinate system, Mars coordinate system converted to K code, and WGS84 coordinate system, etc. This results in slightly different longitude and latitude information on different maps. In order to avoid the position offset caused by different coordinate systems and improve the accuracy of map drawing and rendering, when drawing and rendering the target area, the coordinate system used by the map and the coordinate system used by the longitude and latitude coordinates in the longitude and latitude coordinate set need to be the same map coordinate system.

[0080] The method for determining the map area provided in the above embodiment obtains a regional image and performs image recognition on the regional image to obtain a contour line for identifying the regional image, pre-processes a plurality of pixels according to the pixel coordinates of the pixels included in the contour line on the regional image to obtain a pixel coordinate set, and then performs coordinate conversion on the pixel coordinates in the pixel coordinate set based on the mapping relationship between the regional image and the map to obtain a longitude and latitude coordinate set corresponding to the pixel coordinate set, and finally draws a target area corresponding to the contour line on the map according to the longitude and latitude coordinate set. By converting the pixel coordinates based on the mapping relationship between the regional image and the map to obtain the corresponding longitude and latitude coordinates, the longitude and latitude coordinates in the regional image are extracted, the accuracy of the longitude and latitude coordinate extraction is improved, and the target area is drawn on the map according to the extracted longitude and latitude coordinates to improve the drawing accuracy.

[0081] See also Figure 7 , Figure 7 The embodiment of the present application also provides a schematic block diagram of a device for determining a map area, and the device for determining a map area is used to execute the aforementioned method for determining a map area. The device for determining a map area can be configured in a server or a terminal.

[0082] The server may be an independent server or a server cluster. The terminal may be an electronic device such as a mobile phone, a tablet computer, a notebook computer, a desktop computer, a personal digital assistant, a wearable device, etc.

[0083] like Figure 7 As shown, the map area determination device 200 includes: an image acquisition module 201, an image recognition module 202, a pre-processing module 203, a coordinate conversion module 204 and an area drawing module 205.

[0084] The image acquisition module 201 is used to acquire a regional image.

[0085] The image recognition module 202 is used to perform image recognition on the region image to obtain a contour line representing the region image, wherein the contour line includes a plurality of pixel points.

[0086] In one embodiment, the image recognition module 202 includes an image segmentation submodule 2021 and a contour recognition submodule 2022 .

[0087] Specifically, the image segmentation submodule 2021 is used to perform graphic segmentation on the regional image to obtain multiple graphic regions; the contour line recognition submodule 2022 is used to locate the contour lines of the multiple graphic regions respectively to complete the recognition of the contour lines.

[0088] The preprocessing module 203 is used to preprocess the plurality of pixel points according to the pixel point coordinates of the pixel points on the regional image to obtain a pixel point coordinate set.

[0089] In one embodiment, the pre-processing module 203 includes a square sum calculation sub-module 2031 and a pixel sorting sub-module 2032 .

[0090] Specifically, the square sum calculation submodule 2031 is used to calculate the square sum of the pixel coordinates of each pixel point respectively, and determine the pixel point with the smallest square sum as the starting pixel point; the pixel point sorting submodule 2032 is used to calculate the distance between the remaining pixel points and the starting pixel point according to the corresponding pixel point coordinates, and sort the remaining pixel points according to the distance.

[0091] In another embodiment, the preprocessing module 203 includes a square sum calculation submodule 2031 , a pixel point screening submodule 2033 , and a screening and sorting submodule 2034 .

[0092] Specifically, the square sum calculation submodule 2031 is used to respectively calculate the square sum of the pixel coordinates of each of the pixel points, and determine the pixel point with the smallest square sum as the starting pixel point; the pixel point screening submodule 2033 is used to screen the screening pixel points from the remaining pixel points based on the preset pixel point screening rules; the screening sorting submodule 2034 is used to calculate the distance between the screening pixel points and the starting pixel point according to the pixel coordinates corresponding to the screening pixel points, and sort the screening pixel points according to the distance.

[0093] The coordinate conversion module 204 is used to perform coordinate conversion on the pixel coordinates in the pixel coordinate set based on the mapping relationship between the regional image and the map, so as to obtain a longitude and latitude coordinate set corresponding to the pixel coordinate set.

[0094] In one embodiment, the coordinate conversion module 204 includes a mapping relationship submodule 2041 and a latitude and longitude submodule 2042 .

[0095] Specifically, the mapping relationship submodule 2041 is used to obtain the coordinate mapping relationship between the pixel point coordinates in the pixel point coordinate set and the longitude and latitude coordinates based on the mapping relationship between the regional image and the map; the longitude and latitude submodule 2042 is used to convert each pixel point coordinate into the corresponding longitude and latitude coordinates based on the coordinate mapping relationship.

[0096] The area drawing module 205 is used to draw a target area corresponding to the contour line on the map according to the longitude and latitude coordinate set.

[0097] It should be noted that technicians in the relevant field can clearly understand that for the convenience and brevity of description, the specific working process of the map area determination device and each module described above can refer to the corresponding process in the aforementioned map area determination method embodiment, and will not be repeated here.

[0098] The above-mentioned map area determination device can be implemented in the form of a computer program. The computer program can be used in Figure 8 Runs on the computer device shown.

[0099] See also Figure 8 , Figure 8 1 is a schematic block diagram of a computer device provided in an embodiment of the present application. The computer device may be a server or a terminal.

[0100] See also Figure 8 The computer device includes a processor, a memory and a network interface connected through a system bus, wherein the memory may include a non-volatile storage medium and an internal memory.

[0101] The non-volatile storage medium can store an operating system and a computer program. The computer program includes program instructions, and when the program instructions are executed, the processor can execute any method for determining a map area.

[0102] The processor is used to provide computing and control capabilities and support the operation of the entire computer equipment.

[0103] The internal memory provides an environment for the operation of the computer program in the non-volatile storage medium. When the computer program is executed by the processor, the processor can execute any method for determining the map area.

[0104] The network interface is used for network communication, such as sending assigned tasks, etc. Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0105] It should be understood that the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0106] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:

[0107] Acquire a regional image; perform image recognition on the regional image to obtain a contour line for representing the regional image, wherein the contour line includes a plurality of pixel points; pre-process a plurality of pixel points according to the pixel point coordinates of the pixel points on the regional image to obtain a pixel point coordinate set; perform coordinate conversion on the pixel point coordinates in the pixel point coordinate set based on a mapping relationship between the regional image and a map to obtain a longitude and latitude coordinate set corresponding to the pixel point coordinate set; and draw a target area corresponding to the contour line on the map according to the longitude and latitude coordinate set.

[0108] In one embodiment, when implementing the image recognition of the regional image, the processor is used to implement:

[0109] The regional image is segmented to obtain a plurality of graphic regions; and contour lines of the plurality of graphic regions are located respectively to complete the recognition of the contour lines.

[0110] In one embodiment, when implementing the graphic segmentation of the regional image, the processor is used to implement:

[0111] Performing distance transformation on the region image, and normalizing the region image after the distance transformation; marking the region image after the normalization, and performing watershed transformation on the marked region image according to the mark.

[0112] In one embodiment, when implementing the preprocessing of the plurality of pixels according to the pixel coordinates of the pixel points on the regional image, the processor is used to implement:

[0113] The sum of the squares of the pixel coordinates of each pixel point is calculated respectively, and the pixel point with the smallest square sum is determined as the starting pixel point; the distance between the remaining pixel points and the starting pixel point is calculated according to the corresponding pixel coordinates, and the remaining pixel points are sorted according to the distance.

[0114] In one embodiment, before calculating the distances between the remaining pixel points and the starting pixel point according to the corresponding pixel point coordinates and sorting the remaining pixel points according to the distances, the processor is further configured to implement:

[0115] Based on a preset pixel point screening rule, screening pixels are obtained from the remaining pixels;

[0116] When the processor calculates the distance between the remaining pixel points and the starting pixel point according to the corresponding pixel point coordinates and sorts the remaining pixel points according to the distances, the processor is used to implement:

[0117] The distance between the filtering pixel point and the starting pixel point is calculated according to the pixel coordinates corresponding to the filtering pixel point, and the filtering pixel points are sorted according to the distance; the preset pixel point filtering rule includes: if the distance between the pixel point and the adjacent starting pixel point or the distance between the pixel point and the adjacent filtering pixel point is less than the preset spacing, then the pixel point is determined to be a filtering pixel point.

[0118] In one embodiment, when the processor implements the coordinate conversion of the pixel coordinates in the pixel coordinate set based on the mapping relationship between the regional image and the map, it is used to implement:

[0119] Based on the mapping relationship between the regional image and the map, a coordinate mapping relationship between the pixel point coordinates in the pixel point coordinate set and the longitude and latitude coordinates is obtained; based on the coordinate mapping relationship, each of the pixel point coordinates is converted into a corresponding longitude and latitude coordinate.

[0120] In one embodiment, before implementing the coordinate conversion of the pixel coordinates in the pixel coordinate set based on the mapping relationship between the regional image and the map, the processor is further configured to implement:

[0121] Acquire image information of the regional image, wherein the image information includes the map level, longitude and latitude of the center point, and pixel width and height of the regional image; determine the area to be drawn of the map according to the map level, longitude and latitude of the center point, and pixel width and height of the regional image, and establish a mapping relationship between the regional image and the area to be drawn in the map.

[0122] A computer-readable storage medium is also provided in an embodiment of the present application, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and the processor executes the program instructions to implement any one of the map area determination methods provided in the embodiments of the present application.

[0123] The computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiment, such as a hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (SmartMedia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc., equipped on the computer device.

[0124] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A method for determining a map area, characterized in that: include: Get the area image; Performing image recognition on the region image to obtain a contour line for representing the region image, wherein the contour line includes a plurality of pixel points; Calculating the sum of squares of the pixel coordinates of each pixel point respectively, and determining the pixel point with the smallest square sum as the starting pixel point; calculating the distances between the remaining pixel points and the starting pixel point according to the corresponding pixel coordinates, and sorting the remaining pixel points according to the distances to obtain a pixel coordinate set; Based on the mapping relationship between the regional image and the map, coordinate conversion is performed on the pixel point coordinates in the pixel point coordinate set to obtain a longitude and latitude coordinate set corresponding to the pixel point coordinate set; A target area corresponding to the contour line is drawn on the map according to the latitude and longitude coordinate set.

2. The method for determining a map area according to claim 1, characterized in that: The performing image recognition on the regional image includes: Performing graphic segmentation on the region image to obtain a plurality of graphic regions; The contour lines of the plurality of graphic regions are respectively located to complete the recognition of the contour lines.

3. The method for determining a map area according to claim 2, characterized in that: The step of performing graphic segmentation on the regional image comprises: Performing distance transformation on the region image, and normalizing the region image after the distance transformation; The normalized region image is marked, and a watershed transformation is performed on the marked region image according to the mark.

4. The method for determining a map area according to claim 1, characterized in that: Before calculating the distances between the remaining pixel points and the starting pixel point according to the corresponding pixel point coordinates and sorting the remaining pixel points according to the distances, the method further includes: Based on a preset pixel point screening rule, screening pixels are obtained from the remaining pixels; The calculating the distances between the remaining pixel points and the starting pixel point according to the corresponding pixel point coordinates, and sorting the remaining pixel points according to the distances, comprises: Calculating the distance between the screening pixel point and the starting pixel point according to the pixel point coordinates corresponding to the screening pixel point, and sorting the screening pixel points according to the distance; The preset pixel point screening rule includes: if the distance between the pixel point and an adjacent starting pixel point or the distance between the pixel point and an adjacent screening pixel point is less than a preset spacing, then determining the pixel point as a screening pixel point.

5. The method for determining a map area according to claim 1, characterized in that: The performing coordinate transformation on the pixel point coordinates in the pixel point coordinate set based on the mapping relationship between the regional image and the map includes: Based on the mapping relationship between the regional image and the map, obtaining a coordinate mapping relationship between the pixel point coordinates in the pixel point coordinate set and the longitude and latitude coordinates; The coordinates of each pixel point are converted into corresponding longitude and latitude coordinates based on the coordinate mapping relationship.

6. The device for determining a map area according to claim 1, characterized in that: Before performing coordinate conversion on the pixel point coordinates in the pixel point coordinate set based on the mapping relationship between the regional image and the map, the method includes: Acquire image information of the regional image, wherein the image information includes a map level, longitude and latitude of a center point, and pixel width and height of the regional image; The area to be drawn on the map is determined according to the map level, the longitude and latitude of the center point and the pixel width and height of the area image, and a mapping relationship between the area image and the area to be drawn on the map is established.

7. A device for determining a map area, characterized in that: include: An image acquisition module, used for acquiring regional images; An image recognition module, used for performing image recognition on the regional image to obtain a contour line for representing the regional image, wherein the contour line includes a plurality of pixel points; A preprocessing module, used to calculate the square sum of the pixel coordinates of each pixel point respectively, determine the pixel point with the smallest square sum as the starting pixel point; calculate the distance between the remaining pixel points and the starting pixel point according to the corresponding pixel point coordinates, and sort the remaining pixel points according to the distance to obtain a pixel point coordinate set; A coordinate conversion module, used for performing coordinate conversion on the pixel point coordinates in the pixel point coordinate set based on the mapping relationship between the regional image and the map, so as to obtain a longitude and latitude coordinate set corresponding to the pixel point coordinate set; The area drawing module is used to draw a target area corresponding to the contour line on the map according to the latitude and longitude coordinate set.

8. A computer device, characterized in that: The computer device includes a memory and a processor; The memory is used to store computer programs; The processor is used to execute the computer program and implement the method for determining the map area according to any one of claims 1 to 6 when executing the computer program.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed by a processor, enables the processor to implement the method for determining a map area according to any one of claims 1 to 6.