A hand-drawn map generation method based on machine learning clustering algorithm

The recognition of aerial geographical images through machine learning clustering algorithms solves the problem of slow and error-prone hand-drawn map drawing process, and realizes fast and multi-angle imitation hand-drawn map generation, improving efficiency and accuracy.

CN112149464BActive Publication Date: 2024-12-13陈奇峰 +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201910570139.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-06-27
Publication Date
2024-12-13
Estimated Expiration
2039-06-27

AI Technical Summary

Technical Problem

The hand-drawn map drawing process is slow and difficult to display from multiple angles, and is prone to deviations. Especially in the application of tourist attractions, manual map drawing is inefficient and prone to errors, making it difficult to modify.

Method used

Using a clustering algorithm based on machine learning, aerial photography of geographic images by drone, pixel features are extracted, scenes are segmented using k-means clustering algorithm, and corresponding to pre-drawn hand-drawn anime style logos to generate imitation hand-drawn maps.

Benefits of technology

It realizes the automatic generation of fast and multi-angle display maps, improves efficiency and accuracy, reduces the difficulty of manual modification, and the generated imitation hand-painted map shape is realistic and accurate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112149464B_ABST
    Figure CN112149464B_ABST
Patent Text Reader

Abstract

The present invention relates to a method for generating a hand-drawn map based on a machine learning clustering algorithm, comprising: receiving images taken by a drone above different scenic spots to form an image set; extracting each pixel feature from each image to form an image feature matrix; selecting a preset ratio of atlases from the image set as training images, clustering each training image through a clustering algorithm, and segmenting different parts of the scenery; deleting, merging and annotating the segmented scenery, annotating the scenery category, and corresponding to a pre-drawn hand-drawn cartoon style identification map; clustering other images in the image set through a clustering algorithm to segment different scenery; comparing each segmented scenery with the annotated scenery to determine the category of each scenery; replacing the scenery identified by each image with a pre-drawn hand-drawn scenery cartoon style to generate a hand-drawn map. The method of the present invention quickly generates a hand-drawn map based on a machine learning clustering algorithm.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of machine learning, and in particular relates to a method for generating a hand-drawn map based on a machine learning clustering algorithm. Background Art

[0002] Since hand-drawn maps are slow to draw, they cannot be displayed from multiple angles and may cause large deviations. To display a scenic spot at multiple levels and angles, it is very labor-intensive and slow to draw maps entirely by hand. In the application of tourist attractions, maps are often displayed in the form of animation or hand-drawn, which is not only inefficient and error-prone, but also difficult to modify. In recent years, the application of machine algorithm clustering algorithms can realize simple and efficient recognition of the main objects in the image, such as roads, mountains, lakes, etc., which can be used to automatically draw a map of a given image. Summary of the invention

[0003] The purpose of the present invention is to overcome the shortcomings of the prior art and provide a method for generating a hand-drawn map based on a machine learning clustering algorithm, which utilizes machine learning clustering algorithm technology to identify aerial geographic images and then generates a hand-drawn map based on the identification results.

[0004] In order to achieve the above object, the technical solution of the present invention is:

[0005] A method for generating a hand-drawn map based on a machine learning clustering algorithm, comprising:

[0006] S101, receiving images taken by drones above different scenic spots to form an image set; extracting each pixel feature from each image in the set to form an image feature matrix;

[0007] S102, selecting a preset ratio of atlases from the image set as training images, clustering each training image using a clustering algorithm to segment different parts of the scene;

[0008] S103, deleting and merging the scenes segmented from each training image, and marking them, marking the specific categories of the scenes, and marking them with pre-drawn hand-drawn animation style labels Figure 1 One to one correspondence;

[0009] S104, clustering all images in the image set except the training images by using a clustering algorithm to segment different scenes; comparing each segmented scene with the scene marked in S103 to determine the category of each scene;

[0010] S105, replacing the scene identified in each image in S104 with a pre-drawn hand-drawn scene animation style to generate a simulated hand-drawn map.

[0011] Preferably, the step S101 specifically includes:

[0012] Receive high-definition images taken by drones above different scenic spots and form an image set I = {I 1 ,I 2 ,...,I n}, where n represents the number of images, I j represents the jth aerial photo;

[0013] Extract each pixel feature of each image separately, and form an image feature matrix for each image: F = [P 1 T ,...,P i T ,...P n T ] T , where F represents an image matrix, T represents the matrix vector transpose, and is composed of n pixels; each pixel feature P i =[r i ,g i ,b i ,l i ,g i ] T , where r i , g i , b i , l i and g i Respectively represent the red, green, blue, grayscale, and gradient values ​​of the pixel.

[0014] Preferably, the step S102 specifically includes:

[0015] Select images of preset proportions from the aerial high-definition atlas as training images;

[0016] The image feature matrix F of the training images is respectively input into the clustering algorithm kmeans for clustering; wherein the number of clustering categories K is set to 2m, where m represents the number of predefined scene animation styles; after kmeans completes clustering, 2m categories are output;

[0017] Each pixel is labeled as a category, using CP i Indicates the category to which the i-th pixel belongs; where CP i =1, 2, ..., K;

[0018] Each category has a cluster center point, denoted by C j =[cr j ,cg j ,cb j ,cl j ,cg j] T , represents the cluster center of the jth (j=1, 2, ..., K) category; where cr j ,cg j 、cb j ,cl j and cg j Represent the red, green, blue, grayscale, and gradient values ​​of the category center respectively; the red, green, blue, grayscale, and gradient values ​​of all pixels are changed to the same value as the center point of the category to which they belong.

[0019] Preferably, the step S103 specifically includes:

[0020] Display each category as an image by pixel, identify the scene, and perform the following operations:

[0021] Delete useless categories: Delete the categories that do not appear in the hand-drawn anime style logo;

[0022] Match each category with the logo in the hand-drawn anime style logo map, and record R i,j = k, representing the j-th category of the i-th image and the animation logo S of the hand-drawn animation style logo map k correspond;

[0023] If C j and C k If the similarity between two categories reaches a preset value, they will be mapped to the same animation logo.

[0024] Preferably, the step S104 specifically includes:

[0025] The feature matrix F of the unprocessed image I outside the training image in the image set is input into the kmeans algorithm, K is set to 2m, the image is clustered, and K categories are obtained: CP 1 , CP 2 ...CP K ; Wherein, m represents the number of predefined scene animation styles;

[0026] Each category CP 1 , CP 2 ,...CP K Compare the cosine similarity with the categories trained and labeled in S103 to obtain the most similar category to correspond to the animation logo;

[0027] Merge categories with the same anime logo into one category and merge the pixels at the same time.

[0028] Preferably, the step S105 specifically includes:

[0029] For each category identified by the image I in S104, the following operations are performed respectively:

[0030] Take out the indexes of all pixels belonging to this category and form a set PS;

[0031] Generate a temporary layer U of the same size as I, and fill U with the hand-drawn anime style image corresponding to the category;

[0032] Set the RGB color of all pixels in I that do not appear in PS to [0,0,0];

[0033] All generated layers are merged to get the final hand-drawn map.

[0034] After adopting the above scheme, the beneficial effects of the present invention are:

[0035] The present invention discloses a method for generating a simulated hand-drawn map based on a machine learning clustering algorithm. The method utilizes the machine learning clustering algorithm technology to identify an aerial geographic image, and then generates a simulated hand-drawn map based on the identification result.

[0036] The present invention is further described in detail below in conjunction with the accompanying drawings and embodiments, but the method for generating a simulated hand-drawn map based on a machine learning clustering algorithm of the present invention is not limited to the embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 It is a flow chart of the method for generating a simulated hand-drawn map based on a machine learning clustering algorithm of the present invention. DETAILED DESCRIPTION

[0038] The technical solutions in the embodiments of the present invention will be described and discussed in detail below in conjunction with the accompanying drawings of the present invention. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0039] See also Figure 1 As shown, the present invention provides a method for generating a hand-drawn map based on a machine learning clustering algorithm, comprising:

[0040] S101, receiving images taken by drones above different scenic spots to form an image set; extracting each pixel feature from each image in the set to form an image feature matrix;

[0041] S102, selecting a preset ratio of atlases from the image set as training images, clustering each training image using a clustering algorithm to segment different parts of the scene;

[0042] S103, deleting and merging the scenes segmented from each training image, and marking them, marking the specific categories of the scenes, and marking them with pre-drawn hand-drawn animation style labels Figure 1 One to one correspondence;

[0043] S104, clustering all images in the image set except the training images by using a clustering algorithm to segment different scenes; comparing each segmented scene with the scene marked in S103 to determine the category of each scene;

[0044] S105, replacing the scene identified in each image in S104 with a pre-drawn hand-drawn scene animation style to generate a simulated hand-drawn map.

[0045] Specifically, the implementation process of S101 is as follows:

[0046] S1011, using drones to take aerial photos over various scenic spots;

[0047] S1012, the aerial images and high-definition images are grouped into a set I = {I 1 ,I 2 ,...,I n}, where n is the number of images, I j is the jth aerial photo;

[0048] S1013, extracting each pixel feature from each image to form an image feature matrix: F = [P 1 T ,...,P i T ,...P n T ] T , where F represents an image matrix, T represents the matrix vector transpose, and is composed of n pixels. Each pixel consists of five pieces of information: RGB color, grayscale, and gradient. For example, the i-th pixel is represented by the vector P i =[r i ,g i ,b i ,l i ,g i ] T Indicates that r i ,g i ,b i ,l i ,g i Respectively represent the red, green, blue, grayscale, and gradient values ​​of the point.

[0049] It should be noted that, before S101, the following steps are also included:

[0050] According to different scenes, hand-draw the scene animation style. The specific process is as follows:

[0051] Manually draw anime-style logos of forests, lakes, mountains, etc. (hand-drawn anime-style logos), and then label each logo with S 1 ,S 2 ,...,S m Represents, where m represents the total number of identification graphs.

[0052] Specifically, the implementation process of S102 is as follows:

[0053] S1021, 5% is selected from the aerial high-definition atlas as the training set;

[0054] S1022, the feature matrix F of the training image is input into the clustering algorithm kmeans for clustering, wherein the number of cluster categories K is set to 2m, where m is the number of predefined animation scene styles. After kmeans completes clustering, it outputs 2m categories.

[0055] Each pixel is labeled as a category, CP i Indicates the category to which the i-th pixel belongs, CP i =1, 2,…,K.

[0056] Each category has a cluster center point, denoted by C j =[cr j ,cg j ,cb j ,cl j ,cg j ] T is the cluster center of the jth (j=1, 2,…,K) category, where cr j ,cg j ,cb j ,cl j ,cg j Represents the red, green, blue, grayscale, and gradient values ​​of the category center. Change the red, green, blue, grayscale, and gradient values ​​of all pixels to the same value of the center point of the category to which they belong.

[0057] Specifically, the implementation process of S103 is as follows:

[0058] Display each category as an image by pixel, identify the scene manually, and perform the following operations:

[0059] Delete useless categories: Delete the categories that do not appear in the hand-drawn anime style logo;

[0060] Match each category with the logo in the hand-drawn anime style logo map, and record R i,j = k, representing the j-th category of the i-th image and the animation logo S of the hand-drawn animation style logo map k correspond;

[0061] If C j and C k If the similarity between two categories reaches a preset value, they will be mapped to the same animation logo.

[0062] Specifically, the implementation process of S104 is as follows:

[0063] S1041, input the feature matrix F of the unprocessed image I into the kmeans algorithm, K is set to 2m, cluster the image, and obtain K categories: CP 1 , CP 2 ...CP K ; Wherein, m represents the number of predefined scene animation styles;

[0064] S1042, for each category (CP 1 , CP 2 ...CP K ) are compared with the categories obtained by training and manual annotation in S103 by cosine similarity. 1 For example:

[0065] Remove CP 1 Category Center C 1 ;

[0066] Compare with all class centers of all training images and get the class with maximum similarity:

[0067]

[0068] Among them, C j (i) represents the jth category center of the i-th training image, (h, t) represents the tth category of the h-th training image and C 1 The similarity is the greatest.

[0069] ·CP 1 With hand drawn cartoon logo R h,t correspond.

[0070] S1043, merge categories with the same hand-drawn anime style logo into one category, such as CP 1 and CP 2 All correspond to the kth hand-painted animation style logo, then CP 1 and CP 2 Merge into CP 1, delete CP 2 , and at the same time all the CP 2 Pixels are classified into category CP 1 .

[0071] Specifically, the implementation process of S105 is as follows:

[0072] S1051, for each category of the image I identified in S104, perform the following operations respectively:

[0073] Take out the indexes of all pixels belonging to this category and form a set PS;

[0074] Generate a temporary layer U of the same size as I, and fill U with the hand-drawn anime style image corresponding to the category;

[0075] Set the RGB colors of all pixels in layer U that do not appear in pixel set PS to [0,0,0].

[0076] S1052, merging all generated layers to obtain the final hand-drawn map.

[0077] The above is only a preferred embodiment of the present invention. However, the present invention is not limited to the above embodiment, and any equivalent changes and modifications made according to the present invention, as long as the resulting functions do not exceed the scope of this solution, belong to the protection scope of the present invention.

Claims

1. A method for generating hand-drawn maps based on machine learning clustering algorithm, characterized in that: include: S101, receiving images taken by drones above different scenic spots to form an image set; extracting each pixel feature from each image in the set to form an image feature matrix; S102, selecting a preset ratio of atlases from the image set as training images, clustering each training image using a clustering algorithm to segment different parts of the scene; S103, deleting and merging the scenes segmented from each training image, and marking them, marking the specific categories of the scenes, and making one-to-one correspondence with the pre-drawn hand-drawn animation style identification images; S104, clustering all images in the image set except the training images by using a clustering algorithm to segment different scenes; comparing each segmented scene with the scene marked in S103 to determine the category of each scene; S105, replacing the scene identified in each image in S104 with a pre-drawn hand-drawn scene animation style to generate a simulated hand-drawn map; The step S101 specifically includes: Receive high-definition images taken by drones above different scenic spots and form an image set I = {I1, I2, ..., I n }, where n represents the number of images, I j represents the jth aerial photo; Each pixel feature of each image is extracted separately, and each image forms an image feature matrix: Where F represents an image feature matrix, T represents the matrix vector transpose, and is composed of n pixels; each pixel feature P i =[r i ,g i ,b i ,l i ,g i ] T , where r i , g i 、b i , l i and g i Respectively represent the red, green, blue, grayscale and gradient values ​​of the pixel; The step S102 specifically includes: Select images of preset proportions from the aerial high-definition atlas as training images; The image feature matrices of the training images are respectively input into the clustering algorithm kmeans for clustering; wherein the number of clustering categories K is set to 2m, where m represents the number of predefined scene animation styles; after kmeans completes clustering, 2m categories are output; Each pixel in the image feature matrix is ​​labeled as a category, using CP i Indicates the category to which the i-th pixel belongs; where CP i =1, 2, ..., K; Each category has a cluster center point, denoted by C j =[cr j ,cg j ,cb j ,cl j ,cg j ] T , represents the cluster center of the jth category, j = 1, 2, ..., K; where cr j ,cg j 、cb j ,cl j and cg j Represent the red, green, blue, grayscale and gradient values ​​of the category center respectively; the red, green, blue, grayscale and gradient values ​​of all pixels are changed to the same value as the center point of the category to which they belong. The step S103 specifically includes: Display each category as an image by pixel, identify the scene, and perform the following operations: Delete useless categories: Delete the categories that do not appear in the hand-drawn anime style logo; Match each category with the logo in the hand-drawn anime style logo map, and record R i,j = k, representing the j-th category of the i-th image and the animation logo S of the hand-drawn animation style logo map k correspond; If C j and C k If the similarity between two categories reaches a preset value, they will be mapped to the same animation logo; The step S104 specifically includes: The image feature matrix of the unprocessed image I outside the training image in the image set is input into the kmeans algorithm to cluster the image and obtain K categories: CP1, CP2...CP K ; Each category CP1, CP2, ...CP K Compare the cosine similarity with the categories trained and labeled in S103 to obtain the most similar category to correspond to the animation logo; Merge categories with the same anime logo into one category and merge the pixels at the same time.

2. The method for generating a hand-drawn map based on a machine learning clustering algorithm according to claim 1, characterized in that: The step S105 specifically includes: For each category identified by the image I in S104, the following operations are performed respectively: Take out the indexes of all pixels belonging to this category and form a set PS; Generate a temporary layer U of the same size as I, and fill U with the hand-drawn anime style image corresponding to the category; Set the RGB color of all pixels in I that do not appear in PS to [0,0,0]; All generated layers are merged to get the final hand-drawn map.