CN116935429A - Annular area identification method, annular area identification device, computer equipment and medium - Google Patents

Annular area identification method, annular area identification device, computer equipment and medium Download PDF

Info

Publication number
CN116935429A
CN116935429A CN202210376719.XA CN202210376719A CN116935429A CN 116935429 A CN116935429 A CN 116935429A CN 202210376719 A CN202210376719 A CN 202210376719A CN 116935429 A CN116935429 A CN 116935429A
Authority
CN
China
Prior art keywords
region
closed
area
annular
edge line
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210376719.XA
Other languages
Chinese (zh)
Inventor
郭锋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Glodon Co Ltd
Original Assignee
Glodon Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Glodon Co Ltd filed Critical Glodon Co Ltd
Priority to CN202210376719.XA priority Critical patent/CN116935429A/en
Publication of CN116935429A publication Critical patent/CN116935429A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/62Analysis of geometric attributes of area, perimeter, diameter or volume

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Geometry (AREA)
  • Image Analysis (AREA)

Abstract

The invention provides a method, a device, computer equipment and a medium for identifying an annular area. The annular region identification method comprises the following steps: receiving a drawing to be identified; extracting a closed region in the drawing to be identified to obtain a closed region set; acquiring a first closed area and a second closed area which meet preset business rules and have a containing relation with each other; and forming an annular region by a first loop line circumscribing the first enclosed region and a second loop line circumscribing the second enclosed region.

Description

Annular area identification method, annular area identification device, computer equipment and medium
Technical Field
The present invention relates to the field of graphics processing technologies, and in particular, to a method, an apparatus, a computer device, and a medium for identifying an annular area.
Background
In municipal modeling, the area of a target area needs to be determined according to traffic sign marks, and the engineering quantity of the area needing to be painted is estimated. Fig. 1 is a schematic diagram of a traffic sign commonly used in the prior art, as shown in fig. 1, an area (a filling part in the figure) needing to be painted is first identified, and then a calculation software device can calculate an engineering quantity according to the identified area.
In the prior art, when determining the area of the target area, an internal point recognition algorithm and a filling recognition algorithm are generally adopted for determination, but the algorithm needs to sample the area to be recognized selected by a user, for example, a mouse is moved to the area to be recognized, that is, when the area to be recognized comprises a plurality of areas, the area to be recognized needs to be selected one by one, and the operation is complicated. In addition, in the case of performing recognition, only a single closed area is supported, when the target area to be recognized is not a single closed area, it is necessary to recognize the relevant closed area and then calculate the area, for example, fig. 2 is a schematic diagram of a traffic sign in the prior art, as shown in fig. 2, when the target area is a shaded area P in the drawing, in the case of performing recognition by using the algorithm in the prior art, the user first moves the mouse into the loop S1, recognizes a circular area surrounded by the loop S1, then moves the mouse into the loop S2, recognizes an arrow area surrounded by the loop S2, then calculates the area of the circular area and the area of the arrow area, and subtracts the two areas to obtain the area P, where it is necessary to recognize two closed areas and perform area calculation twice.
Therefore, how to reduce the complexity of the recognition algorithm is a technical problem that needs to be solved in the art.
Disclosure of Invention
The invention aims to provide a method, a device, computer equipment and a medium for identifying an annular area, which are used for solving the technical problems in the prior art.
In one aspect, to achieve the above object, the present invention provides a method for identifying an annular area.
The annular region identification method comprises the following steps: receiving a drawing to be identified; extracting a closed region in the drawing to be identified to obtain a closed region set; acquiring a first closed area and a second closed area which meet preset business rules and have a containing relation with each other; and forming an annular region by a first loop line circumscribing the first enclosed region and a second loop line circumscribing the second enclosed region.
Further, the step of extracting the closed area in the drawing to be identified to obtain a closed area set includes: obtaining a primitive in the drawing to obtain a primitive set; reserving simple primitives in the primitive set, and scattering complex primitives in the primitive set into the simple primitives until the primitive set only comprises the simple primitives; and obtaining the original closed areas of the simple primitives in the primitive set to obtain the closed area set.
Further, after the step of extracting the closed area in the drawing to be identified to obtain a closed area set, the method further includes: dividing the closed region set into a plurality of region blocks according to the inclusion relation among the closed regions; the step of obtaining a first closed region and a second closed region which meet a preset business rule and have a containing relation with each other specifically comprises the following steps: acquiring a first closed area and a second closed area which meet preset business rules and have a containing relation with each other in each area block; after the step of forming an annular region by a first loop wire circumscribing the first enclosed region and a second loop wire circumscribing the second enclosed region, the method further comprises: and obtaining an annular region set of the drawing to be identified according to the annular regions of the region blocks.
Further, the step of dividing the closed region set into a plurality of region blocks according to the inclusion relationship among the closed regions includes: sorting the closed areas in the closed area set according to the area from large to small; traversing each closed region of the sorted closed region sets, and judging whether the current closed region is contained by other closed regions in the closed region sets or not; if the current closed region is contained by other closed regions in the closed region set, adding the current closed region into a region block where the closed region containing the current closed region is located; and if the current occlusion region is not contained by other occlusion regions in the occlusion region set, creating a region block for the current occlusion region.
Further, the step of forming an annular region by a first loop line enclosing the first enclosed region and a second loop line enclosing the second enclosed region includes: judging whether the direction of the first loop line is the same as the direction of the second loop line; if the direction of the first loop wire is the same as the direction of the second loop wire, setting the direction of the first loop wire and the direction of the second loop wire to be opposite; and respectively taking the first loop line and the second loop line as side lines to form the annular region.
Further, the area of the first closed region is larger than the area of the second closed region, and the direction of the first loop line and the direction of the second loop line are set to be opposite, so that the first loop line and the second loop line form the annular region, comprising: reversing the direction of the second loop such that the first loop and the second loop form the loop area.
Further, the step of obtaining the annular region set of the drawing to be identified according to the annular region of each region block includes: and merging the annular areas of the area blocks to obtain an annular area set of the drawing to be identified.
Further, the first annular region and the second annular region have a first overlapping position and a second overlapping position, and the step of merging the annular regions of the region blocks to obtain the annular region set of the drawing to be identified includes: acquiring the edge line of the first annular area to obtain a first inner annular edge line and a first outer annular edge line, and acquiring the edge line of the second annular area to obtain a second inner annular edge line and a second outer annular edge line; determining a first intersection point of the first inner ring edge line with the second inner ring edge line, a second intersection point of the first outer ring edge line with the second inner ring edge line, a third intersection point of the first inner ring edge line with the second outer ring edge line, and a fourth intersection point of the first outer ring edge line with the second outer ring edge line at the first overlapping position; determining a fifth intersection point of the first inner ring edge line and the second inner ring edge line at the second overlapping position, a sixth intersection point of the first outer ring edge line and the second inner ring edge line, a seventh intersection point of the first inner ring edge line and the second outer ring edge line, and an eighth intersection point of the first outer ring edge line and the second outer ring edge line; and connecting the first intersection point with the second intersection point, the third intersection point with the fourth intersection point, the fifth intersection point with the sixth intersection point, and the seventh intersection point with the eighth intersection point.
On the other hand, in order to achieve the above purpose, the present invention provides a method for calculating the engineering quantity of the graphic mark.
The method for calculating the engineering quantity of the graphic mark comprises the following steps: by adopting any one of the annular region identification methods provided by the invention, the annular region corresponding to the graphic mark is identified; and obtaining the engineering quantity of the graphic mark according to the area of the annular area.
In another aspect, the present invention provides an apparatus for identifying a ring-shaped area.
The annular region identification device comprises: the receiving module is used for receiving the drawing to be identified; the extraction module is used for extracting the closed areas in the drawing to be identified to obtain a closed area set; the acquisition module is used for acquiring a first closed area and a second closed area which meet preset business rules and have a containing relationship with each other; and a processing module for forming an annular region by a first loop line enclosing the first enclosed region and a second loop line enclosing the second enclosed region.
In another aspect, the present invention provides a computing system for graphic marking engineering quantities.
The computing system of the graphic mark engineering quantity comprises: the identification device is used for identifying the annular region corresponding to the graphic mark by adopting any annular region identification method provided by the invention; and the calculating device is used for obtaining the engineering quantity of the graphic mark according to the area of the annular area.
In another aspect, the present invention provides an apparatus for identifying a ring-shaped area.
To achieve the above object, the present invention also provides a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the above method when executing the computer program.
To achieve the above object, the present invention also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the above method.
After receiving a drawing to be identified, the method, the device, the computer equipment and the medium for identifying the annular area firstly extract each closed area in the drawing to be identified to obtain a closed area set, then obtain a first closed area and a second closed area which meet preset business rules and have a containing relation with each other, and form the annular area through a first loop line encircling the first closed area and a second loop line encircling the second closed area, namely, the annular area meeting the preset business rules on the drawing to be identified is obtained, and the direct identification of the annular area is realized. When the engineering quantity (i.e. the painting area) of a certain graphic mark is required to be calculated, the area of the annular area corresponding to the graphic mark is calculated first, then the engineering quantity is calculated according to the area of the annular area, the algorithm is simple, and the selection operation of a user is not required.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to designate like parts throughout the figures. In the drawings:
FIG. 1 is a schematic illustration of a traffic sign as is common in the prior art;
FIG. 2 is a schematic illustration of a traffic sign according to the prior art;
FIG. 3 is a flowchart of a method for identifying a ring area according to a first embodiment of the present invention;
FIG. 4 is a schematic diagram illustrating the identification of an annular region according to a first embodiment of the present invention;
FIG. 5 is a flowchart of another method for identifying a ring area according to a first embodiment of the present invention;
fig. 6 to 8 are schematic diagrams illustrating a direction of a border of an annular region according to a first embodiment of the present invention;
FIG. 9 is a schematic view of overlapping closed areas according to a first embodiment of the present invention;
FIG. 10 is a flowchart of a method for calculating engineering quantities of graphic marks according to a second embodiment of the present invention;
FIG. 11 is a block diagram of a ring-shaped area identification device according to a third embodiment of the present invention;
FIG. 12 is a block diagram of a graphical signage engineering quantity computing system provided in accordance with a fourth embodiment of the present invention;
Fig. 13 is a hardware configuration diagram of a computer device according to a fifth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present invention more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In order to solve the problem of complex algorithm in identifying the target area mentioned in the background art, the inventor researches and discovers that if the target area can be identified to directly perform area calculation, the area identification can be reduced once, the calculation steps can be reduced, the complexity of the algorithm can be reduced, that is, if the annular area between the loop line S1 and the loop line S2 can be directly identified, and the area of the area P can be calculated by directly calling the graphic area calculation module as shown in fig. 2.
Based on the above, the invention provides a method, a device, a computer device and a medium for identifying an annular region, wherein after a drawing to be identified is received, each closed region in the drawing to be identified is firstly extracted to obtain a closed region set, then a first closed region and a second closed region which meet a preset service rule and have a containing relation with each other are obtained, and the annular region is formed by a first loop line encircling the first closed region and a second loop line encircling the second closed region, namely the annular region meeting the preset service rule on the drawing to be identified is obtained. When the engineering quantity of a certain graphic mark is required to be calculated, the area of the annular area corresponding to the graphic mark is calculated by adopting the method, and then the engineering quantity is calculated according to the area of the annular area, so that the algorithm is simple, and the selection operation of a user is not required.
Specific embodiments of the method, apparatus, computer device, and medium for identifying a ring area provided by the present invention will be described in detail below.
Before describing the embodiments in detail, basic terms related to the present invention will be described as follows:
enclosed area: in a two-dimensional plane, an area surrounded by one or more straight lines/line segments is defined as a closed area.
Annular closed region: if one enclosed region contains another enclosed region, the region between the large enclosed region and the small enclosed region is referred to as an annular enclosed region.
Region block: if one enclosed area contains a plurality of other enclosed areas, these enclosed areas may constitute an area block.
The CAD primitives are divided into: simple primitives (including display primitives, text primitives, and fill primitives) and complex primitives (including block primitives and combine primitives). Wherein, after the complex graphic primitive is broken up, the sub-graphic primitive is a simple graphic primitive.
An inner ring: the closed area consisting of the clockwise line segments is called the inner ring.
An outer ring: the closed area consisting of segments in the counterclockwise direction is called the outer ring.
Example 1
An embodiment of the present invention provides a method for identifying an annular region, by which an annular region in a drawing can be directly identified, and in particular, fig. 3 is a flowchart of a method for identifying an annular region provided by an embodiment of the present invention, as shown in fig. 3, where the method for identifying an annular region provided by the embodiment includes the following steps S101 to S104.
Step S101: and receiving the drawing to be identified.
Optionally, the drawing to be identified includes graphic data, specifically CAD data or GVD data, where the CAD data includes CAD primitives, such as lines, multi-segment lines, filled primitives, or block primitives, or geometric data such as curves, multi-segment lines, and polygons. In the drawing to be identified, an annular region can be formed from these geometric data.
Step S102: and extracting the closed areas in the drawing to be identified to obtain a closed area set.
And extracting all the closed areas in the drawing to be identified according to the characteristics or geometric data characteristics of the graphic primitive to form a closed area set comprising a plurality of closed areas.
Fig. 4 is a schematic diagram for identifying a ring-shaped area according to an embodiment of the present invention, as shown in fig. 4, a closed area set obtained by extracting a closed area in the drawing includes two arrow areas, a triangle area and a circle area.
Step S103: and acquiring a first closed area and a second closed area which meet preset business rules and have a containing relation with each other.
In this step, the closed areas in the set of closed areas are selected based on a preset business rule. For example, if the business rule is to identify the smallest annular region in the drawing, the step acquires the smallest closed region and the second smallest closed region with the containing relationship; for another example, if the business rule is to identify an annular area formed by two squares in the drawing, then this step obtains a closed area having two squares with an inclusion relationship.
As shown in fig. 4, the target service is a rendering area for determining traffic sign, the corresponding service rule is an annular area needing to be rendered in the identification drawing, and two groups of first closed areas and second closed areas with containing relations can be obtained through the step, wherein one group is a circular area and an arrow area contained by the circular area; the other group is a triangle area and an arrow area contained by the triangle area.
Step S104: the annular region is formed by a first loop line enclosing a first enclosed region and a second loop line enclosing a second enclosed region.
The loop defining the first closed region is a first loop and the loop defining the second closed region is a second loop, in which step an annular region is formed by the first loop and the second loop.
As shown in fig. 4, the first loop line S11 and the second loop line S12 constitute one annular region P1 for the circular region and the arrow region included by the circular region;
the first loop S21 and the second loop S22 constitute one loop region P2 for the triangle region and the arrow region included by the triangle region.
After receiving a drawing to be identified, the method for identifying the annular region firstly extracts each closed region in the drawing to be identified to obtain a closed region set, then obtains a first closed region and a second closed region which meet preset business rules and have a containing relation with each other, and forms the annular region through a first annular line surrounding the first closed region and a second annular line surrounding the second closed region, namely, the annular region meeting the preset business rules on the drawing to be identified is obtained, and the direct identification of the annular region is realized. When the engineering quantity (i.e. the painting area) of a certain graphic mark is required to be calculated, the area of the annular area corresponding to the graphic mark is calculated first, then the engineering quantity is calculated according to the area of the annular area, the algorithm is simple, and the selection operation of a user is not required.
Optionally, in an embodiment, the step of extracting the closed area in the drawing to be identified to obtain the closed area set includes: obtaining a primitive in a drawing to obtain a primitive set; reserving simple primitives in the primitive set, and scattering complex primitives in the primitive set into simple primitives until the primitive set only comprises the simple primitives; and obtaining the original closed areas of all the simple primitives in the primitive set to obtain a closed area set.
Specifically, fig. 5 is a flowchart of another method for identifying an annular region according to the first embodiment of the present invention, as shown in fig. 5, after image data composed of CAD primitives or GVD primitives is received, the image data is processed to identify the annular region, so as to output an annular region Poly. In the processing process, when extracting a closed area in a drawing to be identified, firstly extracting the graphic elements in the drawing to form a graphic element set. The graphic element set comprises simple graphic elements such as linear graphic elements, polygon graphic elements, filling graphic elements and the like, and complex graphic elements such as block graphic elements, labeling graphic elements and the like, wherein when the graphic elements comprise text graphic elements, the graphic elements are filtered out, because the text graphic elements do not have a closed area. And traversing each primitive in the primitive set to judge whether the primitive is required to be broken, if the current primitive is the complex primitive required to be broken, breaking the complex primitive into simple primitives until the primitives which are not required to be broken in the primitive set are all simple primitives, and acquiring the original closed areas of the simple primitives at the moment to obtain the closed area set. The simple primitives can be divided into two major classes, one class is non-filled primitives such as linear primitives or polygon primitives, the other class is filled primitives, and for the two classes, different methods can be adopted to obtain the corresponding closed areas. Specifically, different algorithms for obtaining the original Poly may be performed according to primitive type, based on traversing each simple primitive in the set of simple primitives. The line primitive/polygon primitive can call a civil interface to obtain original Poly (namely a closed area); the fill primitives invoke a municipal fill recognition algorithm to get the original Poly and add the Poly to the original Poly set (i.e., the closed region set).
When the method for identifying the annular region is adopted, when the closed region in the drawing to be identified is extracted to obtain the closed region set, the graphic elements are extracted first, all the complex graphic elements are scattered into simple graphic elements, then the original polygons of the simple graphic elements, namely the closed region, are obtained, and the closed region set corresponding to the drawing to be identified is obtained, so that the obtaining mode is simple and accurate.
Optionally, in an embodiment, after the step of extracting the closed area in the drawing to be identified to obtain the closed area set, the method for identifying the annular area further includes: dividing the closed region set into a plurality of region blocks according to the inclusion relation among the closed regions; the step of obtaining a first closed region and a second closed region which meet a preset business rule and have a containing relation with each other specifically comprises the following steps: acquiring a first closed area and a second closed area which meet preset business rules and have a containing relation with each other in each area block; after the step of forming the annular region by the first loop wire enclosing the first enclosed region and the second loop wire enclosing the second enclosed region, the method of identifying the annular region further comprises: and obtaining an annular region set of the drawing to be identified according to the annular regions of the region blocks.
Specifically, in some application scenarios, for example, a scenario including a plurality of traffic signs on a drawing to be identified, after obtaining a closed area set, the area blocks are first divided, in this embodiment, the closed area and the closed area included therein are divided into one area block, and the closed areas of any two different area blocks have no inclusion relationship. As shown in fig. 5, the closed region set therein is divided into a first region block B1 and a second region block B2 according to the inclusion relationship between the closed regions. Based on the above, when the first closed area and the second closed area which meet the preset business rule and have the containing relation with each other are acquired for each area block, the annular area corresponding to each area block can be obtained, then the annular area set of the drawing to be identified can be obtained according to the annular area of each area block, specifically, the annular areas obtained by each area block can be combined, or the annular areas obtained by each area block can be directly written into a set, so that the annular area set is obtained.
By adopting the annular region identification method provided by the embodiment, the closed region set of the drawing to be identified is divided into the region blocks, and the annular region is identified for each region block respectively, so that the annular region can be better identified. By introducing the concept of the regional blocks, the key links for dividing the closed region according to the position relationship are realized. It is possible to merge all the closed areas of the subsequent acquisition area block.
Optionally, in one embodiment, the step of dividing the closed region set into a plurality of region blocks according to a containment relationship between the closed regions includes: sorting the closed areas in the closed area set according to the area from large to small; traversing each closed region of the sorted closed region sets, and judging whether the current closed region is contained by other closed regions in the closed region sets or not; if the current closed region is contained by other closed regions in the closed region set, adding the current closed region into a region block where the closed region containing the current closed region is located; and creating a region block of the current occlusion region if the current occlusion region is not contained by other occlusion regions in the set of occlusion regions.
Specifically, when dividing the region blocks, all Poly (closed regions) in the obtained Poly set (i.e. the closed region set) are firstly ordered, and the ordered Poly set is formed by sequentially arranging the closed regions from front to back according to the size of the closed regions. Then, as shown in FIG. 5, for each Poly, the sorted set of Poly is traversed to determine whether the current Poly is contained by other Poly. If so, add it to the region block in which its Poly resides; if not, a new region block is created from it. Finally, all the area blocks are added into a set to wait for the next processing.
Optionally, in one embodiment, the step of forming the annular region by a first loop wire circumscribing the first enclosed region and a second loop wire circumscribing the second enclosed region comprises: judging whether the direction of the first loop line is the same as the direction of the second loop line; if the direction of the first loop wire is the same as the direction of the second loop wire, setting the direction of the first loop wire and the direction of the second loop wire to be opposite; the first loop wire and the second loop wire are respectively used as side wires to form an annular area.
Specifically, when the direction of the first loop line is the same as the direction of the second loop line, that is, the first closed region and the second closed region are both inner loops or both outer loops. If both the closed areas are inner rings, the two areas cannot form an annular closed area, but only two independent closed areas are formed, as shown in fig. 6. If the two closed areas are outer rings, the two closed areas cannot form an annular closed area, and only two independent closed areas are formed, as shown in fig. 7. When the direction of the first loop is different from the direction of the second loop, i.e. one of the two closed areas is an inner loop and the other is an outer loop, the two closed areas may constitute an annular closed area. As shown in fig. 8. In this case, if the direction of the first loop line is the same as the direction of the second loop line when the loop region is formed, the directions of the two loop lines are reversed, and the loop region can be formed by the two loop lines.
Optionally, in one embodiment, the area of the first enclosed area is larger than the area of the second enclosed area, and the direction of the first loop wire and the direction of the second loop wire are set to be opposite, so that the first loop wire and the second loop wire form the annular area, and the step of forming the annular area includes: the second loop wire is reversed in direction such that the first loop wire and the second loop wire form an annular region.
Specifically, after a first closed region and a second closed region having an inclusion relationship are found for a certain region block, if the area of the first closed region is larger, at this time, when the loop line of the two closed regions is reversely placed, the direction of the loop line enclosing the closed region with the next largest area (namely, the second closed region) is set to be the reverse direction of the loop line enclosing the closed region with the largest area (namely, the first closed region), and one of the two closed regions is ensured to be an inner loop and the other outer loop, so that an annular closed region can be formed. The loop direction of the closed area with smaller area is reversed, so that the resource consumption is small.
Optionally, in one embodiment, the step of obtaining the set of annular regions of the drawing to be identified from the annular regions of each region block includes: and merging the annular areas of the area blocks to obtain an annular area set of the drawing to be identified.
Specifically, as shown in fig. 9, after annular areas of the area block are obtained, overlapping portions may exist in these annular areas. These overlapping portions may cause errors in calculation of the amount of work, for example, when calculating the amount of work of painting a traffic sign, if the amount of work is not removed, the area of painting may be repeated, and thus the amount of work of municipal administration may be estimated inaccurately, and the bid may be influenced, and as shown in fig. 5, the above-mentioned influence may be eliminated by performing the merging operation on the annular areas of the respective area blocks.
Optionally, in an embodiment, the first annular region and the second annular region have a first overlapping position and a second overlapping position, and the step of merging the annular regions of the respective region blocks to obtain the annular region set of the drawing to be identified includes: acquiring the edge line of the first annular area to obtain a first inner annular edge line and a first outer annular edge line, and acquiring the edge line of the second annular area to obtain a second inner annular edge line and a second outer annular edge line; determining a first intersection point of the first inner ring edge line and the second inner ring edge line, a second intersection point of the first outer ring edge line and the second inner ring edge line, a third intersection point of the first inner ring edge line and the second outer ring edge line, and a fourth intersection point of the first outer ring edge line and the second outer ring edge line at the first overlapping position; determining a fifth intersection point of the first inner ring edge line and the second inner ring edge line at the second overlapping position, a sixth intersection point of the first outer ring edge line and the second inner ring edge line, a seventh intersection point of the first inner ring edge line and the second outer ring edge line, and an eighth intersection point of the first outer ring edge line and the second outer ring edge line; and connecting the first intersection point with the second intersection point, the third intersection point with the fourth intersection point, the fifth intersection point with the sixth intersection point, the seventh intersection point and the eighth intersection point.
Specifically, as shown in fig. 9, the first annular region P1 and the second annular region P2 have overlapping portions, the first annular region P1 is surrounded by the first inner annular edge line S11 and the first outer annular edge line S12, the second annular region P2 is surrounded by the second inner annular edge line S21 and the second outer annular edge line S22, and the overlapping portions of the first annular region P1 and the second annular region P2 have two overlapping positions: a first overlap position P1 'and a second overlap position P2'. When the two annular regions are combined, four intersection points of the first inner ring edge line S11, the second inner ring edge line S21, the first outer ring edge line S12 and the second outer ring edge line S22 are determined at a first overlapping position P1', and a first intersection point D1, a second intersection point D2, a third intersection point D3 and a fourth intersection point D4; at the second overlapping position P2', four intersections of the first inner ring edge S11, the second inner ring edge S21, the first outer ring edge S12, and the second outer ring edge S22, a fifth intersection D5, a sixth intersection D6, a seventh intersection D7, and an eighth intersection D8 are determined, the first intersection D1 and the second intersection D2 are connected, the third intersection D3 and the fourth intersection D4, the fifth intersection D5 and the sixth intersection D6, and the seventh intersection D7 and the eighth intersection D8 are connected such that the first annular region P1 is divided into two portions: a portion constituted by an edge line located between the third intersection point D3 and the seventh intersection point D7 in the first inner ring edge line S11, and an edge line located between the fourth intersection point D4 and the eighth intersection point D8 in the first outer ring edge line S12; the overlapping part of the first annular region P1 and the second annular region P2, that is, the first overlapping position P1 'and the second overlapping position P2', is removed from the other part of the first inner annular edge S11, which is formed by the edge between the first intersection point D1 and the fifth intersection point D5, and the edge between the first intersection point D2 and the sixth intersection point D6, in the first outer annular edge S12, so that the overlapping positions are combined, that is, the two closed regions are combined, and finally, the combined closed region is obtained.
Example two
The second embodiment of the present invention provides a method for calculating a graphic mark engineering quantity, by which the engineering quantity of a graphic mark can be calculated, and in particular, fig. 10 is a flowchart of a method for calculating a graphic mark engineering quantity provided by the second embodiment of the present invention, as shown in fig. 10, where the method for calculating a graphic mark engineering quantity provided by the embodiment includes the following steps S201 to S202.
Step S201: the annular region corresponding to the graphic mark is identified.
Specifically, the graphic mark in this embodiment may be a traffic mark as shown in fig. 1, and by this step, the area to be painted when the traffic mark is made is identified, and specifically any of the annular area identification methods provided in the first embodiment may be adopted, which will not be described herein.
Step S202: and obtaining the engineering quantity of the graphic mark according to the area of the annular area.
After the annular region is obtained, the annular region is a closed region at the same time, and an area calculation tool of the closed region is called to calculate the area of the annular region, so that the engineering quantity of the graphic mark is obtained.
By adopting the calculation method of the graphic mark engineering quantity provided by the embodiment, after a drawing with traffic mark graphic elements is imported, the graphic elements to be identified can be selected, the number is not limited, the selection operation is selected and completed according to the requirements of users, then the process of searching the annular closed area is entered, the final annular closed area is output, and after the model graphic elements are created, the annular closed area data are set to the current graphic elements. The identified annular closed area is stored in the attribute of the model graphic element, when the engineering quantity of the graphic element is calculated, the data of the attribute is taken out from the graphic element, and then an area calculating algorithm is called, so that the area of the annular closed area can be obtained, and the paint brushing area required by a certain traffic sign is estimated.
Example III
Corresponding to the first embodiment, the third embodiment of the present invention provides an annular region identification device, and corresponding technical feature details and corresponding technical effects may refer to the first embodiment, which is not described in detail. Fig. 11 is a block diagram of an apparatus for identifying a ring area according to a third embodiment of the present invention, as shown in fig. 11, the apparatus includes: a receiving module 301, an extracting module 302, an obtaining module 303 and a processing module 304.
The receiving module 301 is configured to receive a drawing to be identified; the extraction module 302 is used for extracting the closed areas in the drawing to be identified to obtain a closed area set; the acquiring module 303 is configured to acquire a first closed area and a second closed area that satisfy a preset service rule and have an inclusion relationship with each other; and the processing module 304 is configured to form an annular region from a first loop wire that encloses a first enclosed region and a second loop wire that encloses a second enclosed region.
Optionally, in one embodiment, the extracting module includes: the first acquisition unit is used for acquiring the primitives in the drawing to obtain a primitive set; the first processing unit is used for reserving simple primitives in the primitive set and scattering complex primitives in the primitive set into the simple primitives until the primitive set only comprises the simple primitives; and a second obtaining unit, configured to obtain the original closed area of each simple primitive in the primitive set, so as to obtain the closed area set.
Optionally, in one embodiment, the identification device further includes: the dividing module is used for dividing the closed region set into a plurality of region blocks according to the inclusion relation among the closed regions after the closed regions in the drawing to be identified are extracted by the extracting module to obtain the closed region set; when the obtaining module obtains a first closed area and a second closed area which meet a preset business rule and have an inclusion relationship with each other, the steps specifically executed include: acquiring a first closed area and a second closed area which meet preset business rules and have a containing relation with each other in each area block; the identification device further includes: the determining module is used for obtaining the annular region set of the drawing to be identified according to the annular region of each region block after the processing module forms the annular region through the first annular line surrounding the first closed region and the second annular line surrounding the second closed region.
Optionally, in one embodiment, the partitioning module includes: the sorting unit is used for sorting the closed areas in the closed area set according to the area from large to small; the first judging unit is used for traversing each closed region of the sorted closed region sets and judging whether the current closed region is contained by other closed regions in the closed region sets or not; a second processing unit, configured to add the current closed region to a region block where a closed region including the current closed region is located, if the current closed region is included by other closed regions in the closed region set; and a creating unit configured to create an area block of the current closed area if the current closed area is not contained by other closed areas in the closed area set.
Optionally, in one embodiment, the processing module includes: a second judging unit configured to judge whether the direction of the first loop line is the same as the direction of the second loop line; a third processing unit, configured to set the direction of the first loop line and the direction of the second loop line to be opposite if the direction of the first loop line is the same as the direction of the second loop line; and the fourth processing unit is used for forming the annular area by taking the first loop line and the second loop line as side lines respectively.
Optionally, in an embodiment, the area of the first enclosed area is larger than the area of the second enclosed area, and the third processing unit specifically performs the steps when setting the direction of the first loop line and the direction of the second loop line to be opposite, so that the first loop line and the second loop line form the loop area, including: reversing the direction of the second loop such that the first loop and the second loop form the loop area.
Optionally, in one embodiment, the determining module specifically performs the steps of: and merging the annular areas of the area blocks to obtain an annular area set of the drawing to be identified.
Optionally, in one embodiment, the first annular region and the second annular region have a first overlapping position and a second overlapping position, and the determining module includes: the third acquisition unit is used for acquiring the edge line of the first annular area to obtain a first inner annular edge line and a first outer annular edge line, and acquiring the edge line of the second annular area to obtain a second inner annular edge line and a second outer annular edge line; a fifth processing unit, configured to determine, at the first overlapping position, a first intersection point of the first inner ring edge line with the second inner ring edge line, a second intersection point of the first outer ring edge line with the second inner ring edge line, a third intersection point of the first inner ring edge line with the second outer ring edge line, and a fourth intersection point of the first outer ring edge line with the second outer ring edge line; a sixth processing unit, configured to determine, at the second overlapping position, a fifth intersection point of the first inner ring edge line and the second inner ring edge line, a sixth intersection point of the first outer ring edge line and the second inner ring edge line, a seventh intersection point of the first inner ring edge line and the second outer ring edge line, and an eighth intersection point of the first outer ring edge line and the second outer ring edge line; and the connecting unit is used for connecting the first intersection point with the second intersection point, the third intersection point with the fourth intersection point, the fifth intersection point with the sixth intersection point, and the seventh intersection point with the eighth intersection point.
Example IV
Corresponding to the second embodiment, the fourth embodiment of the present invention provides a block diagram of a computing system for graphic mark engineering quantity, and accordingly, reference may be made to the second embodiment for details of technical features and corresponding technical effects, which are not described in detail in this embodiment. FIG. 12 is a block diagram of a computing system for graphic marking engineering quantities according to a fourth embodiment of the present invention, as shown in FIG. 12, the system includes: an identification means 401 and a calculation means 402.
The identifying means 401 is used for identifying the annular area corresponding to the graphic mark. The calculation means 402 is used to obtain the engineering quantity of the graphic mark according to the area of the annular region set. Specifically, the graphic mark in this embodiment may be a traffic mark as shown in fig. 1, and the identification device 401 is used to identify the area that needs to be painted when making the traffic mark, and specifically any of the identification methods for the annular area provided in the first embodiment may be used, which is not described herein.
Example five
The fifth embodiment also provides a computer device, such as a smart phone, a tablet computer, a notebook computer, a desktop computer, a rack-mounted server, a blade server, a tower server, or a rack-mounted server (including an independent server or a server cluster formed by a plurality of servers) that can execute the program. As shown in fig. 13, the computer device 01 of the present embodiment includes at least, but is not limited to: the memory 011, the processor 012, which can be communicatively connected to each other through a system bus, as shown in fig. 13. It is noted that fig. 13 only shows a computer device 01 having a component memory 011 and a processor 012, but it is understood that not all of the illustrated components are required to be implemented, and more or fewer components may alternatively be implemented.
In this embodiment, the memory 011 (i.e., readable storage medium) includes flash memory, hard disk, multimedia card, card memory (e.g., SD or DX memory, etc.), random Access Memory (RAM), static Random Access Memory (SRAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), programmable Read Only Memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, memory 011 may be an internal storage unit of computer device 01, such as a hard disk or memory of computer device 01. In other embodiments, the memory 011 may also be an external storage device of the computer device 01, such as a plug-in hard disk, smart Media Card (SMC), secure Digital (SD) Card, flash memory Card (Flash Card) or the like, which are provided on the computer device 01. Of course, the memory 011 may also include both the internal memory unit of the computer device 01 and its external memory device. In the present embodiment, the memory 011 is generally used to store an operating system installed in the computer apparatus 01 and various kinds of application software, such as program codes of the identification device of the annular area of the third embodiment. Further, the memory 011 can also be used for temporarily storing various types of data that have been output or are to be output.
The processor 012 may be a central processing unit (Central Processing Unit, CPU), controller, microcontroller, microprocessor, or other data processing chip in some embodiments. The processor 012 is typically used to control the overall operation of the computer device 01. In the present embodiment, the processor 012 is configured to execute a program code stored in the memory 011 or process data such as a ring area identification method or the like.
Example six
The sixth embodiment also provides a computer readable storage medium, such as a flash memory, a hard disk, a multimedia card, a card memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, a server, an App application store, etc., on which a computer program is stored, which when executed by a processor, performs the corresponding functions. The computer readable storage medium of the present embodiment is used for storing the annular region identification device, and when executed by the processor, implements the annular region identification method of the first embodiment.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.

Claims (13)

1. A method of identifying an annular region, comprising:
receiving a drawing to be identified;
extracting a closed region in the drawing to be identified to obtain a closed region set;
acquiring a first closed area and a second closed area which meet preset business rules and have a containing relation with each other; and
and forming an annular region by a first loop wire surrounding the first closed region and a second loop wire surrounding the second closed region.
2. The method for identifying an annular region according to claim 1, wherein the step of extracting the closed region in the drawing to be identified to obtain a closed region set includes:
Obtaining a primitive in the drawing to obtain a primitive set;
reserving simple primitives in the primitive set, and scattering complex primitives in the primitive set into the simple primitives until the primitive set only comprises the simple primitives; and
and acquiring the original closed areas of the simple primitives in the primitive set to obtain the closed area set.
3. The method for identifying an annular region according to claim 1, wherein,
after the step of extracting the closed areas in the drawing to be identified to obtain a closed area set, the method further comprises the following steps: dividing the closed region set into a plurality of region blocks according to the inclusion relation among the closed regions;
the step of obtaining a first closed region and a second closed region which meet a preset business rule and have a containing relation with each other specifically comprises the following steps: acquiring a first closed area and a second closed area which meet preset business rules and have a containing relation with each other in each area block;
after the step of forming an annular region by a first loop wire circumscribing the first enclosed region and a second loop wire circumscribing the second enclosed region, the method further comprises: and obtaining an annular region set of the drawing to be identified according to the annular regions of the region blocks.
4. A method of identifying annular regions according to claim 3, wherein the step of dividing the set of closed regions into a plurality of region blocks according to inclusion relationships between closed regions comprises:
sorting the closed areas in the closed area set according to the area from large to small;
traversing each closed region of the sorted closed region sets, and judging whether the current closed region is contained by other closed regions in the closed region sets or not;
if the current closed region is contained by other closed regions in the closed region set, adding the current closed region into a region block where the closed region containing the current closed region is located; and
if the current occlusion region is not contained by other occlusion regions in the occlusion region set, a region block of the current occlusion region is created.
5. The method of claim 1, wherein the step of forming the annular region from a first loop line circumscribing the first enclosed region and a second loop line circumscribing the second enclosed region comprises:
judging whether the direction of the first loop line is the same as the direction of the second loop line;
If the direction of the first loop wire is the same as the direction of the second loop wire, setting the direction of the first loop wire and the direction of the second loop wire to be opposite;
and respectively taking the first loop line and the second loop line as side lines to form the annular region.
6. The method of claim 5, wherein the first enclosed area has a larger area than the second enclosed area, and wherein the step of setting the direction of the first loop wire and the direction of the second loop wire to be opposite so that the first loop wire and the second loop wire constitute the annular area comprises:
reversing the direction of the second loop such that the first loop and the second loop form the loop area.
7. A method of identifying an annular region according to claim 3, wherein the step of obtaining an annular region set of the drawing to be identified from the annular region of each of the region blocks comprises: and merging the annular areas of the area blocks to obtain an annular area set of the drawing to be identified.
8. The method of claim 7, wherein the first and second annular regions have a first overlapping position and a second overlapping position, and the step of merging the annular regions of each of the region blocks to obtain the annular region set of the drawing to be identified comprises:
Acquiring the edge line of the first annular area to obtain a first inner annular edge line and a first outer annular edge line, and acquiring the edge line of the second annular area to obtain a second inner annular edge line and a second outer annular edge line;
determining a first intersection point of the first inner ring edge line with the second inner ring edge line, a second intersection point of the first outer ring edge line with the second inner ring edge line, a third intersection point of the first inner ring edge line with the second outer ring edge line, and a fourth intersection point of the first outer ring edge line with the second outer ring edge line at the first overlapping position;
determining a fifth intersection point of the first inner ring edge line and the second inner ring edge line at the second overlapping position, a sixth intersection point of the first outer ring edge line and the second inner ring edge line, a seventh intersection point of the first inner ring edge line and the second outer ring edge line, and an eighth intersection point of the first outer ring edge line and the second outer ring edge line;
and connecting the first intersection point with the second intersection point, the third intersection point with the fourth intersection point, the fifth intersection point with the sixth intersection point, and the seventh intersection point with the eighth intersection point.
9. A method for calculating a graphic marking engineering quantity, comprising:
Identifying the annular region corresponding to the graphic mark by adopting the annular region identification method according to any one of claims 1 to 8; and
and obtaining the engineering quantity of the graphic mark according to the area of the annular area.
10. An apparatus for identifying an annular region, comprising:
the receiving module is used for receiving the drawing to be identified;
the extraction module is used for extracting the closed areas in the drawing to be identified to obtain a closed area set;
the acquisition module is used for acquiring a first closed area and a second closed area which meet preset business rules and have a containing relationship with each other; and
and the processing module is used for forming an annular area through a first loop wire surrounding the first closed area and a second loop wire surrounding the second closed area.
11. A computing system for graphically marking an engineering quantity, comprising:
identification means for identifying an annular region corresponding to a graphic mark using the annular region identification method according to any one of claims 1 to 8; and
and the calculating device is used for obtaining the engineering quantity of the graphic mark according to the area of the annular area.
12. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any one of claims 1 to 9 when the computer program is executed by the processor.
13. A computer-readable storage medium having stored thereon a computer program, characterized by: the computer program implementing the steps of the method of any one of claims 1 to 9 when executed by a processor.
CN202210376719.XA 2022-04-11 2022-04-11 Annular area identification method, annular area identification device, computer equipment and medium Pending CN116935429A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210376719.XA CN116935429A (en) 2022-04-11 2022-04-11 Annular area identification method, annular area identification device, computer equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210376719.XA CN116935429A (en) 2022-04-11 2022-04-11 Annular area identification method, annular area identification device, computer equipment and medium

Publications (1)

Publication Number Publication Date
CN116935429A true CN116935429A (en) 2023-10-24

Family

ID=88390265

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210376719.XA Pending CN116935429A (en) 2022-04-11 2022-04-11 Annular area identification method, annular area identification device, computer equipment and medium

Country Status (1)

Country Link
CN (1) CN116935429A (en)

Similar Documents

Publication Publication Date Title
CN110990516B (en) Map data processing method, device and server
CN112699775A (en) Certificate identification method, device and equipment based on deep learning and storage medium
CN112632844A (en) Extracting and analyzing information from engineering drawings
CN110377209B (en) Method and device for realizing visual flow configuration through dragging
US20070160290A1 (en) Text flow in and around irregular containers
CN112560862A (en) Text recognition method and device and electronic equipment
CN112949477B (en) Information identification method, device and storage medium based on graph convolution neural network
CN109325259B (en) Data processing method, system, terminal and medium applied to 3D modeling
CN112528616A (en) Business form generation method and device, electronic equipment and computer storage medium
CN113420580A (en) Method and device for positioning auxiliary locator for two-dimensional code, two-dimensional code scanning equipment and storage medium
CN111444368B (en) Method and device for constructing user portrait, computer equipment and storage medium
CN115841558B (en) Urban road modeling method, device, electronic equipment and storage medium
CN112711407A (en) Construction method and use method of universal WebGIS development client
CN116935429A (en) Annular area identification method, annular area identification device, computer equipment and medium
CN108153731A (en) Uncommon word processing method, computing device and computer storage media
CN116343251A (en) Building drawing identification method and system based on AI building identification chart
CN115408450A (en) Economic data statistical method, device, equipment and medium based on geographic information
CN114443003A (en) Component rendering method and device, electronic equipment and storage medium
CN114882519A (en) Method and device for extracting layer based on primitive features
CN113192202A (en) Method for representing vector diagram of building model and computer-readable storage medium
CN114140813A (en) High-precision map marking method, device, equipment and storage medium
CN114238528A (en) Map loading method and device, electronic equipment and storage medium
CN113761169A (en) Price identification method and device
CN116049505B (en) Screen space tag collision detection method and device, computer equipment and storage medium
CN117456048B (en) Object labeling method and device in electronic map

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination