Method and device for processing road data of CAD drawing, and non-volatile storage medium
By converting CAD road data into image format and performing blurring and neural network feature extraction, the problem of misprocessing of interference data in CAD road maps in existing technologies is solved, achieving efficient and accurate removal of interference data and clarification of road data.
Patent Information
- Application Number
- CN202210159194.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-21
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2042-02-21
AI Technical Summary
Existing geometric processing methods suffer from misprocessing and incomplete removal of interference data in CAD road maps, especially in the inaccurate handling of connections between similar breakpoints and duplicate data.
The road data from the CAD drawing is converted from layer format to image format, blurred, and then converted back to layer format. A neural network model is used for feature extraction and edge detection to establish a mapping relationship between road data and image, and to remove interfering data.
It achieves efficient and accurate removal of interfering data from CAD road maps, improves the efficiency of connecting redundant paths and breakpoints, and ensures the clarity and accuracy of road data.
Smart Images

Figure CN114547743B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of CAD applications, and in particular, to a method and device for processing road data of a CAD drawing, and a non-volatile storage medium. Background Art
[0002] Management Software Computer Aided Design (MS-CAD) refers to the process of using computer software to design management software on a graphical development interface, designing the flow structure and data structure of the management software, and ultimately generating management software that can be used independently through data loading and parsing of the computer software system.
[0003] DWG is a proprietary file format used by computer-aided design software AutoCAD and AutoCAD's software to save design data.
[0004] The manual drawing of CAD roads is messy and has many interferences. There are redundant or repeated polylines, including subtle breakpoint connections, manually drawn repeated road polylines, etc. Therefore, it is necessary to clear the interference data to obtain the CAD main road map.
[0005] The existing CAD road data processing method is to extract and process the road discrete data in DWG file format, and perform logical processing of points, lines and surfaces on the road data through geometric processing ideas, mainly calling the line segment attributes of CAD, and extracting the starting and turning point coordinates of multiple line segments, clearing redundant data and connecting breakpoints. However, the geometric processing logic cannot be well adapted to eliminate road noise data and extract road paths, and there are mainly the following disadvantages.
[0006] (1) The connection of close breakpoints requires a threshold to be determined. It is necessary to determine how far the line segments can be processed and connected, and there is a possibility of misprocessing;
[0007] (2) When clearing duplicate data or part of duplicate road data, there is a possibility that the data may not be cleared completely or incorrectly.
[0008] With respect to the problem of misprocessing of the interference data of the CAD road map using the existing geometric processing method, no effective solution has been proposed so far. Summary of the invention
[0009] The embodiments of the present application provide a method and device for processing road data of a CAD drawing, and a non-volatile storage medium, so as to at least solve the technical problem of the existing use of geometric processing methods to eliminate the misprocessing of interference data of CAD road drawings.
[0010] According to one aspect of an embodiment of the present application, a method for processing road data of a CAD drawing is provided, comprising: converting the format of the road data of the CAD drawing from a layer format to an image format to obtain a road image; blurring the road image to obtain a processed road image; converting the format of the processed road image from an image format to a layer format to obtain main road data, wherein the main road data is the road data after eliminating interference data.
[0011] Optionally, before blurring the road image to obtain the processed road image, the method further includes: establishing a mapping relationship between the road data and the road image.
[0012] Optionally, establishing a mapping relationship between road data and road images includes: establishing a coordinate system for the road data to obtain multiple coordinate points corresponding to the road data; performing pixel cutting on the road image to obtain multiple pixel points of the road image; and establishing the mapping relationship between multiple pixel points and multiple coordinate points.
[0013] Optionally, blurring the road image to obtain a processed road image includes: inputting the road image into a neural network model to extract features to obtain the processed road image.
[0014] Optionally, the road image is input into a neural network model for feature extraction to obtain a processed road image, including: performing edge detection on the road image to obtain edge features of the road image; and constructing the processed road image based on the edge features.
[0015] Optionally, edge detection is performed on the road image to obtain edge features of the road image, including: removing noise from the road image to obtain a denoised road image; calculating the gradient of the denoised road image to obtain multiple possible edge features; performing non-maximum suppression on the multiple possible edge features to obtain multiple suppressed edge features; and screening the multiple suppressed edge features by setting an upper threshold and a lower threshold to obtain the edge features of the road image.
[0016] Optionally, converting the format of the processed road image from an image format to a layer format to obtain the main road data includes: converting the format of the processed road image from an image format to a layer format according to a mapping relationship to obtain the main road data.
[0017] According to another aspect of an embodiment of the present application, a device for processing road data of a CAD drawing is also provided, including: a first conversion module, used to convert the format of the road data of the CAD drawing from a layer format to an image format to obtain a road image; a processing module, used to blur the road image to obtain a processed road image; a second conversion module, used to convert the format of the processed road image from an image format to a layer format to obtain main road data, which is the road data after interference data is eliminated.
[0018] According to another aspect of the embodiment of the present application, a non-volatile storage medium is also provided, the non-volatile storage medium includes a stored program, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to execute the above-mentioned method for processing road data of the CAD drawing.
[0019] According to another aspect of the embodiment of the present application, a processor is further provided, and the processor is used to run a program stored in a memory, wherein the above method for processing road data of a CAD drawing is executed when the program is run.
[0020] In an embodiment of the present application, the format of the road data of the CAD drawing is converted from a layer format to an image format to obtain a road image; the road image is blurred to obtain a processed road image; the format of the processed road image is converted from an image format to a layer format to obtain main road data, and the main road data is the road data after the interference data is eliminated. The CAD road drawing after the format conversion is cleaned up by image processing technology, thereby achieving the purpose of clearing the interference data of the CAD road drawing, thereby achieving the technical effect of efficiently and accurately clearing the interference data of the CAD road drawing, and further solving the technical problem of incorrect processing of the existing geometric processing method for eliminating the interference data of the CAD road drawing. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0022] Figure 1 It is a hardware structure block diagram of a computer terminal (or mobile device) for implementing a method for processing road data of a CAD drawing according to an embodiment of the present application;
[0023] Figure 2 is a flowchart of an optional method for processing road data of a CAD drawing according to an embodiment of the present application;
[0024] Figure 3is a flowchart of another optional method for processing road data of a CAD drawing according to an embodiment of the present application;
[0025] Figure 4 It is a structural block diagram of an optional device for processing road data of a CAD drawing according to an embodiment of the present application. DETAILED DESCRIPTION
[0026] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only 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 this field without creative work should fall within the scope of protection of the present application.
[0027] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0028] The method embodiment provided in the first embodiment of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 The hardware structure block diagram of a computer terminal (or mobile device) for implementing a method for processing road data of a CAD drawing is shown. Figure 1 As shown, the computer terminal 10 (or mobile device 10) may include one or more (102a, 102b, ..., 102n are used to illustrate) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 1The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0029] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10 (or mobile device). As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0030] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the method for processing road data of the CAD drawing in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, the method for processing road data of the CAD drawing mentioned above is realized. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.
[0031] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0032] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 (or mobile device).
[0033] According to an embodiment of the present application, an embodiment of a method for processing road data of a CAD drawing is provided. It should be noted that the steps shown in the flowchart of the accompanying drawing can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0034] Figure 2 is a flow chart of a method for processing road data of a CAD drawing according to an embodiment of the present application, such as Figure 2 As shown, the method comprises the following steps:
[0035] Step S202, converting the format of the road data of the CAD drawing from a layer format to an image format to obtain a road image;
[0036] Optionally, the layer format is a DWG format. In this step, the road problem is processed by obtaining the road data in the DWG file format to be processed and saving the road data in an image format.
[0037] Step S204, performing fuzzy processing on the road image to obtain a processed road image;
[0038] This step processes the road image to obtain a new road image, mainly by performing blur processing and contour extraction.
[0039] Step S206, converting the format of the processed road image from an image format to a layer format to obtain main road data, where the main road data is the road data after eliminating interference data;
[0040] Optionally, the main road data is road data after the road data is processed for road redundancy and breakpoint connection, etc. The processed road image is converted back to DWG format to obtain a new CAD drawing, thus completing the road extraction and processing process.
[0041] Through the above steps, the CAD road map after format conversion is cleaned up by image processing technology, thereby achieving the purpose of clearing the interference data of the CAD road map, thereby achieving the technical effect of efficiently and accurately clearing the interference data of the CAD road map.
[0042] According to an optional embodiment of the present application, before executing step S204 to perform blur processing on the road image to obtain the processed road image, the method further includes: establishing a mapping relationship between the road data and the road image.
[0043] According to another optional embodiment of the present application, a mapping relationship between road data and a road image is established, including: establishing a coordinate system for the road data to obtain multiple coordinate points corresponding to the road data; performing pixel point cutting on the road image to obtain multiple pixel points of the road image; and establishing the mapping relationship between the multiple pixel points and the multiple coordinate points.
[0044] Figure 3 is a flowchart of another optional method for processing road data of a CAD image according to an embodiment of the present application, such as Figure 3 As shown in the figure, before processing the image, it is necessary to establish the correspondence between pixel points and CAD coordinate points. First, it is necessary to establish a coordinate system for the road data, and at the same time, perform pixel cutting on the image, and map each pixel point to the coordinate point of the road data one by one, so as to establish the correspondence between the road data and the road image.
[0045] By constructing a mapping relationship, rapid conversion between images and CAD drawings can be achieved, improving the efficiency of clearing redundant paths and connecting breakpoints.
[0046] According to another optional embodiment of the present application, step S204 is executed to perform blur processing on the road image to obtain a processed road image, including: inputting the road image into a neural network model for feature extraction to obtain a processed road image.
[0047] Alternatively, if Figure 3 As shown, the convolutional neural network is used to extract features from road images to achieve blur processing of road images. In this step, the road data converted into images is processed using an image processing method, mainly by blurring and extracting contours of road images using a well-constructed convolutional neural network model to obtain the required road features.
[0048] In some optional embodiments of the present application, a road image is input into a neural network model for feature extraction to obtain a processed road image, including: performing edge detection on the road image to obtain edge features of the road image; and constructing a processed road image based on the edge features.
[0049] Image edge is an important feature of an image. It is the discontinuity of the distribution of characteristics (such as pixels, grayscale, texture, etc.) in the image, and the set of pixels with step changes or ridge-like changes around the image. The edge of an image concentrates most of the information of the image. The edge structure and characteristics of an image are often an important part of determining the characteristics of the image. Image edge detection is a technology for extracting useful structural information from an image. It is mainly used to enhance the contour edges, details and grayscale jump parts in the image to form a complete object boundary, so as to separate the object from the image or detect the area representing the surface of the same object. Common edge detection algorithms include edge detection algorithms using Sobel operator, Isotropic Sobel operator, Roberts operator, Prewitt operator, Laplacian operator and Canny operator. Among them, the implementation process of Canny operator is more complicated, but its function is better than the other ones.
[0050] Optionally, edge detection is performed on the image road data to extract the edge features of the road, and Canny edge detection can be used. Canny edge detection is a very popular edge detection algorithm. It is a multi-stage algorithm consisting of multiple steps, and is mainly used to detect the edges of any input image. Canny's evaluation criteria for edge detection algorithms include: the edges must be complete, the positions must be accurate, and the ability to resist noise must be strong. There are mainly five steps, namely Gaussian filtering, pixel gradient calculation, non-maximum suppression, hysteresis threshold processing, and isolated weak edge suppression.
[0051] A new image, i.e., the processed road image, is reconstructed by using the obtained edge features. In this step, by performing edge detection and edge feature reconstruction on the constructed neural network model, accurate connection of breakpoints and accurate identification of repeated paths can be achieved, thereby achieving accurate processing of interference data.
[0052] In some other optional embodiments of the present application, edge detection is performed on a road image to obtain edge features of the road image, including: removing noise from the road image to obtain a denoised road image; calculating the gradient of the denoised road image to obtain multiple possible edge features; performing non-maximum suppression on the multiple possible edge features to obtain multiple suppressed edge features; and screening the multiple suppressed edge features by setting an upper threshold and a lower threshold to obtain the edge features of the road image.
[0053] Edge detection mainly includes the following steps:
[0054] (1) Image denoising: First, remove the noise from the image road data, because noise is where the pixel values vary greatly, so it is easy to be identified as a false edge. Usually, Gaussian blur is used to slightly blur the image to achieve denoising of the image road data. Using a Gaussian filter can smooth the image, eliminate noise, and minimize the impact of noise on edge detection results.
[0055] (2) Calculate the image gradient and obtain possible edges: To calculate the image gradient, you can use the Sobel operator to calculate the first-order gradient, or you can use the Laplance operator to calculate the second-order gradient.
[0056] (3) Non-maximum suppression: Non-maximum suppression is an edge sparse technology that can help suppress all gradient values outside the local maximum to 0, and can eliminate the stray effects caused by edge detection. In the process of image denoising (Gaussian filtering), the edges may be magnified. Therefore, a rule is needed to filter points that are not edges. If a pixel belongs to an edge, then the gradient value of this pixel in the gradient direction is the largest, making the width of the edge 1 pixel. Otherwise, it is not an edge, and the grayscale value is set to 0. The algorithm for non-maximum suppression is to compare the gradient strength of the current pixel with the two pixels along the positive and negative gradient directions. If the gradient strength of the current pixel is the largest compared to the other two pixels, the pixel is retained as an edge point, otherwise the pixel is suppressed.
[0057] (4) Double threshold screening: Since there are still some edge pixels caused by noise and color changes, edge pixels must be filtered with weak gradient values, and edge pixels with high gradient values must be retained. This can be achieved by selecting high and low thresholds. In general, a threshold is used to detect edges. If an upper threshold and a lower threshold can be determined using a heuristic method, all pixels above the lower threshold can be used as edges, which may improve accuracy. Therefore, two thresholds are set to detect edges, optionally, maxVal and minVal. Among them, those greater than maxVal are detected as edges, and those lower than minVal are detected as non-edges. The choice of threshold depends on the content of the given input image. Applying double threshold detection can determine real and potential edges. It should be noted that for the middle pixel, if it is adjacent to the pixel determined to be an edge, it is determined to be an edge; otherwise, it is a non-edge.
[0058] According to an optional embodiment of the present application, executing step S206 to convert the format of the processed road image from an image format to a layer format to obtain main road data, including: converting the format of the processed road image from an image format to a layer format according to a mapping relationship to obtain main road data.
[0059] The coordinate information corresponding to the image pixel points and the road data in DWG format is obtained, and the processed road image is mapped back to the road data in DWG format, thereby completing the processing of the original road data in DWG format.
[0060] The present application provides a method for processing the main road of a CAD drawing. First, the CAD road layer is converted into an image, and the image fuzzy processing method is used to blur the enlarged details of the road and extract the outline, and then the processed road image is mapped back to the DWG format to complete the main road processing of the CAD drawing. The method provided by the present application no longer focuses on the details of the multi-line segments of the road. It mainly converts the road data in DWG format with the image, and at the same time establishes a mapping relationship between the image and the road data in DWG format. Then, the image processing method is used to process the road data, and the road interference data is minimized to the maximum extent. The efficiency of clearing redundant paths and connecting breakpoints can be improved, and the accurate connection of breakpoints and accurate identification of repeated paths can be achieved, thereby achieving the technical effect of efficiently and accurately clearing the interference data of the CAD road map.
[0061] Figure 4 is a structural block diagram of a device for processing road data of a CAD drawing according to an embodiment of the present application, such as Figure 4 As shown, the device comprises:
[0062] A first conversion module 40 is used to convert the format of the road data of the CAD image from a layer format to an image format to obtain a road image;
[0063] Optionally, the layer format is in DWG format. This module processes road problems by obtaining road data in DWG file format to be processed and saving the road data in image format.
[0064] A processing module 42, used for performing blur processing on the road image to obtain a processed road image;
[0065] This module processes the road image to obtain a new road image, mainly performing blur processing and contour extraction.
[0066] The second conversion module 44 is used to convert the format of the processed road image from the image format to the layer format to obtain the main road data, which is the road data after the interference data is removed.
[0067] Optionally, the main road data is road data after the road data is processed for road redundancy and breakpoint connection, etc. The processed road image is converted back to DWG format to obtain a new CAD drawing, thus completing the road extraction and processing process.
[0068] According to an optional embodiment of the present application, the above device further includes:
[0069] The mapping module is used to establish a mapping relationship between road data and road images.
[0070] According to another optional embodiment of the present application, the mapping module includes:
[0071] A first construction unit is used to establish a coordinate system for the road data to obtain a plurality of coordinate points corresponding to the road data;
[0072] A cutting unit, used for cutting the road image into pixels to obtain a plurality of pixel points of the road image;
[0073] A mapping unit is used to establish the mapping relationship between a plurality of pixel points and a plurality of coordinate points.
[0074] Before processing the image, the mapping module needs to establish the correspondence between pixel points and CAD coordinate points. First, a coordinate system needs to be established for the road data, and the image needs to be pixel-cut, and each pixel point needs to be mapped one-to-one with the coordinate point of the road data, so as to establish the correspondence between the road data and the road image.
[0075] By constructing a mapping relationship, rapid conversion between images and CAD drawings can be achieved, improving the efficiency of clearing redundant paths and connecting breakpoints.
[0076] According to another optional embodiment of the present application, the processing module 42 includes:
[0077] The processing unit is used to input the road image into the neural network model for feature extraction to obtain a processed road image.
[0078] This unit uses image processing methods to process road data converted into images. It mainly uses the constructed convolutional neural network model to perform blur processing and contour extraction on road images to obtain the required road features.
[0079] In some optional embodiments of the present application, the processing unit includes:
[0080] A detection unit, used to perform edge detection on the road image to obtain edge features of the road image;
[0081] The second construction unit is used to construct a processed road image according to the edge features.
[0082] Image edge is an important feature of an image. It is the discontinuity of the distribution of characteristics (such as pixels, grayscale, texture, etc.) in the image, and the set of pixels with step changes or ridge-like changes around the image. The edge of an image concentrates most of the information of the image. The edge structure and characteristics of an image are often an important part of determining the characteristics of the image. Image edge detection is a technology for extracting useful structural information from an image. It is mainly used to enhance the contour edges, details and grayscale jump parts in the image to form a complete object boundary, so as to separate the object from the image or detect the area representing the surface of the same object. Common edge detection algorithms include edge detection algorithms using Sobel operator, Isotropic Sobel operator, Roberts operator, Prewitt operator, Laplacian operator and Canny operator. Among them, the implementation process of Canny operator is more complicated, but its function is better than the other ones.
[0083] Optionally, the detection unit can use Canny edge detection. Canny edge detection is a very popular edge detection algorithm. It is a multi-stage algorithm consisting of multiple steps and is mainly used to detect the edge of any input image. Canny's evaluation criteria for edge detection algorithms include: the edge must be complete, the position must be accurate, and the ability to resist noise must be strong. There are mainly five steps, namely Gaussian filtering, pixel gradient calculation, non-maximum suppression, hysteresis threshold processing, and isolated weak edge suppression.
[0084] The second construction unit reconstructs a new image, ie, a processed road image, based on the obtained edge features.
[0085] The processing unit can accurately connect breakpoints and identify repeated paths by performing edge detection and edge feature reconstruction on the constructed neural network model, thereby achieving precise processing of interference data.
[0086] In some other optional embodiments of the present application, the detection unit includes:
[0087] A noise reduction unit, used to remove noise from the road image to obtain a road image after noise reduction;
[0088] A calculation unit, used for calculating the gradient of the road image after noise reduction to obtain multiple possible edge features;
[0089] A suppression unit, used for performing non-maximum suppression on multiple possible edge features to obtain multiple suppressed edge features;
[0090] The screening unit is used to screen the plurality of suppressed edge features by setting an upper threshold and a lower threshold to obtain the edge features of the road image.
[0091] The detection unit mainly uses the following units for edge detection:
[0092] (1) Noise reduction unit, used for image noise reduction: first remove the noise of the image road data, because noise is where the pixel values change greatly, so it is easy to be identified as a false edge. Usually, Gaussian blur is used to slightly blur the image to achieve noise reduction of the image road data. Using a Gaussian filter can smooth the image, eliminate noise, and minimize the impact of noise on edge detection results.
[0093] (2) A calculation unit is used to calculate the image gradient and obtain possible edges: The image gradient can be calculated by using the Sobel operator to obtain the first-order gradient, or by using the Laplance operator to obtain the second-order gradient.
[0094] (3) Suppression unit, used for non-maximum suppression: Non-maximum suppression is an edge sparse technology that can help suppress all gradient values outside the local maximum to 0, and can eliminate the stray effects caused by edge detection. In the process of image denoising (Gaussian filtering), the edges may be magnified. Therefore, a rule is needed to filter points that are not edges. If a pixel belongs to an edge, then the gradient value of this pixel in the gradient direction is the largest, making the width of the edge 1 pixel. Otherwise, it is not an edge, and the grayscale value is set to 0. The algorithm for non-maximum suppression is to compare the gradient strength of the current pixel with the two pixels along the positive and negative gradient directions. If the gradient strength of the current pixel is the largest compared to the other two pixels, the pixel is retained as an edge point, otherwise the pixel is suppressed.
[0095] (4) Screening unit, used for dual threshold screening: Since there are still some edge pixels caused by noise and color changes, it is necessary to filter edge pixels with weak gradient values and retain edge pixels with high gradient values, which can be achieved by selecting high and low thresholds. In general, a threshold is used to detect edges. If an upper threshold and a lower threshold can be determined using a heuristic method, all pixels above the lower threshold can be regarded as edges, which may improve accuracy. Therefore, two thresholds are set to detect edges, optionally, maxVal and minVal. Among them, all pixels greater than maxVal are detected as edges, while all pixels less than minVal are detected as non-edges. The choice of threshold depends on the content of the given input image. The application of dual threshold detection can determine real and potential edges. It should be noted that for the middle pixel, if it is adjacent to the pixel determined as an edge, it is determined to be an edge; otherwise, it is a non-edge.
[0096] According to an optional embodiment of the present application, the second conversion module 44 includes:
[0097] The conversion unit is used to convert the format of the processed road image from the image format to the layer format according to the mapping relationship to obtain the main road data.
[0098] The conversion unit is used to obtain the coordinate information corresponding to the image pixel points and the road data in DWG format, map the processed road image back to the road data in DWG format, and complete the processing of the original road data in DWG format.
[0099] The processing device for the road data of the CAD drawing provided by the present application mainly obtains the CAD road layer data, outputs the road data in a picture format, establishes the correspondence between the pixel points and the CAD coordinate points, applies the convolutional neural network to extract the features of the road picture, returns the processed road features to the CAD layer, and outputs the processed road data. Through this device, the efficiency of clearing redundant paths and connecting breakpoints can be improved, and the accurate connection of breakpoints and the accurate identification of repeated paths can be achieved, so as to achieve the technical effect of efficiently and accurately clearing the interference data of the CAD road map. The processing device for the road data of the CAD drawing provided by the present application has been applied in the road design industry to process road data. After practical verification, the device is safe, reliable, and has a relatively wide adaptability.
[0100] According to another aspect of the embodiment of the present application, a non-volatile storage medium is also provided, the non-volatile storage medium includes a stored program, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to execute the above-mentioned method for processing road data of the CAD drawing.
[0101] The above-mentioned non-volatile storage medium is used to store programs that perform the following functions: converting the format of the road data of the CAD drawing from a layer format to an image format to obtain a road image; blurring the road image to obtain a processed road image; converting the format of the processed road image from an image format to a layer format to obtain main road data, which is the road data after eliminating interference data.
[0102] An embodiment of the present application further provides a processor, which is used to run a program stored in a memory, wherein the above method for processing road data of a CAD drawing is executed when the program is run.
[0103] The above-mentioned processor is used to run a program that performs the following functions: converting the format of the road data of the CAD drawing from a layer format to an image format to obtain a road image; blurring the road image to obtain a processed road image; converting the format of the processed road image from an image format to a layer format to obtain main road data, which is the road data after eliminating interference data.
[0104] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0105] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0106] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0107] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0108] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0109] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the relevant technology or all or part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk, etc. Various media that can store program codes.
[0110] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for processing road data of a CAD drawing, characterized in that: include: Convert the format of the road data of the CAD drawing from a layer format to an image format to obtain a road image; Performing fuzzy processing on the road image to obtain a processed road image, including: inputting the road image into a neural network model to perform feature extraction to obtain the processed road image; Converting the format of the processed road image from the image format to the layer format to obtain main road data, wherein the main road data is road data after interference data is eliminated from the road data, wherein the main road data is road data after redundant path processing and breakpoint connection processing are performed on the road data; The road image is input into a neural network model for feature extraction to obtain the processed road image, including: performing edge detection on the road image to obtain edge features of the road image; and constructing the processed road image based on the edge features.
2. The method according to claim 1, characterized in that: Before blurring the road image to obtain the processed road image, the method further includes: A mapping relationship between the road data and the road image is established.
3. The method according to claim 2, characterized in that Establishing a mapping relationship between the road data and the road image includes: Establishing a coordinate system for the road data to obtain a plurality of coordinate points corresponding to the road data; Performing pixel cutting on the road image to obtain a plurality of pixel points of the road image; The mapping relationship between the plurality of pixel points and the plurality of coordinate points is established.
4. The method according to claim 1, characterized in that Performing edge detection on the road image to obtain edge features of the road image includes: removing noise from the road image to obtain a road image after noise reduction; Calculating the gradient of the denoised road image to obtain a plurality of possible edge features; Performing non-maximum suppression on the multiple possible edge features to obtain multiple suppressed edge features; The plurality of suppressed edge features are screened by setting an upper threshold and a lower threshold to obtain edge features of the road image.
5. The method according to claim 2, characterized in that: Converting the format of the processed road image from the image format to the layer format to obtain main road data includes: The format of the processed road image is converted from the image format to the layer format according to the mapping relationship to obtain the main road data.
6. A device for processing road data of a CAD drawing, characterized in that: include: A first conversion module is used to convert the format of the road data of the CAD image from a layer format to an image format to obtain a road image; A processing module, used for performing fuzzy processing on the road image to obtain a processed road image, comprising: inputting the road image into a neural network model to perform feature extraction to obtain the processed road image; A second conversion module is used to convert the format of the processed road image from the image format to the layer format to obtain main road data, wherein the main road data is the road data after interference data is eliminated from the road data, wherein the main road data is the road data after redundant path processing and breakpoint connection processing are performed on the road data; The processing module is further used to perform edge detection on the road image to obtain edge features of the road image; and construct the processed road image based on the edge features.
7. A non-volatile storage medium, characterized in that: The non-volatile storage medium includes a stored program, wherein when the program is executed, the device where the non-volatile storage medium is located is controlled to execute the method for processing road data of a CAD drawing according to any one of claims 1 to 5.
8. A processor, characterized in that: The processor is used to run a program stored in the memory, wherein the program executes the method for processing road data of a CAD drawing as described in any one of claims 1 to 5 when running.
Citation Information
Patent Citations
Road detection algorithm of fusion of area and edge information
CN106228138A
Building model identification method, system and related device
CN113128457A