A Spark distributed identification method, device, electronic device and storage medium for rural road pavement type
By applying spatial buffer analysis and chain code algorithm in the Spark distributed computing system, combined with low-precision remote sensing image data, we can identify rural road pavement types, which solves the problems of low identification accuracy and high cost in the existing technology, and achieves efficient and economical pavement type recognition.
Patent Information
- Application Number
- CN202411876566.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2044-12-19
AI Technical Summary
In the prior art, the identification accuracy and matching accuracy of rural road pavement types are low and the cost is high, especially in mountainous areas, due to weak satellite signals and vegetation and building occlusion, it is difficult to identify.
The Spark distributed computing system is adopted to obtain rural road electronic maps and low-precision remote sensing image data, and use spatial buffer analysis algorithms and chain code algorithms to divide grid maps and grid images, determine the pavement type and weighted average, reducing costs and improving recognition accuracy.
It improves the identification accuracy and matching accuracy of rural road pavement types, while reducing costs, and solving the problem of difficulty in identifying rural road pavement types in mountainous areas.
Smart Images

Figure CN119323702B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a Spark distributed recognition method, device electronic equipment and storage medium for rural road pavement types. Background Art
[0002] In the prior art, for the identification of rural road pavement types, at least three Spark distributed nodes are deployed in a Yarn manner, and a geographic analysis and processing module algorithm and a convolutional neural network model algorithm are deployed in each distributed node. Under this distributed architecture, the capacity method is used to schedule the subtasks of each distributed node. In this process, high-precision remote sensing image data is usually required to improve the recognition accuracy of rural road pavement types, which will result in high costs. In addition, the satellite signal in the mountainous areas where most rural roads are located is weak, resulting in a large deviation between the rural road line shape and the remote sensing image, making it difficult to accurately match the corresponding remote sensing image data. This situation further affects the recognition accuracy of the pavement type; in addition, when the rural road is blocked by surrounding vegetation, buildings, etc., it is also impossible to accurately identify the rural road pavement type. Summary of the invention
[0003] The purpose of this application is to provide a Spark distributed recognition method, device electronic equipment and storage medium for rural road pavement types, so as to improve the recognition accuracy and matching accuracy of rural road pavement types while reducing costs.
[0004] In a first aspect, the present application provides a Spark distributed recognition method for the pavement type of rural roads, which is applied to a Spark distributed computing system, and includes: obtaining an electronic map of rural roads and corresponding remote sensing image data; determining a grid map set containing rural roads in the electronic map of rural roads, and a grid image set containing rural roads in the remote sensing image data; applying a spatial buffer analysis algorithm to analyze and calculate each grid map in the grid map set to determine at least one first linear road; for each first linear road, performing the following steps: searching for a target grid image set corresponding to the first linear road from the grid image set; calculating a second linear road in the target grid image set; determining an RGB color feature value corresponding to each linear point on the second linear road; determining the pavement type corresponding to each linear point according to the RGB color feature value corresponding to each linear point and the color feature value threshold range corresponding to multiple pavement types obtained in advance through sample training; weighted averaging the pavement types corresponding to multiple linear points to obtain the pavement type of the second linear road, and assigning it to the first linear road; determining the pavement type of the designated road based on the pavement type assigned on the first linear road in each grid map in the electronic map of rural roads.
[0005] Furthermore, the above-mentioned steps of determining a grid map set containing rural roads in an electronic map of rural roads, and a grid image set containing rural roads in remote sensing image data, include: performing the same grid division on the electronic map of rural roads and the remote sensing image data respectively according to a first preset grid size; applying a geospatial buffer analysis method to analyze the electronic map of rural roads, and identifying a grid map set containing rural roads; determining a plurality of grid images corresponding to the grid map set in the remote sensing image data, and for each grid image, retrieving adjacent grid images corresponding to the grid image; determining a set consisting of a plurality of grid images and corresponding adjacent grid images as an initial grid image set in the remote sensing image data; and grid-dividing each initial grid image in the initial grid image set according to a second preset grid size to obtain a grid image set in the remote sensing image data; the second preset grid size is smaller than the first preset grid size.
[0006] Furthermore, the above-mentioned step of searching for a target grid image set corresponding to the first linear highway from the grid image set includes: determining a highway surface area corresponding to the first linear highway; obtaining a minimum circumscribed rectangle corresponding to the highway surface area; and searching for a grid image corresponding to the minimum circumscribed rectangle from the grid image set to obtain a target grid image set.
[0007] Furthermore, the above-mentioned step of calculating the second linear highway in the target grid image set includes: applying a chain code algorithm to calculate the grid images in the target grid image set to determine the highway surface vector data; performing surface-to-line processing on the highway surface vector data to obtain the second linear highway.
[0008] Furthermore, the above-mentioned step of applying the chain code algorithm to calculate the grid images in the target grid image set to determine the highway surface vector data includes: converting the grid images in the target grid image set into grayscale images; binarizing the grayscale images according to the parameter set of the highway on the remote sensing image obtained by preset training to obtain a binary image; wherein the white pixels in the binary image represent the highway; and rasterizing and vectorizing the binary image to obtain the highway surface vector data.
[0009] Furthermore, the step of determining the RGB color feature value corresponding to each linear point on the second linear highway includes: for each linear point on the second linear highway, determining a line between points where a line passing through the linear point and perpendicular to the second linear highway intersects with an edge of the highway surface vector data; determining an RGB color value corresponding to each pixel point on the line; and performing weighted averaging on the RGB color values corresponding to all the pixel points on the line to obtain the RGB color feature value corresponding to the linear point.
[0010] Furthermore, the above-mentioned step of determining the road surface type corresponding to each linear point based on the RGB color feature value corresponding to each linear point and the color feature value threshold intervals corresponding to the multiple road surface types obtained in advance through sample training includes: for the RGB color feature value corresponding to each linear point, judging the target color feature value threshold interval to which the RGB color feature value belongs; and determining the road surface type corresponding to the target color feature value threshold interval as the road surface type corresponding to the linear point.
[0011] In a second aspect, the present application also provides a Spark distributed identification device for rural road pavement types, the device is applied to a Spark distributed computing system, and the device includes: a data acquisition module, used to obtain a rural road electronic map and corresponding remote sensing image data; a set determination module, used to determine a grid map set containing rural roads in the rural road electronic map, and a grid image set containing rural roads in the remote sensing image data; a linear road pavement type determination module, used to apply a spatial buffer analysis algorithm to analyze and calculate each grid map in the grid map set, and determine at least one first linear road; for each first linear road, the following steps are performed: from the grid image set, search Find a target grid image set corresponding to the first linear highway; calculate the second linear highway in the target grid image set; determine the RGB color feature value corresponding to each linear point on the second linear highway; determine the road surface type corresponding to each linear point according to the RGB color feature value corresponding to each linear point and the color feature value threshold range corresponding to multiple road surface types obtained in advance through sample training; perform weighted averaging on the road surface types corresponding to the multiple linear points to obtain the road surface type of the second linear highway, and assign it to the first linear highway; a road surface type determination module is used to determine the road surface type of a designated highway based on the road surface type assigned on the first linear highway in each grid map in the rural highway electronic map.
[0012] In a third aspect, the present application further provides an electronic device, comprising a processor and a memory, wherein the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement the method described in the first aspect above.
[0013] In a fourth aspect, the present application further provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the method described in the first aspect above.
[0014] The present application provides a Spark distributed identification method, device electronic device and storage medium for rural road pavement types. The method is applied to a Spark distributed computing system. First, an electronic map of rural roads and corresponding remote sensing image data are obtained; then a grid map set containing rural roads in the electronic map of rural roads and a grid image set containing rural roads in the remote sensing image data are determined; then a spatial buffer analysis algorithm is applied to analyze and calculate each grid map in the grid map set to determine at least one first linear road; for each first linear road, the following steps are performed: from the grid image set, a first linear road pair is searched; The target grid image set corresponding to the target grid image set is calculated; the second linear highway in the target grid image set is calculated; the RGB color feature value corresponding to each linear point on the second linear highway is determined; the road surface type corresponding to each linear point is determined according to the RGB color feature value corresponding to each linear point and the color feature value threshold interval corresponding to the multiple road surface types obtained in advance through sample training; the road surface types corresponding to the multiple linear points are weighted averaged to obtain the road surface type of the second linear highway, and assigned to the first linear highway; finally, based on the road surface type assigned on the first linear highway in each grid map in the rural highway electronic map, the road surface type of the designated highway is determined. In this application, low-precision remote sensing image data and Spark distributed computing process can be used to accurately assign the road surface type determined in the remote sensing image data to the corresponding highway in the electronic map, thereby reducing costs while improving the road surface type recognition accuracy and matching accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the specific implementation methods of the present application or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0016] Figure 1 A flowchart of a Spark distributed identification method for rural road pavement types provided in an embodiment of the present application;
[0017] Figure 2 A flowchart of a grid set determination process in a Spark distributed identification method for rural road pavement types provided in an embodiment of the present application;
[0018] Figure 3 A flowchart of a road surface type determination process in a Spark distributed identification method for rural road surface types provided in an embodiment of the present application;
[0019] Figure 4A schematic diagram of a highway pavement type identification process provided in an embodiment of the present application;
[0020] Figure 5 A structural block diagram of a Spark distributed identification device for rural road pavement types provided in an embodiment of the present application;
[0021] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0022] The technical solution of the present application will be described clearly and completely below in conjunction with the embodiments. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0023] In view of the problems of high cost caused by the use of high-precision remote sensing impact data for calculation in the prior art for the identification of rural road pavement types, as well as the problem of poor identification accuracy caused by the rural roads being blocked by surrounding vegetation, buildings, etc., and the problem of poor matching accuracy caused by the large deviation between the rural road line shape and the remote sensing image due to the weak satellite signal in the mountainous area where the rural roads are located. The embodiment of the present application provides a Spark distributed identification method, device electronic equipment and storage medium for rural road pavement types, which improves the identification accuracy and matching accuracy of rural road pavement types while reducing costs. To facilitate understanding of the present embodiment, a Spark distributed identification method for rural road pavement types disclosed in the embodiment of the present application is first introduced in detail.
[0024] Figure 1 A flowchart of a Spark distributed method for identifying rural road pavement types provided in an embodiment of the present application, the method is applied to a Spark distributed computing system, and the method specifically includes the following steps:
[0025] Step S102, obtaining a rural road electronic map and corresponding remote sensing image data;
[0026] The remote sensing image data here are low-precision remote sensing image data that can be generally obtained on the Internet, such as: Tiandi Map Images, Baidu Images, Amap Images, Google Images, etc.; the rural road electronic map and remote sensing image data are similar to the data in two layers and can be aligned based on the coordinate position of the image.
[0027] Step S104, determining a grid map set containing rural roads in the rural road electronic map, and a grid image set containing rural roads in the remote sensing image data;
[0028] In this step, it is actually necessary to divide the rural road electronic map into grid maps of a specified size, divide the remote sensing image data into grid images of a specified size, and then filter out the grid set containing rural roads. For example, the rural road electronic map and remote sensing image data can be divided into 5 km × 5 km (divided at longitude 0.04° and latitude 0.043°) grids to be calculated according to longitude and latitude coordinates. Further apply geospatial buffer analysis to identify the grid map set and initial grid image set with rural roads. The initial grid image set can be a grid set obtained by expanding the image grids corresponding to the grid map set on the remote sensing image data. Then, according to the second preset grid size (for example, 320 pixels × 320 pixels), grid division is performed to obtain the grid image set in the remote sensing image data.
[0029] Step S106, applying a spatial buffer analysis algorithm, analyzing and calculating each grid map in the grid map set, and determining at least one first linear highway; for each first linear highway, performing the following steps: searching a target grid image set corresponding to the first linear highway from the grid image set; calculating the second linear highway in the target grid image set; determining the RGB color feature value corresponding to each linear point on the second linear highway; determining the road surface type corresponding to each linear point according to the RGB color feature value corresponding to each linear point and the color feature value threshold range corresponding to a plurality of road surface types obtained in advance through sample training; performing weighted averaging on the road surface types corresponding to the plurality of linear points to obtain the road surface type of the second linear highway, and assigning it to the first linear highway.
[0030] The chain code algorithm can be applied to first determine at least one road surface area, and then use the center line as the linear road.
[0031] The basic principle of chain code is to convert a two-dimensional shape boundary into a series of coordinate points, each of which corresponds to a point on the original shape. These coordinate points are connected in a certain order to form a chain, so it is called "chain code". Each coordinate point has its corresponding direction code, which is used to indicate the position and direction of the point on the shape boundary.
[0032] The extraction of chain codes requires the help of boundary tracking algorithms. The boundary tracking algorithm is a method for extracting the boundary of an object in an image. The algorithm traverses the pixels in the image, finds the pixels connected to the boundary of the object, and connects these pixels according to certain rules to form a boundary. In the process of connecting pixels, it is necessary to consider the color, brightness and other information of the pixels to determine whether the pixel belongs to the boundary of the object.
[0033] The extraction of chain codes is a step in the boundary tracking algorithm. In the process of extracting the boundary, the position and direction information of each boundary pixel point needs to be recorded so as to generate the chain code later. There are many ways to represent the chain code, among which the most commonly used is the Freeman chain code. The Freeman chain code starts from the starting point, records the coordinates and direction code of the starting point, and then traverses the pixels on the boundary in a certain order and records the direction code of each pixel point. The final chain code is a sequence of coordinate points and direction codes representing the boundary of the shape.
[0034] In this step, it is necessary to identify and match the road surface type in the remote sensing data for each first linear highway in the electronic map. The specific process will be described in detail later.
[0035] Step S108, determining the road surface type of the designated road based on the road surface type assigned to the first linear road in each grid map in the rural road electronic map.
[0036] Specifically, all target linear highways corresponding to the designated highway may be searched; and the road surface types corresponding to all target linear highways are weighted averaged to obtain the road surface type of the designated highway.
[0037] For example, in a Spark distributed environment, each computing node calculates the road surface type of each grid according to the above step S106 process, and then groups and takes values for the calculation results of each computing node according to the "route code" attribute index of the highway. If the "route code" has multiple road surface types, the value is taken after weighted average based on the linear length and the road surface type.
[0038] The method for identifying the pavement type of rural roads provided in the embodiment of the present application can use low-precision remote sensing image data, chain code algorithm, and Spark distributed computing process to accurately assign the pavement type determined in the remote sensing image data to the corresponding road in the electronic map, thereby improving the pavement type identification accuracy and matching accuracy while reducing costs.
[0039] The embodiment of the present application also provides another Spark distributed identification method for rural road pavement types, which is implemented on the basis of the above embodiment; this embodiment focuses on describing the grid division, route identification, pavement type identification and matching process.
[0040] See also Figure 2 As shown, the above step of determining the grid map set containing rural roads in the rural road electronic map and the grid image set containing rural roads in the remote sensing image data includes:
[0041] Step S202, according to the first preset grid size, the rural road electronic map and the remote sensing image data are respectively divided into the same grids; for example, the rural road electronic map and the remote sensing image data are respectively divided into 5 km × 5 km (divided at longitude 0.04° and latitude 0.043°) grids to be calculated according to the longitude and latitude coordinates.
[0042] Step S204, applying the geospatial buffer analysis method to analyze the rural road electronic map, and identifying a grid map set containing rural roads; for example, identifying a grid map set P containing rural road vector lines. 农村公路 .
[0043] Step S206, in the remote sensing image data, a plurality of grid images corresponding to the grid map set are determined, and for each grid image, adjacent grid images corresponding to the grid image are retrieved; a set consisting of the plurality of grid images and the corresponding adjacent grid images is determined as an initial grid image set in the remote sensing image data;
[0044] Since rural road data may have local deviations from remote sensing images, it is necessary to retrieve P in remote sensing image data. 农村公路 The corresponding image grids and the grids of each image grid in eight directions (taking the i-th grid as the starting point, due north, northeast, due east, southeast, due south, southwest, due west, and northwest) are included in the new set to form the initial grid image set P of the remote sensing image. 遥感影像 .
[0045] Step S208, gridding each initial grid image in the initial grid image set according to a second preset grid size to obtain a grid image set in the remote sensing image data; the second preset grid size is smaller than the first preset grid size.
[0046] Apply the image processing algorithm to each initial grid image (image with coordinate position) in the initial grid image set, and segment it into a small grid set of 320 pixels × 320 pixels with coordinate position, namely M 遥感集合 .
[0047] The specific implementation process of the above step S106 is described in detail below. Figure 3 As shown:
[0048] In step S106, for each first linear highway, the following steps are performed:
[0049] Step S302, searching for a target grid image set corresponding to the first linear highway from the grid image set;
[0050] Specifically, determine the road surface area L corresponding to the first linear road; find the minimum circumscribed rectangle Q corresponding to the road surface area L; and 遥感影像 In , find the grid image corresponding to the minimum bounding rectangle Q and obtain the target grid image set I.
[0051] Get the minimum enclosing rectangle Q corresponding to M in the previous step 遥感影像 The remote sensing images of the image set retain the images within the rectangular area. If the area is not within a remote sensing image grid image, all the remote sensing images involved need to be found to form a set I.
[0052] Step S304, calculating the second linear highway in the target grid image set;
[0053] (1) Apply the chain code algorithm to calculate the grid images in the target grid image set to determine the road surface vector data;
[0054] In the specific implementation, the grid images in the target grid image set are converted into grayscale images; according to the parameter set of the highway on the remote sensing image obtained by preset training, the grayscale image is binarized to obtain a binary image; wherein the white pixels in the binary image represent the highway; the binary image is rasterized and vectorized to obtain highway surface vector data.
[0055] (2) The highway surface vector data is processed into lines to obtain the second linear highway.
[0056] Step S306, determining the RGB color feature value corresponding to each linear point on the second linear highway;
[0057] For each linear point on the second linear highway, determine the connecting line between the points where the line passing through the linear point and perpendicular to the second linear highway intersects with the edge of the highway surface vector data; determine the RGB color value corresponding to each pixel point on the connecting line; and perform weighted averaging on the RGB color values corresponding to all the pixel points on the connecting line to obtain the RGB color feature value corresponding to the linear point.
[0058] Step S308, determining the road surface type corresponding to each linear point according to the RGB color feature value corresponding to each linear point and the color feature value threshold ranges corresponding to the various road surface types obtained in advance through sample training;
[0059] In specific implementation, for the RGB color feature value corresponding to each linear point, the target color feature value threshold interval to which the RGB color feature value belongs is determined; and the road surface type corresponding to the target color feature value threshold interval is determined as the road surface type corresponding to the linear point.
[0060] Step S310: Perform weighted averaging on the road surface types corresponding to the plurality of linear points to obtain the road surface type of the second linear highway, and assign the road surface type to the first linear highway.
[0061] like Figure 4 As shown in the figure, the left side is the first linear highway in the rural highway electronic map, and the right side is the M in the remote sensing image data. 遥感影像 Two identified surface road sections: The area corresponding to the black line in the right figure is a rural road. The road surface vector data identified on the remote sensing image through the above steps is matched, that is, the road surface area. The gray line is the center line of this road surface area. The RGB color feature values corresponding to each linear point in the center line are calculated one by one with a step length of L. Specifically, for each linear point, a vertical line is drawn to intersect the edge of the road surface area, such as the dark gray short line in the right figure, and the RGB color value of each pixel point on the short line is determined. The part that may fall outside the road surface area needs to be eliminated, and the RGB color values of multiple pixels are weighted averaged to obtain the RGB color feature value corresponding to this point, and then the RGB color feature value corresponding to which road surface type this value falls into is calculated. The road surface type of this point on the remote sensing image is determined within the threshold range. Thus, a set of road surface types is obtained, and then the weighted average of the set of road surface types is performed to form a road surface type assigned to the first linear highway in the left figure.
[0062] The Spark distributed identification method for rural road pavement types provided in the embodiment of the present application mainly solves the following deficiencies in the current prior art:
[0063] (1) To solve the problem of high cost of obtaining high-precision remote sensing image data, this embodiment uses low-precision Internet remote sensing image data.
[0064] (2) To solve the problem that most rural roads are located in mountainous areas with weak satellite signals, resulting in large deviations between the alignment of rural roads and remote sensing images, making it difficult to accurately match the corresponding remote sensing image data. In this embodiment, the chain code technology can solve the problem that the alignment of rural road vector data and remote sensing image roads is similar, but the deviation is within 5 kilometers.
[0065] (3) The problem of being unable to accurately calculate the width of a rural road surface when it is blocked by surrounding vegetation, buildings, etc. is solved. This embodiment solves the problem of being unable to identify rural roads and the difficulty in identifying the road surface type of rural roads when less than 95% of the linear shape of the road section in the remote sensing image is blocked by vegetation, buildings, etc. through the road feature matching process.
[0066] Based on the above method embodiment, the present application embodiment also provides a Spark distributed identification device for rural road pavement type, which is applied to the Spark distributed computing system, see Figure 5As shown, the device includes: a data acquisition module 502, which is used to acquire a rural road electronic map and corresponding remote sensing image data; a set determination module 504, which is used to determine a grid map set containing rural roads in the rural road electronic map, and a grid image set containing rural roads in the remote sensing image data; a linear road pavement type determination module 506, which is used to apply a spatial buffer analysis algorithm to analyze and calculate each grid map in the grid map set to determine at least one first linear road; for each first linear road, the following steps are performed: from the grid image set, searching for a target grid image set corresponding to the first linear road; calculating the target Marking a second linear highway in the grid image set; determining the RGB color feature value corresponding to each linear point on the second linear highway; determining the road surface type corresponding to each linear point according to the RGB color feature value corresponding to each linear point and the color feature value threshold range corresponding to a plurality of road surface types obtained in advance through sample training; weighted averaging the road surface types corresponding to the plurality of linear points to obtain the road surface type of the second linear highway, and assigning it to the first linear highway; a road surface type determination module 508, for determining the road surface type of the designated highway based on the road surface type assigned on the first linear highway in each grid map in the rural highway electronic map.
[0067] Furthermore, the above-mentioned set determination module 504 is used to perform the same grid division on the rural road electronic map and the remote sensing image data respectively according to the first preset grid size; apply the geospatial buffer analysis method to analyze the rural road electronic map and identify the grid map set containing rural roads; in the remote sensing image data, determine multiple grid images corresponding to the grid map set, and for each grid image, retrieve the adjacent grid images corresponding to the grid image; determine the set consisting of the multiple grid images and the corresponding adjacent grid images as the initial grid image set in the remote sensing image data; grid divide each initial grid image in the initial grid image set according to the second preset grid size to obtain the grid image set in the remote sensing image data; the second preset grid size is smaller than the first preset grid size.
[0068] Furthermore, the road type determination module 508 is used to determine the road surface area corresponding to the first linear road; obtain the minimum circumscribed rectangle corresponding to the road surface area; and search for the grid image corresponding to the minimum circumscribed rectangle from the grid image set to obtain the target grid image set.
[0069] Furthermore, the road type determination module 508 is used to apply the chain code algorithm to calculate the grid images in the target grid image set to determine the highway surface vector data; and perform surface-to-line processing on the highway surface vector data to obtain a second linear highway.
[0070] Furthermore, the above-mentioned road type determination module 508 is used to convert the grid images in the target grid image set into grayscale images; according to the parameter set of the highway on the remote sensing image obtained by preset training, the grayscale image is binarized to obtain a binary image; wherein the white pixels in the binary image represent the highway; the binary image is rasterized and vectorized to obtain highway surface vector data.
[0071] Furthermore, the above-mentioned road surface type determination module 508 is used to determine, for each linear point on the second linear highway, a line between the points where a line passing through the linear point and perpendicular to the second linear highway intersects with the edge of the highway surface vector data; determine the RGB color value corresponding to each pixel point on the line; and perform weighted averaging on the RGB color values corresponding to all pixel points on the line to obtain the RGB color feature value corresponding to the linear point.
[0072] Furthermore, the above-mentioned road surface type determination module 508 is used to determine the target color feature value threshold interval to which the RGB color feature value belongs for each linear point; and determine the road surface type corresponding to the target color feature value threshold interval as the road surface type corresponding to the linear point.
[0073] The device provided in the embodiment of the present application has the same implementation principle and technical effects as those of the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the embodiment of the device, reference may be made to the corresponding contents in the aforementioned method embodiment.
[0074] The present application also provides an electronic device, such as Figure 6 As shown, it is a schematic diagram of the structure of the electronic device, wherein the electronic device includes a processor 61 and a memory 60, the memory 60 stores computer executable instructions that can be executed by the processor 61, and the processor 61 executes the computer executable instructions to implement the above method.
[0075] exist Figure 6 In the illustrated embodiment, the electronic device further includes a bus 62 and a communication interface 63 , wherein the processor 61 , the communication interface 63 and the memory 60 are connected via the bus 62 .
[0076] Among them, the memory 60 may include a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 63 (which can be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. can be used. The bus 62 can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The bus 62 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0077] The processor 61 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 61. The above processor 61 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor to execute, or the hardware and software modules in the decoding processor can be executed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor 61 reads the information in the memory and completes the steps of the method of the above embodiment in combination with its hardware.
[0078] An embodiment of the present application also provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the above method. The specific implementation can be found in the aforementioned method embodiment, which will not be repeated here.
[0079] The computer program products of the methods, devices, and electronic devices provided in the embodiments of the present application include a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the previous method embodiments. The specific implementation can be found in the method embodiments, which will not be repeated here.
[0080] Unless otherwise specifically stated, the relative steps, numerical expressions and values of the components and steps set forth in these embodiments do not limit the scope of the present application.
[0081] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0082] In the description of the present application, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present application. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.
[0083] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims
1. A Spark distributed identification method for rural road pavement types, characterized in that: The method is applied to a Spark distributed computing system, and the method includes: Obtain electronic maps of rural roads and corresponding remote sensing image data; Determining a grid map set containing rural roads in the rural road electronic map, and a grid image set containing rural roads in the remote sensing image data; Applying a spatial buffer analysis algorithm, analyzing and calculating each grid map in the grid map set, and determining at least one first linear highway; for each first linear highway, performing the following steps: searching for a target grid image set corresponding to the first linear highway from the grid image set; calculating a second linear highway in the target grid image set; determining an RGB color feature value corresponding to each linear point on the second linear highway; determining a road surface type corresponding to each linear point according to the RGB color feature value corresponding to each linear point and a color feature value threshold range corresponding to a plurality of road surface types obtained in advance through sample training; performing a weighted average of the road surface types corresponding to the plurality of linear points to obtain a road surface type of the second linear highway, and assigning the road surface type to the first linear highway; Determine the road surface type of the designated road based on the road surface type assigned to the first linear road in each grid map in the rural road electronic map; The step of calculating the second linear highway in the target grid image set includes: converting the grid images in the target grid image set into grayscale images; binarizing the grayscale images according to the parameter set of the highway on the remote sensing image obtained by preset training to obtain a binary image; wherein white pixels in the binary image represent the highway; rasterizing and vectorizing the binary image to obtain highway surface vector data; and converting the highway surface vector data into a line to obtain the second linear highway.
2. The method according to claim 1, characterized in that The step of determining a grid map set containing rural roads in the rural road electronic map and a grid image set containing rural roads in the remote sensing image data comprises: According to a first preset grid size, the rural road electronic map and the remote sensing image data are respectively divided into the same grids; Applying a geospatial buffer analysis method to analyze the rural road electronic map, and identifying a grid map set containing rural roads; In the remote sensing image data, a plurality of grid images corresponding to the grid map set are determined, and for each of the grid images, an adjacent grid image corresponding to the grid image is retrieved; a set consisting of the plurality of grid images and the corresponding adjacent grid images is determined as an initial grid image set in the remote sensing image data; Each initial grid image in the initial grid image set is grid-divided according to a second preset grid size to obtain a grid image set in the remote sensing image data; the second preset grid size is smaller than the first preset grid size.
3. The method according to claim 1, characterized in that The step of searching, from the grid image set, a target grid image set corresponding to the first linear highway comprises: Determining a highway surface area corresponding to the first linear highway; Obtaining the minimum circumscribed rectangle corresponding to the road surface area; From the grid image set, the grid image corresponding to the minimum circumscribed rectangle is searched to obtain a target grid image set.
4. The method according to claim 1, characterized in that: The step of determining the RGB color feature value corresponding to each linear point on the second linear highway comprises: For each linear point on the second linear highway, determine a line connecting points where a line passing through the linear point and perpendicular to the second linear highway intersects an edge of the highway surface vector data; Determine the RGB color value corresponding to each pixel on the line; The RGB color values corresponding to all the pixel points on the line are weighted averaged to obtain the RGB color feature values corresponding to the line points.
5. The method according to claim 1, characterized in that The step of determining the road surface type corresponding to each linear point according to the RGB color feature value corresponding to each linear point and the color feature value threshold ranges corresponding to the multiple road surface types obtained in advance through sample training comprises: For each linear point, the RGB color feature value corresponding to the linear point is used to determine the target color feature value threshold interval to which the RGB color feature value belongs; The road surface type corresponding to the target color feature value threshold interval is determined as the road surface type corresponding to the linear point.
6. A Spark distributed recognition device for rural road pavement types, characterized in that: The device is applied to a Spark distributed computing system, and the device includes: A data acquisition module is used to obtain electronic maps of rural roads and corresponding remote sensing image data; A set determination module, used to determine a grid map set containing rural roads in the rural road electronic map, and a grid image set containing rural roads in the remote sensing image data; A linear highway pavement type determination module is used to apply a spatial buffer analysis algorithm to analyze and calculate each grid map in the grid map set to determine at least one first linear highway; for each first linear highway, the following steps are performed: from the grid image set, a target grid image set corresponding to the first linear highway is searched; a second linear highway in the target grid image set is calculated; an RGB color feature value corresponding to each linear point on the second linear highway is determined; according to the RGB color feature value corresponding to each linear point and the color feature value threshold range corresponding to multiple pavement types obtained in advance through sample training, the pavement type corresponding to each linear point is determined; and the pavement types corresponding to multiple linear points are weighted averaged to obtain the pavement type of the second linear highway, and the pavement type is assigned to the first linear highway; A road surface type determination module, used to determine the road surface type of a designated road based on the road surface type assigned on the first linear road in each grid map in the rural road electronic map; The linear highway pavement type determination module is also used to convert the grid images in the target grid image set into grayscale images; according to the parameter set of the highway on the remote sensing image obtained by preset training, the grayscale image is subjected to image binarization processing to obtain a binary image; wherein the white pixels in the binary image represent the highway; the binary image is subjected to rasterization processing and vectorization processing to obtain highway surface vector data; the highway surface vector data is subjected to surface-to-line processing to obtain a second linear highway.
7. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement the method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Rural road type identification method and system, terminal equipment and readable storage medium
CN112949617A
Road identification method and related device
CN117011692A