Green view rate extraction method, device, equipment, and storage medium
The integration of image segmentation models and clustering algorithms enhances the efficiency and reliability of green view rate extraction, addressing the limitations of manual methods and simple pixel extraction in urban environment monitoring.
Patent Information
- Application Number
- CN202111123146.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-24
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2041-09-24
AI Technical Summary
Existing green view rate extraction technologies lack efficiency and reliability, particularly in urban environment monitoring, due to manual methods and simple pixel extraction, which are prone to errors and do not account for complex urban landscapes.
A method involving pre-constructed image segmentation models, such as DeepLabv3+, combined with K-means clustering, to determine the spatial range of green vegetation, using set rules and random point attributes for accurate extraction of green view rate.
Improves the efficiency and accuracy of green view rate extraction by standardizing data collection and utilizing image segmentation technology, providing a reliable basis for urban planning and construction.
Smart Images

Figure CN113837092B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of urban environment monitoring, and in particular to a method, device and equipment, and storage medium for extracting green view rate. Background Art
[0002] With the advancement of the "people-oriented" urban planning concept, the restoration of urban space quality at the micro scale has gradually shown its potential. The green view rate has more advantages than traditional green space quality indicators such as the "green space rate" because it takes into account people's environmental perception and three-dimensional visual effects. It has become a new perspective for evaluating the quality of urban greening environment, and has important guiding significance for urban space quality evaluation and planning and design practice.
[0003] In the related technologies, traditional green view rate evaluation research mostly adopts small-scale shooting sampling and manual identification methods, which lacks efficiency and reliability. At present, cutting-edge technology uses network image big data technology to extract green pixels from street view images to provide a theoretical basis for green view rate identification. However, although this method solves the problems of complex work, high manpower consumption, and manual input errors that may be faced by manual image entry for extraction, it still remains at the stage of direct extraction of simple green pixels at the technical level, and the detection efficiency and reliability need to be further improved. Summary of the invention
[0004] In view of this, the purpose of the present application is to overcome the technical problems of insufficient efficiency and reliability of green viewing rate extraction in the prior art, and to provide a method, device and equipment, and storage medium for green viewing rate extraction.
[0005] To achieve the above objectives, this application adopts the following technical solutions:
[0006] A first aspect of the present application provides a method for extracting green viewing rate, comprising:
[0007] Get the set rules;
[0008] According to the set rules, obtain the detection picture;
[0009] Inputting the detection picture into a pre-built image segmentation model to obtain green vegetation spatial range information;
[0010] Based on the detection picture, the green viewing rate is extracted according to the green vegetation spatial range information to obtain a green viewing rate extraction result.
[0011] Optionally, after obtaining the green viewing rate extraction result, the method further includes:
[0012] The green viewing rate extraction result is displayed.
[0013] Optionally, extracting the green viewing rate according to the green vegetation spatial range information includes:
[0014] The green viewing rate is extracted using a K-means clustering algorithm according to the green vegetation spatial range information.
[0015] Optionally, the setting rule carries random point attributes; the random point attributes include: longitude and latitude information, picture size and viewing angle parameters.
[0016] Optionally, obtaining the detection image according to the set rule includes:
[0017] Determine the acquisition position of the detection image according to the latitude and longitude information;
[0018] Determining, according to the viewing angle parameter, an acquisition angle parameter of the detection image at the acquisition position;
[0019] According to the image size, the detection image is acquired at the acquisition position with the acquisition angle parameter.
[0020] Optionally, the method for constructing the image segmentation model includes:
[0021] Obtain a training sample set;
[0022] Based on the Deep labv3+ framework, the Xception model is trained using the training sample set to obtain the image segmentation model.
[0023] A second aspect of the present application provides a device for extracting green viewing rate, comprising:
[0024] A first acquisition module, used to acquire setting rules;
[0025] A second acquisition module is used to acquire a detection image according to the set rules;
[0026] A calculation module, used for inputting the detection picture into a pre-built image segmentation model to obtain green vegetation spatial range information;
[0027] The extraction module is used to extract the green viewing rate based on the detection image and the green vegetation spatial range information to obtain a green viewing rate extraction result.
[0028] Optionally, a display module is also included;
[0029] The display module is used to display the green viewing rate extraction result.
[0030] A third aspect of the present application provides a device for extracting green viewing rate, comprising:
[0031] A processor, and a memory connected to the processor;
[0032] The memory is used to store computer programs;
[0033] The processor is used to call and execute the computer program in the memory to perform the method according to the first aspect of the present application.
[0034] The fourth aspect of the present application provides a storage medium storing a computer program. When the computer program is executed by a processor, the various steps of the method for extracting green viewing rate as described in the first aspect of the present application are implemented.
[0035] The technical solution provided by this application may have the following beneficial effects:
[0036] In the scheme of the present application, an image segmentation model is pre-constructed that can be used to determine the spatial range of green vegetation in a picture. Based on this, after obtaining the set rules, a test picture can be obtained according to the set rules, and then the test picture is input into the image segmentation model to obtain the spatial range information of green vegetation in the test picture. Based on the test picture, the green view rate is extracted according to the green vegetation spatial range information to obtain the green view rate extraction result. In this way, the set rules are used to obtain standardized test pictures, and at the same time, the image segmentation technology is introduced to determine the spatial range of green vegetation, which effectively improves the efficiency and accuracy of green view rate extraction and provides a theoretical basis for urban planning and construction. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0038] Figure 1 This is a flow chart of a method for extracting green viewing rate provided by an embodiment of the present application.
[0039] Figure 2 It is a structural schematic diagram of a device for extracting green viewing rate provided in another embodiment of the present application.
[0040] Figure 3 It is a structural schematic diagram of a device for extracting green viewing rate provided by another embodiment of the present application. DETAILED DESCRIPTION
[0041] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be described in detail below. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other implementation methods obtained by ordinary technicians in the field without creative work belong to the scope of protection of the present application.
[0042] Green view rate refers to "the proportion of green vegetation in the urban landscape in the field of vision of urban residents on streets that connect human living space, production space, and ecological space." By measuring the urban green view rate, we can find streets that need to be covered with green vegetation in the visual perception of urban residents, and provide refined planning and practical support for the establishment of public urban spaces that are suitable for living, working, and traveling.
[0043] In the related art, the existing green view rate extraction technology is mostly realized by extracting simple green pixels. However, due to the interference of various buildings and facilities in the city, the accuracy of the green view rate obtained by extracting green pixels still has a lot of room for improvement. To this end, the embodiment of the present application provides a method for extracting green view rate, such as Figure 1 As shown, the method may at least include the following steps:
[0044] Step 11: Get the setting rules.
[0045] During implementation, the setting rules provided by the user can be obtained, and the arrangement of random points on the road can be determined by using the setting rules. For example, the setting rule can be to select m random points per kilometer on a certain road in the city. The number of m can be set according to demand. In this way, a data collection basis can be provided for the measurement of the urban green view rate.
[0046] Step 12: Get the detection image according to the set rules.
[0047] Step 13: Input the detected image into a pre-built image segmentation model to obtain the spatial range information of green vegetation.
[0048] Step 14: Based on the detection image, the green viewing rate is extracted according to the spatial range information of the green vegetation to obtain a green viewing rate extraction result.
[0049] In this embodiment, an image segmentation model that can be used to determine the spatial range of green vegetation in a picture is pre-constructed. Based on this, after obtaining the set rules, a detection picture can be obtained according to the set rules, and then the detection picture is input into the image segmentation model to obtain the spatial range information of green vegetation in the detection picture. Then, based on the detection picture, the green view rate is extracted according to the green vegetation spatial range information to obtain the green view rate extraction result. In this way, the set rules are used to obtain standardized detection pictures, and at the same time, the image segmentation technology is introduced to determine the spatial range of green vegetation, which effectively improves the efficiency and accuracy of green view rate extraction and provides a theoretical basis for urban planning and construction.
[0050] In step 11, setting rules may be set manually to ensure the standardization and repeatability of subsequent image data collection.
[0051] During implementation, the setting rules may also carry random point attributes, which may include latitude and longitude information, image size, and viewing angle parameters. Among them, the viewing angle parameters may include horizontal viewing angle, vertical viewing angle, and horizontal direction range. The longitude and latitude information is the information of the observation point (random point), which can be used to determine the position of the random point. The image size, i.e., the image size, can be used to determine the size of the detection image to unify the size of all detection images and improve the extraction efficiency and accuracy. For example, a proposed "pedestrian viewing angle" standard may be established at a random point on the road. The "pedestrian viewing angle" may be defined as: four directions (heading = 0, 90, 180, 270) of the horizontal (pitch = 0), a horizontal range of 90° (fov = 90), an image size width of 1024 (width = 1024), and a height of 512 (height = 512) in each direction, then the acquisition of each detection image needs to be determined as pitch = 0; heading = 0, 90, 180, 270; fov = 90; width = 1024; height = 512. The random point attributes of this point are shown in Table 1.
[0052] Table 1 Random point attributes
[0053]
[0054]
[0055] In some embodiments, when acquiring a detection image according to a set rule, the acquisition position of the detection image can be determined according to the latitude and longitude information; the acquisition angle parameter of the detection image at the acquisition position can be determined according to the viewing angle parameter; and the detection image can be acquired at the acquisition position according to the image size with the acquisition angle parameter. In this way, on the one hand, the acquisition efficiency of the detection image data is greatly improved, and on the other hand, the standard specification for the collection of detection images is established to ensure the repeatability of the collection of detection images.
[0056] After obtaining the test image, the test image can be input into the pre-built image segmentation model to accurately determine the spatial range of green vegetation in the test image based on the image segmentation technology of the convolutional neural network. Compared with the existing "green pixel" recognition, this "image segmentation" completely overcomes the problem that the "green pixel" path only has estimation without hypothesis testing or hypothesis testing with bias, greatly improving the recognition accuracy.
[0057] In some embodiments, the method for constructing an image segmentation model may include: obtaining a training sample set; and training an Xception model using the training sample set based on a Deeplabv3+ framework to obtain an image segmentation model.
[0058] Specifically, the specific implementation method of obtaining the training sample set and using the sample set to train the Xception model can refer to the existing related technology, which will not be repeated here.
[0059] Since the K-means clustering algorithm in the unsupervised clustering algorithm can provide richer and easier-to-interpret visual chart data for extracting plant space area, such as image cluster partition extraction display, cluster color statistics and color space statistics, etc. Therefore, when extracting the green view rate according to the green vegetation space range information, the K-means clustering algorithm can be used to extract the green view rate according to the green vegetation space range information.
[0060] The K-means clustering algorithm originates from a vector quantization method in signal processing and is widely used in the field of data mining. During the calculation, for a given set of image data samples, the sample set is divided into k clusters according to the distance between the samples.
[0061] In specific implementation, taking the data of a certain observation point as an example, the colors in the image can be divided into multiple groups, and the image cluster partitions are assigned to the image pixels of each cluster. The boundary is the color of the cluster, which is calculated by the average value of its pixels. The image partition cluster shows the color distribution of each cluster, and more specific RGB color values, color display, pixel ratio, and K-means distance (ΔE) can also be counted, where ΔE is a measure of the color difference distance between two colors in the lab space, and its formula can be expressed as:
[0062]
[0063] Among them, L2-L1 represents the lightness color difference, a2-a1 represents the red and green colors, and b2-b1 represents the yellow and blue color difference.
[0064] After extraction by the K-means clustering algorithm, a green view rate extraction result can be obtained. The green view rate extraction result may include a color statistics result and a color space statistics result.
[0065] In some embodiments, after obtaining the green viewing rate extraction result, the green viewing rate extraction method may further include: displaying the green viewing rate extraction result so that the user can know the extraction result more intuitively.
[0066] Based on the same technical concept, the embodiment of the present application provides a device for extracting green viewing rate, such as Figure 2 As shown, the device may include: a first acquisition module 201, used to acquire set rules; a second acquisition module 202, used to acquire a detection image according to the set rules; a calculation module 203, used to input the detection image into a pre-built image segmentation model to obtain green vegetation spatial range information; an extraction module 204, used to extract the green viewing rate based on the detection image and the green vegetation spatial range information to obtain a green viewing rate extraction result.
[0067] Optionally, the green viewing rate extraction device may further include a display module; the display module is used to display the green viewing rate extraction result.
[0068] Optionally, when the green viewing rate is extracted according to the green vegetation spatial range information, the calculation module 203 is specifically used to extract the green viewing rate according to the green vegetation spatial range information using a K-means clustering algorithm.
[0069] Optionally, the setting rule carries a random point attribute; the random point attribute may include: longitude and latitude information, image size, and viewing angle parameter. Accordingly, when acquiring the detection image according to the setting rule, the second acquisition module 202 may be specifically used to: determine the acquisition position of the detection image according to the longitude and latitude information; determine the acquisition angle parameter of the detection image at the acquisition position according to the viewing angle parameter; and acquire the detection image at the acquisition position according to the image size and the acquisition angle parameter.
[0070] Optionally, the device for extracting green viewing rate may further include a construction module, which is specifically used to: obtain a training sample set; based on the Deep labv3+ framework, train the Xception model using the training sample set to obtain an image segmentation model.
[0071] During implementation, the specific implementation of the device for extracting green viewing rate provided in the embodiments of the present application can refer to the specific implementation of the method for extracting green viewing rate described in any of the above embodiments, which will not be repeated here.
[0072] Based on the same technical concept, the embodiment of the present application provides a device for extracting green viewing rate, such as Figure 3As shown, the device may include: a processor 301, and a memory 302 connected to the processor 301; the memory 302 is used to store computer programs; the processor 301 is used to call and execute the computer program in the memory 302 to perform the method for extracting green viewing rate as described in any of the above embodiments.
[0073] During implementation, the specific implementation of the green viewing rate extraction device provided in the embodiments of the present application can refer to the specific implementation of the green viewing rate extraction method described in any of the above embodiments, which will not be repeated here.
[0074] Based on the same technical concept, an embodiment of the present application further provides a storage medium storing a computer program. When the computer program is executed by a processor, each step of the method for extracting green viewing rate as described in any of the above embodiments is implemented.
[0075] It can be understood that the same or similar parts of the above embodiments can be referenced to each other, and the contents not described in detail in some embodiments can refer to the same or similar contents in other embodiments.
[0076] It should be noted that, in the description of this application, the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In addition, in the description of this application, unless otherwise specified, the meaning of "plurality" refers to at least two.
[0077] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.
[0078] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0079] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
[0080] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0081] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.
[0082] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0083] Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations on the present application. Ordinary technicians in the field can change, modify, replace and modify the above embodiments within the scope of the present application.
Claims
1. A method for extracting green viewing rate, characterized in that: include: Get the set rules; According to the set rules, obtain the detection picture; Inputting the detection picture into a pre-built image segmentation model to obtain green vegetation spatial range information; Based on the detection picture, the green viewing rate is extracted according to the green vegetation spatial range information to obtain a green viewing rate extraction result, including: according to the green vegetation spatial range information, the green viewing rate is extracted using a K-means clustering algorithm, including: The method comprises: for each observation point, the colors in the image are divided into multiple groups, wherein the image cluster partition is assigned to the image pixels of each cluster, and the boundary is the color of the cluster, which is calculated by the average value of its pixels; and wherein the K-means distance is a measure of the color difference distance between two colors in the lab space, and its formula is expressed as: Wherein, L2-L1 represents the brightness color difference, a2-a1 represents the red and green colors, and b2-b1 represents the yellow and blue color difference; and the green viewing rate extraction result includes a color statistical result and a color space statistical result.
2. The method for extracting green viewing rate according to claim 1, characterized in that: After obtaining the green viewing rate extraction result, the method further includes: The green viewing rate extraction result is displayed.
3. The method for extracting green viewing rate according to claim 1, characterized in that: The setting rule carries random point attributes; the random point attributes include: longitude and latitude information, picture size and viewing angle parameters.
4. The method for extracting green viewing rate according to claim 3, characterized in that: The step of obtaining the detection image according to the set rule includes: Determine the acquisition position of the detection image according to the latitude and longitude information; Determining, according to the viewing angle parameter, an acquisition angle parameter of the detection image at the acquisition position; According to the image size, the detection image is acquired at the acquisition position with the acquisition angle parameter.
5. The method for extracting green viewing rate according to claim 1, characterized in that: The method for constructing the image segmentation model includes: Obtain a training sample set; Based on the Deep labv3+ framework, the Xception model is trained using the training sample set to obtain the image segmentation model.
6. A device for extracting green viewing rate, characterized in that: include: A first acquisition module, used to acquire setting rules; A second acquisition module is used to acquire a detection image according to the set rules; A calculation module, used for inputting the detection picture into a pre-built image segmentation model to obtain green vegetation spatial range information; The extraction module is used to extract the green viewing rate based on the detection image and the green vegetation spatial range information to obtain a green viewing rate extraction result, including: extracting the green viewing rate using a K-means clustering algorithm based on the green vegetation spatial range information, including: The method comprises: for each observation point, the colors in the image are divided into multiple groups, wherein the image cluster partition is assigned to the image pixels of each cluster, and the boundary is the color of the cluster, which is calculated by the average value of its pixels; and wherein the K-means distance is a measure of the color difference distance between two colors in the lab space, and its formula is expressed as: Wherein, L2-L1 represents the brightness color difference, a2-a1 represents the red and green colors, and b2-b1 represents the yellow and blue color difference; and the green viewing rate extraction result includes a color statistical result and a color space statistical result.
7. The device for extracting green viewing rate according to claim 6, characterized in that: Also includes display modules; The display module is used to display the green viewing rate extraction result.
8. A device for extracting green viewing rate, characterized in that: include: A processor, and a memory connected to the processor; The memory is used to store computer programs; The processor is used to call and execute the computer program in the memory to perform the method according to any one of claims 1 to 5.
9. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, each step of the method for extracting green viewing rate according to any one of claims 1 to 5 is implemented.
