A method, system, device, and readable storage medium for identifying the axis of symmetry in drawings.

By obtaining and dividing the coordinates of graphic elements in architectural design drawings, the symmetry of one-dimensional graphic element coordinates in the symmetry direction of the drawings is determined, and candidate axes of symmetry are identified. This solves the problem of low accuracy in symmetry axis recognition in existing technologies and achieves higher recognition accuracy and applicability.

CN116049926BActive Publication Date: 2026-01-30GLODON CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310117374.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-30
Publication Date
2026-01-30
Estimated Expiration
2043-01-30

AI Technical Summary

Technical Problem

Existing intelligent recognition algorithms have low accuracy in identifying the axis of symmetry in architectural design drawings, especially when there is layout symmetry or multiple axes of symmetry, resulting in low accuracy in information mapping.

Method used

By obtaining the one-dimensional coordinates of graphic elements in the drawing in the direction of symmetry, dividing the coordinate sub-regions, and determining whether the coordinates of the one-dimensional graphic elements in the coordinate sub-regions are symmetrical about the midpoint coordinates, and combining the preset conditions to determine the candidate axis of symmetry, and then determining it as the axis of symmetry of the drawing.

Benefits of technology

It improves the accuracy of symmetry axis recognition, can identify symmetry axes at different positions along the symmetry direction of drawings, is applicable to various scenarios, eliminates invalid symmetry axes, and improves detection accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116049926B_ABST
    Figure CN116049926B_ABST
Patent Text Reader

Abstract

This invention discloses a method, system, device, and readable storage medium for identifying the axis of symmetry in a drawing. The method includes obtaining the one-dimensional coordinates of graphic elements in the drawing along the direction of symmetry, and determining the coordinate distribution area of ​​these one-dimensional graphic elements along the direction of symmetry. Within the coordinate distribution area, sub-regions are defined. If the coordinates of the one-dimensional graphic elements within a sub-region are symmetrical about the midpoint of the sub-region, a candidate axis of symmetry is determined at the midpoint of the sub-region. If the candidate axis of symmetry meets preset conditions, it is determined as the axis of symmetry of the drawing. The identified axis of symmetry has a high accuracy rate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer-aided design technology, specifically to a method, system, device, and readable storage medium for identifying the axis of symmetry in drawings. Background Technology

[0002] Many design drawings are symmetrical. A symmetrical drawing is one where two areas of the drawing are mirror images of each other around an axis of symmetry. For example, the elements in the left and right halves of a drawing are symmetrical. When dealing with symmetrical drawings, designers typically only draw one half of the symmetrical portion in detail, while the other half is left with only basic outlines and annotations. Users of the drawing need to use their professional knowledge and experience to deduce the axis of symmetry and the symmetrical area, and then fill in the missing details in the other half.

[0003] Currently, with the development of technologies such as the Internet and machine learning, intelligent recognition algorithms are being used to identify the axis of symmetry in architectural design drawings. Based on the identified axis of symmetry, information such as annotations on one side of the axis of symmetry is mapped to the other side. These algorithms first identify the geometric center line of the architectural design drawing and use it as the axis of symmetry. Then, they map information such as annotations on one side of the axis of symmetry to the other side.

[0004] The accuracy of the symmetry axes identified by this method is relatively low. For example, when there is layout symmetry or multiple symmetry axes in the drawing, this method cannot accurately identify the symmetry axes in the drawing, which in turn leads to a low accuracy of information mapping. Summary of the Invention

[0005] In view of this, embodiments of the present invention provide a method, system, electronic device, and computer-readable storage medium for identifying the axis of symmetry of a drawing, which identifies the axis of symmetry of the drawing with high accuracy.

[0006] This invention provides a method for identifying the axis of symmetry in a drawing, the method comprising:

[0007] Obtain the one-dimensional coordinates of graphic elements in the drawing in the direction of symmetry of the drawing, and determine the coordinate distribution area of ​​the one-dimensional graphic element coordinates in the direction of symmetry of the drawing;

[0008] Divide the coordinate distribution area into coordinate sub-regions;

[0009] If, within the coordinate sub-region, the coordinates of one-dimensional primitives included in the coordinate sub-region are symmetrical about the midpoint coordinates of the coordinate sub-region, it is determined that the drawing has an alternative axis of symmetry at the midpoint coordinates of the coordinate sub-region; and

[0010] If the candidate axis of symmetry meets the preset conditions, the candidate axis of symmetry will be determined as the axis of symmetry of the drawing.

[0011] In some embodiments of this application, the one-dimensional coordinates of graphic elements in the drawing are obtained in the direction of symmetry of the drawing. The coordinate distribution area of ​​the one-dimensional graphic element coordinates is then divided into coordinate sub-regions. By determining whether the one-dimensional graphic element coordinates included in the coordinate sub-regions are symmetrical about the midpoint coordinates of the coordinate sub-regions, it is possible to detect whether there is a candidate axis of symmetry at the midpoint coordinates of the coordinate sub-regions. Candidate axes of symmetry that meet preset conditions are then used as the axes of symmetry of the drawing. In this way, coordinate sub-regions can be divided at different positions in the coordinate distribution area, thereby enabling the detection of axes of symmetry at different positions in the direction of symmetry of the drawing. Compared to some technologies that only use the geometric centerline of the drawing as the axis of symmetry, the axis of symmetry identification method of this application can identify axes of symmetry at different positions in the direction of symmetry of the drawing, and the identified axes of symmetry have a higher accuracy rate.

[0012] In some embodiments, dividing the coordinate distribution region into coordinate sub-regions includes:

[0013] Within the coordinate distribution area, the coordinate sub-regions are divided sequentially according to a preset sliding step size to obtain multiple coordinate sub-regions;

[0014] Determining that there is a candidate axis of symmetry at the midpoint coordinates of the coordinate sub-region of the drawing includes:

[0015] In any of the coordinate sub-regions, if the coordinates of the one-dimensional primitives included in the coordinate sub-region are symmetrical about the midpoint coordinates of the coordinate sub-region, it is determined that the drawing has an alternative axis of symmetry at the midpoint coordinates of the coordinate sub-region.

[0016] Within the coordinate distribution area, coordinate sub-regions are divided according to a preset sliding step size, and it is determined whether there is a candidate axis of symmetry at the midpoint coordinate of each coordinate sub-region. This allows for the traversal of possible candidate axes of symmetry in the drawing, thereby improving the detection accuracy of the axis of symmetry.

[0017] In some embodiments, the coordinates of the one-dimensional primitives included in the coordinate sub-region are determined to be symmetrical about the midpoint coordinates of the coordinate sub-region when the following conditions are met:

[0018] If the proportion of one-dimensional primitive coordinates symmetrical about the midpoint coordinate of the coordinate sub-region exceeds a first proportion threshold, it is determined that the one-dimensional primitive coordinates included in the coordinate sub-region are symmetrical about the midpoint coordinate of the coordinate sub-region.

[0019] By setting a first proportion threshold, two areas in a drawing that have slight differences but are in symmetrical positions can be identified as symmetrical areas. The rules for determining the axis of symmetry are more flexible and applicable to more scenarios.

[0020] In some embodiments, after determining that there is an alternative axis of symmetry at the midpoint coordinates of the drawing, the method further includes:

[0021] Within the coordinate distribution area, the coordinate sub-region is expanded according to a preset expansion step size to determine the symmetrical region of the candidate symmetry axis, wherein the symmetrical region represents the area range of one-dimensional primitive coordinates symmetrical around the candidate symmetry axis.

[0022] By amplifying the coordinate sub-regions according to the preset amplification step size, the symmetrical regions of each axis of symmetry can be divided relatively accurately.

[0023] In some embodiments, determining the candidate axis of symmetry as the axis of symmetry of the drawing when the candidate axis of symmetry meets preset conditions includes:

[0024] If the width of the symmetrical region of the candidate axis of symmetry in the symmetrical direction of the drawing exceeds a width threshold, the candidate axis of symmetry is determined as the axis of symmetry of the drawing.

[0025] By comparing the width of the symmetrical region with a width threshold, invalid axes of symmetry in the drawing can be eliminated, thus improving the detection accuracy of axes of symmetry.

[0026] In some embodiments, the width threshold is determined based on at least one of the following conditions:

[0027] The width of the coordinate distribution area in the symmetrical direction of the drawing;

[0028] The number of axes of symmetry to be determined in the drawings.

[0029] In this way, different width thresholds can be set for different drawings, so that the symmetry axis obtained in the final screening can match the actual symmetry of the drawing, thereby improving the accuracy of symmetry axis detection.

[0030] In some embodiments, determining the candidate axis of symmetry as the axis of symmetry of the drawing when the candidate axis of symmetry meets preset conditions includes:

[0031] If the proportion of collinear elements on both sides of the candidate axis of symmetry exceeds a second proportion threshold in the symmetric region of the candidate axis of symmetry, the candidate axis of symmetry is determined as the axis of symmetry of the drawing.

[0032] By comparing primitives whose coordinates are located in symmetrical regions to ensure collinearity, invalid axes of symmetry can be eliminated, thus improving the detection accuracy of axes of symmetry.

[0033] In some embodiments, obtaining the one-dimensional coordinates of a graphic element in the drawing in the direction of symmetry of the drawing may include:

[0034] Obtain the one-dimensional coordinates of the midpoint of the graphic element in the direction of symmetry of the drawing, and use them as the one-dimensional coordinates of the graphic element in the direction of symmetry of the drawing.

[0035] Using the one-dimensional coordinates of the midpoint of each graphic element in the symmetrical direction of the drawing as the one-dimensional coordinates of the graphic element can reduce the amount of data processing.

[0036] In another aspect, the present invention provides a symmetry axis identification system, the system comprising:

[0037] The coordinate acquisition module is used to acquire the one-dimensional coordinates of graphic elements in the drawing in the symmetrical direction of the drawing, and to determine the coordinate distribution area of ​​the one-dimensional graphic element coordinates in the symmetrical direction of the drawing;

[0038] The neighborhood partitioning module is used to divide the coordinate distribution area into coordinate sub-regions.

[0039] A candidate symmetry axis identification module is used to determine, if the coordinates of one-dimensional primitives included in the coordinate sub-region are symmetrical about the midpoint coordinates of the coordinate sub-region, that the drawing exists as a candidate symmetry axis at the midpoint coordinates of the coordinate sub-region; and

[0040] The symmetry axis identification module is used to identify the candidate symmetry axis as the symmetry axis of the drawing when the candidate symmetry axis meets the preset conditions.

[0041] In another aspect, the present invention provides an electronic device comprising a processor and a memory, the memory being used to store a computer program which, when executed by the processor, implements the method described above.

[0042] In another aspect, the present invention provides a computer-readable storage medium for storing a computer program that, when executed by a processor, implements the method described above. Attached Figure Description

[0043] The features and advantages of the invention will be more clearly understood by referring to the accompanying drawings, which are schematic and should not be construed as limiting the invention in any way. In the drawings:

[0044] Figure 1 A schematic diagram of a symmetrical drawing is shown;

[0045] Figure 2 A schematic diagram of another symmetrical drawing is shown;

[0046] Figure 3 A schematic diagram of another symmetrical drawing is shown;

[0047] Figure 4 A flowchart illustrating a symmetry axis identification method provided in one embodiment of this application is shown;

[0048] Figure 5 A schematic diagram of drawings provided in one embodiment of this application is shown;

[0049] Figure 6 A schematic diagram of drawings provided in another embodiment of this application is shown;

[0050] Figure 7 A schematic diagram of a coordinate distribution area provided in one embodiment of this application is shown;

[0051] Figure 8 This illustration shows a schematic diagram of the division of coordinate sub-regions provided in one embodiment of this application;

[0052] Figure 9 A schematic diagram of drawings provided in another embodiment of this application is shown;

[0053] Figure 10 It shows the Figure 8 A schematic diagram of the amplification of the coordinate sub-region A1 in the diagram;

[0054] Figure 11 A schematic diagram of drawings provided in another embodiment of this application is shown;

[0055] Figure 12 A schematic diagram of drawings provided in another embodiment of this application is shown;

[0056] Figure 13 A schematic diagram of drawings provided in another embodiment of this application is shown;

[0057] Figure 14 A schematic diagram of a symmetry axis recognition system provided in one embodiment of this application is shown.

[0058] Figure 15 A schematic diagram of an electronic device provided in one embodiment of this application is shown. Detailed Implementation

[0059] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0060] Before describing the solution in this application, the symmetrical scene in the drawings will be explained first. Please refer to... Figure 1 This is a schematic diagram of a symmetrical drawing. Figure 1 In the drawing, regions A and B are symmetrical about the axis of symmetry ab. The axis of symmetry ab is also the geometric centerline of the drawing (the line connecting the midpoints of the top and bottom edges of the drawing).

[0061] Please see Figure 2 This is a schematic diagram of another symmetrical drawing. Figure 2 In the region to the left of the dividing line e1f1, regions A1 and B1 are symmetrical with respect to the axis of symmetry c1d1, and the geometric center line a1b1 of the drawing is not collinear with the axis of symmetry c1d1.

[0062] Please see Figure 3 This is a schematic diagram of another symmetrical drawing. Figure 3 Within the dashed box regions, regions A2 and B2 are symmetrical with respect to the axis of symmetry c2d2; regions A3 and B3 are symmetrical with respect to the axis of symmetry c3d3; regions A4 and B4 are symmetrical with respect to the axis of symmetry c4d4; and regions A5 and B5 are symmetrical with respect to the axis of symmetry c5d5. Simultaneously, the left and right regions of the drawing are symmetrical with respect to the axis of symmetry a2b2, which is collinear with the geometric centerline of the drawing.

[0063] Through the above Figures 1 to 3 It can be seen that in some techniques, using only the geometric center line of a drawing as its axis of symmetry is not entirely accurate. Therefore, this application provides a method for identifying the axes of symmetry in a drawing, which can accurately identify each axis of symmetry. This method can be applied to industrial drafting software or to electronic devices running such software. These electronic devices may include laptops, desktop computers, smartphones, tablets, etc. Please refer to... Figure 4 This is a flowchart illustrating a symmetry axis identification method provided in one embodiment of this application. Figure 4 In this context, the symmetry axis identification method includes the following steps:

[0064] Step S41: Obtain the one-dimensional coordinates of the graphic elements in the drawing in the symmetrical direction of the drawing, and determine the coordinate distribution area of ​​the one-dimensional graphic elements in the symmetrical direction of the drawing.

[0065] In some embodiments, graphic elements can be basic unit elements in a drawing, such as line segments, arcs, and points. These graphic elements can be further combined to obtain the components required for the drawing design (such as walls and columns in architectural design drawings). See also... Figure 5 This is a schematic diagram of a drawing provided for one embodiment of this application. Figure 5 The drawing contains components G1 and G2. Components G1 and G2 are each composed of multiple line segments. These line segments are the graphic elements.

[0066] In some embodiments, the one-dimensional coordinates of a graphic element in the symmetrical direction of the drawing refer to the positional information of the graphic element in that symmetrical direction. The symmetrical direction of the drawing can be a direction in which the drawing exhibits symmetry. Figure 5 For example. Figure 5 A drawing coordinate system is defined. In the drawing coordinate system, the origin O is the lower left corner of the drawing, the X-axis points horizontally towards the drawing, and the Y-axis points vertically towards the drawing. Since the graphic elements in the drawing are symmetrical along the X-axis, the goal is to obtain the one-dimensional coordinates of the graphic elements along the X-axis (i.e., the X-axis coordinates).

[0067] It is understandable that if the drawing is symmetrical in the Y-axis direction, then it is possible to obtain the one-dimensional coordinates of the graphic element in the Y-axis direction (i.e., the Y-axis coordinates).

[0068] Furthermore, it can be understood that the symmetrical direction of the drawing can include, but is not limited to, the X-axis and Y-axis directions mentioned above. (See also...) Figure 6 This is a schematic diagram of a drawing provided for another embodiment of this application. Figure 6 In the drawing, primitives G1 and G2 are symmetrical along the dashed line direction. Therefore, the one-dimensional coordinates of the primitives in the symmetrical direction of the drawing are the same as their coordinates along the dashed line direction. The coordinates of the primitives along the dashed line direction can be obtained by converting their X-axis and Y-axis coordinates.

[0069] In some embodiments, if the drawing is symmetrical in multiple directions, the one-dimensional coordinates of the graphic elements in the drawing can be obtained sequentially in multiple symmetrical directions. For example, if the drawing is symmetrical in both the X-axis and Y-axis directions, the one-dimensional coordinates of the graphic elements in the drawing in the X-axis direction and the one-dimensional coordinates of the graphic elements in the Y-axis direction can be obtained sequentially. Based on the one-dimensional coordinates of the graphic elements in the X-axis direction, the axis of symmetry of the drawing in the X-axis direction can be determined; based on the one-dimensional coordinates of the graphic elements in the Y-axis direction, the axis of symmetry of the drawing in the Y-axis direction can be determined. For details on determining the axis of symmetry, please refer to the subsequent descriptions; they will not be repeated here.

[0070] In the following description of this application, the example is given by the fact that the drawing is symmetrical in the X-axis direction.

[0071] In some embodiments, by Figure 5 It can be seen that some graphic elements in a drawing can have multiple one-dimensional coordinates along the symmetrical direction of the drawing. For example, the line segment ab has multiple X-axis coordinates along the X-axis. To reduce data volume, the above method for obtaining the one-dimensional coordinates of graphic elements in the symmetrical direction of the drawing can include:

[0072] Obtain the one-dimensional coordinates of the midpoint of the graphic element in the direction of symmetry of the drawing, and use the obtained one-dimensional coordinates of the graphic element in the direction of symmetry of the drawing.

[0073] For example, for Figure 5 For line segment ab, obtain the one-dimensional primitive coordinates of the midpoint c of line segment ab in the X-axis direction, and use the one-dimensional primitive coordinates of the midpoint c in the X-axis direction as the one-dimensional primitive coordinates of line segment ab in the X-axis direction.

[0074] Thus, based on the one-dimensional coordinates of each graphic element in the drawing along the symmetrical direction of the drawing, the coordinate distribution area of ​​the one-dimensional graphic element coordinates along the symmetrical direction of the drawing can be determined. (Refer to the relevant reference.) Figure 7 This is a schematic diagram of the coordinate distribution area provided in one embodiment of this application. Figure 7 In the diagram, a small black dot represents the one-dimensional coordinates of the midpoint of a graphic element in the drawing, along the direction of symmetry (X-axis). (See also...) Figure 5 Points A, B, C, and D in the drawing can be understood because, in a drawing, the spacing between the midpoints of various graphic elements along the symmetrical direction can be different. Figure 7 The spacing between the coordinates of one-dimensional primitives in the drawing may not be exactly the same. The coordinate region defined by the largest and smallest one-dimensional primitive coordinates is the coordinate distribution area of ​​the one-dimensional primitive coordinates in the symmetrical direction of the drawing. This coordinate distribution area includes the largest and smallest one-dimensional primitive coordinates, as well as all coordinates in between. In other words, the coordinate distribution area includes not only the one-dimensional primitive coordinates in the symmetrical direction of the drawing, but also the coordinates of non-one-dimensional primitives. For example, assuming the one-dimensional primitive coordinates are 1, 2, 4, 5, and 8, then the largest one-dimensional primitive coordinate is 8, the smallest one-dimensional primitive coordinate is 1, and the coordinate distribution area includes 1 and 8, as well as all coordinates in between, such as the non-one-dimensional primitive coordinates 3, 3.5, and 7, and the one-dimensional primitive coordinate 5.

[0075] Step S42: Divide the coordinate distribution area into coordinate sub-regions.

[0076] In some embodiments, a coordinate sub-region can be a continuous sub-interval within a coordinate distribution region. The coordinate sub-region may have midpoint coordinates. The midpoint coordinates can be the coordinates of the midpoint of the coordinate sub-region. For ease of understanding, refer to the relevant documentation. Figure 8 This is a schematic diagram of the division of coordinate sub-regions provided in one embodiment of this application. Figure 8 and Figure 7 Similarly, a small black dot represents the one-dimensional coordinates of the midpoint of a graphic element in the drawing, in the direction of symmetry (X-axis). Figure 8 In the example, a unit circle is used to divide the coordinate sub-regions into three sub-regions: A1, B1, and C1. A triangle symbol represents the coordinates of the midpoint of each sub-region (i.e., the center of the unit circle). The diameter of the unit circle can be the extent of the sub-region. The midpoint coordinates of the sub-region may or may not coincide with the one-dimensional coordinates of the graphic element. For example... Figure 8 In the coordinate sub-region B1, the midpoint coordinate B does not coincide with the one-dimensional coordinate of the graphic element. The midpoint coordinate A of the coordinate sub-region A1 and the midpoint coordinate C of the coordinate sub-region C1 coincide with the one-dimensional coordinate of the graphic element.

[0077] In some embodiments, dividing the coordinate distribution region into coordinate sub-regions may include:

[0078] Within the coordinate distribution area, coordinate sub-regions are divided sequentially according to a preset sliding step size to obtain multiple coordinate sub-regions.

[0079] These multiple coordinate sub-regions can have the same width along the symmetrical direction of the drawing. The sliding step size refers to the distance between the midpoint coordinates of two adjacent coordinate sub-regions. Within the coordinate distribution area, dividing the coordinate sub-regions according to the preset sliding step size allows for the traversal of possible axes of symmetry in the drawing, improving the detection accuracy of axes of symmetry. For details, please refer to the subsequent related descriptions, which will not be elaborated here.

[0080] Step S43: In the coordinate sub-region, if the coordinates of the one-dimensional primitives included in the coordinate sub-region are symmetrical about the midpoint coordinates of the coordinate sub-region, it is determined that there is a candidate axis of symmetry at the midpoint coordinates of the drawing in the coordinate sub-region.

[0081] In some embodiments, step S43 can be performed for each coordinate sub-region. In any coordinate sub-region, if the coordinates of the one-dimensional primitives included in the coordinate sub-region are symmetrical about the midpoint coordinates of the coordinate sub-region, it is determined that there is a candidate axis of symmetry at the midpoint coordinates of the drawing in the coordinate sub-region. The candidate axis of symmetry can be a candidate axis of symmetry of the drawing, that is, the axis of symmetry of the drawing can be selected from the candidate axes of symmetry.

[0082] It is understandable that for two symmetrical regions in a drawing, the coordinates of the graphic elements within those two regions should also be symmetrical along the symmetrical direction of the drawing. Therefore, this application uses each coordinate sub-region as a unit to check whether the coordinates of one-dimensional graphic elements within each coordinate sub-region are symmetrical, and then determines whether the graphic elements corresponding to these one-dimensional graphic element coordinates are symmetrical. Figure 8 For example, within coordinate sub-region A1, the coordinates of one-dimensional primitives on both sides of the midpoint A are symmetrical about the midpoint A, which means that there is a candidate axis of symmetry at the midpoint A. Within coordinate sub-region B1, no one-dimensional primitive coordinates are symmetrical about the midpoint B, which means that there is no candidate axis of symmetry at the midpoint B.

[0083] Furthermore, in some embodiments, for two regions with slight differences but symmetrical positions, most of the graphic elements in these regions have symmetrical coordinates in the symmetrical direction of the drawing, but a small number of graphic elements have asymmetrical coordinates in the symmetrical direction of the drawing. Considering that in some scenarios, it is permissible to define such two regions with slight differences but symmetrical positions as symmetrical regions (i.e., there is an axis of symmetry between these two regions), therefore, in some embodiments, if the proportion of one-dimensional graphic element coordinates symmetrical about the midpoint coordinate of the coordinate sub-region exceeds a first proportion threshold, it can be determined that the one-dimensional graphic element coordinates included in the coordinate sub-region are symmetrical about the midpoint coordinate of the coordinate sub-region, thus determining that there is a candidate axis of symmetry at the midpoint coordinate of the coordinate sub-region. The first proportion threshold can be set according to the actual situation. For example, if the first proportion threshold is 80%, and 80% of the one-dimensional graphic element coordinates included in a coordinate sub-region are symmetrical about the midpoint coordinate of that coordinate sub-region, it can be indicated that there is a candidate axis of symmetry at the midpoint coordinate of that coordinate sub-region.

[0084] For example, please refer to Figure 9 This is a schematic diagram of a drawing provided for another embodiment of this application. Figure 9In the diagram, the right side of component G1 differs slightly from the left side of component G2. The one-dimensional primitive coordinates of the horizontal straight line segment of component G1 along the X-axis are A, B, and C, while those of component G2 are E, F, and G. Assume that a coordinate sub-region is divided with coordinate M as the midpoint, and this sub-region includes one-dimensional primitive coordinates A, B, C, E, F, and G. Within this sub-region, one-dimensional primitive coordinates A and B, and F and G, are symmetrical about the midpoint M, but one-dimensional primitive coordinates C and E are asymmetrical about the midpoint M. Although one-dimensional primitive coordinates C and E are asymmetrical about the midpoint M, most one-dimensional primitive coordinates within the sub-region are symmetrical about the midpoint M. Therefore, it can be considered that the one-dimensional primitive coordinates within the sub-region are symmetrical about the midpoint M.

[0085] Similarly, in Figure 8 Within the coordinate sub-region C1, although some one-dimensional primitive coordinates are not symmetrical about the midpoint C, most one-dimensional primitive coordinates are symmetrical about the midpoint C. Therefore, it can be considered that there is a candidate axis of symmetry at the midpoint C. In this way, the rules for determining the candidate axis of symmetry are more flexible and applicable to more scenarios.

[0086] In some embodiments, the candidate axis of symmetry is perpendicular to the direction of symmetry of the drawing. For example, if the direction of symmetry of the drawing is the X-axis, then the candidate axis of symmetry is perpendicular to the X-axis.

[0087] Step S44: If the candidate axis of symmetry meets the preset conditions, the candidate axis of symmetry is determined as the axis of symmetry of the drawing.

[0088] In this embodiment, the preset conditions can be set based on the symmetrical regions of the candidate symmetry axes. Therefore, before determining whether a candidate symmetry axis meets the preset conditions, the symmetrical regions of the candidate symmetry axes can be determined first. Here, a symmetrical region represents the area of ​​one-dimensional primitive coordinates symmetrical around a candidate symmetry axis. For each candidate symmetry axis, a corresponding symmetrical region can be determined.

[0089] In some embodiments, within the coordinate distribution area, coordinate sub-regions can be expanded according to a preset expansion step size to determine the symmetrical region of the candidate symmetry axis. The expansion step size can be the size by which the coordinate sub-region is expanded outward each time. Specifically, after each expansion, it can be determined whether the coordinates of the one-dimensional primitives included in the coordinate sub-region are symmetrical about the candidate symmetry axis (i.e., the midpoint coordinates) of the coordinate sub-region; if yes, the expansion of the coordinate sub-region continues; if not, the expansion of the coordinate sub-region stops, and the coordinate sub-region before the last expansion is taken as the symmetrical region of the candidate symmetry axis.

[0090] For ease of understanding, please refer to the following: Figure 10In order to Figure 8 A schematic diagram of the amplification of the coordinate sub-region A1 in the diagram. Figure 10 Within the initial region of the coordinate sub-region (within the area defined by circle A1), since all one-dimensional primitive coordinates are symmetrical about the midpoint coordinate A, there exists a candidate axis of symmetry OM at the midpoint coordinate A. Further, the coordinate sub-region is expanded according to a preset expansion step size. After the first expansion, the coordinate sub-region is the region defined by circle A2. Within the region defined by circle A2, all one-dimensional primitive coordinates are still symmetrical about the candidate axis of symmetry OM, so the coordinate sub-region is expanded again according to the preset expansion step size, resulting in the region defined by circle A3. Within the region defined by circle A3, although some one-dimensional primitive coordinates are asymmetrical about the candidate axis of symmetry OM, the proportion of one-dimensional primitive coordinates symmetrical about the candidate axis of symmetry OM exceeds a first proportion threshold compared to the total one-dimensional primitive coordinates within this region. Therefore, the one-dimensional primitive coordinates within this region are still considered symmetrical about the candidate axis of symmetry OM, and the coordinate sub-region is expanded again according to the preset expansion step size, resulting in the region defined by circle A4. Within the region defined by circle A4, if some one-dimensional primitive coordinates are asymmetrical around the candidate axis of symmetry OM, and the proportion of symmetrical one-dimensional primitive coordinates around the candidate axis of symmetry OM to the total one-dimensional primitive coordinates within this region does not exceed a first proportion threshold, then the one-dimensional primitive coordinates within this region are considered asymmetrical around the candidate axis of symmetry OM. Therefore, the coordinate sub-region before the last amplification is taken as the symmetrical region of the candidate axis of symmetry OM, that is, the region defined by circle A3 is taken as the symmetrical region of the candidate axis of symmetry OM. For primitives whose one-dimensional primitive coordinates are located within this region, these primitives are symmetrical with respect to the candidate axis of symmetry OM.

[0091] In some embodiments, amplifying the coordinate sub-region according to a preset amplification step size can more accurately divide the symmetrical regions of each candidate axis of symmetry.

[0092] Based on the symmetrical regions of each candidate axis of symmetry, in some embodiments, if the width of the symmetrical region of a candidate axis of symmetry in the symmetrical direction of the drawing exceeds a width threshold, the candidate axis of symmetry is determined as the axis of symmetry of the drawing.

[0093] For ease of understanding, please refer to the following: Figure 11 This is a schematic diagram of a drawing provided for another embodiment of this application. Figure 11 The diagram shows the one-dimensional coordinates A, B, and C of some primitives of component G1 in the direction of symmetry on the drawing. Assume that... Figure 11The coordinates of three one-dimensional primitives A, B, and C are divided into a coordinate sub-region A1, and the coordinate of one-dimensional primitive B is taken as the midpoint of coordinate sub-region A1. Therefore, the coordinates of one-dimensional primitives A and C can be symmetrical about one-dimensional primitive coordinate B. Thus, it can be determined that there exists a candidate axis of symmetry at one-dimensional primitive coordinate B, and the symmetrical region of the candidate axis of symmetry is coordinate sub-region A1. However, through... Figure 11 It is clear that the judgment that there is a candidate axis of symmetry at coordinate B of the one-dimensional primitive is inaccurate.

[0094] Therefore, a width threshold can be set to limit the minimum width of symmetrical regions in a drawing. After identifying candidate axes of symmetry and their corresponding symmetrical regions, if the width of the symmetrical region exceeds the width threshold, the corresponding candidate axis of symmetry is designated as the axis of symmetry in the drawing; if the width of the symmetrical region does not reach the width threshold, the candidate axis of symmetry is designated as an invalid axis of symmetry. This effectively solves the problem of... Figure 11 The problem shown is that invalid symmetry axes are eliminated from the candidate symmetry axes, thereby improving the detection accuracy of symmetry axes.

[0095] In addition, the width threshold can be set appropriately based on the actual symmetry of the drawing. For example, if the symmetrical area of ​​the drawing is wide, the width threshold can be set to a larger value; if the symmetrical area of ​​the drawing is narrow, the width threshold can be set to a smaller value.

[0096] The following is an example of a method for determining the width threshold.

[0097] In some embodiments, the width threshold X can be determined based on the width Y of the coordinate distribution area in the symmetrical direction of the drawing and the number n of the axes of symmetry to be determined in the drawing. Specifically, the width threshold can be determined according to formula (1):

[0098]

[0099] For example, the above Figure 3 In the drawing, there are 5 axes of symmetry to be determined. Therefore, the width threshold is one-fifth of the width of the coordinate distribution area. After identifying the candidate axes of symmetry and their symmetrical regions, if the width of the symmetrical region does not exceed one-fifth of the width of the coordinate distribution area, the corresponding candidate axis of symmetry is determined as an invalid axis of symmetry. If the width of the symmetrical region exceeds one-fifth of the width of the coordinate distribution area, the corresponding candidate axis of symmetry is determined as the axis of symmetry of the drawing.

[0100] In some embodiments, a width threshold is determined based on the width of the coordinate distribution area in the symmetrical direction of the drawing and the number of symmetry axes to be determined in the drawing. Different width thresholds can be set for different drawings so that the symmetry axes obtained in the final screening can conform to the actual symmetry of the drawing, thereby improving the accuracy of symmetry axis detection.

[0101] In some embodiments, within the symmetrical region of a candidate axis of symmetry, if the proportion of collinear elements on both sides of the candidate axis of symmetry exceeds a second proportion threshold, the candidate axis of symmetry is determined as the axis of symmetry of the drawing. Here, collinear elements on both sides of a candidate axis of symmetry refer to elements that have the same coordinates on both sides of the candidate axis of symmetry in a direction perpendicular to the symmetry of the drawing. For example, assuming the drawing is symmetrical in the X-axis direction, then collinear elements on both sides of a candidate axis of symmetry are elements that have the same Y-axis coordinates on both sides of the candidate axis.

[0102] For ease of understanding, please refer to the following: Figure 12 This is a schematic diagram of a drawing provided for another embodiment of this application. Figure 12 It can be seen that the one-dimensional coordinates of the primitives in the X-axis direction of component G1 and component G2 in the X-axis direction can be symmetrical about the midpoint coordinate M. According to the method for determining the candidate coordinate axes in step S43 above, there should be a candidate axis of symmetry at the midpoint coordinate M. However, the Y-axis coordinates of components G1 and G2 are not the same, meaning that the primitives of component G1 and component G2 are not collinear. Therefore, the candidate axis of symmetry at the midpoint coordinate M cannot be determined as the axis of symmetry of the drawing.

[0103] The following combination Figure 13 Please provide a detailed explanation. Figure 13 A schematic diagram of a drawing provided for another embodiment of this application. Figure 13 In the diagram, the line segment coordinates of components G1, G3, and G5 are located to the left of the candidate axis of symmetry OB; the line segment coordinates of components G2, G4, and G6 are located to the right of the candidate axis of symmetry OB. The Y-axis coordinates of each line segment of components G1, G3, and G5 are compared with the Y-axis coordinates of all line segments of components G2, G4, and G6. For any line segment of G1, G3, or G5, if a line segment with the same Y-axis coordinate can be found among all line segments of components G2, G4, and G6, then a line segment collinear with that line segment exists to the right of the candidate axis of symmetry OB. For example, for line segment a, among the line segments of components G2, G4, and G6, there exists a line segment with the same Y-axis coordinate as line segment a. Therefore, to the right of the candidate axis of symmetry OB, there exists a line segment collinear with line segment a. However, for line segment b, among the line segments of components G2, G4, and G6, there is no line segment with the same Y-axis coordinate as line segment b. Therefore, to the right of the candidate axis of symmetry OB, there is no line segment collinear with line segment b.

[0104] For ease of description, the collinear elements on both sides of the candidate axis of symmetry are referred to as target elements. The proportion of collinear elements on both sides of the candidate axis of symmetry can be a first ratio of the total number of target elements to the total number of elements on both sides of the candidate axis of symmetry, or a second ratio of the number of target elements to the total number of elements on one side of the candidate axis of symmetry. For example, suppose there are 30 elements on the left side of the candidate axis of symmetry, and 20 of these 30 elements are target elements; and there are 25 elements on the left side of the candidate axis of symmetry, and 20 of these 25 elements are target elements. The first ratio could be (20+20) / (30+25), and the second ratio could be 20 / 30 or 20 / 25. If either the first or second ratio exceeds the second threshold, the corresponding candidate axis of symmetry is determined as the axis of symmetry of the drawing; otherwise, if either the first or second ratio does not exceed the second threshold, the corresponding candidate axis of symmetry does not need to be determined as the axis of symmetry of the drawing.

[0105] The second proportion threshold can be set according to the actual situation. If slight differences between the primitives on both sides of the axis of symmetry are acceptable, the second proportion threshold can be set to a value less than 100%; if the primitives on both sides of the axis of symmetry are strictly required to be identical, the second proportion threshold can be set to 100%. This can solve the above problems. Figure 12 The problem shown is to improve the detection accuracy of the axis of symmetry.

[0106] In some embodiments of this application, the one-dimensional coordinates of graphic elements in the drawing are obtained in the direction of symmetry of the drawing. The coordinate distribution area of ​​the one-dimensional graphic element coordinates is then divided into coordinate sub-regions. By determining whether the one-dimensional graphic element coordinates included in the coordinate sub-regions are symmetrical about the midpoint coordinates of the coordinate sub-regions, it is possible to detect whether there is a candidate axis of symmetry at the midpoint coordinates of the coordinate sub-regions. Candidate axes of symmetry that meet preset conditions are then used as the axes of symmetry of the drawing. In this way, coordinate sub-regions can be divided at different positions in the coordinate distribution area, thereby enabling the detection of axes of symmetry at different positions in the direction of symmetry of the drawing. Compared to some technologies that only use the geometric centerline of the drawing as the axis of symmetry, the axis of symmetry identification method of this application can identify axes of symmetry at different positions in the direction of symmetry of the drawing, and the identified axes of symmetry have a higher accuracy rate.

[0107] In some embodiments, after selecting a candidate axis of symmetry that meets preset conditions as the axis of symmetry of the drawing, the symmetrical region of the candidate axis of symmetry can be used as the symmetrical region of the axis of symmetry of the drawing.

[0108] Please see Figure 14 This is a schematic diagram of a symmetry axis recognition system provided in one embodiment of this application. The symmetry axis recognition system includes:

[0109] The coordinate acquisition module is used to acquire the one-dimensional coordinates of graphic elements in the drawing in the symmetrical direction of the drawing, and to determine the coordinate distribution area of ​​the one-dimensional graphic element coordinates in the symmetrical direction of the drawing;

[0110] The neighborhood partitioning module is used to divide the coordinate distribution area into coordinate sub-regions.

[0111] A candidate symmetry axis identification module is used to determine, if the coordinates of one-dimensional primitives included in the coordinate sub-region are symmetrical about the midpoint coordinates of the coordinate sub-region, that the drawing exists as a candidate symmetry axis at the midpoint coordinates of the coordinate sub-region; and

[0112] The symmetry axis identification module is used to identify the candidate symmetry axis as the symmetry axis of the drawing when the candidate symmetry axis meets the preset conditions.

[0113] Please see Figure 15 The diagram below illustrates an electronic device according to an embodiment of this application. The electronic device includes a processor and a memory, the memory storing a computer program that, when executed by the processor, implements the aforementioned symmetry axis identification method.

[0114] The processor can be a central processing unit (CPU). It can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or combinations thereof.

[0115] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as the program instructions / modules corresponding to the methods in the embodiments of this invention. The processor executes various functional applications and data processing by running the non-transitory software programs, instructions, and modules stored in the memory, thereby implementing the methods described in the above embodiments.

[0116] The memory may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created by the processor, etc. Furthermore, the memory may include high-speed random access memory and non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory may optionally include memory remotely located relative to the processor, which can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0117] One embodiment of this application also provides a computer-readable storage medium for storing a computer program that, when executed by a processor, implements the above-described symmetry axis identification method.

[0118] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.

Claims

1. A method of identifying an axis of symmetry of a drawing sheet, characterized by, The method comprises: acquiring one-dimensional element coordinates of elements in a drawing in a symmetry direction of the drawing, and determining a coordinate distribution region of the one-dimensional element coordinates in the symmetry direction of the drawing; dividing a coordinate sub-region in the coordinate distribution region; in the coordinate sub-region, if the one-dimensional element coordinates included in the coordinate sub-region are symmetrical around a midpoint coordinate of the coordinate sub-region, determining that the drawing has a candidate symmetry axis at the midpoint coordinate of the coordinate sub-region; and in a case where the candidate symmetry axis meets a preset condition, determining the candidate symmetry axis as a symmetry axis of the drawing.

2. The method of claim 1, wherein, The dividing of the coordinate sub-region in the coordinate distribution region comprises: in the coordinate distribution region, sequentially dividing the coordinate sub-regions according to a preset sliding step, to obtain a plurality of coordinate sub-regions; The determining of the candidate symmetry axis at the midpoint coordinate of the coordinate sub-region of the drawing comprises: in any coordinate sub-region, if the one-dimensional element coordinates included in the coordinate sub-region are symmetrical around the midpoint coordinate of the coordinate sub-region, it is determined that the drawing has a candidate symmetry axis at the midpoint coordinate of the coordinate sub-region.

3. The method of claim 1, wherein, The one-dimensional element coordinates included in the coordinate sub-region are determined to be symmetrical around the midpoint coordinate of the coordinate sub-region when the following condition is met: in the one-dimensional element coordinates included in the coordinate sub-region, if the proportion of the one-dimensional element coordinates symmetrical around the midpoint coordinate of the coordinate sub-region exceeds a first proportion threshold.

4. The method of claim 1, wherein, After determining that the drawing has a candidate symmetry axis at the midpoint coordinate, the method further comprises: in the coordinate distribution region, expanding the coordinate sub-region according to a preset expansion step, to determine a symmetry region of the candidate symmetry axis, wherein the symmetry region represents the region range of the one-dimensional element coordinates symmetrical around the candidate symmetry axis.

5. The method of claim 4, wherein, The determining of the candidate symmetry axis as the symmetry axis of the drawing in a case where the candidate symmetry axis meets a preset condition comprises: if the region width of the symmetry region of the candidate symmetry axis in the symmetry direction of the drawing exceeds a width threshold, the candidate symmetry axis is determined as the symmetry axis of the drawing.

6. The method of claim 5, wherein, The width threshold is determined based on at least one of the following conditions: the region width of the coordinate distribution region in the symmetry direction of the drawing; the number of symmetry axes to be determined in the drawing.

7. The method of claim 4, wherein, The determining of the candidate symmetry axis as the symmetry axis of the drawing in a case where the candidate symmetry axis meets a preset condition comprises: in the symmetry region of the candidate symmetry axis, if the proportion of the elements collinear on both sides of the candidate symmetry axis exceeds a second proportion threshold, the candidate symmetry axis is determined as the symmetry axis of the drawing.

8. The method of claim 1, wherein, The acquiring of the one-dimensional element coordinates of the elements in the drawing in the symmetry direction of the drawing comprises: acquiring the one-dimensional element coordinates of the midpoints of the elements in the symmetry direction of the drawing as the one-dimensional element coordinates of the elements in the symmetry direction of the drawing.

9. A symmetry axis identification system characterized by, The system comprises: a coordinate acquisition module, configured to acquire one-dimensional element coordinates of elements in a drawing in a symmetry direction of the drawing, and determine a coordinate distribution region of the one-dimensional element coordinates in the symmetry direction of the drawing; The neighborhood division module is configured to divide a coordinate sub-region in the coordinate distribution region; The alternative symmetry axis identification module is configured to, in the coordinate sub-region, if one-dimensional figure element coordinates included in the coordinate sub-region are symmetrical around a midpoint coordinate of the coordinate sub-region, determine that the drawing has an alternative symmetry axis at the midpoint coordinate of the coordinate sub-region; and The symmetry axis identification module is configured to, if the alternative symmetry axis satisfies a preset condition, determine the alternative symmetry axis as a symmetry axis of the drawing.

10. A computer-readable storage medium, characterized in that, The computer readable storage medium is configured to store a computer program, and the computer program is executed by a processor to implement the method in any one of claims 1 to 8.

11. An electronic device, comprising: The electronic device includes a processor and a memory, and the memory is configured to store a computer program, and the computer program is executed by the processor to implement the method in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Method for detecting symmetric axis of two-dimensional figure

    CN103530654A

  • Procedure for detecting the reflectional symmetry of geometrical objects

    EP4086849A1