A vector-guided grid pattern region recognition and area calculation method and device, and a storage medium

By using vector-guided methods to generate initial active contours and spatial constraint areas, and combining them with Snake models to optimize boundaries, the problems of low recognition accuracy and poor efficiency in mixed drawings are solved, achieving high-precision and efficient region recognition and area calculation.

CN121482821BActive Publication Date: 2026-06-26HANGZHOU DINGHONG TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HANGZHOU DINGHONG TECHNOLOGY CO LTD
Filing Date
2025-11-09
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

Existing technologies suffer from low recognition accuracy, poor efficiency, and unreliable results when processing mixed drawings, especially those containing vector graphics and raster images. They lack a deep fusion mechanism that integrates the absolute geometric accuracy of vector data with the adaptive optimization capability of the raster recognition process.

Method used

By using a vector-guided method, the mixed drawing file is acquired, vector graphics and raster image data are parsed and separated, coordinate mapping relationships are established, initial active contours and spatial constraint areas are generated using vector boundaries, iterative optimization is performed using Snake or GVFSnake models, energy function parameters are adaptively configured, and data fusion and area calculation are performed.

Benefits of technology

It achieves high-precision and high-speed region identification and area calculation, avoids the local optima problem of traditional methods, improves boundary positioning accuracy, reduces redundant calculations, and realizes end-to-end automated processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121482821B_ABST
    Figure CN121482821B_ABST
Patent Text Reader

Abstract

The application discloses a kind of vector-guided grid figure area identification and area calculation method, device and medium.Method includes: obtaining and analyzing mixed drawing containing vector and raster data, establish coordinate mapping relationship;Analysis of vector data, identify closed area and extract boundary coordinate sequence;Based on the sequence, through optimization sampling to generate initial active contour, and combined with pixel-level expansion to form spatial constraint region, jointly constitute area guide information;Guidance information is input into active contour model, with initial contour as iteration starting point, constraint region as search range, under double guidance, execute optimization, output optimized boundary that fits the actual edge of raster;Based on confidence evaluation, fuse vector boundary and optimized boundary, determine the final target area;Automatic extraction scale information, convert pixel area into actual physical area.The application actively guides raster recognition through vector data, effectively improves the precision and efficiency of mixed drawing processing, realizes end-to-end automation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of computer vision, digital image processing and engineering information technology, and in particular to a vector-guided method, apparatus and storage medium for raster graphic region recognition and area calculation, used to process mixed drawing files containing vector graphics and raster images, to achieve high-precision and automated region recognition and area calculation. Background Technology

[0002] In fields such as engineering design and surveying, electronic drawings typically contain both vector graphic data (such as lines and filled areas generated by CAD) and raster image data (such as scanned base maps and photographs). This mixed data characteristic presents significant challenges to automated graphic recognition and area measurement. Currently, there are three main technical approaches to automated processing of mixed drawings, each with its own distinct drawbacks:

[0003] (1) Separate processing method: After recognizing the vector data and raster data separately, the results are simply merged. This method often causes boundary conflicts due to the heterogeneity of data sources, resulting in low final recognition accuracy.

[0004] (2) Unified rasterization method: converts high-precision vector data into raster images for unified processing. This method sacrifices the inherent precision advantage of vector data and has low processing efficiency.

[0005] (3) Post-calibration method: First, perform grid recognition, and then use vector data for post-geometric correction. This method cannot actively guide the recognition process from the algorithm initialization level, has limited improvement in accuracy, and still relies on manual intervention for post-adjustment.

[0006] In summary, existing technologies lack a mechanism at the principle level that can deeply integrate the absolute geometric precision of vector data with the adaptive optimization capabilities of the raster recognition process. Therefore, the field needs a novel technical solution that can fully utilize the high-precision characteristics of vector data to actively guide and optimize raster recognition during algorithm execution, thereby achieving efficient and accurate area calculation. Summary of the Invention

[0007] The purpose of this invention is to overcome the shortcomings of the prior art and provide a vector-guided method for identifying and calculating the area of ​​grid graphics regions, thereby solving problems such as low recognition accuracy, poor efficiency, and unreliable results in mixed drawing processing.

[0008] To achieve the above objectives, this invention proposes the technical concept of "vector guidance" and solves the problems of the prior art through the following technical solutions:

[0009] In a first aspect, embodiments of this application provide a vector-guided method for identifying and calculating the area of ​​a raster graphic region, including:

[0010] Step S11: Obtain a mixed drawing file containing vector graphics data and raster image data, parse and separate the vector graphics data and raster image data, and establish a coordinate mapping relationship based on spatial alignment;

[0011] Step S12: Analyze the vector graphics data, identify at least one closed graphic region, and extract its boundary coordinate sequence;

[0012] Step S13: Based on the boundary coordinate sequence, an initial active contour is generated by optimized sampling, and a spatial constraint region is formed by pixel-level expansion operation. The initial active contour and the spatial constraint region together constitute the region guidance information.

[0013] The initial active contour is generated by optimizing the sampling. The Douglas-Puk algorithm is used to optimize the sampling of the boundary coordinate sequence. Redundant coordinate points are eliminated with a set distance tolerance ε to generate an initial active contour composed of key feature points.

[0014] The distance tolerance ε is adaptively set according to the resolution of the raster image data. The higher the resolution, the smaller the value of ε, and the lower the resolution, the larger the value of ε.

[0015] Furthermore, the number of outward pixels used to form the spatially constrained region is set based on the resolution of the raster image data and the estimated vector-raster registration error.

[0016] Step S14: Input the region guidance information into the active contour model algorithm, including the Snake model or the GVFSnake model, wherein the initial active contour is set as the initial iteration state of the algorithm, and the spatial constraint region is set as the search range of the algorithm. Under this dual constraint, iterative optimization is performed, and the optimized boundary that fits the actual edge of the raster image is output.

[0017] Furthermore, the energy function parameters of the active contour model algorithm are adaptively configured based on the features of the raster image data, wherein:

[0018] The continuity weight α is adjusted based on image gradient features;

[0019] The curvature weight β is adjusted based on the contour geometry features;

[0020] Image force weight γ is adjusted based on local contrast features.

[0021] Step S15: Based on confidence assessment, perform data fusion on the region boundary directly determined by the vector and the optimized region boundary to determine the final target graphic region;

[0022] Data fusion calculates confidence levels by comprehensively evaluating contour stability and edge gradient features, and then makes data fusion decisions based on these confidence levels. The specific implementation is as follows:

[0023] Calculate the confidence score of the optimized region boundary:

[0024] Confidence level Conf = k1 × S + k2 × G;

[0025] in:

[0026] k1 and k2 are weight coefficients that satisfy k1 + k2 = 1, and k1 > 0, k2 > 0;

[0027] S is the profile stability coefficient, which is calculated by the displacement during the profile iterative evolution process;

[0028] G is the normalized gradient difference coefficient, which is calculated by the gradient difference between the regions inside and outside the boundary.

[0029] When the confidence level Conf is higher than the preset threshold, the optimized boundary is used; otherwise, the vector direct boundary is used.

[0030] Step S16: Based on the automatically extracted scale information, convert the pixel area of ​​the target graphic region into the actual physical area;

[0031] Furthermore, the actual physical area is calculated as follows:

[0032] Automatically extract scale information by recognizing or parsing drawing metadata using OCR;

[0033] Based on the obtained scale information and the DPI parameter of the raster image data, the pixel area of ​​the target graphic region is converted into the actual physical area.

[0034] Secondly, embodiments of the present invention also provide a vector-guided raster graphic region recognition and area calculation device, comprising:

[0035] The data parsing and mapping module is used to parse drawing files, separate vector graphic data from raster image data, and establish a coordinate mapping relationship between the two.

[0036] The vector analysis module is used to identify closed regions and extract boundary coordinates;

[0037] The guidance information generation module is used to generate region guidance information containing the initial activity contour and spatial constraint area based on the boundary coordinate sequence;

[0038] Specifically, the guidance information generation module also includes:

[0039] The contour initialization unit is used to optimize the boundary coordinate sequence using the Douglas-Puk algorithm to generate the initial active contour.

[0040] The constraint region definition unit is used to define the spatial constraint region through pixel-level expansion operations.

[0041] The guidance and recognition module is used to constrain the execution of the active contour model algorithm using the region guidance information, so as to output the optimized region boundary;

[0042] The data fusion module is used to fuse the direct vector region boundary and the optimized region boundary based on confidence level assessment, and output the final target graphic region.

[0043] The area calculation module is used to calculate the actual physical area of ​​the target graphic region based on automatically extracted scale information.

[0044] Thirdly, embodiments of this application also provide a computer-readable storage medium, characterized in that the computer-readable storage medium stores computer instructions for causing a computer to execute the method as described in any one of the first aspects.

[0045] Compared with the prior art, the present invention has the following beneficial effects:

[0046] High accuracy: By initializing the active contour through vector boundaries, the grid recognition process is ensured to start from a high-quality starting point close to the real edge, effectively avoiding the problem of traditional image recognition methods getting trapped in local optima due to improper random initialization, and the boundary positioning accuracy is significantly improved.

[0047] High efficiency: By expanding the spatial constraint region through vector geometry, the search range of the algorithm is greatly reduced, significantly reducing redundant calculations across the entire graph and resulting in faster processing speed.

[0048] Good integration: Since raster recognition is performed within the framework of vector information, its recognition results are naturally compatible with vector regions, and the data fusion step effectively avoids result conflicts.

[0049] High degree of automation: It achieves end-to-end automated processing from mixed drawings to area data, without the need for manual intervention. Attached Figure Description

[0050] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this invention, illustrate exemplary embodiments of the invention and are used to explain the invention, but do not constitute an undue limitation of the invention. In the drawings:

[0051] Figure 1 This is an overall flowchart of the method of the present invention.

[0052] Figure 2 This is a schematic diagram of a mixed drawing containing vector data and raster data, as presented in this invention.

[0053] Figure 3 This is a schematic diagram of the initial active contour generated in this invention.

[0054] Figure 4 This is a schematic diagram of the spatial constraint region formed by the pixel-level outward expansion operation in this invention.

[0055] Figure 5 This is a schematic diagram of the optimized boundary in this invention.

[0056] Figure 6 This is a schematic diagram of the final boundary in this invention.

[0057] Figure 7 This is a structural diagram of the device of the present invention.

[0058] Figure 8 This is a schematic diagram of the electronic device structure according to an embodiment of the present invention.

[0059] Figure reference numerals: 71. Data parsing and mapping module; 72. Vector analysis module; 73. Guidance information generation module (including 731 contour initialization unit and 732 constraint area definition unit); 74. Guidance recognition module; 75. Data fusion module; 76. Area calculation module. Detailed Implementation

[0060] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present invention and are not intended to limit the present invention. All other embodiments obtained by those skilled in the art based on the embodiments provided by the present invention without creative effort are within the scope of protection of the present invention.

[0061] The accompanying drawings described below are merely some examples or embodiments of the present invention. Those skilled in the art can apply the present invention to other similar scenarios based on these drawings without any inventive effort. Furthermore, it is understood that although the efforts made in this development process may be complex and lengthy, for those skilled in the art related to the content disclosed in this invention, making some design, manufacturing, or production modifications based on the technical content disclosed in this invention is merely a conventional technical means and should not be construed as insufficient disclosure of the present invention.

[0062] In this invention, the reference to "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of the invention. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it a mutually exclusive, independent, or alternative embodiment. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described in this invention may be combined with other embodiments without conflict.

[0063] Unless otherwise defined, the technical or scientific terms used in this invention shall have the ordinary meaning understood by one of ordinary skill in the art to which this invention pertains. The terms "a," "an," "an," "the," and similar words used in this invention do not indicate quantity limitation and may indicate singular or plural. The terms "comprising," "including," "having," and any variations thereof used in this invention are intended to cover non-exclusive inclusion; for example, a process, method, apparatus, product, or device that includes a series of steps or modules (units) is not limited to the listed steps or units, but may also include steps or units not listed, or may include other steps or units inherent to these processes, methods, products, or devices. The terms "connected," "linked," "coupled," and similar words used in this invention are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "A plurality" in this invention refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships may exist; for example, "A and / or B" can represent: A alone, A and B simultaneously, and B alone. The character " / " generally indicates that the preceding and following objects have an "or" relationship. The terms "first," "second," and "third" used in this invention are merely to distinguish similar objects and do not represent a specific ordering of the objects.

[0064] Existing electronic engineering drawings typically contain both vector graphic data (such as lines and filled areas generated by CAD) and raster image data (such as scanned base maps and photographs). However, existing technologies have significant shortcomings in the accuracy and efficiency of automated recognition of drawings with such mixed data characteristics, lacking a mechanism that can deeply integrate the absolute geometric accuracy of vector data with the adaptive optimization capabilities of the raster recognition process.

[0065] Therefore, there is a need in this field for a new technical solution that can fully utilize the high-precision characteristics of vector data to actively guide and optimize grid recognition during algorithm execution, thereby achieving efficient and accurate area calculation.

[0066] Among them, the key parameters of the present invention, such as the distance tolerance ε and the number of extended pixels N, are not common knowledge in the field or arbitrary choices, but are determined based on a deep understanding of the characteristics of hybrid drawings and a large number of experimental verifications. They are the core of achieving a balance between high precision and high efficiency.

[0067] To verify the technical effects of this invention, a test library of drawing samples containing various types of drawings, including architectural drawings, engineering planning drawings, and topographic maps, was constructed. Extensive test results demonstrate that the selection of key technical parameters and the proposed solutions have the following superior effects:

[0068] Distance tolerance ε (1-5 pixels): This parameter range covers the optimal effect range of over 95% of engineering drawings, achieving the best balance between geometric feature fidelity and computational efficiency. If ε is too small (<1 pixel), it cannot effectively filter out coordinate point jitter noise generated during the digitization process; if ε is too large (>5 pixels), it may be oversimplified, losing true corners and other key features, resulting in distortion of the initial contour.

[0069] Outer pixel count (5-15 pixels): This range can effectively cover the registration error of most engineering drawings (3-8 pixels) while effectively avoiding the introduction of too much background interference. If N is too small (<5 pixels), the real edge may fall outside the constraint area, resulting in recognition failure; if N is too large (>15 pixels), it will introduce a lot of irrelevant background interference, increase the calculation time, and may cause the contour evolution to deviate from the correct edge due to image distortion.

[0070] Adaptive configuration mechanism of energy function: The adaptive configuration strategy proposed in this invention can improve the accuracy and robustness of boundary recognition and maintain stable performance under different image features.

[0071] Confidence assessment and fusion mechanism: The test determined the confidence threshold to be 0.7, which can intelligently select the optimized boundary while ensuring the reliability of the results. If the threshold is too high, the system will be too conservative and unable to use raster information to correct vector errors; if the threshold is too low, unreliable recognition results will be easily introduced.

[0072] Example 1

[0073] This application provides a vector-guided method for identifying and calculating the area of ​​a raster graphic region. Figure 1 This is an overall flowchart of a vector-guided raster graphics region identification and area calculation method according to an embodiment of this application, as shown below. Figure 1 As shown, the process includes the following steps:

[0074] Step S11: Data Acquisition and Parsing: Acquire a mixed drawing file containing vector graphics data and raster image data, parse and separate the vector graphics data and raster image data, and establish a coordinate mapping relationship based on spatial alignment.

[0075] Preferably, the system receives a such Figure 2 The image shown is a PDF engineering design drawing containing both vector and raster data of a building floor plan. The PDF is parsed using a parsing library (such as Apache PDFBox), extracting Path objects as vector graphics data and Image objects as raster image data.

[0076] Furthermore, based on the coordinate transformation matrix in the PDF, a spatial alignment relationship is established between the vector graphics data and the raster image data, thus completing the coordinate mapping.

[0077] Step S12: Vector Analysis: Analyze the vector graphic data, identify at least one closed graphic region, and extract its boundary coordinate sequence.

[0078] Analyze vector graphics data, traverse all vector paths, and identify closed graphic regions (such as rooms and plots) with fill attributes.

[0079] Preferably, the precise boundary coordinate sequence is extracted directly using a graphics API (such as the Java2D API).

[0080] Step S13: Guiding information generation: Based on the boundary coordinate sequence, an initial active contour is generated by optimized sampling, and a spatial constraint region is formed by pixel-level expansion operation. The initial active contour and the spatial constraint region together constitute the region guiding information.

[0081] Initial activity contour generation:

[0082] The Douglas-Puk algorithm is used to optimize the sampling of the boundary coordinate sequence, and redundant coordinate points are eliminated with a set distance tolerance ε to generate an initial active contour composed of key feature points (such as...). Figure 3 (As shown).

[0083] The distance tolerance ε is set in segments according to the resolution of the raster image data: when the resolution is ≥300 DPI, ε is 1-2 pixels; when the resolution is between 150-300 DPI, ε is 2-3 pixels; when the resolution is <150 DPI, ε is 3-5 pixels. This segmentation setting can achieve the optimal balance between geometric feature preservation and noise suppression.

[0084] Spatial constraint region generation:

[0085] The number of pixels to be extended is set within the range of 5-15 pixels based on the resolution and the estimated registration error. The extension forms a spatially constrained area (such as...). Figure 4 (As shown).

[0086] Based on the test of the drawing samples, the actual registration error of most engineering drawings is within 3-8 pixels. This range can effectively cover these drawings and effectively avoid introducing too much background interference.

[0087] Furthermore, the initial activity outline and the spatial constraint area together constitute regional guidance information.

[0088] Step S14: Guided recognition: Input the region guidance information into the active contour model algorithm.

[0089] Preferably, the active contour model algorithm is the Snake model or the GVF Snake model.

[0090] Initialization and Constraints:

[0091] The initial active contour is set as the initial iteration state of the algorithm, and the spatial constraint region is set as the search range of the algorithm to achieve dual constraints.

[0092] Iterative optimization:

[0093] The algorithm iterates under dual constraints until the contour converges (e.g., the average movement distance of contour points is less than 0.1 pixels), outputting an optimized boundary that precisely matches the actual texture edge of the raster image (e.g., ...). Figure 5 (As shown).

[0094] Preferably, the adaptive configuration of the energy function of the active contour model algorithm is based on the following technical principles:

[0095] Continuity weight α: Its main function is to maintain uniform spacing between contour points. When the average gradient value is >50 (strong edge features), α is set to 0.1-0.3 to enhance contour flexibility; otherwise, α is set to 0.4-0.5 to maintain contour integrity.

[0096] Curvature weight β: Its function is to control the smoothness of the contour. When the radius of curvature is <5 pixels (high curvature feature points, such as key corners), β is set to 0.1-0.2 to preserve corner features; otherwise, β is set to 0.3-0.4 to smooth the contour.

[0097] Image force weight γ: When the contrast is >30 (sharp edges), γ is set to 0.8-1.0 to enhance edge attraction; otherwise, γ is set to 0.5-0.7 to suppress noise interference.

[0098] Step S15: Data Fusion: Based on confidence assessment, data fusion is performed on the region boundary directly determined by the vector and the optimized region boundary to determine the final target graphic region.

[0099] Furthermore, data fusion calculates confidence by comprehensively evaluating contour stability and edge gradient features, and makes data fusion decisions based on this confidence.

[0100] The confidence level formula is as follows:

[0101] Conf = k1 × S + k2 × G;

[0102] Through testing with drawing samples, where k1=0.6, k2=0.4, and the confidence threshold set to 0.7, a correction accuracy of approximately 98% can be achieved. This means that in most cases, the optimized boundary will only replace the vector direct boundary when it is sufficiently reliable, effectively balancing risk and reward.

[0103] Specifically, the contour stability coefficient S is calculated by the average displacement of contour points over three consecutive iterations: the average displacement AvgDelta = 0.08 pixels, and the stability threshold Th_s = 0.5 pixels.

[0104] S = 1 - min(0.08 / 0.5, 1.0) = 0.84.

[0105] The gradient difference coefficient G is calculated by the difference between the mean gradient values ​​within a 5-pixel range inside and outside the boundary: gradient difference = 25, gradient threshold Th_g = 20.

[0106] G=max(min(25 / 20,1.0),0.0)=1.0.

[0107] The calculated Conf=0.904>0.7, therefore the optimized region boundary is adopted as the final boundary (e.g., Figure 6 (As shown).

[0108] Step S16: Area Calculation: Based on the automatically extracted scale information, the pixel area of ​​the target graphic region is converted into the actual physical area.

[0109] Preferably, the scale text in the drawing is identified by the Tesseract OCR engine, or the scale information in the PDF metadata is parsed.

[0110] Furthermore, based on the acquired scale information and the DPI parameter of the raster image data, the pixel area of ​​the target graphic region is converted into the actual physical area.

[0111] In summary, the present invention has the following beneficial effects:

[0112] High accuracy: By initializing the active contour through vector boundaries, the grid recognition process is ensured to start from a high-quality starting point close to the real edge, effectively avoiding the problem of traditional image recognition methods getting trapped in local optima due to improper random initialization, and the boundary positioning accuracy is significantly improved.

[0113] High efficiency: By expanding the spatial constraint region through vector geometry, the search range of the algorithm is greatly reduced, significantly reducing redundant calculations across the entire graph and resulting in faster processing speed.

[0114] Good integration: Since raster recognition is performed within the framework of vector information, its recognition results are naturally compatible with vector regions, and the data fusion step effectively avoids result conflicts.

[0115] High degree of automation: It achieves end-to-end automated processing from mixed drawings to area data, without the need for manual intervention.

[0116] It should be noted that the above modules can be functional modules or program modules, and can be implemented through software or hardware. For modules implemented through hardware, the above modules can reside in the same processor; or the above modules can be located in different processors in any combination.

[0117] It should be noted that the steps shown in the above process or in the flowchart of the accompanying drawings can be executed in a computer device 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 may be executed in a different order than that shown here.

[0118] Example 2

[0119] This embodiment also provides a vector-guided raster graphics region recognition and area calculation device. Figure 7 This is a structural diagram of a vector-guided grid graphic region recognition and area calculation device according to an embodiment of this application, as shown below. Figure 7 As shown, the device includes: 71, a data parsing and mapping module; 72, a vector analysis module; 73, a guidance information generation module (including 731 a contour initialization unit and 732 a constraint region definition unit); 74, a guidance recognition module; 75, a data fusion module; and 76, an area calculation module.

[0120] The device of the present invention is deployed on a cloud server and includes the following modules:

[0121] The data parsing and mapping module is used to parse drawing files, separate vector graphics data from raster image data, and establish a coordinate mapping relationship between the two.

[0122] The vector analysis module is used to identify closed regions and extract boundary coordinates.

[0123] The guidance information generation module is used to generate region guidance information containing the initial active contour and spatial constraint area based on the boundary coordinate sequence.

[0124] Specifically, the guidance information generation module also includes:

[0125] The contour initialization unit is used to optimize the boundary coordinate sequence using the Douglas-Puk algorithm to generate the initial active contour.

[0126] The constraint region definition unit is used to define the spatial constraint region through pixel-level expansion operations.

[0127] The guidance and recognition module is used to constrain the execution of the active contour model algorithm using the region guidance information, so as to output the optimized region boundary.

[0128] The data fusion module is used to fuse the direct vector region boundary and the optimized region boundary based on confidence level assessment, and output the final target graphic region.

[0129] The area calculation module is used to calculate the actual physical area of ​​the target graphic region based on automatically extracted scale information.

[0130] The above-mentioned device achieves the following beneficial effects:

[0131] High accuracy: By initializing the active contour through vector boundaries, the grid recognition process is ensured to start from a high-quality starting point close to the real edge, effectively avoiding the problem of traditional image recognition methods getting trapped in local optima due to improper random initialization, and the boundary positioning accuracy is significantly improved.

[0132] High efficiency: By expanding the spatial constraint region through vector geometry, the search range of the algorithm is greatly reduced, significantly reducing redundant calculations across the entire graph and resulting in faster processing speed.

[0133] Good integration: Since raster recognition is performed within the framework of vector information, its recognition results are naturally compatible with vector regions, and the data fusion step effectively avoids result conflicts.

[0134] High degree of automation: It achieves end-to-end automated processing from mixed drawings to area data, without the need for manual intervention.

[0135] It should be noted that the above modules can be functional modules or program modules, and can be implemented through software or hardware. For modules implemented through hardware, the above modules can reside in the same processor; or the above modules can be located in different processors in any combination.

[0136] This invention also provides an electronic device, including a memory and a processor. The memory stores a computer program, and the processor is configured to run the computer program to execute the steps of a vector-guided raster region recognition and area calculation method according to any embodiment of this invention. The detailed implementation process of the vector-guided raster region recognition and area calculation method has been described in detail in this specification and will not be repeated here.

[0137] This invention also provides a computer-readable storage medium, characterized in that the storage medium stores a computer program, which, when read and loaded into memory by a processor, implements the steps of a vector-guided raster region identification and area calculation method according to any embodiment of this invention. The detailed implementation process of the vector-guided raster region identification and area calculation method has been described in detail in this specification and will not be repeated here.

[0138] In one embodiment, Figure 8 The diagram illustrates the structure of an electronic device according to an embodiment of the present invention. This electronic device comprises a network interface, a processor, memory, and a storage controller connected via an internal system bus. The network interface is used for communication with external terminals via a network connection. The storage controller is connected to at least one non-volatile storage medium, which stores an operating system and computer programs. The processor provides computational and control capabilities. The memory is a volatile storage device responsible for loading the operating system and computer programs from the storage medium into the runtime environment. The processor executes program instructions in the memory to implement a vector-guided raster graphics region recognition and area calculation method.

[0139] Those skilled in the art will understand that Figure 8 The structures shown are merely schematic diagrams of some structures related to the present invention and do not constitute a limitation on the application of the present invention to other electronic devices. Specifically, electronic devices may include more or fewer components than those shown in the figures, or combine certain components, or have different component arrangements.

[0140] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This computer program can be stored in a computer-readable storage medium, and when run, it can execute the processes of the above method embodiments. The terms "memory," "storage," "database," or "other media" as used herein all encompass the scope of storage media. Storage media include, but are not limited to: read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), flash memory, magnetic disks, or optical disks, etc.

[0141] Those skilled in the art should understand that the technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments have been described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0142] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these all fall within the protection scope of the present invention. Therefore, the protection scope of this invention patent should be determined by the appended claims.

Claims

1. A vector-guided method for identifying and calculating the area of ​​a raster graphic region, characterized in that, Includes the following steps: Step S11: Obtain a mixed drawing file containing vector graphics data and raster image data, parse and separate the vector graphics data and raster image data, and establish a coordinate mapping relationship based on spatial alignment; Step S12: Analyze the vector graphics data, identify at least one closed graphic region, and extract its boundary coordinate sequence; Step S13: Based on the boundary coordinate sequence, an initial active contour is generated by optimized sampling, and a spatial constraint region is formed by pixel-level expansion operation. The initial active contour and the spatial constraint region together constitute the region guidance information. Step S14: Input the region guidance information into the active contour model algorithm, including the Snake model or the GVF Snake model, wherein the initial active contour is set as the initial iteration state of the algorithm, and the spatial constraint region is set as the search range of the algorithm. Under this dual constraint, iterative optimization is performed, and the optimized boundary that fits the actual edge of the raster image is output. Step S15: Based on confidence assessment, perform data fusion on the region boundary directly determined by the vector and the optimized region boundary to determine the final target graphic region; Step S16: Based on the automatically extracted scale information, convert the pixel area of ​​the target graphic region into the actual physical area.

2. The method according to claim 1, characterized in that, In step S13, the initial active contour is generated by optimizing sampling, which is specifically implemented as follows: The boundary coordinate sequence is optimized and sampled using the Douglas-Puk algorithm. Redundant coordinate points are eliminated with a set distance tolerance ε to generate an initial active contour composed of key feature points. The distance tolerance ε is adaptively set according to the resolution of the raster image data. The higher the resolution, the smaller the value of ε, and the lower the resolution, the larger the value of ε.

3. The method according to claim 1, characterized in that, In step S13, the number of outward pixels used when forming the spatial constraint region is set according to the resolution of the raster image data and the estimated value of the vector-raster registration error.

4. The method according to claim 1, characterized in that, In step S14, the energy function parameters of the active contour model algorithm are adaptively configured according to the features of the raster image data, wherein: The continuity weight α is adjusted based on image gradient features; The curvature weight β is adjusted based on the contour geometry features; Image force weight γ is adjusted based on local contrast features.

5. The method according to claim 1, characterized in that, In step S15, the data fusion calculates a confidence level by comprehensively evaluating contour stability and edge gradient features, and makes a data fusion decision based on the confidence level. The specific implementation method is as follows: Calculate the confidence score of the optimized region boundary: Confidence level Conf = k1 × S + k2 × G; in: k1 and k2 are weighting coefficients that satisfy k1+k2=1, and k1>0, k2>0; S is the profile stability coefficient, which is calculated by the displacement during the profile iterative evolution process; G is the normalized gradient difference coefficient, which is calculated by the gradient difference between the regions inside and outside the boundary. When the confidence level Conf is higher than the preset threshold, the optimized boundary is used; otherwise, the vector direct boundary is used.

6. The method according to claim 1, characterized in that, Step S16 calculates the actual physical area, and the specific implementation method is as follows: Automatically extract scale information by recognizing or parsing drawing metadata using OCR; Based on the acquired scale information and the DPI parameter of the raster image data, the pixel area of ​​the target graphic region is... The product is converted into the actual physical area.

7. A vector-guided raster graphic region recognition and area calculation device, characterized in that, include: The data parsing and mapping module is used to parse drawing files, separate vector graphic data from raster image data, and establish a coordinate mapping relationship between the two. The vector analysis module is used to identify closed regions and extract boundary coordinates; The guidance information generation module is used to generate region guidance information containing the initial activity contour and spatial constraint area based on the boundary coordinate sequence; The guidance information generation module includes: The contour initialization unit is used to optimize the boundary coordinate sequence using the Douglas-Puk algorithm to generate the initial active contour. The constraint region definition unit is used to define the spatial constraint region through pixel-level expansion operations; The guidance and recognition module is used to constrain the execution of the active contour model algorithm using the region guidance information, so as to output the optimized region boundary; The data fusion module is used to fuse the direct vector region boundary and the optimized region boundary based on confidence level assessment, and output the final target graphic region. The area calculation module is used to calculate the actual physical area of ​​the target graphic region based on automatically extracted scale information.

8. An electronic device, characterized in that, It includes: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the computer instructions to perform the method of any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing a computer to perform the method of any one of claims 1 to 6.

Citation Information

Patent Citations

  • Human body thoracic and abdominal cavity CT image aorta segmentation method based on GVF Snake model

    CN105976384A

  • Urban building three-dimensional model reconstruction method based on dense matching point cloud features

    CN118097046A