Street view visualization map generation method, system and terminal based on color analysis
Through semantic segmentation and color clustering of rural street scene images, a street view visualization map is generated, which solves the problem of poor accuracy of rural environment color analysis in the existing technology and improves the analysis efficiency and the accuracy of the map.
Patent Information
- Application Number
- CN202410605708.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-16
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2044-05-16
AI Technical Summary
The existing technology is difficult to perform effective color analysis for rural environments, resulting in poor color accuracy of the generated visual color map, which affects the accuracy of the analysis of spatial environmental characteristics of rural environments.
A street view visualization map generation method based on color analysis is adopted. By acquiring and preprocessing rural street scene images, semantic segmentation and color clustering are performed to generate a rural chromatogram, and the image is compared with the chromatogram to generate a street view visualization map.
It improves the efficiency and accuracy of color analysis of rural street view images, reduces the complexity of operations, and increases the accuracy and clarity of street view visualization maps.
Smart Images

Figure CN118212510B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision technology, and in particular to a method, system, terminal and computer-readable storage medium for generating a street view visualization map based on color analysis. Background Art
[0002] Image processing and analysis are widely used in various fields, from urban planning to rural landscape management. When using image technology to analyze the color of the urban environment, techniques such as semantic segmentation and color clustering are usually used. Semantic segmentation is a technique that assigns each pixel in an image to a corresponding semantic category. The purpose is to provide important semantic information for subsequent image processing and to facilitate the retention of valid pixels. Color clustering is to group the pixels in an image according to color features to help understand the color distribution of the image. Common color clustering algorithms include k-means clustering and Gaussian mixture models.
[0003] However, there is currently a lack of integrated, intelligent, and visual color analysis methods for rural spatial environment characteristics. The rural environment is different from the urban environment. The color differences in the rural environment are weak and the homogeneity is strong. In addition, the rural environment is closely related to natural vegetation. It is necessary to identify the plant layer in the spatial environment semantic segmentation and conduct a comprehensive analysis with the color characteristics of the building.
[0004] Therefore, the prior art still needs to be improved and developed. Summary of the invention
[0005] The main purpose of the present invention is to provide a method, system, terminal and computer-readable storage medium for generating a street view visualization map based on color analysis, aiming to solve the problem in the prior art that it is difficult to perform color analysis on a rural environment, the generated visualization color map has poor color accuracy, and the analysis of the spatial environment characteristics of the rural environment is of low accuracy.
[0006] To achieve the above object, the present invention provides a method for generating a street view visualization map based on color analysis, and the method for generating a street view visualization map based on color analysis comprises the following steps:
[0007] Acquire multiple rural street view images to be processed, and perform preprocessing operations on each of the rural street view images to obtain multiple preprocessed street view images;
[0008] Performing semantic segmentation processing on each of the pre-processed street view images respectively to obtain a semantic segmentation result corresponding to each of the pre-processed street view images;
[0009] Performing a stitching operation on all the semantic segmentation results according to preset element conditions to obtain a plurality of stitched images, and performing a color clustering operation on all the stitched images to obtain a rural color spectrum;
[0010] Each of the rural street view images is compared with the rural color spectrum to obtain a street view visualization map corresponding to each of the rural street view images.
[0011] Optionally, the method for generating a street view visualization map based on color analysis, wherein the step of obtaining a plurality of rural street view images to be processed and performing a preprocessing operation on each of the rural street view images to obtain a plurality of preprocessed street view images, specifically comprises:
[0012] Receiving a plurality of rural street view images to be processed sent by an image capturing device, wherein each of the rural street view images is captured by the image capturing device according to a preset perspective angle and preset shooting elements;
[0013] receiving a white balance card photo sent by the image capture device, wherein the white balance card photo is obtained by the image capture device photographing the white balance card;
[0014] A color temperature correction operation is performed on each of the rural street view images according to the white balance card photo to obtain a preprocessed street view image corresponding to each of the rural street view images.
[0015] Optionally, the method for generating a street view visualization atlas based on color analysis, wherein the step of performing semantic segmentation processing on each of the pre-processed street view images to obtain a semantic segmentation result corresponding to each of the pre-processed street view images, specifically includes:
[0016] Performing semantic segmentation processing on each of the pre-processed street view images respectively to obtain a semantic segmentation image corresponding to each of the pre-processed street view images, wherein each of the semantic segmentation images is composed of a plurality of spatial elements;
[0017] A screening operation is performed on each of the semantic segmentation images according to preset element conditions, and spatial elements in each of the semantic segmentation images that meet the preset element conditions are retained to obtain a semantic segmentation result corresponding to each semantic segmentation image.
[0018] Optionally, in the method for generating a street view visualization map based on color analysis, the preset element conditions include building elements, vegetation elements and street landscape elements;
[0019] The step of performing a stitching operation on all the semantic segmentation results according to the preset element conditions to obtain a plurality of stitched images specifically includes:
[0020] Classifying all the semantic segmentation results according to the building elements, the vegetation elements and the street landscape elements, grouping the spatial elements of the same type into one group to obtain a building element group, a vegetation element group and a street landscape element group;
[0021] All spatial elements in the building element group, the vegetation element group and the street landscape element group are spliced respectively to obtain spliced images corresponding to the building element group, the vegetation element group and the street landscape element group respectively.
[0022] Optionally, the method for generating a street view visualization atlas based on color analysis, wherein the step of performing a color clustering operation on all the spliced images to obtain a rural color spectrum, specifically comprises:
[0023] Performing a color clustering operation on the spliced image corresponding to the building element group according to a first preset K value to obtain a building color spectrum;
[0024] Performing a color clustering operation on the spliced image corresponding to the vegetation element group according to a second preset K value to obtain a vegetation color spectrum;
[0025] Performing a color clustering operation on the spliced image corresponding to the street landscape element group according to a third preset K value to obtain a street landscape color spectrum;
[0026] The building chromatogram, the vegetation chromatogram and the street landscape chromatogram are integrated to obtain a rural chromatogram.
[0027] Optionally, the method for generating a street view visualization map based on color analysis, wherein the step of comparing each of the rural street view images with the rural color spectrum to obtain a street view visualization map corresponding to each of the rural street view images, specifically comprises:
[0028] Converting each of the rural street view images into a spatial region vector map, and converting each of the spatial region vector maps into an RGB bitmap, wherein each of the spatial region vector maps and the corresponding RGB bitmap contains a plurality of identical spatial regions;
[0029] Compare each of the RGB bitmaps with the rural color spectrum to obtain a dominant color corresponding to each spatial area in each of the RGB bitmaps;
[0030] The spatial region vector graphs are respectively filled with colors according to the dominant colors of each spatial region in each RGB bitmap to obtain a street view visualization map corresponding to each of the rural street view images.
[0031] Optionally, the method for generating a street view visualization map based on color analysis, wherein the step of comparing each of the RGB bitmaps with the rural color spectrum to obtain the dominant color corresponding to each spatial area in each of the RGB bitmaps, specifically includes:
[0032] Based on each of the RGB bitmaps, the deviation value between each pixel and each chromatogram color in the rural chromatogram is calculated, and the chromatogram color with the smallest deviation value is obtained as the cluster color of the corresponding pixel;
[0033] After calculating the cluster colors of all pixels in each RGB bitmap, the frequency of occurrence of each cluster color in all spatial regions in each RGB bitmap is calculated, and the cluster color with the highest frequency is used as the dominant color of the corresponding spatial region.
[0034] In addition, to achieve the above-mentioned purpose, the present invention further provides a street view visualization map generation system based on color analysis, wherein the street view visualization map generation system based on color analysis includes:
[0035] A preprocessing module, used to obtain a plurality of rural street view images to be processed, and perform a preprocessing operation on each of the rural street view images to obtain a plurality of preprocessed street view images;
[0036] A semantic segmentation module, used to perform semantic segmentation processing on each of the pre-processed street view images to obtain a semantic segmentation result corresponding to each of the pre-processed street view images;
[0037] A color clustering module, used for performing a splicing operation on all the semantic segmentation results according to preset element conditions to obtain a plurality of spliced images, and performing a color clustering operation on all the spliced images to obtain a rural color spectrum;
[0038] The atlas generation module is used to compare each of the rural street view images with the rural color spectrum to obtain a street view visualization atlas corresponding to each of the rural street view images.
[0039] In addition, to achieve the above-mentioned purpose, the present invention also provides a terminal, wherein the terminal includes: a memory, a processor, and a street view visualization map generation program based on color analysis stored in the memory and executable on the processor, wherein the street view visualization map generation program based on color analysis implements the steps of the street view visualization map generation method based on color analysis as described above when the street view visualization map generation program based on color analysis is executed by the processor.
[0040] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a street view visualization map generation program based on color analysis, and when the street view visualization map generation program based on color analysis is executed by a processor, the steps of the street view visualization map generation method based on color analysis as described above are implemented.
[0041] In the present invention, a plurality of rural street view images to be processed are obtained, and a preprocessing operation is performed on each of the rural street view images to obtain a plurality of preprocessed street view images; a semantic segmentation process is performed on each of the preprocessed street view images to obtain a semantic segmentation result corresponding to each of the preprocessed street view images; a splicing operation is performed on all of the semantic segmentation results according to preset element conditions to obtain a plurality of spliced images, and a color clustering operation is performed on all of the spliced images to obtain a rural color spectrum; and a comparison operation is performed on each of the rural street view images and the rural color spectrum to obtain a street view visualization map corresponding to each of the rural street view images. The present invention effectively improves the efficiency and accuracy of color analysis of rural street view images, reduces the complexity of operation, and increases the accuracy and clarity of street view visualization maps. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 It is a flow chart of a preferred embodiment of the method for generating a street view visualization map based on color analysis of the present invention;
[0043] Figure 2 It is a schematic diagram of a standard image of a preferred embodiment of the method for generating a street view visualization map based on color analysis of the present invention;
[0044] Figure 3 It is a schematic diagram of a rural street view image adopted in a preferred embodiment of the method for generating a street view visualization map based on color analysis of the present invention;
[0045] Figure 4 It is a schematic diagram of a preprocessed street view image of a preferred embodiment of the method for generating a street view visualization map based on color analysis of the present invention;
[0046] Figure 5 It is a schematic diagram of spatial elements of a preferred embodiment of the method for generating a street view visualization map based on color analysis of the present invention;
[0047] Figure 6 It is a schematic diagram of the semantic segmentation result of a preferred embodiment of the method for generating a street view visualization map based on color analysis of the present invention;
[0048] Figure 7 It is a schematic diagram of a spliced image of a preferred embodiment of a method for generating a street view visualization map based on color analysis of the present invention;
[0049] Figure 8 It is a schematic diagram of a rural color spectrum of a preferred embodiment of the method for generating a street view visualization map based on color analysis of the present invention;
[0050] Fig. 9 It is a schematic diagram of a spatial region vector diagram of a preferred embodiment of a method for generating a street view visualization map based on color analysis of the present invention;
[0051] Fig.10 It is a schematic diagram of a street view visualization map of a preferred embodiment of the method for generating a street view visualization map based on color analysis of the present invention;
[0052] Fig.11 It is a schematic diagram of the principle of a preferred embodiment of the street view visualization atlas generation system based on color analysis of the present invention;
[0053] Fig.12 Schematic diagram of the operating environment of a preferred embodiment of the terminal of the present invention. DETAILED DESCRIPTION
[0054] In order to make the purpose, technical solution and advantages of the present invention clearer and more specific, the present invention is further described in detail below with reference to the accompanying drawings and examples. 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.
[0055] The method for generating a street view visualization map based on color analysis described in the preferred embodiment of the present invention is as follows: Figure 1 As shown, the method for generating a street view visualization map based on color analysis includes the following steps:
[0056] Step S10: obtaining a plurality of rural street view images to be processed, and performing a preprocessing operation on each of the rural street view images to obtain a plurality of preprocessed street view images.
[0057] Specifically, in a preferred embodiment of the present invention, since the current rural street view database has not yet been fully established, rural street view images are acquired by field survey and shooting; after the technicians obtain multiple rural street view images of the target village through image shooting equipment (such as mobile phones, cameras, and other devices that can take pictures), they will pre-process each rural street view image, which is actually to adjust the white balance of each rural street view image, so as to obtain a pre-processed street view image corresponding to each rural street view image.
[0058] Further, the obtaining of a plurality of rural street view images to be processed and performing a preprocessing operation on each of the rural street view images to obtain a plurality of preprocessed street view images specifically includes:
[0059] Receive multiple rural street view images to be processed sent by an image capture device, wherein each of the rural street view images is obtained by photographing the image capture device according to a preset perspective angle and preset shooting elements; receive a white balance card photo sent by the image capture device, wherein the white balance card photo is obtained by photographing the white balance card by the image capture device; perform a color temperature correction operation on each of the rural street view images according to the white balance card photo to obtain a preprocessed street view image corresponding to each of the rural street view images.
[0060] Specifically, the technicians conduct field research and shoot rural street scenes through image shooting equipment. The shooting is preferably carried out on a cloudy day, because under the lighting conditions of diffuse light, the rural landscape can present its original colors to the greatest extent; and the technicians need to shoot the rural street scenes according to preset perspective angles and preset shooting elements. The preset perspective angle is preferably one-point perspective (parallel perspective), and the preset shooting elements are preferably the sky, the ground and a single-sided building wall (the image containing the sky, the ground and a single-sided building wall can be called a typical scene in the rural street scene, and the typical scene can better express the color characteristics of the target village), such as Figure 2 As shown, Figure 2 (a) and (b) in the figure are rural street scene images that meet the preset perspective angles and preset shooting elements. Figure 2 (c) in the figure does not meet the preset perspective angle, so no subsequent processing is performed on it; in a preferred embodiment of the present invention, Figure 3 As shown, select Figure 3 Four rural street view images of a certain village in China are used as the rural street view images to be processed (more rural street view images can be selected according to actual needs).
[0061] In addition, after taking the rural street view image, it is also necessary to take a photo of the white balance card under the same lighting conditions. As the white balance card photo, the white balance card photo is used as a reference for subsequent white balance adjustment of the rural street view image. Since the light and shadow effects of the same device taken at similar time points are similar, all rural street view images can be uniformly adjusted in parameters based on the white balance card photo. The main purpose is to correct the color temperature of the rural street view image and restore the original color of the photographed subject. First, the color on the white balance card photo is adjusted to the original color of the white balance card, the adjusted color parameters are recorded, and the color temperature correction operation is performed on all rural street view images based on the color parameters to obtain the pre-processed street view image corresponding to each rural street view image, thereby restoring the true color of the rural street view images in batches and improving the accuracy of the street view visualization map. Figure 4 As shown, Figure 4 (a), (b), (c) and (d) are Figure 3 Preprocessed street view images obtained after color temperature correction in (a), (b), (c) and (d).
[0062] Step S20: Perform semantic segmentation processing on each of the pre-processed street view images to obtain a semantic segmentation result corresponding to each of the pre-processed street view images.
[0063] Specifically, in a preferred embodiment of the present invention, it is necessary to perform semantic segmentation processing on each preprocessed image separately, so as to obtain a semantic segmentation result corresponding to each preprocessed street view image; it should be noted that the semantic segmentation processing in the preferred embodiment adopts an image segmentation algorithm based on the deep learning model Deeplab-ResNet101.
[0064] Furthermore, the performing semantic segmentation processing on each of the pre-processed street view images to obtain a semantic segmentation result corresponding to each of the pre-processed street view images specifically includes:
[0065] Semantic segmentation processing is performed on each of the preprocessed street view images to obtain a semantic segmentation image corresponding to each of the preprocessed street view images, wherein each of the semantic segmentation images is composed of a plurality of spatial elements; a screening operation is performed on each of the semantic segmentation images according to preset element conditions, and spatial elements in each of the semantic segmentation images that meet the preset element conditions are retained to obtain a semantic segmentation result corresponding to each of the semantic segmentation images.
[0066] Specifically, spatial elements include building elements, vegetation elements, sky elements, ground elements, streetscape elements and movable elements, among which streetscape elements include advertising signs, wall paintings, street furniture and landscape sketches, and movable elements include people, cars and animals. Semantic segmentation is performed on each pre-processed street view image to obtain a semantic segmentation image corresponding to each pre-processed street view image. The semantic segmentation image is as follows: Figure 5 As shown, it contains multiple spatial elements; then, the technician can retain the required spatial elements according to the actual situation. In the preferred embodiment of the present invention, in order to exclude the influence of sky elements, ground elements and movable elements on color clustering, only three spatial elements of building elements, vegetation elements and street landscape elements are used as preset element conditions; the semantic segmentation image corresponding to each pre-processed street view image is screened by the preset element conditions, and the building elements, vegetation elements and street landscape elements in each semantic segmentation image are retained, so as to obtain the semantic segmentation result corresponding to each semantic segmentation image, such as Figure 6 As shown, Figure 6 (a), (b), (c) and (d) are Figure 4 The semantic segmentation results are obtained after semantic segmentation processing of (a), (b), (c) and (d) in the figure; the present invention can accurately divide different spatial elements in the rural street view image through semantic segmentation processing, more accurately identify and extract the required spatial elements, help to filter out irrelevant information in the rural street view image, simplify subsequent analysis and processing procedures, improve data processing efficiency, and reduce the waste of computing resources.
[0067] Step S30: performing a stitching operation on all the semantic segmentation results according to preset element conditions to obtain a plurality of stitched images, and performing a color clustering operation on all the stitched images to obtain a rural color spectrum.
[0068] Specifically, in a preferred embodiment of the present invention, the semantic segmentation results obtained by the semantic segmentation processing are first stitched together to integrate a stitched image belonging to the same spatial element, and then a color clustering operation is performed based on the stitched image to generate a corresponding rural color spectrum.
[0069] Furthermore, the preset element conditions include building elements, vegetation elements and street landscape elements; the stitching operation is performed on all the semantic segmentation results according to the preset element conditions to obtain multiple stitched images, specifically including:
[0070] A classification operation is performed on all the semantic segmentation results according to the building elements, the vegetation elements and the street landscape elements, and spatial elements of the same type are grouped together to obtain a building element group, a vegetation element group and a street landscape element group; all spatial elements in the building element group, the vegetation element group and the street landscape element group are spliced respectively to obtain spliced images corresponding to the building element group, the vegetation element group and the street landscape element group respectively.
[0071] Specifically, each semantic segmentation result is first classified according to building elements, vegetation elements and street landscape elements, and the spatial elements of the same type are grouped together. Since each semantic segmentation result after screening only contains building elements, vegetation elements and street landscape elements, the classification operation will eventually obtain a building element group, a vegetation element group and a street landscape element group, each of which only contains the corresponding spatial elements; then all the spatial elements in the building element group, the vegetation element group and the street landscape element group are spliced respectively to obtain a spliced image corresponding to the building element group (such as Figure 7 (a)), the mosaic image corresponding to the vegetation element group (as shown in Figure 7 (b)) and the mosaic image corresponding to the street landscape feature group (as shown in Figure 7 ; the present invention can further emphasize the color difference between different spatial elements by splicing the same type of spatial elements into corresponding spliced images, which helps to more accurately identify and extract the colors of different spatial elements.
[0072] Furthermore, the color clustering operation is performed on all the stitched images to obtain a rural color spectrum, which specifically includes:
[0073] According to the first preset K value, a color clustering operation is performed on the stitched images corresponding to the building element group to obtain a building color spectrum; according to the second preset K value, a color clustering operation is performed on the stitched images corresponding to the vegetation element group to obtain a vegetation color spectrum; according to the third preset K value, a color clustering operation is performed on the stitched images corresponding to the street landscape element group to obtain a street landscape color spectrum; the building color spectrum, the vegetation color spectrum and the street landscape color spectrum are integrated to obtain a rural color spectrum.
[0074] Specifically, in a preferred embodiment of the present invention, the color clustering operation adopts the K-means clustering algorithm, so the technician first makes a preliminary estimate based on each stitched image, customizes the number of colors of each stitched image, pre-sets a preset K value corresponding to each stitched image, and then performs the corresponding color clustering operation according to the preset K value, thereby obtaining the clustering results of the stitched images corresponding to different spatial element groups; in a preferred embodiment, a first preset K value is set for the stitched images corresponding to the building element group, preferably 6; a second preset K value is set for the stitched images corresponding to the vegetation element group, preferably 1; and a third preset K value is set for the stitched images corresponding to the street landscape element group, preferably 3.
[0075] As an example, taking the vegetation element group as an example, since the second preset K value is 1, the spliced image needs to be clustered into one color cluster. First, the RGB value of one pixel point is randomly selected from the spliced image as the center of the initial classification. (If it is a spatial feature group, 6 centers are randomly selected, or if it is a streetscape feature group, 3 centers are selected), center Recorded as ,in, Representation Center The red value of Representation Center The green value, Representation Center The blue value of the stitched image (width is , Gao Wei ), the pixel coordinates in the stitched image are ,in, , ; Traverse each pixel in the stitched image and calculate the RGB value of each pixel (in, Represents the red value of the pixel. Represents the green value of the pixel. represents the blue value of the pixel) to the center The Euclidean distance of , and assign the point to the nearest color cluster (since the second preset K value of the vegetation feature group is 1, only the distance from each pixel to the center is calculated Euclidean distance and directly assigned to the center If it is a spatial feature group or a streetscape feature group, the Euclidean distance from each pixel to each center is calculated, and the pixel is assigned to the color cluster corresponding to the center with the shortest Euclidean distance). The specific calculation formula is: ; Then calculate the mean of each color cluster, and perform the same Euclidean distance calculation and distribution operation as above until the clustering result does not change, and get the final clustering result. The clustering result is actually the RGB value of the color cluster corresponding to the vegetation element group. Then, according to the RGB value, the vegetation color spectrum corresponding to the vegetation element group can be obtained (such as Figure 8 as shown); Figure 8 As shown, in the preferred embodiment of the present invention, since the first preset K value is 6, the building color spectrum corresponding to the building element group has 6 colors, and the third preset K value is 3, the street landscape color spectrum corresponding to the street landscape element group has 3 colors; finally, the building color spectrum, the vegetation color spectrum and the street landscape color spectrum are integrated to obtain the rural color spectrum corresponding to the four rural street view images in the preferred embodiment of the present invention.
[0076] Step S40: Compare each of the rural street view images with the rural color spectrum to obtain a street view visualization map corresponding to each of the rural street view images.
[0077] Specifically, in a preferred embodiment of the present invention, after obtaining the rural color spectrum, each rural street view image can be compared with the rural color spectrum respectively, so as to generate a street view visualization map corresponding to each rural street view image, which is actually to represent the rural street view image as a spatial color visualization map.
[0078] Furthermore, the comparing operation of each of the rural street view images with the rural color spectrum to obtain a street view visualization map corresponding to each of the rural street view images specifically includes:
[0079] Each of the rural street view images is converted into a spatial area vector map, and each of the spatial area vector maps is converted into an RGB bitmap, wherein each of the spatial area vector maps and the corresponding RGB bitmap contain a plurality of identical spatial areas; each of the RGB bitmaps is compared with the rural color spectrum to obtain the dominant color corresponding to each spatial area in each RGB bitmap; the spatial area vector maps are filled with colors according to the dominant color of each spatial area in each RGB bitmap to obtain a street view visualization map corresponding to each of the rural street view images.
[0080] Specifically, based on each rural street view image, each rural street view image is converted into a spatial area vector map by a vector drawing tool; for example, Fig. 9 As shown, Fig. 9 For Figure 6 (d) in the figure is used as the spatial region vector diagram for base map conversion. The spatial region vector diagram is a color vector diagram with spatial region information, where each spatial region is a non-intersecting closed polygon. Different spatial regions are randomly filled with different colors, thereby ensuring the validity of different spatial regions and avoiding information loss caused by errors in spatial region calculation during subsequent processing.
[0081] Then, each spatial region vector map is converted into an RGB bitmap (also called an RGB image or an RGB bitmap image). The RGB bitmap is an image corresponding to the spatial region vector map and the rural street view image. The pixels of the RGB bitmap correspond to the rural street view image, and the spatial region of the RGB bitmap corresponds to the spatial region vector map. Then, a comparison operation is performed based on each RGB bitmap and all the color spectrum colors in the rural color spectrum, so as to obtain the dominant color corresponding to each spatial region in each RGB bitmap. Finally, the dominant color of each spatial region is used to fill the spatial region corresponding to the spatial region vector map, so as to obtain a street view visualization map corresponding to each rural street view image. Fig.10 As shown, Fig.10 is the dominant color pair calculated for each spatial region Fig. 9 The street view visualization map is actually obtained by coloring all the spatial areas in the spatial area vector map. Figure 3 (d) The corresponding street view visualization map; the present invention compares the RGB bitmap and the rural color spectrum, and generates the final street view space color map according to the spatial area vector map, thereby avoiding the generation of noise and burrs, and more intuitively and clearly showing the distribution of cluster colors in space, thereby being able to produce a more accurate street view visualization map.
[0082] Furthermore, the comparing operation of each of the RGB bitmaps with the rural color spectrum to obtain the dominant color corresponding to each spatial area in each of the RGB bitmaps specifically includes:
[0083] Based on each of the RGB bitmaps, the deviation value between each pixel and each chromatographic color in the rural color spectrum is calculated, and the chromatographic color with the smallest deviation value is obtained as the clustering color of the corresponding pixel; after calculating the clustering colors of all pixel points in each of the RGB bitmaps, the frequency of occurrence of each clustering color in all spatial areas in each of the RGB bitmaps is calculated, and the clustering color with the highest frequency is used as the dominant color of the corresponding spatial area.
[0084] Specifically, taking a specific RGB bitmap as an example, the deviation value between each pixel in this RGB bitmap and each chromatogram color in the rural color spectrum is calculated, which is actually to calculate the Euclidean distance between each pixel and each chromatogram color. The specific calculation formula is consistent with the above-mentioned Euclidean distance calculation formula; taking a specific pixel as an example, after calculating all the deviation values of this pixel and all chromatogram colors, the minimum deviation value is obtained from all the deviation values, and the chromatogram color corresponding to the minimum deviation value is used as the clustering color of this pixel.
[0085] After calculating the cluster colors corresponding to all pixels in this RGB bitmap, the frequency of occurrence of all cluster colors in each spatial area in the RGB bitmap is calculated based on this; taking a specific spatial area as an example, the cluster colors corresponding to all pixels in this spatial area are obtained, the frequency of occurrence of each cluster color is calculated, and the cluster color with the highest frequency of occurrence is used as the dominant color corresponding to this spatial area.
[0086] Furthermore, if Fig.11 As shown, based on the above-mentioned street view visualization map generation method based on color analysis, the present invention also provides a street view visualization map generation system based on color analysis, wherein the street view visualization map generation system based on color analysis includes:
[0087] A preprocessing module 51 is used to obtain a plurality of rural street view images to be processed, and perform a preprocessing operation on each of the rural street view images to obtain a plurality of preprocessed street view images;
[0088] A semantic segmentation module 52, configured to perform semantic segmentation processing on each of the pre-processed street view images to obtain a semantic segmentation result corresponding to each of the pre-processed street view images;
[0089] A color clustering module 53 is used to perform a splicing operation on all the semantic segmentation results according to preset element conditions to obtain multiple spliced images, and perform a color clustering operation on all the spliced images to obtain a rural color spectrum;
[0090] The atlas generating module 54 is used to compare each of the rural street view images with the rural color spectrum to obtain a street view visualization atlas corresponding to each of the rural street view images.
[0091] Furthermore, if Fig.12 As shown, based on the above-mentioned method and system for generating a street view visualization map based on color analysis, the present invention also provides a terminal accordingly, and the terminal includes a processor 10, a memory 20 and a display 30. Fig.12 Only some components of the terminal are shown, but it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.
[0092] In some embodiments, the memory 20 may be an internal storage unit of the terminal, such as a hard disk or memory of the terminal. In other embodiments, the memory 20 may also be an external storage device of the terminal, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc. equipped on the terminal. Further, the memory 20 may also include both an internal storage unit of the terminal and an external storage device. The memory 20 is used to store application software and various types of data installed in the terminal, such as the program code of the installation terminal. The memory 20 may also be used to temporarily store data that has been output or is to be output. In one embodiment, a street view visualization map generation program 40 based on color analysis is stored on the memory 20, and the street view visualization map generation program 40 based on color analysis can be executed by the processor 10, thereby realizing the street view visualization map generation method based on color analysis in the present application.
[0093] In some embodiments, the processor 10 may be a central processing unit (CPU), a microprocessor or other data processing chip, used to run the program code or process data stored in the memory 20, such as executing the street view visualization map generation method based on color analysis.
[0094] In some embodiments, the display 30 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, etc. The display 30 is used to display information on the terminal and to display a visual user interface. The components 10-30 of the terminal communicate with each other via a system bus.
[0095] In one embodiment, when the processor 10 executes the street view visualization map generation program 40 based on color analysis in the memory 20, the following steps are implemented:
[0096] Acquire multiple rural street view images to be processed, and perform preprocessing operations on each of the rural street view images to obtain multiple preprocessed street view images;
[0097] Performing semantic segmentation processing on each of the pre-processed street view images respectively to obtain a semantic segmentation result corresponding to each of the pre-processed street view images;
[0098] Performing a stitching operation on all the semantic segmentation results according to preset element conditions to obtain a plurality of stitched images, and performing a color clustering operation on all the stitched images to obtain a rural color spectrum;
[0099] Each of the rural street view images is compared with the rural color spectrum to obtain a street view visualization map corresponding to each of the rural street view images.
[0100] The step of obtaining a plurality of rural street view images to be processed and performing a preprocessing operation on each of the rural street view images to obtain a plurality of preprocessed street view images specifically includes:
[0101] Receiving a plurality of rural street view images to be processed sent by an image capturing device, wherein each of the rural street view images is captured by the image capturing device according to a preset perspective angle and preset shooting elements;
[0102] receiving a white balance card photo sent by the image capture device, wherein the white balance card photo is obtained by the image capture device photographing the white balance card;
[0103] A color temperature correction operation is performed on each of the rural street view images according to the white balance card photo to obtain a preprocessed street view image corresponding to each of the rural street view images.
[0104] The performing semantic segmentation processing on each of the pre-processed street view images to obtain a semantic segmentation result corresponding to each of the pre-processed street view images specifically includes:
[0105] Performing semantic segmentation processing on each of the pre-processed street view images respectively to obtain a semantic segmentation image corresponding to each of the pre-processed street view images, wherein each of the semantic segmentation images is composed of a plurality of spatial elements;
[0106] A screening operation is performed on each of the semantic segmentation images according to preset element conditions, and spatial elements in each of the semantic segmentation images that meet the preset element conditions are retained to obtain a semantic segmentation result corresponding to each semantic segmentation image.
[0107] The preset element conditions include building elements, vegetation elements and streetscape elements;
[0108] The step of performing a stitching operation on all the semantic segmentation results according to the preset element conditions to obtain a plurality of stitched images specifically includes:
[0109] Classifying all the semantic segmentation results according to the building elements, the vegetation elements and the street landscape elements, grouping the spatial elements of the same type into one group to obtain a building element group, a vegetation element group and a street landscape element group;
[0110] All spatial elements in the building element group, the vegetation element group and the street landscape element group are spliced respectively to obtain spliced images corresponding to the building element group, the vegetation element group and the street landscape element group respectively.
[0111] The step of performing a color clustering operation on all the stitched images to obtain a rural color spectrum specifically includes:
[0112] Performing a color clustering operation on the spliced image corresponding to the building element group according to a first preset K value to obtain a building color spectrum;
[0113] Performing a color clustering operation on the spliced image corresponding to the vegetation element group according to a second preset K value to obtain a vegetation color spectrum;
[0114] Performing a color clustering operation on the spliced image corresponding to the street landscape element group according to a third preset K value to obtain a street landscape color spectrum;
[0115] The building chromatogram, the vegetation chromatogram and the street landscape chromatogram are integrated to obtain a rural chromatogram.
[0116] The step of comparing each of the rural street view images with the rural color spectrum to obtain a street view visualization map corresponding to each of the rural street view images specifically includes:
[0117] Converting each of the rural street view images into a spatial region vector map, and converting each of the spatial region vector maps into an RGB bitmap, wherein each of the spatial region vector maps and the corresponding RGB bitmap contains a plurality of identical spatial regions;
[0118] Compare each of the RGB bitmaps with the rural color spectrum to obtain a dominant color corresponding to each spatial area in each of the RGB bitmaps;
[0119] The spatial region vector graphs are respectively filled with colors according to the dominant colors of each spatial region in each RGB bitmap to obtain a street view visualization map corresponding to each of the rural street view images.
[0120] The step of comparing each of the RGB bitmaps with the rural color spectrum to obtain the dominant color corresponding to each spatial region in each of the RGB bitmaps specifically includes:
[0121] Based on each of the RGB bitmaps, the deviation value between each pixel and each chromatogram color in the rural chromatogram is calculated, and the chromatogram color with the smallest deviation value is obtained as the cluster color of the corresponding pixel;
[0122] After calculating the cluster colors of all pixels in each RGB bitmap, the frequency of occurrence of each cluster color in all spatial regions in each RGB bitmap is calculated, and the cluster color with the highest frequency is used as the dominant color of the corresponding spatial region.
[0123] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a street view visualization map generation program based on color analysis, and when the street view visualization map generation program based on color analysis is executed by a processor, the steps of the street view visualization map generation method based on color analysis as described above are implemented.
[0124] In summary, the present invention provides a method, system and terminal for generating a street view visualization map based on color analysis, the method comprising: obtaining a plurality of rural street view images to be processed, performing preprocessing operations on each of the rural street view images respectively, and obtaining a plurality of preprocessed street view images; performing semantic segmentation processing on each of the preprocessed street view images respectively, and obtaining a semantic segmentation result corresponding to each of the preprocessed street view images; performing a splicing operation on all of the semantic segmentation results according to preset element conditions, and obtaining a plurality of spliced images, and performing a color clustering operation on all of the spliced images, and obtaining a rural color spectrum; performing a comparison operation on each of the rural street view images and the rural color spectrum respectively, and obtaining a street view visualization map corresponding to each of the rural street view images. The present invention effectively improves the efficiency and accuracy of color analysis of rural street view images, reduces the complexity of operation, and increases the accuracy and clarity of street view visualization maps.
[0125] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or terminal including the element.
[0126] Of course, those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware (such as a processor, a controller, etc.) through a computer program, and the program can be stored in a computer-readable storage medium that can be read by a computer, and the program can include the processes of the above-mentioned method embodiments when executed. The computer-readable storage medium can be a memory, a disk, an optical disk, etc.
[0127] It should be understood that the application of the present invention is not limited to the above examples. For ordinary technicians in this field, improvements or changes can be made based on the above description. All these improvements and changes should fall within the scope of protection of the claims attached to the present invention.
Claims
1. A method for generating a street view visualization map based on color analysis, characterized in that: The street view visualization map generation method based on color analysis includes: Acquire a plurality of rural street view images to be processed, and perform a preprocessing operation on each of the rural street view images to obtain a plurality of preprocessed street view images; The obtaining of a plurality of rural street view images to be processed and performing a preprocessing operation on each of the rural street view images to obtain a plurality of preprocessed street view images specifically includes: Receiving a plurality of rural street view images to be processed sent by an image capturing device, wherein each of the rural street view images is captured by the image capturing device according to a preset perspective angle and preset shooting elements; receiving a white balance card photo sent by the image capture device, wherein the white balance card photo is obtained by the image capture device photographing the white balance card; Performing a color temperature correction operation on each of the rural street view images according to the white balance card photo, uniformly adjusting the parameters of each of the rural street view images, and obtaining a pre-processed street view image corresponding to each of the rural street view images; Performing semantic segmentation processing on each of the pre-processed street view images respectively to obtain a semantic segmentation result corresponding to each of the pre-processed street view images; Performing a stitching operation on all the semantic segmentation results according to preset element conditions to obtain a plurality of stitched images, and performing a color clustering operation on all the stitched images to obtain a rural color spectrum; Comparing each of the rural street view images with the rural color spectrum to obtain a street view visualization map corresponding to each of the rural street view images; The comparing operation of each of the rural street view images with the rural color spectrum to obtain a street view visualization map corresponding to each of the rural street view images specifically includes: Converting each of the rural street view images into a spatial region vector map, and converting each of the spatial region vector maps into an RGB bitmap, wherein each of the spatial region vector maps and the corresponding RGB bitmap contains a plurality of identical spatial regions; Compare each of the RGB bitmaps with the rural color spectrum to obtain a dominant color corresponding to each spatial area in each of the RGB bitmaps; Filling the spatial region vector graphs according to the dominant color of each spatial region in each RGB bitmap, respectively, to obtain a street view visualization map corresponding to each of the rural street view images; The comparing operation of each of the RGB bitmaps with the rural color spectrum to obtain the dominant color corresponding to each spatial area in each of the RGB bitmaps specifically includes: Based on each of the RGB bitmaps, the deviation value between each pixel and each chromatogram color in the rural chromatogram is calculated, and the chromatogram color with the smallest deviation value is obtained as the cluster color of the corresponding pixel; After calculating the cluster colors of all pixels in each RGB bitmap, the frequency of occurrence of each cluster color in all spatial regions in each RGB bitmap is calculated, and the cluster color with the highest frequency is used as the dominant color of the corresponding spatial region.
2. The method for generating a street view visualization map based on color analysis according to claim 1, characterized in that: The performing semantic segmentation processing on each of the pre-processed street view images to obtain a semantic segmentation result corresponding to each of the pre-processed street view images specifically includes: Performing semantic segmentation processing on each of the pre-processed street view images respectively to obtain a semantic segmentation image corresponding to each of the pre-processed street view images, wherein each of the semantic segmentation images is composed of a plurality of spatial elements; A screening operation is performed on each of the semantic segmentation images according to preset element conditions, and spatial elements in each of the semantic segmentation images that meet the preset element conditions are retained to obtain a semantic segmentation result corresponding to each semantic segmentation image.
3. The method for generating a street view visualization map based on color analysis according to claim 1, characterized in that: The preset element conditions include building elements, vegetation elements and street landscape elements; The step of performing a stitching operation on all the semantic segmentation results according to the preset element conditions to obtain a plurality of stitched images specifically includes: Classifying all the semantic segmentation results according to the building elements, the vegetation elements and the street landscape elements, grouping the spatial elements of the same type into one group to obtain a building element group, a vegetation element group and a street landscape element group; All spatial elements in the building element group, the vegetation element group and the street landscape element group are spliced respectively to obtain spliced images corresponding to the building element group, the vegetation element group and the street landscape element group respectively.
4. The method for generating a street view visualization map based on color analysis according to claim 3, characterized in that: The color clustering operation is performed according to all the stitched images to obtain a rural color spectrum, which specifically includes: Performing a color clustering operation on the spliced image corresponding to the building element group according to a first preset K value to obtain a building color spectrum; Performing a color clustering operation on the spliced image corresponding to the vegetation element group according to a second preset K value to obtain a vegetation color spectrum; Performing a color clustering operation on the spliced image corresponding to the street landscape element group according to a third preset K value to obtain a street landscape color spectrum; The building chromatogram, the vegetation chromatogram and the street landscape chromatogram are integrated to obtain a rural chromatogram.
5. A street view visualization map generation system based on color analysis, characterized in that: The street view visualization atlas generation system based on color analysis includes: A preprocessing module, used to obtain a plurality of rural street view images to be processed, and perform a preprocessing operation on each of the rural street view images to obtain a plurality of preprocessed street view images; The obtaining of a plurality of rural street view images to be processed and performing a preprocessing operation on each of the rural street view images to obtain a plurality of preprocessed street view images specifically includes: Receiving a plurality of rural street view images to be processed sent by an image capturing device, wherein each of the rural street view images is captured by the image capturing device according to a preset perspective angle and preset shooting elements; receiving a white balance card photo sent by the image capture device, wherein the white balance card photo is obtained by the image capture device photographing the white balance card; Performing a color temperature correction operation on each of the rural street view images according to the white balance card photo, uniformly adjusting the parameters of each of the rural street view images, and obtaining a pre-processed street view image corresponding to each of the rural street view images; A semantic segmentation module, used to perform semantic segmentation processing on each of the pre-processed street view images to obtain a semantic segmentation result corresponding to each of the pre-processed street view images; A color clustering module, used for performing a splicing operation on all the semantic segmentation results according to preset element conditions to obtain a plurality of spliced images, and performing a color clustering operation on all the spliced images to obtain a rural color spectrum; A map generation module, used for comparing each of the rural street view images with the rural color spectrum, to obtain a street view visualization map corresponding to each of the rural street view images; The comparing operation of each of the rural street view images with the rural color spectrum to obtain a street view visualization map corresponding to each of the rural street view images specifically includes: Converting each of the rural street view images into a spatial region vector map, and converting each of the spatial region vector maps into an RGB bitmap, wherein each of the spatial region vector maps and the corresponding RGB bitmap contains a plurality of identical spatial regions; Compare each of the RGB bitmaps with the rural color spectrum to obtain a dominant color corresponding to each spatial area in each of the RGB bitmaps; Filling the spatial region vector graphs according to the dominant color of each spatial region in each RGB bitmap, respectively, to obtain a street view visualization map corresponding to each of the rural street view images; The comparing operation of each of the RGB bitmaps with the rural color spectrum to obtain the dominant color corresponding to each spatial area in each of the RGB bitmaps specifically includes: Based on each of the RGB bitmaps, the deviation value between each pixel and each chromatogram color in the rural chromatogram is calculated, and the chromatogram color with the smallest deviation value is obtained as the cluster color of the corresponding pixel; After calculating the cluster colors of all pixels in each RGB bitmap, the frequency of occurrence of each cluster color in all spatial regions in each RGB bitmap is calculated, and the cluster color with the highest frequency is used as the dominant color of the corresponding spatial region.
6. A terminal, characterized in that: The terminal includes: a memory, a processor, and a street view visualization map generation program based on color analysis stored in the memory and executable on the processor. When the street view visualization map generation program based on color analysis is executed by the processor, the steps of the street view visualization map generation method based on color analysis as described in any one of claims 1 to 4 are implemented.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a street view visualization map generation program based on color analysis, and when the street view visualization map generation program based on color analysis is executed by a processor, the steps of the street view visualization map generation method based on color analysis as described in any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Image recognition method and system based on combination of segmentation and color
CN113920476A
Road scene segmentation method and device, electronic equipment and storage medium
CN114581664A
Color migration method based on semantic segmentation and clustering blocks
CN116363233A
Night streetscape semantic segmentation method based on difficult category perception mechanism
CN116883667A
Public space digital treatment method for village revitalization
CN117392557A
