CN112991536B - Automatic extraction and vectorization method for geographic surface elements of thematic map - Google Patents

Automatic extraction and vectorization method for geographic surface elements of thematic map Download PDF

Info

Publication number
CN112991536B
CN112991536B CN202110424580.7A CN202110424580A CN112991536B CN 112991536 B CN112991536 B CN 112991536B CN 202110424580 A CN202110424580 A CN 202110424580A CN 112991536 B CN112991536 B CN 112991536B
Authority
CN
China
Prior art keywords
image
gray
pixel
thematic
clustering
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110424580.7A
Other languages
Chinese (zh)
Other versions
CN112991536A (en
Inventor
马肖肖
杨立
方明哲
梁赓
左春
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Institute of Software of CAS
Original Assignee
Institute of Software of CAS
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Institute of Software of CAS filed Critical Institute of Software of CAS
Priority to CN202110424580.7A priority Critical patent/CN112991536B/en
Publication of CN112991536A publication Critical patent/CN112991536A/en
Application granted granted Critical
Publication of CN112991536B publication Critical patent/CN112991536B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • G06T17/05Geographic models
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/23Clustering techniques
    • G06F18/232Non-hierarchical techniques
    • G06F18/2321Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions
    • G06F18/23213Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions with fixed number of clusters, e.g. K-means clustering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/20Image enhancement or restoration using local operators
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/70Denoising; Smoothing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20024Filtering details
    • G06T2207/20032Median filtering

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Geometry (AREA)
  • Software Systems (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • General Engineering & Computer Science (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Probability & Statistics with Applications (AREA)
  • Artificial Intelligence (AREA)
  • Remote Sensing (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computer Graphics (AREA)
  • Image Analysis (AREA)

Abstract

The invention discloses a method for automatically extracting and vectorizing geographic surface elements of a thematic map, which comprises the following steps: 1) acquiring a thematic map and carrying out geographic registration; 2) carrying out self-adaptive image clustering on the thematic map, and carrying out median filtering on the obtained clustering image; 3) for each cluster image, acquiring the boundary of each element in the cluster image and expanding the range of boundary pixel points; creating a new image with the same size as the cluster image, traversing each edge pixel point in the cluster image, carrying out gray value statistics on surrounding pixels, and assigning the gray value with the highest occurrence frequency to the center pixel point at the same position of the new image; 4) generating binary images of various geographic elements according to pixel gray values of new images a' corresponding to the thematic map a, then generating polygonal boundaries representing surface elements according to the binary images of various types, creating corresponding projection and space reference for each polygonal object, and finally outputting vector files of various surface elements of the thematic map a.

Description

Automatic extraction and vectorization method for geographic surface elements of thematic map
Technical Field
The invention relates to a method for automatically extracting and vectorizing geographic surface elements of a thematic map, belonging to the field of computer technology application.
Background
The thematic map is widely used as a popular data visualization form, and with the continuous development of the internet technology and the continuous abundance of geographic data, a large number of thematic maps published on an internet platform cover extremely abundant geographic information and geographic content, the planar geographic elements of the thematic map and the vectorization work thereof can be quickly and efficiently extracted to construct a related data set for a geographic space intelligent task, so that a wider data source is provided for the application of technologies such as geographic knowledge map construction, space-time data mining and the like, and the method has huge data potential and development prospect.
The main problems existing in the extraction and vectorization process of the special map planar geographic elements in the internet at present are as follows:
1) thematic maps are usually published in bitmaps, and vectorization information of relevant geographic elements cannot be directly acquired;
2) the image quality is uneven, only pixel level information can be accessed, and the problems of image distortion, edge blurring and the like generally exist;
3) scene content, scale range and legend labels of a special map in the Internet are not uniform;
4) the types of geographic elements in the thematic map are usually more than one, and the extraction of the surface elements can be influenced by line elements or point elements;
5) map elements such as text labels, graphic labels and the like contained in the thematic map can interfere the extraction of the face elements;
the existing thematic map vectorization method is mainly divided into two types, one type is vectorization by using professional geographic software, but the requirements on image quality are high, a large amount of manual operation is needed, images with different scales and contents need to be provided with different parameters, and the vectorization process is complex; the second type is to utilize an image processing method to realize the vectorization of thematic maps, but the method is only effective for a certain type of images and cannot simultaneously realize the extraction and vectorization of geographic elements of multiple thematic maps.
The two vectorization methods have the following defects when the vectorization is carried out on the multi-scale multi-content thematic map in the internet:
1) the universality is poor, the application scene of the method is single, and the method is only suitable for thematic maps with the same scale and content;
2) vectorization efficiency is low, the automation degree of the processing process of the multi-scale multi-content thematic map is low, and vectorization precision and processing duration can not be considered at the same time;
3) the anti-interference performance is poor, and for a map with line elements, point elements, map labels, administrative regions and the like, the interference of the elements cannot be usually eliminated in the processes of extraction and vectorization of the opposite elements;
4) the vectorization requirement of a low-quality image cannot be met, the processing effect on a clear high-quality image is good, and a large amount of vectorization information of a low-quality thematic map on an internet platform cannot be correctly obtained.
With the increasing abundance of internet thematic maps and the increasing demands of various industries on integration, mining, intellectualization and the like of geographic knowledge, how to quickly and efficiently realize the automatic acquisition and vectorization of geographic surface elements in the multi-scale and multi-content thematic maps in the internet still needs to be solved urgently.
Disclosure of Invention
Aiming at the defects of the prior art, the invention aims to provide the automatic extraction and vectorization method of the multi-scale multi-content thematic map geographic elements, which has the advantages of high efficiency, strong universality, high automation degree, strong anti-interference performance and the like, can effectively improve the content expression of the low-quality thematic map, enhance the utilization value and the geographic readability of the low-quality thematic map, can quickly and effectively extract various thematic map planar geographic elements in the internet, and can acquire vectorized data of the thematic map planar geographic elements.
The technical scheme adopted by the invention for solving the technical problems is as follows:
an automatic extraction and vectorization method for thematic map geographic elements comprises the following steps:
firstly, acquiring thematic maps, preprocessing images, judging whether each thematic map contains geographical projection and spatial reference information, and if not, carrying out geographical registration on the thematic maps; the acquired thematic maps comprise maps of various different scales, contents or qualities.
Secondly, self-adaptive image clustering, namely performing image category pre-judgment, and respectively calculating a step length s and a peak value according to the size of an image and the gray statistic characteristics of the image, wherein the gray statistic characteristics of the image are the characteristics of a gray distribution map of the image, the gray distribution map of the image is the gray statistics of the image, and the number of the peak values in the gray distribution map is the pre-judged category number K; then taking the pixel value set of RGB three channels of the thematic map and the category number K as input, clustering the images by using a K-means algorithm, and carrying out median filtering on the clustered images (namely the clustered images) to remove noise points; the self-adaptive image clustering can improve the low-quality thematic map, solves the problems of image blurring and distortion to a certain extent, and is not influenced by the scale, content, legend labeling and the like of the thematic map.
Thirdly, automatically detecting and removing interference elements, namely acquiring boundaries (including point elements, line elements, face elements and map labels) of all elements in the clustering image by using a Canny edge detection method; then expanding the range of the boundary pixel points by using image expansion to obtain position indexes of all edge pixels of the current image; traversing all boundary pixel points by utilizing a sliding window and a position index on the basis of clustering images, carrying out gray value statistics on s multiplied by s pixels around the boundary pixel points, and assigning a gray value with the highest occurrence frequency to a central pixel point at the same position of a new image; after traversing, for pixel points of which new images are not assigned, the pixel values of the pixel points are the same as those of pixels at the same position of the clustering images; and finally, performing median filtering on the new image. The interference elements are automatically detected and removed, the influences of point elements, line elements, map labeling and the like in the thematic map can be eliminated, the surface elements of the map are correctly extracted, and the anti-interference performance is high.
And fourthly, vectorizing the image, namely firstly generating various binary images according to the pixel gray value of a new image, then generating a polygon boundary representing the surface element according to the gray value of the pixel point of each binary image and the continuity of the space position, establishing corresponding projection and space reference for each polygon object according to the geographical projection and space reference information in the first step, and finally outputting vector files of various surface elements of the thematic map. And corresponding vector files are strictly generated according to the polygon boundaries of various surface elements, the topological relation is correct, the topological relation does not need to be checked and corrected, and the vectorization efficiency is high.
In the second step, self-adaptive image clustering clusters information in an image, and the method flow is as follows:
(1) inputting an image Img to be processed;
(2) carrying out gray level conversion on the Img to obtain a gray level image ImgG;
(3) counting the gray features of ImgG to obtain a corresponding gray distribution graph, wherein the horizontal axis represents the distribution of each gray value DN (DN is 0,1, …,255), and the vertical axis represents the total number of pixels corresponding to the gray values;
(4) calculating the step size s of the image ImgG:
Figure BDA0003028836090000031
wherein, the symbol
Figure BDA0003028836090000034
Represents rounding down, N represents the total number of pixels in the image ImgG, PiRepresenting the gray value of the ith pixel in the image ImgG and μ represents the mean of the gray values of all pixels in ImgG.
(5) Calculating the number of ImgG image categories (the gray values are concentrated and close and can be classified into a category):
1)K=0;
2) according to the gray value and the number of the pixels corresponding to the gray value, performing peak judgment on each gray value (dn is 0, 1.. times, 255):
Figure BDA0003028836090000032
Figure BDA0003028836090000033
when peak (dn) is 1, K +1,
wherein, TdnAnd (4) representing the number of pixel points with the gray value dn in the gray image ImgG, wherein s is the step length calculated in the step (4). After all dn are traversed, the finally obtained K value is the number of categories of the image ImgG.
(6) Clustering the images Img:
1) taking the RGB value of each pixel point of the image Img as an input set: { P0,P1,…,PNI.e., { (R) }0,G0,B0)(R1,G1,B1),…,(RN,GN,BN) N represents the total number of pixel points of the image Img;
2) from the input set { P0,P1,…,PNRandomly selecting K points as an initial clustering center (c)1,c2,…,cK) I.e., { (r)0,g0,b0)(r1,g1,b1),…,(rK,gK,bK) Are respectively corresponding to K categories (C)1,C2,…,CK);
3) Calculating the distance from each point to the central point, and classifying the distance into the category with the shortest distance:
Figure BDA0003028836090000041
when dist (P)i,cj)=min(dist(Pi,c1),dist(Pi,c2),...,dist(Pi,cK) In time of C)j=Cj∪Pi
Wherein i is more than or equal to 0 and less than or equal to N, and j is more than or equal to 0 and less than or equal to K.
4) Updating the center point (c)1,c2,…,cK):
Figure BDA0003028836090000042
5) Repeating steps 3) and 4) until the center point is no longer changed.
(7) Reassigning each type of pixels, and endowing different gray values to the pixels of different types to form a clustered image ImgK; in the clustered images, K gray values are shared, and different gray values represent different categories;
(8) and performing median filtering on the clustered image ImgK, removing noise points, and outputting a final gray level image ImgC.
In the third step, the automatic detection and removal method of the interference elements comprises the following processes:
(1) canny edge detection is carried out on the ImgC to generate a binary image ImgCanny, the gray value values of the binary image ImgCanny are only two, namely 0 and 1, the pixel with the gray value of 1 represents an edge pixel, and the pixel with the gray value of 0 represents a non-edge pixel;
(2) and (3) carrying out image expansion operation on ImgCanny, expanding the range of edge pixels, and obtaining a new binary image ImgDilate:
Figure BDA0003028836090000043
Figure BDA0003028836090000044
where [ ] indicates the dilation operation, D indicates the convolution kernel of the dilation operation, p indicates the pixel in Imgcanny,
and carrying out convolution operation on ImgCanny and D, namely expanding the range of the edge pixels.
(3) And (3) according to the edge pixels obtained in the step (2), reassigning the pixels at the same position in the ImgC by using sliding window statistics, thereby eliminating interference elements (linear elements and labeled elements) in the image ImgC, and finally performing median filtering to obtain an image ImgL:
1) acquiring a pixel index representing an edge element in ImgDiate, and establishing a pixel point set with the same index in ImgC:
edge={p(m,n)|DN(pi(m,n))=1,pi(m,n)∈ImgDilate,p(m,n)∈ImgC}
where (m, n) represents the index of the pixel point, pi(m,n)And p(m,n)Respectively, the index of the pixel point is (m, n) in the binary image imgdialte and the grayscale image ImgC, DN (pi)(m,n)) And representing the gray value of the corresponding pixel point in the image imgdialate.
2) Creating a grayscale map ImgN:
ImgN=ImgC
3) performing sliding window statistics on the gray level image ImgC, and assigning a statistical result to a co-located central pixel point of ImgN:
Figure BDA0003028836090000051
Figure BDA0003028836090000052
DN(pn(i,j))=DN(i,j)
wherein s is the step size obtained by the second step, and maxdn () represents the gray value with the most statistics in the window, DN (pn)(i,j)) And the gray value of the pixel point with the index (i, j) in the ImgN is represented.
4) Performing median filtering on the result of the step 3) to remove noise points, and obtaining a gray level image ImgL.
Compared with the prior art, the invention has the beneficial effects that:
(1) the method has strong universality, and compared with a vectorization method only aiming at the traditional thematic map with the same scale or the same type, the method has wider application scene and is basically not limited by factors such as geographic range, subject content, map form and other geographic elements;
(2) the method has strong anti-interference performance, can eliminate the interference of map labels (characters, numbers and the like), element boundary lines, line elements (rivers, roads and the like), point elements and the like, and accurately identifies and extracts the surface elements;
(3) the vectorization efficiency is high, the automation degree is high, the operations of parameter setting, topology correction and the like in the traditional method are avoided, and the planar geographic elements can be rapidly and accurately extracted and corresponding vectorization data can be generated;
(4) the processing effect and precision of the low-quality thematic map can be guaranteed, and automatic extraction and vectorization of the planar geographic elements in the low-quality thematic map in the internet platform are achieved.
Drawings
Fig. 1 is a schematic flow chart of the method of the present invention and a conventional vectorization method.
FIG. 2 is a general flow diagram of the method.
FIG. 3 is a flow chart of an adaptive image clustering method.
Fig. 4 is a flow chart of a method for automatically detecting and removing an interfering element.
Fig. 5 is a flowchart of an image vectorization method.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in further detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. In addition, the technical features involved in the embodiments of the present invention described below may be combined with each other as long as they do not conflict with each other.
The basic idea of the invention is that according to the distribution characteristics and color characteristics of the thematic map, the image processing technology and the computer technology are utilized to eliminate the interference elements in the map, accurately identify and extract the same kind of geographic surface elements, generate the vector file with correct topological relation, and realize the automatic or semi-automatic extraction and rapid vectorization of the thematic map surface elements. As shown in fig. 1, compared with the strong dependence of the traditional vectorization method on image quality, method parameters or manual operation, the method of the present invention can enhance the expression of a low-quality thematic map through an image processing technology, reduce the ambiguity, and correctly extract the geographic element information; parameters such as step length, clustering number and the like are automatically adjusted according to the image characteristics, and related parameters do not need to be adjusted repeatedly according to the scale or the content of the map; and carrying out vectorization strictly according to the pixel boundary of the processed image, so that the topological relation is correct, and the subsequent manual adjustment process is avoided.
The general flow chart of the method is shown in figure 2, firstly, whether the file contains geographic information is judged, if not, manual geographic registration is carried out, then, the geographic information and the image information of the file are extracted, and all pixel points are arranged into a set { P }0,P1,…,PNThe set element is the value of the pixel point in each RGB wave band, i.e. the ith pixel point Pi=(Ri,Gi,Bi) (ii) a Converting the color image into a gray image through gray conversion of the image, and calculating a step length s according to the gray distribution characteristics and the number of pixels; then the gray scale distributionJudging the peak value of the image according to the sum step length s, wherein the number of the peak values is a clustering number K; set pixel points { P0,P1,…,PNTaking the cluster number K and the cluster number K as input parameters, carrying out K-means clustering on the images, carrying out median filtering on the result, and distinguishing various factors according to the gray value; identifying line elements of the clustered image by using a Canny edge detection algorithm, expanding the labeling range of the line elements by using an image expansion algorithm, then carrying out sliding window statistics on the clustered image, namely taking a labeled pixel as a center, carrying out statistics on surrounding pixel points of the clustered image on the basis of the clustered image, assigning a gray value with the most occurrence times to the center pixel, and carrying out median filtering on a result image after all labeled pixel points are assigned, wherein the line elements in the image can be detected and removed, so that the identification and extraction of the surface elements are prevented from being interfered; and converting the final image obtained in the last step into various binary images, creating geospatial reference information for each image according to the geographic information of the file, performing vectorization strictly according to pixel values, creating a corresponding vector file, and finally realizing the vectorization of various surface elements in the thematic map.
The method comprises the following specific steps:
first, image preprocessing
Judging whether the file contains geographical projection information and spatial reference information, if so, extracting the geographical information and the image waveband information of the file; if not, geographic registration is carried out through professional software, geographic projection information and spatial reference are created for the file, and then geographic information and image information of the file are extracted.
Second, adaptive image clustering
The image clustering algorithm requires two input parameters, which are the number of clusters and the dataset to be classified. As shown in fig. 3, step length s is calculated according to the size of the image after gray level conversion and the gray level statistical characteristics, and then the peak value of the image gray level histogram is judged according to the step length s, wherein the number of the peak values is the clustering number; outputting pixel points of all color images as a set { P0,P1,…,PNThe set element is the value of the pixel point in each RGB wave band, i.e. Pi=(Ri,Gi,Bi) (ii) a Finally, the pixel point set { P0,P1,…,PNAnd (4) taking the clustering number K and the clustering number K as input parameters, carrying out K-means clustering on the images, and carrying out median filtering. Through self-adaptive image clustering, the clustering result of each pixel point of the thematic map is obtained, the image ambiguity can be reduced, the low-quality thematic map can be improved, and the face element identification and accuracy are improved.
The specific steps of the self-adaptive image clustering are as follows:
(1) inputting an image Img to be processed;
(2) carrying out gray level conversion on the Img to obtain a gray level image ImgG;
(3) counting the gray features of ImgG to obtain a corresponding gray distribution graph, wherein the horizontal axis represents the distribution of each gray value DN (DN is 0,1, …,255), and the vertical axis represents the total number of pixels corresponding to the gray values;
(4) calculating the step length s of the image:
Figure BDA0003028836090000071
wherein the symbols
Figure BDA0003028836090000072
Representing rounding down, N representing the total number of pixels of the image, PiRepresenting the gray value of the ith pixel of the image and μ represents the mean of the gray values of all pixels.
(5) Calculating the number of ImgG image categories:
1)K=0;
2) according to the gray values and the number of the pixels corresponding to the gray values, performing peak judgment on each gray value (dn is 0, 1., 255):
Figure BDA0003028836090000073
Figure BDA0003028836090000074
when peak (dn) is 1, K +1,
wherein, TdnAnd (4) representing the number of pixel points with the gray value dn in the gray image, wherein s is the step length calculated in the step (4).
After all dn is traversed, the finally obtained K value is the number of the image categories.
(6) Clustering the images Img:
1) taking the RGB value of each pixel point of the image as an input set: { P0,P1,…,PNI.e., { (R) }0,G0,B0)(R1,G1,B1),…,(RN,GN,BN) N represents the total number of image pixels;
2) from the input set { P0,P1,…,PNRandomly selecting K points as initial clustering centers (c)1,c2,…,cK) I.e., { (r)0,g0,b0)(r1,g1,b1),…,(rK,gK,bK) Are respectively corresponding to K categories (C)1,C2,…,CK);
3) Calculating the distance from each point to the central point, and classifying the distance into the category with the shortest distance:
Figure BDA0003028836090000081
when dist (P)i,cj)=min(dist(Pi,c1),dist(Pi,c2),...,dist(Pi,cK) In time of C)j=Cj∪Pi
Wherein i is more than or equal to 0 and less than or equal to N, and j is more than or equal to 0 and less than or equal to K.
4) Updating the center point (c)1,c2,…,cK):
Figure BDA0003028836090000082
5) Repeating steps 3) and 4) until the center point is no longer changed
(7) Reassigning each type of pixels, and endowing different gray values to the pixels of different types to form a clustered image ImgK;
(8) and performing median filtering on the clustered image ImgK, removing noise points, and outputting a final gray level image ImgC.
Third, automatic detection and removal of interference elements
Due to the diversification of the content and form of the thematic map, the extraction of the geographic surface elements of the thematic map is usually interfered by line elements or point elements, such as water systems, rivers, roads, administrative boundaries, map labels, and the like. In order to ensure the correctness of the extraction result of the surface element, the above elements need to be automatically detected and removed. As shown in fig. 4, the cluster image obtained in the second step is subjected to detection and removal of interfering elements, and the boundaries of all elements in the thematic map are obtained by using a Canny edge detection method; then expanding the range of the boundary pixel points by using image expansion to obtain the position indexes of all edge pixels; traversing all boundary pixel points by utilizing a sliding window and a position index on the basis of clustering images, carrying out gray value statistics on s multiplied by s pixels around the boundary pixel points, and assigning a gray value with the highest occurrence frequency to a central pixel point at the same position of a new image ImgN; after traversing, for pixel points of which new images are not assigned, the pixel values of the pixel points are the same as those of pixels at the same position of the clustering images; and finally, performing median filtering.
The automatic detection and removal method of the interference elements comprises the following flows:
(1) canny edge detection is carried out on the ImgC to generate a binary image ImgCanny, the gray value values of the image are only two, namely 0 and 1, the pixel with the gray value of 1 represents the detected edge pixel, and the pixel with the gray value of 0 represents the non-edge pixel;
(2) and (3) carrying out image expansion operation on ImgCanny, expanding the range of edge pixels, and obtaining a new binary image ImgDilate:
Figure BDA0003028836090000083
Figure BDA0003028836090000091
wherein [. gtoreq ] represents the expansion operation, D represents the convolution kernel of the expansion operation, p represents the pixel point in ImgCanny, and the range of the edge pixel can be expanded by performing the convolution operation on ImgCanny and D.
(3) And (3) according to the index of the edge pixel obtained in the step (2), reassigning the pixel with the same index in the ImgC by using sliding window statistics, thereby eliminating image interference elements (linear elements and labeled elements), and finally performing median filtering to obtain an image ImgL:
1) acquiring a pixel index representing an edge element in ImgDiate, and establishing a pixel point set with the same index in ImgC:
edge={p(m,n)|DN(pi(m,n))=1,pi(m,n)∈ImgDilate,p(m,n)∈ImgC}
where (m, n) represents the index of the pixel point, pi(m,n)And p(m,n)Respectively a pixel point with index (m, n) in the binary image ImgDilate and the gray image ImgC, DN (pi)(m,n)) And representing the gray value of the corresponding pixel point in the image imgdialate.
2) Creating a grayscale map ImgN:
ImgN=ImgC
3) performing sliding window statistics on the gray level image ImgC, and assigning a statistical result to a co-located central pixel point of ImgN:
Figure BDA0003028836090000092
Figure BDA0003028836090000093
DN(pm(i,j))=DN(i,j)
wherein s is the step size calculated in the second step, and maxdn () represents the maximum number of statistics in the windowGray value of (d), DN (pn)(i,j)) Representing the gray value of the pixel point with index (i, j) in ImgN
4) And 3) performing median filtering on the result of the step 3) to remove noise points, and obtaining a gray level image ImgL. In ImgL, different gray values represent different categories, and a binary image of each category can be obtained according to the gray values.
Step four, image vectorization
As shown in fig. 5, after adaptive clustering and interference element removal, a gray scale image of each type of surface element can be obtained, first, binary images of each type of surface element are extracted from the gray scale image ImgL according to gray scale values, then, polygon boundaries of the surface elements are generated according to the gray scale values of pixel points and continuity of spatial positions, corresponding projection and spatial reference are created for each polygon object according to the geographical projection and spatial reference information obtained in the first step, and finally, vector files of each type of surface element of the thematic map are output.
In order to prove the effectiveness of the method, a plurality of thematic maps with different scales and contents are selected as experimental data, wherein the distribution comprises elements such as character labels, linear elements (administrative boundaries, water systems, roads and the like) and legend styles (discrete and continuous). The method is utilized to process the experimental data, and meanwhile, the comparison experiment is carried out by adopting professional geographic software (Arcmap conversion tool), and the experimental result is shown in Table 1.
TABLE 1
Figure BDA0003028836090000101
The above embodiments are only intended to illustrate the technical solution of the present invention and not to limit the same, and a person skilled in the art can modify the technical solution of the present invention or substitute the same without departing from the principle and scope of the present invention, and the scope of the present invention should be determined by the claims.

Claims (8)

1. A method for automatically extracting and vectorizing geographic surface elements of a thematic map comprises the following steps:
1) acquiring thematic maps and judging whether each thematic map contains geographical projection and spatial reference information or not, and if not, carrying out geographical registration on the thematic maps;
2) carrying out self-adaptive image clustering on each thematic map processed in the step 1), carrying out median filtering on the obtained clustering image to remove noise points, and outputting a gray level image ImgC;
3) performing edge detection on the gray level image ImgC to generate a binary image ImgCanny; then, performing image expansion operation on the binary image ImgCanny, and expanding the range of edge pixels to obtain a new binary image ImgDilate; then obtaining each edge pixel in the binary image ImgDilate, reassigning the pixels at the same position in the gray level image ImgC so as to eliminate interference elements in the image ImgC, and then carrying out median filtering to obtain an image ImgL; the method for obtaining the image ImgL comprises the following steps: 31) acquiring a pixel index representing an edge element in ImgDiate, and establishing a pixel point set with the same index in ImgC: edge ═ p(m,n)|DN(pi(m,n))=1,pi(m,n)∈ImgDilate,p(m,n)E.g. ImgC }; wherein pi is(m,n)Is a pixel point with index (m, n) in the binary image imgdialate, p(m,n)The pixel point with index (m, n) in the gray level image ImgC, DN (pi)(m,n)) Representing pixel point pi in image imgdialte(m,n)The gray value of (a); 32) creating a gray level map ImgN, namely ImgN-ImgC; 33) performing sliding window statistics on the gray level image ImgC, and assigning a statistical result to a pixel point in the same position of the gray level image ImgN; 34) performing median filtering on the grayscale image ImgN processed in the step 33) to remove noise points, and obtaining a grayscale image ImgL;
4) generating binary images of various geographic elements according to pixel gray values of new images a' corresponding to the thematic map a, then generating polygonal boundaries representing surface elements according to gray values of pixel points of each type of binary images and continuity of spatial positions, creating corresponding projection and spatial reference for each polygonal object according to geographic projection and spatial reference information of the thematic map a, and finally outputting vector files of various surface elements of the thematic map a.
2. The method of claim 1, wherein the adaptive image clustering of thematic maps is performed by:
21) inputting a thematic image Img to be processed;
22) carrying out gray level conversion on the thematic image Img to obtain a gray level image ImgG thereof;
23) counting the gray characteristics of the gray image ImgG to obtain a corresponding gray distribution map;
24) calculating the step length s of the image ImgG;
25) calculating the number K of categories in the image ImgG;
26) performing K-means clustering on the image Img;
27) reassigning each type of pixels, and endowing different gray values to the pixels of different types to form a clustered image ImgK;
28) and carrying out median filtering on the clustered image ImgK, removing noise points and outputting a final gray level image ImgC.
3. The method of claim 1, wherein the K-means clustering of the images Img is performed by: firstly, taking the RGB value of each pixel point of the image Img as an input set: { P0,P1,…,PN},PNHas an RGB value of (R)N,GN,BN) Wherein N represents the total number of pixel points of the image Img; then from the input set { P0,P1,…,PNRandomly selecting K points as initial clustering centers (c)1,c2,…,cK) Correspond to K categories (C) respectively1,C2,…,CK),cKRGB value of (r)K,gK,bK) (ii) a Then calculating the distance from each pixel point to the clustering center point, and classifying the pixel points into the category with the shortest distance; then updating the cluster center point
Figure FDA0003598565810000021
And re-clustering until the clustering center point is not changed.
4. As claimed in claim 2The method is characterized in that the raw materials are mixed,
Figure FDA0003598565810000022
wherein, the symbol
Figure FDA0003598565810000023
Represents rounding down, N represents the total number of pixels in the image ImgG, PiRepresenting the gray value of the ith pixel in the image ImgG and μ represents the mean of the gray values of all pixels in ImgG.
5. The method of claim 2, wherein the number of classes K in the image ImgG is calculated by:
251) initializing K to be 0;
252) according to the gray value and the number of the pixel points corresponding to the gray value, performing peak value judgment on each gray value:
Figure FDA0003598565810000024
when peak (dn) is 1, K is K + 1; wherein, TdnRepresenting the number of pixel points with the gray value dn in the gray image ImgG;
253) and traversing all dn, wherein the finally obtained K value is the category number of the image ImgG.
6. The method of claim 1, wherein the boundaries of all elements in the thematic map are obtained using a Canny edge detection method.
7. A server, comprising a memory and a processor, the memory storing a computer program configured to be executed by the processor, the computer program comprising instructions for carrying out the steps of the method according to any one of claims 1 to 6.
8. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 6.
CN202110424580.7A 2021-04-20 2021-04-20 Automatic extraction and vectorization method for geographic surface elements of thematic map Active CN112991536B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110424580.7A CN112991536B (en) 2021-04-20 2021-04-20 Automatic extraction and vectorization method for geographic surface elements of thematic map

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110424580.7A CN112991536B (en) 2021-04-20 2021-04-20 Automatic extraction and vectorization method for geographic surface elements of thematic map

Publications (2)

Publication Number Publication Date
CN112991536A CN112991536A (en) 2021-06-18
CN112991536B true CN112991536B (en) 2022-06-24

Family

ID=76341292

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110424580.7A Active CN112991536B (en) 2021-04-20 2021-04-20 Automatic extraction and vectorization method for geographic surface elements of thematic map

Country Status (1)

Country Link
CN (1) CN112991536B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113409461B (en) * 2021-06-22 2023-06-23 北京百度网讯科技有限公司 Method and device for constructing landform map, electronic equipment and readable storage medium
CN114219946B (en) * 2021-12-29 2022-11-15 北京百度网讯科技有限公司 Text image binarization method and device, electronic equipment and medium
CN116543175B (en) * 2023-07-06 2023-08-29 南通凯锐激光科技有限公司 Automatic adjustment method of laser level

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8325179B2 (en) * 2009-03-04 2012-12-04 Landmark Graphics Corporation Three-dimensional visualization of images in the earth's subsurface
CN101853514B (en) * 2009-04-02 2011-10-05 肖克炎 Interactive vectorization method of colorful geologic map image and system thereof
CN103984946B (en) * 2014-05-23 2017-04-26 北京联合大学 High resolution remote sensing map road extraction method based on K-means
CN105931295B (en) * 2016-07-13 2019-02-12 中国地质大学(北京) A kind of geologic map Extracting Thematic Information method

Also Published As

Publication number Publication date
CN112991536A (en) 2021-06-18

Similar Documents

Publication Publication Date Title
CN112991536B (en) Automatic extraction and vectorization method for geographic surface elements of thematic map
CN110866896B (en) Image saliency target detection method based on k-means and level set super-pixel segmentation
CN113449594B (en) Multilayer network combined remote sensing image ground semantic segmentation and area calculation method
CN110020692B (en) Handwriting separation and positioning method based on print template
CN111709420A (en) Text detection method, electronic device and computer readable medium
CN104463195A (en) Printing style digital recognition method based on template matching
CN110390643B (en) License plate enhancement method and device and electronic equipment
CN109993750A (en) A kind of segmentation recognition method and system, terminal and readable storage medium storing program for executing of hand jnjuries
CN107038445B (en) Binarization and segmentation method for Chinese character verification code
CN114694038A (en) High-resolution remote sensing image classification method and system based on deep learning
CN110070548B (en) Deep learning training sample optimization method
CN111507337A (en) License plate recognition method based on hybrid neural network
CN114359538A (en) Water meter reading positioning and identifying method
CN108256518B (en) Character area detection method and device
CN110532938B (en) Paper job page number identification method based on fast-RCNN
CN115033721A (en) Image retrieval method based on big data
CN110889374A (en) Seal image processing method and device, computer and storage medium
CN107729863B (en) Human finger vein recognition method
CN117496532A (en) Intelligent recognition tool based on 0CR
CN109460763B (en) Text region extraction method based on multilevel text component positioning and growth
CN112633070A (en) High-resolution remote sensing image building extraction method and system
CN114792329B (en) Color image segmentation method and device based on mid-intelligence clustering and superpixel
CN116030472A (en) Text coordinate determining method and device
CN112419407B (en) Cloud cluster displacement vector calculation method and device based on cloud cluster edge recognition
CN114511862A (en) Form identification method and device and electronic equipment

Legal Events

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