Methods, equipment, and storage media for line identification using pixel maps in automatic alarm systems

By identifying component locations and line connections in the pixel map of the automatic alarm system and generating semantic data, the problem of unidentifiable lines in the pixel map is solved, achieving high-precision line identification and review support.

CN115170658BActive Publication Date: 2026-03-10TSINGHUA UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-22
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

Existing technologies cannot effectively identify the wiring information in the pixel diagram of an automatic alarm system, especially since pixel-based drawings cannot obtain the wiring connection relationships between components.

Method used

By reading component information from the pixel map of the automatic alarm system, deep learning object detection technology is used to identify component locations, search for the starting line information of the components, and generate semantic data based on the line connection relationship to identify the lines.

Benefits of technology

It enables accurate identification of lines in the pixel map of the automatic alarm system, improves the accuracy of line information acquisition, and supports subsequent standard review work.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115170658B_ABST
    Figure CN115170658B_ABST
Patent Text Reader

Abstract

This application provides a method, device, and storage medium for line identification in a pixel map of an automatic alarm system. The method includes: reading component information drawn in the pixel map of the automatic alarm system, the component information including the component's position information; selecting any component in the pixel map of the automatic alarm system as a first component, and searching for the starting line information of the first component based on the position information of the first component and the pixel information surrounding the first component; searching for a second component that has a line connection relationship with the first component based on the starting line information of the first component, and determining the line connection information between the first component and the second component; generating semantic data based on the component information of the first component and the line connection information, thereby completing the identification of lines in the pixel map of the automatic alarm system. The method of this application can determine component information and the line connection information between components, and generate semantic data based on the component information and the line connection information to complete the line identification of the pixel map of the automatic alarm system.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of drawing detection, and particularly relates to a line identification method for a pixel drawing of an automatic alarm system, a device and a storage medium. BACKGROUND

[0002] Drawing examination is very important work in the construction industry. In the building drawing examination, the examination of the automatic alarm system drawing is also one of the important contents.

[0003] The existing line identification method for the automatic alarm system drawing is based on the automatic alarm system drawing as a vector drawing, such as a CAD drawing, and the information of the line segment in the CAD drawing can be obtained through layer filtering and attribute extraction, and the line information between components can be obtained by merging the information of the line segment.

[0004] However, the layer filtering and attribute extraction cannot obtain the information of the line segment in the pixel drawing of the automatic alarm system, and thus the line in the pixel drawing of the automatic alarm system cannot be identified. SUMMARY

[0005] The present application provides a line identification method for a pixel drawing of an automatic alarm system, a device and a storage medium, to solve the problem that the line in the pixel drawing of the automatic alarm system cannot be identified.

[0006] In a first aspect, the present application provides a line identification method for a pixel drawing of an automatic alarm system, comprising:

[0007] reading component information drawn in the pixel drawing of the automatic alarm system, the component information containing position information of the component;

[0008] selecting any component in the pixel drawing of the automatic alarm system as a first component, searching for starting line information of the first component based on the position information of the first component and pixel information around the first component;

[0009] searching for a second component having a line connection relationship with the first component according to the starting line information of the first component, and determining line connection information between the first component and the second component;

[0010] generating semantic data according to the component information and the line connection information of the first component, to complete the identification of the line in the pixel drawing of the automatic alarm system.

[0011] In a second aspect, the present application provides a line identification device for a pixel drawing of an automatic alarm system, comprising:

[0012] a component information reading module, configured to read component information drawn in the pixel drawing of the automatic alarm system, the component information containing position information of the component;

[0013] The starting line information acquisition module is configured to select any component in the automatic alarm system pixel graph as a first component, search starting line information of the first component based on position information of the first component and pixel information around the first component;

[0014] The component-surrounding-line searching module is configured to search a second component having a line connection relationship with the first component according to the starting line information of the first component, and determine line connection information between the first component and the second component.

[0015] The semantic data generation module is configured to generate semantic data according to the component information of the first component and the line connection information, so as to complete recognition of the line in the automatic alarm system pixel graph.

[0016] In a third aspect, the present application provides an automatic alarm system pixel graph line recognition device, comprising a processor and a memory, the memory storing codes, and the processor executing the codes stored in the memory to implement the automatic alarm system pixel graph line recognition method according to any one of the first aspect.

[0017] In a fourth aspect, the present application provides a computer readable storage medium, which stores computer execution instructions, and the computer execution instructions are executed by a processor to implement the automatic alarm system pixel graph line recognition method according to any one of the first aspect.

[0018] In a fifth aspect, the present application provides a computer program product, which comprises a computer program, and the computer program is executed by a processor to implement the automatic alarm system pixel graph line recognition method according to any one of the first aspect.

[0019] The present application provides an automatic alarm system pixel graph line recognition method, device and storage medium, reads component information drawn in an automatic alarm system pixel graph, and the component information comprises position information of a component. Any component in the automatic alarm system pixel graph is selected as a first component, and starting line information of the first component is searched based on position information of the first component and pixel information around the first component. After the starting line information of the first component is determined, a second component having a line connection relationship with the first component is searched according to the starting line information of the first component, and line connection information between the first component and the second component is determined. The component information and the line connection information of the first component are generated into corresponding semantic data, so as to complete recognition of the line in the automatic alarm system pixel graph. The method provided by the present application acquires starting line information of a first component in an automatic alarm system pixel graph, and acquires a second component having a line connection relationship with the first component and line connection information between the first component and the second component according to the starting line information of the first component. Semantic data is generated according to the component information of the first component and the circuit connection information, so as to complete recognition of the line in the automatic alarm system pixel graph. BRIEF DESCRIPTION OF DRAWINGS

[0020] The accompanying drawings, which are incorporated herein and constitute part of this specification, illustrate embodiments consistent with the application and, together with the description, serve to explain the principles of the application.

[0021] Figure 1 A pixel map part of an automatic alarm system according to an embodiment of the application;

[0022] Figure 2 A line identification method flow chart of a pixel map of an automatic alarm system according to an embodiment of the application;

[0023] Figure 3 A rectangular surrounding frame indicating component position information according to an embodiment of the application;

[0024] Figure 4 A starting line of a component according to an embodiment of the application;

[0025] Figure 5 A starting line search process of a component according to an embodiment of the application;

[0026] Figure 6 A method flow chart of obtaining accurate position information of a first component according to an embodiment of the application;

[0027] Figure 7 A method flow chart of obtaining accurate position information of a first component according to an embodiment of the application; Figure 1 ;

[0028] Figure 8 A method flow chart of obtaining accurate position information of a first component according to an embodiment of the application; Figure 2 ;

[0029] Figure 9 A method flow chart of obtaining a second component according to an embodiment of the application;

[0030] Figure 10 A line search diagram according to an embodiment of the application;

[0031] Figure 11 A method flow chart of determining a turning or interruption of a starting line according to an embodiment of the application;

[0032] Figure 12 A turning diagram of a starting line according to an embodiment of the application;

[0033] Figure 13 An interruption diagram of a starting line according to an embodiment of the application;

[0034] Figure 14A schematic diagram of a line identification device for a pixel map of an automatic alarm system provided by an embodiment of the present application Figure 1 ;

[0035] Figure 15 A schematic diagram of a line identification device for a pixel map of an automatic alarm system provided by an embodiment of the present application Figure 2 .

[0036] The specific embodiments of the present application have been shown by the above-described drawings, and will be described in more detail hereinafter. These drawings and the written description are not intended to restrict the scope of the present application concept in any way, but to illustrate the present application concept to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0037] Exemplary embodiments will be described in detail herein with reference to the drawings. When the description below refers to the drawings, the same numbers in different drawings refer to the same or similar elements unless otherwise described. The embodiments described in the following exemplary embodiments do not represent all the embodiments consistent with the present application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the present application as detailed in the appended claims.

[0038] Drawing review is a very important work in the construction industry, and in the building drawing review, the automatic alarm system drawing is also an important content. For example, in the "Code for Design of Automatic Fire Alarm System", it is clearly stipulated that the design of automatic alarm system drawing needs to follow the specification provisions. An automatic alarm system drawing not only includes various professional components, such as smoke fire detector, bus short circuit isolator, fire sound and light alarm, etc. in the fire automatic alarm system, but also has a complex line connection relationship between these components. The line connection relationship between these components has certain requirements in the design specification, so if the component information and the line connection information between the components in the automatic alarm system drawing can be obtained, the automatic alarm system drawing can be reviewed according to the corresponding provisions in the design specification.

[0039] The existing line identification method of the automatic alarm system drawing is based on the automatic alarm system drawing as a vector drawing, such as CAD drawing, etc. The information of the line segment in the CAD drawing can be obtained by layer filtering and attribute extraction, etc. The line information between the components can be obtained by merging the information of the line segment.

[0040] In addition to the vector drawing, the automatic alarm system drawing can also be a pixel drawing, and the automatic alarm system pixel drawing can be a PDF or jpg format drawing. Since the information of the line segment in the automatic alarm system pixel drawing cannot be obtained by layer filtering and attribute extraction, etc., and the color of the line in the automatic alarm system pixel drawing is usually black, the line in the automatic alarm system pixel drawing cannot be identified.

[0041] Figure 1 A pixel diagram of an automatic alarm system is provided in an embodiment of the present application, as shown in Figure 1 , wherein Figure 2 A and B represent components contained in the pixel diagram of the automatic alarm system, and there is a certain connection relationship between component A and component B.

[0042] The technical solutions of the present application and how the technical solutions solve the above technical problems will be described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes can not be described again in some embodiments. The embodiments of the present application will be described below with reference to the drawings.

[0043] Figure 2 A line identification method flow chart of a pixel diagram of an automatic alarm system is provided in an embodiment of the present application. The method of the present embodiment can be executed by a line identification device of the pixel diagram of the automatic alarm system, and can be realized by hardware, software, or a combination of hardware and software. As shown in Figure 3 , the method provided by the present application can include:

[0044] S201: reading component information drawn in the pixel diagram of the automatic alarm system, wherein the component information contains position information of the component.

[0045] The pixel diagram of the automatic alarm system is a pixel-level automatic alarm system diagram, which can be in PDF, jpg, etc. The pixel diagram of the automatic alarm system contains various components, such as smoke fire detector, bus short circuit isolator, fire sound and light alarm, etc. in the fire automatic alarm system.

[0046] In an implementation scenario, the component information drawn in the pixel diagram of the automatic alarm system can be read by using a target detection technology based on deep learning, which has high identification efficiency and accuracy.

[0047] The position information of the component is used to represent the position of the component in the pixel diagram of the automatic alarm system. In an implementation scenario, the position information of the component can be represented by a rectangular bounding box, which can be referred to as shown in Figure 4 . Specifically, the position of the component can be represented by the coordinates of the top corner of the rectangular bounding box, or the coordinates of the top left corner and the bottom right corner of the rectangular bounding box.

[0048] In an implementation scenario, after reading the component information drawn in the pixel map of the automatic alarm system, the position information of the first component can be refined to obtain accurate position information of the first component in the pixel map of the automatic alarm system, thereby improving the accuracy of the position of the first component and making the obtained starting route information of the first component more accurate.

[0049] S202: Select any component in the pixel map of the automatic alarm system as the first component, search for the starting route information of the first component based on the position information of the first component and the pixel information around the first component.

[0050] The starting route information can include the width, direction, slope and position coordinates of the starting point of the starting route. The starting route diagram of the component can refer to the diagram shown in Figure 5 .

[0051] Before searching whether there is a starting route around the first component, it is necessary to determine the length threshold of the line segment to be searched. In an implementation scenario, based on the position information of the first component, whether there is a line segment around the first component can be searched according to the pixel information around the first component. If there is a line segment with a preset width around the first component and the width of the line segment does not change, the line segment is a starting route, and the width, direction and position coordinates of the starting point of the starting route are determined; the slope of the starting route is calculated according to the position coordinates of the starting point and the position coordinates of the end point of the starting route, thereby obtaining the starting route information of the first component. The end point of the starting route is the position coordinate point with a distance of the length threshold from the starting point.

[0052] Wherein, according to the pixel information around the first component, whether there is a starting route around the first component can be searched from the frame of the first component, whether there is a starting route within the length threshold of the line segment in the up, down, left and right four directions. The pixel information can be the rgb value. In general, the route in the pixel map of the automatic alarm system is black, and the rgb value corresponding to the route is (0, 0, 0). It should be noted that, in addition to (0, 0, 0), the rgb value within a certain range can also be regarded as a black pixel.

[0053] Specifically, starting from the surrounding frame of the first component, whether there is a starting route in the up, down, left and right four directions can be realized by the following way:

[0054] Figure 5 A process diagram for searching the starting route of the component provided by the embodiment of the present application. As shown in Figure 6As shown, taking the right border of the first component as an example, given the coordinates of point A at the top right corner of the rectangular bounding box, the search starts from point A and proceeds downwards until the coordinates of the black pixel point B are found. The width of point B is then calculated. If the width of point B exceeds a certain threshold, the search continues to the right from point B. If, after searching a certain distance, point C is reached, and all pixels between points B and C are black with no change in width, then the BC line segment can be considered a starting line of the first component. Point B is the starting point of the starting line, and point C is the ending point of the starting line.

[0055] In another implementation scenario, if the search distance from the border of the first component has reached the line segment length threshold, and no line matching the preset width and whose width does not change is found within the line segment length threshold, it indicates that there is no starting line around the first component.

[0056] S203: Search for a second component that has a line connection relationship with the first component based on the starting line information of the first component, and determine the line connection information between the first component and the second component.

[0057] The pixel diagram of the automatic alarm system contains multiple components, and these components are connected by wiring. The second component refers to all other components in the pixel diagram of the automatic alarm system besides the first component.

[0058] In one implementation scenario, a search can be performed starting from the coordinates of the starting point along the direction and slope of the starting line to obtain the second component that has a line connection relationship with the first component.

[0059] The connection information between the first component and the second component may include the name and location information of the first component, the name and location information of the second component, the starting point coordinates, ending point coordinates, width, direction and slope of the connection line between the first component and the second component, etc.

[0060] S204: Generate semantic data based on the component information and line connection information of the first component to complete the identification of lines in the pixel map of the automatic alarm system.

[0061] Semantics refers to the meaning of the data. In one implementation scenario, the component information of the first component may include the location information and the component name. The location information is represented by the vertex coordinates of the bounding box of the rectangle. Based on the component information of the first component, semantic data corresponding to the name and location information of the first component can be obtained.

[0062] Based on each component, semantic data such as the width and direction of other components and connecting lines connected to the first component can be obtained according to the circuit connection information of the first component.

[0063] In another implementation scenario, taking a complete route as an example, the component information of the components contained in the route can be obtained, including semantic data such as the name, location, and relative position of the components, as well as the coordinates of the starting and ending points of the route. If the complete route contains multiple segments, the coordinates of the starting and ending points of each segment can be determined separately.

[0064] Semantic data is generated based on the component information and wiring connection information of the first component, and the semantic data is stored to complete the identification of wiring in the automatic alarm system diagram. After obtaining the semantic data, the pixel map of the automatic alarm system can be used for subsequent specification review.

[0065] It should be noted that the line identification method for the pixel map of the automatic alarm system can be implemented using a line search algorithm. This algorithm can handle complex line conditions, such as intersections, interruptions, and bends, thereby enabling a comprehensive search of all lines contained in the pixel map of the automatic alarm system and improving the accuracy of line identification.

[0066] This application provides a method for line identification in a pixel map of an automatic alarm system. The method reads component information drawn in the pixel map of the automatic alarm system, including component location information. Any component in the pixel map of the automatic alarm system is selected as a first component. Based on the location information of the first component and the pixel information surrounding the first component, the method searches for the starting line information of the first component. Based on the starting line information of the first component, the method searches for a second component that has a line connection relationship with the first component, and determines the line connection information between the first component and the second component. Semantic data is generated based on the component information of the first component and the line connection information to complete the line identification in the pixel map of the automatic alarm system. The method provided in this application determines whether there is a starting line around the first component. If a starting line exists around the first component, a second component that has a line connection relationship with the first component is obtained, and the line connection information between the first component and the second component is obtained. Generating semantic data based on the component information and the line connection information completes the line identification in the pixel map of the automatic alarm system.

[0067] Based on the above embodiments, the following embodiment provides a detailed description of the process of refining the position information of the first component.

[0068] Figure 6 This is a flowchart illustrating a method for obtaining precise location information of a first component, provided in an embodiment of this application. The executing entity of this method can be a component information reading module in the pixel image of an automatic alarm system. Figure 7 As shown, the method of this application is as follows:

[0069] S601: Determine the shape of the first component based on its name, and read the pixel information of the first component.

[0070] In the pixel diagram of an automatic alarm system, the shape of the components is generally rectangular or isosceles trapezoidal. Different components correspond to different shapes, so the shape of the first component can be determined based on its name.

[0071] S602: Adjust the position information of the first component according to the shape and pixel information of the first component, and obtain the precise position information of the first component in the pixel map of the automatic alarm system.

[0072] In one implementation scenario, a rectangular bounding box can be used to represent the position information of the first component. Adjusting the position information of the first component means adjusting the size of the rectangular bounding box until it coincides with the boundary of the component. For example, the search and adjustment begins around the rectangular bounding box. Based on the shape and pixel width of the first component, the boundary range of the first component is determined, and the rectangular bounding box is shrunk until it fits perfectly with the first component. (See reference...) Figure 8 As shown, the vertex coordinates of the reduced rectangular bounding box can serve as the precise position information of the first component.

[0073] Specifically, the boundary range of the first component is determined based on its shape and pixel width, and the rectangular bounding box is reduced to fit the boundary of the first component. This can be achieved in the following way:

[0074] like Figure 9 As shown, taking the left line ab of the rectangular bounding box as an example, the midpoint A of line ab is determined, and the search begins to the right. If the pixel of the searched position coordinate point is a black pixel, the width of each position coordinate point in the vertical direction is calculated. When the ratio of the width of the position coordinate point to the length of line ab is much less than a certain threshold, it indicates that the left boundary of the first component has not yet been found, and the search continues to the right. When the ratio of the width of position coordinate point B to the length of line ab is within a certain specific interval, it indicates that the left boundary of the first component has been found. Point B is located on the left boundary of the first component. At this time, based on the coordinates of point B, the left line ab of the rectangular bounding box can be shrunk to the right until it fits with the left boundary of the first component. It can be understood that the lines on the top, right, and bottom sides of the rectangular bounding box can be made to fit with the top, right, and bottom boundaries of the first component, respectively.

[0075] This application provides a method for obtaining precise location information of a first component. The method involves determining the shape of the first component based on its name and reading its pixel information. The position information of the first component is adjusted based on its shape and pixel information to obtain its precise location information in the pixel image of an automatic alarm system. This method improves the accuracy of the first component's position by adjusting its location information, thereby enhancing the accuracy of line recognition in the pixel image of the automatic alarm system.

[0076] Based on the above embodiments, the following embodiment provides a detailed description of the process of searching along the direction and slope of the starting line from the position coordinates of the starting point to obtain the second component that has a line connection relationship with the first component.

[0077] Figure 10 This application provides a flowchart of a method for obtaining a second component. This application embodiment can be executed by a component surrounding line search module in a line identification device of an automatic alarm system pixel map. As shown in the figure, the method of this application may include:

[0078] S901: Calculate the next position coordinate point in the starting line that is searched after the initial search based on the direction and slope of the starting line, and read the pixel information of the position coordinate point.

[0079] Figure 10 This is a schematic diagram of a route search provided for an embodiment of this application. For example... Figure 11 As shown in the figure, point A is the coordinate point where the search has been completed, and the coordinates of point A are (1, 0). Point B is the next coordinate point of point A. If the slope of the starting line where point A is located is 0, then the coordinates of point B are (2, 0). The pixel information of point B can be the RGB value of point B.

[0080] S902: Determine whether the position coordinate point is located on the starting line based on the pixel information of the position coordinate point.

[0081] In one implementation scenario, the starting line is black with an RGB value of (0, 0, 0). If the RGB value of a location point is (0, 0, 0), then the location point is on the starting line. If the RGB value of a location point is not (0, 0, 0), then the location point is not on the starting line.

[0082] In the pixel diagram of an automatic alarm system, the lines are not necessarily all continuous segments. Due to different line types and the intersections between lines, a line in the pixel diagram may be divided into multiple segments. At the point of interruption, the next segment will appear following the direction of the line before the interruption. In addition to interruptions, the line may also turn, in which case the direction of the line will change.

[0083] Therefore, in one implementation scenario, if the location coordinates are not located on the starting line, it is determined that the starting line has turned or been interrupted. If the starting line has turned, the line after the turning point is searched; or, if the starting line is interrupted, the next segment of the line after the interruption is searched.

[0084] S903: If the position coordinate point is located on the starting line, determine whether the position coordinate point is inside or on the edge of the second component based on the position information of the second component.

[0085] Based on the position information of the second component, determine whether the position coordinate point has reached the border position of the second component. The coordinates of the position coordinate point can be compared with the position coordinates of other components except the first component.

[0086] In one implementation scenario, if the coordinates of the location point are outside other components, then the next location coordinate point is determined, and steps S901-S903 are repeated.

[0087] S904: If the location coordinate point is inside the second component or on the border, then the second component and the first component have a line connection relationship.

[0088] If the coordinates of the location point are inside or on the border of the second component, then there is a connection line between the second component and the first component, and the connection information between the first and second components is determined. The connection information between the first and second components includes the name and location of the first component, the name and location of the second component, the starting point coordinates, the ending point coordinates, the width, and the slope of the line between the first and second components.

[0089] This application provides a method for obtaining a second component. The method calculates the next position coordinate point in the starting line relative to the already searched position coordinate point based on the direction and slope of the starting line, and reads the pixel information of the position coordinate point. It then determines whether the position coordinate point is located on the starting line based on the pixel information. If the position coordinate point is on the starting line, it determines whether the position coordinate point is inside or on the border of the second component based on the position information of the second component. If the position coordinate point is inside or on the border of the second component, a line connection relationship exists between the second component and the first component. The method provided in this application, by determining whether a point on the starting line is inside or on the border of the second component, can identify a second component that has a line connection relationship with the first component, and thus determine the line connection information between the first and second components. This method can be used for line identification in the pixel image of an automatic alarm system.

[0090] Based on the above embodiments, the following embodiment provides a detailed description of the process of determining whether the starting line has a turning point or interruption.

[0091] Figure 11 This application provides a flowchart of a method for determining whether a starting line has a bend or interruption. The execution entity of this method can be a component-surrounding line search module in a line identification device of an automatic alarm system pixel map. For example... Figure 12 As shown, the specific method is as follows:

[0092] S1101: Obtain the pixels of the position coordinate point in directions other than the direction of the starting line, and determine whether there are position coordinate points that match the pixel characteristics of the line.

[0093] The location coordinates are the last location coordinates on the starting line. When the next location coordinate is not on the starting line, it indicates that the starting line has turned or been interrupted, and it is necessary to return to that location coordinate. The line pixel features include information such as pixel values ​​and line width.

[0094] In one implementation scenario, a search is performed from the location coordinate point along a direction other than the direction of the starting line. If a location coordinate point contains black pixels in a certain direction and its width is the same as the width of the starting line, then that location coordinate point meets the line pixel characteristics.

[0095] In another implementation scenario, if there are no black pixel coordinate points in any direction other than the direction of the starting line, then there are no coordinate points in any direction other than the direction of the starting line that match the pixel characteristics of the line.

[0096] S1102: If there is a position coordinate point that matches the line pixel characteristics, the starting line turns along the direction of the determined position coordinate point that matches the line pixel characteristics.

[0097] If, excluding the direction of the starting line, there are position coordinate points in other directions that match the pixel characteristics of the line, then the direction, width, slope, and starting point coordinates of the line containing the position coordinate point matching the pixel characteristics are calculated. The search continues along these position coordinate points to obtain a second component that has a line connection with the first component. The process of continuing the search along these position coordinate points to obtain the second component can be found in the embodiments corresponding to the method described above for obtaining the second component. Figure 13 This is a schematic diagram showing the turning point of the initial route.

[0098] S1103: If there is no position coordinate point that matches the pixel characteristics of the line, the starting line is interrupted.

[0099] If the initial line is interrupted, the next line segment after the interruption can be searched. In one implementation scenario, location coordinates that match the pixel characteristics of the line can be searched along the direction of the initial line. If a location coordinate exists that matches the pixel characteristics of the line, the width of the line containing the location coordinate is the same as the width of the initial line, and the search distance along the direction of the initial line is a line segment length threshold, then the line containing the location coordinate is the next line segment after the interruption of the initial line.

[0100] Figure 13This is a diagram illustrating a break in the initial line. (Example:) Figure 14 As shown, since the next position coordinate point of point C is a white pixel, and there are no position coordinate points matching the pixel characteristics of the line in the upward and downward directions of point C, it indicates that BC has not turned. Therefore, the search continues to the right along the direction of BC. When points D or E are found, although the pixels of points D and E are both black pixels, their widths differ significantly from the width of the initial line, and their lengths are less than the line segment length threshold. Therefore, points D and E are not the next line segment after the initial line was interrupted. After finding point E, the search continues to the right until point F is reached. Since the pixels of point F are black pixels, the width of the line containing point F is the same as the width of the initial line, and the search distance from point F is the line segment length threshold, it can be determined that the line containing point F is the next line segment after the initial line was interrupted. It should be noted that the widths of points D and E represent the vertical distances.

[0101] After determining the next segment of the line after the initial line is interrupted, the search continues along that segment. The process can be referred to the embodiment corresponding to the method for obtaining the second component described above, and will not be repeated in the embodiments of this application.

[0102] This application provides a method for determining whether a starting line has a bend or interruption. The method involves acquiring pixels around a location coordinate point and determining whether these pixels conform to line pixel characteristics. If the pixels around the location coordinate point conform to the line pixel characteristics, the starting line has a bend, and the line after the bend can be searched. If the pixels around the location coordinate point do not conform to the line pixel characteristics, the starting line is interrupted. When the starting line is interrupted, the next segment of the line after the interruption is searched. The method provided in this application can determine whether a starting line has a bend or interruption by using pixels around a location coordinate point, thereby identifying lines in the pixel map of an automatic alarm system that have bends or interruptions, improving the accuracy of line identification in the pixel map of an automatic alarm system.

[0103] Figure 1 A schematic diagram of a line identification device for an automatic alarm system pixel map provided in this application embodiment. Figure 14 .like Figure 2 As shown in the figure, this application embodiment provides a line identification device 1400 for an automatic alarm system pixel map, which may include a component information reading module 1401, a starting line information acquisition module 1402, a component surrounding line search module 1403, and a semantic data generation module 1404.

[0104] The component information reading module 1401 is used to read component information drawn in the pixel map of the automatic alarm system. The component information includes the position information of the component.

[0105] The starting line information acquisition module 1402 is used to select any component in the pixel map of the automatic alarm system as the first component, and search for the starting line information of the first component based on the position information of the first component and the pixel information around the first component.

[0106] The component surrounding line search module 1403 is used to search for a second component that has a line connection relationship with the first component based on the starting line information of the first component, and to determine the line connection information between the first component and the second component.

[0107] The semantic data generation module 1404 is used to generate semantic data based on the component information and line connection information of the first component, so as to complete the identification of the line in the pixel map of the automatic alarm system.

[0108] The device in this embodiment can be used to perform, for example... Figure 6 , Figure 9 , Figure 11 and Figure 15 The method embodiments shown are similar in principle and technical effect, and will not be described again here.

[0109] Figure 2 A schematic diagram of a line identification device for an automatic alarm system pixel map provided in this application embodiment. Figure 15 .like Figure 15 As shown in the figure, this application embodiment provides a line identification device 1500 for an automatic alarm system pixel map, including a processor 1501 and a memory 1502, wherein the processor 1501 and the memory 1502 are connected through a bus 1503.

[0110] In the specific implementation process, the memory 1502 stores code, and the processor 1501 runs the code stored in the memory 1502 to execute the line identification method of the pixel map of the automatic alarm system in the above method embodiment.

[0111] The specific implementation process of processor 1501 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.

[0112] In the above ​In the illustrated embodiments, it should be understood that the processor 1501 can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.

[0113] The memory 1502 may include high-speed RAM memory, and may also include non-volatile memory NVM, such as at least one disk storage.

[0114] Bus 1503 can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Bus 1503 can be divided into address bus, data bus, control bus, etc. For ease of illustration, bus 1503 in the accompanying drawings of this application is not limited to only one bus or one type of bus.

[0115] This application provides a computer-readable storage medium storing computer-executable instructions. When executed by a processor, these instructions are used to implement the line identification method for the pixel map of the automatic alarm system described in the above method embodiment.

[0116] The aforementioned computer-readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to general-purpose or special-purpose computers.

[0117] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.

[0118] This application provides a computer program product, including a computer program that, when executed by a processor, implements the line identification method for pixel maps of an automatic alarm system provided in any of the embodiments described above.

[0119] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.

[0120] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.

Claims

1. A method for line identification of an automatic alarm system pixel map, characterized by, The method comprises the following steps: reading component information drawn in a pixel map of an automatic alarm system, wherein the component information comprises position information of the component; selecting any component in the pixel map of the automatic alarm system as a first component; searching for starting line information of the first component based on the position information of the first component and pixel information around the first component; searching for a second component having a line connection relationship with the first component according to the starting line information of the first component, and determining line connection information between the first component and the second component; generating semantic data according to the component information of the first component and the line connection information, so as to complete recognition of lines in the pixel map of the automatic alarm system; wherein the starting line information comprises width, direction, slope and position coordinates of a starting point of the starting line; the searching for the starting line information of the first component based on the position information of the first component and the pixel information around the first component comprises the following steps: searching for whether there is a line segment around the first component according to the pixel information around the first component based on the position information of the first component; if there is a line segment around the first component which meets a preset width and the width of the line segment does not change, the line segment is the starting line, and the width, direction and position coordinates of the starting point of the starting line are determined; calculating the slope of the starting line according to the position coordinates of the starting point and position coordinates of an ending point of the starting line.

2. The method of claim 1, wherein, After the reading of the component information drawn in the pixel map of the automatic alarm system, the method further comprises the following steps: performing fine processing on the position information of the first component to obtain accurate position information of the first component in the pixel map of the automatic alarm system.

3. The method of claim 2, wherein, The component information further comprises a name of the component; the fine processing on the position information of the first component to obtain the accurate position information of the first component in the pixel map of the automatic alarm system comprises the following steps: judging the shape of the first component according to the name of the first component, and reading pixel information of the first component; adjusting the position information of the first component according to the shape of the first component and the pixel information of the first component to obtain the accurate position information of the first component in the pixel map of the automatic alarm system.

4. The method of claim 1, wherein, The searching for the second component having a line connection relationship with the first component according to the starting line information of the first component comprises the following steps: starting searching from the position coordinates of the starting point along the direction and slope of the starting line to obtain the second component having a line connection relationship with the first component.

5. The method of claim 4, wherein, The starting searching from the position coordinates of the starting point along the direction and slope of the starting line to obtain the second component having a line connection relationship with the first component comprises the following steps: calculating a next position coordinate point in the starting line which is different from a position coordinate point which has been searched for according to the direction and slope of the starting line, and reading pixel information of the position coordinate point; judging whether the position coordinate point is located on the starting line according to the pixel information of the position coordinate point; If the position coordinate point is located on the starting line, judging whether the position coordinate point is inside or at the edge of the second component according to position information of the second component; If the position coordinate point is inside or at the edge of the second component, the second component has a line connection relationship with the first component.

6. The method of claim 5, wherein, The step of judging whether the position coordinate point is located on the starting line according to pixel information of the position coordinate point further includes: If the position coordinate point is not located on the starting line, determining that the starting line is bent or interrupted; If the starting line is bent, searching for a line after the starting line is bent; or if the starting line is interrupted, searching for a next line after the starting line is interrupted.

7. The method of claim 6, wherein, The step of determining that the starting line is bent or interrupted includes: acquiring pixels in other directions than the direction of the starting line of the position coordinate point, and judging whether there is a position coordinate point meeting line pixel characteristics; If there is the position coordinate point meeting the line pixel characteristics, the starting line is bent along the direction of the position coordinate point meeting the line pixel characteristics; If there is no position coordinate point meeting the line pixel characteristics, the starting line is interrupted.

8. The method of claim 7, wherein, The step of searching for a next line after the starting line is interrupted includes: searching for a position coordinate point meeting the line pixel characteristics along the direction of the starting line; If there is the position coordinate point meeting the line pixel characteristics, the line on which the position coordinate point is located is the next line after the starting line is interrupted.

9. A line identification device for an automatic alarm system pixel map, characterized in that The method includes: a component information reading module, configured to read component information drawn in a pixel map of an automatic alarm system, wherein the component information includes position information of a component; a starting line information acquisition module, configured to select any component in the pixel map of the automatic alarm system as a first component, and search for starting line information of the first component based on position information of the first component and pixel information around the first component; the starting line information includes width, direction, slope and position coordinates of a starting point of the starting line; a component surrounding line searching module, configured to search for a second component having a line connection relationship with the first component according to the starting line information of the first component, and determine line connection information between the first component and the second component; a semantic data generation module, configured to generate semantic data according to the component information of the first component and the line connection information, so as to complete recognition of lines in the pixel map of the automatic alarm system; the starting line information acquisition module is specifically configured to search whether there is a line segment around the first component based on the position information of the first component and the pixel information around the first component. If there is a line segment with a preset width around the first component and the width of the line segment does not change, the line segment is a starting line, and the width, direction and starting point coordinates of the starting line are determined; and the slope of the starting line is calculated according to the starting point coordinates and the end point coordinates of the starting line.

10. A line identification device for an automatic alarm system pixel map, comprising: A processor and a memory, the memory storing codes, the processor executing the codes stored in the memory to perform the line identification method of the pixel graph of the automatic alarm system according to any one of claims 1-8.

11. A computer readable storage medium, characterized in that, The computer readable storage medium stores computer execution instructions, and the computer execution instructions are executed by the processor to implement the line identification method of the pixel graph of the automatic alarm system according to any one of claims 1-8.

12. A computer program product comprising a computer program which, when executed by a processor, implements the line identification method of the pixel graph of the automatic alarm system according to any one of claims 1-8.

Citation Information

Patent Citations

  • CAD drawing recognition method and device based on domain knowledge and target detection

    CN110909650A

  • Fire-fighting component numbering method and system for automatic fire alarm planar graph, intelligent terminal and storage medium

    CN111798649A